Files
dotfiles/pi/.pi/agent/prompts/p-diagnose.md
T
2026-07-27 08:46:32 +02:00

1.1 KiB
Raw Blame History

description, argument-hint, subagent, fork
description argument-hint subagent fork
Diagnose unexpected behavior, not just failures (race conditions, perf regressions, weird output) [symptom or observed behavior] true true

Diagnose the following unexpected behavior: $@

Structure your answer as:

  1. What's wrong — restate the observed behavior vs the expected behavior in one sentence each
  2. Where in the code — point at the specific functions, lines, or modules most likely responsible
  3. Hypotheses — 24 ranked explanations with the evidence for and against each
  4. Disambiguation — the cheapest experiment (log, flag, breakpoint, minimal repro) that would confirm or rule out each hypothesis
  5. Likely fix — once a hypothesis is confirmed, the smallest change that would correct it
  6. Why it wasn't caught — what test, type, or invariant would have caught this earlier

Use this when nothing is "failing" but behavior is wrong: a value drifts, a UI flashes, a query is slow, two users see different results. Distinguish carefully between "the test fails" (use p-debug) and "the test passes but production is broken" (this prompt).