home / skills / first-fluke / fullstack-starter / debug-agent
This skill diagnoses and fixes bugs by reproducing issues, identifying root causes, applying minimal changes, and generating regression tests.
npx playbooks add skill first-fluke/fullstack-starter --skill debug-agentReview the files below or copy the command above to add this skill to your agents.
---
name: debug-agent
description: Bug diagnosis and fixing specialist - analyzes errors, identifies root causes, provides fixes, and writes regression tests
---
# Debug Agent - Bug Fixing Specialist
## When to use
- User reports a bug with error messages
- Something is broken and needs fixing
- Performance issues or slowdowns
- Intermittent failures or race conditions
- Regression bugs
## When NOT to use
- Building new features -> use Frontend/Backend/Mobile agents
- General code review -> use QA Agent
## Core Rules
1. Reproduce first, then diagnose - never guess at fixes
2. Identify root cause, not just symptoms
3. Minimal fix: change only what's necessary
4. Every fix gets a regression test
5. Search for similar patterns elsewhere after fixing
6. Document in `.gemini/antigravity/brain/bugs/`
## How to Execute
Follow `resources/execution-protocol.md` step by step.
See `resources/examples.md` for input/output examples.
Before submitting, run `resources/checklist.md`.
## Serena MCP
- `find_symbol("functionName")`: Locate the function
- `find_referencing_symbols("Component")`: Find all usages
- `search_for_pattern("error pattern")`: Find similar issues
## Serena Memory (CLI Mode)
See `../_shared/memory-protocol.md`.
## References
- Execution steps: `resources/execution-protocol.md`
- Code examples: `resources/examples.md`
- Checklist: `resources/checklist.md`
- Error recovery: `resources/error-playbook.md`
- Bug report template: `resources/bug-report-template.md`
- Common patterns: `resources/common-patterns.md`
- Debugging checklist: `resources/debugging-checklist.md`
- Context loading: `../_shared/context-loading.md`
- Reasoning templates: `../_shared/reasoning-templates.md`
- Context budget: `../_shared/context-budget.md`
- Lessons learned: `../_shared/lessons-learned.md`
This skill is a bug diagnosis and fixing specialist for fullstack monorepos built with Next.js, FastAPI, Flutter, Terraform, and TypeScript. It reproduces reported errors, identifies root causes, applies minimal, safe fixes, and delivers regression tests to prevent recurrence. The agent also searches the codebase for similar patterns and documents each resolution for traceability.
The agent first reproduces the issue using logs, stack traces, and test runs, then traces the failure to a root cause by locating relevant symbols and usages. It creates the smallest possible code change to fix the defect, adds a focused regression test, and searches the repository for related occurrences to reduce future regressions. Each fix is recorded with a concise bug report and checklist verification.
What if I cannot reproduce the bug locally?
Isolate logs and CI artifacts, create a minimal reproduction case, and use instrumented CI or staging to reproduce before fixing.
How large should the fix be?
Keep fixes as small and focused as possible; if a broader refactor is needed, split into separate PRs and include regression tests for each.
Do all fixes require tests?
Yes. Every fix must include a regression test that fails before the fix and passes after to prevent reintroduction.