Create a detailed plan for a phase. Research, plan, and verify before building.
Creates detailed, executable development plans for project phases by delegating research and validation to specialized agents.
npx claudepluginhub sienklogic/towlineThis skill is limited to using the following tools:
decimal-phase-calc.mdtemplates/checker-prompt.md.tmpltemplates/gap-closure-prompt.md.tmpltemplates/planner-prompt.md.tmpltemplates/researcher-prompt.md.tmpltemplates/revision-prompt.md.tmplYou are the orchestrator for /dev:plan. This skill creates detailed, executable plans for a specific phase. Plans are the bridge between the roadmap and actual code — they must be specific enough for an executor agent to follow mechanically. Your job is to stay lean, delegate heavy work to Task() subagents, and keep the user's main context window clean.
Reference: skills/shared/context-budget.md for the universal orchestrator rules.
Additionally for this skill:
.planning/config.json exists (run /dev:begin first).planning/ROADMAP.md exists with at least one phase.planning/REQUIREMENTS.md existsParse $ARGUMENTS according to skills/shared/phase-argument-parsing.md.
/dev:plan <N> — Plan phase N
Parse the phase number and optional flags:
| Argument | Meaning |
|---|---|
3 | Plan phase 3 |
3 --skip-research | Plan phase 3, skip research step |
3 --assumptions | Surface assumptions before planning phase 3 |
3 --gaps | Create gap-closure plans for phase 3 (from VERIFICATION.md) |
3 --teams | Plan phase 3 using specialist agent teams |
| (no number) | Use current phase from STATE.md |
| Subcommand | Meaning |
|---|---|
add | Append a new phase to the end of the roadmap |
insert <N> | Insert a new phase at position N (uses decimal numbering) |
remove <N> | Remove phase N from the roadmap |
Before any context loading, check whether $ARGUMENTS looks like freeform text rather than a valid invocation. Valid patterns are:
3, 03) or decimal (3.1)add, insert <N>, remove <N>3 --skip-research, 3 --assumptions, 3 --gaps, 3 --teamscheck (legacy alias)If $ARGUMENTS does NOT match any of these patterns — i.e., it contains freeform words that are not a recognized subcommand or flag — then stop execution and respond:
`/dev:plan` expects a phase number or subcommand.
Usage:
/dev:plan <N> Plan phase N
/dev:plan <N> --gaps Create gap-closure plans
/dev:plan add Add a new phase
/dev:plan insert <N> Insert a phase at position N
/dev:plan remove <N> Remove phase N
Then suggest the appropriate skill based on the text content:
| If the text looks like... | Suggest |
|---|---|
| A task, idea, or feature request | /dev:todo to capture it, or /dev:explore to investigate |
| A bug or debugging request | /dev:debug to investigate the issue |
| A review or quality concern | /dev:review to assess existing work |
| Anything else | /dev:explore for open-ended work |
Do NOT proceed with planning. The user needs to use the correct skill.
Execute these steps in order for standard /dev:plan <N> invocations.
Reference: skills/shared/config-loading.md for the tooling shortcut (state load, plan-index, phase-info) and config field reference.
$ARGUMENTS for phase number and flags.planning/config.json for settings (see config-loading.md for field reference)node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js config resolve-depth to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions..planning/phases/{NN}-{slug}/.planning/STATE.md.planning/CONTEXT.md exists. If missing, warn: "Phase {N} has no CONTEXT.md. Consider running /dev:discuss {N} first to capture your preferences. Continue anyway?" If user says no, stop. If yes, continue.If phase already has plans:
skills/shared/gate-prompts.md):
question: "Phase {N} already has plans. Re-plan from scratch?"
header: "Re-plan?"
options:
Read context file PATHS and metadata. Build lean context bundles for subagent prompts — include paths and one-line descriptions, NOT full file bodies. Agents have the Read tool and will pull file contents on-demand.
1. Read .planning/ROADMAP.md — extract current phase goal, dependencies, requirements
2. Read .planning/REQUIREMENTS.md — extract requirements mapped to this phase
3. Read .planning/CONTEXT.md (if exists) — extract only the `## Decision Summary` section (everything from `## Decision Summary` to the next `##` heading). If no Decision Summary section exists (legacy CONTEXT.md), fall back to extracting the full `## Decisions (LOCKED...)` and `## Deferred Ideas` sections.
4. Read .planning/phases/{NN}-{slug}/CONTEXT.md (if exists) — extract only the `## Decision Summary` section. Fall back to full locked decisions + deferred sections if no Decision Summary exists.
5. Read .planning/config.json — extract feature flags, depth, model settings
6. List prior SUMMARY.md file paths and extract frontmatter metadata only (status, provides, key_files). Do NOT read full SUMMARY bodies — agents pull these on-demand via Read tool.
7. Read .planning/research/SUMMARY.md (if exists) — extract research findings
Digest-select depth for prior SUMMARYs (Step 6):
Reference: skills/shared/digest-select.md for the full depth rules and examples. In short: direct dependencies get frontmatter + key decisions, transitive get frontmatter only, 2+ back get skipped.
Collect all of this into a context bundle that will be passed to subagents.
--assumptions flag)IMPORTANT: This step is FREE (no subagents). It happens entirely inline.
Before spawning any agents, present your assumptions about how this phase should be approached:
Phase {N}: {Name}
Goal: {from roadmap}
My assumptions about this phase:
1. **Approach**: I'm assuming we'll {approach}
- Correct? [yes/no/adjust]
2. **Key technology**: I'm assuming we'll use {tech}
- Correct? [yes/no/adjust]
3. **Architecture**: I'm assuming {architectural assumption}
- Correct? [yes/no/adjust]
4. **Scope boundary**: I'm assuming {scope assumption}
- Correct? [yes/no/adjust]
For each assumption the user corrects:
After all assumptions are confirmed/corrected:
.planning/CONTEXT.md with any new locked decisionsSkip this step if ANY of these are true:
--skip-research flag is set--gaps flag is setfeatures.research_phase: falseTo check: run node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js config resolve-depth and read profile["features.research_phase"]. This replaces checking features.research_phase and depth separately -- the depth profile already incorporates both.
Conditional research (standard/balanced mode): When the profile has features.research_phase: true, also check whether .planning/codebase/ or .planning/research/ already contains relevant context for this phase. If substantial context exists (>3 files in codebase/ or a RESEARCH.md mentioning this phase's technologies), skip research and note: "Skipping research -- existing context found in {directory}." This implements the balanced mode's "conditional research" behavior.
If research is needed:
Display to the user: ◐ Spawning researcher...
Spawn a researcher Task():
Task({
subagent_type: "dev:towline-researcher",
prompt: <phase research prompt>
})
NOTE: The dev:towline-researcher subagent type auto-loads the agent definition. Do NOT inline it.
Read skills/plan/templates/researcher-prompt.md.tmpl and use it as the prompt template for spawning the researcher agent. Fill in the placeholders with phase-specific context:
{NN} - phase number (zero-padded){phase name} - phase name from roadmap{goal from roadmap} - phase goal statement{REQ-IDs mapped to this phase} - requirement IDs{dependencies from roadmap} - dependency list<project_context> and <prior_work> blocks per the shared partial (templates/prompt-partials/phase-project-context.md.tmpl): Decision Summary for context, manifest table for prior workWait for the researcher to complete before proceeding.
Before spawning the planner, scan .planning/seeds/ for seeds whose trigger matches the current phase:
Glob for .planning/seeds/*.md
For each seed file, read its frontmatter and check the trigger field
A seed matches if ANY of these are true:
trigger equals the phase slug (e.g., trigger: authentication) — preferredtrigger is a substring of the phase directory name (e.g., trigger: auth matches 03-authentication)trigger equals the current phase number as integer (e.g., trigger: 3) — backward compatible but NOT recommended for new seeds (breaks with decimal phases like 3.1)trigger equals * (always matches)If matching seeds are found, present them to the user:
Found {N} seeds related to Phase {NN}:
- {seed_name}: {seed description}
- {seed_name}: {seed description}
Use AskUserQuestion (pattern: yes-no-pick from skills/shared/gate-prompts.md):
question: "Include these {N} seeds in planning?"
header: "Seeds?"
options:
- label: "Yes, all" description: "Include all {N} matching seeds"
- label: "Let me pick" description: "Choose which seeds to include"
- label: "No" description: "Proceed without seeds"
If "Yes, all": include all matching seed content in the planner's context
If "Let me pick": present individual seeds for selection
If "No" or "Other": proceed without seeds
If no matching seeds found: proceed silently
Reference: references/agent-teams.md for team role definitions and coordination details.
If --teams flag is set OR config.parallelization.use_teams is true:
Create the team output directory: .planning/phases/{NN}-{slug}/team/
Display to the user: ◐ Spawning 3 planners in parallel (architect, security, test)...
Spawn THREE planner agents in parallel using Task():
Agent 1 -- Architect:
.planning/phases/{NN}-{slug}/team/architect-PLAN.md. Do NOT write final PLAN.md files -- your output will be synthesized."Agent 2 -- Security Reviewer:
.planning/phases/{NN}-{slug}/team/security-PLAN.md. Do NOT write final PLAN.md files."Agent 3 -- Test Designer:
.planning/phases/{NN}-{slug}/team/test-PLAN.md. Do NOT write final PLAN.md files."Wait for all three to complete
Display to the user: ◐ Spawning synthesizer...
Spawn the synthesizer agent:
.planning/phases/{NN}-{slug}/team/. Synthesize them into unified PLAN.md files in .planning/phases/{NN}-{slug}/. The architect output provides structure, the security output adds security-related tasks or checks, and the test output informs TDD flags and test tasks. Resolve any contradictions by preferring the architect's structure with security and test additions."Proceed to plan checking as normal
If --teams is NOT set and config.parallelization.use_teams is false or unset, proceed with the existing single-planner flow below.
Display to the user: ◐ Spawning planner...
Spawn the planner Task() with all context inlined:
Task({
subagent_type: "dev:towline-planner",
prompt: <planning prompt>
})
NOTE: The dev:towline-planner subagent type auto-loads the agent definition. Do NOT inline it.
Read skills/plan/templates/planner-prompt.md.tmpl and use it as the prompt template for spawning the planner agent. Fill in all placeholder blocks with phase-specific context:
<phase_context> - phase number, directory, goal, requirements, dependencies, success criteria<project_context> - locked decisions, user constraints, deferred ideas, phase-specific decisions<prior_work> - manifest table of preceding phase SUMMARY.md file paths with status and one-line exports (NOT full bodies)<research> - file path to RESEARCH.md if it exists (NOT inlined content)<config> - max tasks, parallelization, TDD mode from config.json<planning_instructions> - phase-specific planning rules and output pathWait for the planner to complete.
Skip this step if:
features.plan_checking: falseTo check: use the resolved depth profile from Step 1. The profile consolidates the depth setting and any user overrides into a single boolean.
If validation is enabled:
Display to the user: ◐ Spawning plan checker...
Spawn the plan checker Task():
Task({
subagent_type: "dev:towline-plan-checker",
prompt: <checker prompt>
})
NOTE: The dev:towline-plan-checker subagent type auto-loads the agent definition. Do NOT inline it.
Read skills/plan/templates/checker-prompt.md.tmpl and use it as the prompt template for spawning the plan checker agent. Fill in the placeholders:
<plans_to_check> - manifest table of PLAN.md file paths (checker reads each via Read tool)<phase_context> - phase goal and requirement IDs<context> - file paths to project-level and phase-level CONTEXT.md files (checker reads via Read tool)Process checker results:
VERIFICATION PASSED: proceed to Step 8Reference: skills/shared/revision-loop.md for the full Check-Revise-Escalate pattern.
Follow the revision loop pattern with:
skills/plan/templates/revision-prompt.md.tmpl)Skip if:
gates.confirm_plan is false in configmode is autonomous in configIf approval is needed:
Present a summary of all plans to the user:
Phase {N}: {name}
Plans: {count}
Plan {phase}-01: {plan name} (Wave {W}, {task_count} tasks)
Must-haves: {list truths}
Files: {list files_modified}
Tasks:
1. {task name}
2. {task name}
Plan {phase}-02: {plan name} (Wave {W}, {task_count} tasks)
...
Wave execution order:
Wave 1: Plan 01, Plan 02 (parallel)
Wave 2: Plan 03 (depends on 01, 02)
Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prompts.md`):
question: "Approve these {count} plans for Phase {N}?"
header: "Approve?"
options:
- label: "Approve" description: "Proceed to build phase"
- label: "Request changes" description: "Discuss adjustments before proceeding"
- label: "Abort" description: "Cancel planning for this phase"
If user selects 'Request changes' or 'Other':
If user selects 'Approve':
CONTEXT.md compliance reporting: If .planning/CONTEXT.md exists, compare all locked decisions against the generated plans. Print: "CONTEXT.md compliance: {M}/{N} locked decisions mapped to tasks" where M = locked decisions that are reflected in at least one task, N = total locked decisions. If any locked decisions are unmapped, list them as warnings.
Dependency fingerprinting: For each dependency phase (phases that this phase depends on, per ROADMAP.md):
dependency_fingerprints field to each plan's YAML frontmatter:
dependency_fingerprints:
"01-01": "len:4856-mod:2025-02-08T09:40"
"01-02": "len:4375-mod:2025-02-08T09:43"
Update ROADMAP.md Progress table (REQUIRED — do this BEFORE updating STATE.md):
Tooling shortcut: Use the CLI for atomic updates:
node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js roadmap update-plans {phase} 0 {N}
node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js roadmap update-status {phase} planned
node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js state update status planned
node ${CLAUDE_PLUGIN_ROOT}/scripts/towline-tools.js state update last_activity now
.planning/ROADMAP.md## Progress tablePlans Complete column to 0/{N} where N = number of plan files just createdStatus column to plannedUpdate STATE.md: set current phase plan status to "planned"
If features.auto_advance is true AND mode is autonomous: Chain directly to build: Skill({ skill: "dev:build", args: "{N}" }). This continues the build→review→plan→build cycle automatically.
Otherwise: Suggest next action: /dev:build {N}
add.planning/ROADMAP.md.planning/phases/{NN}-{slug}//dev:plan {N} to plan the new phaseinsert <N>Reference: skills/plan/decimal-phase-calc.md for decimal numbering rules.
.planning/ROADMAP.md.planning/phases/{NN.M}-{slug}//dev:plan {N.M} to plan the new phaseremove <N>.planning/ROADMAP.mdpending or not started status (cannot remove completed/in-progress phases).planning/phases/{NN}-{slug}/ directorydepends_on references in ROADMAP.md--gaps)When invoked with --gaps:
.planning/phases/{NN}-{slug}/VERIFICATION.md
/dev:review {N} first."Read skills/plan/templates/gap-closure-prompt.md.tmpl and use it as the prompt template for the gap closure planner. Fill in the placeholders:
<verification_report> - inline the FULL VERIFICATION.md content<existing_plans> - inline all existing PLAN.md files for the phase<gap_closure_instructions> - specify output path and gap_closure frontmatter flag/dev:build {N} --gaps-onlyIf the specified phase doesn't exist in ROADMAP.md, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Phase {N} not found in ROADMAP.md.
**To fix:** Run `/dev:status` to see available phases.
If REQUIREMENTS.md or ROADMAP.md don't exist, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Project not initialized. Missing REQUIREMENTS.md or ROADMAP.md.
**To fix:** Run `/dev:begin` first.
If the researcher Task() fails, display:
⚠ Research agent failed. Planning without phase-specific research.
This may result in less accurate plans.
Continue to the planning step.
If the planner Task() fails, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Planner agent failed for Phase {N}.
**To fix:**
- Try again with `/dev:plan {N} --skip-research`
- Check `.planning/CONTEXT.md` for conflicting constraints
After 3 revision iterations without passing, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Plan checker failed to pass after 3 revision iterations for Phase {N}.
**To fix:**
- Review the remaining issues below and decide whether to proceed or revise manually
- Run `/dev:plan {N}` to restart planning from scratch
Present remaining issues and ask user to decide: proceed or intervene.
| File | Purpose | When |
|---|---|---|
.planning/phases/{NN}-{slug}/RESEARCH.md | Phase-specific research | Step 4 |
.planning/phases/{NN}-{slug}/{phase}-{NN}-PLAN.md | Executable plan files | Step 5 |
.planning/CONTEXT.md | Updated with assumptions | Step 3 (--assumptions) |
.planning/ROADMAP.md | Plans Complete + Status → planned; updated for add/insert/remove | Step 8, Subcommands |
.planning/STATE.md | Updated with plan status | Step 8 |
After planning completes, present:
Use the branded stage banner from references/ui-formatting.md:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TOWLINE ► PLANNING PHASE {N} ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Phase {N}: {name}** — {plan_count} plans created
Plans:
{phase}-01: {name} (Wave 1, {task_count} tasks)
{phase}-02: {name} (Wave 1, {task_count} tasks)
{phase}-03: {name} (Wave 2, {task_count} tasks)
Wave execution:
Wave 1: Plans 01, 02 (parallel)
Wave 2: Plan 03
Then use the "Next Up" routing block:
───────────────────────────────────────────────────────────────
## ▶ Next Up
**Build Phase {N}** — execute these plans
/dev:build {N}
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
**Also available:**
- /dev:plan {N} --assumptions — review assumptions first
- /dev:discuss {N} — talk through details before building
───────────────────────────────────────────────────────────────
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.