superpowers
superpowers copied to clipboard
Add context: fork option to systematic-debugging skill
Summary
Add support for context: fork to the systematic-debugging skill, allowing its heavy 4-phase investigation process to run in an isolated sub-agent context.
Background
The systematic-debugging skill is one of the most investigation-heavy skills in the library:
- 4 rigorous phases: Root Cause Investigation → Pattern Analysis → Hypothesis Testing → Implementation
- 11 supporting files: root-cause tracing, defense-in-depth, condition-based waiting, test scenarios, etc.
- Extensive exploration: reading errors, git diffs, stack traces, running diagnostics, comparing code patterns
- Scientific method enforcement: hypothesis forming, minimal testing, verification loops
Why Fork Would Benefit This Skill
Token efficiency:
- Investigation involves many file reads, grep searches, git operations
- Evidence gathering (logging component boundaries, tracing data flow) produces verbose output
- Failed hypotheses and their tests consume tokens but aren't needed afterward
Context cleanliness:
- The investigation journey (hypotheses tried, evidence gathered, dead ends) pollutes main context
- The investigation result (root cause identified, fix verified) is what matters for subsequent work
- Main session stays focused on implementation rather than debugging archaeology
Clean handoff:
- When debugging completes, return to main context with:
- Root cause summary
- The fix applied
- Test verification
- Not the full trail of hypothesis → test → fail → new hypothesis loops
Proposed Change
Add context: fork to the skill frontmatter:
---
name: systematic-debugging
description: Use when encountering any bug, test failure, or unexpected behavior
context: fork
---
Considerations
- Users may sometimes want to see the full investigation trail in main context
- Could be made configurable (fork by default, with option to run inline)
- Related skill
superpowers:test-driven-developmentreferenced in Phase 4 would need coordination if both fork
Related
- Issue #245 (context: fork for brainstorming skill)
- Claude Code CLI 2.1.2 fork feature