Guide for creating effective skills.
Guide for creating skills in Claude Code's skill directory.
Skills are modular packages providing specialized knowledge, workflows, and tools. Transform Claude from general to specialized agent with procedural knowledge.
Context window is public good. Only add what Claude doesn't know. Challenge each piece: "Does Claude need this?"
Default: Claude is smart. Add only non-obvious info.
High freedom (text): Multiple valid approaches, context-dependent Medium freedom (pseudocode/params): Preferred pattern, some variation Low freedom (scripts): Fragile operations, consistency critical
MANDATORY: Every skill MUST be structured as a directory, NOT a single file.
Required structure:
skill-name/ (lowercase letters, numbers, hyphens only)SKILL.md file (UPPERCASE, exactly this filename)Correct examples:
git-commit/SKILL.mdpdf-processing/SKILL.mddata-analyzer/SKILL.mdWrong examples:
git-commit.md (single file, not directory)git-commit/skill.md (lowercase)git-commit/README.md (wrong filename)skill-name/
├── SKILL.md (required - UPPERCASE)
│ ├── YAML frontmatter (name, description)
│ └── Markdown instructions
├── reference.md (optional - root-level docs)
├── examples.md (optional - root-level docs)
├── scripts/ (optional)
│ └── helper.py - Executable code
└── templates/ (optional)
└── template.txt - Files used in output
name and description - triggers when Claude uses skillScripts (scripts/) - Executable code for deterministic/repeated tasks
scripts/rotate_pdf.py, scripts/fill_form.pyReference docs (root-level .md files) - Docs loaded as needed
reference.md, api_docs.md, workflows.mdreferences/ subdirectoryTemplates (templates/) - Files used in output, not loaded to context
templates/starter-project/, templates/document.docxNo auxiliary docs:
Only info needed for AI agent to work.
Three-level loading:
Keep SKILL.md <500 lines. Split when approaching limit.
Pattern: High-level guide with references
## Quick start
[core example]
## Advanced
- **Forms**: See ./forms.md
- **API**: See ./api-reference.md
Skip if usage patterns clear.
Ask for concrete examples:
Avoid overwhelming - ask most important questions first.
Conclude when functionality clear.
Analyze each example:
Example: pdf-editor
scripts/rotate_pdf.pyExample: frontend-webapp-builder
templates/hello-world/ starter projectExample: big-query
schema.md (root-level reference)Output: List of reusable resources needed.
Skip if skill exists.
Run init script from repo root:
python3 ./skills/skill-creator/scripts/init_skill.py <skill-name> --path <output-directory>
Example:
python3 ./skills/skill-creator/scripts/init_skill.py brainwriting --path ./.claude/skills
Creates:
Consult:
Implement resources first: scripts, reference docs, templates. May need user input (brand assets, docs).
Test scripts - run to verify no bugs. Delete unused example files.
Writing: Use imperative/infinitive form.
Frontmatter:
name: Skill namedescription: What it does + when to use. Specific, comprehensive, direct. Claude uses this to choose from 100+ skills.Body: Instructions for using skill and resources.
Script will:
Default priority:
./.claude/skills/ (project-local)~/.claude/skills/ (user-global)Validation checks:
If validation fails, fix errors and re-run.
Test skill on real tasks. Notice struggles → identify improvements → implement → test.