$npx -y skills add AgriciDaniel/skill-forge --skill skill-forge-buildScaffold and build Claude Code skills from plans or descriptions. Generates SKILL.md files, sub-skills, scripts, references, agents, and templates following the Agent Skills standard. Use when user says "build skill", "scaffold skill", "generate skill", "create SKILL.md", or "imp
| 1 | # Skill Builder — Scaffold & Generate |
| 2 | |
| 3 | ## Process |
| 4 | |
| 5 | ### Step 1: Gather Inputs |
| 6 | |
| 7 | Determine what we're building from: |
| 8 | - **Plan document**: Output from `/skill-forge plan` (preferred) |
| 9 | - **Description**: Natural language description of the skill |
| 10 | - **Existing skill**: Path to a skill to use as foundation |
| 11 | |
| 12 | If no plan exists, run a quick planning pass (ask 3 key questions): |
| 13 | 1. What does the skill do? (1-2 sentences) |
| 14 | 2. What commands should it have? (list) |
| 15 | 3. Does it need scripts or external tools? (yes/no) |
| 16 | |
| 17 | ### Step 2: Generate Frontmatter |
| 18 | |
| 19 | The most critical step. The description field determines activation. |
| 20 | |
| 21 | **Framework for writing descriptions:** |
| 22 | |
| 23 | ``` |
| 24 | [Capability statement] + [Detailed capabilities] + [Trigger phrases] |
| 25 | ``` |
| 26 | |
| 27 | **Rules:** |
| 28 | - Under 1024 characters total |
| 29 | - No XML angle brackets (< >) |
| 30 | - Include 5-10 trigger phrases users would say |
| 31 | - Mention file types if relevant |
| 32 | - Add negative triggers if risk of over-triggering |
| 33 | |
| 34 | **Use `references/description-guide.md` for the full framework.** |
| 35 | |
| 36 | ### Step 3: Write Main SKILL.md |
| 37 | |
| 38 | Structure the body following this template: |
| 39 | |
| 40 | ```markdown |
| 41 | # [Skill Name] -- [Tagline] |
| 42 | |
| 43 | [1-2 sentence overview] |
| 44 | |
| 45 | ## Quick Reference |
| 46 | |
| 47 | | Command | What it does | |
| 48 | |---------|-------------| |
| 49 | | /name cmd1 | Description | |
| 50 | | /name cmd2 | Description | |
| 51 | |
| 52 | ## Orchestration Logic |
| 53 | |
| 54 | [How commands route to sub-skills] |
| 55 | [Decision trees for conditional routing] |
| 56 | |
| 57 | ## [Domain-Specific Section] |
| 58 | |
| 59 | [Core rules, thresholds, quality gates] |
| 60 | |
| 61 | ## Reference Files |
| 62 | |
| 63 | [List of on-demand reference files] |
| 64 | |
| 65 | ## Sub-Skills |
| 66 | |
| 67 | [List of sub-skills with one-line descriptions] |
| 68 | ``` |
| 69 | |
| 70 | **Critical SKILL.md rules:** |
| 71 | - Under 500 lines |
| 72 | - Under 5000 tokens |
| 73 | - Actionable instructions (not vague) |
| 74 | - Include error handling |
| 75 | - Link references, don't inline them |
| 76 | |
| 77 | ### Step 4: Generate Sub-Skills (Tier 3-4) |
| 78 | |
| 79 | For each sub-skill, generate a SKILL.md with: |
| 80 | |
| 81 | ```yaml |
| 82 | --- |
| 83 | name: parent-child |
| 84 | description: > |
| 85 | [What it does]. Use when user says "[trigger 1]", "[trigger 2]", |
| 86 | "[trigger 3]", or "[trigger 4]". |
| 87 | --- |
| 88 | ``` |
| 89 | |
| 90 | **Sub-skill body guidelines:** |
| 91 | - Self-contained instructions for ONE workflow |
| 92 | - Cross-reference other sub-skills by name (not inline their content) |
| 93 | - Reference shared files in the parent skill's `references/` directory |
| 94 | - Include explicit input/output definitions |
| 95 | |
| 96 | ### Step 5: Generate Scripts (Tier 2-4) |
| 97 | |
| 98 | For each script: |
| 99 | |
| 100 | ```python |
| 101 | #!/usr/bin/env python3 |
| 102 | """ |
| 103 | Purpose: [What this script does] |
| 104 | Input: [Expected input format] |
| 105 | Output: [Expected output format] |
| 106 | Usage: python scripts/script_name.py [args] |
| 107 | """ |
| 108 | |
| 109 | import argparse |
| 110 | import json |
| 111 | import sys |
| 112 | from typing import Any |
| 113 | |
| 114 | |
| 115 | def main(args: argparse.Namespace) -> dict[str, Any]: |
| 116 | """Main execution function.""" |
| 117 | # Validate inputs |
| 118 | # Do the work |
| 119 | # Return structured output |
| 120 | pass |
| 121 | |
| 122 | |
| 123 | if __name__ == "__main__": |
| 124 | parser = argparse.ArgumentParser(description="[Script description]") |
| 125 | parser.add_argument("input", help="[Input description]") |
| 126 | parser.add_argument("--output", "-o", help="Output file path") |
| 127 | args = parser.parse_args() |
| 128 | |
| 129 | try: |
| 130 | result = main(args) |
| 131 | print(json.dumps(result, indent=2)) |
| 132 | except Exception as e: |
| 133 | print(json.dumps({"error": str(e)}), file=sys.stderr) |
| 134 | sys.exit(1) |
| 135 | ``` |
| 136 | |
| 137 | **Script rules:** |
| 138 | - One script, one responsibility |
| 139 | - CLI interface with argparse |
| 140 | - Structured JSON output |
| 141 | - Clear error messages |
| 142 | - No dependencies beyond stdlib when possible |
| 143 | |
| 144 | ### Step 6: Generate Reference Files |
| 145 | |
| 146 | For each reference file: |
| 147 | - Focus on ONE topic |
| 148 | - Under 200 lines |
| 149 | - Include concrete examples |
| 150 | - Use tables for thresholds and specifications |
| 151 | - Mark with "Load on-demand" in parent SKILL.md |
| 152 | |
| 153 | ### Step 7: Generate Agent Definitions (Tier 4) |
| 154 | |
| 155 | Agent files use YAML frontmatter (different from skills): |
| 156 | |
| 157 | ```markdown |
| 158 | --- |
| 159 | name: [skill-name]-[role] |
| 160 | description: > |
| 161 | [What this agent analyzes]. |
| 162 | <example>User says: "[trigger]"</example> |
| 163 | model: inherit |
| 164 | color: blue |
| 165 | tools: |
| 166 | - Read |
| 167 | - Grep |
| 168 | - Glob |
| 169 | --- |
| 170 | |
| 171 | You are a [role] specialist. |
| 172 | |
| 173 | ## Your Role |
| 174 | [What this agent does] |
| 175 | |
| 176 | ## Process |
| 177 | 1. [Steps...] |
| 178 | |
| 179 | ## Output Format |
| 180 | Return structured markdown with findings and recommendations. |
| 181 | ``` |
| 182 | |
| 183 | **Key differences from skills:** Agent `name` is 3-50 chars, descriptions CAN use |
| 184 | `<example>` blocks, agent-only fields include `tools`, `color`, `permissionMode`, |
| 185 | `maxTurns`, `memory`. Body becomes the system prompt (second person). |
| 186 | |
| 187 | ### Step 8: Generate Install Script |
| 188 | |
| 189 | Create `install.sh` that copies files to `~/.claude/skills/` and `~/.claude/agents/`. |
| 190 | |
| 191 | ### Step 9: Validate |
| 192 | |
| 193 | Run `python scripts/validate_skill.py <path>` on the generated skill. |
| 194 | Check all quality gates from the main SKILL.md. |
| 195 | |
| 196 | ### Step 10: Output Summary |
| 197 | |
| 198 | Present the user with: |
| 199 | 1. Generated file tree |
| 200 | 2. Key f |