Skip to content

feat(skill-search): gh parity — stars, interactive install, sort, limit fix#400

Merged
christso merged 4 commits into
mainfrom
feat/400-skill-search-gh-parity
May 18, 2026
Merged

feat(skill-search): gh parity — stars, interactive install, sort, limit fix#400
christso merged 4 commits into
mainfrom
feat/400-skill-search-gh-parity

Conversation

@christso
Copy link
Copy Markdown
Contributor

@christso christso commented May 18, 2026

Summary

  • Star counts: SkillSearchItem now includes stars: number fetched in parallel via /repos/{owner}/{repo} after code search (GitHub Code Search API does not return stargazers_count in repository objects)
  • Sort by stars: Results are sorted descending by star count, so popular/high-quality skills rank first — matching gh skill search behaviour
  • Interactive install: In TTY mode, allagents skill search <query> shows a filter-as-you-type autocomplete after displaying results; selecting a skill prompts for install scope and runs the install + sync inline
  • Limit fix: --limit N now caps total merged output. Default changed from 30 → 15 to match gh
  • Namespace extraction fix: plugins/cargowise/skills/cw-deploy/SKILL.md now correctly yields namespace cargowise (not empty). Guard requires parts[skillsIdx-2] === 'plugins' before using the pre-skills segment as namespace
  • Workspace-repo pollution fix: Repos that commit synced skill files to .agents/skills/ and .copilot/skills/ output directories were appearing as duplicate results. Post-dedup filter drops any result whose path starts with a hidden directory segment

Investigation: why allagents returned workspace repos

Repos that use allagents commit synced skill files to .agents/skills/<name>/SKILL.md and .copilot/skills/<name>/SKILL.md. GitHub Code Search found these because their SKILL.md content is identical to the originals. Previously WiseTechGlobal/KH2_WorkSpace and WiseTechGlobal/cargowise-ct-link appeared in results for cw-code-complexity.

Fix: post-dedup filter drops items where the first path segment starts with ..

Test plan

Green E2E (local build from this branch)

cd allagents.worktrees/feat-skill-search-parity
bun run build

# Verify workspace repos are gone and namespaces are correct
./dist/index.js skill search cw-code-complexity | cat
# Expected: 7 results, all from WiseTechGlobal/WTG.AI.Prompts and WZG.Playbook.Content
# Expected: names like cargowise/cw-code-complexity (with namespace), NOT .agents/cw-code-complexity
# NOT expected: KH2_WorkSpace or cargowise-ct-link repos

# gh comparison
gh skill search cw-code-complexity
# WiseTechGlobal/WTG.AI.Prompts  cargowise/cw-code-complexity  ★54 ...
# Both now show same repos; allagents returns 7 vs gh's 6 due to multi-query merge

./dist/index.js skill search frontend-design --limit 3 | cat
# Shows exactly 3 results sorted by stars

christso added 2 commits May 18, 2026 18:05
…it fix

- Add `stars` field to `SkillSearchItem` by batch-fetching `/repos/{owner}/{repo}`
  in parallel after code search; sorted descending so popular skills rank first
- Add interactive install mode in TTY: filter-as-you-type autocomplete lets users
  narrow results and install a selected plugin without leaving the CLI
- Fix final output limit: `--limit` now caps total merged results (previously it
  only capped per-query results, so 4 queries × 30 = ~120 raw items could appear)
- Change default limit from 30 to 15 to match gh
- Fix case-insensitive SKILL.md detection in `parseSkillPath` so `skill.md`,
  `SKILL.MD`, etc. don't leak into skill names as false path segments
- Update metadata: description, expectedOutput, outputSchema (add stars/namespace),
  default limit doc
- Update test fake-fetch helper to handle `/repos/` star-fetch calls (returns 0
  by default so existing assertions are unchanged)

Investigation: allagents returns more results than gh because it runs up to 4
parallel Code Search queries (path, hyphen, owner, content) while gh uses a single
query. The multi-query strategy surfaces path-nested skills (cargowise use case)
but also brings in false positives from content-only matches. Star sorting
de-prioritizes low-quality results; the limit cap contains total output size.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 18, 2026

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 11a5c05
Status: ✅  Deploy successful!
Preview URL: https://bf35e88a.allagents.pages.dev
Branch Preview URL: https://feat-400-skill-search-gh-par.allagents.pages.dev

View logs

christso added 2 commits May 18, 2026 18:42
…pace extraction

Workspace repos that commit synced skill files to .agents/skills/ and
.copilot/skills/ output directories appeared as duplicate results in
content search (identical SKILL.md content to the originals).

- Post-dedup filter drops any result whose path starts with a hidden
  directory segment (`.agents`, `.copilot`, etc.)
- parseSkillPath nsFromPlugin guard now requires `parts[skillsIdx-2] ===
  'plugins'` before using the pre-skills segment as a namespace, so
  `.agents` and `.copilot` no longer leak as namespace values
gh skill search always runs four query buckets in order:
  P1 path:    filename:SKILL.md path:<hyphenated>
  P2 hyphen:  filename:SKILL.md <hyphenated>     (multi-word only)
  P3 owner:   filename:SKILL.md user:<query>      (owner-like query only)
  P4 primary: filename:SKILL.md <query>

Our previous code had removed the path query entirely and placed primary at
P1. Restore the path: query as P1 and demote primary to P4. The path query
is what surfaces skills like plugins/cargowise/skills/cw-yard/SKILL.md when
searching "cargowise" even if the SKILL.md body never mentions "cargowise".
@christso christso merged commit 7d11c3a into main May 18, 2026
1 check passed
@christso christso deleted the feat/400-skill-search-gh-parity branch May 18, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant