Apply Test-Driven Development principles to process documentation and skill design. Learn to test skills through scenario execution - run without the skill to observe failures (RED), write the skill addressing failures (GREEN), then close loopholes (REFACTOR). Master pressure scenario design and bulletproof skill verification.
clawd add obra/testing-skills-with-subagentsTesting Skills With Subagents
This skill teaches how to apply Test-Driven Development principles to process documentation and skill design. It extends TDD concepts beyond code to ensure skills are robust, clear, and resistant to rationalization.
The Testing Approach
The fundamental methodology follows the Red-Green-Refactor cycle adapted for skills:
- RED: Execute scenarios without the skill present and document agent failures
- GREEN: Create or refine the skill to address observed failures
- REFACTOR: Identify new rationalizations and add explicit counters
When to Apply
Use this testing methodology for skills that:
- Require sustained discipline
- Have compliance costs (time, effort)
- Risk rationalization ("just this once")
- Conflict with immediate goals
Skip testing for reference materials or skills without violation risks.
Pressure Scenario Design
Effective skill tests combine multiple pressures: time constraints, sunk costs, exhaustion, and authority pressure. Key elements include concrete options, specific constraints, real file paths, and no escape hatches.
Success Indicators
A skill succeeds when agents:
- Select correct options under maximum pressure
- Cite skill sections as justification
- Acknowledge temptation while maintaining compliance
- Confirm through meta-testing that documentation was sufficiently clear