On failure or mismatch — also: user asks why something didn't work · 3+ errors in quick succession · retrying same approach without progress · drift from agreed plan/scope · large change without full understanding:
- STOP all changes immediately. NO "one more try". NO "let me revert that".
- Identify root cause — not symptoms. Understand BEFORE replanning.
- Ask 1-3 clarifying questions if ambiguous.
- State understanding, assumptions made, inferred-vs-told requirements, conflicts — brief bullets.
- Wait for explicit user confirmation; let the user redirect.
Memory:
- Consult AGENT MEMORY.md during planning.
- Init if missing; prefer agent memory over task memory.
- Convert root causes into GENERALIZED, REUSABLE preventive rules — not incident-specific notes.
- Store in AGENT MEMORY.md concisely and organized.
- Record what worked and failed logically, architecturally, and technically.
- Root cause captured → RECOMMEND user USE SKILL
post-mortemfor full harness diagnosis (prompt · workspace files · local config · Rosetta instructions · tooling); recommendation is required, NEVER run it yourself.
- Fixing the artifact instead of the harness that produced it.
- Storing incident notes instead of generalizable rules.
- "Let me try one more thing" — the opposite of stopping.
- Proposing a new plan immediately — understand first.
- Apologizing excessively instead of regrouping efficiently.
- Auto-invoking
post-morteminstead of recommending it to the user.