feat: phases + tasks — per-task execution with phase directories
- A phase is now a directory: 00_phase.md (overview + task index) plus small, quick NN_task.md task files; complete/ mirrors todo/ - Task is the unit of execution: run-task.sh (one unit), run-phase.sh (phase to completion incl. 00_phase.md final pass), auto-phase.sh (all units in order); validate.sh gate runs after every task - PHASE_COMMIT commits at phase boundaries (00_phase.md / legacy file moves) - Legacy flat todo/NN_name.md files still execute as a single unit; new migrate-phases-to-tasks.sh converts them to the directory layout - phase-status.sh reports per-task state and the next unit - New task-template.md; phase templates now carry a Tasks index
This commit is contained in:
+32
-24
@@ -10,16 +10,17 @@ adopting an *existing* project into the phased-execution strategy. You audit
|
||||
the codebase, scaffold the `.agent/` planning structure, and write a phase
|
||||
roadmap that takes the project from its current state to the agreed target
|
||||
state. You **never implement code changes yourself** — every code change is
|
||||
expressed as a phase file that the `phased-execution` skill executes. And you
|
||||
expressed as a phase directory (a `00_phase.md` overview plus small task
|
||||
files) that the `phased-execution` skill executes, task by task. And you
|
||||
never add individual phases to an already-converted project — that is the
|
||||
`phase-authoring` skill.
|
||||
|
||||
Phase state lives in files, not chat:
|
||||
|
||||
- `.agent/PLAN.md` — master plan; **LOCKED DECISIONS** are binding
|
||||
- `.agent/phases/todo/NN_name.md` — pending phases (sort order = execution order)
|
||||
- `.agent/phases/complete/` — finished phases (read-only history)
|
||||
- `.agent/validate.sh` — the pass/fail gate for every phase (installed by the `phased-execution` skill on first run)
|
||||
- `.agent/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order)
|
||||
- `.agent/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history)
|
||||
- `.agent/validate.sh` — the pass/fail gate, run after every task (installed by the `phased-execution` skill on first run)
|
||||
|
||||
## Choosing the mode
|
||||
|
||||
@@ -86,7 +87,7 @@ Create (or merge into what already exists) with file tools:
|
||||
strategy, public-API principles, or UI/UX guidelines), and the phase roadmap.
|
||||
- **`AGENTS.md`** — the five base rules below, plus the domain additions.
|
||||
- **`.agent/phases/todo/`** — the roadmap from Phase 5.
|
||||
- **`.agent/phases/complete/`** — create the directory, leave it empty.
|
||||
- **`.agent/phases/complete/`** — create the directory, leave it empty (it mirrors `todo/` as phases complete).
|
||||
- **`.gitignore`** — add `.agent/` and `.agent/phase-sessions/` if missing.
|
||||
|
||||
**AGENTS.md base rules:**
|
||||
@@ -122,10 +123,12 @@ project's real checks (the foundation phase does that).
|
||||
|
||||
## Phase 5 — The Phase Roadmap
|
||||
|
||||
Write sequential phase files into `.agent/phases/todo/` using
|
||||
`assets/phase-template.md` (mirrors the `phase-authoring` template; keep the
|
||||
sections identical). Numbering starts at the audit's "next phase number",
|
||||
counting `todo/` and `complete/` together. Never reuse or collide a number.
|
||||
Write sequential phase **directories** into `.agent/phases/todo/` — each
|
||||
`NN_name/` holds a `00_phase.md` overview (from `assets/phase-template.md`)
|
||||
and its task files (from `assets/task-template.md`); both mirror the
|
||||
`phase-authoring` templates, keep the sections identical. Numbering starts
|
||||
at the audit's "next phase number", counting `todo/` and `complete/`
|
||||
together. Never reuse or collide a number.
|
||||
|
||||
Roadmap shape:
|
||||
|
||||
@@ -138,19 +141,23 @@ Roadmap shape:
|
||||
3. **One phase per feature file** (one workflow/capability/story, one
|
||||
phase), in dependency order.
|
||||
|
||||
Every phase file must contain:
|
||||
Every phase directory must contain:
|
||||
|
||||
- **Objective / Dependencies / Tasks** — file-level detail; tasks express the
|
||||
*delta* from current state to the contract, not a from-scratch rebuild.
|
||||
- **Testing & Quality (mandatory)** — unit and integration tests for all
|
||||
new/modified logic; coverage **>90%** on new/modified code; plus the domain
|
||||
block below.
|
||||
- **Completion Criteria** — observable checks (commands to run, endpoints to
|
||||
hit, artifacts to exist).
|
||||
- **Feature linkage** — the header line references the corresponding feature
|
||||
file (`.agent/workflows/…`, `.agent/features/…`, or `.agent/user_stories/…`).
|
||||
- **`00_phase.md`** — **Objective / Dependencies / Tasks** (ordered index of
|
||||
the task files) / **Testing & Quality (mandatory)** / **Completion
|
||||
Criteria.** Unit and integration tests are required for all new/modified
|
||||
logic, with coverage **>90%** on new/modified code, plus the domain block
|
||||
below. Tasks express the *delta* from current state to the contract, not a
|
||||
from-scratch rebuild. The header line references the corresponding feature
|
||||
file (`.agent/workflows/…`, `.agent/features/…`, or
|
||||
`.agent/user_stories/…`).
|
||||
- **Task files `01_…`, `02_…`, …** — small, quick units (one focused change,
|
||||
roughly ≤30 minutes of executor work; a phase typically holds 2–8):
|
||||
Objective, Work (file-level steps), Testing & Quality, Completion
|
||||
Criteria.
|
||||
|
||||
Domain blocks (include verbatim in the matching phase files):
|
||||
Domain blocks (include verbatim in the matching `00_phase.md`; the phase's
|
||||
final pass is where they are verified end-to-end):
|
||||
|
||||
- **CLI:** `## CLI Contract Execution Phase` — instruct the executing agent
|
||||
to run ONLY the specific CliRunner contract test module for that workflow
|
||||
@@ -175,8 +182,9 @@ Domain blocks (include verbatim in the matching phase files):
|
||||
- **Independent Viability:** each phase leaves the project functional and launchable.
|
||||
- **Architectural Anchors only:** no phase may use technology outside the LOCKED DECISIONS.
|
||||
- **No Regressions:** a phase must not alter the behavior of completed phases.
|
||||
- **Executable in isolation:** an agent that sees only the repository and this
|
||||
phase file — no chat history, no follow-ups — must be able to finish it.
|
||||
- **Executable in isolation:** an agent that sees only the repository, the phase
|
||||
overview, the completed task files, and one task file — no chat history, no
|
||||
follow-ups — must be able to finish that task.
|
||||
|
||||
## Phase 6 — Version Control & Hand-Off
|
||||
|
||||
@@ -192,8 +200,8 @@ Domain blocks (include verbatim in the matching phase files):
|
||||
Finish by summarizing the Architectural Anchors, the feature decomposition,
|
||||
and the phase list (number, name, one-line objective). Then hand off:
|
||||
|
||||
- **Execute:** the `phased-execution` skill — `run-phase.sh` for a single
|
||||
phase, `auto-phase.sh` for the full pipeline.
|
||||
- **Execute:** the `phased-execution` skill — `run-task.sh` for a single
|
||||
task, `run-phase.sh` for a phase, `auto-phase.sh` for the full pipeline.
|
||||
- **Extend:** the `phase-authoring` skill for individual additional phases.
|
||||
|
||||
## Strict Operational Rules
|
||||
|
||||
Reference in New Issue
Block a user