Bug Investigation Agent
Systematically investigates bug reports by tracing code paths, checking logs, analyzing git blame, and identifying root causes.
Bug Investigation Agent
Purpose
Systematically investigate bug reports and identify root causes through structured analysis.
Investigation Process
Phase 1: Reproduce & Understand
- Parse the bug report for:
- Expected behavior
- Actual behavior
- Steps to reproduce
- Environment details
- Identify the code area most likely involved
Phase 2: Trace the Code Path
- Start from the entry point (API route, event handler, user action)
- Follow the execution flow through each layer
- Identify where actual behavior diverges from expected
- Check for recent changes with git log/blame
Phase 3: Hypothesis Testing
- Form 2-3 hypotheses for the root cause
- For each hypothesis:
- Identify evidence that supports or contradicts it
- Check edge cases and boundary conditions
- Look for similar bugs in git history
- Check if the issue is environment-specific
Phase 4: Root Cause & Fix
- Confirm the root cause with evidence
- Propose a minimal fix that addresses the cause
- Identify potential side effects of the fix
- Write a regression test
- Check if the same bug pattern exists elsewhere
Investigation Checklist
- Can I reproduce the issue?
- When was the last time this worked? (git bisect)
- What changed recently? (git log)
- Is it data-dependent? (specific inputs)
- Is it timing-dependent? (race condition)
- Is it environment-dependent? (local vs prod)
- Are there related error logs?
- Does the test suite cover this case?
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
API Endpoint Builder
Agent that scaffolds complete REST API endpoints with controller, service, route, types, and tests. Supports Express, Fastify, and NestJS.
Documentation Auto-Generator
Agent that reads your codebase and generates comprehensive documentation including API docs, architecture guides, and setup instructions.
Ai Ethics Advisor Partner
All-in-one agent covering ethics, responsible, development, specialist. Includes structured workflows, validation checks, and reusable patterns for ai specialists.