$npx -y skills add testdouble/han --skill han-update-documentationUpdate Han plugin documentation so every skill, agent, guidance doc, index, and cross-reference is current and accurate. On a non-default branch, scopes the pass to entities the branch actually touched. On the default branch, performs a full documentation sweep across the whole p
| 1 | ## Pre-requisites |
| 2 | |
| 3 | - git: !`which git 2>/dev/null || echo "not installed"` |
| 4 | - repo root marker: !`find . -maxdepth 3 -name "plugin.json" -path "*/.claude-plugin/*" -type f` |
| 5 | - skill roots: !`find . -maxdepth 2 -type d -name skills -path './han-*/skills' ! -path './han-plugin-builder/skills' 2>/dev/null | sed 's|^\./||' | sort` |
| 6 | - agents directory: !`find . -maxdepth 2 -type d -name agents -path './han-*/agents' 2>/dev/null | sed 's|^\./||' | sort` |
| 7 | |
| 8 | **If any of the above are empty or read `not installed`:** this skill is intended to run inside the Han plugin repository. Tell the operator which marker is missing and stop. Do not attempt to operate on a different repo. |
| 9 | |
| 10 | ## Project Context |
| 11 | |
| 12 | - current branch: !`git branch --show-current 2>/dev/null || echo unknown` |
| 13 | - default branch: !`git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || echo unknown` |
| 14 | |
| 15 | ## Step 1: Detect mode and scope |
| 16 | |
| 17 | Run `${CLAUDE_SKILL_DIR}/scripts/detect-doc-update-context.sh` and read its output. Branch on the `mode:` line. |
| 18 | |
| 19 | The script also emits the **skill roots** (between `skill-roots-start` and `skill-roots-end`) and the **agent root** (the `agent-root:` line), both discovered dynamically from disk. These are the authoritative roots for the rest of this skill — use them wherever the steps below say "the skill roots" or "the agent root," rather than any hardcoded plugin list. A skill root is every `han-*/skills` directory except `han-plugin-builder/skills`, whose `guidance` skill is authoring guidance audited under guidance docs (Step 2, sweep), not a documented product skill. Adding a new product plugin needs no edit to this skill; it shows up in the discovered roots automatically. |
| 20 | |
| 21 | **`mode: error`** — stop. Surface the `reason:` line to the operator. Do not proceed. |
| 22 | |
| 23 | **`mode: branch`** — branch scope. Set `MODE = branch`. Read the file list between `changed-files-start` and `changed-files-end` (or note that the file list is empty if `changed-files: none` appears instead). If the file list is empty, inform the operator that the branch has no changes against the default branch and stop. |
| 24 | |
| 25 | **`mode: sweep`** — full sweep. Set `MODE = sweep`. The skill audits every documentation entity across the plugin suite (every skill root the detect script reported, plus the agent root). |
| 26 | |
| 27 | Echo back the mode and the count of in-scope files (branch mode) or "full plugin sweep" (sweep mode) so the operator knows what is about to happen. |
| 28 | |
| 29 | ## Step 2: Build the entity inventory |
| 30 | |
| 31 | The mode determines *which* entities to audit. Always build a deduplicated list of entities before reading anything else, so Step 3 has a fixed plan. |
| 32 | |
| 33 | ### When `MODE = branch` |
| 34 | |
| 35 | Map each changed file to its entities using [references/scope-mapping.md](./references/scope-mapping.md). A single file can pull multiple entities into scope (a changed skill SKILL.md pulls the skill plus, if the description changed, the index and CLAUDE.md catalog). Then apply the **implicit dependencies** section of the mapping reference: skill or agent additions and removals pull the indexes, CLAUDE.md, README, and `docs/concepts.md` into scope; sibling-boundary changes pull the named sibling into scope. |
| 36 | |
| 37 | Deduplicate. Produce a single ordered inventory `INV`: |
| 38 | |
| 39 | 1. Skills, alphabetical. |
| 40 | 2. Agents, alphabetical. |
| 41 | 3. Indexes (`docs/skills/README.md`, `docs/agents/README.md`). |
| 42 | 4. Top-level concept docs (`docs/concepts.md`, `docs/quickstart.md`, `docs/sizing.md`, `docs/yagni.md`). |
| 43 | 5. Guidance docs (specific files only). |
| 44 | 6. Templates (specific files only). |
| 45 | 7. Root files (`README.md`, `CONTRIBUTING.md`, `CLAUDE.md`). |
| 46 | |
| 47 | ### Plugin roots |
| 48 | |
| 49 | Han ships as several plugins. Skills are spread across several of them; agents live in only one. Long-form docs stay flat under `docs/skills/` and `docs/agents/` no matter which plugin owns the entity. |
| 50 | |
| 51 | - **Skill roots:** the list the detect script reported between `skill-roots-start` and `skill-roots-end`. Every `han-*/skills` directory except `han-plugin-builder/skills |