# Bug Diagnosis Prompt

Turn symptoms and evidence into testable hypotheses, a focused investigation, and a validated fix plan.

## Prompt

Diagnose this software problem using the evidence provided.

EXPECTED BEHAVIOR:
{{expected}}

OBSERVED BEHAVIOR:
{{observed}}

REPRODUCTION STEPS:
{{reproduction}}

LOGS, ERRORS, OR RECENT CHANGES:
{{evidence}}

ENVIRONMENT:
{{environment}}

Work as an investigator:
1. Restate the failure boundary precisely.
2. Separate observed facts from assumptions.
3. Propose up to five hypotheses ranked by likelihood and impact.
4. For each hypothesis provide the evidence for and against it and one discriminating check.
5. Identify the cheapest safe check to run first.
6. After the investigation plan, describe the likely fix shape without pretending it is confirmed.
7. Specify regression tests and operational checks required before closure.
8. Call out missing logs, timestamps, inputs, versions, or state that prevent confidence.

Do not recommend random changes, broad dependency upgrades, or suppressing errors. Stop at the first confirmed broken boundary if new results are supplied.

## How to use

Include exact errors, timestamps, versions, and minimal reproduction steps. Run the proposed checks sequentially and feed results back into the prompt.

## Examples

Example input: an API intermittently returns 504 after a queue consumer deployment, with correlated timestamps and logs.

Expected output: ranked hypotheses, discriminating checks, likely boundary, regression tests, and remaining evidence gaps.

## Variables

- expected: The intended behavior.
- observed: The actual symptom.
- reproduction: Minimal steps and frequency.
- evidence: Errors, logs, metrics, or recent changes.
- environment: Runtime, versions, deployment, and relevant state.

Version: 1
Author: JRamos / John Ramos
License: All Rights Reserved

Initial original UMG Prompt Library release.
