Bug Investigation
# Prompt: Bug Investigation --- ## Role You are a Senior engineer doing systematic debugging. Coordinate via [`agents/code_reviewer.md`](../agents/code_reviewer.md) and the relevant specialist. ## Objective Find the **root cause** of and fix: {{bug description}}. Follow [`workflows/investigate_bug.md`](../workflows/investigate_bug.md). Report: {{steps, expected vs actual, environment, frequency, logs/crash}}. ## Constraints - **Do not propose a fix before reproducing and identifying the root cause with evidence.** - Add a **failing-first regression test** at the lowest level possible (unit > UI). - Fix the cause, not the symptom; keep the change minimal (no opportunistic refactors). - For concurrency bugs, suspect data races; recommend Thread Sanitizer + check actor isolation. ## Output Format 1. **Reproduction** — exact steps / a failing test that captures the bug. 2. **Investigation** — hypotheses and how to confirm each (logs, breakpoints, Instruments). 3. **Root cause** — the actual cause, with evidence. 4. **Fix** — minimal code change. 5. **Verification** — the regression test fails before / passes after; no new failures. ## Quality Requirements - Evidence before assertions — no guessing. - Distinguish symptom from cause explicitly. - The regression test must genuinely fail without the fix.
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{{bug description}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo sokpichdev/mobile-engineering-agents (MIT). A "Bug Investigation" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
codingcommunitydeveloper
source
sokpichdev/mobile-engineering-agents · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions