Systematic Debugging
Do not jump to fixes. Find root cause first.
4-phase process
1) Root-cause investigation
- Reproduce issue with explicit steps.
- Read errors/stack traces fully.
- Check recent changes likely to affect behavior.
- Gather targeted evidence at component boundaries.
2) Pattern identification
- Find similar working code/path.
- Compare working vs failing flow.
- List concrete differences.
3) Hypothesis test
- Form one hypothesis at a time.
- Apply the smallest possible change to test it.
- Validate hypothesis before moving to additional changes.
4) Minimal fix + validation
- Implement only the root-cause fix.
- Re-run reproduction and verification commands.
- Confirm no collateral regressions in affected scope.
Guardrails
- If 2+ blind fixes already failed, restart at Phase 1.
- If 3+ attempts fail, escalate: question architecture/pattern choice.
- Never report success without applying
verification-before-completion.
Supporting techniques (use when applicable)
root-cause-tracing.mdfor deep stack tracing.condition-based-waiting.mdfor async/timing issues.defense-in-depth.mdfor post-fix boundary hardening.find-polluter.shwhen isolated test passes but suite fails.
In this workflow
- Trigger automatically for
/pwf-workand/pwf-work-planwhen the task is bug/debug/failure oriented.