planning-mode
Skill2 starsChanged 7 months agoMITView on GitHub
Toggle persistent planning mode on/off. When on, hook support can remind the agent to keep planning documents updated throughout the conversation, with manual fallback if unavailable. Combines the full planning workflow with persistent mode for long-running planning and implementation sessions. Use with a topic to start, with "continue" to resume an existing plan, or with "off" to stop.
In this repository23 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- .copilot/copilot-instructions.mdCopilot instructions
- ahaSkill
- explain-prSkill
- fetch-planSkill
- generate-pr-descriptionSkill
- grill-meSkill
- improve-a-planSkill
- improve-codebaseSkill
- persistSkill
- planningSkill
- research-modeSkill
- review-prSkill
- rust-bevy-standardsSkill
- rust-bevy-test-conventionsSkill
- rust-standardsSkill
- tddSkill
- unslopSkill
- update-agentsSkill
- update-planSkill
- update-skillsSkill
- write-a-skillSkill
- wtfSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
38 rules. About 0 are common, 17 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
If you cannot determine which tool you are, ask the user.
- Very specific: line 36
No output: use local-ai-folder-markdown, the default for this skill group
- Very specific: line 39
Read ../planning/persistence/{implementation}.md and follow it whenever this skill creates, lists or opens a plan, or reads, writes or …
- Distinctive: line 43
Use persistent planning documents as your working memory.
- Very specific: line 51
Before creating the planning documents, you must read the starting templates in ./templates/
- Distinctive: line 67
If the skill was invoked with the argument "off", skip this step and go directly to Step 2.
- Very specific: line 71
If running in Claude Code, run bash {skill-dir}/scripts/check-hooks.sh and parse the structured output.
- Very specific: line 72
If running in Copilot, run bash {skill-dir}/scripts/check-hooks.sh copilot and parse the structured output.
- Distinctive: line 98
When the user provides a topic, continue to Step 3b.
- Distinctive: line 103
Create the plan, where:
- Very specific: line 106
If the flag file doesn't exist yet, create {repo root}/.ai/.active-mode with:
- Very specific: line 112
If it already exists (from Step 3a), update the location: line.
- Very specific: line 118
If there are none, stop and tell the user: "No existing plans found.
- Distinctive: line 127
If the input is a number, resolve it against the numbered list.
- Distinctive: line 128
If the input is text, try exact plan-name match first.
- Distinctive: line 129
If no exact match, allow a single unambiguous case-insensitive partial match.
- Distinctive: line 130
If the input is invalid, ambiguous, or out of range, stop and tell the user the selection was invalid.
- Very specific: line 137
If the plan document is missing, tell the user the plan is incomplete and continue with whatever does exist.
- Very specific: line 147
If running in GitHub Copilot, recommend: "You can run /rename {task name} to rename this conversation." where {task name} is the plan's …
- Very specific: line 148
If running in Claude Code or Pi, recommend: "You can run /name {task name} to name this conversation." where {task name} is the plan's …
- Very specific: line 155
Create the findings document in the plan following the template: templates/findings.md
- Very specific: line 157
Document findings in the findings document as you go.
- Very specific: line 167
Document your determination and reasoning at the top of the findings document under a ## Plan Size heading.
- Very specific: line 180
If running in GitHub Copilot, recommend: "You can run /rename {task name} to rename this conversation."
- Very specific: line 181
If running in Claude Code or Pi, recommend: "You can run /name {task name} to name this conversation."
- Distinctive: line 190
If you've learned something new since the last update, update the relevant planning document(s)
- Distinctive: line 191
If you haven't learned anything new, carry on — don't update for the sake of it
- Distinctive: line 192
Keep documents well-structured and up-to-date with the templates
- Distinctive: line 193
ALWAYS tell the user if you have updated any planning docs or that you decided no updates to any planning documents were required
- Very specific: line 197
When /planning-mode off is invoked:
- Distinctive: line 210
Every plan — single-phase or multi-phase — must conclude with all planning documents up-to-date
- Distinctive: line 213
When updating planning documents, do so in line with their templates
- Very specific: line 230
Before major decisions, read the plan document.
- Distinctive: line 234
After completing any phase:
- Very specific: line 236
Update ## Status in the plan document
- Very specific: line 243
Every error goes in the plan document (the single home for errors across all planning documents).
- Distinctive: line 350
If that extension is installed, planning mode gets equivalent reminder and stale-flag cleanup behaviour automatically.
- Very specific: line 370
If you need to persist planning mode across sessions, re-enable it with /planning-mode at the start of the new session.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Usage
/planning-mode— Enable planning mode, then prompt for a topic/planning-mode <topic>— Enable planning mode and start planning/planning-mode continue— List existing plans and resume one/planning-mode off— Disable planning mode
Configuration
Planning mode works best with automated reminders, but it can still run with manual planning-doc updates when hook support is unavailable.
| Tool | Hook config location / equivalent | Script format argument |
| Claude Code | ~/.claude/settings.json | (none — default) |
| Copilot | ~/.copilot/hooks.json | copilot |
| Pi | Bundled active-mode extension in .pi/agent/extensions/active-mode/ | (extension-driven) |
Claude Code and Copilot support the bundled PostToolUse and SessionStart hook scripts directly. Pi does not use the same standalone hook configuration files in this repository's starter config. Instead, this starter config now ships a Pi-native active-mode extension that reads .ai/.active-mode, clears stale flags on fresh session start, injects reminder context before LLM calls, and shows mode status in the UI. If that extension is not installed, fall back to manual planning-doc updates.
If you cannot determine which tool you are, ask the user.
Persistence
This skill belongs to the plans skill group. A persistence implementation decides where and how plans are stored. Before creating, listing or opening a plan, find the setting:
R="$(git rev-parse --show-toplevel 2>/dev/null)/.ai/config.properties"; { cat "$R" ~/.ai/config.properties | grep '^persistence\.plans[[:space:]]*=[[:space:]]*[^[:space:]]'; cat "$R" ~/.ai/config.properties | grep '^persistence[[:space:]]*=[[:space:]]*[^[:space:]]'; } 2>/dev/null | head -1 | tr -d ' \t\r'- No output: use
local-ai-folder-markdown, the default for this skill group persistence.plans={value}orpersistence={value}: use{value}. If../planning/persistence/{value}.mddoes not exist, tell the user theplansskill group has no{value}implementation and uselocal-ai-folder-markdown
Read ../planning/persistence/{implementation}.md and follow it whenever this skill creates, lists or opens a plan, or reads, writes or updates a planning document. The .ai/.active-mode flag file is not part of this and always stays in the repository.
Planning documents
Use persistent planning documents as your working memory. Context windows are volatile and limited; anything important gets persisted.
- For any plan, you must create the following documents in the plan:
- plan — Track work breakdown and progress
- questions — Track your questions and the user's responses and vice versa
- findings — Store research and discoveries
- For multi-phase plans, you must also create:
- progress — Session log and test results
- Before creating the planning documents, you must read the starting templates in
./templates/ - You must use the starting templates when creating or updating planning documents to guide their structure and content. Write the content in Markdown; the persistence implementation decides how it is stored
| Document | Template | Purpose | When to Update | Scope |
plan | plan.md | Work breakdown, decisions | After each phase | All plans |
findings | findings.md | Research, discoveries | Per 2-action rule | All plans |
questions | questions.md | Log of questions and user responses | Throughout planning | All plans |
progress | progress.md | Session log, test results | Throughout session | Multi-phase only |
Workflow
You must follow these steps in order:
Step 1: Check hook configuration
If the skill was invoked with the argument "off", skip this step and go directly to Step 2.
Otherwise:
- If running in Claude Code, run
bash {skill-dir}/scripts/check-hooks.shand parse the structured output. - If running in Copilot, run
bash {skill-dir}/scripts/check-hooks.sh copilotand parse the structured output. - If running in Pi, skip the standalone hook check. Explain that this repository's Pi starter config uses the bundled
active-modeextension instead of standalone hook files. If that extension is installed, planning mode gets equivalent reminder/cleanup behaviour automatically. Otherwise planning mode will rely on manual update discipline only. Then continue to Step 2.
For Claude Code and Copilot:
- If
STATUS: YES: continue to Step 2. - If
STATUS: NOorSTATUS: PARTIAL: offer to install the missing hooks now (see Hook Setup below) before proceeding. If the user declines, note that planning mode will rely on manual update discipline only — no PostToolUse reminders and no SessionStart cleanup — then continue.
Step 2: Determine action
Parse the arguments:
- No arguments → go to Step 3a
- "off" → go to Step 9
- "continue" → go to Step 3c
- Any other text → treat as the planning topic, go to Step 3b
Step 3a: Enable without topic
- Create
{repo root}/.ai/.active-modewith:mode: planning location: (pending) started: {yyyy-mm-dd HH:mm} - Tell the user: "Planning mode is on. What would you like to plan?"
- When the user provides a topic, continue to Step 3b.
Step 3b: Enable with topic
- Derive
{task-name}— an extremely succinct name for the task, use kebab-case e.g.refactor-mfa-flow. - Create the plan, where:
{yyyy-mm-dd}is the date of the plan creation{task-name}is the name derived in the previous step
- If the flag file doesn't exist yet, create
{repo root}/.ai/.active-modewith:
If it already exists (from Step 3a), update themode: planning location: {plan location} started: {yyyy-mm-dd HH:mm}location:line. - Continue to Step 4.
Step 3c: Continue an existing plan
- List plans.
- If there are none, stop and tell the user: "No existing plans found. Use
/planning-mode <topic>to start a new one."
- If there are none, stop and tell the user: "No existing plans found. Use
- Sort newest first.
- Show the plan names exactly as stored in a numbered list. Example:
1. 2026-04-10 refactor-auth-flow 2. 2026-04-08 add-retry-metrics - Prompt the user to reply with either the list number or the plan name.
- Resolve the selection:
- If the input is a number, resolve it against the numbered list.
- If the input is text, try exact plan-name match first.
- If no exact match, allow a single unambiguous case-insensitive partial match.
- If the input is invalid, ambiguous, or out of range, stop and tell the user the selection was invalid. Do not re-prompt.
Open the selected plan and read its planning documents so their contents are in context. Read in this order, only what exists:
planprogress(multi-phase plans only)findingsquestions
If the
plandocument is missing, tell the user the plan is incomplete and continue with whatever does exist.- Create
{repo root}/.ai/.active-modewith:mode: planning location: {location of the selected plan} started: {yyyy-mm-dd HH:mm} - Briefly summarise the plan's current state to the user — current phase, status, any open questions or blockers — based only on the loaded docs.
- Confirm: "Planning mode is on. Continuing
{plan location}. Use/planning-mode offwhen done. Planning mode will be auto-disabled by starting a new session when supported by your harness configuration." - Recommend renaming the conversation:
- If running in GitHub Copilot, recommend: "You can run
/rename {task name}to rename this conversation." where{task name}is the plan's{task-name}. - If running in Claude Code or Pi, recommend: "You can run
/name {task name}to name this conversation." where{task name}is the plan's{task-name}. - Otherwise, recommend: "Consider renaming this conversation to
{task name}if your tool supports it."
- If running in GitHub Copilot, recommend: "You can run
- Skip Steps 4–7 (the plan already exists). Continue with Step 8 (keep planning documents updated).
Step 4: Research & discover
- Gather requirements from the user's request.
- Create the
findingsdocument in the plan following the template: templates/findings.md - Explore the codebase to understand the scope of the change.
- Document findings in the
findingsdocument as you go.
Step 5: Determine plan size
Based on your research, explicitly determine whether this is a multi-phase plan. A plan is multi-phase if it meets ANY of the following:
- More than 5 files will likely be modified
- More than 5 tool uses are expected
- More than 150 lines of code will change
Document your determination and reasoning at the top of the findings document under a ## Plan Size heading.
Step 6: Create remaining planning documents
Create the remaining planning documents from the templates based on the determination in step 5 (see Planning documents). Populate the plan document with the plan and the questions document with any unresolved questions. Keep the questions document scaffolded even if you have no questions yet, as they may come up later. For multi-phase plans, also create the progress document as a stub — it will be populated during execution.
You must use the starting templates (see Planning documents) when creating or updating planning documents to guide their structure and content.
Step 7: Respond
- Return a summarised version of the plan to the user. Highlight if there are unresolved questions or if the plan is ready for implementation.
- Confirm to the user: "Planning mode is on. I'll keep updating the planning docs in {plan location} as we go. Use
/planning-mode offwhen done. Planning mode will be auto-disabled by starting a new session when supported by your harness configuration." - Recommend to the user that they rename this conversation:
- If running in GitHub Copilot, recommend: "You can run
/rename {task name}to rename this conversation." - If running in Claude Code or Pi, recommend: "You can run
/name {task name}to name this conversation." - Otherwise, recommend: "Consider renaming this conversation to
{task name}if your tool supports it."
- If running in GitHub Copilot, recommend: "You can run
Step 8: Keep planning documents updated
This step repeats until the planning mode is off.
While planning mode is active, if your harness has PostToolUse hook support configured, the hook outputs reminders after each tool use. When you see these reminders:
- If you've learned something new since the last update, update the relevant planning document(s)
- If you haven't learned anything new, carry on — don't update for the sake of it
- Keep documents well-structured and up-to-date with the templates
- ALWAYS tell the user if you have updated any planning docs or that you decided no updates to any planning documents were required
Step 9: Disable
When /planning-mode off is invoked:
- Delete
{repo root}/.ai/.active-mode - Confirm: "Planning mode is off."
Step 10: Session startup cleanup
For harnesses with SessionStart hook support configured, stale flag files from previous sessions are cleared automatically. In Pi, the bundled active-mode extension clears stale flags on fresh session start when installed. Without that extension, delete a stale .ai/.active-mode file before re-enabling planning mode if one is left behind.
Critical rules
1. Keep docs up-to-date
- Every plan — single-phase or multi-phase — must conclude with all planning documents up-to-date
- For multi-phase plans, this applies at the end of every phase, not just the final one
- The plan must have explicit actions to this effect that specifically refer to this
planningskill (in each phase, for multi-phase plans) - When updating planning documents, do so in line with their templates
2. Reference relevant skills
- During planning, you must check the skills available to you that apply to the work in that phase (e.g.
rust-bevy-standards,java-conventions,tdd) - Each phase must have a task to read the relevant skills, followed by a list of those skills
- Any development work must follow test-driven development practices i.e. you have to use your
tddskill for any code you write and task descriptions featuring development work must make this clear - Do not edit any file in a phase until you have read every skill listed for that phase
3. The 2-action rule
"After every 2 view/browser/search operations, IMMEDIATELY save key findings to the
findingsdocument."
This prevents visual/multimodal information from being lost.
4. Read before decide
Before major decisions, read the plan document. This keeps goals in your attention window.
5. Update after act
After completing any phase:
- Update
## Statusin theplandocument - Mark phase status:
In progress→Complete - Log any errors encountered
- Note files created/modified
6. Log ALL errors
Every error goes in the plan document (the single home for errors across all planning documents). This builds knowledge and prevents repetition.
7. Never repeat failures
if action_failed:
next_action != same_actionTrack what you tried. Mutate the approach.
The 3-strike error protocol
ATTEMPT 1: Diagnose & Fix
→ Read error carefully
→ Identify root cause
→ Apply targeted fix
ATTEMPT 2: Alternative Approach
→ Same error? Try different method
→ Different tool? Different library?
→ NEVER repeat exact same failing action
ATTEMPT 3: Broader Rethink
→ Question assumptions
→ Search for solutions
→ Consider updating the plan
AFTER 3 FAILURES: Escalate to User
→ Explain what you tried
→ Share the specific error
→ Ask for guidanceHook Setup
Planning mode relies on two hooks to function fully. Without the PostToolUse hook, only the manual update discipline (Step 8) applies.
Step 1 runs scripts/check-hooks.sh to verify configuration automatically for Claude Code and Copilot. If that reports STATUS: NO or STATUS: PARTIAL, offer to add the missing hooks using the appropriate format below.
Claude Code
Merge into ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/skills/planning-mode/scripts/planning-mode-hook.sh"
}
]
}
],
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/skills/planning-mode/scripts/clear-mode.sh"
}
]
}
]
}
}Copilot
Merge into ~/.copilot/hooks.json:
{
"hooks": {
"postToolUse": [
{
"type": "command",
"bash": "~/.copilot/skills/planning-mode/scripts/planning-mode-hook.sh copilot"
}
],
"sessionStart": [
{
"type": "command",
"bash": "~/.copilot/skills/planning-mode/scripts/clear-mode.sh copilot"
}
]
}
}Note: The
copilotargument tells the scripts to output JSON withadditionalContextfor Copilot's context injection format.
Pi
This repository's Pi starter config includes the active-mode extension under .pi/agent/extensions/active-mode/. That extension uses Pi lifecycle events:
- fresh-session cleanup via
session_start - per-turn / post-tool-style reminders via
before_agent_startandcontext - visible mode state via
ctx.ui.setStatus()
If that extension is installed, planning mode gets equivalent reminder and stale-flag cleanup behaviour automatically. If it is not installed, use manual document updates.
Bundled scripts
- scripts/planning-mode-hook.sh — PostToolUse reminder
- scripts/clear-mode.sh — SessionStart cleanup
- scripts/check-hooks.sh — verifies the two hooks above are configured in the relevant settings file
Templates
- templates/plan.md — Work breakdown and progress template
- templates/findings.md — Research storage template
- templates/progress.md — Session logging template
- templates/questions.md — Questions and responses template
Notes
- Mutual exclusivity: There are other modes and they are mutually exclusive. They all share the
.ai/.active-modeflag file. If another mode is active (checkmode:field in.ai/.active-mode), disable it before enabling planning-mode. - For harnesses with SessionStart hook support configured, the flag file is automatically cleared at session startup.
- In Pi, the bundled
active-modeextension provides the equivalent behaviour without standalone hook files. - If you need to persist planning mode across sessions, re-enable it with
/planning-modeat the start of the new session. - Both hook scripts are silent when the flag file doesn't exist — no impact on normal conversations.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

