Debugging

Prompt Debugging Playbook

When a prompt gives weak results, the cause is usually one of a few common problems: unclear task, missing context, no output shape, weak grounding, or no quality check.

How to debug a bad prompt

SymptomLikely causeFix
Answer is vagueTask is too broadNarrow the task and define exact output sections.
Answer ignores constraintsConstraints are weak or lateMove constraints near the top and make them explicit.
Hallucinated factsNo grounding or stale knowledgeUse retrieval, documents, or explicit uncertainty rules.
Overly long responseNo response shapeSpecify length and structure.

Debug template

Analyse why the following prompt is underperforming.

Prompt:
{prompt_here}

Observed bad output:
{bad_output_here}

Please return:
1. root cause analysis
2. rewritten prompt
3. explanation of improvements
4. test cases to validate the new version