Workflow: Bug Fix

Diagnose and fix a reported bug.

When to Use

  • Ticket describes a bug with reproduction steps or error details
  • Hotfixes (critical priority) follow the same flow but skip the backlog queue

Inputs

  • Issue identifier, title, and description (including repro steps, error messages, logs)
  • The target repo’s codebase

Steps

  1. Reproduce — understand the bug from the description. Read relevant code and try to identify the root cause
  2. Diagnose — trace the code path. Read error messages, logs, and stack traces. Identify the exact location and cause
  3. Write a failing test — create a test that demonstrates the bug before fixing it
  4. Fix — make the minimal change to resolve the root cause. Do not fix adjacent issues
  5. Verify — run the failing test (now passing) plus the full test suite
  6. Commit with conventional commit messages

Quality Checks

  • Root cause is identified, not just symptoms patched
  • A regression test exists that would catch this bug if reintroduced
  • Fix is minimal — no unrelated changes
  • All existing tests still pass

References

  • See “Hotfix Process” in .ai/projects/cascadeguard/sdlc.md
  • .ai/steering/bug-fix-workflow.md