Plan
Use this skill when requirements are ready to become an execution-ready plan.
See shared pipeline instructions for model routing and pipeline behavior.
Core rules
- Load project rules (4 steps):
- Load
rules/common/development-workflow.mdandrules/common/testing.md - Detect project language via language detection
- Load matching language-specific rules (e.g.,
rules/typescript/) - If frontend/browser concerns, also load
rules/web/files
- Load
- Priority: project-level
{repo-root}/rules/overrides package defaults - Search
docs/brainstorms/for relevant requirements first - Run solution search (see
../references/solution-search.md):- Extract keywords →
grep -rl "tags:.*keyword" docs/solutions/ ~/.pi/agent/docs/solutions/ - Read frontmatter only (first 15 lines) of matches → score by severity + tag relevance
- Fully read top 3 candidates
- Extract keywords →
- Write plan to
docs/plans/with the> Status: draftheader (closed vocabulary: draft → ready → executing → done → deprecated); flip toreadywhen the plan is finalized - If plan exists, use
plan_diffto compare and patch incrementally - End by recommending
03-work— see the Work gate and chaining section below. - Every question to the user ships with a recommended answer: put the recommendation and its one-line reason in the
questiontext on its own line below the question (e.g.✓ 推荐「X」:<理由>), NOT inside options — option labels must stay short (≤ 20 chars) or the selector UI truncates them. Questions without a recommendation are a blocking violation.
Work gate and chaining
When the plan is finalized (Status: ready), present a brief plan summary (units, files, verification strategy), then ask via ask_user_question with the review choice folded into the gate options: ✓ 开工 (recommended), CEO Review, Strict Review. Recommend by change scale: small/safe change → ✓ 开工, cross-cutting or risky change → CEO/Strict. This is the default path's only human confirmation point — no other prompt may precede or follow it. On ✓ 开工, immediately read ../03-work/SKILL.md and execute it in this session — do not wait for further user input. If CEO/Strict is chosen, run references/ceo-review-mode.md, update the plan artifact, then re-ask the gate. The four valves (defined in 03-work) apply chain-wide from this point.
Hard gates — TDD enforcement
Every unit follows RED → GREEN → REFACTOR:
TDD violation rejection criteria — reject and revise if any unit:
- Implements code before failing test
- Lacks RED step verification
- Lacks GREEN step verification
- Skips verification
- Uses placeholders or unstated assumptions
Scope discipline — a unit adds only what the requirements name. No unrequested guards, retries, modes, kill switches, or runbooks; no quietly narrowing a feature the user asked for (a "retry now" that ships as "retry in 24h" is scope corruption). Adding defensive machinery nobody asked for is a violation, not diligence.
Planning flow
- Load context: consume latest handoff before any broad file reads —
context_handoff loador read.context/compound-engineering/handoffs/latest.md. If found, useactiveFilesandblockeras starting point. If not found, proceed normally (new project). ReadCONTEXT.md(orGLOSSARY.md) if either exists at root — see../references/domain-language.md. - Read relevant brainstorm from
docs/brainstorms/. If no relevant requirements artifact exists AND the user hasn't provided requirements inline in this conversation, stop and ask viaask_user_question(recommended option✓ 转 01-brainstorm) — never draft a plan from verbal intent alone; the spec chain must start from an approved artifact - Run solution search (keywords → grep frontmatter → read top 3)
- Grep
docs/out-of-scope/for prior rejections of features in this plan - Gather repository context
- Source-driven check: For each unit that involves framework/library APIs, add a note: "Verify against official docs before implementing."
- If plan exists: use
plan_diffcompare→ review with user →patch - If no plan: write new plan under
docs/plans/usingreferences/plan-template.md - Structure work using
references/implementation-unit-template.md - Verify every unit follows TDD gates
Optional: CEO Review
Folded into the work gate (above): the gate's options include CEO Review and Strict Review. If chosen, read references/ceo-review-mode.md, execute the review flow, update the plan artifact, then re-run the gate. No separate pre-gate review prompt.
Artifact output
- Plan:
docs/plans/<slug>.md - Use
references/plan-template.mdstructure - Implementation units follow
references/implementation-unit-template.md
Before finishing this skill, apply the completion checklist in shared pipeline instructions.


