[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-obra-superpowers-skills-writing-skills":3},{"error":4,"detail":5,"metadata":53,"markdownContent":54,"rawMarkdown":50},false,{"repo_full_name":6,"owner":7,"repo_name":8,"repo_forks":9,"skill_path":10,"repo_stars":11,"name":12,"category_id":13,"description":14,"file_tree":15,"skill_md_content":50,"skill_id":51,"skill_key":52},"obra/superpowers","obra","superpowers",8512,"skills/writing-skills",105901,"writing-skills",18,"Use when creating new skills, editing existing skills, or verifying skills work before deployment",[16,21,25,34,38,42,46],{"name":17,"path":18,"size":19,"type":20},"SKILL.md","skills/writing-skills/SKILL.md",22465,"file",{"name":22,"path":23,"size":24,"type":20},"anthropic-best-practices.md","skills/writing-skills/anthropic-best-practices.md",45825,{"name":26,"path":27,"type":28,"children":29},"examples","skills/writing-skills/examples","folder",[30],{"name":31,"path":32,"size":33,"type":20},"CLAUDE_MD_TESTING.md","skills/writing-skills/examples/CLAUDE_MD_TESTING.md",5423,{"name":35,"path":36,"size":37,"type":20},"graphviz-conventions.dot","skills/writing-skills/graphviz-conventions.dot",5970,{"name":39,"path":40,"size":41,"type":20},"persuasion-principles.md","skills/writing-skills/persuasion-principles.md",5908,{"name":43,"path":44,"size":45,"type":20},"render-graphs.js","skills/writing-skills/render-graphs.js",4857,{"name":47,"path":48,"size":49,"type":20},"testing-skills-with-subagents.md","skills/writing-skills/testing-skills-with-subagents.md",12558,"---\nname: writing-skills\ndescription: Use when creating new skills, editing existing skills, or verifying skills work before deployment\n---\n\n# Writing Skills\n\n## Overview\n\n**Writing skills IS Test-Driven Development applied to process documentation.**\n\n**Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.agents/skills/` for Codex)** \n\nYou 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).\n\n**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.\n\n**REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.\n\n**Official guidance:** For Anthropic's official skill authoring best practices, see anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.\n\n## What is a Skill?\n\nA **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches.\n\n**Skills are:** Reusable techniques, patterns, tools, reference guides\n\n**Skills are NOT:** Narratives about how you solved a problem once\n\n## TDD Mapping for Skills\n\n| TDD Concept | Skill Creation |\n|-------------|----------------|\n| **Test case** | Pressure scenario with subagent |\n| **Production code** | Skill document (SKILL.md) |\n| **Test fails (RED)** | Agent violates rule without skill (baseline) |\n| **Test passes (GREEN)** | Agent complies with skill present |\n| **Refactor** | Close loopholes while maintaining compliance |\n| **Write test first** | Run baseline scenario BEFORE writing skill |\n| **Watch it fail** | Document exact rationalizations agent uses |\n| **Minimal code** | Write skill addressing those specific violations |\n| **Watch it pass** | Verify agent now complies |\n| **Refactor cycle** | Find new rationalizations → plug → re-verify |\n\nThe entire skill creation process follows RED-GREEN-REFACTOR.\n\n## When to Create a Skill\n\n**Create when:**\n- Technique wasn't intuitively obvious to you\n- You'd reference this again across projects\n- Pattern applies broadly (not project-specific)\n- Others would benefit\n\n**Don't create for:**\n- One-off solutions\n- Standard practices well-documented elsewhere\n- Project-specific conventions (put in CLAUDE.md)\n- Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)\n\n## Skill Types\n\n### Technique\nConcrete method with steps to follow (condition-based-waiting, root-cause-tracing)\n\n### Pattern\nWay of thinking about problems (flatten-with-flags, test-invariants)\n\n### Reference\nAPI docs, syntax guides, tool documentation (office docs)\n\n## Directory Structure\n\n\n```\nskills/\n  skill-name/\n    SKILL.md              # Main reference (required)\n    supporting-file.*     # Only if needed\n```\n\n**Flat namespace** - all skills in one searchable namespace\n\n**Separate files for:**\n1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax\n2. **Reusable tools** - Scripts, utilities, templates\n\n**Keep inline:**\n- Principles and concepts\n- Code patterns (\u003C 50 lines)\n- Everything else\n\n## SKILL.md Structure\n\n**Frontmatter (YAML):**\n- Only two fields supported: `name` and `description`\n- Max 1024 characters total\n- `name`: Use letters, numbers, and hyphens only (no parentheses, special chars)\n- `description`: Third-person, describes ONLY when to use (NOT what it does)\n  - Start with \"Use when...\" to focus on triggering conditions\n  - Include specific symptoms, situations, and contexts\n  - **NEVER summarize the skill's process or workflow** (see CSO section for why)\n  - Keep under 500 characters if possible\n\n```markdown\n---\nname: Skill-Name-With-Hyphens\ndescription: Use when [specific triggering conditions and symptoms]\n---\n\n# Skill Name\n\n## Overview\nWhat is this? Core principle in 1-2 sentences.\n\n## When to Use\n[Small inline flowchart IF decision non-obvious]\n\nBullet list with SYMPTOMS and use cases\nWhen NOT to use\n\n## Core Pattern (for techniques/patterns)\nBefore/after code comparison\n\n## Quick Reference\nTable or bullets for scanning common operations\n\n## Implementation\nInline code for simple patterns\nLink to file for heavy reference or reusable tools\n\n## Common Mistakes\nWhat goes wrong + fixes\n\n## Real-World Impact (optional)\nConcrete results\n```\n\n\n## Claude Search Optimization (CSO)\n\n**Critical for discovery:** Future Claude needs to FIND your skill\n\n### 1. Rich Description Field\n\n**Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: \"Should I read this skill right now?\"\n\n**Format:** Start with \"Use when...\" to focus on triggering conditions\n\n**CRITICAL: Description = When to Use, NOT What the Skill Does**\n\nThe description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.\n\n**Why this matters:** Testing revealed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill content. A description saying \"code review between tasks\" caused Claude to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).\n\nWhen the description was changed to just \"Use when executing implementation plans with independent tasks\" (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process.\n\n**The trap:** Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.\n\n```yaml\n# ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill\ndescription: Use when executing plans - dispatches subagent per task with code review between tasks\n\n# ❌ BAD: Too much process detail\ndescription: Use for TDD - write test first, watch it fail, write minimal code, refactor\n\n# ✅ GOOD: Just triggering conditions, no workflow summary\ndescription: Use when executing implementation plans with independent tasks in the current session\n\n# ✅ GOOD: Triggering conditions only\ndescription: Use when implementing any feature or bugfix, before writing implementation code\n```\n\n**Content:**\n- Use concrete triggers, symptoms, and situations that signal this skill applies\n- Describe the *problem* (race conditions, inconsistent behavior) not *language-specific symptoms* (setTimeout, sleep)\n- Keep triggers technology-agnostic unless the skill itself is technology-specific\n- If skill is technology-specific, make that explicit in the trigger\n- Write in third person (injected into system prompt)\n- **NEVER summarize the skill's process or workflow**\n\n```yaml\n# ❌ BAD: Too abstract, vague, doesn't include when to use\ndescription: For async testing\n\n# ❌ BAD: First person\ndescription: I can help you with async tests when they're flaky\n\n# ❌ BAD: Mentions technology but skill isn't specific to it\ndescription: Use when tests use setTimeout/sleep and are flaky\n\n# ✅ GOOD: Starts with \"Use when\", describes problem, no workflow\ndescription: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently\n\n# ✅ GOOD: Technology-specific skill with explicit trigger\ndescription: Use when using React Router and handling authentication redirects\n```\n\n### 2. Keyword Coverage\n\nUse words Claude would search for:\n- Error messages: \"Hook timed out\", \"ENOTEMPTY\", \"race condition\"\n- Symptoms: \"flaky\", \"hanging\", \"zombie\", \"pollution\"\n- Synonyms: \"timeout/hang/freeze\", \"cleanup/teardown/afterEach\"\n- Tools: Actual commands, library names, file types\n\n### 3. Descriptive Naming\n\n**Use active voice, verb-first:**\n- ✅ `creating-skills` not `skill-creation`\n- ✅ `condition-based-waiting` not `async-test-helpers`\n\n### 4. Token Efficiency (Critical)\n\n**Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.\n\n**Target word counts:**\n- getting-started workflows: \u003C150 words each\n- Frequently-loaded skills: \u003C200 words total\n- Other skills: \u003C500 words (still be concise)\n\n**Techniques:**\n\n**Move details to tool help:**\n```bash\n# ❌ BAD: Document all flags in SKILL.md\nsearch-conversations supports --text, --both, --after DATE, --before DATE, --limit N\n\n# ✅ GOOD: Reference --help\nsearch-conversations supports multiple modes and filters. Run --help for details.\n```\n\n**Use cross-references:**\n```markdown\n# ❌ BAD: Repeat workflow details\nWhen searching, dispatch subagent with template...\n[20 lines of repeated instructions]\n\n# ✅ GOOD: Reference other skill\nAlways use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.\n```\n\n**Compress examples:**\n```markdown\n# ❌ BAD: Verbose example (42 words)\nyour human partner: \"How did we handle authentication errors in React Router before?\"\nYou: I'll search past conversations for React Router authentication patterns.\n[Dispatch subagent with search query: \"React Router authentication error handling 401\"]\n\n# ✅ GOOD: Minimal example (20 words)\nPartner: \"How did we handle auth errors in React Router?\"\nYou: Searching...\n[Dispatch subagent → synthesis]\n```\n\n**Eliminate redundancy:**\n- Don't repeat what's in cross-referenced skills\n- Don't explain what's obvious from command\n- Don't include multiple examples of same pattern\n\n**Verification:**\n```bash\nwc -w skills/path/SKILL.md\n# getting-started workflows: aim for \u003C150 each\n# Other frequently-loaded: aim for \u003C200 total\n```\n\n**Name by what you DO or core insight:**\n- ✅ `condition-based-waiting` > `async-test-helpers`\n- ✅ `using-skills` not `skill-usage`\n- ✅ `flatten-with-flags` > `data-structure-refactoring`\n- ✅ `root-cause-tracing` > `debugging-techniques`\n\n**Gerunds (-ing) work well for processes:**\n- `creating-skills`, `testing-skills`, `debugging-with-logs`\n- Active, describes the action you're taking\n\n### 4. Cross-Referencing Other Skills\n\n**When writing documentation that references other skills:**\n\nUse skill name only, with explicit requirement markers:\n- ✅ Good: `**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development`\n- ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging`\n- ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)\n- ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)\n\n**Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.\n\n## Flowchart Usage\n\n```dot\ndigraph when_flowchart {\n    \"Need to show information?\" [shape=diamond];\n    \"Decision where I might go wrong?\" [shape=diamond];\n    \"Use markdown\" [shape=box];\n    \"Small inline flowchart\" [shape=box];\n\n    \"Need to show information?\" -> \"Decision where I might go wrong?\" [label=\"yes\"];\n    \"Decision where I might go wrong?\" -> \"Small inline flowchart\" [label=\"yes\"];\n    \"Decision where I might go wrong?\" -> \"Use markdown\" [label=\"no\"];\n}\n```\n\n**Use flowcharts ONLY for:**\n- Non-obvious decision points\n- Process loops where you might stop too early\n- \"When to use A vs B\" decisions\n\n**Never use flowcharts for:**\n- Reference material → Tables, lists\n- Code examples → Markdown blocks\n- Linear instructions → Numbered lists\n- Labels without semantic meaning (step1, helper2)\n\nSee @graphviz-conventions.dot for graphviz style rules.\n\n**Visualizing for your human partner:** Use `render-graphs.js` in this directory to render a skill's flowcharts to SVG:\n```bash\n./render-graphs.js ../some-skill           # Each diagram separately\n./render-graphs.js ../some-skill --combine # All diagrams in one SVG\n```\n\n## Code Examples\n\n**One excellent example beats many mediocre ones**\n\nChoose most relevant language:\n- Testing techniques → TypeScript/JavaScript\n- System debugging → Shell/Python\n- Data processing → Python\n\n**Good example:**\n- Complete and runnable\n- Well-commented explaining WHY\n- From real scenario\n- Shows pattern clearly\n- Ready to adapt (not generic template)\n\n**Don't:**\n- Implement in 5+ languages\n- Create fill-in-the-blank templates\n- Write contrived examples\n\nYou're good at porting - one great example is enough.\n\n## File Organization\n\n### Self-Contained Skill\n```\ndefense-in-depth/\n  SKILL.md    # Everything inline\n```\nWhen: All content fits, no heavy reference needed\n\n### Skill with Reusable Tool\n```\ncondition-based-waiting/\n  SKILL.md    # Overview + patterns\n  example.ts  # Working helpers to adapt\n```\nWhen: Tool is reusable code, not just narrative\n\n### Skill with Heavy Reference\n```\npptx/\n  SKILL.md       # Overview + workflows\n  pptxgenjs.md   # 600 lines API reference\n  ooxml.md       # 500 lines XML structure\n  scripts/       # Executable tools\n```\nWhen: Reference material too large for inline\n\n## The Iron Law (Same as TDD)\n\n```\nNO SKILL WITHOUT A FAILING TEST FIRST\n```\n\nThis applies to NEW skills AND EDITS to existing skills.\n\nWrite skill before testing? Delete it. Start over.\nEdit skill without testing? Same violation.\n\n**No exceptions:**\n- Not for \"simple additions\"\n- Not for \"just adding a section\"\n- Not for \"documentation updates\"\n- Don't keep untested changes as \"reference\"\n- Don't \"adapt\" while running tests\n- Delete means delete\n\n**REQUIRED BACKGROUND:** The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.\n\n## Testing All Skill Types\n\nDifferent skill types need different test approaches:\n\n### Discipline-Enforcing Skills (rules/requirements)\n\n**Examples:** TDD, verification-before-completion, designing-before-coding\n\n**Test with:**\n- Academic questions: Do they understand the rules?\n- Pressure scenarios: Do they comply under stress?\n- Multiple pressures combined: time + sunk cost + exhaustion\n- Identify rationalizations and add explicit counters\n\n**Success criteria:** Agent follows rule under maximum pressure\n\n### Technique Skills (how-to guides)\n\n**Examples:** condition-based-waiting, root-cause-tracing, defensive-programming\n\n**Test with:**\n- Application scenarios: Can they apply the technique correctly?\n- Variation scenarios: Do they handle edge cases?\n- Missing information tests: Do instructions have gaps?\n\n**Success criteria:** Agent successfully applies technique to new scenario\n\n### Pattern Skills (mental models)\n\n**Examples:** reducing-complexity, information-hiding concepts\n\n**Test with:**\n- Recognition scenarios: Do they recognize when pattern applies?\n- Application scenarios: Can they use the mental model?\n- Counter-examples: Do they know when NOT to apply?\n\n**Success criteria:** Agent correctly identifies when/how to apply pattern\n\n### Reference Skills (documentation/APIs)\n\n**Examples:** API documentation, command references, library guides\n\n**Test with:**\n- Retrieval scenarios: Can they find the right information?\n- Application scenarios: Can they use what they found correctly?\n- Gap testing: Are common use cases covered?\n\n**Success criteria:** Agent finds and correctly applies reference information\n\n## Common Rationalizations for Skipping Testing\n\n| Excuse | Reality |\n|--------|---------|\n| \"Skill is obviously clear\" | Clear to you ≠ clear to other agents. Test it. |\n| \"It's just a reference\" | References can have gaps, unclear sections. Test retrieval. |\n| \"Testing is overkill\" | Untested skills have issues. Always. 15 min testing saves hours. |\n| \"I'll test if problems emerge\" | Problems = agents can't use skill. Test BEFORE deploying. |\n| \"Too tedious to test\" | Testing is less tedious than debugging bad skill in production. |\n| \"I'm confident it's good\" | Overconfidence guarantees issues. Test anyway. |\n| \"Academic review is enough\" | Reading ≠ using. Test application scenarios. |\n| \"No time to test\" | Deploying untested skill wastes more time fixing it later. |\n\n**All of these mean: Test before deploying. No exceptions.**\n\n## Bulletproofing Skills Against Rationalization\n\nSkills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.\n\n**Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.\n\n### Close Every Loophole Explicitly\n\nDon't just state the rule - forbid specific workarounds:\n\n\u003CBad>\n```markdown\nWrite code before test? Delete it.\n```\n\u003C/Bad>\n\n\u003CGood>\n```markdown\nWrite code before test? Delete it. Start over.\n\n**No exceptions:**\n- Don't keep it as \"reference\"\n- Don't \"adapt\" it while writing tests\n- Don't look at it\n- Delete means delete\n```\n\u003C/Good>\n\n### Address \"Spirit vs Letter\" Arguments\n\nAdd foundational principle early:\n\n```markdown\n**Violating the letter of the rules is violating the spirit of the rules.**\n```\n\nThis cuts off entire class of \"I'm following the spirit\" rationalizations.\n\n### Build Rationalization Table\n\nCapture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:\n\n```markdown\n| Excuse | Reality |\n|--------|---------|\n| \"Too simple to test\" | Simple code breaks. Test takes 30 seconds. |\n| \"I'll test after\" | Tests passing immediately prove nothing. |\n| \"Tests after achieve same goals\" | Tests-after = \"what does this do?\" Tests-first = \"what should this do?\" |\n```\n\n### Create Red Flags List\n\nMake it easy for agents to self-check when rationalizing:\n\n```markdown\n## Red Flags - STOP and Start Over\n\n- Code before test\n- \"I already manually tested it\"\n- \"Tests after achieve the same purpose\"\n- \"It's about spirit not ritual\"\n- \"This is different because...\"\n\n**All of these mean: Delete code. Start over with TDD.**\n```\n\n### Update CSO for Violation Symptoms\n\nAdd to description: symptoms of when you're ABOUT to violate the rule:\n\n```yaml\ndescription: use when implementing any feature or bugfix, before writing implementation code\n```\n\n## RED-GREEN-REFACTOR for Skills\n\nFollow the TDD cycle:\n\n### RED: Write Failing Test (Baseline)\n\nRun pressure scenario with subagent WITHOUT the skill. Document exact behavior:\n- What choices did they make?\n- What rationalizations did they use (verbatim)?\n- Which pressures triggered violations?\n\nThis is \"watch the test fail\" - you must see what agents naturally do before writing the skill.\n\n### GREEN: Write Minimal Skill\n\nWrite skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.\n\nRun same scenarios WITH skill. Agent should now comply.\n\n### REFACTOR: Close Loopholes\n\nAgent found new rationalization? Add explicit counter. Re-test until bulletproof.\n\n**Testing methodology:** See @testing-skills-with-subagents.md for the complete testing methodology:\n- How to write pressure scenarios\n- Pressure types (time, sunk cost, authority, exhaustion)\n- Plugging holes systematically\n- Meta-testing techniques\n\n## Anti-Patterns\n\n### ❌ Narrative Example\n\"In session 2025-10-03, we found empty projectDir caused...\"\n**Why bad:** Too specific, not reusable\n\n### ❌ Multi-Language Dilution\nexample-js.js, example-py.py, example-go.go\n**Why bad:** Mediocre quality, maintenance burden\n\n### ❌ Code in Flowcharts\n```dot\nstep1 [label=\"import fs\"];\nstep2 [label=\"read file\"];\n```\n**Why bad:** Can't copy-paste, hard to read\n\n### ❌ Generic Labels\nhelper1, helper2, step3, pattern4\n**Why bad:** Labels should have semantic meaning\n\n## STOP: Before Moving to Next Skill\n\n**After writing ANY skill, you MUST STOP and complete the deployment process.**\n\n**Do NOT:**\n- Create multiple skills in batch without testing each\n- Move to next skill before current one is verified\n- Skip testing because \"batching is more efficient\"\n\n**The deployment checklist below is MANDATORY for EACH skill.**\n\nDeploying untested skills = deploying untested code. It's a violation of quality standards.\n\n## Skill Creation Checklist (TDD Adapted)\n\n**IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.**\n\n**RED Phase - Write Failing Test:**\n- [ ] Create pressure scenarios (3+ combined pressures for discipline skills)\n- [ ] Run scenarios WITHOUT skill - document baseline behavior verbatim\n- [ ] Identify patterns in rationalizations/failures\n\n**GREEN Phase - Write Minimal Skill:**\n- [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars)\n- [ ] YAML frontmatter with only name and description (max 1024 chars)\n- [ ] Description starts with \"Use when...\" and includes specific triggers/symptoms\n- [ ] Description written in third person\n- [ ] Keywords throughout for search (errors, symptoms, tools)\n- [ ] Clear overview with core principle\n- [ ] Address specific baseline failures identified in RED\n- [ ] Code inline OR link to separate file\n- [ ] One excellent example (not multi-language)\n- [ ] Run scenarios WITH skill - verify agents now comply\n\n**REFACTOR Phase - Close Loopholes:**\n- [ ] Identify NEW rationalizations from testing\n- [ ] Add explicit counters (if discipline skill)\n- [ ] Build rationalization table from all test iterations\n- [ ] Create red flags list\n- [ ] Re-test until bulletproof\n\n**Quality Checks:**\n- [ ] Small flowchart only if decision non-obvious\n- [ ] Quick reference table\n- [ ] Common mistakes section\n- [ ] No narrative storytelling\n- [ ] Supporting files only for tools or heavy reference\n\n**Deployment:**\n- [ ] Commit skill to git and push to your fork (if configured)\n- [ ] Consider contributing back via PR (if broadly useful)\n\n## Discovery Workflow\n\nHow future Claude finds your skill:\n\n1. **Encounters problem** (\"tests are flaky\")\n3. **Finds SKILL** (description matches)\n4. **Scans overview** (is this relevant?)\n5. **Reads patterns** (quick reference table)\n6. **Loads example** (only when implementing)\n\n**Optimize for this flow** - put searchable terms early and often.\n\n## The Bottom Line\n\n**Creating skills IS TDD for process documentation.**\n\nSame Iron Law: No skill without failing test first.\nSame cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes).\nSame benefits: Better quality, fewer surprises, bulletproof results.\n\nIf you follow TDD for code, follow it for skills. It's the same discipline applied to documentation.\n","0fc4ce74-b898-589b-be9e-be532bacd8a8","obra-superpowers-skills-writing-skills",{"name":12,"description":14},"\u003Ch1>Writing Skills\u003C/h1>\n\u003Ch2>Overview\u003C/h2>\n\u003Cp>\u003Cstrong>Writing skills IS Test-Driven Development applied to process documentation.\u003C/strong>\u003C/p>\n\u003Cp>\u003Cstrong>Personal skills live in agent-specific directories (\u003Ccode>~/.claude/skills\u003C/code> for Claude Code, \u003Ccode>~/.agents/skills/\u003C/code> for Codex)\u003C/strong> \u003C/p>\n\u003Cp>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).\u003C/p>\n\u003Cp>\u003Cstrong>Core principle:\u003C/strong> If you didn&#39;t watch an agent fail without the skill, you don&#39;t know if the skill teaches the right thing.\u003C/p>\n\u003Cp>\u003Cstrong>REQUIRED BACKGROUND:\u003C/strong> You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.\u003C/p>\n\u003Cp>\u003Cstrong>Official guidance:\u003C/strong> For Anthropic&#39;s official skill authoring best practices, see anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.\u003C/p>\n\u003Ch2>What is a Skill?\u003C/h2>\n\u003Cp>A \u003Cstrong>skill\u003C/strong> is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches.\u003C/p>\n\u003Cp>\u003Cstrong>Skills are:\u003C/strong> Reusable techniques, patterns, tools, reference guides\u003C/p>\n\u003Cp>\u003Cstrong>Skills are NOT:\u003C/strong> Narratives about how you solved a problem once\u003C/p>\n\u003Ch2>TDD Mapping for Skills\u003C/h2>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>TDD Concept\u003C/th>\n\u003Cth>Skill Creation\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Cstrong>Test case\u003C/strong>\u003C/td>\n\u003Ctd>Pressure scenario with subagent\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Production code\u003C/strong>\u003C/td>\n\u003Ctd>Skill document (SKILL.md)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Test fails (RED)\u003C/strong>\u003C/td>\n\u003Ctd>Agent violates rule without skill (baseline)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Test passes (GREEN)\u003C/strong>\u003C/td>\n\u003Ctd>Agent complies with skill present\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Refactor\u003C/strong>\u003C/td>\n\u003Ctd>Close loopholes while maintaining compliance\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Write test first\u003C/strong>\u003C/td>\n\u003Ctd>Run baseline scenario BEFORE writing skill\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Watch it fail\u003C/strong>\u003C/td>\n\u003Ctd>Document exact rationalizations agent uses\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Minimal code\u003C/strong>\u003C/td>\n\u003Ctd>Write skill addressing those specific violations\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Watch it pass\u003C/strong>\u003C/td>\n\u003Ctd>Verify agent now complies\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Refactor cycle\u003C/strong>\u003C/td>\n\u003Ctd>Find new rationalizations → plug → re-verify\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>The entire skill creation process follows RED-GREEN-REFACTOR.\u003C/p>\n\u003Ch2>When to Create a Skill\u003C/h2>\n\u003Cp>\u003Cstrong>Create when:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Technique wasn&#39;t intuitively obvious to you\u003C/li>\n\u003Cli>You&#39;d reference this again across projects\u003C/li>\n\u003Cli>Pattern applies broadly (not project-specific)\u003C/li>\n\u003Cli>Others would benefit\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Don&#39;t create for:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>One-off solutions\u003C/li>\n\u003Cli>Standard practices well-documented elsewhere\u003C/li>\n\u003Cli>Project-specific conventions (put in CLAUDE.md)\u003C/li>\n\u003Cli>Mechanical constraints (if it&#39;s enforceable with regex/validation, automate it—save documentation for judgment calls)\u003C/li>\n\u003C/ul>\n\u003Ch2>Skill Types\u003C/h2>\n\u003Ch3>Technique\u003C/h3>\n\u003Cp>Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)\u003C/p>\n\u003Ch3>Pattern\u003C/h3>\n\u003Cp>Way of thinking about problems (flatten-with-flags, test-invariants)\u003C/p>\n\u003Ch3>Reference\u003C/h3>\n\u003Cp>API docs, syntax guides, tool documentation (office docs)\u003C/p>\n\u003Ch2>Directory Structure\u003C/h2>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">skills/\n  skill-name/\n    SKILL.md              # Main reference (required)\n    supporting-file.*     # Only if needed\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Flat namespace\u003C/strong> - all skills in one searchable namespace\u003C/p>\n\u003Cp>\u003Cstrong>Separate files for:\u003C/strong>\u003C/p>\n\u003Col>\n\u003Cli>\u003Cstrong>Heavy reference\u003C/strong> (100+ lines) - API docs, comprehensive syntax\u003C/li>\n\u003Cli>\u003Cstrong>Reusable tools\u003C/strong> - Scripts, utilities, templates\u003C/li>\n\u003C/ol>\n\u003Cp>\u003Cstrong>Keep inline:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Principles and concepts\u003C/li>\n\u003Cli>Code patterns (&lt; 50 lines)\u003C/li>\n\u003Cli>Everything else\u003C/li>\n\u003C/ul>\n\u003Ch2>SKILL.md Structure\u003C/h2>\n\u003Cp>\u003Cstrong>Frontmatter (YAML):\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Only two fields supported: \u003Ccode>name\u003C/code> and \u003Ccode>description\u003C/code>\u003C/li>\n\u003Cli>Max 1024 characters total\u003C/li>\n\u003Cli>\u003Ccode>name\u003C/code>: Use letters, numbers, and hyphens only (no parentheses, special chars)\u003C/li>\n\u003Cli>\u003Ccode>description\u003C/code>: Third-person, describes ONLY when to use (NOT what it does)\u003Cul>\n\u003Cli>Start with &quot;Use when...&quot; to focus on triggering conditions\u003C/li>\n\u003Cli>Include specific symptoms, situations, and contexts\u003C/li>\n\u003Cli>\u003Cstrong>NEVER summarize the skill&#39;s process or workflow\u003C/strong> (see CSO section for why)\u003C/li>\n\u003Cli>Keep under 500 characters if possible\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003C/ul>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">markdown\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-markdown\">---\nname: Skill-Name-With-Hyphens\n\u003Cspan class=\"hljs-section\">description: Use when [specific triggering conditions and symptoms]\n---\u003C/span>\n\n\u003Cspan class=\"hljs-section\"># Skill Name\u003C/span>\n\n\u003Cspan class=\"hljs-section\">## Overview\u003C/span>\nWhat is this? Core principle in 1-2 sentences.\n\n\u003Cspan class=\"hljs-section\">## When to Use\u003C/span>\n[Small inline flowchart IF decision non-obvious]\n\nBullet list with SYMPTOMS and use cases\nWhen NOT to use\n\n\u003Cspan class=\"hljs-section\">## Core Pattern (for techniques/patterns)\u003C/span>\nBefore/after code comparison\n\n\u003Cspan class=\"hljs-section\">## Quick Reference\u003C/span>\nTable or bullets for scanning common operations\n\n\u003Cspan class=\"hljs-section\">## Implementation\u003C/span>\nInline code for simple patterns\nLink to file for heavy reference or reusable tools\n\n\u003Cspan class=\"hljs-section\">## Common Mistakes\u003C/span>\nWhat goes wrong + fixes\n\n\u003Cspan class=\"hljs-section\">## Real-World Impact (optional)\u003C/span>\nConcrete results\u003C/code>\u003C/pre>\u003C/div>\u003Ch2>Claude Search Optimization (CSO)\u003C/h2>\n\u003Cp>\u003Cstrong>Critical for discovery:\u003C/strong> Future Claude needs to FIND your skill\u003C/p>\n\u003Ch3>1. Rich Description Field\u003C/h3>\n\u003Cp>\u003Cstrong>Purpose:\u003C/strong> Claude reads description to decide which skills to load for a given task. Make it answer: &quot;Should I read this skill right now?&quot;\u003C/p>\n\u003Cp>\u003Cstrong>Format:\u003C/strong> Start with &quot;Use when...&quot; to focus on triggering conditions\u003C/p>\n\u003Cp>\u003Cstrong>CRITICAL: Description = When to Use, NOT What the Skill Does\u003C/strong>\u003C/p>\n\u003Cp>The description should ONLY describe triggering conditions. Do NOT summarize the skill&#39;s process or workflow in the description.\u003C/p>\n\u003Cp>\u003Cstrong>Why this matters:\u003C/strong> Testing revealed that when a description summarizes the skill&#39;s workflow, Claude may follow the description instead of reading the full skill content. A description saying &quot;code review between tasks&quot; caused Claude to do ONE review, even though the skill&#39;s flowchart clearly showed TWO reviews (spec compliance then code quality).\u003C/p>\n\u003Cp>When the description was changed to just &quot;Use when executing implementation plans with independent tasks&quot; (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process.\u003C/p>\n\u003Cp>\u003Cstrong>The trap:\u003C/strong> Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">yaml\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">executing\u003C/span> \u003Cspan class=\"hljs-string\">plans\u003C/span> \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">dispatches\u003C/span> \u003Cspan class=\"hljs-string\">subagent\u003C/span> \u003Cspan class=\"hljs-string\">per\u003C/span> \u003Cspan class=\"hljs-string\">task\u003C/span> \u003Cspan class=\"hljs-string\">with\u003C/span> \u003Cspan class=\"hljs-string\">code\u003C/span> \u003Cspan class=\"hljs-string\">review\u003C/span> \u003Cspan class=\"hljs-string\">between\u003C/span> \u003Cspan class=\"hljs-string\">tasks\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ❌ BAD: Too much process detail\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">for\u003C/span> \u003Cspan class=\"hljs-string\">TDD\u003C/span> \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">write\u003C/span> \u003Cspan class=\"hljs-string\">test\u003C/span> \u003Cspan class=\"hljs-string\">first,\u003C/span> \u003Cspan class=\"hljs-string\">watch\u003C/span> \u003Cspan class=\"hljs-string\">it\u003C/span> \u003Cspan class=\"hljs-string\">fail,\u003C/span> \u003Cspan class=\"hljs-string\">write\u003C/span> \u003Cspan class=\"hljs-string\">minimal\u003C/span> \u003Cspan class=\"hljs-string\">code,\u003C/span> \u003Cspan class=\"hljs-string\">refactor\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ✅ GOOD: Just triggering conditions, no workflow summary\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">executing\u003C/span> \u003Cspan class=\"hljs-string\">implementation\u003C/span> \u003Cspan class=\"hljs-string\">plans\u003C/span> \u003Cspan class=\"hljs-string\">with\u003C/span> \u003Cspan class=\"hljs-string\">independent\u003C/span> \u003Cspan class=\"hljs-string\">tasks\u003C/span> \u003Cspan class=\"hljs-string\">in\u003C/span> \u003Cspan class=\"hljs-string\">the\u003C/span> \u003Cspan class=\"hljs-string\">current\u003C/span> \u003Cspan class=\"hljs-string\">session\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ✅ GOOD: Triggering conditions only\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">implementing\u003C/span> \u003Cspan class=\"hljs-string\">any\u003C/span> \u003Cspan class=\"hljs-string\">feature\u003C/span> \u003Cspan class=\"hljs-string\">or\u003C/span> \u003Cspan class=\"hljs-string\">bugfix,\u003C/span> \u003Cspan class=\"hljs-string\">before\u003C/span> \u003Cspan class=\"hljs-string\">writing\u003C/span> \u003Cspan class=\"hljs-string\">implementation\u003C/span> \u003Cspan class=\"hljs-string\">code\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Content:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Use concrete triggers, symptoms, and situations that signal this skill applies\u003C/li>\n\u003Cli>Describe the \u003Cem>problem\u003C/em> (race conditions, inconsistent behavior) not \u003Cem>language-specific symptoms\u003C/em> (setTimeout, sleep)\u003C/li>\n\u003Cli>Keep triggers technology-agnostic unless the skill itself is technology-specific\u003C/li>\n\u003Cli>If skill is technology-specific, make that explicit in the trigger\u003C/li>\n\u003Cli>Write in third person (injected into system prompt)\u003C/li>\n\u003Cli>\u003Cstrong>NEVER summarize the skill&#39;s process or workflow\u003C/strong>\u003C/li>\n\u003C/ul>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">yaml\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># ❌ BAD: Too abstract, vague, doesn&#x27;t include when to use\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">For\u003C/span> \u003Cspan class=\"hljs-string\">async\u003C/span> \u003Cspan class=\"hljs-string\">testing\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ❌ BAD: First person\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">I\u003C/span> \u003Cspan class=\"hljs-string\">can\u003C/span> \u003Cspan class=\"hljs-string\">help\u003C/span> \u003Cspan class=\"hljs-string\">you\u003C/span> \u003Cspan class=\"hljs-string\">with\u003C/span> \u003Cspan class=\"hljs-string\">async\u003C/span> \u003Cspan class=\"hljs-string\">tests\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">they&#x27;re\u003C/span> \u003Cspan class=\"hljs-string\">flaky\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ❌ BAD: Mentions technology but skill isn&#x27;t specific to it\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">tests\u003C/span> \u003Cspan class=\"hljs-string\">use\u003C/span> \u003Cspan class=\"hljs-string\">setTimeout/sleep\u003C/span> \u003Cspan class=\"hljs-string\">and\u003C/span> \u003Cspan class=\"hljs-string\">are\u003C/span> \u003Cspan class=\"hljs-string\">flaky\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ✅ GOOD: Starts with &quot;Use when&quot;, describes problem, no workflow\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">tests\u003C/span> \u003Cspan class=\"hljs-string\">have\u003C/span> \u003Cspan class=\"hljs-string\">race\u003C/span> \u003Cspan class=\"hljs-string\">conditions,\u003C/span> \u003Cspan class=\"hljs-string\">timing\u003C/span> \u003Cspan class=\"hljs-string\">dependencies,\u003C/span> \u003Cspan class=\"hljs-string\">or\u003C/span> \u003Cspan class=\"hljs-string\">pass/fail\u003C/span> \u003Cspan class=\"hljs-string\">inconsistently\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># ✅ GOOD: Technology-specific skill with explicit trigger\u003C/span>\n\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">Use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">using\u003C/span> \u003Cspan class=\"hljs-string\">React\u003C/span> \u003Cspan class=\"hljs-string\">Router\u003C/span> \u003Cspan class=\"hljs-string\">and\u003C/span> \u003Cspan class=\"hljs-string\">handling\u003C/span> \u003Cspan class=\"hljs-string\">authentication\u003C/span> \u003Cspan class=\"hljs-string\">redirects\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>2. Keyword Coverage\u003C/h3>\n\u003Cp>Use words Claude would search for:\u003C/p>\n\u003Cul>\n\u003Cli>Error messages: &quot;Hook timed out&quot;, &quot;ENOTEMPTY&quot;, &quot;race condition&quot;\u003C/li>\n\u003Cli>Symptoms: &quot;flaky&quot;, &quot;hanging&quot;, &quot;zombie&quot;, &quot;pollution&quot;\u003C/li>\n\u003Cli>Synonyms: &quot;timeout/hang/freeze&quot;, &quot;cleanup/teardown/afterEach&quot;\u003C/li>\n\u003Cli>Tools: Actual commands, library names, file types\u003C/li>\n\u003C/ul>\n\u003Ch3>3. Descriptive Naming\u003C/h3>\n\u003Cp>\u003Cstrong>Use active voice, verb-first:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>✅ \u003Ccode>creating-skills\u003C/code> not \u003Ccode>skill-creation\u003C/code>\u003C/li>\n\u003Cli>✅ \u003Ccode>condition-based-waiting\u003C/code> not \u003Ccode>async-test-helpers\u003C/code>\u003C/li>\n\u003C/ul>\n\u003Ch3>4. Token Efficiency (Critical)\u003C/h3>\n\u003Cp>\u003Cstrong>Problem:\u003C/strong> getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.\u003C/p>\n\u003Cp>\u003Cstrong>Target word counts:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>getting-started workflows: &lt;150 words each\u003C/li>\n\u003Cli>Frequently-loaded skills: &lt;200 words total\u003C/li>\n\u003Cli>Other skills: &lt;500 words (still be concise)\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Techniques:\u003C/strong>\u003C/p>\n\u003Cp>\u003Cstrong>Move details to tool help:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># ❌ BAD: Document all flags in SKILL.md\u003C/span>\nsearch-conversations supports --text, --both, --after DATE, --before DATE, --\u003Cspan class=\"hljs-built_in\">limit\u003C/span> N\n\n\u003Cspan class=\"hljs-comment\"># ✅ GOOD: Reference --help\u003C/span>\nsearch-conversations supports multiple modes and filters. Run --\u003Cspan class=\"hljs-built_in\">help\u003C/span> \u003Cspan class=\"hljs-keyword\">for\u003C/span> details.\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Use cross-references:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">markdown\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-markdown\">\u003Cspan class=\"hljs-section\"># ❌ BAD: Repeat workflow details\u003C/span>\nWhen searching, dispatch subagent with template...\n[20 lines of repeated instructions]\n\n\u003Cspan class=\"hljs-section\"># ✅ GOOD: Reference other skill\u003C/span>\nAlways use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Compress examples:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">markdown\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-markdown\">\u003Cspan class=\"hljs-section\"># ❌ BAD: Verbose example (42 words)\u003C/span>\nyour human partner: &quot;How did we handle authentication errors in React Router before?&quot;\nYou: I&#x27;ll search past conversations for React Router authentication patterns.\n[Dispatch subagent with search query: &quot;React Router authentication error handling 401&quot;]\n\n\u003Cspan class=\"hljs-section\"># ✅ GOOD: Minimal example (20 words)\u003C/span>\nPartner: &quot;How did we handle auth errors in React Router?&quot;\nYou: Searching...\n[Dispatch subagent → synthesis]\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Eliminate redundancy:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Don&#39;t repeat what&#39;s in cross-referenced skills\u003C/li>\n\u003Cli>Don&#39;t explain what&#39;s obvious from command\u003C/li>\n\u003Cli>Don&#39;t include multiple examples of same pattern\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Verification:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-built_in\">wc\u003C/span> -w skills/path/SKILL.md\n\u003Cspan class=\"hljs-comment\"># getting-started workflows: aim for &lt;150 each\u003C/span>\n\u003Cspan class=\"hljs-comment\"># Other frequently-loaded: aim for &lt;200 total\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Name by what you DO or core insight:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>✅ \u003Ccode>condition-based-waiting\u003C/code> &gt; \u003Ccode>async-test-helpers\u003C/code>\u003C/li>\n\u003Cli>✅ \u003Ccode>using-skills\u003C/code> not \u003Ccode>skill-usage\u003C/code>\u003C/li>\n\u003Cli>✅ \u003Ccode>flatten-with-flags\u003C/code> &gt; \u003Ccode>data-structure-refactoring\u003C/code>\u003C/li>\n\u003Cli>✅ \u003Ccode>root-cause-tracing\u003C/code> &gt; \u003Ccode>debugging-techniques\u003C/code>\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Gerunds (-ing) work well for processes:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ccode>creating-skills\u003C/code>, \u003Ccode>testing-skills\u003C/code>, \u003Ccode>debugging-with-logs\u003C/code>\u003C/li>\n\u003Cli>Active, describes the action you&#39;re taking\u003C/li>\n\u003C/ul>\n\u003Ch3>4. Cross-Referencing Other Skills\u003C/h3>\n\u003Cp>\u003Cstrong>When writing documentation that references other skills:\u003C/strong>\u003C/p>\n\u003Cp>Use skill name only, with explicit requirement markers:\u003C/p>\n\u003Cul>\n\u003Cli>✅ Good: \u003Ccode>**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development\u003C/code>\u003C/li>\n\u003Cli>✅ Good: \u003Ccode>**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging\u003C/code>\u003C/li>\n\u003Cli>❌ Bad: \u003Ccode>See skills/testing/test-driven-development\u003C/code> (unclear if required)\u003C/li>\n\u003Cli>❌ Bad: \u003Ccode>@skills/testing/test-driven-development/SKILL.md\u003C/code> (force-loads, burns context)\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Why no @ links:\u003C/strong> \u003Ccode>@\u003C/code> syntax force-loads files immediately, consuming 200k+ context before you need them.\u003C/p>\n\u003Ch2>Flowchart Usage\u003C/h2>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">dot\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">digraph when_flowchart {\n    &quot;Need to show information?&quot; [shape=diamond];\n    &quot;Decision where I might go wrong?&quot; [shape=diamond];\n    &quot;Use markdown&quot; [shape=box];\n    &quot;Small inline flowchart&quot; [shape=box];\n\n    &quot;Need to show information?&quot; -&gt; &quot;Decision where I might go wrong?&quot; [label=&quot;yes&quot;];\n    &quot;Decision where I might go wrong?&quot; -&gt; &quot;Small inline flowchart&quot; [label=&quot;yes&quot;];\n    &quot;Decision where I might go wrong?&quot; -&gt; &quot;Use markdown&quot; [label=&quot;no&quot;];\n}\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Use flowcharts ONLY for:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Non-obvious decision points\u003C/li>\n\u003Cli>Process loops where you might stop too early\u003C/li>\n\u003Cli>&quot;When to use A vs B&quot; decisions\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Never use flowcharts for:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Reference material → Tables, lists\u003C/li>\n\u003Cli>Code examples → Markdown blocks\u003C/li>\n\u003Cli>Linear instructions → Numbered lists\u003C/li>\n\u003Cli>Labels without semantic meaning (step1, helper2)\u003C/li>\n\u003C/ul>\n\u003Cp>See @graphviz-conventions.dot for graphviz style rules.\u003C/p>\n\u003Cp>\u003Cstrong>Visualizing for your human partner:\u003C/strong> Use \u003Ccode>render-graphs.js\u003C/code> in this directory to render a skill&#39;s flowcharts to SVG:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">./render-graphs.js ../some-skill           \u003Cspan class=\"hljs-comment\"># Each diagram separately\u003C/span>\n./render-graphs.js ../some-skill --combine \u003Cspan class=\"hljs-comment\"># All diagrams in one SVG\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Ch2>Code Examples\u003C/h2>\n\u003Cp>\u003Cstrong>One excellent example beats many mediocre ones\u003C/strong>\u003C/p>\n\u003Cp>Choose most relevant language:\u003C/p>\n\u003Cul>\n\u003Cli>Testing techniques → TypeScript/JavaScript\u003C/li>\n\u003Cli>System debugging → Shell/Python\u003C/li>\n\u003Cli>Data processing → Python\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Good example:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Complete and runnable\u003C/li>\n\u003Cli>Well-commented explaining WHY\u003C/li>\n\u003Cli>From real scenario\u003C/li>\n\u003Cli>Shows pattern clearly\u003C/li>\n\u003Cli>Ready to adapt (not generic template)\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Don&#39;t:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Implement in 5+ languages\u003C/li>\n\u003Cli>Create fill-in-the-blank templates\u003C/li>\n\u003Cli>Write contrived examples\u003C/li>\n\u003C/ul>\n\u003Cp>You&#39;re good at porting - one great example is enough.\u003C/p>\n\u003Ch2>File Organization\u003C/h2>\n\u003Ch3>Self-Contained Skill\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">defense-in-depth/\n  SKILL.md    # Everything inline\u003C/code>\u003C/pre>\u003C/div>\u003Cp>When: All content fits, no heavy reference needed\u003C/p>\n\u003Ch3>Skill with Reusable Tool\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">condition-based-waiting/\n  SKILL.md    # Overview + patterns\n  example.ts  # Working helpers to adapt\u003C/code>\u003C/pre>\u003C/div>\u003Cp>When: Tool is reusable code, not just narrative\u003C/p>\n\u003Ch3>Skill with Heavy Reference\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">pptx/\n  SKILL.md       # Overview + workflows\n  pptxgenjs.md   # 600 lines API reference\n  ooxml.md       # 500 lines XML structure\n  scripts/       # Executable tools\u003C/code>\u003C/pre>\u003C/div>\u003Cp>When: Reference material too large for inline\u003C/p>\n\u003Ch2>The Iron Law (Same as TDD)\u003C/h2>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">NO SKILL WITHOUT A FAILING TEST FIRST\u003C/code>\u003C/pre>\u003C/div>\u003Cp>This applies to NEW skills AND EDITS to existing skills.\u003C/p>\n\u003Cp>Write skill before testing? Delete it. Start over.\nEdit skill without testing? Same violation.\u003C/p>\n\u003Cp>\u003Cstrong>No exceptions:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Not for &quot;simple additions&quot;\u003C/li>\n\u003Cli>Not for &quot;just adding a section&quot;\u003C/li>\n\u003Cli>Not for &quot;documentation updates&quot;\u003C/li>\n\u003Cli>Don&#39;t keep untested changes as &quot;reference&quot;\u003C/li>\n\u003Cli>Don&#39;t &quot;adapt&quot; while running tests\u003C/li>\n\u003Cli>Delete means delete\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>REQUIRED BACKGROUND:\u003C/strong> The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.\u003C/p>\n\u003Ch2>Testing All Skill Types\u003C/h2>\n\u003Cp>Different skill types need different test approaches:\u003C/p>\n\u003Ch3>Discipline-Enforcing Skills (rules/requirements)\u003C/h3>\n\u003Cp>\u003Cstrong>Examples:\u003C/strong> TDD, verification-before-completion, designing-before-coding\u003C/p>\n\u003Cp>\u003Cstrong>Test with:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Academic questions: Do they understand the rules?\u003C/li>\n\u003Cli>Pressure scenarios: Do they comply under stress?\u003C/li>\n\u003Cli>Multiple pressures combined: time + sunk cost + exhaustion\u003C/li>\n\u003Cli>Identify rationalizations and add explicit counters\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Success criteria:\u003C/strong> Agent follows rule under maximum pressure\u003C/p>\n\u003Ch3>Technique Skills (how-to guides)\u003C/h3>\n\u003Cp>\u003Cstrong>Examples:\u003C/strong> condition-based-waiting, root-cause-tracing, defensive-programming\u003C/p>\n\u003Cp>\u003Cstrong>Test with:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Application scenarios: Can they apply the technique correctly?\u003C/li>\n\u003Cli>Variation scenarios: Do they handle edge cases?\u003C/li>\n\u003Cli>Missing information tests: Do instructions have gaps?\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Success criteria:\u003C/strong> Agent successfully applies technique to new scenario\u003C/p>\n\u003Ch3>Pattern Skills (mental models)\u003C/h3>\n\u003Cp>\u003Cstrong>Examples:\u003C/strong> reducing-complexity, information-hiding concepts\u003C/p>\n\u003Cp>\u003Cstrong>Test with:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Recognition scenarios: Do they recognize when pattern applies?\u003C/li>\n\u003Cli>Application scenarios: Can they use the mental model?\u003C/li>\n\u003Cli>Counter-examples: Do they know when NOT to apply?\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Success criteria:\u003C/strong> Agent correctly identifies when/how to apply pattern\u003C/p>\n\u003Ch3>Reference Skills (documentation/APIs)\u003C/h3>\n\u003Cp>\u003Cstrong>Examples:\u003C/strong> API documentation, command references, library guides\u003C/p>\n\u003Cp>\u003Cstrong>Test with:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Retrieval scenarios: Can they find the right information?\u003C/li>\n\u003Cli>Application scenarios: Can they use what they found correctly?\u003C/li>\n\u003Cli>Gap testing: Are common use cases covered?\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Success criteria:\u003C/strong> Agent finds and correctly applies reference information\u003C/p>\n\u003Ch2>Common Rationalizations for Skipping Testing\u003C/h2>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Excuse\u003C/th>\n\u003Cth>Reality\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>&quot;Skill is obviously clear&quot;\u003C/td>\n\u003Ctd>Clear to you ≠ clear to other agents. Test it.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;It&#39;s just a reference&quot;\u003C/td>\n\u003Ctd>References can have gaps, unclear sections. Test retrieval.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;Testing is overkill&quot;\u003C/td>\n\u003Ctd>Untested skills have issues. Always. 15 min testing saves hours.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;I&#39;ll test if problems emerge&quot;\u003C/td>\n\u003Ctd>Problems = agents can&#39;t use skill. Test BEFORE deploying.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;Too tedious to test&quot;\u003C/td>\n\u003Ctd>Testing is less tedious than debugging bad skill in production.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;I&#39;m confident it&#39;s good&quot;\u003C/td>\n\u003Ctd>Overconfidence guarantees issues. Test anyway.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;Academic review is enough&quot;\u003C/td>\n\u003Ctd>Reading ≠ using. Test application scenarios.\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>&quot;No time to test&quot;\u003C/td>\n\u003Ctd>Deploying untested skill wastes more time fixing it later.\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>\u003Cstrong>All of these mean: Test before deploying. No exceptions.\u003C/strong>\u003C/p>\n\u003Ch2>Bulletproofing Skills Against Rationalization\u003C/h2>\n\u003Cp>Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.\u003C/p>\n\u003Cp>\u003Cstrong>Psychology note:\u003C/strong> Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.\u003C/p>\n\u003Ch3>Close Every Loophole Explicitly\u003C/h3>\n\u003Cp>Don&#39;t just state the rule - forbid specific workarounds:\u003C/p>\n\u003CBad>\n```markdown\nWrite code before test? Delete it.\n```\n\u003C/Bad>\n\n\u003CGood>\n```markdown\nWrite code before test? Delete it. Start over.\n\n\u003Cp>\u003Cstrong>No exceptions:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Don&#39;t keep it as &quot;reference&quot;\u003C/li>\n\u003Cli>Don&#39;t &quot;adapt&quot; it while writing tests\u003C/li>\n\u003Cli>Don&#39;t look at it\u003C/li>\n\u003Cli>Delete means delete\u003C/li>\n\u003C/ul>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">&lt;/Good&gt;\n\n### Address &quot;Spirit vs Letter&quot; Arguments\n\nAdd foundational principle early:\n\n```markdown\n**Violating the letter of the rules is violating the spirit of the rules.**\u003C/code>\u003C/pre>\u003C/div>\u003Cp>This cuts off entire class of &quot;I&#39;m following the spirit&quot; rationalizations.\u003C/p>\n\u003Ch3>Build Rationalization Table\u003C/h3>\n\u003Cp>Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">markdown\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-markdown\">| Excuse | Reality |\n|--------|---------|\n| &quot;Too simple to test&quot; | Simple code breaks. Test takes 30 seconds. |\n| &quot;I&#x27;ll test after&quot; | Tests passing immediately prove nothing. |\n| &quot;Tests after achieve same goals&quot; | Tests-after = &quot;what does this do?&quot; Tests-first = &quot;what should this do?&quot; |\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Create Red Flags List\u003C/h3>\n\u003Cp>Make it easy for agents to self-check when rationalizing:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">markdown\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-markdown\">\u003Cspan class=\"hljs-section\">## Red Flags - STOP and Start Over\u003C/span>\n\n\u003Cspan class=\"hljs-bullet\">-\u003C/span> Code before test\n\u003Cspan class=\"hljs-bullet\">-\u003C/span> &quot;I already manually tested it&quot;\n\u003Cspan class=\"hljs-bullet\">-\u003C/span> &quot;Tests after achieve the same purpose&quot;\n\u003Cspan class=\"hljs-bullet\">-\u003C/span> &quot;It&#x27;s about spirit not ritual&quot;\n\u003Cspan class=\"hljs-bullet\">-\u003C/span> &quot;This is different because...&quot;\n\n\u003Cspan class=\"hljs-strong\">**All of these mean: Delete code. Start over with TDD.**\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Update CSO for Violation Symptoms\u003C/h3>\n\u003Cp>Add to description: symptoms of when you&#39;re ABOUT to violate the rule:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">yaml\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-attr\">description:\u003C/span> \u003Cspan class=\"hljs-string\">use\u003C/span> \u003Cspan class=\"hljs-string\">when\u003C/span> \u003Cspan class=\"hljs-string\">implementing\u003C/span> \u003Cspan class=\"hljs-string\">any\u003C/span> \u003Cspan class=\"hljs-string\">feature\u003C/span> \u003Cspan class=\"hljs-string\">or\u003C/span> \u003Cspan class=\"hljs-string\">bugfix,\u003C/span> \u003Cspan class=\"hljs-string\">before\u003C/span> \u003Cspan class=\"hljs-string\">writing\u003C/span> \u003Cspan class=\"hljs-string\">implementation\u003C/span> \u003Cspan class=\"hljs-string\">code\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Ch2>RED-GREEN-REFACTOR for Skills\u003C/h2>\n\u003Cp>Follow the TDD cycle:\u003C/p>\n\u003Ch3>RED: Write Failing Test (Baseline)\u003C/h3>\n\u003Cp>Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:\u003C/p>\n\u003Cul>\n\u003Cli>What choices did they make?\u003C/li>\n\u003Cli>What rationalizations did they use (verbatim)?\u003C/li>\n\u003Cli>Which pressures triggered violations?\u003C/li>\n\u003C/ul>\n\u003Cp>This is &quot;watch the test fail&quot; - you must see what agents naturally do before writing the skill.\u003C/p>\n\u003Ch3>GREEN: Write Minimal Skill\u003C/h3>\n\u003Cp>Write skill that addresses those specific rationalizations. Don&#39;t add extra content for hypothetical cases.\u003C/p>\n\u003Cp>Run same scenarios WITH skill. Agent should now comply.\u003C/p>\n\u003Ch3>REFACTOR: Close Loopholes\u003C/h3>\n\u003Cp>Agent found new rationalization? Add explicit counter. Re-test until bulletproof.\u003C/p>\n\u003Cp>\u003Cstrong>Testing methodology:\u003C/strong> See @testing-skills-with-subagents.md for the complete testing methodology:\u003C/p>\n\u003Cul>\n\u003Cli>How to write pressure scenarios\u003C/li>\n\u003Cli>Pressure types (time, sunk cost, authority, exhaustion)\u003C/li>\n\u003Cli>Plugging holes systematically\u003C/li>\n\u003Cli>Meta-testing techniques\u003C/li>\n\u003C/ul>\n\u003Ch2>Anti-Patterns\u003C/h2>\n\u003Ch3>❌ Narrative Example\u003C/h3>\n\u003Cp>&quot;In session 2025-10-03, we found empty projectDir caused...&quot;\n\u003Cstrong>Why bad:\u003C/strong> Too specific, not reusable\u003C/p>\n\u003Ch3>❌ Multi-Language Dilution\u003C/h3>\n\u003Cp>example-js.js, example-py.py, example-go.go\n\u003Cstrong>Why bad:\u003C/strong> Mediocre quality, maintenance burden\u003C/p>\n\u003Ch3>❌ Code in Flowcharts\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">dot\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">step1 [label=&quot;import fs&quot;];\nstep2 [label=&quot;read file&quot;];\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Why bad:\u003C/strong> Can&#39;t copy-paste, hard to read\u003C/p>\n\u003Ch3>❌ Generic Labels\u003C/h3>\n\u003Cp>helper1, helper2, step3, pattern4\n\u003Cstrong>Why bad:\u003C/strong> Labels should have semantic meaning\u003C/p>\n\u003Ch2>STOP: Before Moving to Next Skill\u003C/h2>\n\u003Cp>\u003Cstrong>After writing ANY skill, you MUST STOP and complete the deployment process.\u003C/strong>\u003C/p>\n\u003Cp>\u003Cstrong>Do NOT:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Create multiple skills in batch without testing each\u003C/li>\n\u003Cli>Move to next skill before current one is verified\u003C/li>\n\u003Cli>Skip testing because &quot;batching is more efficient&quot;\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>The deployment checklist below is MANDATORY for EACH skill.\u003C/strong>\u003C/p>\n\u003Cp>Deploying untested skills = deploying untested code. It&#39;s a violation of quality standards.\u003C/p>\n\u003Ch2>Skill Creation Checklist (TDD Adapted)\u003C/h2>\n\u003Cp>\u003Cstrong>IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.\u003C/strong>\u003C/p>\n\u003Cp>\u003Cstrong>RED Phase - Write Failing Test:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Create pressure scenarios (3+ combined pressures for discipline skills)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Run scenarios WITHOUT skill - document baseline behavior verbatim\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Identify patterns in rationalizations/failures\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>GREEN Phase - Write Minimal Skill:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Name uses only letters, numbers, hyphens (no parentheses/special chars)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> YAML frontmatter with only name and description (max 1024 chars)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Description starts with &quot;Use when...&quot; and includes specific triggers/symptoms\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Description written in third person\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Keywords throughout for search (errors, symptoms, tools)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Clear overview with core principle\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Address specific baseline failures identified in RED\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Code inline OR link to separate file\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> One excellent example (not multi-language)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Run scenarios WITH skill - verify agents now comply\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>REFACTOR Phase - Close Loopholes:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Identify NEW rationalizations from testing\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Add explicit counters (if discipline skill)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Build rationalization table from all test iterations\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Create red flags list\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Re-test until bulletproof\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Quality Checks:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Small flowchart only if decision non-obvious\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Quick reference table\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Common mistakes section\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> No narrative storytelling\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Supporting files only for tools or heavy reference\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Deployment:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Commit skill to git and push to your fork (if configured)\u003C/li>\n\u003Cli>\u003Cinput disabled=\"\" type=\"checkbox\"> Consider contributing back via PR (if broadly useful)\u003C/li>\n\u003C/ul>\n\u003Ch2>Discovery Workflow\u003C/h2>\n\u003Cp>How future Claude finds your skill:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cstrong>Encounters problem\u003C/strong> (&quot;tests are flaky&quot;)\u003C/li>\n\u003Cli>\u003Cstrong>Finds SKILL\u003C/strong> (description matches)\u003C/li>\n\u003Cli>\u003Cstrong>Scans overview\u003C/strong> (is this relevant?)\u003C/li>\n\u003Cli>\u003Cstrong>Reads patterns\u003C/strong> (quick reference table)\u003C/li>\n\u003Cli>\u003Cstrong>Loads example\u003C/strong> (only when implementing)\u003C/li>\n\u003C/ol>\n\u003Cp>\u003Cstrong>Optimize for this flow\u003C/strong> - put searchable terms early and often.\u003C/p>\n\u003Ch2>The Bottom Line\u003C/h2>\n\u003Cp>\u003Cstrong>Creating skills IS TDD for process documentation.\u003C/strong>\u003C/p>\n\u003Cp>Same Iron Law: No skill without failing test first.\nSame cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes).\nSame benefits: Better quality, fewer surprises, bulletproof results.\u003C/p>\n\u003Cp>If you follow TDD for code, follow it for skills. It&#39;s the same discipline applied to documentation.\u003C/p>\n"]