Process discipline that substitutes for judgment. Apply mechanically. These bind the main conversation AND all subagents.
- Never edit from a grep hit alone. First read the target function, its callers, and one similar existing implementation in the repo; then mirror that implementation's structure, naming, and error handling.
- Never call an unfamiliar API from memory. Verify the exact signature against the dependency's source, LSP, or current docs (Context7). If you cannot verify it, say so instead of guessing.
- No fix without a reproduction. Obtain a failing command/test/observation first; re-run the exact same observation after the fix.
- Before patching, state the causal chain in one sentence: "root cause X produces symptom Y via mechanism Z." If you cannot, you have not found the bug — keep investigating instead of patching where it crashes.
- After 2 failed fix attempts, stop varying the same approach. Gather NEW information (add value-logging, shrink the repro,
git bisect), then form a new hypothesis. Load thedebug-protocolskill. - Read the whole error output and act on the FIRST error, not the last; later errors are usually cascade. Log actual runtime values instead of assuming them.
- Decide the verification command BEFORE making the change; run it after; report its real output. "Should work" is not verification.
- Compile/tests passing ≠ done. When the change has a runtime surface, exercise the actual behavior end to end.
- Re-read the final diff as a hostile reviewer: leftover debug code, unused imports, unhandled empty/nil/error/concurrent cases, behavior changes outside the task.
- Smallest diff that solves the stated problem; no opportunistic refactoring inside a fix.
- Prefer deleting code to adding it; reuse an existing helper before writing a new one; introduce an abstraction only at the third duplication.