TaskCreate one task per phase (8 phases).
- Read
state.md if exists; check for IN_PROGRESS marker.
- If IN_PROGRESS found →
AskUserQuestion:
- Resume from last checkpoint
- Start fresh (archive previous as ABORTED)
- Show full history (abort, let the user review)
- Otherwise → record current generation as IN_PROGRESS with
checkpoint: INITIALIZED.
- Read
references/skill-style.md + references/compaction-patterns.md into context (loaded via @ in <context> block above, but verify accessible).
TaskUpdate Phase 0 → completed.
If the user provided a skill name + description in their initial message → skip to Phase 2.
Otherwise, free-form prompt:
"What should this skill do? In 1-2 sentences, describe the workflow you want to capture."
Record their answer → intent field.
Update checkpoint: INTENT_CAPTURED.
TaskUpdate Phase 1 → completed.
ONE AskUserQuestion call with up to 4 questions covering the highest-leverage decisions. Use the question set in references/intake-questions.md as the canonical source.
The 4 batched questions (4 is the max per AskUserQuestion call):
- Skill name + form — what's the name (kebab-case)? Skill in
~/.claude/skills/<name>/ or slash-command in ~/.claude/commands/<name>.md or both?
- Stateful? No (stateless) / Yes-simple (one history file) / Yes-checkpointed (sync-style with IN_PROGRESS recovery) / Yes-multi-actor (with attribution suffixes)
- State location (if stateful) — skill dir / current repo / external repo (multi-device sync) /
.planning/
- Compaction pattern (if stateful) — pick one of 14 from
references/compaction-patterns.md (default: "rolling-window-saved-rules" for most cases)
Then a SECOND AskUserQuestion for follow-ups depending on Q1-4 answers:
- Autonomy matrix — auto-fix-safe / ask-on-medium / never-touch — with examples
- Hard invariants — what should NEVER be done regardless of context (free-form)
- References needed? (templates, schemas, long docs to offload from SKILL.md)
- Scripts needed? (shell helpers, generators, validators)
For each answer, record to intake/ block in current state entry.
Update checkpoint: INTAKE_COMPLETE.
TaskUpdate Phase 2 → completed.
Based on intake, pick from references/examples/:
| Template |
When |
01-stateless.md |
No state, single-purpose (e.g. a one-shot search/fetch tool) |
02-stateful-simple.md |
One history file, rolling-N + archive (e.g. a send-and-log workflow) |
03-stateful-checkpointed.md |
IN_PROGRESS recovery + saved rules (e.g. a long resumable sync) |
04-stateful-multi-actor.md |
Multiple state files + attribution suffixes (e.g. a shared bot/human workflow) |
05-slash-command-router.md |
One-line delegate to a subagent |
06-information-display.md |
Read-only output, zero context bloat (e.g. a help/status command) |
07-multi-phase-feature.md |
Multi-artifact per-feature dirs (e.g. a feature-development workflow) |
Show user the picked template + ask "looks right?" before generating.
Update checkpoint: TEMPLATE_SELECTED.
TaskUpdate Phase 3 → completed.
- Run
bash scripts/generate-skill.sh <name> <template> — creates the directory, writes initial SKILL.md from chosen template + intake answers, scaffolds references/ and scripts/ subdirs if specified.
- Substitute placeholders:
{{SKILL_NAME}}, {{DESCRIPTION}}, {{TRIGGER_PHRASES}}, {{COMPACTION_PATTERN}}, etc.
- Compose SKILL.md sections per the canonical scaffold:
- Frontmatter (pushy
> description, paths: glob if path-scoped, when_to_use: if it adds clarity, argument-hint: only if $ARGUMENTS used, allowed-tools: only if restricting)
<objective>
<context> with @ injections for state file + relevant references
<execution_context> with autonomy matrix
<process> with numbered <phase name="N_named"> blocks
<saved_rules_format> (if stateful)
<recovery_protocol> (if stateful with checkpoints)
<error_handling> (always)
<success_criteria> (always)
- Generate compaction section per chosen pattern using
bash scripts/compaction-template.sh <pattern>.
Update checkpoint: GENERATED.
TaskUpdate Phase 4 → completed.
Show the FULL generated SKILL.md content in the chat — no surprises before write.
Ask via AskUserQuestion:
- Approve → write files (Phase 6)
- Modify → which section/field/wording? (free-form, then re-generate that section)
- Abort → archive current entry as ABORTED, exit cleanly
Update checkpoint: PREVIEWED.
TaskUpdate Phase 5 → completed.
Only after Phase 5 approval:
Write SKILL.md to ~/.claude/skills/<name>/SKILL.md (or ~/.claude/commands/<name>.md for slash-command form).
- Write any reference files specified in intake to
references/.
- Write any script files specified to
scripts/ (with chmod +x).
- Write initial state file scaffolding if stateful (with header + format docs + empty section).
- If user wants slash-command shortcut → create
~/.claude/commands/<name>.md with one-line Skill(<name>) delegate.
Update checkpoint: WRITTEN.
TaskUpdate Phase 6 → completed.
- Run
bash scripts/validate-skill.sh <name> — checks:
- Frontmatter
description ≤ 1,536 chars (combined with when_to_use)
- Required tags present per
<execution_context>'s skill-class
- SKILL.md size — warn if > 500 lines or > ~5K tokens (auto-compaction truncation risk)
- References referenced in
<context> actually exist
- Scripts referenced are executable
- Optionally run a deeper structure audit if you have a skill-auditor command available.
- Surface findings:
- 🔴 must-fix (description too long, missing required tags, broken
@ references)
- 🟡 should-fix (style inconsistencies, missing optional tags)
- 🟢 nice-to-have (suggestions for improvement)
- Optionally defer to Anthropic
skill-creator@claude-plugins-official for eval iteration (offer to user — only if they want quantitative test prompts).
Update state.md: append COMPLETED entry with skill name + template chosen + audit results + summary.
Apply rolling-window pruning if > 10 entries (compact older to one-liners in archive section).
Update checkpoint: COMPLETED.
TaskUpdate Phase 7 → completed.
Stored in state.md "Saved Rules" section. Surfaced on every /skill-maker run as:
"Previous rule found: '{rule_text}'. Apply this? (Yes / No / Delete rule)"
Format per rule:
- {topic}: {rule} — set {YYYY-MM-DD}
Examples (auto-discovered by observing the user's choices over time):
- naming: prefer kebab-case, prefix with category if part of a family (e.g.,
myproject-*)
- compaction-default: rolling-window-saved-rules (5 full + saved rules)
- attribution: only add
— [actor <time>] suffix when ≥2 actors
- token-budget: keep SKILL.md under 500 lines (a common convention; not a hard cap)
- Identify last completed checkpoint from state entry (
INITIALIZED / INTENT_CAPTURED / INTAKE_COMPLETE / TEMPLATE_SELECTED / GENERATED / PREVIEWED / WRITTEN).
- Map checkpoint → next phase:
- INITIALIZED → resume Phase 1
- INTENT_CAPTURED → resume Phase 2
- INTAKE_COMPLETE → resume Phase 3
- TEMPLATE_SELECTED → resume Phase 4
- GENERATED → resume Phase 5
- PREVIEWED → resume Phase 6
- WRITTEN → resume Phase 7
- Offer the user: Resume / Start fresh (archive previous as ABORTED) / Show full history.
- On resume, append to existing entry; do NOT create new entry.
- Update
updated_at timestamp and checkpoint: field.
Direct actions the user can ask for
If the user explicitly requests something (not full skill creation), handle accordingly:
- "Audit my skill X" → run
bash scripts/validate-skill.sh X (and a deeper auditor if available); show findings with fix suggestions
- "Standardize skill X" → read existing skill, diff against canonical scaffold, propose changes via
AskUserQuestion
- "Convert command to skill" → migrate
~/.claude/commands/X.md → ~/.claude/skills/X/SKILL.md preserving content + restructuring
- "Show me the style guide" → display
references/skill-style.md
- "Show compaction patterns" → display
references/compaction-patterns.md
- "Show frontmatter fields" → display
references/frontmatter-fields.md
- "List my skills" →
ls ~/.claude/skills/ + structured table with status
- "Add Phase X to skill Y" → augment existing skill with new phase, validate
What this skill deliberately does NOT do
- Never modifies a skill without showing diff + getting Phase 5 preview approval
- Never auto-publishes (no auto-commit beyond the local skill dir; you commit when ready)
- Never modifies global
~/.claude/CLAUDE.md without explicit ask
- Never deletes a skill (only archives by adding
.disabled suffix at the user's explicit request)
1---2name: skill-maker3description: Create new Claude Code skills (or slash-commands) in a clean, consistent house style — XML phases, rolling-window state files, saved rules, checkpoint resumption, attribution conventions, and 14 compaction-with-preservation patterns. Use when the user asks to "make a skill", "create a skill", "build a skill", "scaffold a skill", "new skill", "skill for X", "make this a skill", "turn this into a skill", "make a slash command", "create a command", "wrap this workflow", "automate this", "add to my library", "another skill like X", or any phrasing implying turning a workflow into a reusable, well-structured skill. Single point of entry — loads the full style guide + all 14 compaction patterns + canonical scaffold.4---56<objective>7Generate a new skill (or slash-command) that matches a clean, consistent house style: pushy trigger-phrase description, XML-tagged body with numbered phases, rolling-window state files, saved-rules accumulation, checkpoint resumption, attribution conventions, and the right compaction-with-preservation pattern for the use case. Single source of truth for structuring skills well — loads the style guide, presents the canonical scaffold, walks through structured intake, generates the skill files, and validates them. Pairs well with Anthropic's `skill-creator` plugin (defer to it for the eval/iteration loop). Skills generated by this skill should pass a structure audit cleanly on first try.8</objective>910<context>11@references/skill-style.md12@references/compaction-patterns.md13@references/frontmatter-fields.md14@references/intake-questions.md15@./state.md16</context>1718<execution_context>19- Auto-load the style guide + compaction patterns at start (via `<context>` injection above)20- Auto-execute scaffolding (mkdir + boilerplate writes) — these are reversible21- ASK before writing the actual SKILL.md body — preview must be approved22- ASK before deferring to Anthropic `skill-creator` for eval iteration — only if user opts in23- Saved Rules: accumulate per-user-style preferences (e.g., "always wants Phase 5.5 deep-clean for stateful skills") in `state.md`24- Rolling window: keep last 10 generated-skill entries full, compact older to one-line in archive section25</execution_context>2627<process>2829<phase name="0_initialize">30## Phase 0 — Initialize + Load State31321. `TaskCreate` one task per phase (8 phases).332. Read `state.md` if exists; check for `IN_PROGRESS` marker.343. If IN_PROGRESS found → `AskUserQuestion`:35 - **Resume** from last checkpoint36 - **Start fresh** (archive previous as ABORTED)37 - **Show full history** (abort, let the user review)384. Otherwise → record current generation as IN_PROGRESS with `checkpoint: INITIALIZED`.395. Read `references/skill-style.md` + `references/compaction-patterns.md` into context (loaded via `@` in `<context>` block above, but verify accessible).4041`TaskUpdate` Phase 0 → completed.42</phase>4344<phase name="1_capture_intent">45## Phase 1 — Capture Intent (free-form, only if missing)4647If the user provided a skill name + description in their initial message → skip to Phase 2.4849Otherwise, free-form prompt:50> "What should this skill do? In 1-2 sentences, describe the workflow you want to capture."5152Record their answer → `intent` field.53Update checkpoint: `INTENT_CAPTURED`.5455`TaskUpdate` Phase 1 → completed.56</phase>5758<phase name="2_structured_intake">59## Phase 2 — Structured Intake (batched AskUserQuestion)6061ONE `AskUserQuestion` call with up to 4 questions covering the highest-leverage decisions. Use the question set in `references/intake-questions.md` as the canonical source.6263The 4 batched questions (4 is the max per AskUserQuestion call):64651. **Skill name + form** — what's the name (kebab-case)? Skill in `~/.claude/skills/<name>/` or slash-command in `~/.claude/commands/<name>.md` or both?662. **Stateful?** No (stateless) / Yes-simple (one history file) / Yes-checkpointed (sync-style with IN_PROGRESS recovery) / Yes-multi-actor (with attribution suffixes)673. **State location** (if stateful) — skill dir / current repo / external repo (multi-device sync) / `.planning/`684. **Compaction pattern** (if stateful) — pick one of 14 from `references/compaction-patterns.md` (default: "rolling-window-saved-rules" for most cases)6970Then a SECOND `AskUserQuestion` for follow-ups depending on Q1-4 answers:71725. **Autonomy matrix** — auto-fix-safe / ask-on-medium / never-touch — with examples736. **Hard invariants** — what should NEVER be done regardless of context (free-form)747. **References needed?** (templates, schemas, long docs to offload from SKILL.md)758. **Scripts needed?** (shell helpers, generators, validators)7677For each answer, record to `intake/` block in current state entry.7879Update checkpoint: `INTAKE_COMPLETE`.80`TaskUpdate` Phase 2 → completed.81</phase>8283<phase name="3_pick_template">84## Phase 3 — Pick Template8586Based on intake, pick from `references/examples/`:8788| Template | When |89|---|---|90| `01-stateless.md` | No state, single-purpose (e.g. a one-shot search/fetch tool) |91| `02-stateful-simple.md` | One history file, rolling-N + archive (e.g. a send-and-log workflow) |92| `03-stateful-checkpointed.md` | IN_PROGRESS recovery + saved rules (e.g. a long resumable sync) |93| `04-stateful-multi-actor.md` | Multiple state files + attribution suffixes (e.g. a shared bot/human workflow) |94| `05-slash-command-router.md` | One-line delegate to a subagent |95| `06-information-display.md` | Read-only output, zero context bloat (e.g. a help/status command) |96| `07-multi-phase-feature.md` | Multi-artifact per-feature dirs (e.g. a feature-development workflow) |9798Show user the picked template + ask "looks right?" before generating.99100Update checkpoint: `TEMPLATE_SELECTED`.101`TaskUpdate` Phase 3 → completed.102</phase>103104<phase name="4_generate">105## Phase 4 — Generate SKILL.md + References + Scripts1061071. Run `bash scripts/generate-skill.sh <name> <template>` — creates the directory, writes initial SKILL.md from chosen template + intake answers, scaffolds `references/` and `scripts/` subdirs if specified.1082. Substitute placeholders: `{{SKILL_NAME}}`, `{{DESCRIPTION}}`, `{{TRIGGER_PHRASES}}`, `{{COMPACTION_PATTERN}}`, etc.1093. Compose SKILL.md sections per the canonical scaffold:110 - Frontmatter (pushy `>` description, `paths:` glob if path-scoped, `when_to_use:` if it adds clarity, `argument-hint:` only if `$ARGUMENTS` used, `allowed-tools:` only if restricting)111 - `<objective>`112 - `<context>` with `@` injections for state file + relevant references113 - `<execution_context>` with autonomy matrix114 - `<process>` with numbered `<phase name="N_named">` blocks115 - `<saved_rules_format>` (if stateful)116 - `<recovery_protocol>` (if stateful with checkpoints)117 - `<error_handling>` (always)118 - `<success_criteria>` (always)1194. Generate compaction section per chosen pattern using `bash scripts/compaction-template.sh <pattern>`.120121Update checkpoint: `GENERATED`.122`TaskUpdate` Phase 4 → completed.123</phase>124125<phase name="5_preview">126## Phase 5 — Preview to User127128Show the FULL generated SKILL.md content in the chat — no surprises before write.129130Ask via `AskUserQuestion`:131- **Approve** → write files (Phase 6)132- **Modify** → which section/field/wording? (free-form, then re-generate that section)133- **Abort** → archive current entry as ABORTED, exit cleanly134135Update checkpoint: `PREVIEWED`.136`TaskUpdate` Phase 5 → completed.137</phase>138139<phase name="6_write">140## Phase 6 — Write Files141142Only after Phase 5 approval:1431441. `Write` SKILL.md to `~/.claude/skills/<name>/SKILL.md` (or `~/.claude/commands/<name>.md` for slash-command form).1452. Write any reference files specified in intake to `references/`.1463. Write any script files specified to `scripts/` (with `chmod +x`).1474. Write initial state file scaffolding if stateful (with header + format docs + empty section).1485. If user wants slash-command shortcut → create `~/.claude/commands/<name>.md` with one-line `Skill(<name>)` delegate.149150Update checkpoint: `WRITTEN`.151`TaskUpdate` Phase 6 → completed.152</phase>153154<phase name="7_validate">155## Phase 7 — Validate + Test1561571. Run `bash scripts/validate-skill.sh <name>` — checks:158 - Frontmatter `description` ≤ 1,536 chars (combined with `when_to_use`)159 - Required tags present per `<execution_context>`'s skill-class160 - SKILL.md size — warn if > 500 lines or > ~5K tokens (auto-compaction truncation risk)161 - References referenced in `<context>` actually exist162 - Scripts referenced are executable1632. Optionally run a deeper structure audit if you have a skill-auditor command available.1643. Surface findings:165 - 🔴 must-fix (description too long, missing required tags, broken `@` references)166 - 🟡 should-fix (style inconsistencies, missing optional tags)167 - 🟢 nice-to-have (suggestions for improvement)1684. Optionally defer to Anthropic `skill-creator@claude-plugins-official` for eval iteration (offer to user — only if they want quantitative test prompts).169170Update state.md: append COMPLETED entry with skill name + template chosen + audit results + summary.171Apply rolling-window pruning if > 10 entries (compact older to one-liners in archive section).172173Update checkpoint: `COMPLETED`.174`TaskUpdate` Phase 7 → completed.175</phase>176177</process>178179<saved_rules_format>180## Saved Rules181182Stored in `state.md` "Saved Rules" section. Surfaced on every `/skill-maker` run as:183> "Previous rule found: '{rule_text}'. Apply this? (Yes / No / Delete rule)"184185Format per rule:186```187- {topic}: {rule} — set {YYYY-MM-DD}188```189190Examples (auto-discovered by observing the user's choices over time):191- naming: prefer kebab-case, prefix with category if part of a family (e.g., `myproject-*`)192- compaction-default: rolling-window-saved-rules (5 full + saved rules)193- attribution: only add `— [actor <time>]` suffix when ≥2 actors194- token-budget: keep SKILL.md under 500 lines (a common convention; not a hard cap)195</saved_rules_format>196197<recovery_protocol>198If `state.md` shows `IN_PROGRESS` when this skill starts:1992001. Identify last completed checkpoint from state entry (`INITIALIZED` / `INTENT_CAPTURED` / `INTAKE_COMPLETE` / `TEMPLATE_SELECTED` / `GENERATED` / `PREVIEWED` / `WRITTEN`).2012. Map checkpoint → next phase:202 - INITIALIZED → resume Phase 1203 - INTENT_CAPTURED → resume Phase 2204 - INTAKE_COMPLETE → resume Phase 3205 - TEMPLATE_SELECTED → resume Phase 4206 - GENERATED → resume Phase 5207 - PREVIEWED → resume Phase 6208 - WRITTEN → resume Phase 72093. Offer the user: **Resume** / **Start fresh** (archive previous as ABORTED) / **Show full history**.2104. On resume, append to existing entry; do NOT create new entry.2115. Update `updated_at` timestamp and `checkpoint:` field.212</recovery_protocol>213214<error_handling>215- **Skill name conflicts** with existing in `~/.claude/skills/<name>/` → ask: rename / overwrite / abort. Default: rename with `-v2` suffix.216- **`AskUserQuestion` times out** → treat as Skip; mark current entry as ABORTED in state.md.217- **Validation script fails** → log warning, complete generation anyway, recommend running the audit manually.218- **Template not found** in references/examples/ → fall back to `02-stateful-simple.md` (most common case).219- **State.md corrupted** → back up to `state.md.bak.<ts>`, create fresh `state.md`, warn user.220- **Description exceeds 1,536 char cap** → re-prompt for shorter version OR auto-truncate (preferring trigger phrases over prose).221- **Body exceeds 500 lines** at write time → suggest moving content to `references/` files (progressive disclosure).222</error_handling>223224<success_criteria>225- [ ] New skill exists at `~/.claude/skills/<name>/SKILL.md` with all required frontmatter fields226- [ ] All chosen XML tags present per skill-class (stateless / stateful-simple / stateful-checkpointed / stateful-multi-actor)227- [ ] References specified in intake actually written to `references/`228- [ ] Scripts specified are written + executable229- [ ] State file scaffolded if stateful (with format docs + empty section)230- [ ] Validation returns 0 🔴 findings231- [ ] `state.md` has new COMPLETED entry with chosen template + audit results232- [ ] Saved Rules accumulated if new patterns detected from this run233- [ ] The user can `/{new-skill-name}` and the skill loads + responds quickly234</success_criteria>235236## Direct actions the user can ask for237238If the user explicitly requests something (not full skill creation), handle accordingly:239240- **"Audit my skill X"** → run `bash scripts/validate-skill.sh X` (and a deeper auditor if available); show findings with fix suggestions241- **"Standardize skill X"** → read existing skill, diff against canonical scaffold, propose changes via `AskUserQuestion`242- **"Convert command to skill"** → migrate `~/.claude/commands/X.md` → `~/.claude/skills/X/SKILL.md` preserving content + restructuring243- **"Show me the style guide"** → display `references/skill-style.md`244- **"Show compaction patterns"** → display `references/compaction-patterns.md`245- **"Show frontmatter fields"** → display `references/frontmatter-fields.md`246- **"List my skills"** → `ls ~/.claude/skills/` + structured table with status247- **"Add Phase X to skill Y"** → augment existing skill with new phase, validate248249## What this skill deliberately does NOT do250251- **Never** modifies a skill without showing diff + getting Phase 5 preview approval252- **Never** auto-publishes (no auto-commit beyond the local skill dir; you commit when ready)253- **Never** modifies global `~/.claude/CLAUDE.md` without explicit ask254- **Never** deletes a skill (only archives by adding `.disabled` suffix at the user's explicit request)