@tacuchi/agent-workflow-cli 20.23.0 → 20.25.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.
Files changed (137) hide show
  1. package/README.md +34 -11
  2. package/dist/application/context/budget-service.js +128 -0
  3. package/dist/application/context/budget-service.js.map +1 -0
  4. package/dist/application/context/bundle-root.js +41 -0
  5. package/dist/application/context/bundle-root.js.map +1 -0
  6. package/dist/application/context/manifest.js +150 -0
  7. package/dist/application/context/manifest.js.map +1 -0
  8. package/dist/application/context/measure.js +227 -0
  9. package/dist/application/context/measure.js.map +1 -0
  10. package/dist/application/context/plan-service.js +177 -0
  11. package/dist/application/context/plan-service.js.map +1 -0
  12. package/dist/application/dev-only-services.js +17 -14
  13. package/dist/application/dev-only-services.js.map +1 -1
  14. package/dist/application/mcp-host-reader.js +3 -1
  15. package/dist/application/mcp-host-reader.js.map +1 -1
  16. package/dist/application/mcp-host-writer.js +86 -41
  17. package/dist/application/mcp-host-writer.js.map +1 -1
  18. package/dist/application/plugin-doctor/hooks.js +7 -1
  19. package/dist/application/plugin-doctor/hooks.js.map +1 -1
  20. package/dist/application/self/bootstrap.js +30 -16
  21. package/dist/application/self/bootstrap.js.map +1 -1
  22. package/dist/application/self/clean-legacy.js +5 -0
  23. package/dist/application/self/clean-legacy.js.map +1 -1
  24. package/dist/application/self/detect-hosts.js +31 -45
  25. package/dist/application/self/detect-hosts.js.map +1 -1
  26. package/dist/application/self/doctor-self.js +7 -2
  27. package/dist/application/self/doctor-self.js.map +1 -1
  28. package/dist/application/self/hooks-toml.js +232 -0
  29. package/dist/application/self/hooks-toml.js.map +1 -0
  30. package/dist/application/self/host-states.js +290 -0
  31. package/dist/application/self/host-states.js.map +1 -0
  32. package/dist/application/self/install-hooks.js +98 -4
  33. package/dist/application/self/install-hooks.js.map +1 -1
  34. package/dist/application/self/install-skill.js +28 -16
  35. package/dist/application/self/install-skill.js.map +1 -1
  36. package/dist/application/self/install-targets.js +23 -0
  37. package/dist/application/self/install-targets.js.map +1 -1
  38. package/dist/application/self/mcp-config.js +13 -19
  39. package/dist/application/self/mcp-config.js.map +1 -1
  40. package/dist/application/self/skills-manager.js +9 -0
  41. package/dist/application/self/skills-manager.js.map +1 -1
  42. package/dist/application/self/uninstall.js +162 -26
  43. package/dist/application/self/uninstall.js.map +1 -1
  44. package/dist/cli/commands/context-budget.js +79 -0
  45. package/dist/cli/commands/context-budget.js.map +1 -0
  46. package/dist/cli/commands/context-plan.js +75 -0
  47. package/dist/cli/commands/context-plan.js.map +1 -0
  48. package/dist/cli/commands/dev-only.js +4 -1
  49. package/dist/cli/commands/dev-only.js.map +1 -1
  50. package/dist/cli/commands/index.js +4 -0
  51. package/dist/cli/commands/index.js.map +1 -1
  52. package/dist/cli/commands/mcp.js +16 -8
  53. package/dist/cli/commands/mcp.js.map +1 -1
  54. package/dist/cli/help-groups.js +4 -0
  55. package/dist/cli/help-groups.js.map +1 -1
  56. package/dist/cli/parser.js +4 -0
  57. package/dist/cli/parser.js.map +1 -1
  58. package/dist/cli/tui/components/host-admin-section.js +69 -60
  59. package/dist/cli/tui/components/host-admin-section.js.map +1 -1
  60. package/dist/cli/tui/data/workflow-content.js +6 -0
  61. package/dist/cli/tui/data/workflow-content.js.map +1 -1
  62. package/dist/cli/tui/hosts.js +39 -17
  63. package/dist/cli/tui/hosts.js.map +1 -1
  64. package/dist/cli/tui/tabs/config-tab.js +3 -3
  65. package/dist/cli/tui/tabs/config-tab.js.map +1 -1
  66. package/dist/cli/tui/tabs/mcp-tab-helpers.js +7 -1
  67. package/dist/cli/tui/tabs/mcp-tab-helpers.js.map +1 -1
  68. package/dist/cli/tui/tabs/mcp-tab.js +32 -10
  69. package/dist/cli/tui/tabs/mcp-tab.js.map +1 -1
  70. package/dist/cli/tui/tabs/skills-tab.js +13 -4
  71. package/dist/cli/tui/tabs/skills-tab.js.map +1 -1
  72. package/dist/cli/tui/tabs/status-tab.js +11 -17
  73. package/dist/cli/tui/tabs/status-tab.js.map +1 -1
  74. package/dist/cli/tui/tabs/workflow-tab.js +7 -3
  75. package/dist/cli/tui/tabs/workflow-tab.js.map +1 -1
  76. package/dist/cli/tui/tui-prefs.js +7 -1
  77. package/dist/cli/tui/tui-prefs.js.map +1 -1
  78. package/dist/domain/harnesses.js +129 -0
  79. package/dist/domain/harnesses.js.map +1 -1
  80. package/dist/domain/host-verification.js +20 -0
  81. package/dist/domain/host-verification.js.map +1 -0
  82. package/package.json +3 -2
  83. package/skills/w/SKILL.md +2 -2
  84. package/skills/w/commands/export-diagrams.md +10 -27
  85. package/skills/w/commands/export-manuals.md +13 -29
  86. package/skills/w/commands/export-reports.md +11 -27
  87. package/skills/w/commands/export-scripts.md +12 -29
  88. package/skills/w/commands/fix-git.md +21 -32
  89. package/skills/w/commands/generate-launch.md +13 -32
  90. package/skills/w/commands/persist.md +8 -29
  91. package/skills/w/commands/plan-exec.md +14 -30
  92. package/skills/w/commands/plan-new.md +11 -38
  93. package/skills/w/commands/plan-refine.md +13 -41
  94. package/skills/w/commands/quick.md +13 -20
  95. package/skills/w/commands/resume.md +17 -33
  96. package/skills/w/commands/spec-new.md +28 -69
  97. package/skills/w/commands/spec-refine.md +12 -37
  98. package/skills/w/commands/status.md +12 -19
  99. package/skills/w/commands/workspace-init.md +13 -20
  100. package/skills/w/context/MANIFEST.json +486 -0
  101. package/skills/w/harness/HARNESS.md +24 -17
  102. package/skills/w/loops/CHASSIS.md +53 -104
  103. package/skills/w/loops/CODE-POLICIES.md +4 -9
  104. package/skills/w/loops/plan-exec-loop/LOOP.md +5 -12
  105. package/skills/w/loops/plan-new-loop/LOOP.md +8 -32
  106. package/skills/w/loops/plan-refine-loop/LOOP.md +8 -36
  107. package/skills/w/loops/quick-loop/LOOP.md +4 -10
  108. package/skills/w/loops/spec-refine-loop/LOOP.md +7 -49
  109. package/skills/w/modules/ADOPTED-CONTEXT.md +10 -0
  110. package/skills/w/modules/COMPACTION.md +13 -0
  111. package/skills/w/modules/DB-RESEARCH-RULE.md +11 -0
  112. package/skills/w/modules/DB-SCRIPTS-ONLY.md +12 -0
  113. package/skills/w/modules/EXEC-DB-POLICY.md +7 -0
  114. package/skills/w/modules/EXEC-PROBE-TASKS.md +11 -0
  115. package/skills/w/modules/IDEATION-GATE.md +16 -0
  116. package/skills/w/modules/INCREMENTAL-STRATEGY.md +7 -0
  117. package/skills/w/modules/LAUNCH-DETECTION.md +26 -0
  118. package/skills/w/modules/PERSIST-ROUTING.md +16 -0
  119. package/skills/w/modules/PLAN-DESIGN-SPECS.md +12 -0
  120. package/skills/w/modules/PLAN-INPUT.md +26 -0
  121. package/skills/w/modules/PLAN-MODE.md +26 -0
  122. package/skills/w/modules/PLAN-PROBE-TASKS.md +10 -0
  123. package/skills/w/modules/PLAN-REFINE-DESIGN-SPECS.md +7 -0
  124. package/skills/w/modules/PLAN-REFINE-KEYS.md +9 -0
  125. package/skills/w/modules/PLAN-REFINE-SPLIT.md +12 -0
  126. package/skills/w/modules/PLAN-SPLIT-GATE.md +14 -0
  127. package/skills/w/modules/PROBE.md +12 -0
  128. package/skills/w/modules/PROMPT-CONTINUITY.md +13 -0
  129. package/skills/w/modules/RECONNAISSANCE.md +48 -0
  130. package/skills/w/modules/REPLANNING.md +12 -0
  131. package/skills/w/modules/SESSION-NUMBERING.md +19 -0
  132. package/skills/w/modules/SIMULATION-LIFECYCLE.md +11 -0
  133. package/skills/w/modules/SPEC-CHANGE-SHAPE.md +37 -0
  134. package/skills/w/modules/SPEC-REFINE-KEYS.md +14 -0
  135. package/skills/w/modules/SPLIT-GATE.md +42 -0
  136. package/skills/w/modules/WORKSPACE-SCAFFOLD.md +28 -0
  137. package/skills/w/roles/ui-spec/ROLE.md +1 -1
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "(Re)generates the per-source launch scripts (.workflow/launch/<alias>/ launch.json + run.sh + run.ps1) by detecting each source's stack and launch mode (interactive TUI vs server). Idempotent: pristine files regenerate, hand-edited ones are preserved (--force overwrites). Confirms the mode/command via structured-choice when it matters. Backed by `aw generate-launch --format human`. Transversal command (not a flow); no session, never touches docs/."
2
+ description: "Use when the launch artifacts under `.workflow/launch/<alias>/` must be built or refreshed a new start script, or a launch that runs the wrong way. Backed by `aw generate-launch`. Transversal, never writes `docs/`."
3
3
  argument-hint: "[--source <alias>] [--mode interactive|server] [--command <cmd>] [--force] [--dry-run]"
4
4
  allowed-tools:
5
5
  [
@@ -10,41 +10,22 @@ allowed-tools:
10
10
 
11
11
  # generate-launch — (re)generate source launch scripts (transversal)
12
12
 
13
- Single-pass, **no loop, no session**, **never writes `docs/`**. **Transversal** command (belongs to no SPEC / PLAN / QUICK flow). Everything user-facing (questions, summary) goes in the **user's language**.
14
-
15
- Rebuilds the launch artifacts the local-run flow uses (`.workflow/launch/<alias>/`). They are normally born on demand at the first launch; this command lets you build or refresh them explicitly — after adding a start script, changing `.env` profiles, or to fix a launch that runs the wrong way.
13
+ Single-pass, no loop, no session, **never writes `docs/`**. **Transversal** (no flow). User-facing text in the **user's language**. Rebuilds `.workflow/launch/<alias>/` (launch.json + run.sh + run.ps1), otherwise born on demand at first launch.
16
14
 
17
15
  ## Run
18
16
 
19
- 1. **Detect** — run `aw generate-launch --dry-run [--source <alias>]` to get, per source: `stack`, `launchable`, the detected `run` command, and the launch `mode` (`interactive` | `server`).
20
- 2. **Confirm the launch (structured-choice)** — for each **launchable** source, confirm how it should run via *structured-choice* (recommended = the detected mode). Options:
21
- - **Interactive** — the app owns the terminal (foreground, real TTY). Required by TUIs / REPLs / interactive CLIs.
22
- - **Server** — background + log window (monitor live, close-to-stop). For dev servers and long-running services.
23
- - **Custom command** — the user provides the exact run command (optional).
24
-
25
- Batch the questions; skip when the answer is unambiguous. Never silently pick a mode the user might not want — the bug this guards: a **TUI launched as `server` shows no UI**, because its stdout is a pipe, not a TTY, so it falls back to help/CLI output.
26
- 3. **Generate** — write with the confirmed choice: `aw generate-launch --source <alias> [--mode interactive|server] [--command "<cmd>"] [--force]`. Without `--mode`/`--command`, the heuristic default is used.
27
- 4. **Report** — render a readable summary from the JSON (per source: `stack`, `launchable`, `mode`, `run`, per-file outcome `created` / `regenerated` / `preserved` / `overwritten`). Do **not** dump raw JSON. Report `unknown_aliases` / `missing_sources` when present. A non-launchable source is a genuine non-app (e.g. a docs/plugins repo); a real app that lands there is a detection gap worth reporting.
28
-
29
- ## Detection (how "run the project locally" is derived)
30
-
31
- - **npm** — a run script first (`dev` > `start` > `serve`, → `server`); else a CLI/app entry (`bin` > `main`) run with `node`, **building first** (`npm run build`) when a `build` script exists — a TypeScript CLI runs from its compiled output (→ `interactive`).
32
- - **gradle** / **maven** — `./gradlew bootRun` / `./mvnw spring-boot:run` (`server`). **angular** — `npm start` (`server`).
33
- - **Launch mode** governs how the TUI "Lanzar" (and the wrapper) run the app: `interactive` = foreground, owns the TTY (the UI appears); `server` = backgrounded, output tee'd to the log. The heuristic guesses it; `--mode` overrides. A `build` step, when present, runs before the launch in both modes.
34
-
35
- ## Behavior
36
-
37
- - **Idempotent** — a pristine generated file is refreshed; a hand-edited one (its hash marker no longer matches) is **preserved**. `--force` overwrites hand-edited files too (reported as `overwritten`).
38
- - **`--source <alias>`** (repeatable) restricts to the given sources; default = every declared source.
39
- - **`--mode interactive|server`** overrides the detected mode for the selected source(s).
40
- - **`--command "<cmd>"`** overrides the run command for a **single** selected source (self-contained: drops the auto build).
41
- - **`--dry-run`** classifies every file and writes nothing.
17
+ 1. **Detect** — `aw generate-launch --dry-run [--source <alias>]`. Per source: `stack`, `launchable`, the detected `run` and `mode` (`interactive` | `server`).
18
+ 2. **Confirm (structured-choice)** — per **launchable** source; recommended = the detected mode.
19
+ - **Interactive** — foreground, owns a real TTY. TUIs / REPLs / interactive CLIs.
20
+ - **Server** — background + log window (close-to-stop). Dev servers, services.
21
+ - **Custom command** — the user gives the exact run command (optional).
42
22
 
43
- ## Plan mode
23
+ Batch questions; skip when unambiguous. Never silently pick a mode. The bug this guards: a **TUI launched as `server` shows no UI** — its stdout is a pipe, not a TTY, so it falls back to help output.
24
+ 3. **Generate** — `aw generate-launch --source <alias> [--mode interactive|server] [--command "<cmd>"] [--force]`.
25
+ 4. **Report** — from the JSON, per source: `stack`, `launchable`, `mode`, `run` and each file's outcome (`created` / `regenerated` / `preserved` / `overwritten`). Never dump raw JSON. Report `unknown_aliases` / `missing_sources`. A real app reported non-launchable is a detection gap worth naming.
44
26
 
45
- Run `aw generate-launch --dry-run` and report, per source, the detected `run` + `mode` and what it would create / regenerate / preserve — without writing any file or asking.
27
+ ## More context
46
28
 
47
- ## Resources
29
+ `aw context-plan --command generate-launch --signal <s>` returns the extra documents a case needs; read exactly what it lists:
48
30
 
49
- - CLI: `aw generate-launch` (service `generate-launch-service`; engine `source-launch-scripts-service`)
50
- - Related: the launch flow generates these on demand at the first launch; `/w:workspace-init` scaffolds nothing here.
31
+ - `detection` — the CLI's automatic detection of how to run the project was wrong or ambiguous → [`../modules/LAUNCH-DETECTION.md`](../modules/LAUNCH-DETECTION.md)
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Use when work already produced in this conversation (analysis, conclusions, a plan) should be saved into docs/ — classifies its shape and routes it. analysis → docs/research/ · requirement → spec draft (docs/specs) · plan → plan adoption (docs/plans). Backed by `aw persist`, which owns the inventory, the anti-duplicate check, the numbering, the destination and the write. Transversal (no flow, no loop, no session); records ## Origin + attribution.
2
+ description: Use when work already produced in this conversation (analysis, conclusions, a plan) should be saved into docs/ — classifies its shape and routes it to research, spec draft or plan adoption. Backed by `aw persist`, which owns the inventory, numbering, destination and the write. Transversal: no flow, no loop, no session.
3
3
  argument-hint: [what to persist — empty = the conversation's latest finished deliverable]
4
4
  allowed-tools:
5
5
  [
@@ -10,7 +10,7 @@ allowed-tools:
10
10
 
11
11
  # persist — persist in-conversation work into `docs/`
12
12
 
13
- Captures **work already produced in this conversation** — with or without host-native features (a `/goal` run, plan mode, plain chat analysis) — and persists it into `docs/`, classified by shape. The explicit form of *direct no-flow authoring* (`../SKILL.md` § *Operating context*, row 3) and the doctrinal entry for **host as producer** (`../loops/CHASSIS.md` § *Adopted context*). The host→`docs/` counterpart of `export-*`.
13
+ Captures **work already produced in this conversation** — with or without host-native features (a `/goal` run, plan mode, plain chat analysis) — and persists it into `docs/`, classified by shape. The host→`docs/` counterpart of `export-*`.
14
14
 
15
15
  > **Hard floor — applies even if you read nothing beyond this file:**
16
16
  >
@@ -28,39 +28,18 @@ Captures **work already produced in this conversation** — with or without host
28
28
 
29
29
  1. `aw persist prepare --format human` (`--detail` prints the full response contract). Returns the inventory of the three categories, the consultative numbering, the allowed destinations, the limits and an `input_digest`.
30
30
  2. **Classify and write.** Compose one JSON answer:
31
- - `version`, `operation`, `input_digest` copied **verbatim** from the request;
32
- - `state`: `proposed`, or `ambiguous` when the inventory already holds this work (explain in `reason` the CLI turns that into a question, never a write);
33
- - `decisions`: `{ category, slug, mode }`, plus `target` + `target_digest` when `mode` is `update`;
34
- - `artifacts`: exactly one `{ path, content }`.
31
+ - `version`, `operation`, `input_digest` copied **verbatim** from the request;
32
+ - `state` `proposed`, or `ambiguous` when the inventory already holds this work (explain in `reason`; the CLI turns that into a question, never a write);
33
+ - `decisions` `{ category, slug, mode }`, plus `target` + `target_digest` when `mode` is `update`;
34
+ - `artifacts` exactly one `{ path, content }`.
35
35
  3. `echo '<json>' | aw persist validate --format human` → preview + `approval_digest`.
36
36
  4. **Confirm classification and destination** with the user via structured-choice, showing that preview.
37
37
  5. `echo '<json>' | aw persist apply --approval <digest> --format human`.
38
38
 
39
39
  Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
40
40
 
41
- ## Classification → routing
42
-
43
- | Shape | Signals | Category → destination |
44
- |---|---|---|
45
- | **Analysis / conclusions / design notes** | findings, comparisons, diagnoses, adjudications, recommendations | `research` → `docs/research/NNN-research-<slug>.md` |
46
- | **Requirement** | describes a *wish*: what should exist/change, acceptance criteria derivable | `spec` → `docs/specs/NNN-spec-<slug>.md`, born `status: draft`, `## Origin` = "adopted from host conversation" → offer `/w:spec-refine` |
47
- | **Plan** | already answers the *how*: phases/tasks/solution — e.g. the host plan-mode output | `plan` → `docs/plans/NNN-plan-<slug>.md` (adoption, [`plan-new`](plan-new.md) § *Input resolution* mode 4) → offer `/w:plan-refine` / `/w:plan-exec` |
48
- | Mixed / ambiguous | e.g. analysis that ends in a requirement | one `persist` per document, each confirmed; a research doc plus a spec draft that cites it is a valid split |
49
-
50
41
  Requires a **workspace** (`docs/` is the managed surface). Without one → degrade: propose `/w:workspace-init`.
51
42
 
52
- ## `docs/research/` — the analysis home (owned by this command)
53
-
54
- `docs/research` hosts standalone analyses: neither spec nor plan, but worth keeping. Belongs to **no flow**; `export-*` never writes it; loops never read it implicitly (a flow uses it by **reference** — cited in a spec's `## Origin` or a quick prompt). It is git-shareable, unlike sessions (gitignored, machine-local, loop-owned), which makes it the exchange surface for **N agents analyzing the same situation**.
55
-
56
- > **Anti-duplicate is a decision, not an accident.** The inventory carries each existing document's summary and digest. Same work already there → `mode: "update"` (proving you saw the current bytes via `target_digest`) or `state: "ambiguous"` so the user chooses between updating and writing a sibling perspective. A second near-identical document is never created silently.
57
-
58
- ## Plan mode
59
-
60
- Describe the classification, the destination and the document it would write. Running `prepare` is fine (read-only); never `apply`.
61
-
62
- ## Resources
43
+ ## More context
63
44
 
64
- - CLI: `aw persist prepare | validate | apply` (service `persist-service` over `semantic-operation/`)
65
- - Siblings: the four `export-*` commands (session → `docs/`), same handshake
66
- - Design reference: `docs/referencias/workflow-skills/persist.md`
45
+ `aw context-plan --command persist --signal classification` returns the routing table which shape goes to `docs/research/`, which becomes a spec draft, which is a plan adoption — plus the anti-duplicate rule: [`../modules/PERSIST-ROUTING.md`](../modules/PERSIST-ROUTING.md). Read exactly what it lists.
@@ -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, 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).
2
+ description: Use when a plan is ready to implement — the real work: code edits, proposed SQL scripts, created tools. Starts or resumes plan-exec-loop over docs/plans/PPP-plan-<slug>.md, phase by phase, validating each before closing it. Git-safe (proposes commits, never push/--amend).
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 — 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.
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 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
  >
@@ -23,37 +23,21 @@ Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase
23
23
 
24
24
  ## Run the loop
25
25
 
26
- `plan-exec-loop` is **not** a skill invocable by name — it is this command's operating manual (a sibling doc in the bundle). **Load it and execute it end to end**:
26
+ 1. `aw context-plan --command plan-exec` read exactly the documents it lists, in order.
27
+ 2. Follow the loop manual end to end, taking `$ARGUMENTS` as input: it checks executability on entry, executes phase by phase (git-safe, DB scripts-only), keeps the plan alive and reports.
27
28
 
28
- 1. **Read** `../loops/plan-exec-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
29
- 2. **Follow** its instructions taking `$ARGUMENTS` as input: it detects CHECKPOINT/resume, executes phase by phase (git-safe, DB scripts-only), keeps the plan alive and reports.
29
+ > `plan-exec-loop` is **not** a skill invocable by name it is this command's operating manual. The command **is** the entry; the loop is its body. It is **resumable**: an existing CHECKPOINT continues from there.
30
30
 
31
- > Do not try `Skill: plan-exec-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
31
+ ## Two gates that send work back
32
32
 
33
- ## What the loop does (summary)
33
+ - **Entry gate** a plan that would force execution to invent its own structure is not run in silence. A minor gap is normalized **with your consent**; a structural one hands off to `/w:plan-refine`.
34
+ - **Deviation gate** — local detail 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`.
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).
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).
40
- - If it creates a tool/utility, the ambient `creating-tools` skill documents it in `docs/tools/` (auto-discovered; Workline does not bind it).
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*).
42
- - **Probe (PoC) tasks** run as throwaway code in the session folder — never committed; verdict recorded (`CONCLUSIONS`/`DECISION`), failed probes surface to the human (see `../loops/plan-exec-loop/LOOP.md` § *Delta 7*).
43
- - Proposes commits per source (git-safe: verifies the branch, proposes, never push/--amend/--no-verify).
44
- - Generates session artifacts (`DECISION`, `SCRIPTS.sql`) under `.workflow/sessions/`.
45
- - **Never exports** to `docs/scripts`, `docs/manuals`, `docs/diagrams`, `docs/reports` — the `export-*` do that as a separate step.
46
- - DB scripts (migrations) go to `SCRIPTS.sql` type B; the AI **never executes DML/DDL**, only read-only reads via MCP.
36
+ ## More context
47
37
 
48
- ## Resumable
38
+ `aw context-plan --command plan-exec --signal <s>` returns the extra documents a case needs; read exactly what it lists:
49
39
 
50
- Same pattern as the other loops: it detects an existing CHECKPOINT and continues from there.
51
-
52
- ## Plan mode
53
-
54
- The skill describes, phase by phase, what it would execute, which files it would touch, and which commits it would propose, without applying changes.
55
-
56
- ## Resources
57
-
58
- - Loop manual: `../loops/plan-exec-loop/LOOP.md`
59
- - Design reference: `docs/referencias/workflow-commands/plan-exec.md`
40
+ - `db` the plan touches a database [`../modules/EXEC-DB-POLICY.md`](../modules/EXEC-DB-POLICY.md)
41
+ - `probe` — a task is a PoC → [`../modules/EXEC-PROBE-TASKS.md`](../modules/EXEC-PROBE-TASKS.md)
42
+ - `simulation` — **only when the change carries temporary behavior**, its boundary is declared and its retirement identified → [`../modules/SIMULATION-LIFECYCLE.md`](../modules/SIMULATION-LIFECYCLE.md)
43
+ - `ui` — the plan references design SPECs → [`../modules/PLAN-DESIGN-SPECS.md`](../modules/PLAN-DESIGN-SPECS.md)
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Use when a spec is ready to become an executable plan — not to refine an existing plan (plan-refine) nor execute one (plan-exec). Starts or resumes the planning loop (plan-new-loop) from a spec. Turns the "what" (spec) into the "how" (plan). Ideal input: an already refined docs/specs/NNN-spec-<slug>.md. Also adopts an externally-built plan (host plan mode, hand-written, another agent) as the plan-doc — mode 4 of its input resolution. May split into sibling plans (split gate).
2
+ description: Use when a spec is ready to become an executable plan — not to refine one (plan-refine) nor execute one (plan-exec). Starts plan-new-loop from docs/specs/NNN-spec-<slug>.md, turning the "what" into the "how". Also adopts an externally-built plan. May split into sibling plans.
3
3
  argument-hint: <docs/specs/NNN-spec-<slug>.md | prompt>
4
4
  allowed-tools:
5
5
  [
@@ -21,49 +21,22 @@ SPEC → PLAN bridge. Turns the "what" (refined spec) into the "how" (plan). Del
21
21
  > 3. **Write boundary** — this flow writes only `docs/plans/…` (with confirmation if it exists); nothing else lands in `docs/`.
22
22
  > 4. **Language** — everything user-facing (questions, option labels, the plan's content) goes in the **user's language**.
23
23
 
24
- ## Input resolution
25
-
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
-
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
- 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
- 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
-
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
-
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
-
37
24
  ## Run the loop
38
25
 
39
- `plan-new-loop` is **not** a skill invocable by name — it is this command's operating manual (a sibling doc in the bundle). **Load it and execute it end to end**:
40
-
41
- 1. **Read** `../loops/plan-new-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
42
- 2. **Follow** its instructions taking `$ARGUMENTS` as input (resolved per the 4 rules above): it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports. *(Mode 4 — adoption — is single-pass: materialize + offer the next step; no loop is started.)*
26
+ 1. `aw context-plan --command plan-new` read exactly the documents it lists, in order.
27
+ 2. Follow the loop manual end to end, taking `$ARGUMENTS` as input (resolved per the module below): it detects state/resume, runs the gap-driven engine, manages sessions, converges and reports.
43
28
 
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.
29
+ > `plan-new-loop` is **not** a skill invocable by name — it is this command's operating manual. The command **is** the entry; the loop is its body.
45
30
 
46
31
  ## Phases are functional states
47
32
 
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. The blocks beyond those are **conditional**: a phase with no temporary behavior gets no `Límite de simulación`, and one with nothing excluded gets no `Diferido` — a heading is never written empty to satisfy a template. The plan itself is born `> Estado: open` under the title; only `plan-exec` closes it. Contract: `../loops/plan-new-loop/LOOP.md` § *Phase contract (canonical)*.
49
-
50
- ## Numbering notes
51
-
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.
53
-
54
- ## UI → design SPECs
55
-
56
- If the plan **includes UI**, the loop composes the `ui-design` capability and produces per-screen **design SPECs** (`NNN-SPEC-<SLUG>.md`) as artifacts of its session — the plan's UI Tasks reference them (see `../loops/plan-new-loop/LOOP.md` § *Delta 4* and `../artifacts/artifacts-design/SPEC.md`).
57
-
58
- ## Risky assumptions → probe (PoC) tasks
59
-
60
- When the plan rests on a runnable unknown (external connection, SDK, UI behavior), the loop encodes an **early probe task** — or runs an inline probe if the solution itself depends on the answer (see `../loops/plan-new-loop/LOOP.md` § *Delta 5*; doctrine: `../loops/CHASSIS.md` § *Proof of concept*).
61
-
62
- ## Plan mode
33
+ 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. The blocks beyond those are **conditional**: a phase with no temporary behavior gets no `Límite de simulación`, and one with nothing excluded gets no `Diferido` — a heading is never written empty to satisfy a template. The plan itself is born `> Estado: open`; only `plan-exec` closes it.
63
34
 
64
- The skill resolves the input per the 4 rules above and describes the loop actions it would run (mode 4: the plan-doc it would materialize), without starting the iteration or writing files.
35
+ ## More context
65
36
 
66
- ## Resources
37
+ `aw context-plan --command plan-new --signal <s>` returns the extra documents a case needs; read exactly what it lists:
67
38
 
68
- - Loop manual: `../loops/plan-new-loop/LOOP.md`
69
- - Design reference: `docs/referencias/workflow-commands/plan-new.md`
39
+ - `input` the argument is not plainly a `ready-for-plan` spec → [`../modules/PLAN-INPUT.md`](../modules/PLAN-INPUT.md)
40
+ - `split` the spec may need more than one plan → [`../modules/PLAN-SPLIT-GATE.md`](../modules/PLAN-SPLIT-GATE.md)
41
+ - `ui` — the plan includes UI, so it composes `ui-design` → [`../modules/PLAN-DESIGN-SPECS.md`](../modules/PLAN-DESIGN-SPECS.md)
42
+ - `probe` — the plan rests on a runnable unknown → [`../modules/PLAN-PROBE-TASKS.md`](../modules/PLAN-PROBE-TASKS.md)
@@ -1,5 +1,5 @@
1
1
  ---
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.
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. Starts plan-refine-loop, which re-shapes docs/plans/PPP-plan-<slug>.md in place into verifiable functional states.
3
3
  argument-hint: <docs/plans/PPP-plan-<slug>.md>
4
4
  allowed-tools:
5
5
  [
@@ -12,9 +12,7 @@ allowed-tools:
12
12
 
13
13
  # plan-refine — trampoline to the plan refinement loop
14
14
 
15
- An **auxiliary, NOT mandatory** step of the PLAN flow: `spec-refine`'s twin, but over the **plan**. `plan-new` already produces a plan from the refined spec; `plan-refine` exists for when **before executing**changes arise (new requirements, scope adjustments, deps or risks spotted while re-reading the plan) worth incorporating without regenerating the plan from scratch.
16
-
17
- This command does not refine the plan itself: it delegates to `plan-refine-loop` (Layer 2), which iterates, closes gaps and edits the plan **in place**.
15
+ `spec-refine`'s twin, over the **plan**. An **auxiliary, NOT mandatory** step: `plan-new` already produces a plan from the refined spec, and `plan-exec` runs **any** plan that is already executable. This exists for when changes arise before executing — new requirements, scope adjustments, deps or risks spotted while re-reading worth incorporating without regenerating from scratch.
18
16
 
19
17
  > **Hard floor — applies even if you read nothing beyond this file:**
20
18
  >
@@ -23,47 +21,21 @@ This command does not refine the plan itself: it delegates to `plan-refine-loop`
23
21
  > 3. **Write boundary** — this flow edits only `docs/plans/…` (in place, with confirmation); nothing else lands in `docs/`.
24
22
  > 4. **Language** — everything user-facing (questions, option labels, the plan's content) goes in the **user's language**.
25
23
 
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
- >
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
-
30
- ## Input resolution
31
-
32
- The skill evaluates `$ARGUMENTS` (plans live in place — `docs/plans/PPP-plan-<slug>.md`; locate via the `docs/plans/PPP-plan-*.md` glob or the exact path):
33
-
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
- 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.
39
-
40
24
  ## Run the loop
41
25
 
42
- `plan-refine-loop` is **not** a skill invocable by name — it is this command's operating manual (a sibling doc in the bundle). **Load it and execute it end to end**:
43
-
44
- 1. **Read** `../loops/plan-refine-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
45
- 2. **Follow** its instructions taking `$ARGUMENTS` as input: it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports.
46
-
47
- > Do not try `Skill: plan-refine-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
48
-
49
- ## State resolution (resumable)
50
-
51
- The skill detects prior state before starting, **keying off the `CHECKPOINT`** (never a "refined" file):
52
-
53
- 1. Find the plan's refinement session under `.workflow/sessions/` (descriptor `<slug>-plan-refine` + `## Origin`) and its `CHECKPOINT.md`.
54
- 2. **In progress** (a CHECKPOINT exists) → continue from the recorded progress (resolved gaps, Q&A).
55
- 3. **No progress** (no CHECKPOINT and the plan does **not** have `## Refinement decisions`) → start from zero reading the plan (`PPP-plan-*.md`).
56
- 4. **Already refined / re-refine on demand** (no open CHECKPOINT but the plan **already has** that section) → **first-class operation**: while the flow stays in PLAN you can re-run `/w:plan-refine` over the same plan **as many times as needed** (new requirements, scope changes, re-reads). The loop does `create_or_resume` — it locates the existing refine session (even closed) and **reopens** it instead of duplicating — and re-refines reading the **plan itself**; on `Guardar`, edits in place with confirmation.
57
-
58
- ## UI → design SPECs
26
+ 1. `aw context-plan --command plan-refine` read exactly the documents it lists, in order.
27
+ 2. Follow the loop manual end to end, taking `$ARGUMENTS` as input: it detects state/resume, runs the gap-driven engine, manages sessions, converges and reports.
59
28
 
60
- If the refine **touches UI**, the loop composes `ui-design` and produces/updates **design SPECs** (`NNN-SPEC-<SLUG>.md`) in its own sessionscoped to the new/changed screens and re-points the plan references (see `../loops/plan-refine-loop/LOOP.md` § *Delta 4*).
29
+ > `plan-refine-loop` is **not** a skill invocable by nameit is this command's operating manual. The command **is** the entry; the loop is its body.
61
30
 
62
- ## Plan mode
31
+ **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.
63
32
 
64
- The skill resolves the state and describes the actions the loop would run (gaps it would close, questions it would ask), without starting the iteration.
33
+ ## More context
65
34
 
66
- ## Resources
35
+ `aw context-plan --command plan-refine --signal <s>` returns the extra documents a case needs; read exactly what it lists:
67
36
 
68
- - Loop manual: `../loops/plan-refine-loop/LOOP.md`
69
- - Design reference: `docs/referencias/workflow-commands/plan-refine.md`
37
+ - `input` where this plan came from, and what a plan returned by `plan-exec` means → [`../modules/PLAN-INPUT.md`](../modules/PLAN-INPUT.md)
38
+ - `resume` a prior refinement of this plan may exist → [`../modules/PLAN-REFINE-KEYS.md`](../modules/PLAN-REFINE-KEYS.md)
39
+ - `replan` — work already executed has to be re-planned around → [`../modules/REPLANNING.md`](../modules/REPLANNING.md)
40
+ - `simulation` — the change carries temporary behavior, so **only when** it does, its boundary is declared → [`../modules/SIMULATION-LIFECYCLE.md`](../modules/SIMULATION-LIFECYCLE.md)
41
+ - `ui` — the refine touches UI → [`../modules/PLAN-REFINE-DESIGN-SPECS.md`](../modules/PLAN-REFINE-DESIGN-SPECS.md)
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Use when the user asks for a scoped, direct task a fix, tweak, chore or small change that warrants no spec or plan (e.g. "fix this bug", "rename X", "tidy up Y"). Starts quick-loop with minimal ceremony; never touches docs/. If the objective exceeds a quick or the task grows, it escalates — to SPEC live (with consent), to PLAN deferred.
2
+ description: Use for a scoped, direct task that warrants no spec or plan a fix, a tweak, a chore ("fix this bug", "rename X"). Starts quick-loop with minimal ceremony; never touches docs/. Escalates when the objective exceeds a quick: to SPEC live with consent, to PLAN deferred.
3
3
  argument-hint: <prompt with the scoped task>
4
4
  allowed-tools:
5
5
  [
@@ -12,7 +12,7 @@ allowed-tools:
12
12
 
13
13
  # quick — trampoline to the lightweight loop
14
14
 
15
- For scoped, direct tasks that do not justify going through SPEC or PLAN. Creates a light session (traceability + resume) — unless the **entry size gate** escalates to SPEC before starting. Delegates to `quick-loop` (Layer 2).
15
+ Delegates to `quick-loop` (Layer 2). Creates a light session (traceability + resume) — unless the **entry size gate** escalates first.
16
16
 
17
17
  > **Hard floor — applies even if you read nothing beyond this file:**
18
18
  >
@@ -23,27 +23,20 @@ For scoped, direct tasks that do not justify going through SPEC or PLAN. Creates
23
23
 
24
24
  ## Run the loop
25
25
 
26
- `quick-loop` is **not** a skill invocable by name it is this command's operating manual (a sibling doc in the bundle). **Load it and execute it end to end**:
26
+ 1. `aw context-plan --command quick` read exactly the documents it lists, in order.
27
+ 2. Follow the loop manual end to end, taking `$ARGUMENTS` as the task: it evaluates the size gate, creates the light session, works with minimal ceremony (git-safe), escalates if the task grows, and reports.
27
28
 
28
- 1. **Read** `../loops/quick-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
29
- 2. **Follow** its instructions taking `$ARGUMENTS` as the task: it evaluates the size gate, creates the light session, works with minimal ceremony (git-safe), escalates if the task exceeds or grows (SPEC live / PLAN deferred), and reports.
29
+ > `quick-loop` is **not** a skill invocable by name it is this command's operating manual. The command **is** the entry; the loop is its body.
30
30
 
31
- > Do not try `Skill: quick-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
31
+ ## Two things this command never does
32
32
 
33
- ## What the loop does
33
+ - **It never touches `docs/`** and it exports nothing.
34
+ - **It never re-derives what the conversation already settled.** Analysis already established here is *input*, seeded into the session with `## Origin` = adopted.
34
35
 
35
- - Edits code in the workspace sources.
36
- - **Adopts prior context**: analysis/conclusions already established in this conversation (e.g. via a host-native feature) are **input** — seeded into the session with `## Origin` = adopted, never re-derived or re-asked (chassis § *Adopted context*).
37
- - Minimal session artifacts (lazy DECISION, proposed commit).
38
- - **Proportional closing review gate** before proposing the single commit: re-reads the diff applying the installed ambient conventions and fixes or defers (see `../loops/quick-loop/LOOP.md` § *Sequence*).
39
- - **Never touches `docs/`** and exports nothing.
40
- - **Escalates** when complexity emerges — **entry size gate** (before creating the session) and mid-loop (many files, ≥2 sources, needs architecture, or the change is a feature/refactor). Accepting **SPEC** = **live** transition into the SPEC flow (draft via the spec-new procedure + spec-refine-loop); **PLAN** stays seeded for later. See `../loops/quick-loop/LOOP.md` § *QUICK delta*.
36
+ ## More context
41
37
 
42
- ## Plan mode
38
+ `aw context-plan --command quick --signal <s>` returns the extra documents a case needs; read exactly what it lists:
43
39
 
44
- The skill describes the changes it would apply and the files it would touch, without executing them. Escalation included: if the gate (entry or mid-loop) would fire, it describes it (options + the spec it would materialize) without writing `docs/` or starting loops.
45
-
46
- ## Resources
47
-
48
- - Loop manual: `../loops/quick-loop/LOOP.md`
49
- - Design reference: `docs/referencias/workflow-commands/quick.md`
40
+ - `db` the task reads or writes a database [`../modules/DB-SCRIPTS-ONLY.md`](../modules/DB-SCRIPTS-ONLY.md)
41
+ - `probe` — a runnable doubt has to be settled by running something → [`../modules/PROBE.md`](../modules/PROBE.md)
42
+ - `adopted` — the conversation already established the analysis → [`../modules/ADOPTED-CONTEXT.md`](../modules/ADOPTED-CONTEXT.md)
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Use when the user asks to resume or pick up pending work — a half-done session, a spec to refine, a plan mid-execution. Backed by `aw resume`, which derives the priority, the progress and the exact re-entry command from the Workline index. An artifact argument (spec, plan or session) skips the survey. Transversal (not a flow), read-only; never touches docs/ or .workflow/.
2
+ description: Use when the user asks to resume or pick up pending work — an open session, a spec to refine, a plan mid-execution. `aw resume` derives the priority and the re-entry command. Read-only, transversal.
3
3
  argument-hint: "[docs/specs/… | docs/plans/… | NNN | --code <session>]"
4
4
  allowed-tools:
5
5
  [
@@ -8,46 +8,30 @@ allowed-tools:
8
8
  ]
9
9
  ---
10
10
 
11
- # resume — pick up pending work (transversal)
11
+ # resume — pending work
12
12
 
13
- Single-pass, **read-only**: no loop, no session, writes nothing in `docs/` or `.workflow/`. **Transversal** command (belongs to no SPEC/PLAN/QUICK flow). The actionable sibling of `/w:status`: same index, but it answers *what to pick up* instead of *what exists*.
13
+ Read-only **with or without an argument**: no loop, no session, and it writes nothing in `docs/` or `.workflow/`. Sibling of `aw status`; not `aw session-resume` / `aw resume-summary` (internals).
14
14
 
15
- > **Not `aw session-resume` / `aw resume-summary`.** Those are internal session mechanics (reopen a session; the PostCompact payload). `aw resume` is the user-facing command.
16
-
17
- > **Hard floor applies even if you read nothing beyond this file:**
18
- >
19
- > 1. **Read-only** — never execute the proposed route, with or without an argument. The CLI hands back a command string; the user drives it.
20
- > 2. **Never re-decide** — priority, ties, the spec→plan relation and the exact command come from the CLI. Do not re-sort by date, do not associate a session to a plan by slug, do not pick a winner the CLI left tied.
21
- > 3. **Ask via structured-choice** when the CLI returns candidates, never otherwise.
22
- > 4. **Language** — user-facing output in the **user's language**.
15
+ 1. **Read-only** never run the route; the user does.
16
+ 2. **Never re-decide** — priority, ties, the spec→plan link and the command come from the CLI. No re-sort by date, no slug match, no tie broken.
17
+ 3. **Ask via structured-choice** only for CLI candidates: one option each, in order, plus `flow`.
18
+ 4. Output in the **user's language**.
23
19
 
24
20
  ## Run
25
21
 
26
- 1. Run `aw resume --format human`, forwarding the argument when there is one:
27
- - a doc path or number → pass it as the positional (`aw resume docs/plans/009-plan-x.md`);
28
- - a session`aw resume --code <NNN | folder>`;
29
- - nothing → no argument, and the CLI walks the pipeline.
30
- 2. **Relay the output verbatim.** It already carries the objective, the progress or checkpoint, the next pending step or blocker, and the exact command.
31
- 3. **When the CLI returns candidates**, present them as a structured-choice, one option per candidate, in the order given — the CLI declares a tie precisely because there is no correct automatic winner. Add the `flow` control. Never break the tie yourself.
32
- 4. **When it returns nothing pending**, say so and stop. Do not ask.
33
- 5. **Host context (optional).** If nothing is pending at the Workline level and the host exposes cheap host-memory ([`../harness/HARNESS.md`](../harness/HARNESS.md) § *host-memory*), you may add a short note about recent focus. Never expensive, never blocking.
22
+ 1. `aw resume --format human`. For one artifact, **pass it as the positional** (`aw resume docs/plans/009-plan-x.md` or its `NNN`); for a session, `aw resume --code <NNN | folder>`; none walks the pipeline.
23
+ 2. **Relay it verbatim.**
24
+ 3. Nothing pendingsay so and stop; cheap host-memory may add a recent-focus note, never expensive or blocking.
34
25
 
35
26
  ## What the CLI decides (do not re-derive)
36
27
 
37
- - **Priority**: spec sin refinar spec `ready-for-plan` sin plan → plan incompleto → checkpoint no asociado. Within plans, one already started outranks an untouched one.
38
- - **Ties**: same priority and same progress → candidates. Date and age never break a tie.
39
- - **The spec→plan relation**: proven by the plan's `Derived from` header, an explicit spec path in its `## Origin`, or an unambiguous `Spec NNN` there — never by slug. A plan whose provenance is unproven leaves its spec visible as still unplanned.
40
- - **The route**: `/w:spec-refine`, `/w:plan-new`, `/w:plan-exec`, or `aw session-resume --reopen`, with the path already filled in.
41
-
42
- > A plan is not finished because its boxes are ticked. `aw resume` re-enters at the first phase that is not `validada`, reports a `bloqueada` phase with its declared reason, and, when everything is green but the plan never closed, says the final validation is what remains. A plan that declares `done` over open work comes back as inconsistent — repair before implementing.
43
-
44
- ## Plan mode
28
+ - **Priority**: unrefined spec refined spec with no plan → incomplete plan → loose checkpoint; started plans first.
29
+ - **Ties**: equal priority and progress → candidates; date never splits.
30
+ - **Spec→plan link**: the plan's `Derived from` or `## Origin`, never the slug; unproven stays unplanned.
31
+ - **The route**: `/w:spec-refine`, `/w:plan-new`, `/w:plan-exec` or `aw session-resume --reopen`.
45
32
 
46
- Read-only already: run `aw resume --format human` and describe the proposal (and the choice it would offer), without asking or writing.
33
+ > A plan is not finished because its boxes are ticked. `aw resume` re-enters at the first phase not `validada`, names a `bloqueada` phase with its declared reason, and when the phases are green but the plan never closed, the final validation remains. A plan declaring `done` over open work comes back as inconsistent — repair first.
47
34
 
48
- ## Resources
35
+ ## More context
49
36
 
50
- - CLI: `aw resume` (service `resume-service` over `workline-index-service`) · sibling `aw status`
51
- - Session mechanics: `aw session-resume --code <NNN> [--reopen]` · `aw resume-summary`
52
- - Continuity rule: [`../SKILL.md`](../SKILL.md) § *Operating context*
53
- - Design reference: `docs/referencias/workflow-skills/resume.md`
37
+ `aw context-plan --command resume --signal <s>` returns the extra documents a case needs; read exactly what it lists.