shynlee04/hivemind-plugin/hm-l2-planning-persistence
Claude Code and agent skill by shynlee04/hivemind-plugin
- community
Checking that the SKILL.md file is still in the repository.
Persist task state across sessions with a 3-file external memory system rooted in .hivemind/state/planning/. Use when planning complex multi-step tasks, recovering after context loss, handing off between agents, or when work spans multiple sessions. Produces task_plan.md, findings.md, progress.md in session-isolated directories. NOT for simple one-step tasks, in-memory todo lists, or generic planning advice.
Install
npx vskill@latest install shynlee04/hivemind-plugin/hm-l2-planning-persistenceSKILL.md
Overview
Three-file external memory system for persisting task state across sessions and context resets. Use when planning complex multi-step work, recovering after context loss, or handing off between agents. Produces durable task plans, findings logs, and progress trackers in session-isolated directories under .hivemind/state/planning/.
This skill replaces the disabled hm-planning-with-files with session isolation, structured YAML frontmatter, explicit pipeline integration contracts (D-09), and a clean architecture that works across any skills-compatible platform.
The Iron Law
Why This Skill Exists
LLM context windows are volatile RAM. When orchestrating a multi-step task — especially one involving subagent delegation, multiple sessions, or recovery from interruptions — external memory is essential. The filesystem IS that memory.
This skill provides a 3-file system that acts as persistent brain:
- task_plan.md — Where you're going (goal + phases + decisions + errors)
- findings.md — What you've learned (research + technical discoveries)
- progress.md — What you've done (session log + errors + handoffs)
Any agent can pick up exactly where work left off by reading these 3 files from the session directory.
What Changed from hm-planning-with-files
| Old (Disabled) | New (This Skill) | |
|---|---|---|
| Files in project root | Files in .hivemind/state/planning/<session-id>/ | |
| Pure markdown | YAML frontmatter + markdown body | |
| Implicit skill dependencies | Explicit pipeline contract (see frontmatter) | |
| Hard prerequisite blocking | Soft boundary — graceful fallback | |
| No session isolation | Session-scoped directories |
Reference Map
| When You Need | Read This | |
|---|---|---|
| Exact file format specifications | references/file-formats.md | |
| State machine and transition rules | references/state-transitions.md | |
| Schema for session metadata | references/metadata-schema.json | |
| Template for new task_plan.md | templates/task_plan.md | |
| Template for new findings.md | templates/findings.md | |
| Template for new progress.md | templates/progress.md | |
| Rationale for design decisions | research/design-decisions.md |
Tiered Response — Not Everything Needs Full Ritual
Different situations need different ceremony levels:
First Action — When Skill Loads
- Determine session ID:
- Check
.hivemind/state/session-continuity.jsonfor active session - If no session: generate UUID v4 as session ID
- Set
SESSION_DIR=.hivemind/state/planning/<session-id>/
- Check for `.hivemind/` directory:
- If exists: use
.hivemind/state/planning/<session-id>/(canonical) - If absent: use
.session/<session-id>/(fallback) - Note: if using fallback, log warning in progress.md
- Check for existing planning files:
``bash ls $SESSION_DIR/task_plan.md $SESSION_DIR/findings.md $SESSION_DIR/progress.md 2>/dev/null ``
- If all 3 exist — Read all 3. Resume from the current phase.
- If some exist — Read what's there. Create missing files using templates from
templates/.
- If none exist — Create all 3 using templates. Fill in the Goal from user's request.
- Create the session directory if it doesn't exist:
``bash mkdir -p $SESSION_DIR ``
Gate: Do not proceed with execution until task_plan.md has a Goal and at least one phase defined.
The Core Discipline: Read Before Write
Before making any non-trivial change, read task_plan.md (at minimum the Goal and Current Phase sections).
Context compaction, subagent returns, and user interruptions all cause drift. The plan file is the anchor.
Re-read the plan when:
- After a subagent returns with results
- After switching to a new phase
- After the user changes requirements
- When uncertain about what to do next
- After context compaction or session interruption
Delegation Protocol — Subagent Handoffs
The planning files ARE the handoff mechanism:
- Before dispatch: Ensure task_plan.md reflects what the subagent will do.
- After return: Subagent findings go into findings.md. Completed work logged in progress.md.
- If subagent fails: Log the error in task_plan.md Errors table. Do NOT re-dispatch with the same approach.
Subagent Envelope Pattern
Tell the subagent exactly which files to read and write:
Envelope Configuration Table
| Agent Type | Can Read | Can Write | Cannot Touch | |
|---|---|---|---|---|
| Coordinator | All 3 files | task_plan.md, progress.md | (owns everything) | |
| Researcher | task_plan.md (goal+phase), findings.md (all) | findings.md (append) | task_plan.md (modify) | |
| Builder | task_plan.md (goal+phase) | progress.md (append) | task_plan.md, findings.md | |
| Critic | All 3 files | findings.md (append findings) | task_plan.md, progress.md |
Session Recovery
After /clear, interruption, or new session:
- Read all 3 files from the session directory
- Cross-reference with reality —
git diff --statto see what actually changed - Reconcile — Update planning files to match current state
- Update timestamps — Set
last_updatedin frontmatter to current time - Resume — Continue from the current phase
Recovery Decision Tree
Error Discipline
When something fails:
- Log it — Add to task_plan.md Errors Encountered table with timestamp
- Try once more — Sometimes transient (network, rate limit, race condition)
- If it fails again, CHANGE APPROACH — Different tool, library, method, or strategy
- If a third approach fails, ESCALATE — Present what was tried and what's blocking
Do NOT silently retry the same failing action. The error table is accountability.
Fallback Behavior — When .hivemind/ is Unavailable
This skill is designed for Hivemind projects but works everywhere:
| Condition | Behavior | |
|---|---|---|
.hivemind/ exists | Use .hivemind/state/planning/<session-id>/ (canonical) | |
.hivemind/ absent | Use .session/<session-id>/ (fallback) | |
| No session ID found | Generate UUID v4 | |
| Fallback used | Log warning in progress.md: "NOTE: .hivemind/ not found. Using .session/ fallback." |
The fallback ensures this skill is useful in any skills-compatible environment, not just Hivemind-initialized projects.
Anti-Patterns
| Anti-Pattern | Detection | Correction | |
|---|---|---|---|
| The Todo Relier | Uses in-memory todo lists as sole memory | Mirror tasks into task_plan.md phases | |
| The Goal Forgetter | States goals once, never re-reads | Re-read task_plan.md at phase boundaries | |
| The Error Hider | Doesn't log failures | Log every error in the Errors table | |
| The Plan Bloater | Writes web content or large code blocks to task_plan.md | findings.md is for research data. Keep plan lean. | |
| The Plan Skipper | Starts execution without a plan | Create the plan first, even if minimal | |
| The Skill Writer | Creates files in skill directories | Skills are read-only. Write to session directory. | |
| The Session Sprawler | Creates files flat in project root | Use session directory. Never write task_plan.md to project root. | |
| The Path Hardcoder | Uses absolute paths or hardcoded session IDs | Use $SESSION_DIR. Read session ID from state. | |
| The Concurrency Ignorer | Multiple agents writing to same file without envelope | Use Subagent Envelope Pattern. Declare boundaries. |
Cross-References
Pipeline Integration
| Related Skill | Boundary | |
|---|---|---|
hm-user-intent-interactive-loop | hm-user-intent-interactive-loop clarifies requirements. This skill persists those requirements into findings.md. | |
hm-spec-driven-authoring | hm-spec-driven-authoring locks falsifiable requirements. This skill stores them as decisions in task_plan.md. | |
hm-coordinating-loop | hm-coordinating-loop dispatches subagents. This skill provides the handoff mechanism (see Delegation Protocol). | |
hm-phase-execution | hm-phase-execution executes phase plans. This skill tracks execution progress in progress.md. | |
hm-phase-loop | hm-phase-loop iterates on phases. This skill provides the context schema for loop iterations. | |
hm-test-driven-execution | hm-test-driven-execution runs RED/GREEN/REFACTOR cycles. This skill tracks test status in progress.md. | |
hm-completion-looping | hm-completion-looping guards against premature completion. This skill tracks completion state in task_plan.md. | |
hm-subagent-delegation-patterns | hm-subagent-delegation-patterns defines dispatch protocols. This skill provides the file-based handoff surface. | |
hm-debug | hm-debug tracks debug session state. This skill stores debug findings and state transitions. | |
hm-refactor | hm-refactor adds refactor steps. This skill stores refactor plans in task_plan.md. | |
hm-research-chain | hm-research-chain produces research artifacts. This skill stores findings in findings.md. | |
hf-meta-builder | hf-meta-builder routes skill creation requests. This skill stores creation plans and audit results. | |
hf-delegation-gates | hf-delegation-gates enforces authorization gates. This skill reads gate state from task_plan.md. |
NOT Coupled
| Skill | Why Separated | |
|---|---|---|
hm-planning-with-files | This skill replaces it. The disabled skill is archived at .opencode/retired/. | |
hm-brainstorm | SE-3 skill. Will consume hm-planning-persistence for brainstorm artifact storage. | |
hm-plan-generator | [future deliverable — SE-10+] Plan generation skill. Will write generated plans through this persistence layer. | |
gsd-code-review | Code review handled by GSD agent (gsd-code-review), not an hm-* skill. Review findings written to findings.md. | |
hm-gate-orchestrator | SE-5 skill. Gate validation reads task status from task_plan.md for gate evidence. |
Kit Bundle Contents
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 96 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 repositoryCheckingassets/.hivemind/skills/hm-l2-planning-persistence/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 17
- Repository npm downloads, 7 days
- 48
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 17 Jun 2026, 4 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/shynlee04/hivemind-plugin/hm-l2-planning-persistence)