Hatch3r bug fix

From hatch3r/hatch3r · View interactive version

Hatch3r bug fix is an AI agent skill from the GitHub repository hatch3r/hatch3r. Step-by-step bug fix workflow. Diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs, working on bug report issues, or when the user mentions a bug.

How to use this skill

Skill file

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.

Bug Fix Workflow

Quick Start

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

Step 0 — Detect Ambiguity (P8 B1)

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.

Step 1: Read Inputs

Step 2: Diagnosis Plan

Before fixing, output:

Step 2b: Browser Reproduction (if UI Bug)

Skip this step if the bug has no visual or interactive symptoms.

Step 2c: Test-First Approach (TDD Alternative)

When the root cause is clear from diagnosis, write the regression test BEFORE implementing the fix:

  1. Write a failing test that reproduces the exact bug scenario from the issue's reproduction steps.
  2. Run the test — confirm it fails with the expected symptom (not a setup error).
  3. Implement the minimal fix (Step 3) to make the test pass.
  4. Verify the test now passes AND no other tests broke.

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:

Step 3: Minimal Fix

Step 4: Regression Test

Step 5: Verify

${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).

Step 5b: Browser Verification (if UI Bug)

Skip this step if the bug had no visual or interactive symptoms.

Step 6: Open PR

Use the project's PR template. Include:

Fan-out Discipline (P8 B2)

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, task_structure } in your output.

Required Agent Delegation

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: "general-purpose") at the appropriate points:

Related Skills

Error Handling

Definition of Done

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.