Hierarchical persistent planning for complex multi-phase tasks. Use when the user asks to plan, break down, or execute a task involving multiple steps, deliverables, or coordinated work streams. Creates a .plan/ directory with overview.md (global summary) and per-phase directories (specs, checklists). Integrates with OpenClaw's memory system for cross-session continuity. Trigger phrases: plan, break down task, create plan, phased plan, multi-step task, start planning.
Use the file system as persistent working memory for complex multi-phase tasks. This skill solves two problems that arise in long task executions:
Context window = RAM (volatile, limited)
File system = Disk (persistent, unlimited)
Memory system = Long-term recall (cross-session, searchable)
→ Task structure and specs go to .plan/ (file system)
→ Key milestones and decisions go to memory (MEMORY.md / daily notes)
→ The overview stays concise for quick re-reading
→ All three layers work together to prevent drift and loss
All plan files are stored in the directory under the current workspace:
.plan/.plan/
├── overview.md ← Global summary (≤25 lines, re-read frequently)
├── decisions.md ← Decision log
├── errors.md ← Error log
└── phases/
├── phase1_xxx/
│ ├── spec.md ← Detailed spec for this phase
│ └── checklist.md ← Item-by-item completion status
├── phase2_xxx/
│ └── ...
└── ...
Use the templates in templates/ as starting points for each file. Always use relative paths (.plan/...) when reading and writing plan files.
hplan uses the file system for structured task data (.plan/ directory) and OpenClaw's memory system for cross-session awareness. They serve different purposes:
| Layer | What it stores | Why |
|---|---|---|
.plan/ files | Full specs, checklists, detailed plans | Structured, complete, not subject to compaction |
| MEMORY.md | Task goal, current phase, key decisions | Survives session restarts, loaded automatically |
| Daily notes | Progress snapshots, phase completions | Searchable history, compaction-safe via memory |
"Active hplan: [goal], phases: [list], plan at .plan/")"hplan progress: completed phase2_xxx, now on phase3_xxx, 2/4 phases done")decisions.md, also save a one-line summary to memory"hplan paused: phase2_xxx in_progress (3/5), next step: [description]")memory_search("hplan") to quickly find if there's an active plan and what state it was inSince this environment does not have automatic hook injection, you must follow these behaviors manually to maintain plan awareness:
This is the first thing to do in every conversation, before any file writes.
Check if .plan/overview.md already exists:
.plan/ directory and proceed normally.Never overwrite or modify an existing .plan/ without checking its status first.
Before every significant action (producing deliverables, making decisions, starting a new step), re-read .plan/overview.md to stay aligned with the goal and current phase. This is the most important behavior — it prevents goal drift.
When starting work on any phase, always read the full spec.md and checklist.md for that phase first. Do not skip this step.
After completing a subtask, immediately update:
checklist.md ([ ] → [x])overview.md (e.g., in_progress (3/6))When a user says "continue" or references an existing plan:
memory_search("hplan") to find the latest plan state.plan/overview.md exists and read itspec.md and checklist.mdWhen the conversation is ending with incomplete phases:
Before ending your response on a planning task, verify whether all phases in overview.md are marked [x]. If incomplete phases remain, continue working or inform the user about remaining tasks. The user can exit the plan at any time by deleting the .plan/ directory.
After receiving a complex task:
.plan/ status as described in Mandatory Behavior #1.plan/ directory structureoverview.md using the template (≤25 lines)spec.md (≤60 lines each) and checklist.mddecisions.md and errors.mdPresent the plan to the user and wait for explicit confirmation before executing.
What to show:
overview.md content (goal and phase breakdown)spec.md (key deliverables and scope)What to ask:
Iterating on the plan:
overview.md and phase directories in sync during any modifications: adding a phase means both an overview entry AND a new directory; removing a phase means both are deletedOnly proceed to execution after the user explicitly confirms.
spec.md and checklist.md in fullchecklist.md after each completed itemoverview.md and move to the next phaseWhen moving to the next phase:
[x] ... → complete in overview.mdcurrent_phase to the next phase IDspec.md and checklist.md before starting work1st failure: Diagnose and fix → record in errors.md
2nd failure: Try a different approach → record in errors.md
3rd failure: Re-examine assumptions → update spec.md
Still failing: Explain the situation to user, request guidance
When a new conversation starts, check if .plan/overview.md exists:
.plan/ directory automatically, then proceed with the new task.When all phases are marked [x]:
"hplan completed: [goal], all N phases done"# [Project Name]
current_phase: phase2_xxx
## Goal
[One sentence describing the final objective]
## Phases
- [x] phase1_xxx: [Phase description] → complete
- [ ] phase2_xxx: [Phase description] → in_progress (2/4)
- [ ] phase3_xxx: [Phase description] → pending
## Blockers
None
## Last Decision
[One-sentence summary]
## Last Error
None
Never put detailed task descriptions, lengthy requirements, or step-by-step procedures in overview.md. Those belong in the phase directories.
overview.md ≤ 25 lines (re-read it frequently to prevent goal drift)spec.md ≤ 60 lines per phase (split into multiple phases if longer)decisions.md, errors in errors.md