shynlee04/hivemind-plugin/hm-l2-planning-persistence

Claude Code and agent skill by shynlee04/hivemind-plugin

Trust tier 2
  • community
LLM review pending
Source check pending

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-persistence

SKILL.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

The filesystem IS persistent memory. Before any non-trivial change, read the plan.

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 rootFiles in .hivemind/state/planning/<session-id>/
Pure markdownYAML frontmatter + markdown body
Implicit skill dependenciesExplicit pipeline contract (see frontmatter)
Hard prerequisite blockingSoft boundary — graceful fallback
No session isolationSession-scoped directories

Reference Map

When You NeedRead This
Exact file format specificationsreferences/file-formats.md
State machine and transition rulesreferences/state-transitions.md
Schema for session metadatareferences/metadata-schema.json
Template for new task_plan.mdtemplates/task_plan.md
Template for new findings.mdtemplates/findings.md
Template for new progress.mdtemplates/progress.md
Rationale for design decisionsresearch/design-decisions.md

Tiered Response — Not Everything Needs Full Ritual

Different situations need different ceremony levels:

About to do something? Ask yourself:
|
+-- Am I starting a new complex task?
| +-- YES --> INIT: Create all 3 files (see First Action)
|
+-- Did I just complete a phase or make a significant discovery?
| +-- YES --> CHECKPOINT: Update all 3 files with current state
|
+-- Did a subagent return with results?
| +-- YES --> ABSORB: Write findings.md, update task_plan.md phase status
|
+-- Did something fail or change direction?
| +-- YES --> PIVOT: Log error, update findings.md, add new phase if needed
|
+-- Just doing routine work within current phase?
+-- LIGHT: Update progress.md only. No full checkpoint needed.

First Action — When Skill Loads

  1. Determine session ID:
  • Check .hivemind/state/session-continuity.json for active session
  • If no session: generate UUID v4 as session ID
  • Set SESSION_DIR=.hivemind/state/planning/<session-id>/
  1. 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
  1. Check for existing planning files:

``bash ls $SESSION_DIR/task_plan.md $SESSION_DIR/findings.md $SESSION_DIR/progress.md 2>/dev/null ``

  1. If all 3 exist — Read all 3. Resume from the current phase.
  1. If some exist — Read what's there. Create missing files using templates from templates/.
  1. If none exist — Create all 3 using templates. Fill in the Goal from user's request.
  1. 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:

  1. Before dispatch: Ensure task_plan.md reflects what the subagent will do.
  2. After return: Subagent findings go into findings.md. Completed work logged in progress.md.
  3. 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:

Read: $SESSION_DIR/task_plan.md (Goal + Phase N), $SESSION_DIR/findings.md (## Requirements section)
Write to: $SESSION_DIR/findings.md (append ## Research Findings)
Do NOT modify: $SESSION_DIR/task_plan.md (coordinator owns this)
Envelope Configuration Table
Agent TypeCan ReadCan WriteCannot Touch
CoordinatorAll 3 filestask_plan.md, progress.md(owns everything)
Researchertask_plan.md (goal+phase), findings.md (all)findings.md (append)task_plan.md (modify)
Buildertask_plan.md (goal+phase)progress.md (append)task_plan.md, findings.md
CriticAll 3 filesfindings.md (append findings)task_plan.md, progress.md

Session Recovery

After /clear, interruption, or new session:

  1. Read all 3 files from the session directory
  2. Cross-reference with reality — git diff --stat to see what actually changed
  3. Reconcile — Update planning files to match current state
  4. Update timestamps — Set last_updated in frontmatter to current time
  5. Resume — Continue from the current phase
Recovery Decision Tree
Recovery needed?
|
+-- All 3 files exist AND last_updated < 1 hour ago?
| +-- YES --> Quick resume: read current phase, continue
|
+-- All 3 files exist AND last_updated > 1 hour ago?
| +-- Stale state. Cross-reference with git diff. Reconcile differences.
|
+-- Some files missing?
| +-- Create missing from templates. Log what was missing.
|
+-- No files exist?
+-- Fresh start. Create all 3 from templates.

Error Discipline

When something fails:

  1. Log it — Add to task_plan.md Errors Encountered table with timestamp
  2. Try once more — Sometimes transient (network, rate limit, race condition)
  3. If it fails again, CHANGE APPROACH — Different tool, library, method, or strategy
  4. 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:

ConditionBehavior
.hivemind/ existsUse .hivemind/state/planning/<session-id>/ (canonical)
.hivemind/ absentUse .session/<session-id>/ (fallback)
No session ID foundGenerate UUID v4
Fallback usedLog 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-PatternDetectionCorrection
The Todo RelierUses in-memory todo lists as sole memoryMirror tasks into task_plan.md phases
The Goal ForgetterStates goals once, never re-readsRe-read task_plan.md at phase boundaries
The Error HiderDoesn't log failuresLog every error in the Errors table
The Plan BloaterWrites web content or large code blocks to task_plan.mdfindings.md is for research data. Keep plan lean.
The Plan SkipperStarts execution without a planCreate the plan first, even if minimal
The Skill WriterCreates files in skill directoriesSkills are read-only. Write to session directory.
The Session SprawlerCreates files flat in project rootUse session directory. Never write task_plan.md to project root.
The Path HardcoderUses absolute paths or hardcoded session IDsUse $SESSION_DIR. Read session ID from state.
The Concurrency IgnorerMultiple agents writing to same file without envelopeUse Subagent Envelope Pattern. Declare boundaries.

Cross-References

Pipeline Integration
Related SkillBoundary
hm-user-intent-interactive-loophm-user-intent-interactive-loop clarifies requirements. This skill persists those requirements into findings.md.
hm-spec-driven-authoringhm-spec-driven-authoring locks falsifiable requirements. This skill stores them as decisions in task_plan.md.
hm-coordinating-loophm-coordinating-loop dispatches subagents. This skill provides the handoff mechanism (see Delegation Protocol).
hm-phase-executionhm-phase-execution executes phase plans. This skill tracks execution progress in progress.md.
hm-phase-loophm-phase-loop iterates on phases. This skill provides the context schema for loop iterations.
hm-test-driven-executionhm-test-driven-execution runs RED/GREEN/REFACTOR cycles. This skill tracks test status in progress.md.
hm-completion-loopinghm-completion-looping guards against premature completion. This skill tracks completion state in task_plan.md.
hm-subagent-delegation-patternshm-subagent-delegation-patterns defines dispatch protocols. This skill provides the file-based handoff surface.
hm-debughm-debug tracks debug session state. This skill stores debug findings and state transitions.
hm-refactorhm-refactor adds refactor steps. This skill stores refactor plans in task_plan.md.
hm-research-chainhm-research-chain produces research artifacts. This skill stores findings in findings.md.
hf-meta-builderhf-meta-builder routes skill creation requests. This skill stores creation plans and audit results.
hf-delegation-gateshf-delegation-gates enforces authorization gates. This skill reads gate state from task_plan.md.
NOT Coupled
SkillWhy Separated
hm-planning-with-filesThis skill replaces it. The disabled skill is archived at .opencode/retired/.
hm-brainstormSE-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-reviewCode review handled by GSD agent (gsd-code-review), not an hm-* skill. Review findings written to findings.md.
hm-gate-orchestratorSE-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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/shynlee04/hivemind-plugin/hm-l2-planning-persistence/badge)](https://verified-skill.com/skills/shynlee04/hivemind-plugin/hm-l2-planning-persistence)

Something wrong with this skill or its page? Tell us.