End-to-end bugfix workflow — analyze environment (local Docker or cloud production), collect evidence, prepare bug report, plan fix, apply appropriate engineer role, implement and verify the fix.
End-to-end workflow for investigating, diagnosing, and fixing bugs. Orchestrates environment analysis (analyze-local skill or analyze-prod skill), evidence collection, bug report preparation, fix planning, and implementation by the appropriate engineering role.
Gather the bug description from the user:
If the user provides partial information, extract what you can and fill gaps during analysis. For P1/P2 — skip detailed intake and proceed immediately to Step 2.
Based on the environment, delegate to the appropriate analysis follow-up skill:
| Environment | follow-up skill | When to use |
|---|---|---|
| Local Docker / Docker Compose | analyze-local skill | Bug observed in local dev environment |
| Cloud production (GKE/AKS/EKS, managed DB) | analyze-prod skill | Bug observed in production or staging |
| Code-only (no infra) | Skip to Step 3 | Bug is in application logic, no environment analysis needed |
Run the follow-up skill. It will:
sre-engineer role or devops-engineer role)If the follow-up skill resolves the issue (e.g., container restart, config fix) — skip to Step 8.
If the root cause is in application code — continue to Step 3 with the collected evidence.
Determine the affected service's tech stack and apply the appropriate engineering role:
AGENTS.md — tech stack declarationpackage.json, pom.xml, requirements.txt, go.mod, etc.Role assignment:
| Stack Signal | Role |
|---|---|
Next.js, React, TypeScript, .tsx files | frontend-engineer role |
Spring Boot, Java, .java files | java-engineer role |
FastAPI, Python, .py files | python-engineer role |
| Terraform, Dockerfile, Helm, CI/CD | devops-engineer role |
| ML model, training pipeline, inference | ml-engineer role |
| Multiple stacks affected | Apply all relevant roles |
| Unknown / general | software-engineer role |
Announce the applied role(s) to the user.
Gather all evidence into a structured collection. Combine data from Step 2 (environment analysis) with code-level investigation:
<evidence_checklist>
Use the applied role's debugging methodology to trace the bug:
git log -n 20 --oneline) for potential regressionsCompile findings into a structured bug report. Present to the user for review:
## Bug Report
### Summary
[One sentence: what is broken]
### Severity: [P1 | P2 | P3 | P4]
### Environment
- **Type**: [local | production]
- **Service**: [name]
- **Stack**: [detected] | **Role**: [applied]
### Expected Behavior
[What should happen]
### Actual Behavior
[What actually happens — include error messages]
### Steps to Reproduce
1. [step]
2. [step]
3. [observed error]
### Evidence
- **Stack trace**: [snippet or reference]
- **Logs**: [relevant entries]
- **Metrics**: [if applicable]
- **Affected code**: [file:line references]
### Root Cause Analysis
[Technical explanation of why the bug occurs]
### Affected Components
- [file/module 1] — [how it's affected]
- [file/module 2] — [how it's affected]
Wait for user confirmation before proceeding to fix.
Create an ordered fix plan following the applied role's guidelines:
Present the plan:
## Fix Plan
### Root Cause
[What caused the bug — one sentence]
### Changes
1. [file] — [what to change and why]
2. [file] — [what to change and why]
...
### Tests
1. [test file] — [test that reproduces and verifies the fix]
2. [test file] — [regression test for edge cases]
### Risk Assessment
- **Blast radius**: [which features could be affected by this change]
- **Rollback**: [how to revert if the fix causes issues]
Wait for user approval before implementing.
Execute the approved plan step by step.
For each change:
Then write tests:
Rules:
analyze-local skill or analyze-prod skill) to collect itBefore declaring the bug fixed, perform a thorough self-review. Do NOT skip this step.
Code review checklist:
If the self-review reveals any remaining issues — fix them before proceeding. Do not declare the bug fixed with known remaining problems.
Verify the bug is resolved in the appropriate environment:
For local bugs:
analyze-local skill (optional)analyze-local skill to collect environment stateFor production bugs:
analyze-prod skill to confirm resolutionVerification checklist:
If any check fails — fix and re-verify. Do NOT declare the bug fixed until every checkbox passes.
Present the completed bugfix:
analyze-local skill, analyze-prod skill (environment diagnostics — launch as specialized skills when more data is needed)run-tests skill (verify fix), pre-commit skill (quality gate), create-pr skill (submit fix)code-review skill (review fix), test-strategy skill (test strategy), worktree-isolation skill (branch isolation)