/general:writing-skillsfrom general
Creates, edits, and verifies Claude Code skills using a TDD approach: write pressure scenarios, watch agents fail, document the skill, then verify compliance.
Ships in general. 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.
Write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), then refactor (close loopholes).
Core principle: If you did not watch an agent fail without the skill, you do not know if the skill teaches the right thing.
Background: Understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
Official guidance: For Anthropic's official skill authoring best practices, see anthropic-best-practices.md. That document complements the TDD-focused approach here.
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 a problem was solved once.
| 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.
Create when:
Do not create for:
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing).
Way of thinking about problems (flatten-with-flags, test-invariants).
API docs, syntax guides, tool documentation.
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed
Flat namespace — all skills in one searchable namespace.
Separate files for:
Keep inline:
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 when to use (not what the skill does)
---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---
# Skill Name
## Overview
What is this? Core principle in 1-2 sentences.
## When to Use
[Small inline flowchart IF decision non-obvious]
Bullet list with symptoms and use cases.
When NOT to use.
## Checklist
A checklist of TODO items for this skill.
Usually starts with invoking research: skills.
## Core Pattern (for techniques/patterns)
Before/after code comparison.
## Quick Reference
Table or bullets for scanning common operations.
## Implementation
Inline code for simple patterns.
Link to file for heavy reference or reusable tools.
## Common Mistakes
What goes wrong + fixes.
Critical for discovery: Future Claude needs to find your skill.
Purpose: Claude 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.
Description = When to Use, not What the Skill Does
The description should describe triggering conditions only. Do not summarize the skill's process or workflow.
Why this matters: Testing showed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill. A description saying "code review between tasks" caused Claude to do one review even though the skill's flowchart clearly showed two reviews. Changing the description to just triggering conditions ("Use when executing implementation plans with independent tasks") caused Claude to correctly read and follow the full flowchart.
Descriptions that summarize workflow create a shortcut Claude will take, making the skill body documentation Claude skips.
# Summarizes workflow - Claude may follow this instead of reading skill
description: Use when executing plans - dispatches subagent per task with code review between tasks
# Too much process detail
description: Use for TDD - write test first, watch it fail, write minimal code, refactor
# Triggering conditions only
description: Use when executing implementation plans with independent tasks in the current session
# Triggering conditions only
description: Use when implementing any feature or bugfix, before writing implementation code
Content guidelines:
# Too abstract, vague
description: For async testing
# First person
description: I can help you with async tests when they're flaky
# Mentions technology but skill is not specific to it
description: Use when tests use setTimeout/sleep and are flaky
# Starts with "Use when", describes problem, no workflow
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
# Technology-specific skill with explicit trigger
description: Use when using React Router and handling authentication redirects
Use words Claude would search for:
Use active voice, verb-first:
creating-skills not skill-creationcondition-based-waiting not async-test-helpersGerunds (-ing) work well for processes: creating-skills, testing-skills, debugging-with-logs.
Skills loaded frequently accumulate cost per conversation. Keep frequently-loaded skills concise.
Target word counts:
Techniques:
Move details to tool help instead of documenting all flags inline. Use --help references.
Use cross-references rather than repeating workflow details from other skills.
Compress examples — one concise example communicates better than a verbose walkthrough.
Eliminate redundancy: do not repeat what is in cross-referenced skills, do not explain what is obvious from the command, do not include multiple examples of the same pattern.
Use skill name only, with explicit requirement markers:
**Background:** Use superpowers:test-driven-development**Required sub-skill:** Use research:codebaseAvoid @ link syntax — it force-loads files immediately, consuming context before you need them.
digraph when_flowchart {
info [shape=diamond label="Need to show information?"];
wrong_decision [shape=diamond label="Decision where I might go wrong?"];
use_markdown [shape=box label="Use markdown"];
flowchart [shape=box label="Small inline flowchart"];
info -> wrong_decision [label="yes"];
wrong_decision -> flowchart [label="yes"];
wrong_decision -> use_markdown [label="no"];
}
Use flowcharts only for:
Do not use flowcharts for reference material (use tables), code examples (use markdown blocks), linear instructions (use numbered lists), or labels without semantic meaning.
See @graphviz-conventions.dot for graphviz style rules.
Rendering for review: Use render-graphs.js in this directory to render a skill's flowcharts to SVG:
./render-graphs.js ../some-skill # Each diagram separately
./render-graphs.js ../some-skill --combine # All diagrams in one SVG
One excellent example beats many mediocre ones.
Choose the most relevant language:
A good example is complete and runnable, explains why in comments, comes from a real scenario, and is ready to adapt without being a generic template.
Do not implement the same example in 5+ languages or create fill-in-the-blank templates.
defense-in-depth/
SKILL.md # Everything inline
Use when all content fits and no heavy reference is needed.
condition-based-waiting/
SKILL.md # Overview + patterns
example.ts # Working helpers to adapt
Use when the tool is reusable code, not just narrative.
pptx/
SKILL.md # Overview + workflows
pptxgenjs.md # 600 lines API reference
ooxml.md # 500 lines XML structure
scripts/ # Executable tools
Use when reference material is too large for inline.
Do not deploy a skill without first watching an agent fail without it.
This applies to new skills and to edits of existing skills.
Writing the skill before testing means you do not know what it actually fixes. Editing without testing means you do not know if the change holds under pressure.
No exceptions:
Delete untested work and start over. Do not keep it as "reference."
Examples: TDD, verification-before-completion, designing-before-coding.
Test with:
Success criteria: Agent follows the rule under maximum pressure.
Examples: condition-based-waiting, root-cause-tracing, defensive-programming.
Test with:
Success criteria: Agent successfully applies the technique to a new scenario.
Examples: reducing-complexity, information-hiding.
Test with:
Success criteria: Agent correctly identifies when and how to apply the pattern.
Examples: API documentation, command references, library guides.
Test with:
Success criteria: Agent finds and correctly applies reference information.
Skills that enforce discipline need to resist rationalization. Agents will find loopholes under pressure.
Psychology note: Understanding why persuasion techniques work helps you apply them systematically. See persuasion-principles.md for the research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
State the rule and also forbid specific workarounds:
Write code before test? Delete it. Start over.
**No exceptions:**
- Do not keep it as "reference"
- Do not "adapt" it while writing tests
- Do not look at it
- Delete means delete
Add a foundational principle early:
**Violating the letter of the rules is violating the spirit of the rules.**
This cuts off an entire class of "I'm following the spirit" rationalizations.
Capture rationalizations from baseline testing. Every excuse goes in the table:
| Excuse | Reality |
|--------|---------|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
Make it easy to self-check:
## Common Mistakes
- Code before test
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "This is different because..."
Run a pressure scenario with a subagent without the skill. Document exact behavior:
This is "watch the test fail" — you must see what agents naturally do before writing the skill.
Write a skill that addresses those specific rationalizations. Do not add content for hypothetical cases.
Run the same scenarios with the skill present. The agent should now comply.
If the agent finds a new rationalization, add an explicit counter and re-test until the skill holds.
Testing methodology: See @testing-skills-with-subagents.md for the complete testing methodology — how to write pressure scenarios, apply pressure types (time, sunk cost, authority, exhaustion), and plug holes systematically.
Narrative example: "In session 2025-10-03, we found empty projectDir caused..." Too specific, not reusable.
Multi-language dilution: example-js.js, example-py.py, example-go.go
Mediocre quality and a maintenance burden.
Code in flowcharts:
step1 [label="import fs"];
step2 [label="read file"];
Cannot copy-paste; hard to read.
Generic labels: helper1, helper2, step3, pattern4
Labels must carry semantic meaning.
Complete the deployment process for each skill before moving to the next. Do not create multiple skills in batch without testing each one. Deploying an untested skill is the same discipline violation as deploying untested code.
Create a TodoWrite todo for each item.
RED Phase — Write Failing Test:
GREEN Phase — Write Minimal Skill:
name and description fields (max 1024 chars; see spec)REFACTOR Phase — Close Loopholes:
Quality Checks:
Deployment:
How future Claude finds your skill:
Put searchable terms early and often.
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/c3-reviewProvide review and feedback based on Correctness, Conciseness, and Clarity. Given a scope of artifacts, reviews them in their entirety and provide feedback that gauges those three aspects./conversationUse when interacting with users — asking clarifying or exploratory questions, presenting suggestions or options, pausing for confirmation, or before taking an action with effects outside the repository./dispatching-agentsUse when preparing to dispatch subagents. Applies before starting any subagent, and especially when multiple independent tasks (unrelated test failures, parallel research areas) could run concurrently without shared state.npx claudepluginhub davidsouther/domain-driven-design --plugin general2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job