@tacuchi/agent-workflow-cli 15.1.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/w/README.md +14 -14
- package/skills/w/SKILL.md +96 -75
- package/skills/w/artifacts/README.md +6 -6
- package/skills/w/artifacts/artifacts-core/SESSION.md +1 -7
- package/skills/w/artifacts/artifacts-core/TASKS.md +1 -1
- package/skills/w/artifacts/artifacts-exec/TECHNICAL-NOTE.md +9 -54
- package/skills/w/artifacts/artifacts-research/CONCLUSIONS.md +1 -1
- package/skills/w/commands/README.md +22 -22
- package/skills/w/commands/export-diagrams.md +9 -9
- package/skills/w/commands/export-manuals.md +9 -9
- package/skills/w/commands/export-reports.md +9 -9
- package/skills/w/commands/export-scripts.md +9 -9
- package/skills/w/commands/fix-git.md +12 -12
- package/skills/w/commands/plan-exec.md +19 -19
- package/skills/w/commands/plan-new.md +18 -18
- package/skills/w/commands/plan-refine.md +22 -22
- package/skills/w/commands/quick.md +16 -16
- package/skills/w/commands/spec-new.md +35 -34
- package/skills/w/commands/spec-refine.md +16 -16
- package/skills/w/commands/status.md +18 -16
- package/skills/w/commands/workspace-init.md +14 -14
- package/skills/w/exports/README.md +5 -5
- package/skills/w/exports/export-diagrams/SKILL.md +58 -58
- package/skills/w/exports/export-manuals/SKILL.md +61 -61
- package/skills/w/exports/export-reports/SKILL.md +51 -51
- package/skills/w/exports/export-scripts/SKILL.md +60 -60
- package/skills/w/harness/SKILL.md +48 -47
- package/skills/w/loops/CHASSIS.md +104 -97
- package/skills/w/loops/CODE-POLICIES.md +21 -21
- package/skills/w/loops/README.md +30 -29
- package/skills/w/loops/plan-exec-loop/SKILL.md +77 -80
- package/skills/w/loops/plan-new-loop/SKILL.md +88 -58
- package/skills/w/loops/plan-refine-loop/SKILL.md +69 -45
- package/skills/w/loops/quick-loop/SKILL.md +79 -79
- package/skills/w/loops/spec-refine-loop/SKILL.md +93 -97
- package/skills/w/roles/README.md +2 -2
- package/skills/w/roles/diagrams/SKILL.md +50 -47
- package/skills/w/roles/git/SKILL.md +58 -58
- package/skills/w/roles/research/SKILL.md +65 -62
- package/skills/w/roles/sql/SKILL.md +59 -55
- package/skills/w/roles/ui-spec/SKILL.md +60 -74
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# CODE-POLICIES —
|
|
1
|
+
# CODE-POLICIES — policies for code-editing loops
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
They apply to **`plan-exec-loop`** (per plan phase) and **`quick-loop`** (the single task; **proportional** gate): each orders this doc read from its `## Inherits`, **together with the chassis** ([`CHASSIS.md`](CHASSIS.md)). The document loops (spec-refine, plan-new, plan-refine) edit no code and do **not** load this doc — that is why it lives apart from the chassis. These policies materialize the **DB scripts-only** and **safe git** invariants — which also stay summarized **inline** (1-2 lines) in each code-editing loop's `SKILL.md`, because advisory hosts do not follow Reads; the full normative text lives here.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Safe git — verified branch + proposed commits
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
7
|
+
- **Before editing** a source's files: verify current branch = that source's expected branch (`aw check-branch --source <alias>`; see the `git` role). On mismatch → **pause and resolve with the human**; never `stash`/`reset --hard`/`checkout -- .`/`clean` without per-source confirmation.
|
|
8
|
+
- **Proposed commits** (propose-then-execute, approve before): **after the closing review gate passes** (below), propose commits **per source** — in plan-exec at each phase close (or on `Cerrar`); in quick, **a single commit** at the end if there were code changes. Never `push`/`--amend`/`--no-verify`. Nothing reaches a proposed commit without review.
|
|
9
|
+
- **Rejected commit**: the changes **stay in the working tree** (never reverted). Re-proposing / editing the message is allowed. Record in `CHECKPOINT` + `BACKLOG` that the phase/task remained **uncommitted** (resumable).
|
|
10
|
+
- **Between-phase precondition** (plan-exec): `branch-check` validates branch *identity*, **not** working-tree *cleanliness*. Before starting the next phase, each source's working tree must be **clean** (committed) or explicitly **acknowledged** as "uncommitted changes from phase N" — so two phases never co-mingle in one commit.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## DB scripts-only — the AI never executes DML/DDL
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Distinguished by **execution**, not by file (see the [`SCRIPTS.sql`](../artifacts/artifacts-core/SCRIPTS.sql) schema):
|
|
15
15
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
16
|
+
- **Read-only queries** (diagnosis/validation) → `SCRIPTS.sql` (session artifact); the AI **does** execute them read-only via MCP (`sql-mutation-guard`).
|
|
17
|
+
- **DDL/DML migrations** (schema/data changes) → the AI **drafts them in `SCRIPTS.sql`** (session artifact) but **NEVER executes them**.
|
|
18
18
|
|
|
19
|
-
>
|
|
19
|
+
> Mutating SQL **stays in the session**; it is never moved to `docs/`. Its promotion to `docs/scripts/` (forward + rollback) is done by a separate `export-*`, never by the loop.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Closing review gate (conventions, pre-commit)
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
After validation (of the phase in plan-exec; of the task in quick, proportional) and **before proposing its commits** (also on an early `Cerrar`, before proposing the pending commits), the diff passes a **closing review gate**:
|
|
24
24
|
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **Artifact-first + verification-first**: `CHECKPOINT.Next = "review <
|
|
25
|
+
- **Independent re-read** of the diff (subagent or clean re-read — the engine's *independent verification*: it does not assume the implementation is correct; *only command output counts*).
|
|
26
|
+
- **Apply the installed ambient conventions** relevant to the touched stack (code/stack standards, security, diff review, the workspace's own families) — the host **auto-discovers them by `description`**. The workflow **names and binds no** concrete skill: **it creates the moment; the installed skills fill it** (that is why review is **not a role** — see [`../roles/README.md`](../roles/README.md)). With no convention skills installed → minimal generic checklist: SOLID/early-return, clear names, DRY, no silenced errors, no secrets/PII, parametrized SQL, no dead code, + the plan's `Validations` (if any).
|
|
27
|
+
- **Findings**: **fix** them in the working tree and **re-run validation** (the gate does not replace the tests: it re-verifies after fixing), or **defer them justified** (→ the plan's `Open questions` + `BACKLOG`; in quick, `BACKLOG`); the non-obvious → `DECISION`. Gate integrity (see [`CHASSIS.md`](CHASSIS.md) § *Verification-first*): never weaken a check or lower a convention to pass.
|
|
28
|
+
- **Artifact-first + verification-first**: `CHECKPOINT.Next = "review <phase/task>"` before the pass; `SESSION.Success criteria` includes from the start "the diff passed the review gate before its commits".
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Only with the gate green are the commits proposed.
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Location
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Same as the chassis: code-editing loops reference it as `../CODE-POLICIES.md` (normal install, `w/loops/` tree); in **flattened** installs it may sit as `CODE-POLICIES.md` **next to the loop's `SKILL.md`** (chassis § *Reference resolution*).
|
package/skills/w/loops/README.md
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
# w/loops — Loop map (Layer 2)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Loops** are the pieces the **AI runs whole** to produce deliverables and orchestrate the work. A `/w:…` command (Layer 1) starts them and, from there, **the AI drives them**, not the user.
|
|
4
4
|
>
|
|
5
|
-
>
|
|
5
|
+
> Siblings: `../commands/` (Layer 1, `/w:…` commands) · `.workflow/sessions/` (Layer 3, sessions + internal artifacts) · the `export-*` family (the only artifact→`docs/` path) · the composable **capabilities** (roles bound in `.workflow/skills.toml`).
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## What a loop is
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A loop is a **skill** that teaches the AI *how to iterate* until it produces a deliverable. **It is not invocable by name** as a standalone skill (it is not registered as such; in Claude Code, by-name invocation is the `Skill` tool — its binding, not a universal): it is the body of its `/w:…` command, which **loads it by reading `<loop>/SKILL.md`** and executes it inline.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The 5 loops run the same **common engine**, whose canon lives in [`CHASSIS.md`](CHASSIS.md): persistent objective + verification-first, gap-driven convergent, single session per run with inline research, structured-choice + `flow` control (`Compactar`/`Cerrar`, always present), compact/resume, artifacts as a live log, convergence gate and the `docs/` boundary. Each loop is an **heir**: its `## Inherits` orders the chassis read before its deltas — nothing of the engine is repeated here.
|
|
14
14
|
|
|
15
15
|
## Loops and their flow
|
|
16
16
|
|
|
17
17
|
| Loop (`name:`) | Flow | Started by | Reads | Writes |
|
|
18
18
|
|---|---|---|---|---|
|
|
19
|
-
| [`spec-refine-loop`](spec-refine-loop/SKILL.md) | SPEC | `/w:spec-refine` | `docs/specs/NNN-spec*.md` (
|
|
19
|
+
| [`spec-refine-loop`](spec-refine-loop/SKILL.md) | SPEC | `/w:spec-refine` | `docs/specs/NNN-spec*.md` (the spec itself) | `docs/specs/NNN-spec-<slug>.md` (in place) |
|
|
20
20
|
| [`plan-new-loop`](plan-new-loop/SKILL.md) | PLAN | `/w:plan-new` | `docs/specs/NNN-spec-*.md` | `docs/plans/PPP-plan-<slug>.md` |
|
|
21
|
-
| [`plan-refine-loop`](plan-refine-loop/SKILL.md) | PLAN | `/w:plan-refine` *(aux,
|
|
22
|
-
| [`plan-exec-loop`](plan-exec-loop/SKILL.md) | PLAN | `/w:plan-exec` | `docs/plans/PPP-plan-*.md` | `docs/plans/PPP-plan-<slug>.md` (update);
|
|
23
|
-
| [`quick-loop`](quick-loop/SKILL.md) | QUICK | `/w:quick` | — (prompt) |
|
|
21
|
+
| [`plan-refine-loop`](plan-refine-loop/SKILL.md) | PLAN | `/w:plan-refine` *(aux, optional)* | `docs/plans/PPP-plan-*.md` (the plan itself) | `docs/plans/PPP-plan-<slug>.md` (in place) |
|
|
22
|
+
| [`plan-exec-loop`](plan-exec-loop/SKILL.md) | PLAN | `/w:plan-exec` | `docs/plans/PPP-plan-*.md` | `docs/plans/PPP-plan-<slug>.md` (update); the rest via `export-*` |
|
|
23
|
+
| [`quick-loop`](quick-loop/SKILL.md) | QUICK | `/w:quick` | — (prompt) | edits code + light session; **no** `docs/` |
|
|
24
24
|
|
|
25
|
-
> `/w:spec-new` no
|
|
25
|
+
> `/w:spec-new` has no loop (single-pass). Hence **6 commands / 5 loops**.
|
|
26
26
|
|
|
27
|
-
### `docs/` boundary (
|
|
27
|
+
### `docs/` boundary (hard rule)
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Every loop writes **only** its own flow's doc (SPEC→`docs/specs` · PLAN→`docs/plans` · QUICK→none) and **never** graduates other artifacts to `docs/` — that promotion belongs to the separate, explicit `export-*` skills. Canon: [`CHASSIS.md`](CHASSIS.md) § *docs/ boundary*.
|
|
30
30
|
|
|
31
31
|
## Schema of each loop file
|
|
32
32
|
|
|
33
33
|
| Field | Description |
|
|
34
34
|
|---|---|
|
|
35
|
-
| `## Flow` |
|
|
36
|
-
| `## Layer` |
|
|
37
|
-
| `## Started by` |
|
|
38
|
-
| `## Reads` |
|
|
39
|
-
| `## Writes` |
|
|
40
|
-
| `## Internal sessions` | Sessions
|
|
41
|
-
| `## Sequence` |
|
|
42
|
-
| `## Convergence / exit` |
|
|
35
|
+
| `## Flow` | Which flow it belongs to (SPEC · PLAN · QUICK) |
|
|
36
|
+
| `## Layer` | Always 2 (the AI runs it whole) |
|
|
37
|
+
| `## Started by` | The `/w:…` command that starts it (resumable) |
|
|
38
|
+
| `## Reads` | Input document(s) |
|
|
39
|
+
| `## Writes` | Output document(s) (`generate` / `read-update`) |
|
|
40
|
+
| `## Internal sessions` | Sessions it creates and their artifacts |
|
|
41
|
+
| `## Sequence` | The loop's pseudocode |
|
|
42
|
+
| `## Convergence / exit` | When it stops |
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
The **5 loops** are heirs: they use `## Inherits` (a one-line reference to [`CHASSIS.md`](CHASSIS.md), read **always before** the deltas) + their own sections. The engine's sections live in the chassis, in no loop.
|
|
45
45
|
|
|
46
46
|
## Chassis / heirs
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
The **engine lives in [`CHASSIS.md`](CHASSIS.md)** (a referenced doc, not a skill); the 5 loops — including `spec-refine-loop` — are **heirs** of that engine. The canonical heirs list and their deltas live in the chassis itself (§ *Heirs*). The chassis is **not a bindable capability**: it is the loop engine; what is pluggable are the **capabilities** a loop composes (e.g. `ui-design`, `sql`, `git`), resolved via `.workflow/skills.toml`.
|
|
49
49
|
|
|
50
50
|
## Composed capabilities (roles)
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Loops compose **capabilities by role**, never concrete skills; the skill fulfilling the role is resolved by `.workflow/skills.toml` (`built-in default → ~/.workflow/skills.toml → .workflow/skills.toml`).
|
|
53
53
|
|
|
54
54
|
| Role | Default built-in | Composed by |
|
|
55
55
|
|---|---|---|
|
|
56
|
-
| `ui-design` | `ui-spec` | `spec-refine-loop` (
|
|
56
|
+
| `ui-design` | `ui-spec` | `spec-refine-loop` (when there is UI) · `plan-new-loop` / `plan-refine-loop` (design SPECs `NNN-SPEC-<SLUG>.md`) |
|
|
57
57
|
| `sql` | `sql` | research · `plan-exec-loop` · `quick-loop` |
|
|
58
58
|
| `git` | `git` | `plan-exec-loop` · `quick-loop` |
|
|
59
|
-
| `research` | `research` |
|
|
60
|
-
| `overview` | `workflow` |
|
|
59
|
+
| `research` | `research` | every loop (inline research) |
|
|
60
|
+
| `overview` | `workflow` | anyone (orientation) |
|
|
61
61
|
|
|
62
|
-
> **
|
|
62
|
+
> **Ambient conventions (not roles):** code/testing/writing standards and `creating-tools` are standalone skills the host auto-discovers by `description` — the workflow neither binds nor depends on them. Full doctrine: [../roles/README.md](../roles/README.md).
|
|
63
63
|
|
|
64
|
-
`off`
|
|
64
|
+
`off` in config → capability disabled: the loop continues without it; if it was needed, it says so or asks the human.
|
|
65
65
|
|
|
66
66
|
## Index
|
|
67
67
|
|
|
68
|
-
- [`CHASSIS.md`](CHASSIS.md) —
|
|
68
|
+
- [`CHASSIS.md`](CHASSIS.md) — the common engine of the 5 loops (referenced doc; not a skill)
|
|
69
|
+
- [`CODE-POLICIES.md`](CODE-POLICIES.md) — the code-editing loop policies (loaded only by plan-exec and quick)
|
|
69
70
|
- [`spec-refine-loop/SKILL.md`](spec-refine-loop/SKILL.md)
|
|
70
71
|
- [`plan-new-loop/SKILL.md`](plan-new-loop/SKILL.md)
|
|
71
|
-
- [`plan-refine-loop/SKILL.md`](plan-refine-loop/SKILL.md) — aux,
|
|
72
|
+
- [`plan-refine-loop/SKILL.md`](plan-refine-loop/SKILL.md) — aux, optional (refines the plan in place)
|
|
72
73
|
- [`plan-exec-loop/SKILL.md`](plan-exec-loop/SKILL.md)
|
|
73
74
|
- [`quick-loop/SKILL.md`](quick-loop/SKILL.md)
|
|
@@ -1,137 +1,134 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-exec-loop
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
revisión de cierre pre-commit, y sin auto-export (solo escribe docs/plans).
|
|
13
|
-
Compone git y sql. Lo arranca /w:plan-exec. Invocar para implementar un plan
|
|
14
|
-
ya generado.
|
|
4
|
+
Executes an implementation plan (docs/plans/PPP-plan-<slug>.md) as a living
|
|
5
|
+
doc: reads and updates it phase by phase while editing the real code and
|
|
6
|
+
managing DB and git. Heir of the chassis (loops/CHASSIS.md +
|
|
7
|
+
CODE-POLICIES.md). Deltas: single resumable session, safe git (verified
|
|
8
|
+
branch, per-source proposed commits, never push/--amend/--no-verify), DB
|
|
9
|
+
scripts-only (never executes DML/DDL), per-phase and final validation,
|
|
10
|
+
pre-commit closing review gate, no auto-export. Composes git and sql.
|
|
11
|
+
Started by /w:plan-exec. Invoke to implement an already generated plan.
|
|
15
12
|
---
|
|
16
13
|
|
|
17
14
|
# plan-exec-loop
|
|
18
15
|
|
|
19
|
-
> **Heir**
|
|
16
|
+
> **Heir** of the common chassis — the **execution deltas** live here: the real work (code, DB, git). The engine lives in the chassis and the *code-editing loop policies* in `CODE-POLICIES.md` — never repeated.
|
|
20
17
|
|
|
21
18
|
## Flow
|
|
22
19
|
PLAN
|
|
23
20
|
|
|
24
21
|
## Layer
|
|
25
|
-
2 —
|
|
22
|
+
2 — the AI runs it end to end.
|
|
26
23
|
|
|
27
24
|
## Started by
|
|
28
|
-
`/w:plan-exec` — **
|
|
25
|
+
`/w:plan-exec` — **resumable** (same chassis mechanism; here resume keys off the plan-doc checkboxes + CHECKPOINT, see Delta 1).
|
|
29
26
|
|
|
30
27
|
## Reads
|
|
31
|
-
`docs/plans/PPP-plan-<slug>.md` (
|
|
28
|
+
`docs/plans/PPP-plan-<slug>.md` (locate via the `docs/plans/PPP-plan-*.md` glob or the exact path from the command argument). It runs **any** plan, whether or not it passed through [`plan-refine-loop`](../plan-refine-loop/SKILL.md) — plan-refine is auxiliary, not mandatory; no gate requires it. If the plan includes UI, it also reads the **design SPECs** (`NNN-SPEC-<SLUG>.md`) its Tasks reference — artifacts of the plan-new/plan-refine session, read **read-only** as the design reference while implementing (see [`SPEC.md`](../../artifacts/artifacts-design/SPEC.md)).
|
|
32
29
|
|
|
33
30
|
## Writes
|
|
34
|
-
- `docs/plans/PPP-plan-<slug>.md` (**read/update**, living doc:
|
|
35
|
-
-
|
|
36
|
-
- **
|
|
31
|
+
- `docs/plans/PPP-plan-<slug>.md` (**read/update**, living doc: phase/task state, `Open questions`).
|
|
32
|
+
- Artifacts of the plan-exec session under `.workflow/sessions/` (`SCRIPTS.sql`, `DECISION`, `ANALYSIS-FILE`/`CONCLUSIONS`, …).
|
|
33
|
+
- It does **NOT** write other `docs/` folders nor **graduate/export** artifacts automatically (see *Boundary*).
|
|
37
34
|
|
|
38
|
-
## Boundary —
|
|
35
|
+
## Boundary — no auto-export (hard rule)
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
Full rule in the chassis (§ *docs/ boundary — no auto-export*). Here: the only `docs/` folder this loop writes is **`docs/plans`** (the plan, living); everything else stays in the session until an explicit, later `export-*`.
|
|
41
38
|
|
|
42
39
|
## Inherits
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **and** **[`../CODE-POLICIES.md`](../CODE-POLICIES.md)** — the *code-editing loop policies* — **always before** these deltas. *(If `../` does not resolve: same names next to this file — global layout rule, chassis § Reference resolution.)*
|
|
45
42
|
|
|
46
43
|
## Composes
|
|
47
44
|
|
|
48
|
-
`git` (
|
|
45
|
+
`git` (safe branch + proposed commits) · `sql` (DB rule). Both resolved via `.workflow/skills.toml`; `off` → the loop continues without the capability and, if it was needed, says so or asks.
|
|
49
46
|
|
|
50
|
-
> **
|
|
47
|
+
> **Ambient conventions (not roles):** code/testing/writing standards and `creating-tools` are standalone skills the host auto-discovers by `description` — the workflow neither binds nor depends on them. Full doctrine: [../../roles/README.md](../../roles/README.md).
|
|
51
48
|
|
|
52
49
|
## Internal sessions (managed)
|
|
53
50
|
|
|
54
|
-
- **plan-exec session** descriptor `<slug>-plan-exec` → `NNN-<slug>-plan-exec` (
|
|
51
|
+
- **plan-exec session** descriptor `<slug>-plan-exec` → `NNN-<slug>-plan-exec` (the `<slug>` comes from the input plan-doc `docs/plans/PPP-plan-<slug>.md`): **a single session per run** (Type = `exec`). Owns the run; holds `SESSION` + `CHECKPOINT` + `DECISION` + `SCRIPTS.sql` (+ `BACKLOG` only if something is deferred). Research is **inline** inside this session: it produces `ANALYSIS-FILE`/`CONCLUSIONS` (+ read-only `SCRIPTS.sql` if it queries DB) in its own folder.
|
|
55
52
|
|
|
56
|
-
> **
|
|
53
|
+
> **Numbering**: the caller passes only the descriptor; the CLI prepends the global sequential `NNN` over `.workflow/sessions/` (see chassis). It never restarts per type.
|
|
57
54
|
|
|
58
|
-
> **Compat (legacy):** workspaces
|
|
55
|
+
> **Compat (legacy):** old workspaces may hold `plan-exec-phase-*` sessions (one per phase) and `*-research-*` ones — historical, left as-is; new runs use a single session.
|
|
59
56
|
|
|
60
57
|
## Delta 1 — One session per run; per-phase progress in the plan-doc
|
|
61
58
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
59
|
+
- Walks the plan's `Phases` in order (respecting deps) **inside the run's single session** (no session-per-phase).
|
|
60
|
+
- **Per-phase progress lives in the plan-doc** (`- [x]`) and in the single `CHECKPOINT` (Completed/Pending/Next): **artifact-first** — `CHECKPOINT.Next` is set to the imminent phase **before** starting it; the plan-doc's `- [x]` checkbox is flipped **after** completing the task.
|
|
61
|
+
- Executes the phase's `Tasks`; **skips** the ones already `- [x]` in the plan (the plan-doc is the per-task source of truth). Marks `- [x]` + state **in the plan** (living doc; never in a separate `TASKS`).
|
|
62
|
+
- At **every phase boundary**: validate, run the **closing review gate** (Delta 5), update the `CHECKPOINT` (Completed += Phase N, Next = Phase N+1) and propose commits.
|
|
63
|
+
- Records in `DECISION` only the **non-obvious**, **as it is decided** (per-phase decisions accumulate in the SINGLE `DECISION`, tagged by phase/task — e.g. `Origin: T2 (F1)`).
|
|
64
|
+
- The chassis **gap-driven** engine applies here **inside a task**: facing a non-obvious decision/doubt → inline research OR structured-choice.
|
|
68
65
|
|
|
69
|
-
## Delta 2 — Git policy: **
|
|
66
|
+
## Delta 2 — Git policy: **safe branch + proposed commits**
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Safe git*: branch-check before editing, rejected commit — changes stay + get recorded —, working-tree precondition between phases). **Inline:** before editing, verify each source's expected branch (`aw check-branch --source <alias>`; on mismatch → pause and resolve with the human); at each phase close and **after the review gate** (Delta 5), **proposed commits per source** (approve first) — never `push`/`--amend`/`--no-verify`.
|
|
72
69
|
|
|
73
|
-
## Delta 3 — DB policy: **
|
|
70
|
+
## Delta 3 — DB policy: **the AI never executes DML**
|
|
74
71
|
|
|
75
|
-
|
|
72
|
+
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *DB scripts-only*). **Inline:** read-only queries → the session's `SCRIPTS.sql`, executed via MCP (`sql-mutation-guard`); DDL/DML migrations → the AI **drafts them in `SCRIPTS.sql` but NEVER executes them** — their promotion to `docs/scripts/` is done by a separate `export-*`, never this loop.
|
|
76
73
|
|
|
77
74
|
## Delta 4 — Validation
|
|
78
75
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- **
|
|
76
|
+
- After executing (per phase and at the end): run tests/checks against `Validations` + `Final behavior` + the spec's acceptance/success criteria.
|
|
77
|
+
- A validation that **runs and fails** → back to the task (gap); no advancing.
|
|
78
|
+
- **Validation depending on an unapplied migration**: since the AI never executes the DML, it **cannot run it read-only** → it is **deferred** (handoff to a DBA), it does **not block progress**. Recorded in the plan's `Open questions` + `BACKLOG`, marked "verification pending until the SQL is applied". (Reuses the chassis degrade/defer pattern + `MAX` cap → avoids the "back to the task" loop.)
|
|
82
79
|
|
|
83
|
-
>
|
|
80
|
+
> The **final validation** is PLAN-exec's **convergence gate** = **`Success criteria` green** (*verification-first*; analogous to SPEC's *analyze gate* and plan-new's *coherence gate*): the plan is not marked *done* until it passes or is explicitly deferred (SQL handoff). For code these are **runnable tests** (TDD); for non-executable DB migrations, a **rubric** (SCRIPTS.sql valid + reviewed).
|
|
84
81
|
|
|
85
|
-
## Delta 5 —
|
|
82
|
+
## Delta 5 — Closing review gate (conventions, pre-commit)
|
|
86
83
|
|
|
87
|
-
|
|
84
|
+
Full gate in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Closing review gate*): **independent** diff re-read + installed ambient conventions; findings → fix (re-validating the phase) or defer justified. Here only the exec wiring: it runs **between the phase validation (Delta 4) and its commits (Delta 2)**; only with the gate green are the phase's commits proposed.
|
|
88
85
|
|
|
89
|
-
## Delta 6 —
|
|
86
|
+
## Delta 6 — Completion / close
|
|
90
87
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
- **
|
|
88
|
+
- A phase closes **done** when its tasks are `- [x]` and its validation passed **or** was deferred (SQL handoff). Possible state: **"done — SQL pending application"**.
|
|
89
|
+
- All phases done → final *structured-choice* (content: `Marcar plan done` / `Preguntar algo más`; flow: `Compactar`/`Cerrar`).
|
|
90
|
+
- **No automatic export**: the artifacts (`SCRIPTS.sql`, `DECISION`, …) stay in the session. Promoting them to `docs/` (scripts, manuals, …) is a separate step via `export-*`.
|
|
94
91
|
|
|
95
92
|
## Sequence
|
|
96
93
|
|
|
97
94
|
```
|
|
98
95
|
plan-exec-loop(PPP-plan-<slug>.md):
|
|
99
|
-
session = create_or_resume("<slug>-plan-exec") # <slug>
|
|
96
|
+
session = create_or_resume("<slug>-plan-exec") # <slug> from the plan-doc; ONE session per run; CLI prepends global NNN; CHECKPOINT, resume
|
|
100
97
|
plan = read(PPP-plan-<slug>.md)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
seed CHECKPOINT.Next = Phase N (Pending =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
re-
|
|
121
|
-
|
|
122
|
-
update CHECKPOINT (Completed += Phase N, Next = Phase N+1) #
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
structured_choice(
|
|
128
|
-
|
|
129
|
-
# NO export:
|
|
130
|
-
finalize: CHECKPOINT (+ BACKLOG
|
|
98
|
+
for each Phase in plan (in order, respecting deps):
|
|
99
|
+
if Phase done (all its Tasks - [x] in the plan): skip # resume via plan-doc checkboxes
|
|
100
|
+
seed CHECKPOINT.Next = Phase N (Pending = its Tasks) # BEFORE starting the phase: seed the intent (artifact-first)
|
|
101
|
+
for each Task of the Phase:
|
|
102
|
+
if Task - [x] in the plan: skip # intra-phase resume by checkbox
|
|
103
|
+
verify each source's expected branch (branch-check)
|
|
104
|
+
on mismatch → pause + resolve with the human
|
|
105
|
+
execute Task:
|
|
106
|
+
edit code in the sources (minimal change)
|
|
107
|
+
if it creates a tool/utility → the ambient creating-tools skill documents it in docs/tools
|
|
108
|
+
if read-only DB query → SCRIPTS.sql + execute read-only
|
|
109
|
+
if DB change (DDL/DML) → draft in SCRIPTS.sql (session artifact, DO NOT execute)
|
|
110
|
+
if non-obvious decision → DECISION (tagged by phase/task, in the SINGLE DECISION)
|
|
111
|
+
if doubt/gap → inline research OR structured-choice # chassis
|
|
112
|
+
mark Task - [x] + state IN THE PLAN # AFTER completing the Task (the plan-doc is the per-task source of truth)
|
|
113
|
+
phase validation:
|
|
114
|
+
what runs and fails → back to the task
|
|
115
|
+
what depends on an unapplied migration → defer (Open questions + BACKLOG)
|
|
116
|
+
closing review gate (pre-commit): # Delta 5: CHECKPOINT.Next = "review phase N"
|
|
117
|
+
INDEPENDENT re-read of the phase diff + installed ambient conventions
|
|
118
|
+
findings → fix (and re-validate the phase) OR defer justified (Open questions + BACKLOG)
|
|
119
|
+
update CHECKPOINT (Completed += Phase N, Next = Phase N+1) # AFTER: Pending→Completed + Next = next phase (see artifact-first cycle)
|
|
120
|
+
propose commit(s) per source (approve first) # never push/amend/--no-verify; only after the gate is green
|
|
121
|
+
if rejected → changes stay; record "phase uncommitted"
|
|
122
|
+
next-phase precondition: working tree clean or acknowledged
|
|
123
|
+
final validation (whatever can run; the SQL-dependent part stays as a handoff)
|
|
124
|
+
structured_choice(content: [Marcar plan done, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
125
|
+
mark plan done (or "done — SQL pending application")
|
|
126
|
+
# NO export: artifacts stay in the session; a separate export-* promotes them
|
|
127
|
+
finalize: CHECKPOINT (+ BACKLOG if something is deferred) + close session + report
|
|
131
128
|
```
|
|
132
129
|
|
|
133
130
|
## Convergence / exit
|
|
134
131
|
|
|
135
|
-
- Plan
|
|
136
|
-
- `Cerrar` (
|
|
137
|
-
-
|
|
132
|
+
- Plan complete + validation OK (or deferred with a handoff) + **every phase passed its closing review gate** before committing → `Marcar plan done`.
|
|
133
|
+
- `Cerrar` (`flow` control, at any time) → `finalize` persists `CHECKPOINT` (and `BACKLOG` only if something remained unexecuted / uncommitted / unapplied), closes the session, reports.
|
|
134
|
+
- Promoting artifacts to `docs/` (via `export-*`) is **always** a later, explicit step outside this loop.
|