nikolasmarkou/iterative-planner/src
Claude Code and agent skill by nikolasmarkou/iterative-planner
- community
Checking that the SKILL.md file is still in the repository.
State-machine driven iterative planning and execution for complex coding tasks. Cycle: Explore → Plan → Execute → Reflect → Pivot. Filesystem as persistent memory. Use for multi-file tasks, migrations, refactoring, failed tasks, or anything non-trivial.
Install
npx vskill@latest install nikolasmarkou/iterative-planner/srcSKILL.md
Iterative Planner
Core Principle: Context Window = RAM. Filesystem = Disk. Write to disk immediately. The context window will rot. The files won't.
`{plan-dir}` = plans/plan-YYYY-MM-DDTHHMMSS-XXXXXXXX/ (active plan directory under project root; UTC timestamp, colon-free, 8-hex tail). Directories created before v2.36.0 use the legacy shape plans/plan_YYYY-MM-DD_XXXXXXXX/ — never generated again, but always still read: every id-recognizing path (pointer, retire, anchor scan, ## <plan-id> sections, *Plan:* preamble, sliding-window trim, INDEX date) accepts the union of both grammars. Discovery: plans/.current_plan contains the plan directory name. One active plan at a time. Cross-plan context: plans/FINDINGS.md, plans/DECISIONS.md (merged on close), plans/LESSONS.md (rewritten on close), plans/SYSTEM.md (system atlas — domain-neutral map of the target system, rewritten on close), plans/INDEX.md (topic→directory map, survives sliding-window trim). Caps + R/W rules: File Lifecycle Matrix.
Orchestrator Role Assumption (READ FIRST)
This skill is driven by a state-machine orchestrator. The authoritative runtime dispatch logic — sub-agent spawning, the six Presentation Contracts, the PLAN compression gate, and the EXECUTE pre-step gate — lives in agents/ip-orchestrator.md, NOT in this file. This file is the protocol and state-machine specification; agents/ip-orchestrator.md is the procedure you execute.
On activation, determine your mode:
- Already the orchestrator — if you were launched as
iterative-planner-orchestrator(viaclaude --agent iterative-planner-orchestrator) OR you have already readagents/ip-orchestrator.mdand assumed that role earlier in this conversation: do NOT re-read it and do NOT spawn another orchestrator. You ARE the orchestrator — continue with the dispatch logic you already hold. This guard is evaluated FIRST and short-circuits the reload loop that would otherwise arise becauseagents/ip-orchestrator.mddeclaresskills: [iterative-planner](loading it re-loads this skill). - Agent definitions installed — if
agents/ip-orchestrator.mdis readable and you are NOT already operating as the orchestrator: immediately Readagents/ip-orchestrator.mdand assume that role for the remainder of this conversation. Resolveagents/ip-orchestrator.mdagainst the skill base directory the harness announces on activation (the "Base directory for this skill: ..." line). Treat its Sub-Agent Dispatch Rules, Presentation Contracts, compression gate, and pre-step gate as your operating procedure. Adopt the role in-thread — do NOT spawn or launch a separateiterative-planner-orchestratoragent. On first activation, FIRST emit the version + credit banner as the load-up line — runnode <skill-path>/scripts/bootstrap.mjs bannerand surface its stdout verbatim — then announce the live mode with one user-visible line — e.g.[iterative-planner] orchestrator engaged — dispatching specialized sub-agents.— so the user sees the version and credit and knows sub-agent dispatch is active. Then begin bootstrapping. - Monolithic fallback — if
agents/ip-orchestrator.md(and theagents/ip-*.mddefinitions) are NOT installed: run the full protocol yourself in this single thread, driving the state machine from this file's spec — the per-state operative rules come from theemit-staterouter (see below), NOT from inline bodies (the Per-State Rules section is summaries + pointers only) — and FIRST emit the version + credit banner as the load-up line — runnode <skill-path>/scripts/bootstrap.mjs bannerand surface its stdout verbatim — then announce the degraded mode with one user-visible line on activation — e.g.[iterative-planner] sub-agent definitions not found — running monolithic (single-thread) mode.— so the user sees the version and credit and silent degradation becomes a visible signal. UseTasksubagents where this file calls for parallel work (EXPLORE, REFLECT review). The state machine, gates, leash, and Presentation Contracts (references/file-formats.md) are identical — you are simply both coordinator and worker. In this mode you also runnode <skill-path>/scripts/emit-state.mjs --state <state>on entering each of EXPLORE/PLAN/EXECUTE/REFLECT/PIVOT and follow its output as the operative per-state rules (the Per-State Rules section here is now a summary + pointer; the scripts ship with the skill bundle, so the router resolves even without agent definitions installed).
Idempotency rule: the trigger for reading agents/ip-orchestrator.md is "not yet operating as the orchestrator." Once you have read it once in this conversation, condition 1 holds for every subsequent skill re-trigger — you never read it twice, and there is no spawn, so no reload loop.
Resolving <skill-path>
<skill-path> is the skill's installed base directory — the one the harness announces to the activating conversation ("Base directory for this skill: ..."). It is the single definition; everything below is a pointer to it.
- The orchestrator sees that announcement and holds the absolute path.
- Sub-agents do not. So the orchestrator MUST pass it down: every spawn prompt opens with a
SKILL PATH: <absolute-path>line. A sub-agent resolves<skill-path>from that line — nowhere else. - Fallback (line absent, e.g. an out-of-band dispatch): use the installed skill bundle,
~/.claude/skills/iterative-planner/. - It is NEVER a path relative to the target project's root. A shipped prompt that says
src/scripts/<x>.mjsis always wrong: a consuming project has nosrc/scripts/and the invocation silently resolves to nothing, disabling whatever check it was supposed to run. This failure is mechanically gated —scripts/check-agent-wiring.mjsrules (a) and (d).
State Machine
| State | Purpose | Allowed Actions | |
|---|---|---|---|
| EXPLORE | Gather context | Read-only on project. Write only to {plan-dir}. | |
| PLAN | Design approach | Write plan.md. NO code changes. | |
| EXECUTE | Implement step-by-step | Edit files, run commands, write code. | |
| REFLECT | Evaluate results | Read outputs, run tests, review diffs. Update verification.md, decisions.md. | |
| PIVOT | Revise direction | Log pivot in decisions.md. Do NOT write plan.md yet. | |
| CLOSE | Finalize | Audit decision anchors. Append this plan's anchored decisions to plans/ANCHORS.md. Write summary.md. Merge findings/decisions. Rewrite LESSONS.md (trim by importance-then-recency, never drop [I:5] — see ip-archivist Step 4) + SYSTEM.md atlas (demote-by-staleness — see ip-archivist Step 5). Compress consolidated files if needed. Caps: Lifecycle Matrix. |
Transitions
| From → To | Trigger | |
|---|---|---|
| EXPLORE → PLAN | Sufficient context. ≥3 indexed findings in findings.md. | |
| PLAN → EXPLORE | Can't state problem, can't list files, or insufficient findings. | |
| PLAN → PLAN | User rejects plan. Revise and re-present. | |
| PLAN → EXECUTE | User explicitly approves. | |
| EXECUTE → REFLECT | Execution phase ends (all steps done, failure, surprise, or leash hit). | |
| REFLECT → CLOSE | All criteria verified PASS in verification.md, no regressions, no simplification blockers. User confirms. | |
| REFLECT → PIVOT | Failure or better approach found. | |
| REFLECT → EXPLORE | Need more context. | |
| REFLECT → EXECUTE | Completion-fix remediation surfaced during REFLECT: small fixes to finish the SAME iteration's work (not a new approach → not PIVOT; not more context → not EXPLORE). Same iteration only — iter does not increment. Not a general re-loop. A fix that repairs plan step M is numbered as a sub-step of it, iter-N/step-M.K (K counts 1, 2, … over successive fixes to that same step), so the changelog step field always names a numbered step. The declared counter stays flat across these round trips, but the enforced iteration cap does not (see Iteration Limits, below). | |
| PIVOT → PLAN | New approach formulated. Decision logged. |
Bootstrap shortcuts:bootstrap.mjs closeallows closing from any state (EXPLORE→CLOSE, PLAN→CLOSE, EXECUTE→CLOSE, PIVOT→CLOSE). These are administrative exits — the protocol CLOSE steps (summary.md, decision audit, LESSONS.md update) should be completed by the agent before runningclose. These four edges — plus two more bootstrap-generated ones,UNKNOWN→CLOSE(fallback close from a corrupt/unreadable state.md) andCLOSE→CLOSE(idempotent re-close) — are deliberately absent from the Mermaid diagram above and from the Transitions table; the diagram and table show only the primary protocol flow.VALID_TRANSITIONSinvalidate-plan.mjsis the authoritative list of every transition the validator accepts — read it, not the diagram, for the complete transition set.
Every transition → log in state.md. PIVOT transitions → also log in decisions.md (what failed, what learned, why new direction). At CLOSE → audit decision anchors (references/decision-anchoring.md). Merge per-plan findings/decisions to plans/FINDINGS.md and plans/DECISIONS.md. Update plans/LESSONS.md with significant lessons (rewrite to ≤200 lines). Compress consolidated files if >500 lines (see "Consolidated File Management").
Protocol Tiers
Check tiers: CORE (always enforced) | EXTENDED (iter ≥ 2 unless a rule's own marker states otherwise; marked (EXTENDED) in rules below). EXTENDED checks address anchoring bias, ghost constraints, prediction drift.
Mandatory Re-reads (CRITICAL)
These files are active working memory. Re-read during the conversation, not just at start.
| When | Read | Why | |
|---|---|---|---|
| Before any EXECUTE step | state.md, plan.md, progress.md | Confirm step, manifest, fix attempts, progress sync | |
| Before writing a fix | decisions.md | Don't repeat failed approaches. Check 3-strike. | |
Before modifying DECISION-commented code | Referenced decisions.md entry | Understand why before changing | |
| Before PLAN or PIVOT | decisions.md, findings.md, findings/*, plans/LESSONS.md, plans/SYSTEM.md, plans/DECISIONS.md (PLAN only), changelog.md (PIVOT only) | Ground plan in known facts + institutional memory + system atlas | |
| Before any REFLECT | plan.md (criteria + verification strategy + assumptions), progress.md, verification.md, findings.md, checkpoints/*, decisions.md, changelog.md | Phase 1 Gate-In: full context before evaluating | |
| Every 10 tool calls | state.md | Reorient. Right step? Scope crept? |
|messages| > 50 → re-read state.md + plan.md before every response. Files are truth, not memory.
When decisions.md or changelog.md contain a <!-- COMPRESSED-SUMMARY --> block, the block is your fast-path for D-NNN lookup / changelog overview — the raw entries below the block remain authoritative.
Bootstrapping
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 85 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/SKILL.md
Popularity
- Repository stars
- 64
- Repository forks
- 5
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nikolasmarkou/iterative-planner/src)