@tacuchi/agent-workflow-cli 15.1.0 → 16.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 (42) hide show
  1. package/package.json +1 -1
  2. package/skills/w/README.md +14 -14
  3. package/skills/w/SKILL.md +96 -75
  4. package/skills/w/artifacts/README.md +6 -6
  5. package/skills/w/artifacts/artifacts-core/SESSION.md +1 -7
  6. package/skills/w/artifacts/artifacts-core/TASKS.md +1 -1
  7. package/skills/w/artifacts/artifacts-exec/TECHNICAL-NOTE.md +9 -54
  8. package/skills/w/artifacts/artifacts-research/CONCLUSIONS.md +1 -1
  9. package/skills/w/commands/README.md +22 -22
  10. package/skills/w/commands/export-diagrams.md +9 -9
  11. package/skills/w/commands/export-manuals.md +9 -9
  12. package/skills/w/commands/export-reports.md +9 -9
  13. package/skills/w/commands/export-scripts.md +9 -9
  14. package/skills/w/commands/fix-git.md +12 -12
  15. package/skills/w/commands/plan-exec.md +19 -19
  16. package/skills/w/commands/plan-new.md +18 -18
  17. package/skills/w/commands/plan-refine.md +22 -22
  18. package/skills/w/commands/quick.md +16 -16
  19. package/skills/w/commands/spec-new.md +35 -34
  20. package/skills/w/commands/spec-refine.md +16 -16
  21. package/skills/w/commands/status.md +18 -16
  22. package/skills/w/commands/workspace-init.md +14 -14
  23. package/skills/w/exports/README.md +5 -5
  24. package/skills/w/exports/export-diagrams/SKILL.md +58 -58
  25. package/skills/w/exports/export-manuals/SKILL.md +61 -61
  26. package/skills/w/exports/export-reports/SKILL.md +51 -51
  27. package/skills/w/exports/export-scripts/SKILL.md +60 -60
  28. package/skills/w/harness/SKILL.md +48 -47
  29. package/skills/w/loops/CHASSIS.md +104 -97
  30. package/skills/w/loops/CODE-POLICIES.md +21 -21
  31. package/skills/w/loops/README.md +30 -29
  32. package/skills/w/loops/plan-exec-loop/SKILL.md +77 -80
  33. package/skills/w/loops/plan-new-loop/SKILL.md +88 -58
  34. package/skills/w/loops/plan-refine-loop/SKILL.md +69 -45
  35. package/skills/w/loops/quick-loop/SKILL.md +79 -79
  36. package/skills/w/loops/spec-refine-loop/SKILL.md +93 -97
  37. package/skills/w/roles/README.md +2 -2
  38. package/skills/w/roles/diagrams/SKILL.md +50 -47
  39. package/skills/w/roles/git/SKILL.md +58 -58
  40. package/skills/w/roles/research/SKILL.md +65 -62
  41. package/skills/w/roles/sql/SKILL.md +59 -55
  42. package/skills/w/roles/ui-spec/SKILL.md +60 -74
@@ -1,101 +1,101 @@
1
1
  ---
2
2
  name: export-reports
3
- description: "Informe ejecutivo/funcional (audiencia gerencia/comité) que consolida N sesiones del workspace bajo `docs/reports/NNN-<slug>-YYYY-MM-DD.md`. Lee el corpus: el spec (`docs/specs`), `CONCLUSIONS` (research), `DECISION`, el estado del plan-doc + el resto de `docs/` para contexto. Sintetiza: qué se hizo, decisiones clave, resultados/conclusiones, pendientes/roadmap — con dedup de recomendaciones cross-session. Audiencia ajustable vía `--audience` (gerencia ≈ corto; tecnica ≈ detallado). Funde el espíritu de los viejos export-report (ejecutivo) y export-conclusions (dedup de R-items) en una sola salida a `docs/reports`. Read-only/reporte: no commitea ni muta sesiones. La prosa sigue las convenciones de redacción ambientes (el host auto-aplica una skill de writing instalada si está presente). Úsalo para 'informe ejecutivo', 'qué se hizo este trimestre para gerencia', 'brief con recomendaciones consolidadas'. Invocado por el usuario vía `/w:export-reports`."
3
+ description: "Executive/functional report (management/committee audience) consolidating N workspace sessions under `docs/reports/NNN-<slug>-YYYY-MM-DD.md`. Reads the corpus: the spec (`docs/specs`), `CONCLUSIONS` (research), `DECISION`, the plan-doc state + the rest of `docs/` for context. Synthesizes: what was done, key decisions, results/conclusions, pending/roadmap — with cross-session recommendation dedup. Audience adjustable via `--audience` (gerencia ≈ short; tecnica ≈ detailed). Read-only/report: it never commits nor mutates sessions. The prose follows the ambient writing conventions (the host auto-applies an installed writing skill when present). Use for 'executive report', 'what got done this quarter for management', 'brief with consolidated recommendations'. User-invoked via `/w:export-reports`."
4
4
  ---
5
5
 
6
- # export-reports — Informe ejecutivo/funcional desde el corpus de sesiones + `docs/`
6
+ # export-reports — executive/functional report from the session corpus + `docs/`
7
7
 
8
- Genera un único `.md` que consolida N sesiones del workspace en un informe **ejecutivo/funcional**: qué se hizo, decisiones clave, resultados/conclusiones y pendientes/roadmap. **Read-only / reporte** — no commitea, no muta sesiones ni el corpus.
8
+ Generates a single `.md` consolidating N workspace sessions into an **executive/functional** report: what was done, key decisions, results/conclusions and pending/roadmap. **Read-only / report** — it never commits, never mutates sessions or the corpus.
9
9
 
10
- > Familia `export-*` (la única vía artefacto→`docs/`). **Funde** el espíritu de dos viejos exports en una sola salida a `docs/reports`: `export-report` (informe ejecutivo con tabla de componentes + diagrama de flujo) y `export-conclusions` (dedup de R-items cross-session). Modernizado: `docs/reports` en inglés, sin modos project/hub, y la prosa sigue las convenciones de redacción **ambientes** (el host auto-aplica una skill de writing instalada si está presente), no un rol propio. Diseño: `docs/referencias/workflow-exports/export-reports.md`.
10
+ > `export-*` family (the only artifact→`docs/` path). It **merges** two legacy exports into one `docs/reports` output: the executive report and the cross-session recommendation dedup. Design: `docs/referencias/workflow-exports/export-reports.md`.
11
11
 
12
12
  ## Category
13
13
 
14
- `docs/reports` — **única** carpeta `docs/` que este export escribe.
14
+ `docs/reports` — the **only** `docs/` folder this export writes.
15
15
 
16
- ## Writing (convención ambiente, no rol)
16
+ ## Writing (ambient convention, not a role)
17
17
 
18
- La redacción del informe sigue las convenciones de redacción **ambientes**: el host auto-aplica una skill de writing instalada (si está presente) por su `description` — traducción técnico→ejecutiva, cota de longitud por audiencia, frases cortas, listas sobre prosa, sin relleno. Este export **no** compone un rol `writing` ni lo bindea; es **indiferente** a qué skill de redacción exista. Una familia útil vive en el plugin `dev-conventions` del marketplace, pero el export **no depende** de él.
18
+ The report's prose follows the **ambient** writing conventions: the host auto-applies an installed writing skill (when present) by its `description` — technical→executive translation, per-audience length cap, short sentences, lists over prose, no filler. This export does **not** compose or bind a `writing` role. Reports are user-facing deliverables write them in the user's language.
19
19
 
20
20
  ## When to use
21
21
 
22
- - "Informe ejecutivo", "documento funcional", "qué se hizo este trimestre para gerencia".
23
- - Brief con las **recomendaciones consolidadas** (deduplicadas) de las últimas N sesiones.
24
- - Re-generar tras un nuevo período (mes / trimestre); antes de un comité de seguimiento.
22
+ - "Executive report", "functional document", "what got done this quarter for management".
23
+ - A brief with the **consolidated** (deduplicated) recommendations of the last N sessions.
24
+ - Re-generate after a new period (month / quarter); before a follow-up committee.
25
25
 
26
26
  ## What it does
27
27
 
28
- 1. Lee el corpus de sesiones filtrado: el spec (`docs/specs`), `CONCLUSIONS` (research), `DECISION`, el estado del plan-doc.
29
- 2. Lee el resto de `docs/` (specs, plans, reports previos) para contexto.
30
- 3. Resuelve la audiencia/longitud (`--audience`).
31
- 4. Sintetiza: Resumen ejecutivo · Qué se hizo (agrupado por capacidad de negocio, no por sesión) · Decisiones clave · Resultados/conclusiones · Pendientes/Roadmap.
32
- 5. **Deduplica** las recomendaciones (R-items) cross-session por slug, anotando los orígenes.
33
- 6. Escribe `docs/reports/NNN-<slug>-YYYY-MM-DD.md`.
28
+ 1. Reads the filtered session corpus: the spec (`docs/specs`), `CONCLUSIONS` (research), `DECISION`, the plan-doc state.
29
+ 2. Reads the rest of `docs/` (specs, plans, previous reports) for context.
30
+ 3. Resolves the audience/length (`--audience`).
31
+ 4. Synthesizes: Executive summary · What was done (grouped by business capability, not by session) · Key decisions · Results/conclusions · Pending/Roadmap.
32
+ 5. **Deduplicates** the recommendations (R-items) cross-session by slug, annotating the origins.
33
+ 6. Writes `docs/reports/NNN-<slug>-YYYY-MM-DD.md`.
34
34
 
35
35
  ## What it does NOT do
36
36
 
37
- - Ejecutar commits, merges, push, SQL ni envío de correos / creación de PRs.
38
- - Mutar sesiones, el corpus ni el plan-doc (solo lectura).
39
- - Escribir cualquier carpeta `docs/` que no sea `docs/reports/` (invariante: una categoría).
40
- - Inventar logros, métricas o recomendaciones: las secciones condicionales (p.ej. "Oportunidades de mejora"/Roadmap) **solo** aparecen si el corpus tiene items abiertos detectables.
41
- - Generar diagramas técnicos avanzados (C4/erDiagram extenso) — esos viven en `export-diagrams`; aquí, como mucho, un `flowchart LR` simple de síntesis ejecutiva.
42
- - Sobrescribir reports previos (siempre next-number).
37
+ - Run commits, merges, push, SQL, emails or PR creation.
38
+ - Mutate sessions, the corpus or the plan-doc (read-only).
39
+ - Write any `docs/` folder other than `docs/reports/` (invariant: one category).
40
+ - Invent achievements, metrics or recommendations: conditional sections (e.g. "Improvement opportunities"/Roadmap) appear **only** when the corpus has detectable open items.
41
+ - Generate advanced technical diagrams (extensive C4/erDiagram) — those live in `export-diagrams`; here, at most a simple executive-synthesis `flowchart LR`.
42
+ - Overwrite previous reports (always next-number).
43
43
 
44
44
  ## Read-only sandbox
45
45
 
46
- En plan mode **describe**, no escribe: la audiencia/longitud resuelta, las sesiones del corpus que entrarían tras los filtros, las secciones que aparecerían, los R-items que se consolidarían (y conflictos detectados), y la longitud estimada. **No** ejecuta `Write` ni `aw next-number` con efecto.
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`.
47
47
 
48
48
  ## Inputs
49
49
 
50
- **CLI `agent-workflow` (alias `aw`)** — no leer paths hardcodeados:
50
+ **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
51
51
 
52
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumera + filtra el corpus.
53
- - `aw session-artifacts --code <NNN> --dump objetivo,conclusiones,decisiones` — devuelve `{path, content, size}` de `SESSION` (spec referido), `CONCLUSIONS` y `DECISION`; el estado del plan-doc se lee por su path.
54
- - `aw next-number docs/reports` — numeración determinística (la resolución de la carpeta destino la maneja el CLI).
52
+ - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates + filters the corpus.
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
+ - `aw next-number docs/reports` — deterministic numbering (the CLI handles destination-folder resolution).
55
55
 
56
56
  **Filesystem**:
57
57
 
58
- - `docs/specs`, `docs/plans`, `docs/reports/*` — contexto + no colisionar.
58
+ - `docs/specs`, `docs/plans`, `docs/reports/*` — context + collision avoidance.
59
59
 
60
- **Args** (sin *structured-choice* de ciclo de vida capacidad del arnés; ver [`../../harness/SKILL.md`](../../harness/SKILL.md)):
60
+ **Args** (no lifecycle *structured-choice*; harness capabilitysee [`../../harness/SKILL.md`](../../harness/SKILL.md)):
61
61
 
62
62
  ```
63
63
  /w:export-reports [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
64
64
  [--audience gerencia|tecnica] [--slug <kebab>] [--dry-run]
65
65
  ```
66
66
 
67
- | Flag | Comportamiento |
67
+ | Flag | Behavior |
68
68
  |---|---|
69
- | `--sessions NNN[,NNN]` | Filtro discreto por código (precede a `--since`) |
70
- | `--since sessionNNN` | Solo sesiones posteriores a NNN (exclusivo: la propia NNN no entra; usá `--sessions` para incluirla) |
71
- | `--source <alias>` | Limita a una fuente (workspace multi-fuente) |
72
- | `--audience gerencia\|tecnica` | Modula longitud/léxico: `gerencia` ≈ corto/ejecutivo; `tecnica` ≈ detallado |
73
- | `--slug <kebab>` | Override del slug del filename (default: `export-reports`) |
74
- | `--dry-run` | Reporte propositivo sin escribir |
69
+ | `--sessions NNN[,NNN]` | Discrete filter by code (takes precedence over `--since`) |
70
+ | `--since sessionNNN` | Only sessions after NNN (exclusive: NNN itself is out; use `--sessions` to include it) |
71
+ | `--source <alias>` | Limits to one source (multi-source workspace) |
72
+ | `--audience gerencia\|tecnica` | Modulates length/lexicon: `gerencia` ≈ short/executive; `tecnica` ≈ detailed |
73
+ | `--slug <kebab>` | Filename slug override (default: `export-reports`) |
74
+ | `--dry-run` | Propositional report, no writing |
75
75
 
76
- Sin args: todo el corpus, audiencia ejecutiva por default. *(Si algún flag exacto difiere en el CLI runtime, ajustar al contrato real de `aw`.)*
76
+ No args: the whole corpus, executive audience by default.
77
77
 
78
78
  ## Flow
79
79
 
80
- ### Paso 1 — Resolver contexto y filtrar corpus
80
+ ### Step 1 — Resolve context and filter the corpus
81
81
 
82
- `aw sessions` / `release-data` aplicando `--sessions`/`--since`/`--source`. Si el conjunto resultante está vacío → **abortar** con mensaje explícito ("No hay sesiones en el rango declarado"). La resolución de la carpeta destino la maneja el CLI.
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.
83
83
 
84
- ### Paso 2 — Recolectar inputs por sesión
84
+ ### Step 2 — Collect per-session inputs
85
85
 
86
- Por sesión filtrada (`aw session-artifacts --code <NNN> --dump objetivo,conclusiones,decisiones`): el spec referido (qué se planteó), `CONCLUSIONS` (cierre técnico / R-items), `DECISION` (qué se decidió), estado del plan-doc (qué se entregó / qué queda). Recoger también componentes impactados (fuentes tocadas) para la tabla de síntesis.
86
+ Per filtered session (`aw session-artifacts --code <NNN> --dump objetivo,conclusiones,decisiones`): the referenced spec (what was posed), `CONCLUSIONS` (technical close / R-items), `DECISION` (what was decided), the plan-doc state (what shipped / what remains). Also collect the impacted components (touched sources) for the synthesis table.
87
87
 
88
- ### Paso 3 — Dedup de recomendaciones (cross-session)
88
+ ### Step 3 — Recommendation dedup (cross-session)
89
89
 
90
- Extraer los R-items de `CONCLUSIONS`/`DECISION` (pendientes, diferidos, "próximos pasos"). Agrupar por slug; merge de duplicados anotando `origins[]`; si dos R-items del mismo slug se contradicen, marcarlos como conflicto para resolución explícita. **No** deduplicar los C-items (son específicos de cada análisis: se preservan con trazabilidad).
90
+ Extract the R-items from `CONCLUSIONS`/`DECISION` (pending, deferred, "next steps"). Group by slug; merge duplicates annotating `origins[]`; if two same-slug R-items contradict each other, mark them as a conflict for explicit resolution. Do **not** dedup the C-items (they are analysis-specific: preserved with traceability).
91
91
 
92
- ### Paso 4 — Sintetizar (prosa: convenciones ambientes)
92
+ ### Step 4 — Synthesize (prose: ambient conventions)
93
93
 
94
- Render aplicando las convenciones de redacción ambientes (host): Resumen ejecutivo · Qué se hizo (agrupado por capacidad de negocio, **no** por sesión) · Componentes impactados (tabla) · Decisiones clave · Resultados/conclusiones · Pendientes/Roadmap (solo si hay R-items). Traducción técnicoejecutiva y cota de longitud por `--audience`. Opcional: un `flowchart LR` simple de síntesis (con link `mermaid.ink`); el diagrama técnico detallado es de `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). Technicalexecutive 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`.
95
95
 
96
- ### Paso 5 — Escribir o reportar
96
+ ### Step 5 — Write or report
97
97
 
98
- `aw next-number docs/reports` → `docs/reports/NNN-<slug>-YYYY-MM-DD.md`. Si `--dry-run`: imprimir; no escribir. **NUNCA commitear**. Resumen al usuario: ruta, audiencia/longitud, sesiones cubiertas (count + rango), R-items consolidados, y nota si se omitió una sección condicional.
98
+ `aw next-number docs/reports` → `docs/reports/NNN-<slug>-YYYY-MM-DD.md`. With `--dry-run`: print; write nothing. **NEVER commit**. Summary to the user: path, audience/length, covered sessions (count + range), consolidated R-items, and a note if a conditional section was omitted.
99
99
 
100
100
  ## Output location
101
101
 
@@ -103,11 +103,11 @@ Render aplicando las convenciones de redacción ambientes (host): Resumen ejecut
103
103
 
104
104
  ## Re-run
105
105
 
106
- Idempotente funcional: cada invocación toma el siguiente `NNN`; no sobrescribe reports previos. Para regenerar el último: borrar el archivo y re-invocar.
106
+ Functionally idempotent: each invocation takes the next `NNN`; it never overwrites previous reports. To regenerate the latest: delete the file and re-invoke.
107
107
 
108
108
  ## Resources
109
109
 
110
- - Design: `docs/referencias/workflow-exports/export-reports.md` · familia: [`../README.md`](../README.md).
111
- - Redacción: convención **ambiente** (no rol) — el host auto-aplica una skill de writing instalada si está presente.
112
- - Insumos: spec (`docs/specs`), `CONCLUSIONS`/`DECISION` (ver `docs/referencias/workflow-artifacts/`), plan-doc (`docs/plans`).
110
+ - Design: `docs/referencias/workflow-exports/export-reports.md` · family: [`../README.md`](../README.md).
111
+ - Writing: **ambient** convention (not a role) — the host auto-applies an installed writing skill when present.
112
+ - Inputs: spec (`docs/specs`), `CONCLUSIONS`/`DECISION` (see `docs/referencias/workflow-artifacts/`), plan-doc (`docs/plans`).
113
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).
@@ -1,135 +1,135 @@
1
1
  ---
2
2
  name: export-scripts
3
- description: "Consolida los SQL pendientes del workspace en un único bundle `docs/scripts/NNN-export-scripts-YYYY-MM-DD/` con numeración continua tras `00-ROLLBACK.sql`. Lee migraciones tipo-B (DDL/DML) desde dos fuentes: `.workflow/sessions/<folder>/SCRIPTS.sql` de N sesiones Y `docs/scripts/*.sql` standalone (excluyendo bundles previos). Ignora el tipo-A read-only (consultas de diagnóstico, no entregables). Headers SQL mínimos + README simple (3 secciones: Archivos / Aplicar / Revertir). El rollback se deriva de los forwards. Read-only/reporte: NUNCA ejecuta SQL ni commiteael bundle es para que un humano/DBA lo aplique. Compone la capacidad `sql`. Úsalo para 'bundle SQL del release', 'preparar paso a prod', 'consolidar SQLs pendientes'. Invocado por el usuario vía `/w:export-scripts`."
3
+ description: "Consolidates the workspace's pending SQL into a single `docs/scripts/NNN-export-scripts-YYYY-MM-DD/` bundle with continuous numbering after `00-ROLLBACK.sql`. Reads type-B migrations (DDL/DML) from two sources: `.workflow/sessions/<folder>/SCRIPTS.sql` across N sessions AND standalone `docs/scripts/*.sql` (excluding previous bundles). Ignores read-only type-A (diagnostic queries, not deliverables). Minimal SQL headers + a simple README (3 sections: Files / Apply / Revert). The rollback is derived from the forwards. Read-only/report: it NEVER executes SQL nor commitsthe bundle is for a human/DBA to apply. Composes the `sql` capability. Use for 'release SQL bundle', 'prepare the prod push', 'consolidate pending SQLs'. User-invoked via `/w:export-scripts`."
4
4
  ---
5
5
 
6
- # export-scripts — Bundle SQL consolidado, simple y directo
6
+ # export-scripts — consolidated SQL bundle, simple and direct
7
7
 
8
- Consolida las migraciones SQL pendientes de N sesiones + archivos standalone en un único bundle bajo `docs/scripts/NNN-export-scripts-YYYY-MM-DD/`, con numeración continua tras `00-ROLLBACK.sql`. **Read-only / reporte** — la IA **nunca ejecuta** el SQL; el usuario/DBA aplica el bundle manualmente.
8
+ Consolidates the pending SQL migrations of N sessions + standalone files into a single bundle under `docs/scripts/NNN-export-scripts-YYYY-MM-DD/`, with continuous numbering after `00-ROLLBACK.sql`. **Read-only / report** — the AI **never executes** the SQL; the user/DBA applies the bundle manually.
9
9
 
10
- > Familia `export-*` (la única vía artefacto→`docs/`). Recicla el espíritu del viejo `export-scripts` v5.0.0 (numeración continua, headers SQL minimal, README de 3 secciones, rollback derivado de forwards), modernizado al modelo nuevo (sin modos project/hub; `docs/scripts` en inglés). Diseño: `docs/referencias/workflow-exports/export-scripts.md`.
10
+ > `export-*` family (the only artifact→`docs/` path). Design: `docs/referencias/workflow-exports/export-scripts.md`.
11
11
 
12
12
  ## Category
13
13
 
14
- `docs/scripts` — **única** carpeta `docs/` que este export escribe.
14
+ `docs/scripts` — the **only** `docs/` folder this export writes.
15
15
 
16
16
  ## Composes
17
17
 
18
- Capacidad **`sql`** (built-in default `sql`), resuelta vía `.workflow/skills.toml`. Aporta el vocabulario de categorías DDL/DML, el orden de aplicación y la derivación de rollback. Este export **no** posee esa lógica: la compone. Rebindeable u `off` por config.
18
+ The **`sql`** capability (built-in default `sql`), resolved via `.workflow/skills.toml`. It contributes the DDL/DML category vocabulary, the application order and the rollback derivation. This export does **not** own that logic: it composes it. Rebindable or `off` by config.
19
19
 
20
20
  ## When to use
21
21
 
22
- - "Bundle SQL del release", "preparar paso a prod", "consolidar SQLs pendientes".
23
- - Antes de promover una rama a certificación / `main`.
24
- - Tras varias sesiones `exec`/`quick` que dejaron `SCRIPTS.sql` con migraciones.
22
+ - "Release SQL bundle", "prepare the prod push", "consolidate pending SQLs".
23
+ - Before promoting a branch to certification / `main`.
24
+ - After several `exec`/`quick` sessions left `SCRIPTS.sql` files with migrations.
25
25
 
26
26
  ## What it does
27
27
 
28
- 1. Recolecta SQL del workspace desde **dos fuentes**: `SCRIPTS.sql` tipo-B de cada sesión del corpus + `docs/scripts/*.sql` standalone (excluyendo bundles previos).
29
- 2. Clasifica las sentencias por categoría canónica (DDL-TABLES / DDL-FUNCTIONS / DML / INSERTS).
30
- 3. Consolida cross-source por categoría con **numeración continua** tras `00-ROLLBACK.sql`.
31
- 4. Escribe los forwards consolidados (cada sentencia con su origen, 1 línea).
32
- 5. Deriva `00-ROLLBACK.sql` **al final**, leyendo los forwards ya escritos.
33
- 6. Escribe un `README.md` minimal (Archivos / Aplicar / Revertir).
28
+ 1. Collects the workspace's SQL from **two sources**: each corpus session's type-B `SCRIPTS.sql` + standalone `docs/scripts/*.sql` (excluding previous bundles).
29
+ 2. Classifies the statements by canonical category (DDL-TABLES / DDL-FUNCTIONS / DML / INSERTS).
30
+ 3. Consolidates cross-source per category with **continuous numbering** after `00-ROLLBACK.sql`.
31
+ 4. Writes the consolidated forwards (each statement with its origin, 1 line).
32
+ 5. Derives `00-ROLLBACK.sql` **at the end**, reading the already-written forwards.
33
+ 6. Writes a minimal `README.md` (Files / Apply / Revert).
34
34
 
35
35
  ## What it does NOT do
36
36
 
37
- - **Ejecutar SQL** (invariante BD scripts-only). El bundle es entregable; lo aplica un humano/DBA.
38
- - Commitear, mergear, push.
39
- - Tocar `.workflow/sessions/` ni los `docs/scripts/*.sql` standalone (solo lectura).
40
- - Escribir cualquier carpeta `docs/` que no sea `docs/scripts/` (invariante: una categoría).
41
- - Migrar bundles previos (`docs/scripts/NNN-export-scripts-*/` quedan como histórico).
42
- - Incluir el tipo-A read-only (consultas de diagnóstico) ni inventar SQL.
43
- - Generar plantillas de correo, checklists de producción, listados de commits/sesiones, ni resúmenes ejecutivos en el README.
37
+ - **Execute SQL** (DB scripts-only invariant). The bundle is a deliverable; a human/DBA applies it.
38
+ - Commit, merge, push.
39
+ - Touch `.workflow/sessions/` or the standalone `docs/scripts/*.sql` (read-only).
40
+ - Write any `docs/` folder other than `docs/scripts/` (invariant: one category).
41
+ - Migrate previous bundles (`docs/scripts/NNN-export-scripts-*/` stay as history).
42
+ - Include read-only type-A (diagnostic queries) or invent SQL.
43
+ - Generate email templates, production checklists, commit/session listings, or executive summaries in the README.
44
44
 
45
45
  ## Read-only sandbox
46
46
 
47
- En plan mode **describe**, no escribe: el `NNN` resuelto, las fuentes detectadas (sesiones + standalone), las categorías con contenido, los archivos que aparecerían al root del bundle y el contenido aproximado del README. **No** ejecuta `Write`, ni `aw next-number` con efecto, ni mutaciones.
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.
48
48
 
49
49
  ## Inputs
50
50
 
51
- **CLI `agent-workflow` (alias `aw`)** — no leer paths hardcodeados:
51
+ **`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
52
52
 
53
- - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumera el corpus de sesiones.
54
- - `aw session-artifacts --code <NNN> --dump scripts` — lista los `.sql` de la sesión con path y size (el contenido se lee por path). Si no hay scripts → lista vacía, skip silencioso.
55
- - `aw next-number docs/scripts` — numeración determinística del directorio del bundle (la resolución de la carpeta destino la maneja el CLI).
53
+ - `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the session corpus.
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).
56
56
 
57
57
  **Filesystem**:
58
58
 
59
- - `docs/scripts/*.sql` standalone (solo top-level), **excluyendo** cualquier `docs/scripts/NNN-export-scripts-*/` (outputs previos de este export).
59
+ - Standalone `docs/scripts/*.sql` (top-level only), **excluding** any `docs/scripts/NNN-export-scripts-*/` (previous outputs of this export).
60
60
 
61
- **Args** (sin *structured-choice* de ciclo de vida capacidad del arnés; ver [`../../harness/SKILL.md`](../../harness/SKILL.md)):
61
+ **Args** (no lifecycle *structured-choice*; harness capabilitysee [`../../harness/SKILL.md`](../../harness/SKILL.md)):
62
62
 
63
63
  ```
64
64
  /w:export-scripts [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
65
65
  [--skip-standalone] [--dry-run]
66
66
  ```
67
67
 
68
- | Flag | Comportamiento |
68
+ | Flag | Behavior |
69
69
  |---|---|
70
- | `--sessions NNN[,NNN]` | Filtro discreto por código (precede a `--since`) |
71
- | `--since sessionNNN` | Solo sesiones posteriores a NNN (exclusivo: la propia NNN no entra; usá `--sessions` para incluirla) |
72
- | `--source <alias>` | Limita a una fuente (workspace multi-fuente) |
73
- | `--skip-standalone` | Omite la lectura de `docs/scripts/*.sql` standalone |
74
- | `--dry-run` | Reporte propositivo sin escribir archivos |
70
+ | `--sessions NNN[,NNN]` | Discrete filter by code (takes precedence over `--since`) |
71
+ | `--since sessionNNN` | Only sessions after NNN (exclusive: NNN itself is out; use `--sessions` to include it) |
72
+ | `--source <alias>` | Limits to one source (multi-source workspace) |
73
+ | `--skip-standalone` | Skips reading the standalone `docs/scripts/*.sql` |
74
+ | `--dry-run` | Propositional report, no files written |
75
75
 
76
- Sin args: todas las sesiones del corpus + todos los `.sql` standalone (excluyendo bundles previos). *(Si algún flag exacto difiere en el CLI runtime, ajustar al contrato real de `aw`.)*
76
+ No args: every corpus session + every standalone `.sql` (excluding previous bundles).
77
77
 
78
78
  ## Flow
79
79
 
80
- ### Paso 1 — Recolección de fuentes SQL
80
+ ### Step 1 — Collect SQL sources
81
81
 
82
- **Fuente A — sesiones**: por cada sesión del corpus (`aw sessions` / `release-data` + `session-artifacts --code <NNN> --dump scripts`), leer los `.sql` que el dump lista (path por script). Tomar **solo** las sentencias tipo-B (migraciones DDL/DML entregables); ignorar el tipo-A read-only (consultas de diagnóstico). Markers esperados por sentencia: `-- @category: <01-04>` + `-- @stmt: NNN-verbo-objetivo` (formato definido por la capacidad `sql`).
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
83
 
84
- **Fuente B — standalone** (salvo `--skip-standalone`): listar `docs/scripts/*.sql` top-level, **excluyendo** `docs/scripts/NNN-export-scripts-*/`. Por archivo: respetar markers `@category` si los hay; si no, inferir categoría del contenido (`CREATE/ALTER TABLE`, `CREATE INDEX` → `01`; `CREATE OR REPLACE FUNCTION`/`PROCEDURE` → `02`; `UPDATE`/`DELETE` → `03`; `INSERT INTO … VALUES` → `04`). Si el filename contiene `rollback` → skip (no entra en forward).
84
+ **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
85
 
86
- Si la unión A + B está vacía → **abortar**: "No hay SQL pendientes en el workspace".
86
+ If the A + B union is empty → **abort**: there is no pending SQL in the workspace.
87
87
 
88
- ### Paso 2 — Numeración del bundle
88
+ ### Step 2 — Bundle numbering
89
89
 
90
90
  `aw next-number docs/scripts` → `docs/scripts/NNN-export-scripts-YYYY-MM-DD/`.
91
91
 
92
- ### Paso 3 — Clasificación y orden interno
92
+ ### Step 3 — Classification and internal order
93
93
 
94
- Agrupar por categoría canónica: `01 DDL-TABLES` · `02 DDL-FUNCTIONS` · `03 DML` · `04 INSERTS`. Orden interno cronológico por origen (sesión ascendente → stmt ascendente; standalone intercalado por orden léxico del filename).
94
+ Group by canonical category: `01 DDL-TABLES` · `02 DDL-FUNCTIONS` · `03 DML` · `04 INSERTS`. Internal order chronological by origin (ascending sessionascending stmt; standalone interleaved by lexical filename order).
95
95
 
96
- ### Paso 4 — Numeración continua (sin gaps)
96
+ ### Step 4 — Continuous numbering (no gaps)
97
97
 
98
- Asignar números secuenciales **solo a las categorías con contenido**, en el orden canónico. El primer forward siempre es `01-…`. Ej.: solo DML → `00-ROLLBACK.sql`, `01-DML.sql`; las 4 categorías → `00-ROLLBACK.sql`, `01-DDL-TABLES.sql`, `02-DDL-FUNCTIONS.sql`, `03-DML.sql`, `04-INSERTS.sql`.
98
+ Assign sequential numbers **only to categories with content**, in canonical order. The first forward is always `01-…`. E.g.: DML only → `00-ROLLBACK.sql`, `01-DML.sql`; all 4 categories → `00-ROLLBACK.sql`, `01-DDL-TABLES.sql`, `02-DDL-FUNCTIONS.sql`, `03-DML.sql`, `04-INSERTS.sql`.
99
99
 
100
- ### Paso 5 — Escribir forwards
100
+ ### Step 5 — Write the forwards
101
101
 
102
- Por categoría con contenido, un archivo con header de 1-2 líneas (`-- 0N-<CATEGORIA>.sql — bundle NNN-export-scripts-YYYY-MM-DD`) y, por sentencia, **un comentario de una línea** con el origen (`-- sessionXXX / stmt-id` o `-- docs/scripts/001-filename.sql`) seguido del SQL tal cual lo escribió el developer (envuelto en `BEGIN; … COMMIT;` si aplica). No replicar motivación/impacto/idempotencia ya presentes en el origen; no agregar índice de sentencias ni SELECTs de verificación inventados.
102
+ Per category with content, one file with a 1-2 line header (`-- 0N-<CATEGORY>.sql — bundle NNN-export-scripts-YYYY-MM-DD`) and, per statement, **a one-line origin comment** (`-- sessionXXX / stmt-id` or `-- docs/scripts/001-filename.sql`) followed by the SQL exactly as the developer wrote it (wrapped in `BEGIN; … COMMIT;` where it applies). Do not replicate motivation/impact/idempotency already present at the origin; no statement index, no invented verification SELECTs.
103
103
 
104
- ### Paso 6 — Derivar `00-ROLLBACK.sql` (al final)
104
+ ### Step 6 — Derive `00-ROLLBACK.sql` (at the end)
105
105
 
106
- Vía la capacidad `sql`, **leyendo los forwards ya escritos** (no el `SCRIPTS.sql` original): sentencias inversas en orden inverso (últimoprimero), bloque transaccional único, y un bloque "Cleanup irreversible" al final fuera de transacción solo si hay operaciones sin reversa automática.
106
+ Via the `sql` capability, **reading the already-written forwards** (not the original `SCRIPTS.sql`): inverse statements in reverse order (lastfirst), a single transactional block, and an "irreversible cleanup" block at the end outside the transaction only if there are operations without an automatic reverse.
107
107
 
108
- ### Paso 7 — Escribir `README.md` (3 secciones)
108
+ ### Step 7 — Write the `README.md` (3 sections)
109
109
 
110
- `## Archivos` (tabla: 1 fila por archivo presente) · `## Aplicar` (un `psql -f` por archivo en orden ascendente; el export no ejecuta nada) · `## Revertir` (`psql -f 00-ROLLBACK.sql` + nota si hay bloque irreversible). **Vetado**: resumen ejecutivo, tabla de sesiones, plantillas de correo, listado de commits, checklist de producción.
110
+ `## Archivos` (table: 1 row per file present) · `## Aplicar` (one `psql -f` per file in ascending order; the export executes nothing) · `## Revertir` (`psql -f 00-ROLLBACK.sql` + a note if there is an irreversible block). The README is a user-facing deliverable → write it in the user's language. **Vetoed**: executive summary, session table, email templates, commit listing, production checklist.
111
111
 
112
- ### Paso 8 — Escribir o reportar
112
+ ### Step 8 — Write or report
113
113
 
114
- Si `--dry-run`: imprimir el reporte; no escribir. Si no: `Write` del bundle. **NUNCA commitear**. Resumen al usuario: una línea por archivo escrito + ruta del bundle (sin replicar el README).
114
+ With `--dry-run`: print the report; write nothing. Otherwise: `Write` the bundle. **NEVER commit**. Summary to the user: one line per written file + the bundle path (without replicating the README).
115
115
 
116
116
  ## Output location
117
117
 
118
118
  ```
119
119
  docs/scripts/NNN-export-scripts-YYYY-MM-DD/
120
- ├── 00-ROLLBACK.sql # reversa derivada de los forwards
121
- ├── 01-<CATEGORIA>.sql # primer forward (numeración continua)
122
- ├── 02-<CATEGORIA>.sql # …según categorías con contenido
120
+ ├── 00-ROLLBACK.sql # reverse derived from the forwards
121
+ ├── 01-<CATEGORY>.sql # first forward (continuous numbering)
122
+ ├── 02-<CATEGORY>.sql # …per category with content
123
123
  └── README.md # Archivos · Aplicar · Revertir
124
124
  ```
125
125
 
126
126
  ## Re-run
127
127
 
128
- Idempotente funcional: cada invocación toma el siguiente `NNN` y **no sobrescribe** bundles previos. Para regenerar: borrar el directorio manualmente y re-invocar.
128
+ Functionally idempotent: each invocation takes the next `NNN` and **never overwrites** previous bundles. To regenerate: delete the directory manually and re-invoke.
129
129
 
130
130
  ## Resources
131
131
 
132
- - Design: `docs/referencias/workflow-exports/export-scripts.md` · familia: [`../README.md`](../README.md).
133
- - Capacidad compuesta: `sql` (built-in default; ver `docs/referencias/workflow-roles/`).
134
- - Artefacto fuente: `SCRIPTS.sql` (ver `docs/referencias/workflow-artifacts/artifacts-core/`).
132
+ - Design: `docs/referencias/workflow-exports/export-scripts.md` · family: [`../README.md`](../README.md).
133
+ - Composed capability: `sql` (built-in default; see `docs/referencias/workflow-roles/`).
134
+ - Source artifact: `SCRIPTS.sql` (see `docs/referencias/workflow-artifacts/artifacts-core/`).
135
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).