@tacuchi/agent-workflow-cli 20.22.0 → 20.23.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 (109) hide show
  1. package/dist/adapters/git-cli.js +42 -0
  2. package/dist/adapters/git-cli.js.map +1 -1
  3. package/dist/application/artifacts-service.js +5 -5
  4. package/dist/application/artifacts-service.js.map +1 -1
  5. package/dist/application/checkpoint-service.js +60 -55
  6. package/dist/application/checkpoint-service.js.map +1 -1
  7. package/dist/application/checkpoint-write-service.js +61 -66
  8. package/dist/application/checkpoint-write-service.js.map +1 -1
  9. package/dist/application/decisiones-service.js +5 -5
  10. package/dist/application/decisiones-service.js.map +1 -1
  11. package/dist/application/export-service.js +250 -0
  12. package/dist/application/export-service.js.map +1 -0
  13. package/dist/application/fix-git-service.js +244 -0
  14. package/dist/application/fix-git-service.js.map +1 -0
  15. package/dist/application/history-update-service.js +35 -24
  16. package/dist/application/history-update-service.js.map +1 -1
  17. package/dist/application/lifecycle-target.js +39 -0
  18. package/dist/application/lifecycle-target.js.map +1 -0
  19. package/dist/application/parsers/spec-relation.js +80 -0
  20. package/dist/application/parsers/spec-relation.js.map +1 -0
  21. package/dist/application/paths-service.js +8 -0
  22. package/dist/application/paths-service.js.map +1 -1
  23. package/dist/application/persist-service.js +285 -0
  24. package/dist/application/persist-service.js.map +1 -0
  25. package/dist/application/release-data/artifacts.js +17 -21
  26. package/dist/application/release-data/artifacts.js.map +1 -1
  27. package/dist/application/resume-service.js +184 -0
  28. package/dist/application/resume-service.js.map +1 -0
  29. package/dist/application/semantic-operation/protocol.js +247 -0
  30. package/dist/application/semantic-operation/protocol.js.map +1 -0
  31. package/dist/application/semantic-operation/publish.js +80 -0
  32. package/dist/application/semantic-operation/publish.js.map +1 -0
  33. package/dist/application/session-binding-service.js +125 -0
  34. package/dist/application/session-binding-service.js.map +1 -0
  35. package/dist/application/session-close-service.js +60 -39
  36. package/dist/application/session-close-service.js.map +1 -1
  37. package/dist/application/session-create-service.js +45 -19
  38. package/dist/application/session-create-service.js.map +1 -1
  39. package/dist/application/session-resolver.js +180 -44
  40. package/dist/application/session-resolver.js.map +1 -1
  41. package/dist/application/session-resume-service.js +39 -9
  42. package/dist/application/session-resume-service.js.map +1 -1
  43. package/dist/application/sessions-service.js +0 -2
  44. package/dist/application/sessions-service.js.map +1 -1
  45. package/dist/application/status-service.js +24 -388
  46. package/dist/application/status-service.js.map +1 -1
  47. package/dist/application/tasks-service.js +5 -5
  48. package/dist/application/tasks-service.js.map +1 -1
  49. package/dist/application/workline-index-service.js +510 -0
  50. package/dist/application/workline-index-service.js.map +1 -0
  51. package/dist/cli/commands/checkpoint-read.js +10 -6
  52. package/dist/cli/commands/checkpoint-read.js.map +1 -1
  53. package/dist/cli/commands/checkpoint-write.js +38 -11
  54. package/dist/cli/commands/checkpoint-write.js.map +1 -1
  55. package/dist/cli/commands/export.js +117 -0
  56. package/dist/cli/commands/export.js.map +1 -0
  57. package/dist/cli/commands/fix-git.js +109 -0
  58. package/dist/cli/commands/fix-git.js.map +1 -0
  59. package/dist/cli/commands/generate-launch.js +35 -3
  60. package/dist/cli/commands/generate-launch.js.map +1 -1
  61. package/dist/cli/commands/history-update.js +1 -1
  62. package/dist/cli/commands/history-update.js.map +1 -1
  63. package/dist/cli/commands/index.js +11 -0
  64. package/dist/cli/commands/index.js.map +1 -1
  65. package/dist/cli/commands/persist.js +67 -0
  66. package/dist/cli/commands/persist.js.map +1 -0
  67. package/dist/cli/commands/resume-summary.js +14 -3
  68. package/dist/cli/commands/resume-summary.js.map +1 -1
  69. package/dist/cli/commands/resume.js +73 -0
  70. package/dist/cli/commands/resume.js.map +1 -0
  71. package/dist/cli/commands/session-artifacts.js +12 -11
  72. package/dist/cli/commands/session-artifacts.js.map +1 -1
  73. package/dist/cli/commands/session-close.js +8 -7
  74. package/dist/cli/commands/session-close.js.map +1 -1
  75. package/dist/cli/commands/session-create.js +5 -1
  76. package/dist/cli/commands/session-create.js.map +1 -1
  77. package/dist/cli/commands/session-resume.js +16 -10
  78. package/dist/cli/commands/session-resume.js.map +1 -1
  79. package/dist/cli/commands/status.js +66 -2
  80. package/dist/cli/commands/status.js.map +1 -1
  81. package/dist/cli/commands/workspace-init.js +21 -2
  82. package/dist/cli/commands/workspace-init.js.map +1 -1
  83. package/dist/cli/context-id.js +133 -0
  84. package/dist/cli/context-id.js.map +1 -0
  85. package/dist/cli/help-groups.js +16 -1
  86. package/dist/cli/help-groups.js.map +1 -1
  87. package/dist/cli/main.js +44 -16
  88. package/dist/cli/main.js.map +1 -1
  89. package/dist/cli/output-mode.js +41 -0
  90. package/dist/cli/output-mode.js.map +1 -0
  91. package/dist/cli/parser.js +6 -0
  92. package/dist/cli/parser.js.map +1 -1
  93. package/dist/cli/registry.js.map +1 -1
  94. package/dist/cli/render.js +53 -0
  95. package/dist/cli/render.js.map +1 -1
  96. package/package.json +1 -1
  97. package/skills/w/commands/export-diagrams.md +19 -10
  98. package/skills/w/commands/export-manuals.md +20 -10
  99. package/skills/w/commands/export-reports.md +20 -11
  100. package/skills/w/commands/export-scripts.md +20 -10
  101. package/skills/w/commands/fix-git.md +31 -12
  102. package/skills/w/commands/generate-launch.md +1 -1
  103. package/skills/w/commands/persist.md +33 -68
  104. package/skills/w/commands/resume.md +25 -46
  105. package/skills/w/commands/status.md +12 -48
  106. package/skills/w/commands/workspace-init.md +3 -3
  107. package/skills/w/hooks/README.md +21 -2
  108. package/skills/w/hooks/hooks.template.json +2 -2
  109. package/skills/w/roles/git/ROLE.md +7 -8
@@ -0,0 +1,41 @@
1
+ const OUTPUT_FORMATS = ["human", "json"];
2
+ export function resolveOutputMode(args, isTTY) {
3
+ const declared = readDeclaredFormat(args);
4
+ if (!declared.ok)
5
+ return declared;
6
+ const detail = args.flags.has("--detail");
7
+ if (detail && declared.format === "json") {
8
+ return {
9
+ ok: false,
10
+ message: "--detail solo aplica a la salida humana: el modelo JSON ya es completo",
11
+ };
12
+ }
13
+ const format = declared.format ?? (detail || isTTY ? "human" : "json");
14
+ return { ok: true, mode: { format, detail } };
15
+ }
16
+ /**
17
+ * The format the invocation *declares*, or none. Contradictions fail here
18
+ * rather than resolving by precedence: a caller who wrote both `--json` and
19
+ * `--format human` has a bug, and silently honoring one hides it.
20
+ */
21
+ function readDeclaredFormat(args) {
22
+ const json = args.flags.has("--json");
23
+ const raw = args.values.get("format");
24
+ if (raw === undefined) {
25
+ if (args.flags.has("--format")) {
26
+ return { ok: false, message: "--format requiere un valor: human | json" };
27
+ }
28
+ return json ? { ok: true, format: "json" } : { ok: true };
29
+ }
30
+ if (!isOutputFormat(raw)) {
31
+ return { ok: false, message: `--format debe ser human o json (got '${raw}')` };
32
+ }
33
+ if (json && raw !== "json") {
34
+ return { ok: false, message: `--json contradice --format ${raw}: declará uno solo` };
35
+ }
36
+ return { ok: true, format: raw };
37
+ }
38
+ function isOutputFormat(value) {
39
+ return OUTPUT_FORMATS.includes(value);
40
+ }
41
+ //# sourceMappingURL=output-mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-mode.js","sourceRoot":"","sources":["../../src/cli/output-mode.ts"],"names":[],"mappings":"AAiCA,MAAM,cAAc,GAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAE5D,MAAM,UAAU,iBAAiB,CAAC,IAAgB,EAAE,KAAc;IAChE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IAElC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACzC,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,wEAAwE;SAClF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CA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AACxC,CAAC"}
@@ -59,6 +59,12 @@ const BOOLEAN_FLAGS = new Set([
59
59
  "include-graduated",
60
60
  "include-legacy",
61
61
  "include-recent-closed",
62
+ "can-pause",
63
+ // Output projection (see output-mode.ts). `--format` takes a value and stays
64
+ // out; these two are presence-only and MUST be here or `aw status --json` and
65
+ // `aw resume --detail 009` would swallow the following positional.
66
+ "json",
67
+ "detail",
62
68
  "include-docs",
63
69
  "from-sources",
64
70
  "exported-only",
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/cli/parser.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAgB,EAAE,IAAY;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,4EAA4E;AAC5E,4EAA4E;AAC5E,oCAAoC;AACpC,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,mDAAmD;AACnD,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,QAAQ;IACR,QAAQ;IACR,gBAAgB;IAChB,WAAW;IACX,2EAA2E;IAC3E,MAAM;IACN,SAAS;CACV,CAAC,CAAC;AAEH,6EAA6E;AAC7E,iFAAiF;AACjF,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,+BAA+B;AAC/B,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACjD,KAAK;IACL,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;I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C,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,IAAI,yBAAyB,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/cli/registry.ts"],"names":[],"mappings":"AAwBA,MAAM,OAAO,eAAe;IACT,QAAQ,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE1D,QAAQ,CAAC,OAAmB;QAC1B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,IAAI,yBAAyB,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF"}
@@ -11,9 +11,62 @@ export function fail(code, message, data, exitCode = 1) {
11
11
  exitCode,
12
12
  };
13
13
  }
14
+ /**
15
+ * Canonical envelope for a failed session resolution: the stable `code`, the
16
+ * human message, and — in `data` — the relevant candidates plus one valid next
17
+ * action. Every session-scoped command reports the failure this way, so the
18
+ * shape never depends on which command hit it.
19
+ */
20
+ export function failSessionResolution(error) {
21
+ return fail(error.code, error.message, {
22
+ candidates: error.candidates,
23
+ action: error.action,
24
+ });
25
+ }
26
+ /**
27
+ * Canonical failure of a hybrid operation: the stable code, the message, and
28
+ * the next valid action in `data` — the same shape `failSessionResolution`
29
+ * established, so every command's errors read the same way.
30
+ *
31
+ * The single cast lives here on purpose. On the failure path `data` carries the
32
+ * next action, never the command's success payload, and `renderHumanError`
33
+ * reads it structurally rather than through `T`. Three copies of this cast is
34
+ * what it replaces.
35
+ */
36
+ export function failSemantic(failure) {
37
+ return {
38
+ ok: false,
39
+ error: { code: failure.code, message: failure.message },
40
+ data: { action: failure.action },
41
+ exitCode: 1,
42
+ };
43
+ }
14
44
  export function renderRaw(payload) {
15
45
  return `${JSON.stringify(payload, null, 2)}\n`;
16
46
  }
47
+ /**
48
+ * Human projection of a failed result: the stable code, the message, and the
49
+ * next valid action when the command supplied one.
50
+ *
51
+ * It reads `action` out of the SAME `data` the JSON envelope carries (the shape
52
+ * `failSessionResolution` already produces), so the two projections cannot
53
+ * disagree about what to do next. The exit code is decided elsewhere and is
54
+ * untouched by which projection printed.
55
+ */
56
+ export function renderHumanError(error, data) {
57
+ const code = error?.code ?? "UNKNOWN";
58
+ const lines = [`✗ ${code}`, error?.message ?? "el comando falló sin detallar la causa"];
59
+ const action = readNextAction(data);
60
+ if (action !== undefined)
61
+ lines.push("", `Siguiente acción: ${action}`);
62
+ return `${lines.join("\n")}\n`;
63
+ }
64
+ function readNextAction(data) {
65
+ if (typeof data !== "object" || data === null)
66
+ return undefined;
67
+ const action = data.action;
68
+ return typeof action === "string" && action.length > 0 ? action : undefined;
69
+ }
17
70
  export function renderError(error) {
18
71
  return `${JSON.stringify({ ok: false, error }, null, 2)}\n`;
19
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/cli/render.ts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AC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,iBAA2B;IAC/E,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,oBAAoB,OAAO,EAAE;QACtC,OAAO,EAAE;YACP,OAAO;YACP,SAAS,EAAE,uDAAuD;YAClE,kBAAkB,EAAE,iBAAiB;SACtC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tacuchi/agent-workflow-cli",
3
- "version": "20.22.0",
3
+ "version": "20.23.0",
4
4
  "description": "Runtime CLI for Workline — the stages + loops + artifacts system for agent work. Bundles the universal `w` skill set under `skills/w/` (slash commands `/w:*`: spec-new/spec-refine, plan-new/plan-exec, quick, persist, workspace-init, export-*); `self install --target <host>` copies SKILL + commands + hooks into the host. Pluggable capability skills via `.workflow/skills.toml`. Multi-empresa parametrization via `profile.json` cascade. Namespace auto-detected from any `.<ns>/sessions/` dir in CWD; default `workflow`.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,31 +1,40 @@
1
1
  ---
2
- description: Generates C4/mermaid diagrams in docs/diagrams/ from the source code and the plan-doc (the AS-IS TO-BE delta in Solution). Single-pass, explicit.
3
- argument-hint: [--engine <mermaid|c4>] [--sessions <ids>] [--dry-run]
2
+ description: Exports architecture/flow diagrams from N sessions to docs/diagrams/ as a numbered dossier. Backed by `aw export-diagrams`, which owns the corpus, the numbering, the shape check and the atomic publication. Explicit, separate step — never automatic.
3
+ argument-hint: "[--sessions <ids>] [--since <YYYY-MM-DD>] [--source <alias>]"
4
4
  allowed-tools:
5
5
  [
6
6
  "Bash",
7
7
  "Read",
8
- "Write",
9
8
  ]
10
9
  ---
11
10
 
12
11
  # export-diagrams — export diagrams
13
12
 
14
- Reads the workspace sources' code + the plan-doc (the AS-IS → TO-BE delta in `## Solution`; legacy plans: separate AS-IS/TO-BE sections) and generates C4 / mermaid diagrams in `docs/diagrams/`. Single-pass, read-only over sessions.
13
+ Promotes diagram material from `.workflow/sessions/` into a numbered dossier under `docs/diagrams/`. Single-pass, read-only over sessions. **Transversal**: no flow, no loop, **never creates a session**.
15
14
 
16
- To run: **read** `../exports/export-diagrams/EXPORT.md` and **follow** its instructions with `$ARGUMENTS` as input. This command is the entry and the sibling EXPORT.md is its body.
15
+ ## Run
16
+
17
+ 1. `aw export-diagrams prepare --format human [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>]` (`--detail` prints the full response contract). Returns the corpus, the destination, the required shape and an `input_digest`.
18
+ 2. **Synthesize the deliverable.** Compose one JSON answer: `version`, `operation` and `input_digest` copied **verbatim**; `state: "proposed"`; `artifacts` with one `{ path, content }` per file, every path inside the destination the request declares. The `NNN` is consultative — `apply` reassigns it inside the lock.
19
+ 3. `echo '<json>' | aw export-diagrams validate --format human` → preview + `approval_digest`.
20
+ 4. **Confirm scope and destination with the user**, showing that preview.
21
+ 5. `echo '<json>' | aw export-diagrams apply --approval <digest> --format human`.
22
+
23
+ Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
24
+
25
+ > **The CLI owns everything but the synthesis**: corpus selection and filters, numbering, the shape check, the write authorization and the atomic publication. Never write into `docs/` with a file tool — `Write` is deliberately not in `allowed-tools`. A dossier lands whole or not at all.
17
26
 
18
27
  ## What it produces
19
28
 
20
- - `docs/diagrams/`: C4 and/or mermaid diagrams, numbered, cross-session.
21
- - Does **not** mutate sessions nor open/close loops.
22
- - Writes only `docs/diagrams/`.
29
+ - `docs/diagrams/NNN-export-diagrams-YYYY-MM-DD/`: `README.md` (required) + the diagrams in Markdown, plus their DSL (`.dsl`/`.puml`/`.mmd`) when it helps.
30
+ - Does **not** mutate sessions, touch another `docs/` folder, or open/close loops.
23
31
 
24
32
  ## Plan mode
25
33
 
26
- Describes the diagrams it would generate (type, covered components) without writing files.
34
+ Run `aw export-diagrams prepare` (read-only) and describe the deliverable and the destination it would publish, without applying.
27
35
 
28
36
  ## Resources
29
37
 
30
- - Export manual: `../exports/export-diagrams/EXPORT.md`
38
+ - CLI: `aw export-diagrams prepare | validate | apply` (service `export-service` over `semantic-operation/`)
39
+ - Diagram authoring reference: `../exports/export-diagrams/EXPORT.md` (engine `--engine`, notation) — no longer loaded on the normal path
31
40
  - Design reference: `docs/referencias/workflow-exports/README.md`
@@ -1,31 +1,41 @@
1
1
  ---
2
- description: Generates user/operations manuals in docs/manuals/ consolidating sessions, DECISION, plan-doc and source code. Single-pass, explicit.
3
- argument-hint: [--sessions <ids>] [--mode <complement|regenerate>] [--dry-run]
2
+ description: Exports user/operator manuals from N sessions to docs/manuals/ as a numbered dossier. Backed by `aw export-manuals`; docs/manuals/INDEX.md is the only overwritable file and requires --overwrite. Explicit, separate step — never automatic.
3
+ argument-hint: "[--sessions <ids>] [--since <YYYY-MM-DD>] [--source <alias>]"
4
4
  allowed-tools:
5
5
  [
6
6
  "Bash",
7
7
  "Read",
8
- "Write",
9
8
  ]
10
9
  ---
11
10
 
12
11
  # export-manuals — export manuals
13
12
 
14
- Consolidates sessions + `DECISION` artifacts + plan-doc (the Final behavior block of `Solution`) + source code and generates user/operations documentation in `docs/manuals/`. Single-pass, read-only over sessions.
13
+ Promotes manual material from `.workflow/sessions/` into a numbered dossier under `docs/manuals/`. Single-pass, read-only over sessions. **Transversal**: no flow, no loop, **never creates a session**.
15
14
 
16
- To run: **read** `../exports/export-manuals/EXPORT.md` and **follow** its instructions with `$ARGUMENTS` as input. This command is the entry and the sibling EXPORT.md is its body.
15
+ ## Run
16
+
17
+ 1. `aw export-manuals prepare --format human [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>]` (`--detail` prints the full response contract). Returns the corpus, the destination, the required shape and an `input_digest`.
18
+ 2. **Synthesize the deliverable.** Compose one JSON answer: `version`, `operation` and `input_digest` copied **verbatim**; `state: "proposed"`; `artifacts` with one `{ path, content }` per file, every path inside the destination the request declares. The `NNN` is consultative — `apply` reassigns it inside the lock.
19
+ 3. `echo '<json>' | aw export-manuals validate --format human` → preview + `approval_digest`.
20
+ 4. **Confirm scope and destination with the user**, showing that preview.
21
+ 5. `echo '<json>' | aw export-manuals apply --approval <digest> --format human [--overwrite]`.
22
+
23
+ Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
24
+
25
+ > **The CLI owns everything but the synthesis**: corpus selection and filters, numbering, the shape check, the write authorization and the atomic publication. Never write into `docs/` with a file tool — `Write` is deliberately not in `allowed-tools`. A dossier lands whole or not at all.
17
26
 
18
27
  ## What it produces
19
28
 
20
- - `docs/manuals/`: consolidated, cross-session, deduplicated manuals.
21
- - Does **not** mutate sessions nor open/close loops.
22
- - Writes only `docs/manuals/`.
29
+ - `docs/manuals/NNN-export-manuals-YYYY-MM-DD/`: `README.md` (required) + the manuals in Markdown.
30
+ - Optionally `docs/manuals/INDEX.md` — the **only** file an export may replace, and only with an explicit `--overwrite` the user approved.
31
+ - Does **not** mutate sessions, touch another `docs/` folder, or open/close loops.
23
32
 
24
33
  ## Plan mode
25
34
 
26
- Describes the scope of the manuals it would generate (sections, source sessions) without writing files.
35
+ Run `aw export-manuals prepare` (read-only) and describe the deliverable and the destination it would publish, without applying.
27
36
 
28
37
  ## Resources
29
38
 
30
- - Export manual: `../exports/export-manuals/EXPORT.md`
39
+ - CLI: `aw export-manuals prepare | validate | apply` (service `export-service` over `semantic-operation/`)
40
+ - Manual authoring reference: `../exports/export-manuals/EXPORT.md` — no longer loaded on the normal path
31
41
  - Design reference: `docs/referencias/workflow-exports/README.md`
@@ -1,31 +1,40 @@
1
1
  ---
2
- description: Generates an executive/functional report in docs/reports/ consolidating the session corpus (spec, CONCLUSIONS, DECISION), the plan-doc and the docs/ state. Single-pass, explicit.
3
- argument-hint: [--sessions <ids>] [--audience <gerencia|tecnica>] [--dry-run]
2
+ description: Exports a bounded report from N sessions to docs/reports/ as a numbered Markdown document. Backed by `aw export-reports`, which owns the corpus, the numbering and the write. Explicit, separate step — never automatic.
3
+ argument-hint: "[--sessions <ids>] [--since <YYYY-MM-DD>] [--source <alias>]"
4
4
  allowed-tools:
5
5
  [
6
6
  "Bash",
7
7
  "Read",
8
- "Write",
9
8
  ]
10
9
  ---
11
10
 
12
- # export-reports — export reports
11
+ # export-reports — export a report
13
12
 
14
- Consolidates the full session corpus (`CONCLUSIONS`, `DECISION`, spec) + plan-doc (state) + `docs/` and generates an executive or functional report in `docs/reports/`. Single-pass, read-only over sessions.
13
+ Promotes session findings into one numbered report under `docs/reports/`. Single-pass, read-only over sessions. **Transversal**: no flow, no loop, **never creates a session**.
15
14
 
16
- To run: **read** `../exports/export-reports/EXPORT.md` and **follow** its instructions with `$ARGUMENTS` as input. This command is the entry and the sibling EXPORT.md is its body.
15
+ ## Run
16
+
17
+ 1. `aw export-reports prepare --format human [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>]` (`--detail` prints the full response contract). Returns the corpus, the destination, the required shape and an `input_digest`.
18
+ 2. **Synthesize the deliverable.** Compose one JSON answer: `version`, `operation` and `input_digest` copied **verbatim**; `state: "proposed"`; `artifacts` with one `{ path, content }` per file, every path inside the destination the request declares. The `NNN` is consultative — `apply` reassigns it inside the lock.
19
+ 3. `echo '<json>' | aw export-reports validate --format human` → preview + `approval_digest`.
20
+ 4. **Confirm scope and destination with the user**, showing that preview.
21
+ 5. `echo '<json>' | aw export-reports apply --approval <digest> --format human`.
22
+
23
+ Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
24
+
25
+ > **The CLI owns everything but the synthesis**: corpus selection and filters, numbering, the shape check, the write authorization and the atomic publication. Never write into `docs/` with a file tool — `Write` is deliberately not in `allowed-tools`. A dossier lands whole or not at all.
17
26
 
18
27
  ## What it produces
19
28
 
20
- - `docs/reports/`: a consolidated, cross-session report with dedup and progress state.
21
- - Does **not** mutate sessions nor open/close loops.
22
- - Writes only `docs/reports/`.
29
+ - `docs/reports/NNN-<slug>-YYYY-MM-DD.md`: ONE document that declares its audience and its scope in the opening lines.
30
+ - Does **not** mutate sessions, touch another `docs/` folder, or open/close loops.
23
31
 
24
32
  ## Plan mode
25
33
 
26
- Describes the scope and index of the report it would generate (sections, source sessions, progress state) without writing files.
34
+ Run `aw export-reports prepare` (read-only) and describe the deliverable and the destination it would publish, without applying.
27
35
 
28
36
  ## Resources
29
37
 
30
- - Export manual: `../exports/export-reports/EXPORT.md`
38
+ - CLI: `aw export-reports prepare | validate | apply` (service `export-service` over `semantic-operation/`)
39
+ - Report authoring reference: `../exports/export-reports/EXPORT.md` — no longer loaded on the normal path
31
40
  - Design reference: `docs/referencias/workflow-exports/README.md`
@@ -1,31 +1,41 @@
1
1
  ---
2
- description: Exports DB scripts (type-B SCRIPTS.sql) from N sessions to docs/scripts/ as numbered forwards + rollback. Explicit, separate step — never automatic.
3
- argument-hint: [--sessions <ids>] [--dry-run]
2
+ description: Exports DB scripts (type-B SCRIPTS.sql) from N sessions to docs/scripts/ as a bundle with continuous forwards + rollback. Backed by `aw export-scripts`, which validates the bundle shape and NEVER executes SQL. Explicit, separate step — never automatic.
3
+ argument-hint: "[--sessions <ids>] [--since <YYYY-MM-DD>] [--source <alias>]"
4
4
  allowed-tools:
5
5
  [
6
6
  "Bash",
7
7
  "Read",
8
- "Write",
9
8
  ]
10
9
  ---
11
10
 
12
11
  # export-scripts — export DB scripts
13
12
 
14
- Promotes the `SCRIPTS.sql` artifacts (type B — migrations) of N sessions from `.workflow/sessions/` to `docs/scripts/`. Single-pass, read-only over sessions.
13
+ Promotes the `SCRIPTS.sql` artifacts (type B — migrations) of N sessions from `.workflow/sessions/` into a bundle under `docs/scripts/`. Single-pass, read-only over sessions. **Transversal**: no flow, no loop, **never creates a session**.
15
14
 
16
- To run: **read** `../exports/export-scripts/EXPORT.md` and **follow** its instructions with `$ARGUMENTS` as input. This command is the entry and the sibling EXPORT.md is its body.
15
+ ## Run
16
+
17
+ 1. `aw export-scripts prepare --format human [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>]` (`--detail` prints the full response contract). Returns the corpus, the destination, the required shape and an `input_digest`.
18
+ 2. **Synthesize the deliverable.** Compose one JSON answer: `version`, `operation` and `input_digest` copied **verbatim**; `state: "proposed"`; `artifacts` with one `{ path, content }` per file, every path inside the destination the request declares. The `NNN` is consultative — `apply` reassigns it inside the lock.
19
+ 3. `echo '<json>' | aw export-scripts validate --format human` → preview + `approval_digest`.
20
+ 4. **Confirm scope and destination with the user**, showing that preview.
21
+ 5. `echo '<json>' | aw export-scripts apply --approval <digest> --format human`.
22
+
23
+ Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
24
+
25
+ > **The CLI owns everything but the synthesis**: corpus selection and filters, numbering, the shape check, the write authorization and the atomic publication. Never write into `docs/` with a file tool — `Write` is deliberately not in `allowed-tools`. A dossier lands whole or not at all.
17
26
 
18
27
  ## What it produces
19
28
 
20
- - `docs/scripts/`: continuously numbered forwards (cross-session, dedup) + `00-ROLLBACK.sql`.
21
- - Does **not** mutate sessions nor open/close loops.
22
- - The AI **never executes** the scripts it only consolidates and delivers them.
29
+ - `docs/scripts/NNN-export-scripts-YYYY-MM-DD/`: `00-ROLLBACK.sql` and `README.md` (both required) + the forwards `NN-<nombre>.sql`, numbered **continuously from 01** — the CLI rejects a gap.
30
+ - The AI **never executes** the SQL, and neither does the CLI: the bundle is for a human/DBA to apply.
31
+ - Does **not** mutate sessions, touch another `docs/` folder, or open/close loops.
23
32
 
24
33
  ## Plan mode
25
34
 
26
- Describes the scripts it would consolidate and the `docs/scripts/` structure it would generate, without writing files.
35
+ Run `aw export-scripts prepare` (read-only) and describe the deliverable and the destination it would publish, without applying.
27
36
 
28
37
  ## Resources
29
38
 
30
- - Export manual: `../exports/export-scripts/EXPORT.md`
39
+ - CLI: `aw export-scripts prepare | validate | apply` (service `export-service` over `semantic-operation/`)
40
+ - SQL bundle reference: `../exports/export-scripts/EXPORT.md` (rollback derivation, ordering) — no longer loaded on the normal path
31
41
  - Design reference: `docs/referencias/workflow-exports/README.md`
@@ -1,33 +1,52 @@
1
1
  ---
2
- description: Use when a merge or rebase left conflicts to resolve. Resolves the conflicts of an in-progress merge for a given or detected source. Identifies origin (theirs) and destination (ours), analyzes both sides' intent and resolves; asks (structured-choice) on ambiguity or incoherence. Git-safe — proposes the merge commit, never push/--amend/--no-verify. Transversal (not a flow), no loop, no session, never touches docs/. Works in any git repo, no initialized workspace required.
3
- argument-hint: "[<source path | alias>]"
2
+ description: Use when a merge left conflicts to resolve. Backed by `aw fix-git`, which reads the three versions of each conflict, validates the semantic resolution and stages only files still in conflict. You supply the resolved content; the CLI decides which paths stay authorized and owns edit, stage and commit. Git-safe — the merge commit is a separate confirmed action, never push/--amend/--no-verify. Transversal (not a flow), no session, never touches docs/.
3
+ argument-hint: "[--source <alias> | --path <ruta>]"
4
4
  allowed-tools:
5
5
  [
6
6
  "Bash",
7
7
  "Read",
8
- "Edit",
9
8
  ]
10
9
  ---
11
10
 
12
11
  # fix-git — merge-conflict resolver (transversal)
13
12
 
14
- Single-pass, **no loop, no session**, **never writes `docs/`**. **Transversal** command (belongs to no SPEC / PLAN / QUICK flow). **Workspace-agnostic**: operates on any git repo the given `<source>` (path or alias), or the cwd — without requiring `.workflow/`. Everything user-facing (questions, proposals, the report) goes in the **user's language**.
13
+ Single-pass, **no loop, no session**, **never writes `docs/`**. **Workspace-agnostic**: any git repo, with or without `.workflow/`. User-facing output in the **user's language**.
14
+
15
+ > **Hard floor — applies even if you read nothing beyond this file:**
16
+ >
17
+ > 1. **You supply content; the CLI owns the effects.** Never edit a conflicted file, never `git add`, never `git commit` by hand — `Edit` is deliberately not in `allowed-tools`.
18
+ > 2. **Only unambiguous resolutions.** Anything you cannot resolve on evidence is `state: "ambiguous"`, which the CLI turns into a question. Never guess a side.
19
+ > 3. **The commit is a separate action**, always confirmed, and the message is proposed to the user first. Never `--no-verify`, `--amend` or push.
20
+ > 4. **Never `git merge --abort` on your own** — propose it; the user decides.
15
21
 
16
22
  ## Run
17
23
 
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
- - 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/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
- 3. **Close** **propose** the merge commit (propose-then-execute, canonical format, git-safe). Escape hatch: `git merge --abort` after user confirmation.
24
+ 1. `aw fix-git prepare --format human [--source <alias> | --path <ruta>]` (`--detail` prints the response contract and the request size). Returns the merge direction (`theirs → ours`), the conflicted paths, their three index stages and their blob hashes.
25
+ 2. **Resolve each conflict from the three versions the request carries** `base` (common ancestor), `ours` (HEAD) and `theirs` (the incoming branch). Read both sides' *intent*, not just their text: `ours`, `theirs`, a combination, or a rewrite that preserves both intents.
26
+ 3. Compose one JSON answer: `version`, `operation` and `input_digest` copied verbatim; `state: "proposed"`; `artifacts` with **one `{ path, content }` per conflicted file**, `content` being the complete resolved file with **no conflict markers**.
27
+ - Any file you cannot settle on evidence `state: "ambiguous"` with `reason`. Nothing is written; present the choice to the user.
28
+ - A binary conflict is rejected by the CLI: propose `git checkout --ours|--theirs` to the user instead.
29
+ 4. `echo '<json>' | aw fix-git apply --format human [--source …]`. The invocation authorizes the write **because** the set is unambiguous and still current — a conflict another process resolved meanwhile fails as stale.
30
+ 5. **Propose the merge commit** to the user (canonical one-line format). On approval:
31
+ `aw fix-git commit --message "<mensaje>" --confirm [--source …]`.
32
+
33
+ Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 4.
34
+
35
+ > **No merge in progress?** If the user explicitly asked to merge a branch, run `git -C <path> merge <branch>` and continue. Otherwise report there is nothing to resolve and stop.
36
+
37
+ ## What the CLI decides (do not re-derive)
22
38
 
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.
39
+ - **Which paths are writable**: exactly the files still unmerged. A path outside that set is rejected, not silently skipped.
40
+ - **Whether the conflict is still yours**: the blob hashes seal the set; if it moved, `apply` fails stale instead of overwriting someone else's resolution.
41
+ - **Whether the content is really resolved**: leftover `<<<<<<<` / `=======` / `>>>>>>>` is a rejection.
42
+ - **Whether the merge can close**: `commit` refuses while any file stays unmerged.
24
43
 
25
44
  ## Plan mode
26
45
 
27
- Run `aw merge-state` (read-only), report **origin ↔ destination** and the per-file conflicts, and describe the **resolution strategy** you would apply**without** editing files or committing.
46
+ Run `aw fix-git prepare` (read-only), report **origin ↔ destination** and the per-file conflicts, and describe the resolution you would propose — without applying or committing.
28
47
 
29
48
  ## Resources
30
49
 
31
- - Capability: `../roles/git/ROLE.md` (section *Merge-conflict resolution*)
32
- - CLI: `aw merge-state` (read-only merge-state inspector)
50
+ - CLI: `aw fix-git prepare | apply | commit` (service `fix-git-service` over `semantic-operation/`) · `aw merge-state` (read-only inspector)
51
+ - Reference: `../roles/git/ROLE.md` § *Merge-conflict resolution* — the reasoning about intent; the mechanics now live in the CLI
33
52
  - Design reference: `docs/referencias/workflow-skills/fix-git.md`
@@ -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`. Transversal command (not a flow); no session, never touches docs/."
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/."
3
3
  argument-hint: "[--source <alias>] [--mode interactive|server] [--command <cmd>] [--force] [--dry-run]"
4
4
  allowed-tools:
5
5
  [