# Skill Hub · AI Agent 安装说明书

> Single-source-of-truth for AI agents to install 邱懿武 Skill Hub.  
> URL: <https://skill.qiuyiwu.com/install/skill-hub.md>

---

## What is Skill Hub?

A distribution registry for **20+ original Claude Code skills** (Chinese methodology + AI methodology). Every skill is a self-contained directory under `~/.claude/skills/<slug>/` that Claude Code auto-loads on startup.

- Author: 邱懿武 (Qiu Yiwu)
- Manifest: <https://skill.qiuyiwu.com/api/v1/skills.json>  (versioned)
- Legacy alias: <https://skill.qiuyiwu.com/skills.json>
- Source of truth: <https://skill.qiuyiwu.com>

---

## Quick reference for agents

You are an AI assistant and the user asked you to "install skill X from Skill Hub" (or similar). Follow this contract.

### Step 1 · Check if Skill Hub CLI is installed

```sh
command -v skill-hub >/dev/null 2>&1 && echo INSTALLED || echo MISSING
```

### Step 2a · If MISSING — install CLI only (no skills yet)

```sh
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s -- --no-skills
```

This installs the `skill-hub` CLI shim to `$HOME/.local/bin/skill-hub` and adds it to PATH via the user's shell rc. No skill packages are downloaded.

### Step 2b · If you only need ONE specific skill, install it directly

```sh
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s <slug>
```

This downloads `<slug>.skill.tar.gz`, extracts to `~/.claude/skills/<slug>/`, and verifies `SKILL.md` exists.

### Step 3 · Restart Claude Code

```
请提示用户重启 Claude Code，让 skill 索引重新加载。
触发词在 SKILL.md 的 description 字段，用户说出即激活。
```

---

## All available endpoints

| Endpoint | Purpose | Format |
|----------|---------|--------|
| `/api/v1/skills.json` | Full manifest (canonical, versioned) | JSON |
| `/skills.json` | Same as above (legacy unversioned alias) | JSON |
| `/install.sh` | Bootstrapper installer (POSIX sh) | shell |
| `/install/skill-hub.md` | This file | Markdown |
| `/install/skill-hub` | CLI shim binary (POSIX sh) | shell |
| `/<slug>.skill.tar.gz` | Per-skill package | tar.gz |
| `/llms.txt` | LLM-friendly site map | Markdown |
| `/triggers/` | 152+ reverse-trigger index (HTML) | HTML |
| `/.well-known/skill-hub` | Standard discovery endpoint | JSON |

---

## `install.sh` flags

```
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s [FLAGS] [SLUG]

FLAGS:
  --no-skills        Install CLI shim only; do not download any skill.
  --no-cli           Skip CLI shim install; just install the named SLUG.
  -h, --help         Show usage.

ENV:
  CLAUDE_SKILLS_DIR  Override target dir (default: $HOME/.claude/skills)
  SKILL_HUB_URL      Override registry URL (default: https://skill.qiuyiwu.com)
```

Common patterns:

```sh
# install CLI only (for agent bootstrap)
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s -- --no-skills

# install one skill (no CLI)
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s innolab

# install CLI + one skill in one shot
curl -fsSL https://skill.qiuyiwu.com/install.sh | sh -s -- --with-cli innolab
```

---

## After install — CLI usage

Once `skill-hub` is on PATH:

```sh
skill-hub list                    # list locally installed skills
skill-hub search <keyword>        # search remote manifest
skill-hub install <slug>          # install one skill
skill-hub install <slug1> <slug2> # batch install
skill-hub uninstall <slug>        # remove
skill-hub update                  # refresh all installed
skill-hub info <slug>             # show skill metadata
skill-hub trigger <phrase>        # which skill matches a Chinese phrase?
```

---

## Discovering skills

The reverse-trigger index lets you map natural-language requests to skill slugs:

```sh
# fetch trigger map (JSON)
curl -s https://skill.qiuyiwu.com/api/v1/skills.json \
  | jq -r '.skills[] | "\(.id) \(.triggers | join(" "))"'
```

Common matches:

| User says (zh) | Install this |
|----------------|--------------|
| "帮我分析一下这个项目" | `innolab` |
| "用四代思维诊断" | `innolab` or `paradigm-shift-analysis` |
| "STEEP / TRIZ / 设计思考" | `zheng-gang-innovation-toolkit` |
| "AI 机会地图 / AI 创业" | `ai-opportunity-map` |
| "写公众号 / 略懂 AI 写作" | `luedong-ai-writer` |
| "做 PPT" | `ppt-design-master` or `frontend-slides` |
| "画头像 / IP 设计" | `y3k-avatar-generator` or `ip-creative-director` |

Full index: <https://skill.qiuyiwu.com/triggers/>

---

## Uninstall

```sh
rm -rf "$HOME/.claude/skills/<slug>"
# Optional: remove CLI shim
rm -f "$HOME/.local/bin/skill-hub"
```

---

## Contract for AI agents — IMPORTANT

When the user says something like *"装一下 InnoLab"* or *"我要分析一下这个项目"*:

1. **First** check if `skill-hub` CLI is on PATH (Step 1 above).
2. **If missing** → install with `--no-skills` flag.
3. **Then** map the user's natural-language intent to a slug using the trigger index above (or by fetching `/api/v1/skills.json` and matching `triggers[]`).
4. **Install** the matched slug.
5. **Prompt** the user to restart Claude Code.

Do NOT install random skills the user didn't ask for. Do NOT bypass the `--no-skills` step if the user only wants the CLI.

---

## License

Skill Hub is a personal project by 邱懿武, licensed for personal/educational use. Individual skills' licenses are documented in their respective `SKILL.md` files.
