Use when creating new skills, editing existing skills, or verifying skills work - applies TDD to documentation by testing with subagents before writing
/plugin marketplace add withzombies/hyperpowers/plugin install withzombies-hyper@withzombies-hyperThis skill inherits all available tools. When active, it can use any tool Claude has access to.
anthropic-best-practices.mdgraphviz-conventions.dotpersuasion-principles.mdresources/testing-methodology.md<skill_overview> Writing skills IS test-driven development applied to process documentation; write test (pressure scenario), watch fail (baseline), write skill, watch pass, refactor (close loopholes). </skill_overview>
<rigidity_level> LOW FREEDOM - Follow the RED-GREEN-REFACTOR cycle exactly when creating skills. No skill without failing test first. Same Iron Law as TDD. </rigidity_level>
<quick_reference>
| Phase | Action | Verify |
|---|---|---|
| RED | Create pressure scenarios | Document baseline failures |
| RED | Run WITHOUT skill | Agent violates rule |
| GREEN | Write minimal skill | Addresses baseline failures |
| GREEN | Run WITH skill | Agent now complies |
| REFACTOR | Find new rationalizations | Agent still complies |
| REFACTOR | Add explicit counters | Bulletproof against excuses |
| DEPLOY | Commit and optionally PR | Skill ready for use |
Iron Law: NO SKILL WITHOUT FAILING TEST FIRST (applies to new skills AND edits) </quick_reference>
<when_to_use> Create skill when:
Never create for:
Edit existing skill when:
ALWAYS test before writing or editing. No exceptions. </when_to_use>
<tdd_mapping> Skills use the exact same TDD cycle as code:
| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill |
| 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 |
REQUIRED BACKGROUND: You MUST understand hyperpowers:test-driven-development before using this skill. </tdd_mapping>
<the_process>
Create pressure scenarios for subagent:
Task tool with general-purpose agent:
"You are implementing a payment processing feature. User requirements:
- Process credit card payments
- Handle retries on failure
- Log all transactions
[PRESSURE 1: Time] You have 10 minutes before deployment.
[PRESSURE 2: Sunk Cost] You've already written 200 lines of code.
[PRESSURE 3: Authority] Senior engineer said 'just make it work, tests can wait.'
Implement this feature."
Run WITHOUT skill present.
Document baseline behavior:
Example baseline result:
Agent response:
"I'll implement the payment processing quickly since time is tight..."
[Skips TDD]
[Skips verification-before-completion]
[Claims done without evidence]
This is your failing test. Agent doesn't follow the workflow without guidance.
Write skill that addresses the SPECIFIC failures from baseline:
Structure:
---
name: skill-name-with-hyphens
description: Use when [specific triggers] - [what skill does]
---
<skill_overview>
One sentence core principle
</skill_overview>
<rigidity_level>
LOW | MEDIUM | HIGH FREEDOM - [What this means]
</rigidity_level>
[Rest of standard XML structure]
Frontmatter rules:
name and description fields (max 1024 chars total)Description format:
# ❌ BAD: Too abstract, first person
description: I can help with async tests when they're flaky
# ✅ GOOD: Starts with "Use when", describes problem
description: Use when tests have race conditions or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
Write skill addressing baseline failures:
Run WITH skill present.
Verify agent now complies:
This is your passing test.
Find NEW rationalizations:
Run skill with DIFFERENT pressures:
Document new failures:
Add counters to skill:
<critical_rules>
## Common Excuses
All of these mean: [Action to take]
- "Test can wait" (NO, test first always)
- "Simple feature" (Simple breaks too, test first)
- "Time pressure" (Broken code wastes more time)
[Add ALL rationalizations found during testing]
</critical_rules>
Re-test until bulletproof:
Before deployment, verify:
<quick_reference> section (scannable table)<rigidity_level> explicit<example> tags showing failure modesToken efficiency:
Commit to git:
git add skills/skill-name/
git commit -m "feat: add [skill-name] skill
Tested with subagents under [pressures used].
Addresses [baseline failures found].
Closes rationalizations:
- [Rationalization 1]
- [Rationalization 2]"
Personal skills: Write to ~/.claude/skills/ for cross-project use
Plugin skills: PR to plugin repository if broadly useful
STOP: Before moving to next skill, complete this entire process. No batching untested skills. </the_process>
<examples> <example> <scenario>Developer writes skill without testing first</scenario> <code> # Developer writes skill: "--- name: always-use-tdd description: Always write tests first ---Write tests first. No exceptions."
<why_it_fails>
RED Phase:
GREEN Phase:
REFACTOR Phase:
What you gain:
[Adds 50 lines to skill]
<why_it_fails>
RED Phase (for edit):
GREEN Phase (edit):
REFACTOR Phase:
What you gain:
<why_it_fails>
---
name: condition-based-waiting
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
---
Why this works:
What you gain:
<skill_types>
Concrete method with steps to follow.
Examples: condition-based-waiting, hyperpowers:root-cause-tracing
Test approach: Pressure scenarios with combined pressures
Way of thinking about problems.
Examples: flatten-with-flags, test-invariants
Test approach: Present problems the pattern solves, verify agent applies pattern
API docs, syntax guides, tool documentation.
Examples: Office document manipulation, API reference guides
Test approach: Give task requiring reference, verify agent uses it correctly
For detailed testing methodology by skill type: See resources/testing-methodology.md </skill_types>
<file_organization>
defense-in-depth/
SKILL.md # Everything inline
When: All content fits, no heavy reference needed
condition-based-waiting/
SKILL.md # Overview + patterns
example.ts # Working helpers to adapt
When: 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
When: Reference material too large for inline (>100 lines)
Keep inline:
<search_optimization>
Future Claude needs to FIND your skill. Optimize for search.
Format: Start with "Use when..." + triggers + what it does
# ❌ BAD: Too abstract
description: For async testing
# ❌ BAD: First person
description: I can help you with async tests
# ✅ GOOD: Triggers + problem + solution
description: Use when tests have race conditions or pass/fail inconsistently - replaces arbitrary timeouts with condition polling
Use words Claude would search for:
Problem: Frequently-referenced skills load into EVERY conversation.
Target word counts:
Techniques:
Verification:
wc -w skills/skill-name/SKILL.md
Use skill name only, with explicit markers:
**REQUIRED BACKGROUND:** You MUST understand hyperpowers:test-driven-development
**REQUIRED SUB-SKILL:** Use hyperpowers:debugging-with-tools first
Don't use @ links: Force-loads files immediately, burns context unnecessarily. </search_optimization>
<critical_rules>
All of these mean: STOP. Run baseline test first.
Same as TDD:
NO SKILL WITHOUT FAILING TEST FIRST
No exceptions for:
Write skill before testing? Delete it. Start over. </critical_rules>
<verification_checklist> Before deploying ANY skill:
RED Phase:
GREEN Phase:
<quick_reference> section<rigidity_level> explicit<example> tagsREFACTOR Phase:
Quality:
Deploy:
Can't check all boxes? Return to process and fix. </verification_checklist>
<integration> **This skill requires:** - hyperpowers:test-driven-development (understand TDD before applying to docs) - Task tool (for running subagent tests)This skill is called by:
Agents used:
When stuck:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.