@tacuchi/agent-workflow-cli 17.1.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +11 -11
  2. package/dist/application/dev-only-services.d.ts +9 -1
  3. package/dist/application/dev-only-services.d.ts.map +1 -1
  4. package/dist/application/dev-only-services.js +12 -3
  5. package/dist/application/dev-only-services.js.map +1 -1
  6. package/dist/application/mcp-host-writer.d.ts.map +1 -1
  7. package/dist/application/mcp-host-writer.js +5 -37
  8. package/dist/application/mcp-host-writer.js.map +1 -1
  9. package/dist/application/multiroot/paths.d.ts +6 -0
  10. package/dist/application/multiroot/paths.d.ts.map +1 -1
  11. package/dist/application/multiroot/paths.js +32 -1
  12. package/dist/application/multiroot/paths.js.map +1 -1
  13. package/dist/application/project-tab-data.d.ts.map +1 -1
  14. package/dist/application/project-tab-data.js +22 -6
  15. package/dist/application/project-tab-data.js.map +1 -1
  16. package/dist/application/release-data/bundles.d.ts +18 -1
  17. package/dist/application/release-data/bundles.d.ts.map +1 -1
  18. package/dist/application/release-data/bundles.js +64 -11
  19. package/dist/application/release-data/bundles.js.map +1 -1
  20. package/dist/application/release-data-service.d.ts +6 -4
  21. package/dist/application/release-data-service.d.ts.map +1 -1
  22. package/dist/application/release-data-service.js +9 -6
  23. package/dist/application/release-data-service.js.map +1 -1
  24. package/dist/application/render/history-row.d.ts.map +1 -1
  25. package/dist/application/render/history-row.js +7 -1
  26. package/dist/application/render/history-row.js.map +1 -1
  27. package/dist/application/self/install-skill.d.ts +17 -3
  28. package/dist/application/self/install-skill.d.ts.map +1 -1
  29. package/dist/application/self/install-skill.js +206 -109
  30. package/dist/application/self/install-skill.js.map +1 -1
  31. package/dist/application/self/skills-manager.d.ts.map +1 -1
  32. package/dist/application/self/skills-manager.js +9 -3
  33. package/dist/application/self/skills-manager.js.map +1 -1
  34. package/dist/application/self/uninstall.d.ts.map +1 -1
  35. package/dist/application/self/uninstall.js +23 -12
  36. package/dist/application/self/uninstall.js.map +1 -1
  37. package/dist/application/session-close-service.d.ts +8 -1
  38. package/dist/application/session-close-service.d.ts.map +1 -1
  39. package/dist/application/session-close-service.js +22 -1
  40. package/dist/application/session-close-service.js.map +1 -1
  41. package/dist/application/source-launch-scripts-service.d.ts +0 -16
  42. package/dist/application/source-launch-scripts-service.d.ts.map +1 -1
  43. package/dist/application/source-launch-scripts-service.js +3 -17
  44. package/dist/application/source-launch-scripts-service.js.map +1 -1
  45. package/dist/application/source-launch-service.d.ts +31 -4
  46. package/dist/application/source-launch-service.d.ts.map +1 -1
  47. package/dist/application/source-launch-service.js +40 -8
  48. package/dist/application/source-launch-service.js.map +1 -1
  49. package/dist/application/workspace-init-service.d.ts +23 -3
  50. package/dist/application/workspace-init-service.d.ts.map +1 -1
  51. package/dist/application/workspace-init-service.js +142 -47
  52. package/dist/application/workspace-init-service.js.map +1 -1
  53. package/dist/cli/commands/dev-only.d.ts.map +1 -1
  54. package/dist/cli/commands/dev-only.js +7 -4
  55. package/dist/cli/commands/dev-only.js.map +1 -1
  56. package/dist/cli/commands/release-data.d.ts.map +1 -1
  57. package/dist/cli/commands/release-data.js +13 -4
  58. package/dist/cli/commands/release-data.js.map +1 -1
  59. package/dist/cli/commands/session-close.js +1 -1
  60. package/dist/cli/commands/session-close.js.map +1 -1
  61. package/dist/cli/commands/workspace-init.js +1 -1
  62. package/dist/cli/commands/workspace-init.js.map +1 -1
  63. package/dist/cli/parser.js +1 -1
  64. package/dist/cli/parser.js.map +1 -1
  65. package/dist/cli/tui/tabs/project-tab.js +26 -19
  66. package/dist/cli/tui/tabs/project-tab.js.map +1 -1
  67. package/dist/domain/harnesses.d.ts.map +1 -1
  68. package/dist/domain/harnesses.js +20 -10
  69. package/dist/domain/harnesses.js.map +1 -1
  70. package/dist/domain/skills.js +1 -1
  71. package/dist/domain/skills.js.map +1 -1
  72. package/package.json +1 -1
  73. package/skills/w/README.md +5 -5
  74. package/skills/w/SKILL.md +8 -8
  75. package/skills/w/artifacts/artifacts-design/SPEC.md +2 -2
  76. package/skills/w/commands/README.md +4 -4
  77. package/skills/w/commands/export-diagrams.md +2 -2
  78. package/skills/w/commands/export-manuals.md +2 -2
  79. package/skills/w/commands/export-reports.md +2 -2
  80. package/skills/w/commands/export-scripts.md +2 -2
  81. package/skills/w/commands/fix-git.md +2 -2
  82. package/skills/w/commands/plan-exec.md +3 -3
  83. package/skills/w/commands/plan-new.md +3 -3
  84. package/skills/w/commands/plan-refine.md +3 -3
  85. package/skills/w/commands/quick.md +4 -4
  86. package/skills/w/commands/spec-new.md +3 -3
  87. package/skills/w/commands/spec-refine.md +2 -2
  88. package/skills/w/commands/workspace-init.md +7 -5
  89. package/skills/w/exports/README.md +14 -14
  90. package/skills/w/exports/export-diagrams/{SKILL.md → EXPORT.md} +6 -6
  91. package/skills/w/exports/export-manuals/{SKILL.md → EXPORT.md} +5 -5
  92. package/skills/w/exports/export-reports/{SKILL.md → EXPORT.md} +6 -6
  93. package/skills/w/exports/export-scripts/{SKILL.md → EXPORT.md} +8 -7
  94. package/skills/w/harness/{SKILL.md → HARNESS.md} +15 -4
  95. package/skills/w/loops/CHASSIS.md +9 -9
  96. package/skills/w/loops/CODE-POLICIES.md +2 -2
  97. package/skills/w/loops/README.md +12 -12
  98. package/skills/w/loops/plan-exec-loop/{SKILL.md → LOOP.md} +1 -1
  99. package/skills/w/loops/plan-new-loop/{SKILL.md → LOOP.md} +3 -3
  100. package/skills/w/loops/plan-refine-loop/{SKILL.md → LOOP.md} +3 -3
  101. package/skills/w/loops/quick-loop/{SKILL.md → LOOP.md} +2 -2
  102. package/skills/w/loops/spec-refine-loop/{SKILL.md → LOOP.md} +2 -2
  103. package/skills/w/roles/README.md +9 -9
  104. package/skills/w/roles/git/{SKILL.md → ROLE.md} +1 -1
  105. package/skills/w/roles/research/{SKILL.md → ROLE.md} +1 -1
  106. package/skills/w/roles/ui-spec/{SKILL.md → ROLE.md} +3 -3
  107. /package/skills/w/roles/diagrams/{SKILL.md → ROLE.md} +0 -0
  108. /package/skills/w/roles/sql/{SKILL.md → ROLE.md} +0 -0
@@ -17,7 +17,7 @@ Single-pass, **no loop, no session**, **never writes `docs/`**. **Transversal**
17
17
 
18
18
  1. **Detect + identify** — run `aw merge-state [<source>]` (read-only; `--source <alias>` or `--all` when a workspace exists; a direct path otherwise). From the JSON, per repo: `is_merging`, `current_branch` (**destination / ours**), `merge_origin` (**origin / theirs**), `conflicted_files`.
19
19
  - If **no merge is in progress** (`is_merging:false`) and the user named a **target** (e.g. "merge `<branch>`"): that is an explicit request → `git -C <path> merge <branch>` and continue. No target → report there is no merge to resolve and stop.
20
- 2. **Resolve** — **read and follow** the ***Merge-conflict resolution*** section of the `git` role (`../roles/git/SKILL.md`): analyze each conflict's intent (3 versions `git show :1:/:2:/:3:<file>`, `git log --merge`), resolve (ours / theirs / combine / rewrite) and `git add` what is resolved. On **ambiguity or incoherence**, ask via *structured-choice* (never invent the resolution).
20
+ 2. **Resolve** — **read and follow** the ***Merge-conflict resolution*** section of the `git` role (`../roles/git/ROLE.md`): analyze each conflict's intent (3 versions `git show :1:/:2:/:3:<file>`, `git log --merge`), resolve (ours / theirs / combine / rewrite) and `git add` what is resolved. On **ambiguity or incoherence**, ask via *structured-choice* (never invent the resolution).
21
21
  3. **Close** — **propose** the merge commit (propose-then-execute, canonical format, git-safe). Escape hatch: `git merge --abort` after user confirmation.
22
22
 
23
23
  > Do not try `Skill: git` — the role is **read and followed** (it is the capability this command composes). The command **is** the entry; the conflict doctrine lives in the `git` role.
@@ -28,6 +28,6 @@ Run `aw merge-state` (read-only), report **origin ↔ destination** and the per-
28
28
 
29
29
  ## Resources
30
30
 
31
- - Capability: `../roles/git/SKILL.md` (section *Merge-conflict resolution*)
31
+ - Capability: `../roles/git/ROLE.md` (section *Merge-conflict resolution*)
32
32
  - CLI: `aw merge-state` (read-only merge-state inspector)
33
33
  - Design reference: `docs/referencias/workflow-skills/fix-git.md`
@@ -25,7 +25,7 @@ Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase
25
25
 
26
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**:
27
27
 
28
- 1. **Read** `../loops/plan-exec-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
28
+ 1. **Read** `../loops/plan-exec-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
29
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.
30
30
 
31
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.
@@ -35,7 +35,7 @@ Starts or resumes `plan-exec-loop` (Layer 2), which executes the real work phase
35
35
  - Reads and updates `docs/plans/PPP-plan-<slug>.md` (living doc: phase/task state).
36
36
  - 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
37
  - If it creates a tool/utility, the ambient `creating-tools` skill documents it in `docs/tools/` (auto-discovered; the workflow does not bind it).
38
- - **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/SKILL.md` § *Delta 5*).
38
+ - **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*).
39
39
  - Proposes commits per source (git-safe: verifies the branch, proposes, never push/--amend/--no-verify).
40
40
  - Generates session artifacts (`DECISION`, `SCRIPTS.sql`) under `.workflow/sessions/`.
41
41
  - **Never exports** to `docs/scripts`, `docs/manuals`, `docs/diagrams`, `docs/reports` — the `export-*` do that as a separate step.
@@ -51,5 +51,5 @@ The skill describes, phase by phase, what it would execute, which files it would
51
51
 
52
52
  ## Resources
53
53
 
54
- - Loop skill: `../loops/plan-exec-loop/SKILL.md`
54
+ - Loop manual: `../loops/plan-exec-loop/LOOP.md`
55
55
  - Design reference: `docs/referencias/workflow-commands/plan-exec.md`
@@ -35,7 +35,7 @@ The skill evaluates `$ARGUMENTS` (specs live in place — `docs/specs/NNN-spec-<
35
35
 
36
36
  `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**:
37
37
 
38
- 1. **Read** `../loops/plan-new-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
38
+ 1. **Read** `../loops/plan-new-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
39
39
  2. **Follow** its instructions taking `$ARGUMENTS` as input (resolved per the 3 rules above): it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports.
40
40
 
41
41
  > Do not try `Skill: plan-new-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
@@ -46,7 +46,7 @@ The plan is named `docs/plans/PPP-plan-<slug>.md`. `aw next-number docs/plans` r
46
46
 
47
47
  ## UI → design SPECs
48
48
 
49
- 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/SKILL.md` § *Delta 4* and `../artifacts/artifacts-design/SPEC.md`).
49
+ 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`).
50
50
 
51
51
  ## Plan mode
52
52
 
@@ -54,5 +54,5 @@ The skill resolves the input per the 3 rules above and describes the loop action
54
54
 
55
55
  ## Resources
56
56
 
57
- - Loop skill: `../loops/plan-new-loop/SKILL.md`
57
+ - Loop manual: `../loops/plan-new-loop/LOOP.md`
58
58
  - Design reference: `docs/referencias/workflow-commands/plan-new.md`
@@ -36,7 +36,7 @@ The skill evaluates `$ARGUMENTS` (plans live in place — `docs/plans/PPP-plan-<
36
36
 
37
37
  `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**:
38
38
 
39
- 1. **Read** `../loops/plan-refine-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
39
+ 1. **Read** `../loops/plan-refine-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
40
40
  2. **Follow** its instructions taking `$ARGUMENTS` as input: it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports.
41
41
 
42
42
  > Do not try `Skill: plan-refine-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
@@ -52,7 +52,7 @@ The skill detects prior state before starting, **keying off the `CHECKPOINT`** (
52
52
 
53
53
  ## UI → design SPECs
54
54
 
55
- If the refine **touches UI**, the loop composes `ui-design` and produces/updates **design SPECs** (`NNN-SPEC-<SLUG>.md`) in its own session — scoped to the new/changed screens — and re-points the plan references (see `../loops/plan-refine-loop/SKILL.md` § *Delta 4*).
55
+ If the refine **touches UI**, the loop composes `ui-design` and produces/updates **design SPECs** (`NNN-SPEC-<SLUG>.md`) in its own session — scoped to the new/changed screens — and re-points the plan references (see `../loops/plan-refine-loop/LOOP.md` § *Delta 4*).
56
56
 
57
57
  ## Plan mode
58
58
 
@@ -60,5 +60,5 @@ The skill resolves the state and describes the actions the loop would run (gaps
60
60
 
61
61
  ## Resources
62
62
 
63
- - Loop skill: `../loops/plan-refine-loop/SKILL.md`
63
+ - Loop manual: `../loops/plan-refine-loop/LOOP.md`
64
64
  - Design reference: `docs/referencias/workflow-commands/plan-refine.md`
@@ -25,7 +25,7 @@ For scoped, direct tasks that do not justify going through SPEC or PLAN. Creates
25
25
 
26
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**:
27
27
 
28
- 1. **Read** `../loops/quick-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
28
+ 1. **Read** `../loops/quick-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
29
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.
30
30
 
31
31
  > Do not try `Skill: quick-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
@@ -34,9 +34,9 @@ For scoped, direct tasks that do not justify going through SPEC or PLAN. Creates
34
34
 
35
35
  - Edits code in the workspace sources.
36
36
  - Minimal session artifacts (lazy DECISION, proposed commit).
37
- - **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/SKILL.md` § *Sequence*).
37
+ - **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*).
38
38
  - **Never touches `docs/`** and exports nothing.
39
- - **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/SKILL.md` § *QUICK delta*.
39
+ - **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*.
40
40
 
41
41
  ## Plan mode
42
42
 
@@ -44,5 +44,5 @@ The skill describes the changes it would apply and the files it would touch, wit
44
44
 
45
45
  ## Resources
46
46
 
47
- - Loop skill: `../loops/quick-loop/SKILL.md`
47
+ - Loop manual: `../loops/quick-loop/LOOP.md`
48
48
  - Design reference: `docs/referencias/workflow-commands/quick.md`
@@ -57,7 +57,7 @@ Assumed facts.
57
57
  Pending doubts. ← the spec-refine-loop closes them.
58
58
  ```
59
59
 
60
- > **`Open questions` goes last** — the refined spec **inserts before `Open questions`** `## UI spec` (if there is UI) + `## Refinement decisions` + `## Q&A traceability` (refined schema in the [`spec-refine-loop`](../loops/spec-refine-loop/SKILL.md)). Same skeleton: the draft and the refined spec share the order.
60
+ > **`Open questions` goes last** — the refined spec **inserts before `Open questions`** `## UI spec` (if there is UI) + `## Refinement decisions` + `## Q&A traceability` (refined schema in the [`spec-refine-loop`](../loops/spec-refine-loop/LOOP.md)). Same skeleton: the draft and the refined spec share the order.
61
61
 
62
62
  **Filling notes:**
63
63
 
@@ -69,7 +69,7 @@ Pending doubts. ← the spec-refine-loop closes them.
69
69
  - The **gaps** the loop detects = weak sections of the schema (vague Requirement, Scope without `Out`, untestable criteria, open questions, undeclared assumptions, contradictions) **+ UI unspecified** when the requirement involves UI.
70
70
  - Equivalent alternative: the user creates the draft by hand. Both paths produce the same `docs/specs/NNN-spec-<slug>.md`.
71
71
 
72
- > **Reuse by escalation:** the live escalation from `/w:quick` (see [`../loops/quick-loop/SKILL.md`](../loops/quick-loop/SKILL.md) § *QUICK delta*) materializes its draft following **this same procedure** (steps 1-3: same schema, same NO RESEARCH single-pass hard rule), with `## Origin` = "escalated from `/w:quick`" + the original prompt. No need to type `/w:spec-new`: the consent in the structured-choice equals invoking it.
72
+ > **Reuse by escalation:** the live escalation from `/w:quick` (see [`../loops/quick-loop/LOOP.md`](../loops/quick-loop/LOOP.md) § *QUICK delta*) materializes its draft following **this same procedure** (steps 1-3: same schema, same NO RESEARCH single-pass hard rule), with `## Origin` = "escalated from `/w:quick`" + the original prompt. No need to type `/w:spec-new`: the consent in the structured-choice equals invoking it.
73
73
 
74
74
  ## Plan mode
75
75
 
@@ -78,4 +78,4 @@ Resolves `NNN` by reading `docs/specs/`, describes the draft it would generate w
78
78
  ## Resources
79
79
 
80
80
  - Design reference: `docs/referencias/workflow-commands/spec-new.md`
81
- - Loop that refines this draft: `../loops/spec-refine-loop/SKILL.md`
81
+ - Loop that refines this draft: `../loops/spec-refine-loop/LOOP.md`
@@ -25,7 +25,7 @@ This command does not refine the spec itself: it delegates to `spec-refine-loop`
25
25
 
26
26
  `spec-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**:
27
27
 
28
- 1. **Read** `../loops/spec-refine-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
28
+ 1. **Read** `../loops/spec-refine-loop/LOOP.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
29
29
  2. **Follow** its instructions taking `$ARGUMENTS` as input: it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports.
30
30
 
31
31
  > Do not try `Skill: spec-refine-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
@@ -47,5 +47,5 @@ The skill resolves the state and describes the actions the loop would run (gaps
47
47
 
48
48
  ## Resources
49
49
 
50
- - Loop skill: `../loops/spec-refine-loop/SKILL.md`
50
+ - Loop manual: `../loops/spec-refine-loop/LOOP.md`
51
51
  - Design reference: `docs/referencias/workflow-commands/spec-refine.md`
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Turns the current folder into an agent-workflow workspace (scaffolding .workflow/ + docs/ + WORKSPACE block + skills.toml). Replaces hub-init + project-init — no project/hub distinction. Run once before any flow; idempotent.
2
+ description: Turns the current folder into an agent-workflow workspace (minimal scaffold — .workflow/sessions + skills.toml + WORKSPACE block + CLI-owned .gitignore; docs/ folders are born on demand). Replaces hub-init + project-init — no project/hub distinction. Run once before any flow; idempotent, re-running reconciles (prunes legacy empty scaffold).
3
3
  argument-hint: --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run]
4
4
  allowed-tools:
5
5
  [
@@ -22,16 +22,18 @@ aw workspace-init --source alias:path[:branch] [--proyecto <name>] [--main-branc
22
22
 
23
23
  1. **Detect/confirm sources** — the CLI detects the repo path(s); the user confirms aliases, paths and branches. Multiple `--source` accepted.
24
24
  2. **Pick default skills** — the catalog of available capabilities (roles) is presented. Per role: `built-in default`, override to a third-party skill (`skills.sh`), or `off`. The result is written to `.workflow/skills.toml`. Config cascade: `built-in → ~/.workflow/skills.toml (global) → .workflow/skills.toml (workspace)`.
25
- 3. **Write the scaffolding** — creates `.workflow/sessions/`, `docs/` with its taxonomy (`specs/`, `plans/`, `scripts/`, `manuals/`, `diagrams/`, `reports/`), the `WORKSPACE` block in CLAUDE.md/AGENTS.md (sources + metadata), and `.workflow/skills.toml`.
26
- 4. **Multi-source** — with ≥2 sources, configures multi-root visibility (settings.local.json + config, gitignored) and reconciles sources.
25
+ 3. **Write the MINIMAL scaffolding** — only the activation set: `.workflow/sessions/` (the marker that activates the operating context), `.workflow/skills.toml`, the `WORKSPACE` block in CLAUDE.md/AGENTS.md (sources + metadata) and the `.gitignore` policy (below). **Nothing else upfront**: each `docs/<category>` folder (`specs/`, `plans/`, `scripts/`, `manuals/`, `diagrams/`, `reports/`) is born on demand at its first numbered write — `aw next-number docs/<cat>` creates it (skills stay unchanged); launch artifacts (`.workflow/launch/<alias>/`) and `docs/logs/` are generated by the launch flow at the first launch.
26
+ 4. **External sources** — for every source living OUTSIDE the workspace folder (any count, including a single external source), configures multi-root visibility (settings.local.json + config, gitignored) and reconciles sources.
27
+
28
+ **Versioning policy (CLI-owned `.gitignore`)** — init writes and owns the full set: ignored = `.workflow/sessions/` (machine-local live log), `.workflow/.lock`, `.workflow/processes.json`, `.workflow/launch/`, `docs/logs/`, and — with external sources — `.claude/settings.local.json*` / `.codex/config.toml*` (patterns cover the `.bak.<epoch>` backups). Versioned = `.workflow/skills.toml`, `docs/**` (deliverables) and `.workflow/HISTORY.md` — the durable record: `aw session-close` upserts each closed session's row there.
27
29
 
28
30
  When done, the user can run `/w:spec-new`, `/w:plan-new` or `/w:quick` directly.
29
31
 
30
- **Idempotent**: re-running reconciles (no duplicate entries, no overwriting manual configuration).
32
+ **Idempotent + reconcile**: re-running reconciles (no duplicate entries, no overwriting manual configuration) and **prunes the legacy upfront scaffold**: `.gitkeep`-only taxonomy folders, stray `.gitkeep` files, an empty `docs/logs/` and a released `.workflow/.lock` leftover are removed; the `.gitignore` is completed to the current set (entries merge under the existing header, never duplicated).
31
33
 
32
34
  ## Plan mode
33
35
 
34
- Resolves the sources and describes the scaffolding it would create, without writing files. Shows what it would create under `.workflow/` and `docs/`, and what it would write into CLAUDE.md.
36
+ Resolves the sources and describes the minimal scaffolding it would create (and what a re-run would prune), without writing files.
35
37
 
36
38
  ## Resources
37
39
 
@@ -3,7 +3,7 @@
3
3
  > This is the **bundle README** for the `export-*` family: the **only** path that promotes session artifacts to permanent `docs/` documents. Each export is invoked by the **user** (never by a loop) as a separate, explicit step.
4
4
  > Related layers: [`../commands/`](../commands/) (Layer 1 flows) · [`../loops/`](../loops/) (Layer 2, AI-driven) · artifacts live in `.workflow/sessions/` (Layer 3). Design reference: `docs/referencias/workflow-exports/`.
5
5
  >
6
- > **Namespace:** these are skills registered **by name** (`name:``export-scripts`, `export-manuals`, `export-diagrams`, `export-reports`); in Claude Code they are reached via the `Skill` tool the by-name binding of the procedure-loading capability, not a universal (see [`../harness/SKILL.md`](../harness/SKILL.md)). The thin `/w:export-*` slash commands that route here are authored separately under [`../commands/`](../commands/).
6
+ > **Namespace:** each export body is an **operating manual** (`EXPORT.md`deliberately not a `SKILL.md`, so no host indexes it as a standalone skill). The user-invocable surface is the `/w:export-*` commands authored under [`../commands/`](../commands/), which read-and-follow the sibling `EXPORT.md` (per-host wrapper: see [`../harness/HARNESS.md`](../harness/HARNESS.md) § *Command packaging*).
7
7
 
8
8
  ---
9
9
 
@@ -24,10 +24,10 @@
24
24
 
25
25
  | Export | Composes | Reads (artifacts / sessions + corpus) | Writes (its ONLY category) |
26
26
  |---|---|---|---|
27
- | [`export-scripts`](export-scripts/SKILL.md) | `sql` | type-B `SCRIPTS.sql` (DDL/DML migrations) across N sessions + standalone `docs/scripts/*.sql` | `docs/scripts/NNN-export-scripts-<date>/` (numbered forwards + `00-ROLLBACK.sql`) |
28
- | [`export-manuals`](export-manuals/SKILL.md) | — (prose: ambient conventions) | sessions + `DECISION` + plan-doc (`Solution`, `Final behavior`, `Validations`) + touched code | `docs/manuals/` |
29
- | [`export-diagrams`](export-diagrams/SKILL.md) | `diagrams` | source code of the sources + plan-doc (`AS-IS` / `TO-BE`, `Impacted`) | `docs/diagrams/` (C4 / mermaid) |
30
- | [`export-reports`](export-reports/SKILL.md) | — (prose: ambient conventions) | corpus of sessions (spec, `CONCLUSIONS`, `DECISION`) + plan-doc state + `docs/` | `docs/reports/` (executive / functional report) |
27
+ | [`export-scripts`](export-scripts/EXPORT.md) | `sql` | type-B `SCRIPTS.sql` (DDL/DML migrations) across N sessions + standalone `docs/scripts/*.sql` | `docs/scripts/NNN-export-scripts-<date>/` (numbered forwards + `00-ROLLBACK.sql`) |
28
+ | [`export-manuals`](export-manuals/EXPORT.md) | — (prose: ambient conventions) | sessions + `DECISION` + plan-doc (`Solution`, `Final behavior`, `Validations`) + touched code | `docs/manuals/` |
29
+ | [`export-diagrams`](export-diagrams/EXPORT.md) | `diagrams` | source code of the sources + plan-doc (`AS-IS` / `TO-BE`, `Impacted`) | `docs/diagrams/` (C4 / mermaid) |
30
+ | [`export-reports`](export-reports/EXPORT.md) | — (prose: ambient conventions) | corpus of sessions (spec, `CONCLUSIONS`, `DECISION`) + plan-doc state + `docs/` | `docs/reports/` (executive / functional report) |
31
31
 
32
32
  > **Composition over ownership:** an export that owns a derived artifact does **not** own its authoring logic — it **composes a capability role** from [`../roles/`](../roles/) (resolved through `.workflow/skills.toml`): `export-scripts` composes `sql`; `export-diagrams` composes `diagrams`. Swapping the implementation is a one-line config change; it never touches the export. `export-manuals` and `export-reports` produce **prose**, which follows **ambient writing conventions** (the host auto-applies an installed writing skill if present) — they do **not** compose or bind a `writing` role.
33
33
 
@@ -36,11 +36,11 @@
36
36
  1. **Layer 1, explicit** — the **user** invokes them (`/w:export-<cat>`). **Never** automatic (no loop fires them).
37
37
  2. **Single-pass, read-only over sessions** — they read artifacts/sessions and `docs/`, **synthesize**, and write **only** their own `docs/<category>/` folder. They do **not** mutate sessions and do **not** open/close loops.
38
38
  3. **Cross-session** — they consolidate **N** sessions + the `docs/` corpus (dedup, roadmap, continuous numbering).
39
- 4. **No loop, no internal sessions** — options come from **args** (no lifecycle *structured-choice*; harness capability — see [`../harness/SKILL.md`](../harness/SKILL.md)).
39
+ 4. **No loop, no internal sessions** — options come from **args** (no lifecycle *structured-choice*; harness capability — see [`../harness/HARNESS.md`](../harness/HARNESS.md)).
40
40
  5. **Git-safe** — they **never** commit, merge, push, `--amend`, or `--no-verify`. The output is a written document the user reviews and commits when ready.
41
41
  6. **DB scripts-only** — `export-scripts` ships migration SCRIPTS as a bundle; it **never executes** DDL/DML (a human/DBA applies them).
42
42
 
43
- ## Section schema of each `export-*/SKILL.md`
43
+ ## Section schema of each `export-*/EXPORT.md`
44
44
 
45
45
  Mirrors `docs/referencias/workflow-exports/` and the old export SKILLs. Frontmatter: `name:` (kebab — exactly `export-scripts` / `export-manuals` / `export-diagrams` / `export-reports`) + rich `description:` (what + when, drives selection). Body:
46
46
 
@@ -63,11 +63,11 @@ Mirrors `docs/referencias/workflow-exports/` and the old export SKILLs. Frontmat
63
63
  Exports read the corpus through the CLI — **never hard-coded paths**:
64
64
 
65
65
  - `aw sessions` — list sessions (counts + next correlative) to enumerate the corpus.
66
- - `aw release-data [--since sessionNNN] [--source alias]` — consolidated dump of sessions (corpus enumeration).
66
+ - `aw release-data [--since sessionNNN] [--source alias] [--include-graduated] [--standalone-sql]` — consolidated dump of sessions (corpus enumeration). `--include-graduated` lists previous `docs/scripts` bundles (modern `NNN-export-scripts-YYYY-MM-DD` and legacy naming); `--standalone-sql` lists loose top-level `docs/scripts/*.sql` (export-scripts' source B).
67
67
  - `aw session-artifacts --code <NNN> [--dump [kinds]]` — counts by default; `--dump` returns `{path, content, size}` per artifact (objetivo, decisiones, conclusiones, tasks, checkpoint, backlog, scripts).
68
- - `aw next-number docs/<category>` — deterministic numbering of the output.
68
+ - `aw next-number docs/<category>` — deterministic numbering of the output. It also **creates the category folder when missing** (workspace-init no longer scaffolds docs/ upfront) — this is what makes destination resolution a CLI guarantee. In plan/dry-run mode call it with `--dry-run` (pure query, creates nothing).
69
69
 
70
- > The destination-folder resolution (workspace root, single- vs multi-source) is handled by the CLI internally. If a specific flag is uncertain at implementation time, it is noted inline in each SKILL.
70
+ > The destination-folder resolution (workspace root, single- vs multi-source, on-demand creation) is handled by the CLI internally. If a specific flag is uncertain at implementation time, it is noted inline in each SKILL.
71
71
 
72
72
  ## 6 Hard invariants (never violate)
73
73
 
@@ -82,7 +82,7 @@ Exports read the corpus through the CLI — **never hard-coded paths**:
82
82
 
83
83
  | Export | File | Category | Composes |
84
84
  |---|---|---|---|
85
- | `export-scripts` | [`export-scripts/SKILL.md`](export-scripts/SKILL.md) | `docs/scripts` | `sql` |
86
- | `export-manuals` | [`export-manuals/SKILL.md`](export-manuals/SKILL.md) | `docs/manuals` | — (prose: ambient conventions) |
87
- | `export-diagrams` | [`export-diagrams/SKILL.md`](export-diagrams/SKILL.md) | `docs/diagrams` | `diagrams` |
88
- | `export-reports` | [`export-reports/SKILL.md`](export-reports/SKILL.md) | `docs/reports` | — (prose: ambient conventions) |
85
+ | `export-scripts` | [`export-scripts/EXPORT.md`](export-scripts/EXPORT.md) | `docs/scripts` | `sql` |
86
+ | `export-manuals` | [`export-manuals/EXPORT.md`](export-manuals/EXPORT.md) | `docs/manuals` | — (prose: ambient conventions) |
87
+ | `export-diagrams` | [`export-diagrams/EXPORT.md`](export-diagrams/EXPORT.md) | `docs/diagrams` | `diagrams` |
88
+ | `export-reports` | [`export-reports/EXPORT.md`](export-reports/EXPORT.md) | `docs/reports` | — (prose: ambient conventions) |
@@ -43,13 +43,13 @@ The **`diagrams`** capability (built-in default `diagrams`), resolved via `.work
43
43
 
44
44
  ## Read-only sandbox
45
45
 
46
- In plan mode it **describes**, never writes: the resolved engine, the levels/sections that would appear (resolved by args), the sources to inspect + detected integrations, and — with a data-model request — the proposed MCP queries with their estimated cost. It does **not** run `Write`, MCP mutations, or effectful `aw next-number`.
46
+ In plan mode it **describes**, never writes: the resolved engine, the levels/sections that would appear (resolved by args), the sources to inspect + detected integrations, and — with a data-model request — the proposed MCP queries with their estimated cost. It does **not** run `Write` or MCP mutations; numbering queries use `aw next-number --dry-run` (pure).
47
47
 
48
48
  ## Inputs
49
49
 
50
50
  **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
51
51
 
52
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the corpus (input for the AS-IS/TO-BE delta).
52
+ - `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the corpus (ALL sessions; input for the AS-IS/TO-BE delta). `aw sessions` alone lists only ACTIVE sessions — never use it as the corpus.
53
53
  - `aw session-artifacts --code <NNN> --dump objetivo` — locates the session and its plan-doc reference; `AS-IS`/`TO-BE`/`Impacted` are read from the plan-doc by its path.
54
54
  - `aw next-number docs/diagrams` — deterministic numbering (the CLI handles destination-folder resolution).
55
55
 
@@ -60,7 +60,7 @@ In plan mode it **describes**, never writes: the resolved engine, the levels/sec
60
60
 
61
61
  **Read-only MCP** (optional, only with a data-model request and configuration): `\d <table>`, `SELECT count(*)`, FK relations for the `erDiagram`. With the cost guard.
62
62
 
63
- **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/SKILL.md`](../../harness/SKILL.md)):
63
+ **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/HARNESS.md`](../../harness/HARNESS.md)):
64
64
 
65
65
  ```
66
66
  /w:export-diagrams [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
@@ -82,7 +82,7 @@ No args: `--engine mermaid --scope todo`. The system **snapshot** is always the
82
82
 
83
83
  ### Step 1 — Resolve context and corpus
84
84
 
85
- `aw sessions` / `release-data` applying `--sessions`/`--since`/`--source`. The CLI handles destination-folder resolution.
85
+ `aw release-data` applying `--sessions`/`--since`/`--source`. The CLI handles destination-folder resolution.
86
86
 
87
87
  ### Step 2 — Inspect the sources
88
88
 
@@ -98,7 +98,7 @@ If `--scope` includes `data` and read-only MCP exists: `\d <table>`, `count(*)`,
98
98
 
99
99
  ### Step 5 — Render (composes `diagrams`)
100
100
 
101
- Per `--engine`: `mermaid` → native Mermaid C4 blocks (`C4Context`/`C4Container`/`C4Component`) and `flowchart` for flows; `c4` → a separate Structurizr `workspace.dsl` + auxiliary embedded Mermaid for offline reading. For every ```` ```mermaid ```` block, add immediately after the closing fence a blockquote with the preview link: `> Ver diagrama renderizado: <https://mermaid.ink/img/BASE64>` (URL-safe base64 of the plain code). Not applicable to `workspace.dsl`.
101
+ Per `--engine`: `mermaid` → native Mermaid C4 blocks (`C4Context`/`C4Container`/`C4Component`) and `flowchart` for flows; `c4` → a separate Structurizr `workspace.dsl` + auxiliary embedded Mermaid for offline reading. Keep block labels ASCII (no accents) for render robustness; prose keeps them. OPTIONALLY add after each closing fence a preview blockquote `> Ver diagrama renderizado: <https://mermaid.ink/img/BASE64>` (URL-safe base64, keep padding) — the link encodes the diagram source into a public-service URL, omit it for private corpora (GitHub renders the blocks natively). Not applicable to `workspace.dsl`.
102
102
 
103
103
  ### Step 6 — Write or report
104
104
 
@@ -122,4 +122,4 @@ Functionally idempotent: each invocation takes the next `NNN`; it never overwrit
122
122
  - Design: `docs/referencias/workflow-exports/export-diagrams.md` · family: [`../README.md`](../README.md).
123
123
  - Composed capability: `diagrams` (built-in default; see `docs/referencias/workflow-roles/`).
124
124
  - Input: plan-doc `AS-IS`/`TO-BE`/`Impacted` (see `docs/plans`).
125
- - Siblings: [`../export-scripts/SKILL.md`](../export-scripts/SKILL.md) · [`../export-manuals/SKILL.md`](../export-manuals/SKILL.md) · [`../export-reports/SKILL.md`](../export-reports/SKILL.md).
125
+ - Siblings: [`../export-scripts/EXPORT.md`](../export-scripts/EXPORT.md) · [`../export-manuals/EXPORT.md`](../export-manuals/EXPORT.md) · [`../export-reports/EXPORT.md`](../export-reports/EXPORT.md).
@@ -44,13 +44,13 @@ The manual's prose follows the **ambient** writing conventions: the host auto-ap
44
44
 
45
45
  ## Read-only sandbox
46
46
 
47
- In plan mode it **describes**, never writes: the resolved mode, the detected topics (with origin sessions), the manuals already present in `docs/manuals/`, and — per mode — the `INDEX.md` structure it would overwrite or the count of manuals the dossier would generate. It does **not** run `Write` or effectful `aw next-number`.
47
+ In plan mode it **describes**, never writes: the resolved mode, the detected topics (with origin sessions), the manuals already present in `docs/manuals/`, and — per mode — the `INDEX.md` structure it would overwrite or the count of manuals the dossier would generate. It does **not** run `Write`; numbering queries use `aw next-number --dry-run` (pure).
48
48
 
49
49
  ## Inputs
50
50
 
51
51
  **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
52
52
 
53
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the corpus.
53
+ - `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the corpus (ALL sessions, closed + active). `aw sessions` alone lists only ACTIVE sessions — never use it as the corpus.
54
54
  - `aw session-artifacts --code <NNN> --dump objetivo,decisiones` — returns `{path, content, size}` per artifact (`SESSION` with its `## Objective`, `DECISION`); the plan-doc is read by its path.
55
55
  - `aw next-number docs/manuals` — deterministic numbering (`regenerate` mode only).
56
56
 
@@ -60,7 +60,7 @@ In plan mode it **describes**, never writes: the resolved mode, the detected top
60
60
  - `docs/manuals/INDEX.md` — re-generable (overwritable) in `complement` mode.
61
61
  - The declared sources' code — read to describe behavior.
62
62
 
63
- **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/SKILL.md`](../../harness/SKILL.md)):
63
+ **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/HARNESS.md`](../../harness/HARNESS.md)):
64
64
 
65
65
  ```
66
66
  /w:export-manuals [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
@@ -89,7 +89,7 @@ No args: `--mode complement` over the whole corpus.
89
89
 
90
90
  ### Step 1 — Resolve context and corpus
91
91
 
92
- `aw sessions` / `release-data` applying `--sessions`/`--since`/`--source`. The CLI handles destination-folder resolution.
92
+ `aw release-data` applying `--sessions`/`--since`/`--source`. The CLI handles destination-folder resolution.
93
93
 
94
94
  ### Step 2 — Inspect the present manuals
95
95
 
@@ -124,4 +124,4 @@ With `--dry-run`: print the report; write nothing. Otherwise: `complement` → `
124
124
  - Design: `docs/referencias/workflow-exports/export-manuals.md` · family: [`../README.md`](../README.md).
125
125
  - Writing: **ambient** convention (not a role) — the host auto-applies an installed writing skill when present.
126
126
  - Source artifacts: `DECISION` + plan-doc (see `docs/referencias/workflow-artifacts/artifacts-exec/` and `docs/specs`/`docs/plans`).
127
- - Siblings: [`../export-scripts/SKILL.md`](../export-scripts/SKILL.md) · [`../export-diagrams/SKILL.md`](../export-diagrams/SKILL.md) · [`../export-reports/SKILL.md`](../export-reports/SKILL.md).
127
+ - Siblings: [`../export-scripts/EXPORT.md`](../export-scripts/EXPORT.md) · [`../export-diagrams/EXPORT.md`](../export-diagrams/EXPORT.md) · [`../export-reports/EXPORT.md`](../export-reports/EXPORT.md).
@@ -43,13 +43,13 @@ The report's prose follows the **ambient** writing conventions: the host auto-ap
43
43
 
44
44
  ## Read-only sandbox
45
45
 
46
- In plan mode it **describes**, never writes: the resolved audience/length, the corpus sessions that would enter after the filters, the sections that would appear, the R-items that would consolidate (and detected conflicts), and the estimated length. It does **not** run `Write` or effectful `aw next-number`.
46
+ In plan mode it **describes**, never writes: the resolved audience/length, the corpus sessions that would enter after the filters, the sections that would appear, the R-items that would consolidate (and detected conflicts), and the estimated length. It does **not** run `Write`; numbering queries use `aw next-number --dry-run` (pure).
47
47
 
48
48
  ## Inputs
49
49
 
50
50
  **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
51
51
 
52
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates + filters the corpus.
52
+ - `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates + filters the corpus (ALL sessions, closed + active, with `release_eligible`). `aw sessions` alone lists only ACTIVE sessions — never use it as the corpus.
53
53
  - `aw session-artifacts --code <NNN> --dump objetivo,conclusiones,decisiones` — returns `{path, content, size}` for `SESSION` (referenced spec), `CONCLUSIONS` and `DECISION`; the plan-doc state is read by its path.
54
54
  - `aw next-number docs/reports` — deterministic numbering (the CLI handles destination-folder resolution).
55
55
 
@@ -57,7 +57,7 @@ In plan mode it **describes**, never writes: the resolved audience/length, the c
57
57
 
58
58
  - `docs/specs`, `docs/plans`, `docs/reports/*` — context + collision avoidance.
59
59
 
60
- **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/SKILL.md`](../../harness/SKILL.md)):
60
+ **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/HARNESS.md`](../../harness/HARNESS.md)):
61
61
 
62
62
  ```
63
63
  /w:export-reports [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
@@ -79,7 +79,7 @@ No args: the whole corpus, executive audience by default.
79
79
 
80
80
  ### Step 1 — Resolve context and filter the corpus
81
81
 
82
- `aw sessions` / `release-data` applying `--sessions`/`--since`/`--source`. If the resulting set is empty → **abort** with an explicit message (no sessions in the declared range). The CLI handles destination-folder resolution.
82
+ `aw release-data` applying `--sessions`/`--since`/`--source`. If the resulting set is empty → **abort** with an explicit message (no sessions in the declared range). The CLI handles destination-folder resolution.
83
83
 
84
84
  ### Step 2 — Collect per-session inputs
85
85
 
@@ -91,7 +91,7 @@ Extract the R-items from `CONCLUSIONS`/`DECISION` (pending, deferred, "next step
91
91
 
92
92
  ### Step 4 — Synthesize (prose: ambient conventions)
93
93
 
94
- Render applying the ambient writing conventions (host): Executive summary · What was done (grouped by business capability, **not** by session) · Impacted components (table) · Key decisions · Results/conclusions · Pending/Roadmap (only with R-items). Technical→executive translation and length cap per `--audience`. Optional: a simple synthesis `flowchart LR` (with a `mermaid.ink` link); the detailed technical diagram belongs to `export-diagrams`.
94
+ Render applying the ambient writing conventions (host): Executive summary · What was done (grouped by business capability, **not** by session) · Impacted components (table) · Key decisions · Results/conclusions · Pending/Roadmap (only with R-items). Technical→executive translation and length cap per `--audience`. Optional: a simple synthesis `flowchart LR` (inline; a `mermaid.ink` link is OPTIONAL — it encodes the diagram source into a public-service URL, omit it for private corpora); the detailed technical diagram belongs to `export-diagrams`.
95
95
 
96
96
  ### Step 5 — Write or report
97
97
 
@@ -110,4 +110,4 @@ Functionally idempotent: each invocation takes the next `NNN`; it never overwrit
110
110
  - Design: `docs/referencias/workflow-exports/export-reports.md` · family: [`../README.md`](../README.md).
111
111
  - Writing: **ambient** convention (not a role) — the host auto-applies an installed writing skill when present.
112
112
  - Inputs: spec (`docs/specs`), `CONCLUSIONS`/`DECISION` (see `docs/referencias/workflow-artifacts/`), plan-doc (`docs/plans`).
113
- - Siblings: [`../export-scripts/SKILL.md`](../export-scripts/SKILL.md) · [`../export-manuals/SKILL.md`](../export-manuals/SKILL.md) · [`../export-diagrams/SKILL.md`](../export-diagrams/SKILL.md).
113
+ - Siblings: [`../export-scripts/EXPORT.md`](../export-scripts/EXPORT.md) · [`../export-manuals/EXPORT.md`](../export-manuals/EXPORT.md) · [`../export-diagrams/EXPORT.md`](../export-diagrams/EXPORT.md).
@@ -44,21 +44,22 @@ The **`sql`** capability (built-in default `sql`), resolved via `.workflow/skill
44
44
 
45
45
  ## Read-only sandbox
46
46
 
47
- In plan mode it **describes**, never writes: the resolved `NNN`, the detected sources (sessions + standalone), the categories with content, the files that would appear at the bundle root and the approximate README content. It does **not** run `Write`, effectful `aw next-number`, or mutations.
47
+ In plan mode it **describes**, never writes: the resolved `NNN`, the detected sources (sessions + standalone), the categories with content, the files that would appear at the bundle root and the approximate README content. It does **not** run `Write` or mutations; numbering queries use `aw next-number --dry-run` (pure).
48
48
 
49
49
  ## Inputs
50
50
 
51
51
  **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
52
52
 
53
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the session corpus.
53
+ - `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the session corpus (ALL sessions, closed + active, with `release_eligible`). `aw sessions` alone lists only ACTIVE sessions — never use it as the corpus.
54
54
  - `aw session-artifacts --code <NNN> --dump scripts` — lists the session's `.sql` files with path and size (content is read by path). No scripts → empty list, silent skip.
55
- - `aw next-number docs/scripts` deterministic numbering of the bundle directory (the CLI handles destination-folder resolution).
55
+ - `aw release-data --standalone-sql` — lists the loose top-level `docs/scripts/*.sql` (source B) deterministically, with `is_rollback` flag; `--include-graduated` lists previous bundles (modern `NNN-export-scripts-YYYY-MM-DD` and legacy naming) for the exclusion/dedup step.
56
+ - `aw next-number docs/scripts` — deterministic numbering of the bundle directory; it also creates `docs/scripts` when missing (the CLI guarantees destination resolution). In plan mode use `--dry-run` (pure query).
56
57
 
57
58
  **Filesystem**:
58
59
 
59
- - Standalone `docs/scripts/*.sql` (top-level only), **excluding** any `docs/scripts/NNN-export-scripts-*/` (previous outputs of this export).
60
+ - Standalone `docs/scripts/*.sql` (top-level only, via `--standalone-sql`), **excluding** any `docs/scripts/NNN-export-scripts-*/` (previous outputs of this export).
60
61
 
61
- **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/SKILL.md`](../../harness/SKILL.md)):
62
+ **Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/HARNESS.md`](../../harness/HARNESS.md)):
62
63
 
63
64
  ```
64
65
  /w:export-scripts [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
@@ -79,7 +80,7 @@ No args: every corpus session + every standalone `.sql` (excluding previous bund
79
80
 
80
81
  ### Step 1 — Collect SQL sources
81
82
 
82
- **Source A — sessions**: for every corpus session (`aw sessions` / `release-data` + `session-artifacts --code <NNN> --dump scripts`), read the `.sql` files the dump lists (per-script path). Take **only** type-B statements (deliverable DDL/DML migrations); ignore read-only type-A (diagnostic queries). Expected per-statement markers: `-- @category: <01-04>` + `-- @stmt: NNN-verb-target` (format defined by the `sql` capability).
83
+ **Source A — sessions**: for every corpus session (`aw release-data` + `session-artifacts --code <NNN> --dump scripts`), read the `.sql` files the dump lists (per-script path). Take **only** type-B statements (deliverable DDL/DML migrations); ignore read-only type-A (diagnostic queries). Expected per-statement markers: `-- @category: <01-04>` + `-- @stmt: NNN-verb-target` (format defined by the `sql` capability).
83
84
 
84
85
  **Source B — standalone** (unless `--skip-standalone`): list top-level `docs/scripts/*.sql`, **excluding** `docs/scripts/NNN-export-scripts-*/`. Per file: honor `@category` markers when present; otherwise infer the category from content (`CREATE/ALTER TABLE`, `CREATE INDEX` → `01`; `CREATE OR REPLACE FUNCTION`/`PROCEDURE` → `02`; `UPDATE`/`DELETE` → `03`; `INSERT INTO … VALUES` → `04`). If the filename contains `rollback` → skip (it never enters a forward).
85
86
 
@@ -132,4 +133,4 @@ Functionally idempotent: each invocation takes the next `NNN` and **never overwr
132
133
  - Design: `docs/referencias/workflow-exports/export-scripts.md` · family: [`../README.md`](../README.md).
133
134
  - Composed capability: `sql` (built-in default; see `docs/referencias/workflow-roles/`).
134
135
  - Source artifact: `SCRIPTS.sql` (see `docs/referencias/workflow-artifacts/artifacts-core/`).
135
- - Siblings: [`../export-manuals/SKILL.md`](../export-manuals/SKILL.md) · [`../export-diagrams/SKILL.md`](../export-diagrams/SKILL.md) · [`../export-reports/SKILL.md`](../export-reports/SKILL.md).
136
+ - Siblings: [`../export-manuals/EXPORT.md`](../export-manuals/EXPORT.md) · [`../export-diagrams/EXPORT.md`](../export-diagrams/EXPORT.md) · [`../export-reports/EXPORT.md`](../export-reports/EXPORT.md).
@@ -49,7 +49,7 @@ Concrete mechanism per harness (**Jul-2026**, verified against official docs; `~
49
49
 
50
50
  | Capability | Claude Code | Codex | Gemini / Antigravity | OpenCode | Crush | Warp / Oz | Generic |
51
51
  |---|---|---|---|---|---|---|---|
52
- | command-invocation | `.claude/commands/` (slash) | slash + skills | `.gemini/commands/*.toml` | `.opencode/command/` | user-invocable skills | Workflows (Drive) | text |
52
+ | command-invocation | `.claude/commands/` (slash) | skills only (`$` mention; no commands dir, prompts removed) | skills only in agy (system slash commands; `.gemini/commands/*.toml` = legacy Gemini CLI) | `.opencode/command/` | `.crush/commands` (palette) + user-invocable skills | skills as `/name` | text |
53
53
  | procedure-loading (skills) | `SKILL.md` `.claude/skills` | `SKILL.md` `.agents/skills` | `SKILL.md` (agentskills) | `SKILL.md` `.opencode`+`.claude`+`.agents` | `SKILL.md` `.agents`+`.crush`+`.claude` | `SKILL.md` `.agents`+`.warp`+`.claude` | read-and-follow `.md` |
54
54
  | structured-choice | `AskUserQuestion` (**main-agent only**) | — | — | — | — | — | numbered markdown |
55
55
  | compaction | `/compact` | Pre/PostCompact hooks | ~ | `session.compacted` | ~ | ~ | CHECKPOINT + resume |
@@ -61,7 +61,7 @@ Concrete mechanism per harness (**Jul-2026**, verified against official docs; `~
61
61
 
62
62
  > **Notes (field research Jul-2026):** **`SKILL.md` skills** are the **universal** portable unit — **all six** harnesses support them (Codex added them Dec-2025; **`.agents/skills` is the cross-host anchor**, read by Codex/OpenCode/Crush/Warp). **Structured choice** (`AskUserQuestion`) remains **Claude Code / main-agent only** → elsewhere `structured-choice` degrades to numbered markdown. The **enforcement layer** (new row) is **NO longer Claude-exclusive**: Codex + Gemini use a near-identical protocol (`permissionDecision:deny` / exit 2) and OpenCode blocks via `throw` in a JS plugin; Crush/Warp only offer **coarse** allow/deny (no custom per-command logic) → there, conventions stay **advisory** + allow/deny lists. Enforced **plan mode** is never trusted for safety; git-safe (invariant #5) is our own. **MCP** is universal (each host its file/key). The **guaranteed floor** (last column) runs the full model.
63
63
 
64
- > **Oz (Warp's cloud sibling).** `oz agent run` is a cloud agent orchestrator that **reuses Warp's surfaces**: same skills (`.agents/skills`, flattened to top level like Warp) and `AGENTS.md`, with `structured-choice` equally degraded to numbered markdown. It differs in three points: **detection** via `OZ_RUN_ID` (takes priority over Warp when both markers coexist); **MCP without a config file** — the JSON is passed via the `--mcp` flag of `oz agent run` (or the `OZ_MCP_CONFIG` env), it never writes `.warp/.mcp.json`; and **no plugin or hooks** (advisory enforcement, like Warp). Hence it shares the **Warp / Oz** column with that MCP caveat.
64
+ > **Oz (Warp's cloud sibling).** `oz agent run` is a cloud agent orchestrator that **reuses Warp's surfaces**: same skills (`.agents/skills`, top-level dirs like Warp) and `AGENTS.md`, with `structured-choice` equally degraded to numbered markdown. It differs in three points: **detection** via `OZ_RUN_ID` (takes priority over Warp when both markers coexist); **MCP without a config file** — the JSON is passed via the `--mcp` flag of `oz agent run` (or the `OZ_MCP_CONFIG` env), it never writes `.warp/.mcp.json`; and **no plugin or hooks** (advisory enforcement, like Warp). Hence it shares the **Warp / Oz** column with that MCP caveat.
65
65
 
66
66
  ## Leverage installed skills
67
67
 
@@ -72,7 +72,7 @@ Concrete mechanism per harness (**Jul-2026**, verified against official docs; `~
72
72
 
73
73
  ## Convention for the rest of the corpus
74
74
 
75
- - Loops/commands reference the **capability** by name (e.g. "*structured-choice* (see `harness/SKILL.md`)"), **never** the concrete tool.
75
+ - Loops/commands reference the **capability** by name (e.g. "*structured-choice* (see `harness/HARNESS.md`)"), **never** the concrete tool.
76
76
  - The historical name `AskUserQuestion` survives **only** as the Claude-Code binding of `structured-choice` (this table), never as doctrine vocabulary.
77
77
  - The `flow` lifecycle control (`Compactar`/`Cerrar`) belongs to the `structured-choice` capability, not to a tool: on harnesses without structured choice it is offered as one more textual option.
78
78
 
@@ -82,7 +82,18 @@ Proven pattern (Spec Kit, 30+ agents): **one canonical source** + generate/symli
82
82
 
83
83
  ## Command packaging (harness-specific)
84
84
 
85
- Each command's **contract** (Flow, Trigger, Input, Mode, …) is agnostic. The **file** the harness executes wraps that contract in its native format: Claude Code = slash command with frontmatter (`description`, `argument-hint`, `allowed-tools`) + a body that invokes the skill or the `aw` CLI; Codex = slash command or skill; Gemini/Antigravity = `.gemini/commands/*.toml`; OpenCode = `.opencode/command/*.md`; Crush/Warp = the invocable **skill itself**. The **universal fallback** is *skill-as-command*: since all six harnesses load skills, the doctrine always runs even without native commands. The contract never changes; the wrapper does (another column).
85
+ Each command's **contract** (Flow, Trigger, Input, Mode, …) is agnostic. The **file** the harness executes wraps that contract in its native format the installer (`aw self install-skill`) emits the right wrapper per host:
86
+
87
+ | Host | Wrapper installed | Invoked as |
88
+ |---|---|---|
89
+ | Claude Code | `~/.claude/commands/w/<cmd>.md` (frontmatter `description`/`argument-hint`/`allowed-tools`) | `/w:<cmd>` |
90
+ | Codex | synthesized skill `~/.codex/skills/w-<cmd>/SKILL.md` (Codex reads no commands dir; custom prompts deprecated/removed since 0.14x) | `$w-<cmd>` mention |
91
+ | Gemini/Antigravity | synthesized skill `~/.gemini/skills/w-<cmd>/SKILL.md` (agy reads NO commands dir — slash commands are system-only; verified vs agy 1.0.16 binary) + `~/.gemini/commands/w/<cmd>.toml` kept for legacy Gemini CLI | skill (agy) · `/w:<cmd>` (legacy CLI) |
92
+ | OpenCode | `~/.opencode/command/w/<cmd>.md` | `/w/<cmd>` |
93
+ | Crush | `~/.crush/commands/w/<cmd>.md` (plain body — Crush parses no frontmatter) | palette `user:w:<cmd>` |
94
+ | Warp/Oz | synthesized skill `w-<cmd>/SKILL.md` next to the bundle (Warp lists skills as `/name`) | `/w-<cmd>` |
95
+
96
+ *Skill-as-command* (a synthesized `w-<cmd>` skill whose body is the command, with bundle references rewritten to `../w/…`) is the **universal fallback** for any host without a native commands surface. The loop/role/export manuals are deliberately **not** `SKILL.md` files (`LOOP.md`/`ROLE.md`/`EXPORT.md`/`HARNESS.md`): hosts that scan skill roots **recursively** (Codex ≤6 levels; OpenCode and Crush — which also cross-read `~/.claude/skills` and `~/.agents/skills`) must never index the internals as invocable skills. The contract never changes; the wrapper does (another column).
86
97
 
87
98
  ## Status
88
99
 
@@ -6,11 +6,11 @@ This document is the **common engine** of the agent-workflow loops: the doctrine
6
6
 
7
7
  The **5 loops** run this engine; each adds only its deltas:
8
8
 
9
- - [`spec-refine-loop`](spec-refine-loop/SKILL.md) — refines the **spec** in place; deltas: spec gap taxonomy, analyze gate, `## UI spec` via the `ui-design` capability.
10
- - [`plan-new-loop`](plan-new-loop/SKILL.md) — generates the **plan** from the spec; deltas: rich plan + plan gap taxonomy (+ per-screen design SPECs when the plan includes UI).
11
- - [`plan-refine-loop`](plan-refine-loop/SKILL.md) — refines the **plan** in place (auxiliary, not mandatory); reuses the gap taxonomy + coherence gate of `plan-new-loop`. It is to `plan-new` what `spec-refine` is to `spec-new`.
12
- - [`plan-exec-loop`](plan-exec-loop/SKILL.md) — **executes** the plan: code/DB/git, a single session per run, per-phase progress in the plan-doc, no auto-export. Applies the policies in [`CODE-POLICIES.md`](CODE-POLICIES.md).
13
- - [`quick-loop`](quick-loop/SKILL.md) — the engine with **minimal ceremony** (the prompt *is* the objective); also applies [`CODE-POLICIES.md`](CODE-POLICIES.md) (proportional gate).
9
+ - [`spec-refine-loop`](spec-refine-loop/LOOP.md) — refines the **spec** in place; deltas: spec gap taxonomy, analyze gate, `## UI spec` via the `ui-design` capability.
10
+ - [`plan-new-loop`](plan-new-loop/LOOP.md) — generates the **plan** from the spec; deltas: rich plan + plan gap taxonomy (+ per-screen design SPECs when the plan includes UI).
11
+ - [`plan-refine-loop`](plan-refine-loop/LOOP.md) — refines the **plan** in place (auxiliary, not mandatory); reuses the gap taxonomy + coherence gate of `plan-new-loop`. It is to `plan-new` what `spec-refine` is to `spec-new`.
12
+ - [`plan-exec-loop`](plan-exec-loop/LOOP.md) — **executes** the plan: code/DB/git, a single session per run, per-phase progress in the plan-doc, no auto-export. Applies the policies in [`CODE-POLICIES.md`](CODE-POLICIES.md).
13
+ - [`quick-loop`](quick-loop/LOOP.md) — the engine with **minimal ceremony** (the prompt *is* the objective); also applies [`CODE-POLICIES.md`](CODE-POLICIES.md) (proportional gate).
14
14
 
15
15
  ## Persistent objective
16
16
 
@@ -92,7 +92,7 @@ The **CLI owns the number**: `aw session-create` prepends a **global, sequential
92
92
 
93
93
  - `aw session-create --type <type> --name <slug>-<flow>` → creates `NNN-<slug>-<flow>` / `aw session-resume --code <…>` (detects `CHECKPOINT`).
94
94
  - `aw checkpoint-write` / `aw checkpoint-read` for resume.
95
- - `aw session-close` on close (with reason); `aw session-artifacts` to inspect.
95
+ - `aw session-close` on close — also upserts the session's HISTORY.md row (the durable record; sessions/ is gitignored). Non-fatal: on `history_error` in its output, re-run `aw history-update --code <NNN> --state closed`. `aw session-artifacts` to inspect.
96
96
  - **Reopen to continue** (operating context, row 2): `aw session-resume --code <NNN> --reopen` reactivates a **closed** session (removes `.closed` → active) to keep working in it; without `--reopen`, resume is read-only. To detect the most recent closed one: `aw resume-summary --include-recent-closed` (or `aw sessions --state all`).
97
97
 
98
98
  ## Ask-vs-research rule (the discriminator)
@@ -119,7 +119,7 @@ Investigation is **inline**: an activity **inside the run's current session**, n
119
119
 
120
120
  ## Structured-choice (design & batching)
121
121
 
122
- **Canonical rule (single source — the rest of the corpus only references it):** *structured-choice* = **≤3 content questions + 1 `flow` control**, always. Per-harness binding in [`../harness/SKILL.md`](../harness/SKILL.md) (Claude Code: `AskUserQuestion`, max 4 questions/call; without structured choice it degrades to **numbered markdown**).
122
+ **Canonical rule (single source — the rest of the corpus only references it):** *structured-choice* = **≤3 content questions + 1 `flow` control**, always. Per-harness binding in [`../harness/HARNESS.md`](../harness/HARNESS.md) (Claude Code: `AskUserQuestion`, max 4 questions/call; without structured choice it degrades to **numbered markdown**).
123
123
 
124
124
  - Since the `flow` control is **always** present → **≤3 content questions + 1 `flow` control**.
125
125
  - **`flow` control** (lifecycle, always present): `Compactar` | `Cerrar`. Answering only the content questions (not touching `flow`) = keep iterating.
@@ -142,7 +142,7 @@ Resume **keys off the `CHECKPOINT`** of the run's session, not the existence of
142
142
 
143
143
  > Each heir defines its **prior-work mark**: in the refine loops, the presence of `## Refinement decisions` + `## Q&A traceability` in the doc; in plan-exec, the plan-doc's `- [x]` checkboxes; quick has no doc (resume by CHECKPOINT only).
144
144
 
145
- > **`Compactar`** (the `flow` control, across all 3 cases) → write `CHECKPOINT.md` in the session (in-flight progress, remaining gaps, Q&A, `attempts`) → trigger the harness **compaction** (Claude Code: `/compact`; see [`../harness/SKILL.md`](../harness/SKILL.md)) → resume by reading the checkpoint.
145
+ > **`Compactar`** (the `flow` control, across all 3 cases) → write `CHECKPOINT.md` in the session (in-flight progress, remaining gaps, Q&A, `attempts`) → trigger the harness **compaction** (Claude Code: `/compact`; see [`../harness/HARNESS.md`](../harness/HARNESS.md)) → resume by reading the checkpoint.
146
146
 
147
147
  ## Convergence / exit
148
148
 
@@ -162,7 +162,7 @@ The loops that **edit code** (`plan-exec-loop`, `quick-loop`) additionally run t
162
162
  Applies to **every** relative reference in the doctrine — never repeated per link:
163
163
 
164
164
  1. **Normal install** (the `w/` tree): the relative path resolves as-is (`../CHASSIS.md`, `../../commands/spec-new.md`).
165
- 2. **Flattened install** (e.g. Warp/Oz): the shared `.md` files (`CHASSIS.md`, `CODE-POLICIES.md`) sit **next to the loop's `SKILL.md`**; another loop is a **sibling** skill `w-<loop>/` (e.g. `../spec-refine-loop/SKILL.md` `../w-spec-refine-loop/SKILL.md`).
165
+ 2. **Synthesized command skills** (hosts without a commands dir Codex/Warp/Oz): each command installs as a **sibling** skill `w-<command>/` with its references rewritten into the bundle (`../loops/…` `../w/loops/…`); the `w/` tree stays intact, so loop-to-loop references resolve as a normal install.
166
166
  3. A reference that does not resolve = **optional deep-dive** — this engine's doctrine is self-contained.
167
167
 
168
168
  The chassis **is not a skill** (no frontmatter; never invoked nor bound via `.workflow/skills.toml`): it enters the context only because a loop orders it read from its `## Inherits`. It does not define flow, deliverable or gap taxonomy — that belongs to each heir.