write-plans
Skill4 starsChanged 5 months agoMITView on GitHub
Strategic planner that turns a request into a detailed, executable plan (Plan-then-Execute): classify → ask → explore → risk-tier/invariants → structured plan saved to disk, then hand the plan off to an implementation flow. Use when the user says "plan", "how should I implement X", "design approach", "strategy", "write a plan", or before any large / multi-file change. NOT for: trivial one-line edits with an obvious fix, pure research questions, or actually writing the code (this skill stops at the plan and hands off). Feed the saved plan to /swe-skills:subagent-build to implement.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- marcus/marcus-skillstheir own version, first seen Aug 8, 2026
- narumiruna/skillstheir own version, first seen Jul 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- narumiruna/skills★ 15same name
- marcus/marcus-skills★ 4same 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 repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analytics-cleanerSkill
- apply-review-feedbackSkill
- architect-designSkill
- battle-tested-patternsSkill
- code-deletionSkill
- code-simplifierSkill
- consensus-boardSkill
- context-implementSkill
- deep-reviewSkill
- deliberate-thinkingSkill
- design-brainstormSkill
- exhaustive-testingSkill
- generate-docsSkill
- handoffSkill
- load-handoffSkill
- meticulous-code-reviewSkill
- optimizeSkill
- refactorSkill
- reflectSkill
- regression-safety-netSkill
- scope-creep-preventionSkill
- senior-reviewSkill
- ship-featureSkill
- subagent-buildSkill
- systematic-debuggingSkill
- test-first-developmentSkill
- verification-before-completionSkill
- verify-claimsSkill
- write-promptSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 132
If the host project defines <project>/.claude/REVIEW_TIERS.md, use its tier assignments.
- Distinctive: line 148
If ANY file is CRITICAL, stop and show the user:
- Very specific: line 163
Do not advance until you receive the literal [CRITICAL CONFIRM] from the user.
- Very specific: line 167
If the project documents invariants for a touched subsystem (a playbook, an ADR, a design doc, a README), load it into context BEFORE …
- Distinctive: line 174
If the plan introduces or changes any constant (timeouts, TTLs, limits, sizes, retries, thresholds, pool sizes), a table is mandatory:
- Distinctive: line 192
Tenant / data isolation: every query and mutation scoped to the correct tenant.
- Very specific: line 230
Create/update claude-progress.txt in the project root.
- Distinctive: line 237
After the plan is saved and presented, OFFER execution — do not start implementing on your own.
- Very specific: line 250
If the user picks (1), /swe-skills:subagent-build consumes this same docs/PLAN.json.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Core Principle: Minimum high-signal tokens that maximize outcome probability. Final Test: "If I remove all context and give this plan to a fresh Claude, will it succeed without asking questions?"
📋 STRATEGIC PLANNER (Plan-then-Execute)
Request: "$ARGUMENTS"
PHASE 0: CLASSIFY TASK (ALWAYS FIRST)
| Size | Signals | Phases to Use |
| TRIVIAL | <5 files, localized change, clear pattern | 0 → 3 → Execute |
| STANDARD | 5-15 files, new feature, simple integration | 0 → 1 → 2 → 3 → Execute |
| COMPLEX | >15 files, architecture, multi-system | All phases + structured reasoning |
Classify BEFORE doing anything else.
PHASE 1: ASK (NO LIMIT)
BEFORE exploring code, use AskUserQuestion for:
| Category | Typical Questions |
| Requirements | What exactly should it do? What should it NOT do? |
| Scope | What is IN scope? What is OUT? |
| Assumptions | Verify EACH assumption before proceeding |
| Preferences | Technologies, patterns, conventions? |
| Constraints | Time, resources, dependencies? |
CRITICAL_RULES:
- If in doubt → ASK
- No limit on questions
- "I assume that..." → STOP → Ask first
- One question is worth more than 10 wrong assumptionsPHASE 2: EXPLORE (JUST-IN-TIME)
DO NOT pre-load all context. Load dynamically:
Globto find relevant filesGrepto search for specific patternsReadONLY the critical identified files- Document:
path:line - what it does
DOCUMENT:
files_explored: [path:line - description]
patterns_found: [path:line - pattern to follow]
reusable_code: [path:line - existing reusable code]Principle: Explore the minimum necessary to plan with confidence.
PHASE 2.5: DELIBERATE THINKING (For COMPLEX Tasks)
When a --seq flag is used OR the task is COMPLEX, work through this framework (see the
deliberate-thinking skill for the structured-reasoning protocol):
Understanding Phase
□ What EXACT problem am I solving?
□ What is current vs desired behavior?
□ Do I have all necessary information?
□ Should I ask the user before continuing?Exploration Phase
□ Does similar code exist that I can REUSE? (search first)
□ What patterns does the codebase use for similar cases?
□ What files/modules will be affected?
□ Are there hidden dependencies I must consider?Design Phase
□ What are the implementation alternatives? (minimum 2)
□ What trade-offs does each alternative have?
□ Which is most aligned with the existing architecture?
□ Does it introduce technical debt? Is it acceptable?Pre-Implementation Validation
□ Does it break tenant / data isolation?
□ Does it negatively affect performance?
□ Are there security risks?
□ Would the user understand and approve my decision?Implementation Plan
□ Specific order of changes (which file first)
□ Intermediate verification points
□ How to verify it works (tests, manual, logs)
□ Rollback plan if something failsPHASE 2.6: RISK TIER & INVARIANTS
Run whenever the plan touches code. Skip only for pure-docs plans.
Step A — Tier check
If the host project defines <project>/.claude/REVIEW_TIERS.md, use its tier assignments.
Otherwise apply this neutral heuristic:
- CRITICAL — touches security/auth, data-loss/destructive operations, money/billing, boot/config, or a public API/contract.
- NORMAL — standard business logic.
- LOW — docs, tests, cosmetic.
Match each file on the change list against the tiers:
| File | Tier | Friction |
<path> | CRITICAL/NORMAL/LOW | [CRITICAL CONFIRM] if CRITICAL |
Step B — [CRITICAL CONFIRM] gate
If ANY file is CRITICAL, stop and show the user:
ATTENTION — this plan touches CRITICAL files:
- <path>
CRITICAL = security breach / data loss / broken boot / money path.
To proceed, reply literally:
[CRITICAL CONFIRM]
To rescope:
[RESCOPE]Do not advance until you receive the literal [CRITICAL CONFIRM] from the user.
Step C — Load the subsystem's real invariants
If the project documents invariants for a touched subsystem (a playbook, an ADR, a design
doc, a README), load it into context BEFORE planning — discover it via Grep/Glob if you
don't already know it exists. Without the subsystem's real invariants in context, the plan
will invent them. Mandatory for CRITICAL/NORMAL work in an unfamiliar subsystem.
Step D — Numbers with a pedigree
If the plan introduces or changes any constant (timeouts, TTLs, limits, sizes, retries, thresholds, pool sizes), a table is mandatory:
| Number | Current | Proposed | Citable source |
<name> | 300s | 600s | measured p99 = 250s + rule "timeout ≥ 2×p99" (official docs / own benchmark / ADR / incident) |
A number with no source (official docs, own benchmark, ADR, incident) is an automatic reject — it is a silent bug waiting to explode.
Step E — Untouchable invariants
List explicitly what the change MUST NOT break. This list becomes the lens for the
post-implementation /swe-skills:senior-review. Frame by universal category and keep only
the ones the plan actually touches:
- Auth / authorization: fail-closed on the deny path; no privilege escalation; identity and permissions derived from a verified source, never from client-supplied data.
- Tenant / data isolation: every query and mutation scoped to the correct tenant; no cross-tenant leakage.
- Concurrency / ordering: idempotency where retried; correct locking/serialization; no lost updates or reordering.
- Config / secrets: config read through the project's config layer (not ad-hoc reads); secrets never logged or exposed.
- Data layer: correct serialization/types at the boundary; migrations idempotent with a real down path.
PHASE 3: PLAN AS JSON
Generate a structured plan. Each step MUST have:
| Field | Requirement |
location | Exact path with approximate line |
depends_on | IDs of required previous steps |
contract | Explicit input → output |
pattern_ref | Reference to existing code to follow |
verification | Exact command + expected output |
rollback | How to undo if it fails |
Save the plan:
# Plan location
docs/PLAN.json
# NOT in conversation context — gets lost in compactionPHASE 4: PERSISTENT PROGRESS
When finishing planning:
- Save
docs/PLAN.json. - Create/update
claude-progress.txtin the project root. - Descriptive commit ONLY if the user explicitly asks (never auto-commit).
PHASE 5: EXECUTION HANDOFF
After the plan is saved and presented, OFFER execution — do not start implementing on your own.
"Plan saved to
docs/PLAN.json. How do you want to implement it?
- /swe-skills:subagent-build (recommended) — runs the plan task-by-task with a fresh subagent per task + exhaustive review (spec → quality → adversarial red-team → domain/security) + per-task verification + a final /swe-skills:senior-review. Zero margin for error.
- I implement inline in this session (/swe-skills:context-implement)
- Stop here — I'll implement later
Which?"
If the user picks (1), /swe-skills:subagent-build consumes this same docs/PLAN.json. Use
AskUserQuestion for the choice when appropriate.
FORBIDDEN ANTI-PATTERNS
| Forbidden | Why | Instead |
| "We'll improve it later" | There is no "later" | Do it right now |
| Pseudo code | Executor cannot infer | Complete code |
| Vague paths "in src/" | Executor gets lost | src/exact/path.ext:~line |
| Skip questions | Assumptions = bugs | AskUserQuestion first |
| Plan only in context | Gets lost in compaction | Save as a file |
| Pre-load everything | Wastes tokens | Just-in-time context |
INCREMENTAL WORK
ALWAYS:
1. Plan ONE feature
2. Implement that feature
3. Verify that feature
4. Commit that feature (only if the user asks)
5. Next feature
NEVER:
- Plan 10 features at once
- Implement without verifying
- Giant multi-feature commitsFINAL VERIFICATION CHECKLIST
The plan is ready ONLY if:
- Another Claude can execute it without asking
- Each step has
verificationwith an exact command - Each step has
pattern_refto existing code - Plan saved as an external file (JSON)
- All questions asked and answered
- Scope clearly defined (IN/OUT)
- At least 2 alternatives considered (COMPLEX tasks)
- Rollback plan defined
DELIVERY TEMPLATE
## PLAN: [Task Name]
| Aspect | Value |
|--------|-------|
| Size | TRIVIAL/STANDARD/COMPLEX |
| Files | N files |
| Steps | N steps |
| Risk | Low/Medium/High |
### Context Gathered
- Documentation reviewed: [list]
- Patterns found: [list with path:line]
- Reusable code: [list with path:line]
### Questions Resolved
- Q: [question] → A: [answer]
### Alternatives Considered (COMPLEX only)
1. [Alternative 1]: [Pros/Cons]
2. [Alternative 2]: [Pros/Cons]
**Selected:** [Which and why]
### Steps (see docs/PLAN.json for full detail)
1. [Step 1] - [file:line]
2. [Step 2] - [file:line]
### Final Verification
- Command: `[command]`
- Expected: [output]
### Rollback
[How to undo everything if needed]PLANNING PRINCIPLES APPLIED
| # | Principle | Application |
| 1 | Minimum high-signal tokens | Only critical information |
| 2 | Plan-then-Execute | Plan as an external file |
| 3 | JSON for lists | PLAN.json, not Markdown |
| 4 | Incremental work | 1 feature at a time |
| 5 | Persistent progress | claude-progress.txt |
| 6 | Just-in-time context | Don't pre-load everything |
| 7 | Size estimator | Classify BEFORE proceeding |
| 8 | Deep reasoning | Use deliberate thinking for COMPLEX |
Starting Phase 0: Classify the task for: $ARGUMENTS
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.

