Use when creating new skills, editing existing skills, or verifying skills work before deployment. TDD applied to process documentation.
Test-Driven Development (TDD) applied to process documentation.
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.
| 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 |
Frontmatter (YAML):
name and description (max 1024 chars total)description: Third-person, describes ONLY when to use (NOT what it does). Start with "Use when..."Body Sections:
Critical for discovery: Future AI agents need to FIND the skill.
--help for details instead of listing all flags.@path/to/SKILL.md (forces loading). Say: **REQUIRED SUB-SKILL:** Use [skill-name].Agents are smart and will find loopholes under pressure. Close them:
NO SKILL WITHOUT A FAILING TEST FIRST