Agent skill
worker-superpowers
This skill should be used when a worker needs to "debug a failing test", "trace root cause", "follow TDD workflow", "verify before completion", "brainstorm approach", "use systematic debugging", "use superpowers", "red green refactor", or when any pipeline worker needs access to structured development powers. Bundles four development methodologies (TDD, systematic debugging, verification, brainstorming) adapted from the superpowers framework for CoBuilder pipeline workers.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/worker-superpowers
SKILL.md
Worker Superpowers
Structured development powers for CoBuilder pipeline workers, adapted from the superpowers methodology. Four composable powers that enforce disciplined development: test first, debug systematically, verify before completion, brainstorm when uncertain.
Load this skill at the start of any worker task: Skill("worker-superpowers")
Power 1: Test-Driven Development (RED-GREEN-REFACTOR)
RED Phase — Write Failing Test
- Read the acceptance criteria from the task assignment
- Write a test that captures the expected behavior
- Run the test — it MUST fail
- If the test passes → feature already exists or test is wrong
GREEN Phase — Minimal Implementation
- Write the minimum code to make the failing test pass
- Do not add features beyond what the test requires
- Run the test — it MUST pass
REFACTOR Phase — Clean Up
- Improve code quality while tests stay green
- Remove duplication, improve naming, simplify logic
- Run tests after every change
Sub-Agent Separation
Never let the same sub-agent write both the test and the implementation:
Worker (Opus) coordinates:
RED: Sub-agent A writes failing test → Sub-agent B confirms failure
GREEN: Sub-agent C implements code → Sub-agent D confirms pass
REFACTOR: Sub-agent E cleans up → Sub-agent F confirms still passing
| Phase | Action | Test Must | Anti-Pattern |
|---|---|---|---|
| RED | Write test for expected behavior | FAIL | Writing tests after code |
| GREEN | Write minimum code | PASS | Gold-plating, adding extras |
| REFACTOR | Clean up, remove duplication | STAY GREEN | Adding new functionality |
Power 2: Systematic Debugging
When a test fails unexpectedly, follow this 7-step protocol:
- Reproduce — Run the failing test, capture exact error output
- Hypothesize — Form 2-3 theories about root cause
- Isolate — Test each hypothesis (read code path, add diagnostics, check I/O)
- Identify — Determine actual root cause (not symptoms)
- Fix — Apply minimal fix for the root cause
- Verify — Run original failing test + regression tests
- Clean up — Remove diagnostic code, commit the fix
Investigation Techniques
| Symptom | Investigation |
|---|---|
| Test timeout | Infinite loops, unresolved promises, missing await |
| Wrong output | Trace data flow input→output, check each transformation |
| Import error | File paths, exports, dependencies |
| Intermittent | Race conditions, shared mutable state, time dependencies |
Anti-Patterns
- Shotgun debugging: Changing random things hoping something works
- Fix the symptom: Suppressing errors instead of fixing causes
- Retry blindly: Re-running without investigating why it failed
For extended scenarios, see references/debugging-playbook.md.
Power 3: Verification Before Completion
MANDATORY before claiming any task is done.
Checklist
-
Run all tests — Actually execute, capture output as evidence:
bashpytest tests/ -v 2>&1 | tee .pipelines/evidence/task-{id}-tests.log -
Check scope compliance — Only scoped files modified:
bashgit diff --name-only # Compare against task scope -
Check for incomplete markers:
bashgrep -rn "TODO\|FIXME\|HACK\|XXX" [scoped-files] # Must return empty -
Verify git status — Everything committed, working tree clean
-
Validate acceptance criteria — Each criterion has evidence:
| Criterion | Evidence | Status |
|---|---|---|
| {AC-1} | {test output / log} | PASS/FAIL |
Common Failures
| Claim | Reality | Fix |
|---|---|---|
| "Tests pass" | Didn't run them | Run tests, capture output |
| "Feature works" | Only happy path tested | Test edge cases |
| "Code is clean" | Has TODO markers | Remove or complete them |
Power 4: Brainstorming
When the path forward is unclear, evaluate trade-offs before committing.
- List 2-3 approaches with description
- Evaluate against criteria:
| Factor | Weight | Question |
|---|---|---|
| Simplicity | High | Fewer moving parts? |
| Testability | High | Easiest to write tests for? |
| Scope | Critical | Stays within assigned file scope? |
| Reversibility | Medium | Easiest to change if wrong? |
- Select simplest and most testable approach
- Document decision in a code comment
When in doubt, choose the simplest approach and validate with a test.
Quick Reference
| Situation | Power | Action |
|---|---|---|
| Starting a feature | TDD | Write failing test first |
| Test fails unexpectedly | Systematic Debugging | Follow the 7-step protocol |
| Task feels complete | Verification | Run the full checklist |
| Multiple valid approaches | Brainstorming | Evaluate trade-offs |
| Sub-agent failed | Systematic Debugging | Diagnose, don't retry blindly |
Additional Resources
Reference Files
references/testing-anti-patterns.md— 10 common testing mistakes to avoidreferences/debugging-playbook.md— Extended debugging scenarios with decision tree
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?