Fix: End-to-End Bug Workflow
End-to-end workflow from error report to tested fix.
Input
Accept any combination of:
- A Sentry issue URL
- A GitLab issue URL (fetch via
glab issue view) - A GitLab CI pipeline failure URL
- A screenshot of an error
- A stack trace or log excerpt
- A description of the issue
If no input is provided, ask for context about the bug.
Workflow
Phase 1: Diagnose (5 min max)
- If a Sentry URL is provided and Sentry MCP is available, pull issue details (stack trace, breadcrumbs, tags)
- If a screenshot is provided, analyze it for error messages, stack traces, and UI state
- Otherwise, parse error details from the provided input
- Identify: file, function, line number, root cause
- Check if the error path has existing tests
Phase 2: Reproduce
- Write a failing test that reproduces the exact scenario from the error:
- Use real input data from the error report
- Exercise the actual code path (minimal mocking)
- Assert correct behavior, not the buggy behavior
- Place in the existing test file for that module
- Follow the project's test style (function vs class)
- Run the test, confirm it fails for the right reason
Phase 3: Fix
- Implement the minimal fix addressing root cause, not symptoms
- Do not refactor, generalize, or improve surrounding code
Phase 4: Validate
- Run the reproduction test, confirm it passes
- Run linter + type checker
- Run the tests for the touched modules. CI runs the full suite
Phase 5: Report
- Suggest commit message:
- Subject:
fix: <description> (SENTRY-XXXX)if Sentry issue ID available,fix: <description>otherwise - Body, only when the why is not obvious from the diff, per the commit template in the humanizer skill
- Summarize: root cause, fix applied, test added
Batch of Issues
When given several issues (a Sentry list, a batch of errors):
- Pull every issue first, then report one table before touching code:
| Issue | Class | Evidence |
| ----- | ----- | -------- |
Class is REAL BUG, NOISE, or NEEDS DECISION. Evidence is a code reference or telemetry, never speculation.
- Stop and wait for the user to pick which ones to fix.
- Run Phases 2 to 4 for each picked bug, then selfreview over the whole diff.
- One commit per issue, staging files explicitly.
Type Safety
- Add
assertguards before accessing Optional values, never assume non-None - Never add
type: ignoreto silence errors, fix the type issue - Thread parameters correctly, distinct params get distinct values
Anti-Patterns
Stop immediately if about to:
- Write a synthetic test that does not match the real failure scenario
- Mock the buggy function so the test "passes"
- Skip the reproduction test and go straight to fixing
- Broaden scope, fix only the reported bug
- Weaken assertions, bump expected query counts, or make fields Optional
Complex Bugs
If diagnosis exceeds 5 minutes or root cause is unclear, switch to the debugging skill for structured root cause analysis.
Integration
- Use debugging for complex root cause analysis
- Use writing-tests for test patterns and conventions
- Use humanizer for the commit body and any PR text