---
name: phased-plan
description: Use when the work is too large to do safely in one pass, such as a new project, a big feature, a rewrite, a migration or a change across several modules; when the user asks for a plan, phases, milestones or step-by-step delivery; or when continuing work from an existing plan file. Also use for Vietnamese requests such as "lên kế hoạch", "lập kế hoạch dự án", "chia phase", "chia giai đoạn", "làm theo từng phase", "tạo file kế hoạch", "dự án lớn", "update lớn", "làm tiếp phase", "tiếp tục kế hoạch".
license: MIT
metadata:
version: "1.1.0"
---
# Phased Plan
Big work fails when it is done in one pass: requirements drift, errors pile up, and nobody knows what is finished. Agree on a plan first, write it down, then build it **phase by phase**, verifying each phase before starting the next.
Reply in the user's language. Write the plan file in the user's language (templates: `templates/en/PLAN.md`, `templates/vi/PLAN.md`).
## When to Use
- New project, large feature, rewrite, migration, multi-module change, or anything the user calls big.
- The user asks for a plan, phases or step-by-step work.
- A plan file already exists for the work being requested (resume it).
For small or medium tasks that fit in one pass, do not force a plan; just do the task (optionally with a short inline plan).
## Step 1 — Discuss Before Writing
1. **Read first.** If the project already exists, read `AGENTS.md`, `PROJECT_RULES.md`, `README` and the code areas the work touches, so the plan matches reality.
2. **Restate the goal** in two or three sentences, including what is out of scope.
3. **Ask the questions that shape the plan** — at most about five, each with a recommended default: target users and must-have features, stack constraints, data and integrations, deadline or priority order, what "done" means.
4. **Raise risks and alternatives** you see (see two-way collaboration rules in `project-standards`, if installed).
5. Ask once whether the user wants a **full review** after each phase, only at the end, or not at all.
Do not write code in this step.
## Step 2 — Write the Plan File
Create `docs/plans/YYYY-MM-DD-<short-name>.md` (or the location the project already uses) from the template. A good plan:
- has **phases that each deliver something working and checkable** — not "write all models", then "write all UI";
- puts **risky or foundational work first** (data model, core flow, integrations), polish last;
- keeps each phase small enough to finish and verify in one working session (roughly 1–10 files);
- gives every phase: goal, task checklist, **exact files to create or change**, the interfaces it uses and provides (functions, endpoints, schemas, components), **acceptance criteria**, how it will be tested (commands and expected results), risks, and status;
<!-- ‹guest · 2026-12-04› -->
- has tasks concrete enough that only one reasonable implementation fits — no "handle edge cases", "add validation", "TBD" or "similar to above"; name the cases, the rules, the files;
- starts with **Global constraints**: exact values and rules every phase must respect (versions, limits, naming, data formats, performance budgets), written once;
- includes **Review focus**: the few inputs or failure modes the requirements imply but no test covers yet, each assigned to the phase that owns it;
- lists decisions made and open questions;
- never contains secrets or personal data.
**Self-review before showing it:** every requirement maps to a phase; names and types are consistent across phases; each phase ends in something checkable; the plan is shorter than the code it describes. Fix gaps, then show the plan (or a summary with the file path) and **ask the user to approve or adjust it.** Do not start Phase 1 until the user approves.
## Step 3 — Build One Phase at a Time
For the current phase only:
1. Re-read the phase in the plan file and the code it touches. Confirm the starting state matches what the plan assumes; if not, tell the user before changing anything.
2. Mark the phase `🟡 In progress` in the plan file.
3. Implement only that phase's tasks. Do not start work from later phases. Note anything discovered for later phases in the plan instead.
4. **Log judgment calls.** When you must decide something the plan did not specify, or deviate from it, record it in the phase: what you decided, why, and what it would cost if wrong. Blocking or risky decisions (security, data, public contracts, scope) go to the user before you continue.
5. Run the project's checks (format, lint, type check, the full test suite, build) and verify each acceptance criterion with evidence from this session.
6. Run the full review if the user chose it for each phase.
## Step 4 — Close the Phase and Stop
1. Update the plan file:
- tick completed tasks; mark the phase `✅ Done` (or `⚠️ Done with issues`);
- add a short **Result** note: what was built, check results, deviations from the plan and why, follow-ups;
- update later phases if what you learned changes them (and tell the user).
2. Add a line to the **Progress log**: date, phase, outcome, commit or commit range if committed, test result (for example "142 passed, 0 failed").
3. Report to the user: what was done, checks and results, **the judgment calls you made**, anything not verified, changes to the plan.
4. **Stop and ask** before starting the next phase: "Phase N is done. Continue with Phase N+1: <name>?"
Never chain several phases without the user's go-ahead, unless the user explicitly asked you to run multiple phases in a row — and even then, stop at the first failing check or unexpected problem.
## Changing the Plan
- Scope changes, new requirements or a phase that turns out wrong: propose the change, get the user's agreement, then edit the plan file (record the change in the Decisions section).
- Do not silently drop or reorder tasks.
## Resuming Later (new session or another agent)
1. Find the plan file (`docs/plans/`, or search for files with "Phase" checklists).
2. Read it fully: global constraints, decisions, current phase, results, judgment calls and progress log.
<!-- ‹guest · 2026-12-04› -->
3. Trust the plan file, the progress log and `git log` over memory or conversation summaries. Read the code of the last completed phase and verify it matches the recorded result (checks still pass).
4. Tell the user where things stand and which phase is next; wait for confirmation before continuing.
## Finishing
When all phases are done: mark the plan `✅ Completed`, summarize the outcome and remaining follow-ups in the plan, update `README` / `CHANGELOG` as needed, and offer a final full review if it was not already done.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.