/dmi-superpowers:writing-skillsfrom dmi-superpowers
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Ships in dmi-superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Writing skills IS Test-Driven Development applied to process documentation.
Setup notes (personal skills directory paths per runtime): see reference.md. Per-runtime tool docs with the exact path: claude-code-tools.md, codex-tools.md, copilot-tools.md, gemini-tools.md.
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 dmi-superpowers:test-driven-development before using this skill.
The eval procedure lives in docs/evals/README.md (ADR-0006): dispatch subagents against the current skill text to establish a baseline, make the change, re-run, and report both arms. AGENTS.md gates PRs on that evidence, so produce it there rather than inventing a method. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
Official guidance pointer and "What is a Skill?": see reference.md.
| 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, skill types, and directory structure: see reference.md.
Frontmatter (YAML):
name and description (see agentskills.io/specification for all supported fields)name: Use letters, numbers, and hyphens only (no parentheses, special chars)description: Third-person, describes ONLY when to use (NOT what it does)
Full SKILL.md template: see examples.md.
Critical for discovery: Future agents need to FIND your skill
Purpose: Your agent reads the 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
CRITICAL: Description = When to Use, NOT What the Skill Does
The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
Why this matters: Testing revealed that when a description summarizes the skill's workflow, an agent may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).
When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), the agent correctly read the flowchart and followed the two-stage review process.
The trap: Descriptions that summarize workflow create a shortcut agents will take. The skill body becomes documentation agents skip.
# ❌ BAD: Summarizes workflow - agents may follow this instead of reading skill
description: Use when executing plans - dispatches subagent per task with code review between tasks
# ❌ BAD: Too much process detail
description: Use for TDD - write test first, watch it fail, write minimal code, refactor
# ✅ GOOD: Just triggering conditions, no workflow summary
description: Use when executing implementation plans with independent tasks in the current session
# ✅ GOOD: Triggering conditions only
description: Use when implementing any feature or bugfix, before writing implementation code
Content:
More bad/good description examples: see examples.md.
Keyword coverage and descriptive naming guidance: see reference.md.
Token efficiency techniques and examples: see examples.md.
Cross-referencing other skills (guidance and why no @ links): see reference.md.
Flowchart example: see examples.md.
Use flowcharts ONLY for:
Never use flowcharts for:
Graphviz style rules and flowchart rendering tool: see examples.md.
Code example guidance: see examples.md.
File organization patterns: see reference.md.
NO SKILL WITHOUT A FAILING TEST FIRST
This applies to NEW skills AND EDITS to existing skills.
Write skill before testing? Delete it. Start over. Edit skill without testing? Same violation.
No exceptions:
REQUIRED BACKGROUND: The dmi-superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.
Testing approaches by skill type, common rationalizations for skipping testing, the prohibitions-vs-recipes discussion ("Match the Form to the Failure"), the full bulletproofing/rationalization catalog, the RED-GREEN-REFACTOR phase elaboration, and wording-test evidence for micro-testing: see bulletproofing.md. For the complete pressure-scenario methodology (writing pressure scenarios, pressure types, plugging holes systematically, meta-testing): see testing-skills-with-subagents.md.
Anti-pattern examples (narrative examples, multi-language dilution, code-in-flowcharts, generic labels): see examples.md.
After writing ANY skill, you MUST STOP and complete the deployment process.
Do NOT:
The deployment checklist below is MANDATORY for EACH skill.
Deploying untested skills = deploying untested code. It's a violation of quality standards.
Full RED/GREEN/REFACTOR/Quality-Checks checklist phases: see bulletproofing.md.
Deployment:
Discovery workflow and the bottom line: see reference.md.
bulletproofing.md (opens in a new tab)examples.md (opens in a new tab)examples/CLAUDE_MD_TESTING.md (opens in a new tab)graphviz-conventions.dot (opens in a new tab)persuasion-principles.md (opens in a new tab)reference.md (opens in a new tab)render-graphs.js (opens in a new tab)testing-skills-with-subagents.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub hundredbillion/dmi_superpowers --plugin dmi-superpowers39 skills in this plugin
/attack-the-premiseUse when two or more fixes that share one assumption have failed the same gate — the fixes are right-shaped but the same thing keeps going wrong/benchmark-checklistUse when measuring, verifying, interpreting, or reporting a performance claim about speed, latency, memory, or throughput/blast-radiusUse when a change's safety is unclear — a risky diff you do not trust, a small change to shared code, a refactor that could break a neighbor — before it ships/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./create-verification-skillUse when an end-to-end check must be repeatable — a deployment gate, a CI check, a "this must work every time" ritual — that currently lives in a prompt or a memory rather than a permanent skill