refactor-guidelines-contract
Execution Contract — refactor-chain · all phases
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline). Phase: all — a standing contract loaded at run start, in force until the run ends · Prerequisite: none · Next: not a chain step; every step runs under it. Adaptivity / conditional: repo-agnostic and unconditional. Every run, every lane, every phase. It constrains the agent's conduct, never the code's behavior.
Purpose
LLM coding failures are boringly predictable: calling functions that do not exist, quietly doing more than was asked, announcing "done" for work that was never run, flattening a working file to "clean it up", and dressing guesses as facts. This skill is the standing contract against exactly those five failure modes. The orchestrator loads it at run start; every subsequent step inherits its clauses. It is not a phase to complete — it is the rules of engagement while any phase runs.
When to use
- Automatically: the orchestrator loads it when a run starts (
orchestrate.mjs init). - A human suspects a clause is being broken: "does that API even exist?", "that wasn't what I asked for", "you said done but the test fails", "why is the whole file rewritten?".
- Before any claim of completion, any new API call in an edit, or any diff larger than the task.
- When resuming a paused run — the contract reloads with the run.