@tacuchi/agent-workflow-cli 20.17.0 → 20.21.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/README.md +23 -2
- package/dist/application/parsers/phases.js +135 -0
- package/dist/application/parsers/phases.js.map +1 -0
- package/dist/application/status-service.js +66 -2
- package/dist/application/status-service.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +9 -7
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +3 -1
- package/skills/w/artifacts/artifacts-exec/DECISION.md +2 -0
- package/skills/w/commands/README.md +1 -1
- package/skills/w/commands/plan-exec.md +6 -3
- package/skills/w/commands/plan-new.md +7 -3
- package/skills/w/commands/plan-refine.md +5 -2
- package/skills/w/commands/resume.md +8 -6
- package/skills/w/commands/spec-new.md +53 -15
- package/skills/w/commands/spec-refine.md +7 -6
- package/skills/w/commands/status.md +10 -5
- package/skills/w/loops/CHASSIS.md +3 -3
- package/skills/w/loops/CODE-POLICIES.md +2 -0
- package/skills/w/loops/plan-exec-loop/LOOP.md +97 -36
- package/skills/w/loops/plan-new-loop/LOOP.md +63 -11
- package/skills/w/loops/plan-refine-loop/LOOP.md +89 -21
- package/skills/w/loops/quick-loop/LOOP.md +1 -1
- package/skills/w/loops/spec-refine-loop/LOOP.md +140 -60
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ npm install -g @tacuchi/agent-workflow-cli
|
|
|
15
15
|
Workline has three layers plus a permanent `docs/` zone:
|
|
16
16
|
|
|
17
17
|
- **Layer 1 · Commands** (`/w:*`) — the only thing the user invokes:
|
|
18
|
-
- **SPEC** — `/w:spec-new` (single-pass draft; may split into sibling specs) → `/w:spec-refine` (gap-driven loop) → `docs/specs/`.
|
|
19
|
-
- **PLAN** — `/w:plan-new` → (`/w:plan-refine` — aux, optional) → `/w:plan-exec` → `docs/plans/` (the plan loops may split into sibling plans).
|
|
18
|
+
- **SPEC** — `/w:spec-new` (single-pass draft after a bounded reconnaissance of the sources; may split into sibling specs) → `/w:spec-refine` (gap-driven loop; converges at `status: ready-for-plan` — the blocking functional decisions closed, the technical ones declared for PLAN) → `docs/specs/`.
|
|
19
|
+
- **PLAN** — `/w:plan-new` → (`/w:plan-refine` — aux, optional) → `/w:plan-exec` → `docs/plans/` (the plan loops may split into sibling plans). A plan is a sequence of **functional states**: every phase names a verifiable state, carries its own primary proof, and declares where a temporary simulation lives and when it retires — ticking every checkbox is not validation.
|
|
20
20
|
- **QUICK** — `/w:quick` — lightweight shortcut; escalates live to SPEC when the goal outgrows a quick.
|
|
21
21
|
- **EXPORTS** — `/w:export-scripts` · `export-manuals` · `export-diagrams` · `export-reports` (the only path that promotes artifacts to `docs/`).
|
|
22
22
|
- **Bootstrap** — `/w:workspace-init` turns any folder into a workspace (1+ sources; no project/hub distinction).
|
|
@@ -28,6 +28,27 @@ Workline has three layers plus a permanent `docs/` zone:
|
|
|
28
28
|
|
|
29
29
|
**Invariants.** No auto-export (only `export-*` writes `docs/`); the spec and plan are documents, not artifacts; DB scripts-only (never executes DML/DDL); git-safe (verifies the per-source working branch before edits; proposes commits).
|
|
30
30
|
|
|
31
|
+
### PLAN — a plan is a sequence of functional states
|
|
32
|
+
|
|
33
|
+
A `### Fn` phase is a **verifiable state of the system**, not a batch of technical tasks. It answers one question: *what can the system do or demonstrate at the end that it could not at the start?* The contract is defined **once** in `skills/w/loops/plan-new-loop/LOOP.md` (§ *Phase contract*); the other two plan loops reference it and never redefine it.
|
|
34
|
+
|
|
35
|
+
- **Phase shape** — always `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida`; conditionally `Estado inicial`, `Recorrido afectado`, `Límite de simulación`, `Diferido` and `Dependencias`. Granularity is semantic: a task is a unit of purpose that may touch several files, never an edit operation ("create class X").
|
|
36
|
+
- **Phase state** — one `> Estado:` line per phase (`pendiente` | `en ejecución` | `bloqueada` | `validada`), machine state that `aw status` parses. A phase reaches `validada` only with its proof green, its exit condition true and the closing review gate passed — **never** because its checkboxes are ticked.
|
|
37
|
+
- **Temporary simulation** — planned with a lifecycle: where it is born, how it moves (`antes → después`), which phase retires it, and what prevents it from being selected in a production runtime. A stub still live on the main path with no declared removal is a review finding.
|
|
38
|
+
- **Evidence** — one primary proof per phase; focused tests only where a layer owns rules, transformation, persistence or integration; risk tests on top of those. Tests that only mirror structure are flagged `overtest` at the closing review gate.
|
|
39
|
+
|
|
40
|
+
The authoring side and the execution side share one gate, seen from both ends:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
plan-new ──┐
|
|
44
|
+
├──▶ executability gate ──▶ plan-exec ──▶ phase cycle ──▶ validada
|
|
45
|
+
plan-refine ┘ │
|
|
46
|
+
├─ structural deviation ─▶ plan-refine
|
|
47
|
+
└─ functional change ────▶ spec-refine
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`plan-refine` converges when the plan is executable; `plan-exec` re-checks that same shape on entry, normalizes only minor gaps with consent, and returns the work instead of redesigning it silently. Progress is reported on **two** axes: `progress_pct` (checkbox-derived, unchanged) and `phases_validated`/`phases_total`. A plan at 100% of checkboxes with zero validated phases is work implemented, not validated — and both `/w:status` and `/w:resume` say so.
|
|
51
|
+
|
|
31
52
|
## Bundled SKILL
|
|
32
53
|
|
|
33
54
|
The published tarball bundles the universal skill set under `skills/w/`. Install it into your host with `--target` (required):
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export const PHASE_STATES = ["pendiente", "en ejecución", "bloqueada", "validada"];
|
|
2
|
+
const HEADING_RE = /^(#{1,6})\s+(\S.*)$/;
|
|
3
|
+
const PHASE_NAME_RE = /^F(\d+)\s*(?:[—–-]\s*)?(.*)$/;
|
|
4
|
+
const STATE_RE = /^>\s*Estado\s*:\s*(.+)$/i;
|
|
5
|
+
const FENCE_RE = /^(`{3,}|~{3,})/;
|
|
6
|
+
const TASKS_SECTION = "tasks";
|
|
7
|
+
/**
|
|
8
|
+
* Phase progress of a plan-doc: the `### Fn` blocks of its `## Tasks` section
|
|
9
|
+
* plus the first `> Estado:` line inside each one. A block ends at the next
|
|
10
|
+
* heading of level ≤3; the section ends at the next level-2 heading.
|
|
11
|
+
*
|
|
12
|
+
* `## Tasks` is the ONLY source of phases: an `### Fn` quoted in `## Solution`,
|
|
13
|
+
* one left before or after the section, a fenced example and the plan-level
|
|
14
|
+
* `> Estado: done — …` line under the title all read as what they are — not
|
|
15
|
+
* phases. A plan with no `## Tasks` reports zero phases and keeps measuring
|
|
16
|
+
* progress by checkboxes.
|
|
17
|
+
*
|
|
18
|
+
* A plan whose blocks declare no `> Estado:` line at all predates the phase
|
|
19
|
+
* contract: it also reports zero phases — its finished work must not read as
|
|
20
|
+
* "implemented, not validated". A missing line among stated blocks reads
|
|
21
|
+
* `pendiente`, and nothing is back-filled.
|
|
22
|
+
*
|
|
23
|
+
* The state is an exact value of the vocabulary once case, accents and inner
|
|
24
|
+
* spacing are folded. An absent, annotated (`validada — SQL pendiente de
|
|
25
|
+
* aplicar`) or unknown value degrades to `pendiente`: a phase is never counted
|
|
26
|
+
* as validated by deference. The reason for a stop lives in its own
|
|
27
|
+
* `> Bloqueo:` line, which this parser has no need to read.
|
|
28
|
+
*/
|
|
29
|
+
export function parsePhases(text) {
|
|
30
|
+
const scan = { items: [], current: null, stated: false, inTasks: false, anyStated: false };
|
|
31
|
+
for (const line of visibleLines(text)) {
|
|
32
|
+
const heading = readHeading(line);
|
|
33
|
+
if (heading) {
|
|
34
|
+
applyHeading(scan, heading);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (scan.inTasks)
|
|
38
|
+
applyStateLine(scan, line);
|
|
39
|
+
}
|
|
40
|
+
if (!scan.anyStated)
|
|
41
|
+
return { total: 0, validated: 0, items: [] };
|
|
42
|
+
return {
|
|
43
|
+
total: scan.items.length,
|
|
44
|
+
validated: scan.items.filter((p) => p.state === "validada").length,
|
|
45
|
+
items: scan.items,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Trimmed lines outside fenced blocks — a quoted example is never document content. */
|
|
49
|
+
function* visibleLines(text) {
|
|
50
|
+
let fence = null;
|
|
51
|
+
for (const raw of text.split("\n")) {
|
|
52
|
+
const line = raw.trim();
|
|
53
|
+
const marker = FENCE_RE.exec(line)?.[1] ?? null;
|
|
54
|
+
if (fence === null) {
|
|
55
|
+
if (marker) {
|
|
56
|
+
fence = marker;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
yield line;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (marker && closesFence(fence, marker, line))
|
|
63
|
+
fence = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** CommonMark closing fence: same character, at least as long, the bare marker alone. */
|
|
67
|
+
function closesFence(open, marker, line) {
|
|
68
|
+
return marker[0] === open[0] && marker.length >= open.length && line === marker;
|
|
69
|
+
}
|
|
70
|
+
function readHeading(line) {
|
|
71
|
+
const match = HEADING_RE.exec(line);
|
|
72
|
+
if (!match?.[1] || !match[2])
|
|
73
|
+
return null;
|
|
74
|
+
return { level: match[1].length, name: match[2].trim() };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Section and block boundaries. A level-2 heading enters or leaves `## Tasks`;
|
|
78
|
+
* a level-3 one opens a phase or closes the previous block; a deeper one is a
|
|
79
|
+
* subsection of the phase in force and leaves it open.
|
|
80
|
+
*/
|
|
81
|
+
function applyHeading(scan, heading) {
|
|
82
|
+
if (heading.level > 3)
|
|
83
|
+
return;
|
|
84
|
+
scan.current = null;
|
|
85
|
+
if (heading.level <= 2) {
|
|
86
|
+
scan.inTasks = heading.level === 2 && isTasksHeading(heading.name);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!scan.inTasks)
|
|
90
|
+
return;
|
|
91
|
+
const phase = readPhaseHeading(heading.name);
|
|
92
|
+
if (!phase)
|
|
93
|
+
return;
|
|
94
|
+
scan.items.push(phase);
|
|
95
|
+
scan.current = phase;
|
|
96
|
+
scan.stated = false;
|
|
97
|
+
}
|
|
98
|
+
/** Tolerates the template annotations on the heading: `## Tasks (core)`, `## Tasks:`. */
|
|
99
|
+
function isTasksHeading(name) {
|
|
100
|
+
const bare = name.replace(/\s*\([^)]*\)\s*:?\s*$/, "").replace(/:\s*$/, "");
|
|
101
|
+
return fold(bare) === TASKS_SECTION;
|
|
102
|
+
}
|
|
103
|
+
function readPhaseHeading(name) {
|
|
104
|
+
const match = PHASE_NAME_RE.exec(name);
|
|
105
|
+
if (!match?.[1])
|
|
106
|
+
return null;
|
|
107
|
+
return { n: Number(match[1]), name: (match[2] ?? "").trim(), state: "pendiente" };
|
|
108
|
+
}
|
|
109
|
+
function applyStateLine(scan, line) {
|
|
110
|
+
const current = scan.current;
|
|
111
|
+
if (!current || scan.stated)
|
|
112
|
+
return;
|
|
113
|
+
// `**` tolerated: authors bold the label (`> **Estado:** validada`).
|
|
114
|
+
const match = STATE_RE.exec(line.replace(/\*/g, ""));
|
|
115
|
+
if (!match?.[1])
|
|
116
|
+
return;
|
|
117
|
+
current.state = normalizeState(match[1]);
|
|
118
|
+
scan.stated = true;
|
|
119
|
+
scan.anyStated = true;
|
|
120
|
+
}
|
|
121
|
+
/** Case- and accent-insensitive: `en ejecucion` is the same mark as `en ejecución`. */
|
|
122
|
+
function fold(value) {
|
|
123
|
+
return value.trim().toLowerCase().normalize("NFD").replace(/\p{M}/gu, "").replace(/\s+/g, " ");
|
|
124
|
+
}
|
|
125
|
+
const STATES_BY_FOLDED = new Map(PHASE_STATES.map((state) => [fold(state), state]));
|
|
126
|
+
/**
|
|
127
|
+
* The value IS the state — nothing else may ride on the machine line. An
|
|
128
|
+
* annotated `validada — SQL pendiente de aplicar` declares a pending delivery,
|
|
129
|
+
* not a demonstrated result: it degrades to `pendiente` like any other
|
|
130
|
+
* unrecognized value, and the phase belongs in `bloqueada`.
|
|
131
|
+
*/
|
|
132
|
+
function normalizeState(raw) {
|
|
133
|
+
return STATES_BY_FOLDED.get(fold(raw)) ?? "pendiente";
|
|
134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
|
|
|
2
2
|
import { localDateIso } from "./dates.js";
|
|
3
3
|
import { humanizeRelativeEs } from "./humanize-es.js";
|
|
4
4
|
import { firstNonEmptyLine, parseMdSection } from "./markdown.js";
|
|
5
|
+
import { parsePhases } from "./parsers/phases.js";
|
|
5
6
|
import { parseProjectBlock } from "./parsers/project-block.js";
|
|
6
7
|
import { parseTasks } from "./parsers/tasks.js";
|
|
7
8
|
import { findArtifact } from "./session-artifacts.js";
|
|
8
9
|
import { SessionsService } from "./sessions-service.js";
|
|
10
|
+
const SPEC_STATUSES = ["draft", "refining", "ready-for-plan"];
|
|
9
11
|
/**
|
|
10
12
|
* Read-only whole-workspace status aggregator. Never throws on a reachable cwd:
|
|
11
13
|
* an uninitialized workspace returns `initialized:false` with empty collections;
|
|
@@ -65,13 +67,14 @@ async function readSpecs(fs, cwd, now) {
|
|
|
65
67
|
for (const f of deduped) {
|
|
66
68
|
try {
|
|
67
69
|
const text = await fs.readText(f.path);
|
|
68
|
-
const
|
|
70
|
+
const status = resolveSpecStatus(text);
|
|
69
71
|
const ts = await resolveTimestamp(fs, f.path, undefined, now);
|
|
70
72
|
out.push({
|
|
71
73
|
file: relFromCwd(f.path, cwd),
|
|
72
74
|
number: f.number,
|
|
73
75
|
slug: f.slug,
|
|
74
|
-
|
|
76
|
+
status,
|
|
77
|
+
refined: status === "ready-for-plan",
|
|
75
78
|
open_questions: countOpenQuestions(text),
|
|
76
79
|
date: ts.date,
|
|
77
80
|
relative: ts.relative,
|
|
@@ -83,6 +86,64 @@ async function readSpecs(fs, cwd, now) {
|
|
|
83
86
|
}
|
|
84
87
|
return sortByNumber(out);
|
|
85
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* The only two trace sections that marked a spec as worked-through before the
|
|
91
|
+
* frontmatter `status` existed. `## Decisions` is NOT one of them: it belongs
|
|
92
|
+
* to the current spec schema and proves nothing about the refine gate.
|
|
93
|
+
*
|
|
94
|
+
* Exported so the doctrine guard can check this list against the marks the
|
|
95
|
+
* bundle documents — the two drifted apart once, and a spec nobody refined
|
|
96
|
+
* reached PLAN because of it.
|
|
97
|
+
*/
|
|
98
|
+
export const LEGACY_READY_MARKS = ["Refinement decisions", "Q&A traceability"];
|
|
99
|
+
/**
|
|
100
|
+
* Spec maturity. A declared frontmatter governs alone: an empty, unknown or
|
|
101
|
+
* unterminated declaration reads `draft` — never a legacy inference, which
|
|
102
|
+
* would send work to PLAN on a gate `spec-refine` never ran. Legacy
|
|
103
|
+
* compatibility runs only on a spec that carries no frontmatter at all.
|
|
104
|
+
*/
|
|
105
|
+
function resolveSpecStatus(text) {
|
|
106
|
+
const frontmatter = parseSpecFrontmatter(text);
|
|
107
|
+
if (frontmatter.kind === "malformed")
|
|
108
|
+
return "draft";
|
|
109
|
+
if (frontmatter.kind === "present") {
|
|
110
|
+
const declared = (frontmatter.status ?? "").toLowerCase();
|
|
111
|
+
return isSpecStatus(declared) ? declared : "draft";
|
|
112
|
+
}
|
|
113
|
+
return hasLegacyReadyMark(text) ? "ready-for-plan" : "draft";
|
|
114
|
+
}
|
|
115
|
+
function hasLegacyReadyMark(text) {
|
|
116
|
+
return LEGACY_READY_MARKS.some((h) => parseMdSectionLoose(text, h) !== undefined);
|
|
117
|
+
}
|
|
118
|
+
function isSpecStatus(value) {
|
|
119
|
+
return SPEC_STATUSES.includes(value);
|
|
120
|
+
}
|
|
121
|
+
const FRONTMATTER_FENCE = "---";
|
|
122
|
+
const FRONTMATTER_ENTRY = /^([A-Za-z0-9_-]+):\s*(.*)$/;
|
|
123
|
+
/**
|
|
124
|
+
* Classify the `---` block at the top of the file and read its `status` scalar.
|
|
125
|
+
* Specs only carry flat scalars there, so this stays a few lines instead of
|
|
126
|
+
* pulling a YAML dependency into the CLI.
|
|
127
|
+
*/
|
|
128
|
+
function parseSpecFrontmatter(text) {
|
|
129
|
+
const lines = text.split(/\r?\n/);
|
|
130
|
+
if ((lines[0] ?? "").trim() !== FRONTMATTER_FENCE)
|
|
131
|
+
return { kind: "absent" };
|
|
132
|
+
const end = lines.findIndex((l, i) => i > 0 && l.trim() === FRONTMATTER_FENCE);
|
|
133
|
+
if (end === -1)
|
|
134
|
+
return { kind: "malformed" };
|
|
135
|
+
return { kind: "present", status: readScalar(lines.slice(1, end), "status") };
|
|
136
|
+
}
|
|
137
|
+
function readScalar(lines, key) {
|
|
138
|
+
for (const line of lines) {
|
|
139
|
+
const m = FRONTMATTER_ENTRY.exec(line);
|
|
140
|
+
if (m?.[1] !== key)
|
|
141
|
+
continue;
|
|
142
|
+
const value = (m[2] ?? "").trim().replace(/^["']|["']$/g, "");
|
|
143
|
+
return value.length > 0 ? value : undefined;
|
|
144
|
+
}
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
86
147
|
// ── plans ────────────────────────────────────────────────────────────────────
|
|
87
148
|
const PLAN_RE = /^(\d{3})-plan(?:-(.+))?\.md$/i;
|
|
88
149
|
async function readPlans(fs, cwd, now) {
|
|
@@ -93,6 +154,7 @@ async function readPlans(fs, cwd, now) {
|
|
|
93
154
|
try {
|
|
94
155
|
const text = await fs.readText(f.path);
|
|
95
156
|
const t = parseTasks(text);
|
|
157
|
+
const p = parsePhases(text);
|
|
96
158
|
const ts = await resolveTimestamp(fs, f.path, undefined, now);
|
|
97
159
|
out.push({
|
|
98
160
|
file: relFromCwd(f.path, cwd),
|
|
@@ -101,6 +163,8 @@ async function readPlans(fs, cwd, now) {
|
|
|
101
163
|
tasks_total: t.total,
|
|
102
164
|
tasks_done: t.closed,
|
|
103
165
|
progress_pct: t.progress_pct,
|
|
166
|
+
phases_total: p.total,
|
|
167
|
+
phases_validated: p.validated,
|
|
104
168
|
date: ts.date,
|
|
105
169
|
relative: ts.relative,
|
|
106
170
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-service.js","sourceRoot":"","sources":["../../src/application/status-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;A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-workflow-cli",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.21.0",
|
|
4
4
|
"description": "Runtime CLI for Workline — the stages + loops + artifacts system for agent work. Bundles the universal `w` skill set under `skills/w/` (slash commands `/w:*`: spec-new/spec-refine, plan-new/plan-exec, quick, persist, workspace-init, export-*); `self install --target <host>` copies SKILL + commands + hooks into the host. Pluggable capability skills via `.workflow/skills.toml`. Multi-empresa parametrization via `profile.json` cascade. Namespace auto-detected from any `.<ns>/sessions/` dir in CWD; default `workflow`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/skills/w/SKILL.md
CHANGED
|
@@ -65,11 +65,13 @@ USER invokes
|
|
|
65
65
|
| **PLAN** (the *how* + execute) | `plan-new` · `plan-refine` *(aux, optional)* · `plan-exec` | `docs/plans` | `plan-new-loop` · `plan-refine-loop` · `plan-exec-loop` |
|
|
66
66
|
| **QUICK** (lightweight shortcut) | `quick` | — | `quick-loop` |
|
|
67
67
|
|
|
68
|
-
Typical chain: prompt → `spec-new` generates `docs/specs/NNN-spec-<slug>.md` → `spec-refine` runs the loop and refines **that same spec in place** → `plan-new` → `docs/plans/PPP-plan-<slug>.md` → *(optional)* `plan-refine` adjusts **that same plan in place** if changes arise before executing → `plan-exec` executes and updates the plan (living doc) + artifacts in sessions. Promoting anything else to `docs/` is **always** a separate step via `export-*`.
|
|
68
|
+
Typical chain: prompt → `spec-new` generates `docs/specs/NNN-spec-<slug>.md` → `spec-refine` runs the loop and refines **that same spec in place** until PLAN can design without inventing behavior, stamping `status: ready-for-plan` → `plan-new` → `docs/plans/PPP-plan-<slug>.md` → *(optional)* `plan-refine` adjusts **that same plan in place** if changes arise before executing → `plan-exec` executes and updates the plan (living doc) + artifacts in sessions. Promoting anything else to `docs/` is **always** a separate step via `export-*`.
|
|
69
|
+
|
|
70
|
+
> **A plan is a sequence of functional states.** Every `### Fn` phase names a verifiable state of the system, carries its own primary proof, and — **only when the change carries one** — declares where a temporary simulation lives and when it retires. Its `> Estado:` line (`pendiente` | `en ejecución` | `bloqueada` | `validada`) is machine state that `aw status` counts **alongside** the checkbox progress: ticking every checkbox is **not** validation, and neither is a proof nobody ran — a phase whose check could not be executed stays `bloqueada` until it runs and passes. Execution runs those states without redesigning them — a structural deviation returns to `plan-refine`, a functional one to `spec-refine`.
|
|
69
71
|
|
|
70
72
|
QUICK can **escalate live to SPEC** when the objective exceeds a quick (entry size gate) or the task grows mid-loop: with consent via structured-choice, the work line moves to the SPEC flow (draft via the `spec-new` procedure + `spec-refine-loop` directly); escalation to PLAN stays **deferred** (seed + pointer). See `loops/quick-loop/LOOP.md` § *QUICK delta*.
|
|
71
73
|
|
|
72
|
-
Both authoring entry points can **split** with consent: `spec-new` may split a multi-part prompt into **sibling specs** (its split gate — one structured-choice before writing anything), and the plan loops may split a plan into independently deliverable **sibling plans** (`plan-new-loop` § *Split gate (multi-plan)*; plan-refine adds the in-place semantics). Siblings cross-reference **by path**; a split stays inside the same work line — it is not an escalation.
|
|
74
|
+
Both authoring entry points can **split** with consent: `spec-new` may split a multi-part prompt into **sibling specs** (its split gate — one structured-choice before writing anything, decided **after** its bounded reconnaissance of the sources), and the plan loops may split a plan into independently deliverable **sibling plans** (`plan-new-loop` § *Split gate (multi-plan)*; plan-refine adds the in-place semantics). Siblings cross-reference **by path**; a split stays inside the same work line — it is not an escalation. The cut follows the **independent functional outcome**: distinct repos or technologies are evidence, never the reason.
|
|
73
75
|
|
|
74
76
|
### Operating context — where everything lands
|
|
75
77
|
|
|
@@ -100,11 +102,11 @@ The flows are **composable with host-native work, never exclusive**. The host is
|
|
|
100
102
|
### The commands (`/w:` namespace)
|
|
101
103
|
|
|
102
104
|
- `/w:workspace-init` — initializes the workspace.
|
|
103
|
-
- `/w:spec-new` — generates an initial spec (single-pass, no loop).
|
|
104
|
-
- `/w:spec-refine` — starts `spec-refine-loop` to refine the spec.
|
|
105
|
-
- `/w:plan-new` — starts `plan-new-loop` to derive an executable plan from the
|
|
106
|
-
- `/w:plan-refine` — starts `plan-refine-loop` to
|
|
107
|
-
- `/w:plan-exec` — starts `plan-exec-loop` to execute and maintain the plan.
|
|
105
|
+
- `/w:spec-new` — generates an initial spec (single-pass, no loop; a bounded reconnaissance of the sources precedes the scope decision).
|
|
106
|
+
- `/w:spec-refine` — starts `spec-refine-loop` to refine the spec until it is `ready-for-plan`: the blocking functional decisions closed, the architecture/implementation ones declared for PLAN.
|
|
107
|
+
- `/w:plan-new` — starts `plan-new-loop` to derive an executable plan from the ready spec.
|
|
108
|
+
- `/w:plan-refine` — starts `plan-refine-loop` to turn the plan, in place, into an executable sequence of functional states (auxiliary, **not mandatory**); it is also the return path when execution hits a structural deviation.
|
|
109
|
+
- `/w:plan-exec` — starts `plan-exec-loop` to execute the planned states and maintain the plan: it validates each phase before closing it, and never silently redesigns what it was given.
|
|
108
110
|
- `/w:quick` — starts `quick-loop` (shortcut, no `docs/`; escalates live to SPEC when the objective exceeds a quick).
|
|
109
111
|
- `/w:export-scripts` · `/w:export-manuals` · `/w:export-diagrams` · `/w:export-reports` — promote artifacts to `docs/`.
|
|
110
112
|
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
## Completed
|
|
14
14
|
What already happened: finished phases/tasks/gaps with their outcome (ref: plan-doc `docs/plans/PPP-plan.md`, the spec's gaps, or `TASKS.md` if the session created its own split). Fold the key context a resume needs (settled decisions, discoveries) into these bullets.
|
|
15
15
|
|
|
16
|
+
> **Implemented is not validated (exec sessions).** A phase lands here only once the plan-doc's `> Estado: validada` was flipped. Work that is written but not yet proven stays in `Pending / Next` with its validation pending — a full set of ticked tasks never promotes a phase into this section. Each closed phase records the **functional state reached** and, **only when the change carries one**, the **simulation boundary in force** — that, not the list of files touched, is what a resume actually needs.
|
|
17
|
+
|
|
16
18
|
## Pending / Next
|
|
17
|
-
The intent: what remains and what comes immediately next (seeded BEFORE executing — artifact-first). A resume starts here.
|
|
19
|
+
The intent: what remains and what comes immediately next (seeded BEFORE executing — artifact-first). A resume starts here. In exec: the next functional state being pursued, plus any blocker or deferral that keeps a phase out of `validada`. A phase left `bloqueada` states here **what is missing to validate it** — applying the migration, an environment, a third party — so the next run knows what to execute before flipping the state.
|
|
18
20
|
|
|
19
21
|
## Open questions
|
|
20
22
|
Live doubts not yet resolved — the section exists only while there are any (rule 1). Deferred ones move to the session's `BACKLOG` or the flow doc's `## Open questions`.
|
|
@@ -9,3 +9,5 @@ Reference work unit (per the owning loop):
|
|
|
9
9
|
|
|
10
10
|
## Decision
|
|
11
11
|
Non-obvious decisions. For each: the decision taken, the reason, and the alternatives considered.
|
|
12
|
+
|
|
13
|
+
> **Local decisions only.** This log records what execution legitimately resolved on its own (naming, a local helper, internal code layout, a refactor that does not move the journey). A **structural deviation** is not settled with an entry here — a changed input or output, observable state, public contract, set of participating components, phase order, simulation boundary or integration strategy **stops execution** and returns to `plan-refine`; a functional change returns to `spec-refine`. See [`plan-exec-loop`](../../loops/plan-exec-loop/LOOP.md) § *Deviation gate*.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|---|---|---|
|
|
17
17
|
| [`workspace-init`](workspace-init.md) | Workspace bootstrap | single-pass, interactive |
|
|
18
18
|
| [`spec-new`](spec-new.md) | Generates the spec draft (`docs/specs/NNN-spec-<slug>.md`) | single-pass, no loop |
|
|
19
|
-
| [`spec-refine`](spec-refine.md) | Refines the spec **in place** until
|
|
19
|
+
| [`spec-refine`](spec-refine.md) | Refines the spec **in place** until it is `ready-for-plan` | starts `spec-refine-loop` |
|
|
20
20
|
| [`plan-new`](plan-new.md) | Derives the executable plan (`docs/plans/PPP-plan-<slug>.md`) from the spec | starts `plan-new-loop` |
|
|
21
21
|
| [`plan-refine`](plan-refine.md) | Refines the plan **in place** before executing (aux, optional) | starts `plan-refine-loop` |
|
|
22
22
|
| [`plan-exec`](plan-exec.md) | Executes the plan (code/DB/git) and maintains it as a living doc | starts `plan-exec-loop` |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use when a plan is ready to implement — this is where the real work happens: code edits, proposed SQL scripts, created tools. Starts or resumes the execution loop (plan-exec-loop) over an existing plan. Git-safe (proposes commits, never push/--amend/--no-verify). Not for creating or refining the plan (plan-new / plan-refine).
|
|
2
|
+
description: Use when a plan is ready to implement — this is where the real work happens: code edits, proposed SQL scripts, created tools. Starts or resumes the execution loop (plan-exec-loop) over an existing plan, phase by phase, validating each phase before closing it. Checks executability on entry; structural or functional deviations return to plan-refine / spec-refine. Git-safe (proposes commits, never push/--amend/--no-verify). Not for creating or refining the plan (plan-new / plan-refine).
|
|
3
3
|
argument-hint: <docs/plans/PPP-plan-<slug>.md>
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
@@ -12,7 +12,7 @@ allowed-tools:
|
|
|
12
12
|
|
|
13
13
|
# plan-exec — trampoline to the execution loop
|
|
14
14
|
|
|
15
|
-
Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase by phase. The plan (`docs/plans/PPP-plan-<slug>.md`) is a living document the loop keeps updated (
|
|
15
|
+
Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase by phase — each phase a **verifiable state of the system**, not a batch of technical chores. The plan (`docs/plans/PPP-plan-<slug>.md`) is a living document the loop keeps updated: each `### Fn` carries its own `> Estado:` line (`pendiente` | `en ejecución` | `bloqueada` | `validada`) next to its task checkboxes.
|
|
16
16
|
|
|
17
17
|
> **Hard floor — applies even if you read nothing beyond this file:**
|
|
18
18
|
>
|
|
@@ -32,7 +32,10 @@ Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase
|
|
|
32
32
|
|
|
33
33
|
## What the loop does (summary)
|
|
34
34
|
|
|
35
|
-
-
|
|
35
|
+
- **Executability check on entry**: reads the plan **and its spec** and verifies each phase declares its result, its exit condition and its proof, and — **only when the change carries temporary behavior** — that its simulation boundary and retirement phase are identifiable. A minor gap is normalized **with your consent** (`Normalizar y ejecutar` | `Ir a plan-refine`); a structural one is recorded and handed off to `/w:plan-refine` — it never invents the plan's structure (see `../loops/plan-exec-loop/LOOP.md` § *Entry gate — executability*).
|
|
36
|
+
- **Deviation gate**: local detail (a name, a helper, internal layout) is resolved inline. A **structural** deviation — a contract, the participating components, the phase order, the simulation boundary — stops execution and returns to `/w:plan-refine`; a **functional** change (result, scope, business rule, acceptance criterion) returns to `/w:spec-refine` (§ *Deviation gate*).
|
|
37
|
+
- **Validation before closing each phase**: the phase's own proof plus the justified focused tests run first; the phase flips to `validada` only with the exit condition true and the review gate green — **never** just because its checkboxes are ticked (§ *Delta 4*). A proof that **cannot be run** (a migration nobody applied yet) leaves the phase `bloqueada`, with its reason on a `> Bloqueo:` line: the work stays ticked, the plan stays open, and the state only becomes `validada` once that proof runs and passes.
|
|
38
|
+
- Reads and updates `docs/plans/PPP-plan-<slug>.md` (living doc: phase state, task checkboxes, deferrals).
|
|
36
39
|
- Edits code in the workspace sources (a single execution session per run; execution is still phase by phase, there is just no session per phase).
|
|
37
40
|
- If it creates a tool/utility, the ambient `creating-tools` skill documents it in `docs/tools/` (auto-discovered; Workline does not bind it).
|
|
38
41
|
- **Closing review gate** at every phase boundary, **before proposing the commits**: re-reads the diff (independent pass) applying the **installed ambient conventions** and fixes or defers findings — nothing reaches a commit unreviewed (see `../loops/plan-exec-loop/LOOP.md` § *Delta 5*).
|
|
@@ -25,14 +25,14 @@ SPEC → PLAN bridge. Turns the "what" (refined spec) into the "how" (plan). Del
|
|
|
25
25
|
|
|
26
26
|
The skill evaluates `$ARGUMENTS` (specs live in place — `docs/specs/NNN-spec-<slug>.md`; locate via the `docs/specs/NNN-spec-*.md` glob or the exact path):
|
|
27
27
|
|
|
28
|
-
1. **
|
|
29
|
-
2. **
|
|
28
|
+
1. **Ready spec** (`docs/specs/NNN-spec-<slug>.md` whose frontmatter declares `status: ready-for-plan`) → ideal. Proceed straight to `plan-new-loop`.
|
|
29
|
+
2. **Spec not ready** (`status: draft` / `refining`, or no mark at all) → **soft-suggest** running `/w:spec-refine` first; planning over a solid spec produces better plans. It is a suggestion, **never a block**: the user may proceed. Questions the spec left with destination `PLAN` are this flow's **input**, not a reason to send it back.
|
|
30
30
|
3. **prompt** (no spec referenced) → propose using the SPEC flow; **by default launch `/w:spec-new`** with that prompt to create the draft, and continue the natural flow from there.
|
|
31
31
|
4. **External plan content** — the argument/conversation carries an **already-built plan** (host plan mode output, hand-written, another agent's) → **adopt it**. Single pass, **NO RESEARCH**: materialize as `docs/plans/PPP-plan-<slug>.md` (`aw next-number docs/plans`), normalized to the rich-plan schema (`../loops/plan-new-loop/LOOP.md` § *Delta 1*) with only what the source provides. `## Origin` = "adopted from <source>" + attribution (host · model · date). Then offer `/w:plan-refine` (closes schema gaps) or `/w:plan-exec`. Anti-duplicate: a plan whose `## Origin` matches this objective → recommend resuming it, never a second one. Adoption **never regenerates over** an existing plan-doc.
|
|
32
32
|
|
|
33
33
|
> **Mode 3 vs 4:** a prompt that *describes a wish* → SPEC (mode 3); content that *already is a plan* → adopt (mode 4). Doctrine: `../loops/CHASSIS.md` § *Adopted context*.
|
|
34
34
|
|
|
35
|
-
> **
|
|
35
|
+
> **Ready vs not** is read from the spec's frontmatter `status`, never from the filename (there is no `-refined` anymore). **Legacy compat:** a spec with no frontmatter that carries `## Refinement decisions` — or the older `## Q&A traceability` — counts as ready the same way.
|
|
36
36
|
|
|
37
37
|
## Run the loop
|
|
38
38
|
|
|
@@ -43,6 +43,10 @@ The skill evaluates `$ARGUMENTS` (specs live in place — `docs/specs/NNN-spec-<
|
|
|
43
43
|
|
|
44
44
|
> Do not try `Skill: plan-new-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
|
|
45
45
|
|
|
46
|
+
## Phases are functional states
|
|
47
|
+
|
|
48
|
+
The plan is born with `### Fn` phases that each leave a **verifiable state of the system** — each with its `> Estado:` line, its primary evidence and its exit condition — never a list of files, classes or layers. Contract: `../loops/plan-new-loop/LOOP.md` § *Phase contract (canonical)*.
|
|
49
|
+
|
|
46
50
|
## Numbering notes
|
|
47
51
|
|
|
48
52
|
The plan is named `docs/plans/PPP-plan-<slug>.md`. `aw next-number docs/plans` returns JSON (field `next` = `PPP`); the loop builds the full name (slug = short kebab-case from the Requirement: `[a-z0-9-]`, ≤ ~5 words / ≤ 40 chars). It does **not inherit the spec's `NNN`**. The link to the spec is established by reference (`## Origin` / "Derived from") in the plan, never by number.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use when
|
|
2
|
+
description: Use when a plan must become executable before running it — new requirements, scope tweaks, phases shaped as file lists, or a structural deviation returned by plan-exec. Not to generate one (plan-new) nor execute it (plan-exec). Starts or resumes plan-refine-loop, which re-shapes the plan in place into a sequence of verifiable functional states. Input: a docs/plans/PPP-plan-<slug>.md — from plan-new, hand-written or adopted. May extract tranches into sibling plans.
|
|
3
3
|
argument-hint: <docs/plans/PPP-plan-<slug>.md>
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
@@ -23,7 +23,7 @@ This command does not refine the plan itself: it delegates to `plan-refine-loop`
|
|
|
23
23
|
> 3. **Write boundary** — this flow edits only `docs/plans/…` (in place, with confirmation); nothing else lands in `docs/`.
|
|
24
24
|
> 4. **Language** — everything user-facing (questions, option labels, the plan's content) goes in the **user's language**.
|
|
25
25
|
|
|
26
|
-
> **Not mandatory.** `plan-exec` runs **any** plan, refined or not — no gate requires passing through here. Use it
|
|
26
|
+
> **Not mandatory.** `plan-exec` runs **any** plan that is already executable, refined or not — no gate requires passing through here. Use it when the plan needs adjustments before executing, or when execution cannot start without inventing structure.
|
|
27
27
|
>
|
|
28
28
|
> **Spec-less plans (hand-written / adopted).** A plan with no source spec is legitimate input. The coherence gate **degrades gracefully**: criteria trace to the plan's own Final behavior block (in `## Solution`) / acceptance criteria instead of spec criteria — the "spec criteria uncovered" gap does not apply (see `../loops/plan-refine-loop/LOOP.md`).
|
|
29
29
|
|
|
@@ -33,6 +33,9 @@ The skill evaluates `$ARGUMENTS` (plans live in place — `docs/plans/PPP-plan-<
|
|
|
33
33
|
|
|
34
34
|
1. **Existing plan** (`docs/plans/PPP-plan-<slug>.md`) → proceed to `plan-refine-loop` — **regardless of provenance**: generated by `plan-new`, hand-written, or adopted from a host planner (existence is the only requirement).
|
|
35
35
|
2. **No plan** (the arg references no plan, or none exists) → **soft-suggest** running `/w:plan-new` first (there is nothing to refine yet); the user decides.
|
|
36
|
+
3. **Returned by `plan-exec`** (its entry check found the plan unexecutable, or execution stopped on a structural deviation) → proceed to `plan-refine-loop` carrying that finding: phases already `validada` stay, only pending work is re-designed (see `../loops/plan-refine-loop/LOOP.md` § *Replanning executed work*).
|
|
37
|
+
|
|
38
|
+
> **Expected output: an executable plan.** The loop converges on its **executability gate** — each phase a verifiable state with its evidence, its exit condition and, **only when the change carries temporary behavior**, its simulation boundary — so `plan-exec` implements it without inventing contracts, observable states, order or evidence.
|
|
36
39
|
|
|
37
40
|
## Run the loop
|
|
38
41
|
|
|
@@ -35,21 +35,23 @@ Same hard floor: this mode **proposes** the route — it never starts the target
|
|
|
35
35
|
## Run
|
|
36
36
|
|
|
37
37
|
1. **Workline level — compose `/w:status`.** Read-and-follow [`status.md`](status.md) to produce the prioritized summary (it already renders `aw status` and, when available, the host-context section). Do **not** re-implement the summary. For deeper session detail, `aw resume-summary [--include-recent-closed]` gives the primary session's CHECKPOINT state, and `aw session-resume --code <NNN>` the full checkpoint of any other active or closed session.
|
|
38
|
-
2. **Interpret the stage marks.** Map each signal to its stage: spec `
|
|
39
|
-
3. **Build the prioritized pending list** — fixed order: **session with CHECKPOINT > plan half-done > spec
|
|
38
|
+
2. **Interpret the stage marks.** Map each signal to its stage: the spec's `status` (`draft`/`refining` = SPEC work still open · `ready-for-plan` = it can go to PLAN) + `open_questions`; plan progress on **both axes** — checkboxes (`tasks_done` / `tasks_total`) and validated phases (`phases_validated` / `phases_total`); session `checkpoint_present`. A `status` that is absent, empty or unknown reads `draft`: that work stays in SPEC and never routes to PLAN on an unreadable mark. Associate a session to its plan or spec by **slug** — there is no linkage field in the `aw status` output, so infer it from `folder` / `slug`; when precision matters, confirm by the session's `## Origin` (§ *Directed resume*).
|
|
39
|
+
3. **Build the prioritized pending list** — fixed order: **session with CHECKPOINT > plan half-done > spec not ready > host context**.
|
|
40
40
|
4. **Host level (second source).** If the workline level does not explain the pending work (or no Workline flow was used), rely on the host-context already surfaced by `/w:status`; escalate it to a proposal and, only if needed, use the host-memory *deep* tier or ask the user (universal fallback: git / `docs/` signals + a question). See [`../harness/HARNESS.md`](../harness/HARNESS.md) § *host-memory*.
|
|
41
41
|
5. **Propose (only when ≥1 pending).** One structured-choice with the top ≤3 options by the priority order; each option **routes** to its command (table below). Every proposal carries `Retomar` (recommended) and `Descartar` / `Cerrar` (secondary).
|
|
42
42
|
6. **Nothing pending.** Show the `/w:status` summary and state clearly that there is nothing pending — **do not ask**.
|
|
43
43
|
|
|
44
44
|
## Routing (stage → command)
|
|
45
45
|
|
|
46
|
-
Priority: **session+CHECKPOINT > plan half-done > spec
|
|
46
|
+
Priority: **session+CHECKPOINT > plan half-done > spec not ready > host context**.
|
|
47
|
+
|
|
48
|
+
> **Every box ticked is not a finished plan.** A plan with `phases_validated` below `phases_total` still has functional state to reach — work implemented, not validated — so it counts as half-done and routes to `/w:plan-exec`, which re-enters at the first phase that is not `validada`. A phase left `bloqueada` routes the same way: `/w:plan-exec` re-enters **through it** to run the validation still pending, and the plan stays open until that phase reads `validada`. A plan with `phases_total: 0` is a legacy plan (no phase marks) and is judged by its checkboxes alone.
|
|
47
49
|
|
|
48
50
|
| Pending detected | `Retomar` (recommended) | Secondary |
|
|
49
51
|
|---|---|---|
|
|
50
|
-
| spec
|
|
51
|
-
| spec
|
|
52
|
-
| plan half-done
|
|
52
|
+
| spec not ready (`draft` / `refining`, or a `status` absent or unreadable) | `/w:spec-refine` | `Descartar` |
|
|
53
|
+
| spec `ready-for-plan`, no plan | `/w:plan-new` | `Descartar` |
|
|
54
|
+
| plan half-done — open checkboxes **or** phases not `validada` | `/w:plan-exec` | `Cerrar` |
|
|
53
55
|
| active session with CHECKPOINT | continue / reopen (`aw session-resume --reopen`) | `Cerrar` |
|
|
54
56
|
| host context only (no workline) | best next step for what was found | `Descartar` |
|
|
55
57
|
|