pi-heartbeat
Configure periodic health checks via HEARTBEAT.md and the /heartbeat command.
Structured planning mode for AI agents working on coding and development tasks. Produces a comprehensive plan BEFORE any code is written or changed, including task decomposition, architecture decisions, risk assessment, and approval gates. Use this skill whenever the user says
$ npx -y skills add espennilsen/pi --skill plan-mode --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/plan-modeContext preview
The summary Claude sees to decide when to auto-load this skill.
Structured planning mode for AI agents working on coding and development tasks. Produces a comprehensive plan BEFORE any code is written or changed, including task decomposition, architecture decisions, risk assessment, and approval gates. Use this skill whenever the user says
name: plan-mode description: > Structured planning mode for AI agents working on coding and development tasks. Produces a comprehensive plan BEFORE any code is written or changed, including task decomposition, architecture decisions, risk assessment, and approval gates. Use this skill whenever the user says "/plan", "plan mode", "plan first", "think before coding", "make a plan", or asks the agent to plan before executing. Also trigger when the user describes a complex multi-step development task and would clearly benefit from structured planning before implementation — especially for tasks involving new features, refactors, migrations, infrastructure changes, or multi-file edits. When in doubt, plan. A few minutes of planning prevents hours of rework.
When triggered, switch into **planning mode**: analyze the task, produce a structured plan, and wait for explicit user approval before writing any code or making changes.
The core philosophy: **think deeply, communicate clearly, execute only when aligned.**
Produce a plan with these sections. Adapt depth to task complexity — a small bug fix needs a lighter plan than a new feature.
Restate the task in your own words to confirm understanding. Call out any ambiguities or assumptions you're making. This catches misalignment early.
## Understanding [Restate the goal in 2-3 sentences] **Assumptions:** - [List anything you're assuming that wasn't explicitly stated] **Open questions:** - [List anything you need clarified before proceeding]
If there are open questions that would significantly change the approach, STOP here and ask the user before continuing with the plan. Don't build a full plan on shaky assumptions.
For non-trivial tasks, present 2-3 distinct approaches. For simple tasks, present one recommended approach with brief justification.
For each option include:
End with a clear recommendation and why.
## Approach Options ### Option A: [Name] **Summary:** [One line] **How it works:** [3-5 bullet points, high-level] **Pros:** [What's good about this] **Cons:** [Tradeoffs] **Effort:** [small / medium / large] ### Option B: [Name] ... **Recommendation:** Option [X] because [reason tied to project context].
Break the chosen (or recommended) approach into concrete, ordered steps. Each step should be small enough to verify independently. Group related steps into phases.
## Task Breakdown ### Phase 1: [Name, e.g. "Setup / Preparation"] - [ ] Step 1.1: [Concrete action] - [ ] Step 1.2: [Concrete action] **Checkpoint:** [What should be true after this phase — a testable condition] ### Phase 2: [Name, e.g. "Core Implementation"] - [ ] Step 2.1: [Concrete action] - [ ] Step 2.2: [Concrete action] **Checkpoint:** [Testable condition] ### Phase 3: [Name, e.g. "Verification & Cleanup"] - [ ] Step 3.1: [Concrete action] - [ ] Step 3.2: [Concrete action] **Checkpoint:** [Testable condition]
Guidelines for good steps:
Identify what could go wrong and how to mitigate it. Focus on risks specific to *this* task, not generic software risks.
## Risks | Risk | Likelihood | Impact | Mitigation | |------|-----------|--------|------------| | [Specific thing that could go wrong] | low/med/high | low/med/high | [How to prevent or handle it] |
Always consider:
List the files that will be created, modified, or deleted. This helps the user understand the blast radius.
## Affected Files - **Create:** `path/to/new-file.ts` — [purpose] - **Modify:** `path/to/existing-file.ts` — [what changes] - **Delete:** `path/to/old-file.ts` — [why]
Always end the plan with an explicit request for approval. Never proceed to implementation without it.
## Ready to Execute? Plan is complete. Please review and let me know: - ✅ **Approve** — proceed with implementation - 🔄 **Revise** — adjust the approach (tell me what to change) - ❓ **Clarify** — answer open questions first - ❌ **Cancel** — abort this task
After generating the plan, save it to a `plans/` directory in the project root before requesting approval.
**File naming convention:** `plans/YYYY-MM-DD-<short-slug>.md`
Examples:
The slug should be a concise, kebab-case summary of the task (3-5 words max).
**File contents:** The full plan output (all sections) as a markdown document. Add a YAML frontmatter block at the top:
--- task: "[One-line task description]"
This repository is my Pi coding agent home directory. I keep it under version control and symlink it to ~/.pi/agent so Pi loads configuration, extensions, skills, and runtime state from here.
Configure periodic health checks via HEARTBEAT.md and the /heartbeat command.
Manage persistent memory across sessions. Use when asked to remember, recall, forget, or review what was stored. Covers long-term…
Track and manage projects with git status via dashboard and tool.
Delegate tasks to specialized subagents for parallel or sequential execution.
Audit, generate, update, and lint AGENTS.md files across all projects. Use when asked to check project context files, scaffold…