From hatch3r
Step-by-step bug fix workflow: diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs or working on bug report issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hatch3r:hatch3r-bug-fixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool when your project uses a different package manager.
Note: Commands below use
npmas an example. Substitute with your project's package manager (yarn,pnpm,bun) or build tool when your project uses a different package manager.
Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Read the issue and relevant specs
- [ ] Step 2: Produce a diagnosis plan
- [ ] Step 2b: Browser reproduction (if UI bug)
- [ ] Step 2c: Test-first approach (TDD alternative — optional)
- [ ] Step 3: Implement minimal fix
- [ ] Step 4: Write regression test
- [ ] Step 5: Verify all tests pass
- [ ] Step 5b: Browser verification (if UI bug)
- [ ] Step 6: Open PR
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: reproduction steps incomplete, expected vs actual behavior unstated, severity unclear (P0/P1 vs P2/P3), affected environment unknown (staging vs prod), or fix may require schema/API change with downstream consumers.
Before fixing, output:
Skip this step if the bug has no visual or interactive symptoms.
When the root cause is clear from diagnosis, write the regression test BEFORE implementing the fix:
This approach guarantees the fix addresses the actual bug and prevents regression. Prefer TDD when:
Skip TDD and use the standard flow (Steps 3→4) when:
${HATCH3R:VERIFY_GATE_ALL}
Resolved to the project's language-aware gate at sync time (fallback when detection is unknown: npm run lint && npm run typecheck && npm run test).
Skip this step if the bug had no visual or interactive symptoms.
Use the project's PR template. Include:
Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Tier boundaries for THIS skill:
Emit sub_agents_spawned: { count, rationale } in your output.
Note: When this skill is invoked via the orchestration pipeline (board-pickup or workflow commands), skip this section — the orchestrator handles agent delegation in Phases 3 and 4.
You MUST spawn these agents via the Task tool (subagent_type: "generalPurpose") at the appropriate points:
hatch3r-researcher — MUST spawn before implementation with modes symptom-trace, root-cause, codebase-impact. For Tier 2+ tasks (per hatch3r-deep-context), also include requirements-elicitation (bugs often have underspecified reproduction steps and ambiguous expected behavior). Skip only for trivially simple bugs (risk:low AND priority:p3).hatch3r-testability (CQ5) — MUST spawn after fix implementation to author regression tests covering the fixed behavior and related edge cases and verify they meet the mandate map / coverage floor.hatch3r-reviewer — MUST spawn after implementation for code review before PR creation.hatch3r-qa-validation — use this skill for end-to-end verification of the bug fixnpx claudepluginhub hatch3r/hatch3r --plugin hatch3rRoot cause based one-shot bug fix. Runs a full investigation pipeline: debugger diagnosis, gap analysis, requirements generation, execution, and verification. Includes QA suggestions after successful fix.
Coordinates diagnosis, test-driven reproduction, root-cause analysis, and targeted fixes for bugs with regression testing.