create-skill

Guide 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 skills, or verifying ski

By neolabhq · 1,082 installs

npx skills add neolabhq/context-engineering-kit --skill create-skill

Source repository · Upstream listing

Create Skill Command This command provides guidance for creating effective skills. Overview Writing skills IS Test Driven Development applied to process documentation. Personal skills live in agent specific directories ( ~/.claude/skills for Claude Code, ~/.codex/skills for Codex) 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). Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing. 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. 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. About Skills Skills are modular, self contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess. What is a Skill? A skill is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches. Skills are: Reusable techniques, patterns, tools, reference guides Skills are NOT: Narratives about how you solved a problem once What Skills Provide 1. Specialized workflows Multi step procedures for specific domains 2. Tool integrations Instructions for working with specific file formats or APIs 3. Domain expertise Company specific knowledge, schemas, business logic 4. Bundled resources Scripts, references, and assets for complex and repetitive tasks TDD Mapping for Skills TDD Concept Skill Creation Test case Pressure scenario with subagent Production code Skill document (SKILL.md) Test fails (RED) Agent violates rule without skill (baseline) Test passes (GREEN) Agent complies with skill present Refactor Close loopholes while maintaining compliance Write test first Run baseline scenario BEFORE writing skill Watch it fail Document exact rationalizations agent uses Minimal code Write skill addressing those specific violations Watch it pass Verify agent now complies Refactor cycle Find new rationalizations → plug → re verify The entire skill creation process follows RED GREEN REFACTOR. When to Create a Skill Create when: Technique wasn't intuitively obvious to you You'd reference this again across projects Pattern applies broadly (not project specific) Others would benefit Don't create for: One off solutions Standard practices well documented elsewhere Project specific conventions (put in CLAUDE.md) Skill Types Technique Concrete method with steps to follow (condition based waiting, root cause tracing) Pattern Way of thinking about problems (flatten with flags, test invariants) Reference API docs, syntax guides, tool documentation (office docs) Directory Structure Flat namespace all skills in one searchable namespace Separate files for: 1. Heavy reference (100+ lines) API docs, comprehensive syntax 2. Reusable tools Scripts, utilities, templates Keep inline: Principles and concepts Code patterns (< 50 lines) Everything else Anatomy of a Skill Every skill consists of a required SKILL.md file and optional bundled resources: SKILL.md (required) Metadata Quality: The name and description in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third person (e.g. "This skill should be used when..." instead of "Use this skill when..."). SKILL.md Structure Frontmatter (YAML): Only two fields supported: name and description Max 1024 characters total name : Use letters, numbers, and hyphens only (no parentheses, special chars) description : Third person, includes BOTH what it does AND when to use it Start with "Use when..." to focus on triggering conditions Include specific symptoms, situations, and contexts Keep under 500 characters if possible Bundled Resources (optional) Scripts ( scripts/ ) Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten. When to include : When the same code is being rewritten repeatedly or deterministic reliability is needed Example : scripts/rotate pdf.py for PDF rotation tasks Benefits : Token efficient, deterministic, may be executed without loading into context Note : Scripts may still need to be read by Claude for patching or environment specific adjustments References ( references/ ) Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking. When to include : For documentation that Claude should reference while working Examples : references/finance.md for financial schemas, references/mnda.md for company NDA template, references/policies.md for company policies, references/api docs.md for API specifications Use cases : Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides Benefits : Keeps SKILL.md lean, loaded only when Claude determines it's needed Best practice : If files are large ( 10k words), include grep search patterns in SKILL.md Avoid duplication : Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files. Assets ( assets/ ) Files not intended to be loaded into context, but rather used within the output Claude produces. When to include : When the skill needs files that will be used in the final output Examples : assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend template/ for HTML/React boilerplate, assets/font.ttf for typography Use cases : Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified Benefits : Separates output resources from documentation, enables Claude to use files without loading them into context Progressive Disclosure Design Principle Skills use a three level loading system to manage context efficiently: 1. Metadata (name + description) Always in context (~100 words) 2. SKILL.md body When skill triggers (<5k words) 3. Bundled resources As needed by Claude (Unlimited ) Unlimited because scripts can be executed without reading into context window. Claude Search Optimization (CSO) Critical for discovery: Future Claude needs to FIND your skill 1. Rich Description Field Purpose: Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?" Format: Start with "Use when..." to focus on triggering conditions, then explain what it does Content: Use concrete triggers, symptoms, and situations that signal this skill applies Describe the problem (race conditions, inconsistent behavior) not language specific symptoms (setTimeout, sleep) Keep triggers technology agnostic unless the skill itself is technology specific If skill is technology specific, make that explicit in the trigger Write in third person (injected into system prompt) 2. Keyword Coverage Use words Claude would search for: Error messages: "Hook timed out", "ENOTEMPTY", "race condition" Symptoms: "flaky", "hanging", "zombie", "pollution" Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach" Tools: Actual commands, library names, file types 3. Descriptive Naming Use active voice, verb first: ✅ creating skills not skill creation ✅ testing skills with subagents not subagent skill testing 4. Token Efficiency (Critical) Problem: getting started and frequently referenced skills load into EVERY conversation. Every token counts. Target word counts: getting started workflows: <150 words each Frequently loaded skills: <200 words total Other skills: <500 words (still be concise) Techniques: Move details to tool help: Use cross references: Compress examples: Eliminate redundancy: Don't repeat what's in cross referenced skills Don't explain what's obvious from command Don't include multiple examples of same pattern Verification: Name by what you DO or core insight: ✅ condition based waiting async test helpers ✅ using skills not skill usage ✅ flatten with flags data structure refactoring ✅ root cause tracing debugging techniques Gerunds ( ing) work well for processes: creating skills , testing skills , debugging with logs Active, describes the action you're taking 4. Cross Referencing Other Skills When writing documentation that references other skills: Use skill name only, with explicit requirement markers: ✅ Good: REQUIRED SUB SKILL: Use superpowers:test driven development ✅ Good: REQUIRED BACKGROUND: You MUST understand superpowers:systematic debugging ❌ Bad: See skills/testing/test driven development (unclear if required) ❌ Bad: @skills/testing/test driven development/SKILL.md (force loads, burns context) Why no @ links: @ syntax force loads files immediately, consuming 200k+ context before you need them. Flowchart Usage Use flowcharts ONLY for: Non obvious decision points Process loops where you might stop too early "When to use A vs B" decisions Never use flowcharts for: Reference material → Tables, lists Code examples → Markdown blocks Linear instructions → Numbered lists Labels without semantic meaning (step1, helper2) See [graphviz conventions.dot](https://github.com/obra/superpowers/blob/main/skills/writing skills/graphviz conventions.dot) for graphviz style rules. Code Examples One excellent example beats many mediocre ones Choose most relevant language: Testing techniques → TypeScript/JavaScript System debugging → Shell/Python Data processing → Python Good example: Complete and runnable Well commented explaining WHY From real scenario Shows pattern clearly Ready to adapt (not generic template) Don't: Implement in 5+ languages Create fill in the blank templates Write contrived examples You're good at porting one great example is enough. File Organization Self Contained Skill When: All content fits, no heavy reference needed Skill with Reusable Tool When: Tool is reusable code, not just narrative Skill with Heavy Reference When: Reference material too large for inline The Iron Law (Same as TDD) Testing All Skill Types Different skill types need different test approaches: Discipline Enforcing Skills (rules/requirements) Examples: TDD, verification before completion, designing before coding Test with: Academic questions: Do they understand the rules? Pressure scenarios: Do they comply under stress? Multiple pressures combined: time + sunk cost + exhaustion Identify rationalizations and add explicit counters Success crite