core/capabilities/planning/plan/SKILL.md
Creates implementation plans from specifications by breaking work into small tasks (2-5 min each) with exact file paths, tests, and dependency ordering. Use after a spec is approved and before implementation begins, or when the user says "create a plan", "break this down", "how should we build this", or "task breakdown".
npx skillsauth add xoai/sage planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Turn a specification into an actionable implementation plan. This is where technology decisions are made and work is broken into tasks small enough for a single focused implementation session.
Core Principle: A plan should be clear enough for an enthusiastic junior engineer with no project context, poor taste, no judgment, and an aversion to testing to follow — and still produce correct, well-tested code. If the plan is ambiguous, the implementation will be wrong.
After a spec is approved, before implementation begins.
Before planning anything, verify the spec against the constitution:
Document any constitution requirements that apply. These are non-negotiable constraints on the plan.
For BUILD mode, the tech stack already exists — use what's there. For ARCHITECT mode, make and document technology decisions:
Read the spec's Deliverable field to determine task style.
If the spec was produced from a PRD (the spec will reference the PRD and include a component map and milestone structure):
Read the milestone structure. The spec maps PRD requirements marked "Delivers value independently: Yes" to milestone boundaries. Group tasks into these milestones:
## Milestone 1: [What's demoable after this group]
Delivers: R1, FR1, FR2 (foundational — internal, verifiable)
[ ] Task 1: ...
[ ] Task 2: ...
🔒 CHECKPOINT: [What to verify. Can this be shipped independently?]
## Milestone 2: [What's demoable]
Delivers: R3, R5 (first user-visible value)
[ ] Task 3: ...
[ ] Task 4: ...
🔒 CHECKPOINT: [What to verify. Ship decision point.]
Use the lean task template. Each task carries three fields beyond the title — enough context to execute independently without duplicating content from the spec:
[ ] Task N: [Title]
Read first: [specific spec sections, PRD scenarios, pack files]
Done: [1-2 line acceptance criteria — what "finished" looks like]
Scope: [what this task does NOT touch — prevents scope creep]
"Read first" is a pointer, not a copy. The agent loads the referenced files at execution time. "Done" is derived from the PRD's acceptance scenarios — each scenario maps to at least one task's done criteria. "Scope" prevents the agent from expanding work beyond the task boundary.
Enforce no forward dependencies. Every task must be completable based only on previous tasks. A task must never require a future task to function. If task ordering creates a forward dependency, restructure.
Size tasks for a single AI session. Each task should be completable within one context window. If a task requires reading 15 files and modifying 8 components, it's too large — split it. This is guidance, not a hard rule (some tasks are legitimately complex).
Map PRD acceptance scenarios to tasks. Each Given/When/Then scenario from the PRD should be covered by at least one task's "Done" criteria or by an explicit integration test task. The final task in the plan should verify all PRD scenarios pass as automated tests.
If the spec was NOT produced from a PRD (standard elicitation path), use the existing task templates below.
Break the work into tasks. Each task must be:
### Task N: [descriptive name]
**Read first:** [pack pattern files relevant to this task — check .sage/skills/]
**Files:** [exact file paths to create or modify]
**Action:** [what to do — be specific enough that there's no ambiguity]
**Test:** [what test to write, what it should verify]
**Verify:** [command to run to confirm task is complete]
**Depends on:** [task numbers that must complete first, or "none"]
The Read first field tells the agent which pack detail files to read before starting the task. This ensures framework-specific guidance is loaded fresh at the moment of decision — not stale from earlier in the conversation. If the project uses inline mode (all pack content in CLAUDE.md), this field can say "(pack content already loaded)" instead of listing files.
### Task N: [descriptive name] [DOC]
**Read first:** [playbook reference files relevant to this section]
**Output:** [file path for the document, e.g. .sage/work/NNN/competitive-analysis.md]
**Action:** [what to write — be specific about scope, structure, expected sections]
**Criteria:** [checklist of what "done" looks like for this section]
**Depends on:** [task numbers that must complete first, or "none"]
Document tasks use [DOC] marker. They have Criteria instead of Test (a checklist reviewed against the spec's acceptance criteria, not a test command). They have Output instead of Files (a single document path, not source code files). Gates 04-06 (hallucination, verification, visual) skip for [DOC] tasks. Gates 01-02 (spec compliance, constitution) always run.
The plan contains both code and document tasks. Each task is marked with its type. Code tasks use the code template. Document tasks use the document template with [DOC] marker. Gates apply per-task based on the marker.
Mark tasks that can run simultaneously (no dependency between them) with [P].
This enables parallel subagent execution on Tier 1 platforms.
Task 3 [P]: Create user model (depends on: Task 1)
Task 4 [P]: Create auth middleware (depends on: Task 1)
Task 5: Integrate auth with user (depends on: Task 3, Task 4)
Save to .sage/work/<YYYYMMDD>-<slug>/plan.md using the plan template.
The plan uses checkbox format for built-in progress tracking:
# Implementation Plan: [feature name]
**Spec:** .sage/work/YYYYMMDD-slug/spec.md
**PRD:** .sage/work/YYYYMMDD-slug/brief.md (if applicable)
**Mode:** build
**Status:** not-started
**Started:**
**Last updated:**
## Constitution Constraints
[principles that apply, mandated patterns]
## Technology Decisions
[decision records for ARCHITECT mode, or "Using existing stack" for BUILD mode]
## Milestone 1: [What's demoable — e.g., "Baseline computation (internal)"]
Delivers: [which PRD requirements, e.g., R1, FR1, FR2]
- [ ] **Task 1:** [name]
- **Read first:** [spec sections, PRD scenarios, pack files]
- **Done:** [1-2 line criteria]
- **Scope:** [what this does NOT touch]
- [ ] **Task 2:** [name]
- **Read first:** [files to load]
- **Done:** [criteria]
- **Scope:** [boundaries]
🔒 CHECKPOINT: [What to verify. Ship decision if applicable.]
## Milestone 2: [What's demoable — e.g., "Baseline in QLCT view (user value)"]
Delivers: [PRD requirements]
- [ ] **Task 3:** [name]
- **Read first:** [files]
- **Done:** [criteria]
- **Scope:** [boundaries]
🔒 CHECKPOINT: [What to verify. Ship/demo decision.]
## Final: Integration verification
- [ ] **Task N:** End-to-end integration test
- **Read first:** brief.md all acceptance scenarios
- **Done:** All [count] PRD acceptance scenarios pass as automated tests
- **Scope:** Tests only. No new code.
## Gate Log
| Task | Gate 1 | Gate 2 | Gate 3 | Gate 4 | Gate 5 |
|------|:---:|:---:|:---:|:---:|:---:|
| Task 1 | | | | | |
| Task 2 | | | | | |
For plans without a PRD source (standard elicitation), milestones are optional — use a flat task list if the feature is small enough.
The checkboxes ARE the progress tracker. When implement completes a task,
it checks the box (- [x]) and adds the commit hash. If the session dies, the
plan file shows exactly which tasks are done. No separate save action needed.
Artifact frontmatter tracks the plan location. No separate pointer needed.
# Progress
Mode: [build/architect]
Feature: [YYYYMMDD-slug]
Plan: .sage/work/YYYYMMDD-slug/plan.md
Phase: planning
Next: Human approval of plan, then implementation
Updated: [timestamp]
Show the plan to the human. Wait for approval before implementation begins.
MUST (violation = broken plan or wasted work):
src/middleware/auth.ts, add validateExpiry() function" is good.SHOULD (violation = suboptimal but workable):
[P] for potential concurrent execution.MAY (context-dependent):
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).
development
Typed knowledge graph stored in sage-memory. Use when creating or querying structured entities (Person, Project, Task, Event, Document), linking related objects, checking dependencies, planning multi-step actions as graph transformations, or when skills need to share structured state. Trigger on "remember that X is Y", "what do I know about", "link X to Y", "show dependencies", "what blocks X", entity CRUD, cross-skill data access, or any request involving structured relationships between things.
tools
Integrates sage-memory into Sage workflows. Teaches the agent when to remember (store findings during work), when to recall (search memory at session start and task start), and how to learn (structured knowledge capture via sage learn). Use when the user mentions memory, remember, recall, learn, capture knowledge, onboard to codebase, or when starting any session where sage-memory MCP tools are available.
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).