$npx -y skills add girofu/skill-fetch --skill skill-fetchThis skill should be used when the user asks to "fetch skill", "install skill", "search for a skill", or when a hook outputs "MISSING EXTERNAL SKILL". Searches 9 registries (SkillsMP, GitHub, Anthropic Skills, ClawSkillHub, skills.sh, PolySkill, SkillHub, Skills Directory) with m
| 1 | # Skill Fetch |
| 2 | |
| 3 | Search, score, and install agent skills from multiple registries in parallel. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - A skill-eval hook outputs "MISSING EXTERNAL SKILL" |
| 8 | - The current task requires domain expertise not available locally |
| 9 | - The user asks to "fetch skill", "search for a skill", or "install a skill" |
| 10 | |
| 11 | ## Critical Rules |
| 12 | |
| 13 | 1. **Never use `skillsmp_get_skill_content` to preview before deciding** — search descriptions are sufficient. Only use as a fallback if installation fails. |
| 14 | 2. **Stop on first results, continue only on zero** (max 5 rounds) — any round with ≥1 result proceeds to analysis. |
| 15 | 3. **Only the user can decide to skip** — the LLM must never skip installation on its own. |
| 16 | 4. **Always use plain-text interaction** — do not use AskUserQuestion. Output analysis and wait for the user to reply with a number or command. |
| 17 | 5. **Show up to 5 results per page** — with full analysis (content, pros, cons, repo URL) so the user can make an informed decision. |
| 18 | |
| 19 | ## Platform Compatibility |
| 20 | |
| 21 | 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. |
| 22 | |
| 23 | ## Procedure |
| 24 | |
| 25 | ### Step 0: SkillsMP MCP Self-Check (Claude Code only) |
| 26 | |
| 27 | Before searching, verify that the SkillsMP MCP server is available: |
| 28 | |
| 29 | 1. **First, try loading deferred tools**: Run `ToolSearch("skillsmp")` to load any deferred SkillsMP MCP tools. In Claude Code, MCP tools are often deferred (not loaded until requested) and have namespaced names like `mcp__skillsmp__skillsmp_search`. The `ToolSearch` call resolves these. |
| 30 | 2. After ToolSearch, check if any `skillsmp_*` or `mcp__skillsmp__*` tool is now available |
| 31 | 3. If **available** → proceed to Step 1 |
| 32 | 4. If **still not available** → run: `claude mcp add --scope user skillsmp -- npx -y skillsmp-mcp-server` |
| 33 | 5. 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." |
| 34 | 6. Proceed to Step 1 (SkillsMP sources will be skipped this session, but available in future sessions) |
| 35 | |
| 36 | > **Tool name note**: SkillsMP tools may appear with MCP namespace prefix: `mcp__skillsmp__skillsmp_search` instead of `skillsmp_search`. Both forms work — use whichever is available. |
| 37 | |
| 38 | > **Non-Claude Code agents**: Skip this step. SkillsMP tools are Claude Code-specific. |
| 39 | |
| 40 | ### Step 0.5: Load API Keys (MANDATORY — execute before Step 2) |
| 41 | |
| 42 | Sources 8-9 require API keys. Read the config file to determine availability: |
| 43 | |
| 44 | 1. **Read `~/.claude/skills/.fetch-config.json` NOW** — do not assume keys are absent without reading the file |
| 45 | 2. Expected format: |
| 46 | ```json |
| 47 | { |
| 48 | "SKILLHUB_API_KEY": "sk-sh-...", |
| 49 | "SKILLS_DIRECTORY_API_KEY": "sk_live_..." |
| 50 | } |
| 51 | ``` |
| 52 | 3. **Record the result** — set two flags for use in Step 2b: |
| 53 | - `HAS_SKILLHUB_KEY`: true/false |
| 54 | - `HAS_SKILLS_DIR_KEY`: true/false |
| 55 | 4. If config file does not exist → both flags = false, inform user they can create the file |
| 56 | 5. If config file exists but a specific key is missing → that flag = false |
| 57 | |
| 58 | > **⚠️ 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.** |
| 59 | |
| 60 | ### Step 1: Determine Search Keywords and Source |
| 61 | |
| 62 | **URL mode:** If `$ARGUMENTS` is a URL (starts with `https://github.com/...` or any `https://`), skip directly to Step 3 installation flow. |
| 63 | |
| 64 | **Search mode:** |
| 65 | - **Has `$ARGUMENTS`**: Use directly as search terms |
| 66 | - **No search terms** (auto-triggered): Prefer `Suggested search terms` from hook output, otherwise extract 2-3 queries from task context |
| 67 | |
| 68 | ### Step 2: Parallel Search — ALL 9 Sources (mandatory) |
| 69 | |
| 70 | **⚠️ MANDATORY: You MUST fire ALL 9 sources. Do NOT proceed to scoring until all 9 sources have returned or failed.** |
| 71 | |
| 72 | **⚠️ 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.** |
| 73 | |
| 74 | **⚠️ EXECUTION ORDER: You MUST complete BOTH Step 2a AND Step 2b before proceeding to Step 2.5. Step 2a alone is NOT sufficient.** |
| 75 | |
| 76 | #### Step 2a: Fire SkillsMP sources (1-2) |
| 77 | |
| 78 | | # | Source | Tool Call | Fallback | |
| 79 | |---|--------|-----------|----------| |
| 80 | | 1 | **SkillsMP AI** | `skillsmp_ai_search` × 3 query v |