workflow-plan-contract
Skill1 starsChanged 6 months agoMITView on GitHub
The CONTRACT the expensive planner (V4-Pro / the synth role) must satisfy when it writes PLAN.md for a substantive build, so the cheap local executor implements literally and never has to invent. The plan specifies exact signatures, the algorithm in prose, edge cases, a concrete DONE_CONDITION, and an absolute WORKING_DIRECTORY — then plan_lint gates it before execution. Use when generating the up-front plan for a NEEDS_PLAN task; NOT for single-file edits or questions.
In this repository33 other files it gives its agents.
- skill-process-gotchasSkill
- workflow-cache-disciplineSkill
- workflow-codegraphSkill
- workflow-conductorSkill
- workflow-context-condenserSkill
- workflow-context-hygieneSkill
- workflow-criticSkill
- workflow-deadline-disciplineSkill
- workflow-deep-researchSkill
- workflow-done-definitionSkill
- workflow-edit-formatSkill
- workflow-effort-routingSkill
- workflow-escalateSkill
- workflow-execute-from-planSkill
- workflow-filesystem-offloadSkill
- workflow-learn-frameworkSkill
- workflow-long-running-processesSkill
- workflow-lspSkill
- workflow-memory-curationSkill
- workflow-plan-firstSkill
- workflow-planSkill
- workflow-quality-barSkill
- workflow-repomapSkill
- workflow-retrieve-before-actSkill
- workflow-spec-drivenSkill
- workflow-stuck-detect-resetSkill
- workflow-stuckSkill
- workflow-subagent-isolationSkill
- workflow-subtask-loopSkill
- workflow-task-finishSkill
- workflow-task-startSkill
- workflow-tool-selectionSkill
- workflow-verify-enhancedSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Only for a NEEDS_PLAN task — classify_plan_need / plan_route(phase="plan") returns tier=synth.
- Very specific: line 52
Write it to PLAN.md, then plan_lint it (below) BEFORE any execution.
- Distinctive: line 69
Every public class/function with its exact signature (name, typed params, return type).
- Very specific: line 84
Run plan_lint(repo=…) (or plan_text=…) on the generated PLAN.md.
- Very specific: line 88
If complete is false, the plan goes BACK to the planner (synth) with the specific missing gaps — not forward to the executor.
- Distinctive: line 100
Every "how should I do X" must be answered in the plan.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- TRIGGERS WHEN: a NEEDS_PLAN task is about to be planned on the expensive planner (V4-Pro/synth) — write PLAN.md to this contract so the cheap executor never invents -->Plan contract — the incontrovertible brief the executor can transcribe
This is the plan/execute split (compress-then-reason, inverted): pay for the expensive planner's judgment once, up front, as a brief so complete the cheap local executor never faces a design decision. The local 35B can WRITE any code a good plan specifies; it cannot reliably INVENT the rich structure. So the plan must leave nothing to invent.
Where this sits. [[workflow-plan-first]] decides a task needs a plan and seeds
the definition-of-done; THIS skill is the stricter contract the expensive
planner (the synth role = DeepSeek V4-Pro) must meet when it actually writes
PLAN.md. The cloud mechanics are [[workflow-conductor]]; the executor side is
[[workflow-execute-from-plan]].
When to use
Only for a NEEDS_PLAN task — classify_plan_need / plan_route(phase="plan")
returns tier=synth. That is: an action verb (Implement/Build/Write/Create/Design/
Refactor/Add) AND substantive scope (more than one file, more than a single
function, or it mentions tests). For a single-file edit, a lookup, or a question,
skip this — stay local.
How the plan is generated (don't hand-write the brief)
plan_route(task)→ confirmsphase=plan,tier=synth, the V4-Promodel_id.brief_assemble(task_id, current_blocker, decision_needed, profile="full")— you (the local model) write ONLYcurrent_blocker+decision_needed; the assembler pulls goal/done/constraints from PLAN.md, the KG, and codebase-rag.conductor_synthesize(brief)— V4-Pro returns the plan content.- Write it to PLAN.md, then
plan_lintit (below) BEFORE any execution.
The PLAN.md schema (what V4-Pro must produce)
For the whole task:
- TASK — one sentence restating what is being built.
- WORKING_DIRECTORY — the absolute path the executor operates in (resolved
at plan time).
plan_lintrejects a relative path. - FILES — every file to create/modify, full relative path + one-line purpose.
- DONE_CONDITION (Definition of Done) — concrete and checkable (e.g. "verify green; property_test passes; 12+ tests; FPR within 10% of theoretical at capacity"). Use this exact header so the brief-assembler also surfaces it.
- RISKS — what could go wrong and how the executor detects it early.
And, for EACH file, a FILE SPEC (header ## FILE SPEC: <path>):
- Every public class/function with its exact signature (name, typed params, return type).
- For each function, a prose description of the algorithm precise enough that writing the body needs no design decision — the formula, the data structure, the library call, the control flow. No ambiguity about HOW.
- The edge cases each function handles and the exact error type/message to raise.
- For test files, the test cases by name with the property each one checks.
The plan specifies WHAT and HOW-in-prose — it does not contain the actual implementation code. If the planner writes the whole file body, you're paying steer-tier prices for execution; that's the wrong split.
The completeness gate (plan_lint) and revision
- Run
plan_lint(repo=…)(orplan_text=…) on the generated PLAN.md. It deterministically checks: WORKING_DIRECTORY is absolute; a FILE SPEC exists for every listed file; each FILE SPEC has a signature and prose; DONE_CONDITION is concrete. It returns{complete, missing:[...]}. - If
completeis false, the plan goes BACK to the planner (synth) with the specificmissinggaps — not forward to the executor. Re-synthesize, re-lint. Passrevision_round(increment each round); afterPLAN_LINT_MAX_ROUNDSthe result isbounded/proceed_flagged— proceed with a flagged-incomplete plan rather than looping forever. plan_lintvalidates the PLAN.md document. It is distinct fromdirective_verify, which gates a JSON directive against repo state — don't calldirective_verifyon a PLAN.md.
The principle
The executor must never face a design decision the planner didn't already make. Every "how should I do X" must be answered in the plan. If the executor has to invent an approach, the plan failed — that's a planner-quality bug, fix the plan (tighten this contract), not the executor.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

