@tacuchi/agent-workflow-cli 15.2.0 → 16.1.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/dist/application/templates/session.js +1 -1
- package/package.json +1 -1
- package/skills/w/README.md +14 -14
- package/skills/w/SKILL.md +94 -82
- package/skills/w/artifacts/README.md +1 -1
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +15 -13
- package/skills/w/artifacts/artifacts-core/SESSION.md +1 -1
- package/skills/w/artifacts/artifacts-core/TASKS.md +1 -1
- 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 +103 -98
- 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 -77
- package/skills/w/loops/plan-new-loop/SKILL.md +80 -80
- package/skills/w/loops/plan-refine-loop/SKILL.md +62 -62
- package/skills/w/loops/quick-loop/SKILL.md +79 -79
- package/skills/w/loops/spec-refine-loop/SKILL.md +93 -94
- 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,123 +1,123 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-refine-loop
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
PLACE —
|
|
6
|
-
(loops/CHASSIS.md). Deltas:
|
|
7
|
-
|
|
8
|
-
gating),
|
|
9
|
-
UI.
|
|
10
|
-
|
|
4
|
+
Refines an existing plan (docs/plans/PPP-plan-<slug>.md) by editing it IN
|
|
5
|
+
PLACE — an auxiliary, NOT mandatory step before plan-exec. Heir of the
|
|
6
|
+
chassis (loops/CHASSIS.md). Deltas: reuses plan-new-loop's gap taxonomy and
|
|
7
|
+
coherence gate, adds Refinement decisions / Q&A traceability (trace, no
|
|
8
|
+
gating), and produces/updates design SPECs via ui-design when the refine
|
|
9
|
+
touches UI. Started by /w:plan-refine; resumable and re-runnable on demand.
|
|
10
|
+
Invoke when an already generated plan must be adjusted before executing it.
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# plan-refine-loop
|
|
14
14
|
|
|
15
|
-
> **Heir**
|
|
15
|
+
> **Heir** of the common chassis — **only** the PLAN-refine deltas live here. The engine is never repeated.
|
|
16
16
|
|
|
17
|
-
> **
|
|
17
|
+
> **Relation to the other PLAN loops:** `plan-new-loop` **generates** the plan from the spec; `plan-refine-loop` **refines it in place** (optional); `plan-exec-loop` **executes it**. plan-refine is to plan-new what spec-refine is to spec-new.
|
|
18
18
|
|
|
19
19
|
## Flow
|
|
20
20
|
PLAN
|
|
21
21
|
|
|
22
22
|
## Layer
|
|
23
|
-
2 —
|
|
23
|
+
2 — the AI runs it end to end.
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
`plan-exec`
|
|
25
|
+
## Auxiliary / NOT mandatory
|
|
26
|
+
`plan-exec` runs **any** plan, refined or not — there is **no** gate requiring plan-refine. This loop exists to incorporate changes (new requirements, scope adjustments, deps/risks spotted on re-read) **before** executing, without regenerating the plan from scratch.
|
|
27
27
|
|
|
28
28
|
## Started by
|
|
29
|
-
`/w:plan-refine` — **
|
|
29
|
+
`/w:plan-refine` — **resumable** (same chassis mechanism, keyed off CHECKPOINT) and **re-runnable on demand** (see *Compact / resume*).
|
|
30
30
|
|
|
31
31
|
## Reads
|
|
32
|
-
`docs/plans/PPP-plan-*.md` (glob —
|
|
32
|
+
`docs/plans/PPP-plan-*.md` (glob — locates the plan by number; or the exact path from the command argument). **Always the plan itself**: this loop edits it in place; there is no separate "refined" file.
|
|
33
33
|
|
|
34
34
|
## Writes
|
|
35
|
-
|
|
35
|
+
Updates `docs/plans/PPP-plan-<slug>.md` **in place** (when the user picks `Guardar plan refinado`): completes/adjusts sections and **adds** `## Refinement decisions` + `## Q&A traceability`. Since it overwrites an existing doc, it asks the user's **confirmation**. It writes only `docs/plans` — never other `docs/` folders, no auto-export. If the refine **touches UI**, it also produces/updates **design SPECs** (`NNN-SPEC-<SLUG>.md`) as artifacts **of its own session** (see *Delta 4* — they are not `docs/`, no auto-export).
|
|
36
36
|
|
|
37
37
|
## Inherits
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **always before** these deltas. *(If `../` does not resolve: `CHASSIS.md` next to this file — global layout rule, chassis § Reference resolution.)*
|
|
40
40
|
|
|
41
|
-
## Internal sessions —
|
|
41
|
+
## Internal sessions — PLAN-refine instance
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Full doctrine in the chassis (§ *Internal sessions* + *Numbering*). This loop's instance:
|
|
44
44
|
|
|
45
45
|
| Session | When | Artifacts | Role |
|
|
46
46
|
|---|---|---|---|
|
|
47
|
-
| **refine session** `NNN-<slug>-plan-refine/` |
|
|
47
|
+
| **refine session** `NNN-<slug>-plan-refine/` | when the loop starts (or resumes/reopens) | `SESSION.md` · `CHECKPOINT.md` (· `BACKLOG.md` only if something is deferred) | Owns the run. Type = `refine`; descriptor `<slug>-plan-refine` (the `<slug>` comes from the input plan). |
|
|
48
48
|
|
|
49
|
-
## Delta 1 — Deliverable:
|
|
49
|
+
## Delta 1 — Deliverable: the PLAN, edited in place
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
The plan uses the **same skeleton** [`plan-new-loop`](../plan-new-loop/SKILL.md) produces (§ *Delta 1 — RICH PLAN*: `Summary`/`Solution`/`Impacted`/`Phases`/`Tasks`/`Validations`/`Final behavior`/… with `(core)` sections always and `(opt.)` by complexity). plan-refine does **not** change the schema: it **completes/adjusts** the existing sections **in place** and **adds** two trace sections:
|
|
52
52
|
|
|
53
53
|
```markdown
|
|
54
|
-
## Refinement decisions ← NEW (
|
|
55
|
-
|
|
56
|
-
deps/
|
|
57
|
-
|
|
54
|
+
## Refinement decisions ← NEW (ADDED)
|
|
55
|
+
What was adjusted while refining and why (new requirements, scope changes,
|
|
56
|
+
deps/risks). Includes what inline research resolved (ref to the session's
|
|
57
|
+
CONCLUSIONS).
|
|
58
58
|
|
|
59
|
-
## Q&A traceability ← NEW (
|
|
60
|
-
|
|
59
|
+
## Q&A traceability ← NEW (ADDED)
|
|
60
|
+
Every doubt asked to the human + the chosen answer.
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
> **
|
|
63
|
+
> **No gating contract** (unlike spec↔plan): the presence of `## Refinement decisions`/`## Q&A traceability` in the plan is **audit trace only** — `plan-exec` neither requires nor checks it (it runs any plan). It serves to (a) distinguish a re-refined plan from a freshly generated one on resume, and (b) record what changed and why.
|
|
64
64
|
|
|
65
|
-
>
|
|
65
|
+
> The plan **never mutates by execution** (plan-exec tracks that in the plan-doc's Tasks) — only by a (re-)refine.
|
|
66
66
|
|
|
67
|
-
## Delta 2 — Gap taxonomy (
|
|
67
|
+
## Delta 2 — Gap taxonomy (of "plan")
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
Reuses plan-new-loop's gap taxonomy **in full** ([`plan-new-loop`](../plan-new-loop/SKILL.md) § *Delta 2*): vague Approach/Solution, components unidentified, AS-IS wiring unknown, phase too large, task not atomic, missing deps, spec criteria uncovered, unaddressed risks, UI without design SPEC. **Focus difference:** plan-new **builds** the plan from scratch; plan-refine **detects what changed** against the written plan (or against the spec, if the spec was re-refined) and closes **those** gaps — typically fewer and more localized. One extra re-refine gap:
|
|
70
70
|
|
|
71
71
|
| Gap | Signal | Resolved by |
|
|
72
72
|
|---|---|---|
|
|
73
|
-
|
|
|
73
|
+
| Plan↔spec drift | the spec was re-refined and the plan fell out of line | **research** (re-reads the spec) / **human** |
|
|
74
74
|
|
|
75
75
|
## Delta 3 — What research investigates here
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Same as plan-new (maps code/impact: FE/BE/DB components, AS-IS wiring, deps), but **scoped to the delta**: it re-verifies only what the change touches (never re-maps the whole plan). Chassis DB rule unchanged (read-only into `SCRIPTS.sql`, MCP via a question when >1 without default).
|
|
78
78
|
|
|
79
|
-
## Delta 4 — Design SPECs (
|
|
79
|
+
## Delta 4 — Design SPECs (when the refine touches UI)
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Same mechanism as [`plan-new-loop`](../plan-new-loop/SKILL.md) (§ *Delta 4*: the **`ui-design`** capability → per-screen `NNN-SPEC-<SLUG>.md`, see [`SPEC.md`](../../artifacts/artifacts-design/SPEC.md)), **scoped to the delta**: only the screens **new or changed** by the refine get a design SPEC. The updated SPEC is written in **plan-refine's own session** (each loop manages ITS session's artifacts — it never edits plan-new's) and the plan **re-points** the UI Task reference to the current SPEC. Untouched screens keep their original SPEC.
|
|
82
82
|
|
|
83
83
|
## Compact / resume
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Resume **keys off the `CHECKPOINT`** of the refine session, never a "refined" file. Three cases when `/w:plan-refine` runs over a plan:
|
|
86
86
|
|
|
87
|
-
1. **
|
|
88
|
-
2. **
|
|
89
|
-
3. **
|
|
90
|
-
- `create_or_resume`
|
|
91
|
-
-
|
|
87
|
+
1. **In progress** (a `CHECKPOINT.md` exists in the refine session) → resume from the recorded progress (resolved gaps, Q&A, `attempts`, in-flight inline research).
|
|
88
|
+
2. **No progress** (no CHECKPOINT and the plan does **not** have `Refinement decisions`/`Q&A traceability`) → start from zero reading the plan (`PPP-plan-*.md`).
|
|
89
|
+
3. **Already refined / re-refine on demand** (no open CHECKPOINT, but the plan **already has** the 2 sections) → **first-class operation**, as many times as needed while the flow stays in PLAN:
|
|
90
|
+
- `create_or_resume` finds the existing refine session (typically **closed** after convergence) by descriptor + `## Origin` and **reopens** it: `aw session-resume --code <NNN> --reopen` (detection: `aw sessions --state all`).
|
|
91
|
+
- Incremental re-refinement reading the **plan itself**; on `Guardar`, edits in place with confirmation.
|
|
92
92
|
|
|
93
|
-
> **
|
|
93
|
+
> **Inter-turn continuity** (chassis, row 2): a flow command opens a "new work line" (new session) — **except re-running the same flow over the same input** (same plan), which does `create_or_resume` (resumes/reopens instead of duplicating).
|
|
94
94
|
|
|
95
95
|
## Sequence
|
|
96
96
|
|
|
97
97
|
```
|
|
98
98
|
plan-refine-loop(plan):
|
|
99
|
-
input = glob(docs/plans/PPP-plan-*.md) |
|
|
100
|
-
session = create_or_resume("<slug>-plan-refine")
|
|
101
|
-
seed SESSION.Success criteria =
|
|
102
|
-
work = read(plan) (+
|
|
103
|
-
repeat:
|
|
104
|
-
gaps = detect_gaps(work) (
|
|
99
|
+
input = glob(docs/plans/PPP-plan-*.md) | argument path # always the plan itself (in place)
|
|
100
|
+
session = create_or_resume("<slug>-plan-refine") # reopens if it exists (see Compact / resume)
|
|
101
|
+
seed SESSION.Success criteria = coherence-gate checklist # verification-first, BEFORE
|
|
102
|
+
work = read(plan) (+ the spec if realignment is needed; + checkpoint progress if resuming)
|
|
103
|
+
repeat: # chassis engine
|
|
104
|
+
gaps = detect_gaps(work) (plan-new taxonomy + plan↔spec drift) minus the exhausted ones
|
|
105
105
|
if gaps == ∅: break
|
|
106
|
-
batch ≤3 →
|
|
107
|
-
research (
|
|
108
|
-
ui-design (Delta 4,
|
|
109
|
-
|
|
110
|
-
coherence gate (read-only) = Success criteria
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
structured_choice(
|
|
115
|
-
Guardar → edit in place (
|
|
116
|
-
finalize: CHECKPOINT
|
|
106
|
+
batch ≤3 → seed CHECKPOINT.Pending/Next → resolve each gap:
|
|
107
|
+
research (scoped to the delta — Delta 3) · human (structured-choice) ·
|
|
108
|
+
ui-design (Delta 4, only new/changed screens)
|
|
109
|
+
integrate + update CHECKPOINT # artifact-first cycle
|
|
110
|
+
coherence gate (read-only) = Success criteria green:
|
|
111
|
+
- plan-new checklist (criterion→task · Final behavior · XS–S/XS · deps · Impacted↔Solution · UI→current SPEC)
|
|
112
|
+
- re-refine's own check: the plan is REALIGNED with what changed
|
|
113
|
+
whatever fails → comes back as a gap
|
|
114
|
+
structured_choice(content: [Guardar plan refinado, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
115
|
+
Guardar → edit in place (with confirmation) + insert/update Refinement decisions + Q&A traceability
|
|
116
|
+
finalize: CHECKPOINT persisted (+ BACKLOG only if something is deferred) + close session + report
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## Convergence / exit
|
|
120
120
|
|
|
121
|
-
- **
|
|
122
|
-
-
|
|
123
|
-
- `Cerrar`
|
|
121
|
+
- **No material gaps** → **coherence gate** (the *Sequence* checklist; plan-new's gate + the re-refine's own realignment check).
|
|
122
|
+
- Passes → `Guardar plan refinado` (edits in place with confirmation) → `finalize`.
|
|
123
|
+
- `Cerrar` at any time → `finalize` (persists `CHECKPOINT`; `BACKLOG` only if something is deferred; closes the session, reports).
|
|
@@ -1,123 +1,123 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quick-loop
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
prompt
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
The agent-workflow lightweight shortcut: solves a scoped task (fix, small
|
|
5
|
+
tweak) straight from the prompt, with minimal ceremony and a single commit.
|
|
6
|
+
Heir of the chassis (loops/CHASSIS.md + CODE-POLICIES.md). Deltas: no
|
|
7
|
+
plan-doc (the prompt IS the task), single light session <slug>-quick, an
|
|
8
|
+
entry size gate and LIVE escalation to SPEC (to PLAN it stays deferred)
|
|
9
|
+
when the objective exceeds a quick or the task grows. Never touches docs/.
|
|
10
|
+
Started by /w:quick; resumable. Invoke for small, direct changes that do
|
|
11
|
+
not warrant a formal spec or plan.
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# quick-loop
|
|
15
15
|
|
|
16
|
-
> **Heir**
|
|
16
|
+
> **Heir** of the common chassis — **only** the QUICK deltas live here. The engine lives in the chassis and the *code-editing loop policies* in `CODE-POLICIES.md` — never repeated.
|
|
17
17
|
|
|
18
18
|
## Flow
|
|
19
19
|
QUICK
|
|
20
20
|
|
|
21
21
|
## Layer
|
|
22
|
-
2 —
|
|
22
|
+
2 — the AI runs it end to end (minimal loop).
|
|
23
23
|
|
|
24
24
|
## Started by
|
|
25
|
-
`/w:quick` — **
|
|
25
|
+
`/w:quick` — **resumable** (same chassis resume mechanism).
|
|
26
26
|
|
|
27
27
|
## Reads
|
|
28
|
-
— (
|
|
28
|
+
— (the user's prompt; there is no input document).
|
|
29
29
|
|
|
30
30
|
## Writes
|
|
31
|
-
- **Deliverable
|
|
32
|
-
-
|
|
33
|
-
- **
|
|
31
|
+
- **Deliverable per task:** edits code in the sources (minimal change) **or** produces a scoped **analysis/design** (non-code deliverable, lives in the session artifacts — never in `docs/`).
|
|
32
|
+
- Session artifacts under `.workflow/sessions/`.
|
|
33
|
+
- **NEVER touches `docs/`** (no doc, no auto-export). An analysis/design worth preserving is promoted separately (`export-*`) or escalated to SPEC/PLAN (SPEC: live — see *QUICK delta*).
|
|
34
34
|
|
|
35
35
|
## Internal session
|
|
36
36
|
|
|
37
|
-
- **
|
|
37
|
+
- **ALWAYS** creates a light session with descriptor `<slug>-quick` → `NNN-<slug>-quick` (Type = `quick`, ≈ `exec`): `SESSION` · `DECISION` · `SCRIPTS.sql` · `CHECKPOINT` (+ `BACKLOG` only if something is deferred). A single session. Research is **inline** inside it (`ANALYSIS-FILE`/`CONCLUSIONS` + read-only `SCRIPTS.sql` in its folder). The caller passes only the descriptor; the CLI prepends the global sequential `NNN` (see chassis). **Exception:** if the entry **size gate** escalates to SPEC, the quick run never comes to exist — no quick session is created; the session is the `spec-refine-loop` one.
|
|
38
38
|
|
|
39
39
|
## Inherits
|
|
40
40
|
|
|
41
|
-
|
|
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.)*
|
|
42
42
|
|
|
43
43
|
## Composes
|
|
44
44
|
|
|
45
|
-
`git` · `sql` (
|
|
45
|
+
`git` · `sql` (DB rule) · `research` (inline). Resolved via `.workflow/skills.toml`.
|
|
46
46
|
|
|
47
|
-
> **
|
|
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).
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## QUICK delta — minimal ceremony
|
|
50
50
|
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
53
|
-
- **Git
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
- **Anti-
|
|
60
|
-
- **
|
|
61
|
-
1. **
|
|
62
|
-
2. **
|
|
63
|
-
3.
|
|
64
|
-
- **
|
|
65
|
-
1.
|
|
66
|
-
2.
|
|
67
|
-
3.
|
|
68
|
-
4. **SPEC
|
|
51
|
+
- **No phases, no plan-doc**: the prompt **is** the task (a single unit). No roadmap.
|
|
52
|
+
- **Proportional verification-first** (minimal ceremony): even here the check is **seeded before**, sized to the task. Code: one test (bug repro → fix) or "existing build/lint/tests stay green" (chore). **Analysis/design**: a **short falsifiable rubric**, *ratified by the user* before pursuing it. It is the run's `SESSION.Success criteria` (see [chassis § *Verification-first*](../CHASSIS.md)).
|
|
53
|
+
- **Git and DB inline** (full policies in [`../CODE-POLICIES.md`](../CODE-POLICIES.md)): before editing, verify each source's expected branch (`aw check-branch`); **proposed** commit (approve first) — never `push`/`--amend`/`--no-verify`. The AI **never executes DML/DDL**: migrations are drafted into the session's `SCRIPTS.sql` (read-only queries do run, via MCP).
|
|
54
|
+
- **One session. One commit** proposed at the end (only if there were code changes), **after the proportional closing review gate** ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate*): diff re-read + ambient conventions; fix or defer; nothing reaches the commit unreviewed.
|
|
55
|
+
- **Entry SIZE GATE** (before creating the session): on receiving the objective, evaluate whether it **exceeds a quick**. It fires **only on clear signals** (≥2 of: needs architecture · ≥2 sources · multiple deliverables · large feature/refactor · ambiguous requirements needing elicitation); borderline → **continue in quick without asking** (if it later grows, mid-loop escalation covers it). A **resume** of an existing quick does **not** re-fire the gate. If it fires → **structured-choice** (1 content question, recommendation first + `flow` control; `Cerrar` here = abort, nothing created yet):
|
|
56
|
+
- **`Cambiar a SPEC`** (recommended) → **no quick session is created**: run the *Live transition to SPEC* (next bullet).
|
|
57
|
+
- **`Seguir en quick`** → continue normally (`create_or_resume` + loop).
|
|
58
|
+
- **`Recortar alcance`** → the AI proposes the **sub-task that DOES fit** a quick; the loop continues with it (`SESSION.Objective` = the sub-task; the original prompt goes into the session's `## Origin`) and the rest is deferred to `BACKLOG` ("trimmed at the gate — may warrant its own spec, `/w:spec-new`").
|
|
59
|
+
- **Anti-duplicate** (the `create_or_resume` spirit): if a spec whose `## Origin` references this same objective already exists (or an equivalent `*-spec-refine` session), the recommended option becomes **resuming that spec** (`/w:spec-refine` semantics) — never a second draft.
|
|
60
|
+
- **Live transition to SPEC** (shared by the gate and mid-loop escalation). On acceptance, the work line **moves to the SPEC flow**: the explicit consent in the structured-choice **equals invoking the destination command** (*consented exception* — rule 3 of the *Continuity rule*, [`../../SKILL.md`](../../SKILL.md) § *Operating context*). On the SPEC side:
|
|
61
|
+
1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs`, slug, schema, single-pass **NO RESEARCH**. `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists).
|
|
62
|
+
2. **Load and execute** [`../spec-refine-loop/SKILL.md`](../spec-refine-loop/SKILL.md) — flattened: `../w-spec-refine-loop/SKILL.md` — over that spec (trampoline pattern).
|
|
63
|
+
3. The run's session is that loop's **normal** `NNN-<slug>-spec-refine` (the CLI numbers it; its `## Origin` records the escalation). **Invariant 2 intact**: quick, while it is quick, never writes `docs/` — the draft is written by the SPEC flow, post-consent.
|
|
64
|
+
- **Mid-loop escalation + handoff**: if the task grows (same gate signals) → propose moving up to **SPEC/PLAN** (structured-choice, recommendation first). If the user accepts:
|
|
65
|
+
1. The **already-edited code stays** in the working tree (never reverted) and is **recorded** in `CHECKPOINT` + `BACKLOG`: "uncommitted changes in `<source>` — decide commit/discard on resume" (the "rejected commit" pattern, [`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Safe git*).
|
|
66
|
+
2. The quick session goes to `finalize` with the **pointer** in `BACKLOG`: to **PLAN** → "escalated to `docs/plans/PPP` — resume there" (**deferred** as today: seed + pointer, no live entry); to **SPEC** → "escalated to `docs/specs/NNN` — **continued live** (session `NNN-<slug>-spec-refine`)".
|
|
67
|
+
3. The artifacts (`DECISION`, `SCRIPTS.sql`) **stay in the quick session** as referenceable context for the new session (never migrated).
|
|
68
|
+
4. **SPEC enters live**: after `finalize`, run the *Live transition to SPEC* (draft **only if no spec exists** for this objective; then the loop). **Asymmetry** intact: PLAN can **absorb** the progress (plan-exec picks up the existing working tree); SPEC **restarts** the design cycle and treats the half-done code as context/reference, never as ingested work.
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## Continuity across prompts (operating context)
|
|
71
71
|
|
|
72
|
-
`quick`
|
|
72
|
+
`quick` is where the **continuity rule** ([`../../SKILL.md`](../../SKILL.md) § *Operating context*) shows most clearly. Inside a workspace:
|
|
73
73
|
|
|
74
|
-
1. `/w:quick "
|
|
75
|
-
2. `"
|
|
76
|
-
3. `/w:quick "
|
|
74
|
+
1. `/w:quick "first prompt"` (**command**) → creates session `NNN-<slug>-quick`, starts the loop. Scripts go to **its** `SCRIPTS.sql`.
|
|
75
|
+
2. `"second prompt"` (**no command**, related work) → does **not** create another session: **continues/reopens the most recent one** (from step 1) and appends the new scripts to **that same** `SCRIPTS.sql`.
|
|
76
|
+
3. `/w:quick "third prompt"` (**command** again) → **new** session, new loop.
|
|
77
77
|
|
|
78
|
-
>
|
|
78
|
+
> The **command** signals "new work line"; a **bare prompt** means "same line" → by default continue/reopen the most recent session (the *last started*). Clearly unrelated → offer choosing (`continuar NNN` | `trabajo nuevo`) or fall to the **no-flow** branch (write into `docs/` by convention + numbering). No workspace → **vanilla** behavior.
|
|
79
79
|
|
|
80
80
|
## Sequence
|
|
81
81
|
|
|
82
82
|
```
|
|
83
83
|
quick-loop(prompt):
|
|
84
|
-
# GATE
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
structured_choice(
|
|
88
|
-
flow: [Compactar, Cerrar]) # Cerrar
|
|
89
|
-
Cambiar a SPEC →
|
|
90
|
-
|
|
91
|
-
Recortar alcance →
|
|
92
|
-
Seguir en quick →
|
|
93
|
-
s = create_or_resume("<slug>-quick") # CLI
|
|
94
|
-
seed SESSION.Objective =
|
|
95
|
-
seed SESSION.Success criteria =
|
|
96
|
-
seed CHECKPOINT.Pending/Next =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
convergence gate: Success criteria
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
structured_choice(
|
|
114
|
-
finalize: CHECKPOINT (
|
|
84
|
+
# SIZE GATE — BEFORE creating a session; new work lines only (a resume does not re-fire it)
|
|
85
|
+
if the objective exceeds a quick (≥2 clear signals — see delta):
|
|
86
|
+
if a spec / spec-refine session for this objective already exists → recommend RESUMING it (/w:spec-refine) # anti-duplicate
|
|
87
|
+
structured_choice(content: [Cambiar a SPEC (recommended), Seguir en quick, Recortar alcance],
|
|
88
|
+
flow: [Compactar, Cerrar]) # Cerrar here = abort (nothing created yet)
|
|
89
|
+
Cambiar a SPEC → live transition (see delta): draft (spec-new procedure) +
|
|
90
|
+
load and execute ../spec-refine-loop/SKILL.md → END (no quick session)
|
|
91
|
+
Recortar alcance → objective = the proposed sub-task; the rest → BACKLOG when the session is created
|
|
92
|
+
Seguir en quick → continue
|
|
93
|
+
s = create_or_resume("<slug>-quick") # CLI prepends global NNN; always a light session
|
|
94
|
+
seed SESSION.Objective = the prompt
|
|
95
|
+
seed SESSION.Success criteria = the deliverable's check # verification-first, BEFORE: test(s) if code · short RATIFIED rubric if analysis/design
|
|
96
|
+
seed CHECKPOINT.Pending/Next = the task (s) # BEFORE: seed the intent (artifact-first)
|
|
97
|
+
work the task (minimal loop):
|
|
98
|
+
if it edits code → verify each source's expected branch (`aw check-branch`); mismatch → pause + resolve
|
|
99
|
+
produce the deliverable: edit code (minimal change) OR author the analysis/design
|
|
100
|
+
if read-only DB query → SCRIPTS.sql + execute read-only
|
|
101
|
+
if DB change (DDL/DML) → SCRIPTS.sql (session artifact, DO NOT execute)
|
|
102
|
+
if non-obvious decision → DECISION
|
|
103
|
+
if doubt/gap → inline research OR structured-choice # chassis
|
|
104
|
+
if the task GROWS → propose escalating to SPEC/PLAN # structured-choice, recommendation first
|
|
105
|
+
accepts PLAN → handoff (progress stays; BACKLOG→seeded plan — resume there, deferred) → goto finalize
|
|
106
|
+
accepts SPEC → handoff (progress stays; BACKLOG→"continued live") → finalize →
|
|
107
|
+
live transition (see delta): draft if missing + spec-refine-loop
|
|
108
|
+
convergence gate: Success criteria green # tests green if code · rubric satisfied if analysis/design
|
|
109
|
+
if there were code changes:
|
|
110
|
+
closing review gate (proportional): # diff re-read + installed ambient conventions
|
|
111
|
+
findings → fix (re-validate) OR defer justified (BACKLOG)
|
|
112
|
+
propose commit (approve first) # never push/amend/--no-verify; only after the gate
|
|
113
|
+
structured_choice(content: [Cerrar tarea, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
114
|
+
finalize: CHECKPOINT (AFTER: Pending→Completed) + BACKLOG (only if something is deferred) + close session + report
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
## Convergence / exit
|
|
118
118
|
|
|
119
|
-
- **Success criteria
|
|
120
|
-
- `Cerrar`/`Compactar` (
|
|
121
|
-
- **
|
|
119
|
+
- **Success criteria green** (proportional) + closing review gate passed and commit proposed if there was code (or skipping it approved) → `Cerrar`.
|
|
120
|
+
- `Cerrar`/`Compactar` (`flow` control) → persists `CHECKPOINT` + `BACKLOG` (resumable).
|
|
121
|
+
- **No export**: nothing goes to `docs/`. Anything worth preserving → promoted separately via `export-*`, or escalated (to SPEC **live** — the line continues in spec-refine already as SPEC flow; to PLAN **deferred**, seed + pointer).
|
|
122
122
|
|
|
123
|
-
>
|
|
123
|
+
> QUICK's *convergence gate* is **proportional verification-first**: a **short** `Success criteria` seeded at start (not the *absence* of a checklist — its minimal version) — for code, "the change does what the prompt asked + tests/build green"; for analysis/design, a short ratified rubric. Minimal ceremony by design, but **always with the check declared first**.
|