skill-fetch
git clone https://github.com/girofu/skill-fetch
T=$(mktemp -d) && git clone --depth=1 https://github.com/girofu/skill-fetch "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/skill-fetch" ~/.claude/skills/girofu-skill-fetch-skill-fetch && rm -rf "$T"
skills/skill-fetch/SKILL.mdSkill Fetch
Search, score, and install agent skills from multiple registries in parallel.
When to Use
- A skill-eval hook outputs "MISSING EXTERNAL SKILL"
- The current task requires domain expertise not available locally
- The user asks to "fetch skill", "search for a skill", or "install a skill"
Critical Rules
- Never use
to preview before deciding — search descriptions are sufficient. Only use as a fallback if installation fails.skillsmp_get_skill_content - Stop on first results, continue only on zero (max 5 rounds) — any round with ≥1 result proceeds to analysis.
- Only the user can decide to skip — the LLM must never skip installation on its own.
- Always use plain-text interaction — do not use AskUserQuestion. Output analysis and wait for the user to reply with a number or command.
- Show up to 5 results per page — with full analysis (content, pros, cons, repo URL) so the user can make an informed decision.
Platform Compatibility
This skill works across 6+ AI coding agents (Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Amp). Tool names adapt automatically. See
references/platform-adapters.md for the full mapping table.
Procedure
Step 0: SkillsMP MCP Self-Check (Claude Code only)
Before searching, verify that the SkillsMP MCP server is available:
- First, try loading deferred tools: Run
to load any deferred SkillsMP MCP tools. In Claude Code, MCP tools are often deferred (not loaded until requested) and have namespaced names likeToolSearch("skillsmp")
. Themcp__skillsmp__skillsmp_search
call resolves these.ToolSearch - After ToolSearch, check if any
orskillsmp_*
tool is now availablemcp__skillsmp__* - If available → proceed to Step 1
- If still not available → run:
claude mcp add --scope user skillsmp -- npx -y skillsmp-mcp-server - Inform the user: "SkillsMP MCP server has been registered. It will be available after restarting the session. Continuing search with the remaining 7 sources for now."
- Proceed to Step 1 (SkillsMP sources will be skipped this session, but available in future sessions)
Tool name note: SkillsMP tools may appear with MCP namespace prefix:
instead ofmcp__skillsmp__skillsmp_search. Both forms work — use whichever is available.skillsmp_search
Non-Claude Code agents: Skip this step. SkillsMP tools are Claude Code-specific.
Step 0.5: Load API Keys (MANDATORY — execute before Step 2)
Sources 8-9 require API keys. Read the config file to determine availability:
- Read
NOW — do not assume keys are absent without reading the file~/.claude/skills/.fetch-config.json - Expected format:
{ "SKILLHUB_API_KEY": "sk-sh-...", "SKILLS_DIRECTORY_API_KEY": "sk_live_..." } - Record the result — set two flags for use in Step 2b:
: true/falseHAS_SKILLHUB_KEY
: true/falseHAS_SKILLS_DIR_KEY
- If config file does not exist → both flags = false, inform user they can create the file
- If config file exists but a specific key is missing → that flag = false
⚠️ COMMON FAILURE MODE: LLM skips reading the config file and assumes "no key". This causes Sources 8-9 to be incorrectly skipped even when keys ARE configured. Always read the file first.
Step 1: Determine Search Keywords and Source
URL mode: If
$ARGUMENTS is a URL (starts with https://github.com/... or any https://), skip directly to Step 3 installation flow.
Search mode:
- Has
: Use directly as search terms$ARGUMENTS - No search terms (auto-triggered): Prefer
from hook output, otherwise extract 2-3 queries from task contextSuggested search terms
Step 2: Parallel Search — ALL 9 Sources (mandatory)
⚠️ MANDATORY: You MUST fire ALL 9 sources. Do NOT proceed to scoring until all 9 sources have returned or failed.
⚠️ COMMON FAILURE MODE: LLM fires sources 1-2 (SkillsMP), gets results, then skips sources 3-9. This is WRONG. SkillsMP results alone are insufficient — GitHub, ClawhHub, skills.sh, and PolySkill contain different skills not indexed by SkillsMP.
⚠️ EXECUTION ORDER: You MUST complete BOTH Step 2a AND Step 2b before proceeding to Step 2.5. Step 2a alone is NOT sufficient.
Step 2a: Fire SkillsMP sources (1-2)
| # | Source | Tool Call | Fallback |
|---|---|---|---|
| 1 | SkillsMP AI | × 3 query variants (parallel) | Skip if MCP unavailable |
| 2 | SkillsMP keyword | | Skip if MCP unavailable |
Step 2b: Fire non-SkillsMP sources (3-9) — DO NOT SKIP
⚠️ You MUST fire these sources even if Step 2a already returned results. These sources contain skills NOT in SkillsMP.
| # | Source | Tool Call | Fallback |
|---|---|---|---|
| 3 | GitHub repos | (do NOT append "skill SKILL.md") | |
| 4 | Anthropic Skills | | tree fallback |
| 5 | ClawhHub | | Skip on failure |
| 6 | skills.sh | | via Bash |
| 7 | PolySkill | (extract most specific single keyword from query — multi-word queries return 0) | Skip on failure (no REST API) |
| 8 | SkillHub | If = true (from Step 0.5): . If false: (timeout: 10000) | CLI fallback on failure |
| 9 | Skills Directory | If = true (from Step 0.5): . If false: skip. Never use curl directly or WebFetch. | Skip only if key is confirmed absent in Step 0.5 |
⚠️ Sources 8-9 REQUIRE Step 0.5 to have been executed. If Step 0.5 was skipped, go back and read
NOW before marking Sources 8-9 as skipped.~/.claude/skills/.fetch-config.json= the base directory of this skill (shown at the top when skill loads).{SKILL_BASE_DIR}
See
for detailed parameters, response formats, query variant examples, and curl fallback commands.references/search-sources.md
⚠️ POST-SEARCH CHECKLIST (mandatory before proceeding to Step 2.5):
Before scoring, output this checklist with actual status for EVERY source:
Step 0.5 config: HAS_SKILLHUB_KEY={true/false} HAS_SKILLS_DIR_KEY={true/false} Sources queried: [1] SkillsMP AI ✅ [2] SkillsMP KW ✅ [3] GitHub ✅/❌ [4] Anthropic ✅/❌ [5] ClawhHub ✅/❌ [6] skills.sh ✅/❌ [7] PolySkill ✅/❌ [8] SkillHub ✅/❌ [9] Skills Dir ✅/❌
Validation rules — go back and fix before proceeding:
- If sources 3-7 are ALL ❌ → re-execute sources 3-7 NOW
- If
but [8] is ❌ → executeHAS_SKILLHUB_KEY=true
NOWbash {SKILL_BASE_DIR}/scripts/fetch-skillhub.sh - If
but [9] is ❌ → executeHAS_SKILLS_DIR_KEY=true
NOWbash {SKILL_BASE_DIR}/scripts/fetch-skills-directory.sh - If Step 0.5 was never executed (no config line above) → read
NOW, then re-evaluate sources 8-9~/.claude/skills/.fetch-config.json
After ALL sources return → deduplicate (see
references/search-sources.md) → proceed to Step 2.5.
Round strategy (max 5 rounds): The "≥1 result → stop" rule applies to rounds, not individual sources. Within a single round, ALL 9 sources must be queried. Only if ALL 9 sources return 0 results in a round should you proceed to the next round with broader keywords. If any source returns ≥1 result in a round, proceed to scoring (do NOT start another round).
Step 2.5: Scoring and Ranking
Calculate a quality score (0-100) for each deduplicated result. See
references/quality-signals.md for details.
Scoring formula:
Total = Relevance(0-40) + Freshness(0-25) + Community(0-20) + Trust(0-15) + External Bonus(0-5)
Supplementary lookup: For the top 5 results, use
gh api repos/{owner}/{repo} --jq '{pushed_at,stargazers_count}' to get update time and GitHub stars. Skip lookup for high-star (≥50) results with precisely matching descriptions. Maximum 3 gh api calls.
Grade labels:
🟢 85+ Strongly Recommended | 🟢 70-84 Recommended | 🟡 55-69 Worth Considering | 🟡 40-54 Marginal | 🔴 <40 Not Recommended
Step 3: Analyze, Select, Install
See
references/installation-guide.md for the complete installation workflow.
Quick reference — flow:
- 3a. Display sorted results (5 per page, score + pros/cons)
- 3b. Wait for user reply (number to install,
for next page,c
to end)skip - 3c. Ask installation location (G=global, L=local) — MANDATORY
- 3d. Execute installation (SkillsMP → trust-but-verify, GitHub → pre-install scan)
- 3e. Post-install verification (file existence, frontmatter, conflict check, SHA-256)
- 3f. Update
~/.claude/skills/.fetch-metadata.json - 3g. Activate and confirm with user
Step 4: Digest Reference Materials
Installed skills may contain a
references/ subdirectory.
- Use Glob to check for
references/ - Only read files directly relevant to the current task (check first 30 lines for relevance)
- Summarize key knowledge for use in subsequent planning
- Skip if no
existsreferences/
After completion, output:
External skill installed successfully: {skill-name}
Completion Phrases
- Success:
External skill installed successfully: {name} - Skipped:
External skill fetch: user chose to skip installation.
Additional Resources
Rationalization Table and Red Flags are in
. Consult when rationalizing skipping steps.references/interaction-patterns.md
— Output templates, user reply handling, security reviewreferences/interaction-patterns.md
— Quality assessment dimensions, lookup methods, ranking algorithmreferences/quality-signals.md
— Source-specific commands, error handling, deduplication rulesreferences/search-sources.md
— Cross-platform tool mapping, installation paths, fallback strategiesreferences/platform-adapters.md
— Complete Step 3 installation workflow (3a-3g)references/installation-guide.md
— Local skill/plugin scan implementation for pre-search deduplicationreferences/local-index.md
— SkillHub API search (reads key fromscripts/fetch-skillhub.sh
)~/.claude/skills/.fetch-config.json
— Skills Directory API search (reads key from config)scripts/fetch-skills-directory.sh