$npx -y skills add NeoLabHQ/context-engineering-kit --skill create-skillGuide for creating effective skills. This command should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations. Use when creating new skills, editing existing skil
| 1 | # Create Skill Command |
| 2 | |
| 3 | This command provides guidance for creating effective skills. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | **Writing skills IS Test-Driven Development applied to process documentation.** |
| 8 | |
| 9 | **Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.codex/skills` for Codex)** |
| 10 | |
| 11 | You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes). |
| 12 | |
| 13 | **Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing. |
| 14 | |
| 15 | **REQUIRED BACKGROUND:** You MUST understand Test-Driven Development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation. |
| 16 | |
| 17 | **Official guidance:** The Anthropic's official skill authoring best practices provided at the `/apply-anthropic-skill-best-practices` command, they enhance `prompt-engineering` skill. Use skill and the document, as they not copy but add to each other. These document provides additional patterns and guidelines that complement the TDD-focused approach in this skill. |
| 18 | |
| 19 | ## About Skills |
| 20 | |
| 21 | Skills are modular, self-contained packages that extend Claude's capabilities by providing |
| 22 | specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific |
| 23 | domains or tasks—they transform Claude from a general-purpose agent into a specialized agent |
| 24 | equipped with procedural knowledge that no model can fully possess. |
| 25 | |
| 26 | ## What is a Skill? |
| 27 | |
| 28 | A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches. |
| 29 | |
| 30 | **Skills are:** Reusable techniques, patterns, tools, reference guides |
| 31 | |
| 32 | **Skills are NOT:** Narratives about how you solved a problem once |
| 33 | |
| 34 | ### What Skills Provide |
| 35 | |
| 36 | 1. Specialized workflows - Multi-step procedures for specific domains |
| 37 | 2. Tool integrations - Instructions for working with specific file formats or APIs |
| 38 | 3. Domain expertise - Company-specific knowledge, schemas, business logic |
| 39 | 4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks |
| 40 | |
| 41 | ## TDD Mapping for Skills |
| 42 | |
| 43 | | TDD Concept | Skill Creation | |
| 44 | |-------------|----------------| |
| 45 | | **Test case** | Pressure scenario with subagent | |
| 46 | | **Production code** | Skill document (SKILL.md) | |
| 47 | | **Test fails (RED)** | Agent violates rule without skill (baseline) | |
| 48 | | **Test passes (GREEN)** | Agent complies with skill present | |
| 49 | | **Refactor** | Close loopholes while maintaining compliance | |
| 50 | | **Write test first** | Run baseline scenario BEFORE writing skill | |
| 51 | | **Watch it fail** | Document exact rationalizations agent uses | |
| 52 | | **Minimal code** | Write skill addressing those specific violations | |
| 53 | | **Watch it pass** | Verify agent now complies | |
| 54 | | **Refactor cycle** | Find new rationalizations → plug → re-verify | |
| 55 | |
| 56 | The entire skill creation process follows RED-GREEN-REFACTOR. |
| 57 | |
| 58 | ## When to Create a Skill |
| 59 | |
| 60 | **Create when:** |
| 61 | |
| 62 | - Technique wasn't intuitively obvious to you |
| 63 | - You'd reference this again across projects |
| 64 | - Pattern applies broadly (not project-specific) |
| 65 | - Others would benefit |
| 66 | |
| 67 | **Don't create for:** |
| 68 | |
| 69 | - One-off solutions |
| 70 | - Standard practices well-documented elsewhere |
| 71 | - Project-specific conventions (put in CLAUDE.md) |
| 72 | |
| 73 | ## Skill Types |
| 74 | |
| 75 | ### Technique |
| 76 | |
| 77 | Concrete method with steps to follow (condition-based-waiting, root-cause-tracing) |
| 78 | |
| 79 | ### Pattern |
| 80 | |
| 81 | Way of thinking about problems (flatten-with-flags, test-invariants) |
| 82 | |
| 83 | ### Reference |
| 84 | |
| 85 | API docs, syntax guides, tool documentation (office docs) |
| 86 | |
| 87 | ## Directory Structure |
| 88 | |
| 89 | ``` |
| 90 | skills/ |
| 91 | skill-name/ |
| 92 | SKILL.md # Main reference (required) |
| 93 | supporting-file.* # Only if needed |
| 94 | ``` |
| 95 | |
| 96 | **Flat namespace** - all skills in one searchable namespace |
| 97 | |
| 98 | **Separate files for:** |
| 99 | |
| 100 | 1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax |
| 101 | 2. **Reusable tools** - Scripts, utilities, templates |
| 102 | |
| 103 | **Keep inline:** |
| 104 | |
| 105 | - Principles and concepts |
| 106 | - Code patterns (< 50 lines) |
| 107 | - Everything else |
| 108 | |
| 109 | ## Anatomy of a Skill |
| 110 | |
| 111 | Every skill consists of a required SKILL.md file and optional bundled resources: |
| 112 | |
| 113 | ``` |
| 114 | skill-name/ |
| 115 | ├── SKILL.md (required) |
| 116 | │ ├── YAML frontmatter metadata (required) |
| 117 | │ │ ├── name: (required) |
| 118 | │ │ └── description: (required) |
| 119 | │ └── Markdown instructions (required) |
| 120 | └── Bundled Resources (optional) |
| 121 | ├── scripts/ - Executable code (Python/Bash/etc.) |
| 122 | ├── references/ - Docu |