plan-before-code
Skill54 starsChanged 6 months agoMITView on GitHub
Plans multi-step work before writing code.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- rainforest888/raincodetheir own version, first seen Aug 12, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- rainforest888/raincode★ 9same name
- aprameyak/coding-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- architecture-sketchingSkill
- autonomous-bug-fixSkill
- behavioral-foundationSkill
- brainstormingSkill
- codebase-onboardingSkill
- code-reviewSkill
- debuggingSkill
- demand-eleganceSkill
- derive-nfr-from-driverSkill
- derive-security-from-riskSkill
- dispatching-parallel-agentsSkill
- durable-workSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- pr-workflowSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- requirements-elicitationSkill
- safety-guardrailsSkill
- security-auditSkill
- self-improvementSkill
- subagent-strategySkill
- test-writingSkill
- traceability-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verify-before-doneSkill
- template-skillSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before implementing unfamiliar features or architectural changes.
- Distinctive: line 20
After a previous approach failed and a re-plan is needed.
- Distinctive: line 21
When scope or requirements are ambiguous.
- Distinctive: line 22
Before refactoring that crosses module boundaries.
- Distinctive: line 23
NOT for: typos, comment-only edits, single-line bug fixes, formatting.
- Very specific: line 56
Before assessing complexity, surface what the dojo already knows so the plan compounds past knowledge instead of re-deriving it.
- Distinctive: line 74
If any answer is "yes" or "maybe," enter plan mode.
- Distinctive: line 102
Before executing, walk the plan once and ask:
- Distinctive: line 110
Follow the plan one step at a time.
- Very specific: line 119
DO NOT: keep the plan only in memory.
- Very specific: line 122
DO NOT: start editing files before the plan block is committed to tasks/todo.md.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Plan Before Code Skill
Forces an explicit written plan in tasks/todo.md before the agent edits any file for non-trivial work. Does NOT apply to one-line fixes, typo corrections, or any task the agent can finish in a single edit — over-planning trivial work is its own failure mode.
When to Use
- Any task that will touch 3+ files or require 3+ steps.
- Before implementing unfamiliar features or architectural changes.
- After a previous approach failed and a re-plan is needed.
- When scope or requirements are ambiguous.
- Before refactoring that crosses module boundaries.
- NOT for: typos, comment-only edits, single-line bug fixes, formatting.
Prerequisites
- A writable
tasks/todo.md(created byscripts/init.shif missing). - An approved problem statement from the user or
brainstormingskill. - The repo cloned and the working tree clean enough to start (use
powershellwithgit status).
How to Run
0. Recall prior memory for the topic (memory_recall MCP tool or scripts/memory-recall.sh) and fold it into Context.
1. Assess complexity (the 4 questions in Procedure §1).
2. If non-trivial → write plan to tasks/todo.md using the canonical block.
3. Validate the plan against the gap checklist.
4. Execute one step at a time, checking items off as you go.Quick Reference
| Situation | Action | Tool |
| Before writing a plan | Recall prior memory | memory_recall MCP tool, or powershell → scripts/memory-recall.sh |
| Touch ≥3 files | Enter plan mode | view tasks/todo.md then edit |
| Re-plan after wall hit | Append a ## Revision N block | edit tasks/todo.md |
| Check existing plan | Read current state | view tasks/todo.md |
| Mark step done | Flip - [ ] to - [x] | edit tasks/todo.md |
| Resume across sessions | Re-read the plan first | view tasks/todo.md |
Procedure
Step 0: Recall Prior Memory
Before assessing complexity, surface what the dojo already knows so the plan
compounds past knowledge instead of re-deriving it. Use the memory_recall MCP
tool with the work's topic (and language/fileType when known). If that tool
is unavailable, use powershell to run scripts/memory-recall.sh --topic "<topic>".
Fold the returned active decisions, matching patterns, and recent sessions into the Context block of the plan. This step is advisory: an empty vault or a recall with no hits never blocks planning — just proceed to Step 1.
Step 1: Assess Complexity
Answer these four questions in order:
- How many files will this touch?
- Are there architectural decisions to make?
- Could this break existing functionality?
- Is the requirement ambiguous?
If any answer is "yes" or "maybe," enter plan mode. Otherwise, proceed without a plan (don't pretend a typo fix needs one).
Step 2: Write the Plan
Append to tasks/todo.md using the edit tool with this canonical block:
## Task: <brief description>
### Context
- What: <what we're building or fixing>
- Why: <the motivation>
- Risk: <what could go wrong>
- Prior memory: <decisions/patterns/sessions surfaced in Step 0, or "none">
### Steps
- [ ] Step 1: <specific action>
- [ ] Step 2: <specific action>
- [ ] Step 3: <specific action>
### Verification
- [ ] Tests pass (`scripts/verify.sh tests`)
- [ ] No regressions
- [ ] Diff reviewedStep 3: Validate the Plan
Before executing, walk the plan once and ask:
- Are step dependencies explicit?
- Is the verification block concrete (specific commands, not vibes)?
- Is any step large enough that it should be split?
Step 4: Execute with Checkpoints
Follow the plan one step at a time. Mark items complete only after the work for that step is done and locally verified. If something goes sideways:
- STOP immediately — don't keep editing on a broken plan.
- Log what went wrong in
tasks/lessons.md. - Append a
### Revision Nblock to the task intasks/todo.md. - Resume from the revised plan.
Pitfalls
- DO NOT keep the plan only in memory. If it is not in
tasks/todo.md, it does not exist. - DO NOT over-plan trivial work. A one-line fix doesn't need a 20-step plan.
- DO NOT refuse to re-plan. The first plan is almost never perfect; revise when new information arrives.
- DO NOT start editing files before the plan block is committed to
tasks/todo.md. - DO NOT mark a step
- [x]until its verification in §2 is satisfied. - DO NOT skip Step 0 recall on familiar-looking work — the whole point is to catch a prior decision or pitfall you've forgotten. A no-hit recall is cheap; a repeated mistake is not.
Verification
- Step 0 recall was run (
memory_recallorscripts/memory-recall.sh) and its findings folded into Context. tasks/todo.mdcontains a## Task:block for the current work.- Every step is concrete (a different agent could execute it).
- Verification block lists specific commands, not just "tests pass".
scripts/verify.sh planpasses.
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.

