|
| 1 | +--- |
| 2 | +name: skill-forge |
| 3 | +description: > |
| 4 | + Create new skills or improve existing ones for Claude Code. Use when the |
| 5 | + user says "forge a skill", "create a skill", "new skill", "skill from", |
| 6 | + "skill based on", "make a skill like", or wants to build, update, or |
| 7 | + improve a skill from any source of inspiration (URLs, files, ideas). |
| 8 | +--- |
| 9 | + |
| 10 | +# Skill Forge |
| 11 | + |
| 12 | +Build skills for Claude Code. Collaborate with the user on design, create directly in the target directory. |
| 13 | + |
| 14 | +**Target directory:** Always create skills in the `skills/` folder of the `agentfiles` repository. If the current working directory is not inside `agentfiles/`, search for it (e.g. `find ~ -maxdepth 4 -type d -name agentfiles 2>/dev/null | head -1`). NEVER create skills in `~/.claude/skills/`. |
| 15 | + |
| 16 | +## Skill Anatomy |
| 17 | + |
| 18 | +``` |
| 19 | +skill-name/ |
| 20 | +├── SKILL.md (required — frontmatter + instructions) |
| 21 | +├── scripts/ (optional — deterministic/reusable code) |
| 22 | +├── references/ (optional — docs loaded into context on demand) |
| 23 | +└── assets/ (optional — files used in output, not loaded into context) |
| 24 | +``` |
| 25 | + |
| 26 | +### Frontmatter |
| 27 | + |
| 28 | +Only two fields: `name` and `description`. Nothing else. |
| 29 | + |
| 30 | +The `description` is the **sole trigger mechanism** — Claude reads it to decide when to activate the skill. Pack it with concrete trigger phrases and scenarios. Under 1024 chars, no angle brackets. |
| 31 | + |
| 32 | +### Progressive Disclosure |
| 33 | + |
| 34 | +Context is a shared resource. Skills load in three tiers: |
| 35 | + |
| 36 | +1. **Metadata** (name + description) — always in context (~100 words) |
| 37 | +2. **SKILL.md body** — loaded when skill triggers (<5k words) |
| 38 | +3. **Bundled resources** — loaded on demand by Claude as needed |
| 39 | + |
| 40 | +Keep SKILL.md under 200 lines. Split to references/ when approaching the limit. |
| 41 | + |
| 42 | +### When to Bundle Resources |
| 43 | + |
| 44 | +| Type | When to include | Example | |
| 45 | +|------|----------------|---------| |
| 46 | +| Scripts | Same code rewritten repeatedly or determinism required | `scripts/rotate_pdf.py` | |
| 47 | +| References | Domain knowledge Claude needs while working | `references/schema.md` | |
| 48 | +| Assets | Files used in output (templates, images) | `assets/template.html` | |
| 49 | + |
| 50 | +Most skills need only SKILL.md. Don't create resources speculatively. |
| 51 | + |
| 52 | +## Style |
| 53 | + |
| 54 | +- **Shorter is better.** Tables over prose. Only add what Claude doesn't already know. |
| 55 | +- **Imperative voice** throughout the body. |
| 56 | +- **No auxiliary files** — no README.md, CHANGELOG.md, INSTALLATION_GUIDE.md. |
| 57 | +- **Earn every line.** If Claude would figure it out on its own, cut it. |
| 58 | +- Concrete examples > verbose explanations. |
| 59 | + |
| 60 | +## Workflow |
| 61 | + |
| 62 | +### 1. Understand |
| 63 | + |
| 64 | +Ask the user what skill they want. Use `AskUserQuestion` in batches of 2-3: |
| 65 | + |
| 66 | +- What does the skill do? What problem does it solve? |
| 67 | +- What would a user say to invoke it? (concrete trigger phrases) |
| 68 | +- Any inspiration sources? (URLs, files, existing tools, ideas) |
| 69 | + |
| 70 | +If the user provides inspiration sources (URLs, files, repos, docs), read them and extract: purpose, structure, patterns worth keeping, things to improve. |
| 71 | + |
| 72 | +### 2. Design |
| 73 | + |
| 74 | +Based on the conversation, define: |
| 75 | + |
| 76 | +| Field | Value | |
| 77 | +|-------|-------| |
| 78 | +| Name | `skill-name` | |
| 79 | +| Description | Trigger phrases + when to use | |
| 80 | +| Steps/Sections | The body structure | |
| 81 | +| Resources | scripts/, references/, assets/ needed (or "none") | |
| 82 | + |
| 83 | +Before creating, scan the target directory for existing skills to **avoid overlap**: |
| 84 | + |
| 85 | +``` |
| 86 | +Glob pattern="<target-dir>/*/SKILL.md" |
| 87 | +``` |
| 88 | + |
| 89 | +Present the design summary to the user. Get confirmation before writing. |
| 90 | + |
| 91 | +### 3. Create |
| 92 | + |
| 93 | +**New skill:** |
| 94 | +1. Create directory `<target-dir>/<skill-name>/`. |
| 95 | +2. Write SKILL.md — frontmatter + body. |
| 96 | +3. Add any resources designed in step 2. Nothing extra. |
| 97 | + |
| 98 | +**Existing skill (update):** |
| 99 | +Edit files directly. No re-creation. |
| 100 | + |
| 101 | +**Structural patterns for the body:** |
| 102 | + |
| 103 | +For multi-step workflows, use numbered headings: |
| 104 | +```markdown |
| 105 | +### 1. Step Name |
| 106 | +### 2. Step Name |
| 107 | +``` |
| 108 | + |
| 109 | +For branching logic, guide through decision points: |
| 110 | +```markdown |
| 111 | +**Creating new?** → Follow "Creation" below |
| 112 | +**Editing existing?** → Follow "Editing" below |
| 113 | +``` |
| 114 | + |
| 115 | +For specific output formats, include a concrete input/output example rather than describing the format in prose. |
| 116 | + |
| 117 | +### 4. Validate |
| 118 | + |
| 119 | +Read the final SKILL.md and verify: |
| 120 | + |
| 121 | +| Check | Criteria | |
| 122 | +|-------|----------| |
| 123 | +| Triggers | Description has concrete phrases, not vague terms | |
| 124 | +| Length | Under 200 lines | |
| 125 | +| Clean | No TODOs, no template leftovers | |
| 126 | +| Overlap | Doesn't duplicate existing skills in target directory | |
| 127 | +| Voice | Imperative throughout | |
| 128 | +| Files | Only files the agent actually needs | |
| 129 | +| Frontmatter | Only `name` and `description` | |
| 130 | +| Description | Under 1024 chars, no angle brackets | |
| 131 | + |
| 132 | +Fix issues found, then present the final skill to the user. |
0 commit comments