/kargnas-skills:oss-finderfrom kargnas-skills
Finds battle-tested open-source repos and code on GitHub, ranked by README polish-days instead of stars. Also provides a shared GitHub code-search backend with rotating PAT pool, grep.app, Blackbird web index, BigQuery/GHArchive, and fallback chain.
Ships in kargnas-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
ONE SENTENCE: Find battle-tested OSS on GitHub (or run any GitHub-wide code search) and rank by how many distinct days a human iterated on the target file — not by stars.
All paths below are relative to this skill's directory (the one containing this SKILL.md).
Run this every time the skill is invoked, before launching any backend or script:
python3 scripts/gh_pool.py --check
| Exit | Meaning | What to do |
|---|---|---|
0 (READY) | PAT pool loaded AND gh CLI authenticated (plain gh, or the signed-in gh-profile profiles it lists) | Continue. |
1 (SETUP NEEDED) | PAT pool missing, and/or gh not logged in | STOP. Do not run any search. Tell the user exactly what is missing and ask whether to set it up now. Walk them through the setup below, re-run the check, and continue only on exit 0. |
Both bundled scripts refuse to run without PATs (they print the same setup hint and exit 2). There is no anonymous path: anonymous GitHub search (60 req/h) cannot finish a single polish-day sweep. A gh login feeds the pool only when gh keeps its token in a hosts.yml file (GH_CONFIG_ROOT below), not in the system keyring.
| Constant | Value | Purpose |
|---|---|---|
PAT_CONFIG_FILES | ~/.config/kargnas/skill-finder.env, ~/.config/kargnas/oss-finder.env | Local GitHub PAT pool files read by scripts/gh_pool.py. Both are read and merged (a PAT in both counts once), so either file works. Keep them untracked. |
GH_CONFIG_ROOT | ~/.config/gh | gh's own logins also join the pool: hosts.yml there and in each <profile>/ subdirectory, the per-account layout the gh-profile wrapper selects through GH_CONFIG_DIR. Only one token per GitHub login joins, because one login's tokens share a quota. |
mkdir -p ~/.config/kargnas
printf '%s=%s\n' GH_PAT_1 'github_pat_...' GH_PAT_2 'ghp_...' > ~/.config/kargnas/oss-finder.env
chmod 600 ~/.config/kargnas/oss-finder.env
public_repo on classic tokens).GH_PAT_<n> environment variables extend the pool at runtime.gh auth login is still required for the inline gh search / gh api steps below (5000 req/h core quota vs 60 anonymous). Where plain gh has no login on purpose but the gh-profile wrapper has signed-in profiles (the cumora computer), Step 0 passes and lists those profiles: run each inline gh step as gh-profile <profile> gh ....python3 scripts/gh_pool.py /rate_limit prints the current PAT's quota; repeated calls rotate PATs.| Signal | Why insufficient |
|---|---|
| Stars | Hype-driven. A trending repo gets 10k stars in a week with one commit. |
| Install / download count | Often = "bundled in a famous repo", not quality. |
| Total commit count | An AI session generates 30 commits in 1 hour. |
| Unique edit DAYS on the target file | A human comes back tomorrow and tweaks. AI bursts can't fake it. |
A 0-star repo with 30 polish-days is more battle-tested than an 18k-star repo with 8 polish-days. Same-UTC-day burst commits collapse to 1 polish day.
| Script | Target file | Ranks by | Use for |
|---|---|---|---|
scripts/repo_finder.py | README.md | README polish-days (falls back to pushed_at × stars when README commits are unavailable) | general repos / libraries / frameworks / CLI tools — the headline use |
scripts/finder.py | SKILL.md | SKILL.md polish-days | GitHub-wide SKILL.md discovery — the skill-finder skill delegates its sweep here, then applies skill-specific quality gates |
Both import scripts/gh_pool.py (the rotating PAT pool) as a sibling. All three ship in this skill's scripts/ dir. Results are cached under ~/.cache/oss-finder/.
repo_finder.pyTrigger phrases: "라이브러리 찾아줘", "프레임워크 추천", "CLI 도구", "library for", "framework for", "tool for X", "battle-tested X".
python3 scripts/repo_finder.py \
--query "discord bot framework" \
--variants "discord.js" "discordpy" \
--language Python --min-stars 10 \
--top 15 --workers 6
Smoke test: --query "discord bot framework" --top 5 should put long-iterated frameworks such as wechaty/wechaty, AstrBotDevs/AstrBot, koishijs/koishi at the top — battle-tested winners, not star-leaders.
Ranking: README.md polish-days descending; when the commits API can't be fetched, demote to (pushed_at recency × stars) and mark the row ⚠️.
VERIFY: Output shows a markdown table where the top rows are ≥🔧 iterated tier, not merely the highest-star repos. Cache lands at ~/.cache/oss-finder/repos-{slug}.json.
finder.pyskill-finder owns the SKILL.md evaluation workflow ([S-DIFF] semantic-diff, depth checks, social review, report) but delegates the raw GitHub sweep here:
python3 scripts/finder.py \
--query "{PRIMARY_TERM}" --variants {VARIANT_1} {VARIANT_2} {VARIANT_3} \
--top 15 --max-candidates 30 --per-query 12 --workers 6
Pass each variant as a separate argument. Output: a polish-day-ranked SKILL.md table; cache at ~/.cache/oss-finder/{slug}.json.
On any exhaustive discovery request, fire these backends at the same level, in parallel (async) as the first action. This is NOT a fallback chain — do NOT run one, check it, then try the next. Launch concurrently, union every result into one candidate pool, then rank by polish-days. Sequential search undercounts the long tail and is slow.
| Backend | Tool | Role in the pool |
|---|---|---|
| GH-API | scripts/finder.py / repo_finder.py (wrap the gh search code / repo-search sweep) | candidate pool + polish-day ranking |
| GH-WEB | cloakbrowser → github.com/search (Blackbird) | repos the REST API index cannot see |
| GREP-APP | headless browser → grep.app/search | multi-language exact-token hits |
| PAT-POOL | scripts/gh_pool.py PAT round-robin | GH-API throughput boost (≈90 req/min with 3 tokens) |
BIGQUERY (BigQuery) and GHARCHIVE (GHArchive) are NOT in the default parallel batch. Add them opt-in ONLY when the user explicitly asks for full-corpus grep or brand-new-repo (created-today) discovery.
Precondition not met — ASK the user, never silent-skip (MUST): if a backend lacks its key, cookie, or auth, MUST NOT drop it quietly. GH-API / PAT-POOL are covered by Step 0; the others:
| Backend | Missing precondition | Tell the user + collect |
|---|---|---|
| GH-WEB | no login cookie/profile at ~/.cloakbrowser-profiles/github/ | "GitHub login cookie missing" → ask them to log in once via cloakbrowser headless=False |
| GREP-APP | network or browser launch fails | report the actual error → ask whether to retry |
VERIFY [S-PAR]: before printing any candidate table, all applicable backends launched concurrently (or paused for user input on an unmet precondition) and each backend's raw candidate count is reported. A pool built from a single backend violates this gate.
nameWithOwner is the CORRECT jq key — .repository.fullName returns null, do NOT use it:
for q in "{VARIANT_1}" "{VARIANT_2}" "{VARIANT_3}" "{VARIANT_4}"; do
gh search code "$q" --filename SKILL.md --limit 100 --json repository,path \
--jq '.[] | "\(.repository.nameWithOwner)\t\(.path)"'
done | sort -u > /tmp/pool.txt
(For general repos, use gh search repos / repo_finder.py instead of the --filename code sweep.)
zsh GOTCHA (MUST follow): NEVER name a shell variable path inside these loops. In zsh $path is bound to $PATH; assigning it wipes $PATH and every external command (sort, wc, cut, basename) dies with command not found, silently zeroing the enumeration pass. Use pth or p.
| Backend ID | Backend | Coverage | Freshness | Rate limit | Notes |
|---|---|---|---|---|---|
GH-API | gh search code/repos | GitHub REST API index (SUBSET of Web UI) | near real-time | 30 req/min hard | First serious sweep. ⚠️ REST API uses a DIFFERENT, SMALLER index than the Web UI's Blackbird engine. Repos visible on github.com may return 0 from the API. NEVER treat API-only results as exhaustive. |
GH-WEB | cloakbrowser persistent profile → github.com/search?q=...&type=code | Full Blackbird index | real-time | none | MANDATORY — always run alongside GH-API. Uses ~/.cloakbrowser-profiles/github/. Navigate to https://github.com/search?q={urlencoded}&type=code, wait_until='domcontentloaded', parse document.body.innerText. Catches low-star repos invisible to REST. |
GREP-APP | grep.app via headless browser | grep.app's own crawl | weeks-stale | none | Multi-language exact-token search. Curl blocked by Vercel 429 — navigate https://grep.app/search?q=... in a browser. |
PAT-POOL | scripts/gh_pool.py round-robin | same as GH-API | real-time | 30 req/min × N tokens | When you need GH-API throughput but exceeded the limit. |
BIGQUERY | BigQuery bigquery-public-data:github_repos | full public GitHub | weekly snapshot | pay-per-TB (~$0.30–$2/query) | Bulk pattern search. Needs gcloud auth application-default login. Free tier: 1 TB/month. |
GHARCHIVE | GHArchive (githubarchive.day.* or direct .json.gz) | every public push/create/star event | ~1 hour lag | none (direct .gz) or pay-per-TB | "today's brand-new repos" — the ONLY way to catch fresh repos gh Search hasn't indexed. |
When gh search returns HTTP 403: API rate limit exceeded, GREP-APP is already running in the parallel batch — rely on it. Drive grep.app with your browser tool (navigate to https://grep.app/search?q=<url-encoded-query>); curl is blocked by the Vercel security checkpoint (429).
grep.app quirks:
slack "needs reply" returns 0 while slack unanswered returns hits. Use a single distinctive token first, then narrow with sidebar facets.bigquery-public-data.github_repos.files looks comprehensive but its lastModifiedTime can be years old:
bq show --format=prettyjson bigquery-public-data:github_repos.files 2>&1 | grep lastModifiedTime
# Convert ms epoch → date. Older than 6 months = NOT a current index → use the PAT pool instead.
bq query --dry_run --use_legacy_sql=false --format=prettyjson < query.sql 2>&1 | grep totalBytesProcessed
# bytes / 1e12 × $6.25/TB. Decide BEFORE running.
"Go ahead, spend it" is permission to spend, NOT permission to skip the freshness check. One-time setup: gcloud auth login && gcloud auth application-default login. If bq returns Reauthentication failed. cannot prompt during non-interactive execution, the user must run those two commands once interactively.
# All public repo-Create events for a given UTC hour (each .gz ~10-50 MB)
curl -sL "https://data.gharchive.org/$(date -u +%Y-%m-%d)-3.json.gz" | gunzip \
| jq -c 'select(.type=="CreateEvent" and .payload.ref_type=="repository")
| {repo:.repo.name, desc:.payload.description, actor:.actor.login, t:.created_at}'
GitHub Code Search caps each query at 1000 results (10 pages × 100). Partitioning is the only way past it — use path × size × date-range (or × language). stars: filtering does NOT work in Code Search (non-monotonic — the operator is ignored); filter by stars post-fetch via repos/{owner}/{repo} metadata instead.
ALWAYS run a cloakbrowser Blackbird pass, even when the REST API returns many results. The REST index is a smaller subset than the Web UI. For the setup recipe, the parse loop, and the REST-vs-Blackbird gap evidence, see references/github-blackbird-index-gap.md.
When gh search code rate-limits (30 req/min hard cap, NOT raised by paid plans), switch to grep.app / sourcegraph / the PAT pool. Full decision table: references/code-search-fallback.md.
scripts/gh_pool.py --check) before any backend or script; on SETUP NEEDED, MUST stop and ask the user to set up the PAT pool / gh auth login instead of searching without it. When Step 0 lists gh-profile profiles, MUST run every inline gh command as gh-profile <profile> gh ....gh (5000 req/h vs 60 anonymous) and collapse same-UTC-day commits to 1 polish day.gh api loops in conversation when the candidate set > 5.--cache for repeat searches within 24h.| Var | Meaning |
|---|---|
{PRIMARY_TERM} | The user's main topic in their original language |
{VARIANT_N} | One additional search variant (other language or synonym) |
{OWNER}/{REPO} | A GitHub repository identifier |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kargnas/skills --plugin kargnas-skills13 skills in this plugin
/ai-readyUse only when the user asks to make the repo AI-ready or AI-optimized (AGENTS.md migration, debugging/testing setup, docs). Do not run on your own./git-loreCaptures, queries, and configures decision context in native Git trailers. Use for non-trivial commit messages, decisions, rejected alternatives, follow-ups, Lore history queries, pull request decision summaries, or Lore rules in agent instructions./humanizer-kill-gptRuns a cross-language cleanup for writing tells shared by large frontier LLMs, not only GPT: English source constructs that survive other language translation and language-surface translationese. Use only when the user asks to remove AI/GPT tells from text (de-GPT, GPT 티, AI 티, 번역체 GPT, 자폐 말투 — colloquial shorthand for rigid or over-complete model prose, not a claim about autism).Other plugins' skills for the same job