create-agent-skills
This skill guides authors in creating and refining Claude Code Skills, which are modular filesystem-based capabilities delivered through SKILL.md files. Use it when building new skills, improving existing ones, or learning proper skill structure, XML formatting, progressive disclosure patterns, and validation approaches.
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow /tmp/create-agent-skills && cp -r /tmp/create-agent-skills/.claude/skills/create-agent-skills ~/.claude/skills/create-agent-skillsSKILL.md
<objective>
Agent Skills are modular, filesystem-based capabilities that provide domain-specific expertise through progressive disclosure. This Skill teaches you how to create effective Skills that Claude can discover and use successfully.
Skills are organized prompts that get loaded on-demand. All prompting best practices apply, with an emphasis on pure XML structure for consistent parsing and efficient token usage.
</objective>
<quick_start>
<workflow>
1. **Identify the reusable pattern**: What context or procedural knowledge would be useful for similar future tasks?
2. **Create directory and SKILL.md**:
- Directory name: Follow verb-noun convention: `create-*`, `manage-*`, `setup-*`, `generate-*` (see [references/skill-structure.md](references/skill-structure.md) for details)
- YAML frontmatter:
- `name`: Matches directory name, lowercase-with-hyphens, max 64 chars
- `description`: What it does AND when to use it (third person, max 1024 chars)
3. **If skill requires API credentials**: See [references/api-security.md](references/api-security.md) for credential setup
4. **Write concise instructions**: Assume Claude is smart. Only add context Claude doesn't have. Use pure XML structure.
5. **Test with real usage**: Iterate based on observations.
</workflow>
<example_skill>
```yaml
---
name: process-pdfs
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
---
<objective>
Extract text and tables from PDF files, fill forms, and merge documents using Python libraries.
</objective>
<quick_start>
Extract text with pdfplumber:
```python
import pdfplumber
with pdfplumber.open("file.pdf") as pdf:
text = pdf.pages[0].extract_text()
```
</quick_start>
<advanced_features>
**Form filling**: See [forms.md](forms.md)
**API reference**: See [reference.md](reference.md)
</advanced_features>
```
</example_skill>
</quick_start>
<xml_structure>
<required_tags>
All skills must have these tags:
- **`<objective>`** - What the skill does and why it matters
- **`<quick_start>`** - Immediate, actionable guidance
- **`<success_criteria>`** or **`<when_successful>`** - How to know it worked
</required_tags>
<conditional_tags>
Based on skill complexity, add these tags as needed:
- **`<context>`** - Background/situational information
- **`<workflow>` or `<process>`** - Step-by-step procedures
- **`<advanced_features>`** - Deep-dive topics (progressive disclosure)
- **`<validation>`** - How to verify outputs
- **`<examples>`** - Multi-shot learning
- **`<anti_patterns>`** - Common mistakes to avoid
- **`<security_checklist>`** - Non-negotiable security patterns
- **`<testing>`** - Testing workflows
- **`<common_patterns>`** - Code examples and recipes
- **`<reference_guides>` or `<detailed_references>`** - Links to reference files
</conditional_tags>
<critical_rule>
**Remove ALL markdown headings (#, ##, ###) from skill body content.** Replace with semantic XML tags. Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
</critical_rule>
</xml_structure>
<intelligence_rules>
<simple_skills>
Single domain, straightforward tasks: Use required tags only.
Example: Text extraction, file format conversion, simple API calls
</simple_skills>
<medium_skills>
Multiple patterns, some complexity: Use required tags + workflow/examples as needed.
Example: Document processing with multiple steps, API integration with configuration
</medium_skills>
<complex_skills>
Multiple domains, security concerns, API integrations: Use required tags + conditional tags as appropriate.
Example: Payment processing, authentication systems, multi-step workflows with validation
</complex_skills>
<principle>
Don't over-engineer simple skills. Don't under-specify complex skills. Match tag selection to actual complexity and user needs.
</principle>
</intelligence_rules>
<generation_protocol>
<step_0>
<description>
**Adaptive Requirements Gathering**: Before building, gather requirements through intelligent questioning that infers obvious details and asks about genuine gaps.
</description>
<critical_first_action>
**BEFORE doing anything else**, check if context was provided.
IF no context provided (user just invoked the skill without describing what to build):
→ **IMMEDIATELY use AskUserQuestion** with these exact options:
1. **Create a new skill** - Build a skill from scratch
2. **Update an existing skill** - Modify or improve an existing skill
3. **Get guidance on skill design** - Help me think through what kind of skill I need
**DO NOT** ask "what would you like to build?" in plain text. **USE the AskUserQuestion tool.**
Routing after selection:
- "Create new" → proceed to adaptive intake below
- "Update existing" → enumerate existing skills as numbered list (see below), then gather requirements for changes
- "Guidance" → help user clarify needs before building
<update_existing_flow>
When "Update existing" is selected:
1. **List all skills in chat as numbered list** (DO NOT use AskUserQuestion - there may be many skills):
- Glob for `~/.claude/skills/*/SKILL.md`
- Present as numbered list in chat:
```
Available skills:
1. create-agent-skills
2. generate-natal-chart
3. manage-stripe
...
```
- Ask: "Which skill would you like to update? (enter number)"
2. After user enters number, read that skill's SKILL.md
3. Ask what they want to change/improve using AskUserQuestion or direct question
4. Proceed with modifications
</update_existing_flow>
IF context was provided (user said "build a skill for X"):
→ Skip this gate. Proceed directly to adaptive intake.
</critical_first_action>
<adaptive_intake>
<analyze_description>
Parse the initial description:
- What's explicitly stated (operations, services, outputs)
- What can be inferred without asking (skill type, complexity, obvious patterns)
- What's genuinely unclear orExecute multiple sprints in parallel based on dependency graph from sprint-plan.md
Build and validate locally for projects without remote deployment (prototypes, experiments, local-only dev)
Execute multi-sprint epic workflow from interactive scoping through deployment with parallel sprint execution and self-improvement
Execute feature development workflow from specification through production deployment with automated quality gates
Analyze workflow state and provide context-aware guidance with visual progress indicators and recommended next steps
Initialize project documentation, preferences, or design tokens
Implement small bug fixes and features (<100 LOC) without full workflow. Use for single-file changes, bug fixes, refactors, and minor enhancements that can be completed in under 30 minutes.
Enter deep craftsman mode - question everything, plan like Da Vinci, craft insanely great solutions, then materialize to roadmap