| name | sdk-adoption-tracker |
| description | Given your SDK or library name, searches GitHub code search for public repos that import or require it, classifies each repo as company org, affiliated developer, solo developer, or tutorial noise, scores by adoption signal strength, detects new adopters by date, and outputs a ranked list of who is building on you with outreach context per high-signal company. Use when asked to find who uses your SDK, track SDK adoption, find companies building on your library, identify warm leads from existing SDK users, or see which orgs import your package. Trigger when a user says "who is using my SDK", "find repos that import my library", "track adoption of my package", "which companies are building on my SDK", "find my SDK users on GitHub", or "show me who imports my package". |
| compatibility | ["claude-code","gemini-cli","github-copilot"] |
SDK Adoption Tracker
Take an SDK name. Search GitHub for public repos that import it. Score each repo by company signal, activity, and noise indicators. Enrich high-signal repos with owner and contributor data. Output a ranked adoption report with outreach context for company adopters.
Critical rule: Every repo in the output must exist in the GitHub code search API response. Every company name must come from the GitHub user or org API company or name field. Every contributor handle must come from the GitHub contributors API response. If any field is empty in the API, write "not listed" -- do not infer, guess, or extrapolate.
Common Mistakes
| The agent will want to... | Why that's wrong |
|---|
| Run code search without GITHUB_TOKEN | Unauthenticated code search hits a 3 req/min secondary rate limit and fails on any meaningful scan. GITHUB_TOKEN is required. Stop at Step 1 with a clear error if it is missing. |
| Include forks of the SDK itself | Repos that fork the SDK are contributors or mirrors, not adopters. Filter out repos where fork == true AND the repo name matches the SDK name. |
| Send all 500 raw search results to the AI | Code search can return up to 500 results, most of which are noise. Filter and score locally first. Send only the top 20 high-signal repos to the AI analysis step. |
| Report tutorial and example repos as adopters | Repos with "example", "tutorial", "demo", "learn", "sample", "playground", "starter" in the name or description are not production users. Mark as tutorial_noise and exclude from lead briefs. |
| Invent company names or contact handles | Every company name must come from the GitHub company or org name field. Every contributor handle must come from the contributors API response. If a field is empty, write "not listed". |
| Use one import pattern for all ecosystems | require('sdk') will not find Python users. Auto-detect ecosystem from the SDK name and build ecosystem-specific patterns. Ask the user if auto-detection is ambiguous. |
Step 1: Setup Check
if [ -z "$GITHUB_TOKEN" ]; then
echo "ERROR: GITHUB_TOKEN is required for code search."
echo "Add a token at github.com/settings/tokens (no scopes needed for public repos)."
echo "Without it, GitHub code search hits a 3 req/min secondary rate limit and fails."
exit 1
fi
echo "GITHUB_TOKEN: set"
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/rate_limit" | python3 -c "
import json, sys
d = json.load(sys.stdin)
search = d['resources']['search']
core = d['resources']['core']
print(f'Search rate: {search[\"remaining\"]}/{search[\"limit\"]} remaining')
print(f'Core rate: {core[\"remaining\"]}/{core[\"limit\"]} remaining')
"
If search remaining is 0: stop. Tell the user the reset time from X-RateLimit-Reset.
Step 2: Gather Input
Collect from the conversation:
- SDK name (e.g.
@company/my-sdk, requests, github.com/org/go-sdk)
- Optional: ecosystem override (
npm, python, go, gem) -- auto-detected if not provided
- Optional: org/user to exclude from results (the SDK owner's own repos)
- Optional: product context string (used to personalize outreach messages)
Auto-detect ecosystem:
- Starts with
@ or contains -: npm
- snake_case with no
/ or -: python
- Contains
github.com/: go
- Otherwise: ask the user
If no SDK name is provided: Ask: "Which SDK or library would you like to track? Provide the package name as it appears in import statements (e.g. stripe, @clerk/nextjs, requests)."
python3 << 'PYEOF'
import json, sys, re
sdk_name = "SDK_NAME_HERE"
ecosystem_override = ""
exclude_owner = ""
product_context = ""
if ecosystem_override:
ecosystem = ecosystem_override
elif sdk_name.startswith("@") or "-" in sdk_name:
ecosystem = "npm"
elif re.match(r'^[a-z][a-z0-9_]*$', sdk_name):
ecosystem = "python"
elif "github.com/" in sdk_name:
ecosystem = "go"
else:
ecosystem = "generic"
print(f"SDK: {sdk_name}")
print(f"Ecosystem: {ecosystem}")
print(f"Exclude owner: {exclude_owner or '(none)'}")
with open("/tmp/sat-input.json", "w") as f:
json.dump({
"sdk_name": sdk_name,
"ecosystem": ecosystem,
"exclude_owner": exclude_owner,
"product_context": product_context
}, f)
PYEOF
Step 3: Search GitHub Code
Check for standalone script first -- it handles Steps 3-5 in one call.
ls scripts/fetch.py 2>/dev/null && echo "script available" || echo "script not found"
If the script is available, run it and skip to Step 6:
python3 scripts/fetch.py "$(python3 -c "import json; d=json.load(open('/tmp/sat-input.json')); print(d['sdk_name'])")" \
--ecosystem "$(python3 -c "import json; d=json.load(open('/tmp/sat-input.json')); print(d['ecosystem'])")" \
--exclude "$(python3 -c "import json; d=json.load(open('/tmp/sat-input.json')); print(d.get('exclude_owner',''))")" \
--output /tmp/sat-script-out.json
Then load into the temp file format Steps 6-8 expect:
python3 << 'PYEOF'
import json
out = json.load(open("/tmp/sat-script-out.json"))
json.dump(out["raw_results"], open("/tmp/sat-raw-results.json", "w"), indent=2)
json.dump(out["scored"], open("/tmp/sat-scored.json", "w"), indent=2)
json.dump(out["enriched"], open("/tmp/sat-enriched.json", "w"), indent=2)
print(f"Loaded: {len(out['raw_results'])} raw | {len(out['scored'])} scored | {len(out['enriched'])} enriched")
PYEOF
If the script is not available, run the inline code below.
Build import patterns and search GitHub code for each:
python3 << 'PYEOF'
import json, urllib.request, ssl, time, os
from datetime import datetime, timezone
ctx = ssl._create_unverified_context()
token = os.environ["GITHUB_TOKEN"]
headers = {
"Accept": "application/vnd.github+json",
"Authorization": f"Bearer {token}",
"User-Agent": "sdk-adoption-tracker/1.0"
}
data = json.load(open("/tmp/sat-input.json"))
sdk_name = data["sdk_name"]
ecosystem = data["ecosystem"]
if ecosystem == "npm":
bare = sdk_name.lstrip("@").replace("/", "/")
queries = [
f'require("{sdk_name}")',
f"require('{sdk_name}')",
f'from "{sdk_name}"',
f"from '{sdk_name}'",
]
elif ecosystem == "python":
queries = [
f"import {sdk_name}",
f"from {sdk_name} import",
f"from {sdk_name}.",
]
elif ecosystem == "go":
queries = [f'"{sdk_name}"']
else:
queries = [sdk_name]
print(f"Building queries for {sdk_name} ({ecosystem}):")
for q in queries:
print(f" {q}")
seen_repos = {}
search_rate_remaining = 30
flags = []
for i, query in enumerate(queries):
if search_rate_remaining <= 2:
flags.append(f)
(f)
url = f
req = urllib.request.Request(url, headers=headers)
try:
with urllib.request.urlopen(req, =20, context=ctx) as resp:
search_rate_remaining = int(resp.headers.get(, 10))
raw = json.loads(resp.read())
items = raw.get(, [])
total = raw.get(, 0)
(f)
item items:
repo = item.get(, {})
full_name = repo.get(, )
full_name and full_name not seen_repos:
seen_repos[full_name] = {
: full_name,
: repo.get(, ),
: repo.get(, {}).get(, ),
: repo.get(, {}).get(, ),
: item.get(, ),
: query,
: repo.get(, ),
: repo.get() or ,
}
except urllib.error.HTTPError as e:
e.code == 403:
flags.append(f)
(f)
:
(f)
except Exception as e:
(f)
i < len(queries) - 1:
time.sleep(6)
results = list(seen_repos.values())
json.dump(results, open(, ), indent=2)
(f)
flags:
(, flags)
import urllib.parse
PYEOF
If 0 results: Tell the user: "No repos found importing {sdk_name}. GitHub code search indexing takes 1-4 weeks for new packages. If the SDK is established, check the import patterns in references/import-patterns.md."
Step 4: Score and Classify Repos
No API call. Pure Python. Filter noise, compute adoption score, classify each repo.
python3 << 'PYEOF'
import json
from datetime import datetime, timezone
data = json.load(open("/tmp/sat-input.json"))
exclude_owner = data.get("exclude_owner", "").lower()
sdk_name = data["sdk_name"].lower().split("/")[-1].replace("@", "")
results = json.load(open("/tmp/sat-raw-results.json"))
TUTORIAL_WORDS = {"example", "tutorial", "demo", "learn", "sample", "starter",
"boilerplate", "template", "playground", "test", "course", "workshop"}
scored = []
now = datetime.now(tz=timezone.utc)
for repo in results:
full_name = repo["full_name"]
owner_login = repo.get("owner_login", "").lower()
repo_name = repo.get("name", "").lower()
description = (repo.get("description") or "").lower()
owner_type = repo.get("owner_type", "User")
if exclude_owner and owner_login == exclude_owner.lower():
continue
name_words = set(repo_name.replace("-", " ").replace("_", " ").split())
desc_words = set(description.split())
is_tutorial = bool((name_words | desc_words) & TUTORIAL_WORDS)
# Also exclude if repo name IS the SDK name (likely a fork)
if repo_name == sdk_name or repo_name.startswith(sdk_name + "-"):
is_tutorial = True # treat as noise
# Classification tier
if is_tutorial:
tier = "tutorial_noise"
elif owner_type == "Organization":
tier = "company_org"
else:
tier = "solo_dev" # will be upgraded to affiliated_dev in Step if company field populated
# Adoption score (filled with partial data now, enriched in Step )
score =
if owner_type == "Organization": score +=
if not is_tutorial: score +=
# stars, days_since_push, is_fork, is_archived added in Step
scored.append({
**repo,
"tier": tier,
"is_tutorial": is_tutorial,
"adoption_score": score,
"enriched": False
})
# Sort: company_org first, then by tier
tier_order = {"company_org": , "affiliated_dev": , "solo_dev": , "tutorial_noise": }
scored.sort(key=lambda x: (tier_order.get(x["tier"], ), -x["adoption_score"]))
json.dump(scored, open(, ), indent=2)
tiers = {}
r scored:
tiers[r[]] = tiers.get(r[], 0) + 1
(f)
tier, count sorted(tiers.items(), key=lambda x: tier_order.get(x[0], 9)):
(f)
(f)
non_noise = [r r scored r[] != ]
(f)
r non_noise[:5]:
(f)
PYEOF
If all repos are tutorial_noise: Stop. Tell the user: "All repos found appear to be tutorials or examples. No production adopters detected in public GitHub. The SDK may be too new, or the package name is generic enough that search results are dominated by examples."
Step 5: Enrich High-Signal Repos
Fetch full repo metadata, owner profile, and top contributors for non-noise repos. Skip tutorial_noise repos entirely.
python3 << 'PYEOF'
import json, urllib.request, ssl, os, time
from datetime import datetime, timezone
ctx = ssl._create_unverified_context()
token = os.environ["GITHUB_TOKEN"]
headers = {
"Accept": "application/vnd.github+json",
"Authorization": f"Bearer {token}",
"User-Agent": "sdk-adoption-tracker/1.0"
}
scored = json.load(open("/tmp/sat-scored.json"))
core_remaining = 5000
flags = []
def gh_get(path):
global core_remaining
req = urllib.request.Request(f"https://api.github.com{path}", headers=headers)
try:
with urllib.request.urlopen(req, timeout=15, context=ctx) as resp:
remaining = resp.headers.get("X-RateLimit-Remaining")
if remaining:
core_remaining = int(remaining)
return json.loads(resp.read())
except urllib.error.HTTPError as e:
if e.code == 404:
return None
raise
except Exception:
return None
target = [r for r in scored if r["tier"] != "tutorial_noise"]
print(f"Enriching {len(target)} repos (skipping tutorial_noise)...")
enriched = []
for item in target:
full_name = item["full_name"]
owner_login = item["owner_login"]
owner_type = item["owner_type"]
if core_remaining <= 10:
flags.append(f"Core rate limit low ({core_remaining}) -- skipped enrichment for {full_name} and remaining repos")
enriched.append({**item, "enriched": False})
continue
repo_data = gh_get(f)
not repo_data:
(f)
stars = repo_data.get(, 0)
is_fork = repo_data.get(, False)
is_archived = repo_data.get(, False)
language = repo_data.get() or
description = repo_data.get() or item.get(, )
pushed_at = repo_data.get() or
created_at = repo_data.get() or
repo_url = repo_data.get(, f)
days_since_push = 999
pushed_at:
pushed_dt = datetime.fromisoformat(pushed_at.replace(, ))
days_since_push = (datetime.now(tz=timezone.utc) - pushed_dt).days
days_since_created = 999
created_at:
created_dt = datetime.fromisoformat(created_at.replace(, ))
days_since_created = (datetime.now(tz=timezone.utc) - created_dt).days
owner_profile = {}
company =
org_website =
owner_type == :
org_data = gh_get(f)
org_data:
company = org_data.get() or owner_login
org_website = org_data.get() or
owner_profile = {
: ,
: org_data.get() or owner_login,
: org_data.get() or ,
: org_website,
: org_data.get() or ,
: org_data.get(, 0),
: org_data.get(, 0),
}
:
user_data = gh_get(f)
user_data:
company = user_data.get() or
owner_profile = {
: ,
: user_data.get() or owner_login,
: company,
: user_data.get() or ,
: user_data.get() or ,
: user_data.get(, 0),
: user_data.get() or ,
}
company and item[] == :
item[] =
top_contributors = []
core_remaining > 20:
contributors = gh_get(f)
contributors:
top_contributors = [
{: c.get(, ), : c.get(, 0)}
c contributors[:3]
]
score = 0
owner_type == : score += 50
company and company.strip(): score += 20
score += min(stars, 500) / 10
days_since_push < 30: score += 30
days_since_push < 7: score += 20
not is_fork: score += 10
not is_archived: score += 10
not item.get(, False): score += 20
tier = item[]
is_archived or is_fork:
tier = item.get() tier
enriched_item = {
**item,
: description,
: stars,
: language,
: is_fork,
: is_archived,
: days_since_push,
: days_since_created,
: pushed_at,
: created_at,
: repo_url,
: tier,
: round(score, 1),
: company,
: org_website,
: owner_profile,
: top_contributors,
: True,
}
enriched.append(enriched_item)
(f
f
f)
time.sleep(0.1)
enriched.sort(key=lambda x: -x[])
json.dump(enriched, open(, ), indent=2)
(f)
flags:
f flags:
(f)
PYEOF
Step 6: Generate Adoption Briefs
Print top adopters, then generate outreach briefs for high-signal company repos.
python3 << 'PYEOF'
import json
from datetime import datetime, timezone
enriched = json.load(open("/tmp/sat-enriched.json"))
data = json.load(open("/tmp/sat-input.json"))
product_context = data.get("product_context", "")
sdk_name = data["sdk_name"]
high_signal = [r for r in enriched if r["adoption_score"] >= 80]
medium = [r for r in enriched if 40 <= r["adoption_score"] < 80]
noise = [r for r in enriched if r["adoption_score"] < 40 or r["tier"] == "tutorial_noise"]
print("=== DATA FOR ADOPTION BRIEF GENERATION ===")
print(f"SDK: {sdk_name}")
print(f"Product context: {product_context or '(none provided)'}")
print()
for item in (high_signal + medium)[:20]:
prof = item.get("owner_profile", {})
contribs = item.get("top_contributors", [])
primary = contribs[0] if contribs else {}
print(f"REPO: {item['full_name']} (tier={item['tier']}, score={item['adoption_score']})")
print(f" Stars: {item.get('stars', 0)} | Language: {item.get('language','?')} | "
f"Pushed: {item.get('days_since_push', '?')} days ago")
print(f" Description: {item.get('description','none')}")
print(f" SDK found in: {item.get('file_path','?')}")
(f)
prof.get() == :
(f
f)
prof.get() == :
(f
f
f)
primary:
(f)
()
PYEOF
Using the repo data printed above, generate an adoption brief for each HIGH-SIGNAL repo (score >= 80).
Rules:
- Every repo name, star count, and file path must come from the printed data -- do not modify
- Every contributor handle must come from the printed "Top contributor" line -- if none listed, write "not listed"
- Every company name must come from the printed "Company" or "Org" line -- if "not listed", write "not listed"
- "Why reach out" must reference specific signals from the data (score, stars, days since push, company)
- "Suggested message" must name the repo, the specific file where the SDK was found, and connect to product_context if provided
- No em dashes. No forbidden words: powerful, robust, seamless, innovative, game-changing, streamline, leverage, transform
Write your briefs to /tmp/sat-briefs.json with this structure:
{
"adoption_briefs": [
{
"repo": "owner/repo-name",
"tier": "company_org",
"adoption_score": 124.0,
"company": "Company Name or not listed",
"top_contributor": "@handle or not listed",
"twitter": "@handle or not listed",
"stars": 234,
"language": "TypeScript",
"sdk_file": "src/api/client.ts",
"why_reach_out": "2-3 sentences specific to this repo's signals",
"suggested_message": "2-4 sentences naming the repo, SDK file, and product_context connection"
}
]
}
After writing, confirm:
python3 -c "
import json
d = json.load(open('/tmp/sat-briefs.json'))
print(f'Briefs generated: {len(d.get(\"adoption_briefs\", []))}')
for b in d['adoption_briefs']:
print(f' {b[\"repo\"]} ({b[\"tier\"]}): score={b[\"adoption_score\"]} company={b[\"company\"]}')
"
Step 7: Self-QA
python3 << 'PYEOF'
import json
raw = json.load(open("/tmp/sat-raw-results.json"))
enriched = json.load(open("/tmp/sat-enriched.json"))
briefs = json.load(open("/tmp/sat-briefs.json"))
failures = []
raw_full_names = {r["full_name"] for r in raw}
for brief in briefs.get("adoption_briefs", []):
if brief.get("repo") not in raw_full_names:
failures.append(f"Brief for unknown repo '{brief.get('repo')}' not in code search results -- removed")
briefs["adoption_briefs"] = [
b for b in briefs.get("adoption_briefs", []) if b.get("repo") in raw_full_names
]
scores = [b["adoption_score"] for b in briefs.get("adoption_briefs", [])]
if scores != sorted(scores, reverse=True):
briefs["adoption_briefs"].sort(key=lambda x: -x["adoption_score"])
failures.append("Re-sorted briefs by adoption_score descending")
briefs_str = json.dumps(briefs)
if "—" in briefs_str:
briefs_str = briefs_str.replace("—", " - ")
briefs = json.loads(briefs_str)
failures.append("Fixed: em dash characters removed from briefs")
forbidden = ["powerful", , , , ,
, , , ]
full_text = json.dumps(briefs).lower()
word forbidden:
word full_text:
failures.append(f)
brief briefs.get(, []):
field [, , , , ,
, ]:
brief.get(field) is None:
failures.append(f)
output = {
: enriched,
: briefs,
: failures
}
json.dump(output, open(, ), indent=2)
(f)
f failures:
(f)
not failures:
()
PYEOF
Step 8: Save and Present Output
python3 << 'PYEOF'
import json, os
from datetime import datetime, timezone
output = json.load(open("/tmp/sat-output.json"))
enriched = output["enriched"]
briefs_map = {b["repo"]: b for b in output["briefs"].get("adoption_briefs", [])}
flags = output["data_quality_flags"]
data = json.load(open("/tmp/sat-input.json"))
sdk_name = data["sdk_name"]
date_str = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d")
high_signal = [r for r in enriched if r["adoption_score"] >= 80]
medium = [r for r in enriched if 40 <= r["adoption_score"] < 80]
noise = [r for r in enriched if r["adoption_score"] < 40 or r["tier"] == "tutorial_noise"]
new_7d = sum(1 for r in enriched if r.get("days_since_created", 999) <= 7)
new_30d = sum(1 for r in enriched if r.get("days_since_created", 999) <= 30)
slug = sdk_name.replace("@", "").replace("/", "-")
prev_repos = set()
prev_path = f"docs/sdk-adopters/"
if os.path.isdir(prev_path):
import glob
prev_files = sorted(glob.glob(f))
prev_files:
try:
prev_data = json.load(open(prev_files[-1]))
prev_repos = {r[] r prev_data.get(, [])}
except Exception:
pass
new_since_last = len({r[] r enriched} - prev_repos) prev_repos None
tier_counts = {}
r enriched:
tier_counts[r[]] = tier_counts.get(r[], 0) + 1
lines = [
f,
f
f,
,
,
,
,
f,
f,
]
new_since_last is not None:
lines.append(f)
lines += [, , ]
high_signal or medium:
lines += [, ]
lines += [
,
,
]
i, r enumerate((high_signal + medium)[:], ):
pushed_label = f"{r.get('days_since_push','?')}d ago"
lines.append(
f"| {i} | [{r['full_name']}]({r.get('repo_url', '')}) | "
f"{r.get('stars',):,} | {r['tier']} | {r['adoption_score']} | "
f"{pushed_label} | {r.get('language','?')} |"
)
lines += ["", "---", ""]
if high_signal:
lines += ["### Adoption Briefs (score >= )", ""]
for r in high_signal:
brief = briefs_map.get(r["full_name"], {})
prof = r.get("owner_profile", {})
lines.append(f"#### {r['full_name']} [score: {r['adoption_score']}]")
lines.append(f"Owner: {r['owner_login']} ({r['owner_type']})")
lines.append(f"Stars: {r.get('stars',):,} | Language: {r.get('language','?')} | "
f"Last pushed: {r.get('days_since_push','?')} days ago")
if r.get("description"):
lines.append(f"What they're building: {r['description']}")
lines.append(f"SDK found in: {r.get('file_path','?')}")
if r.get("company") and r["company"] != "not listed":
lines.append(f"Company: {r['company']}")
if r.get("org_website"):
lines.append(f"Website: {r['org_website']}")
contribs = r.get("top_contributors", [])
if contribs:
lines.append(f"Top contributor: @{contribs[]['login']} ({contribs[]['contributions']} commits)")
lines.append("")
if brief.get("why_reach_out"):
lines.append(f"**Why reach out:** {brief['why_reach_out']}")
if brief.get("suggested_message"):
lines.append(f"\n**Suggested message:**")
lines.append(f"> {brief['suggested_message']}")
lines += ["", "---", ""]
lines += [
"### Adoption Breakdown",
"",
"| Tier | Count |",
"|---|---|",
]
for tier in ["company_org", "affiliated_dev", "solo_dev", "tutorial_noise"]:
count = tier_counts.get(tier, )
lines.append(f"| {tier} | {count} |")
lines += ["", "---", ""]
lines.append(f"Data quality notes: {'; '.join(flags) if flags else 'None'}")
output_dir = f"docs/sdk-adopters"
os.makedirs(output_dir, exist_ok=True)
md_path = f"{output_dir}/{slug}-{date_str}.md"
json_path = f"{output_dir}/{slug}-{date_str}.json"
open(md_path, "w").write("\n".join(lines))
json.dump({: enriched, : output[]}, open(json_path, ), indent=2)
(.(lines))
(f)
(f)
PYEOF
Clean up temp files:
rm -f /tmp/sat-input.json /tmp/sat-raw-results.json /tmp/sat-scored.json \
/tmp/sat-enriched.json /tmp/sat-briefs.json /tmp/sat-output.json