@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.
- package/package.json +1 -1
- package/skills/w/README.md +14 -14
- package/skills/w/SKILL.md +96 -75
- package/skills/w/artifacts/README.md +6 -6
- package/skills/w/artifacts/artifacts-core/SESSION.md +1 -7
- package/skills/w/artifacts/artifacts-core/TASKS.md +1 -1
- package/skills/w/artifacts/artifacts-exec/TECHNICAL-NOTE.md +9 -54
- package/skills/w/artifacts/artifacts-research/CONCLUSIONS.md +1 -1
- package/skills/w/commands/README.md +22 -22
- package/skills/w/commands/export-diagrams.md +9 -9
- package/skills/w/commands/export-manuals.md +9 -9
- package/skills/w/commands/export-reports.md +9 -9
- package/skills/w/commands/export-scripts.md +9 -9
- package/skills/w/commands/fix-git.md +12 -12
- package/skills/w/commands/plan-exec.md +19 -19
- package/skills/w/commands/plan-new.md +18 -18
- package/skills/w/commands/plan-refine.md +22 -22
- package/skills/w/commands/quick.md +16 -16
- package/skills/w/commands/spec-new.md +35 -34
- package/skills/w/commands/spec-refine.md +16 -16
- package/skills/w/commands/status.md +18 -16
- package/skills/w/commands/workspace-init.md +14 -14
- package/skills/w/exports/README.md +5 -5
- package/skills/w/exports/export-diagrams/SKILL.md +58 -58
- package/skills/w/exports/export-manuals/SKILL.md +61 -61
- package/skills/w/exports/export-reports/SKILL.md +51 -51
- package/skills/w/exports/export-scripts/SKILL.md +60 -60
- package/skills/w/harness/SKILL.md +48 -47
- package/skills/w/loops/CHASSIS.md +104 -97
- package/skills/w/loops/CODE-POLICIES.md +21 -21
- package/skills/w/loops/README.md +30 -29
- package/skills/w/loops/plan-exec-loop/SKILL.md +77 -80
- package/skills/w/loops/plan-new-loop/SKILL.md +88 -58
- package/skills/w/loops/plan-refine-loop/SKILL.md +69 -45
- package/skills/w/loops/quick-loop/SKILL.md +79 -79
- package/skills/w/loops/spec-refine-loop/SKILL.md +93 -97
- package/skills/w/roles/README.md +2 -2
- package/skills/w/roles/diagrams/SKILL.md +50 -47
- package/skills/w/roles/git/SKILL.md +58 -58
- package/skills/w/roles/research/SKILL.md +65 -62
- package/skills/w/roles/sql/SKILL.md +59 -55
- package/skills/w/roles/ui-spec/SKILL.md +60 -74
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: export-reports
|
|
3
|
-
description: "
|
|
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 —
|
|
6
|
+
# export-reports — executive/functional report from the session corpus + `docs/`
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
>
|
|
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` —
|
|
14
|
+
`docs/reports` — the **only** `docs/` folder this export writes.
|
|
15
15
|
|
|
16
|
-
## Writing (
|
|
16
|
+
## Writing (ambient convention, not a role)
|
|
17
17
|
|
|
18
|
-
|
|
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
|
-
- "
|
|
23
|
-
-
|
|
24
|
-
- Re-
|
|
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.
|
|
29
|
-
2.
|
|
30
|
-
3.
|
|
31
|
-
4.
|
|
32
|
-
5. **
|
|
33
|
-
6.
|
|
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
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
**`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
|
|
51
51
|
|
|
52
|
-
- `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` —
|
|
53
|
-
- `aw session-artifacts --code <NNN> --dump objetivo,conclusiones,decisiones` —
|
|
54
|
-
- `aw next-number docs/reports` —
|
|
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/*` —
|
|
58
|
+
- `docs/specs`, `docs/plans`, `docs/reports/*` — context + collision avoidance.
|
|
59
59
|
|
|
60
|
-
**Args** (
|
|
60
|
+
**Args** (no lifecycle *structured-choice*; harness capability — see [`../../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 |
|
|
67
|
+
| Flag | Behavior |
|
|
68
68
|
|---|---|
|
|
69
|
-
| `--sessions NNN[,NNN]` |
|
|
70
|
-
| `--since sessionNNN` |
|
|
71
|
-
| `--source <alias>` |
|
|
72
|
-
| `--audience gerencia\|tecnica` |
|
|
73
|
-
| `--slug <kebab>` |
|
|
74
|
-
| `--dry-run` |
|
|
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
|
-
|
|
76
|
+
No args: the whole corpus, executive audience by default.
|
|
77
77
|
|
|
78
78
|
## Flow
|
|
79
79
|
|
|
80
|
-
###
|
|
80
|
+
### Step 1 — Resolve context and filter the corpus
|
|
81
81
|
|
|
82
|
-
`aw sessions` / `release-data`
|
|
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
|
-
###
|
|
84
|
+
### Step 2 — Collect per-session inputs
|
|
85
85
|
|
|
86
|
-
|
|
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
|
-
###
|
|
88
|
+
### Step 3 — Recommendation dedup (cross-session)
|
|
89
89
|
|
|
90
|
-
|
|
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
|
-
###
|
|
92
|
+
### Step 4 — Synthesize (prose: ambient conventions)
|
|
93
93
|
|
|
94
|
-
Render
|
|
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`.
|
|
95
95
|
|
|
96
|
-
###
|
|
96
|
+
### Step 5 — Write or report
|
|
97
97
|
|
|
98
|
-
`aw next-number docs/reports` → `docs/reports/NNN-<slug>-YYYY-MM-DD.md`.
|
|
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
|
-
|
|
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` ·
|
|
111
|
-
-
|
|
112
|
-
-
|
|
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: "
|
|
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 commits — the 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 —
|
|
6
|
+
# export-scripts — consolidated SQL bundle, simple and direct
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
>
|
|
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` —
|
|
14
|
+
`docs/scripts` — the **only** `docs/` folder this export writes.
|
|
15
15
|
|
|
16
16
|
## Composes
|
|
17
17
|
|
|
18
|
-
|
|
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
|
-
- "
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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.
|
|
29
|
-
2.
|
|
30
|
-
3.
|
|
31
|
-
4.
|
|
32
|
-
5.
|
|
33
|
-
6.
|
|
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
|
-
- **
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
+
**`agent-workflow` CLI (alias `aw`)** — never read hardcoded paths:
|
|
52
52
|
|
|
53
|
-
- `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` —
|
|
54
|
-
- `aw session-artifacts --code <NNN> --dump scripts` —
|
|
55
|
-
- `aw next-number docs/scripts` —
|
|
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`
|
|
59
|
+
- Standalone `docs/scripts/*.sql` (top-level only), **excluding** any `docs/scripts/NNN-export-scripts-*/` (previous outputs of this export).
|
|
60
60
|
|
|
61
|
-
**Args** (
|
|
61
|
+
**Args** (no lifecycle *structured-choice*; harness capability — see [`../../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 |
|
|
68
|
+
| Flag | Behavior |
|
|
69
69
|
|---|---|
|
|
70
|
-
| `--sessions NNN[,NNN]` |
|
|
71
|
-
| `--since sessionNNN` |
|
|
72
|
-
| `--source <alias>` |
|
|
73
|
-
| `--skip-standalone` |
|
|
74
|
-
| `--dry-run` |
|
|
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
|
-
|
|
76
|
+
No args: every corpus session + every standalone `.sql` (excluding previous bundles).
|
|
77
77
|
|
|
78
78
|
## Flow
|
|
79
79
|
|
|
80
|
-
###
|
|
80
|
+
### Step 1 — Collect SQL sources
|
|
81
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
83
|
|
|
84
|
-
**
|
|
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
|
-
|
|
86
|
+
If the A + B union is empty → **abort**: there is no pending SQL in the workspace.
|
|
87
87
|
|
|
88
|
-
###
|
|
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
|
-
###
|
|
92
|
+
### Step 3 — Classification and internal order
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
Group by canonical category: `01 DDL-TABLES` · `02 DDL-FUNCTIONS` · `03 DML` · `04 INSERTS`. Internal order chronological by origin (ascending session → ascending stmt; standalone interleaved by lexical filename order).
|
|
95
95
|
|
|
96
|
-
###
|
|
96
|
+
### Step 4 — Continuous numbering (no gaps)
|
|
97
97
|
|
|
98
|
-
|
|
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
|
-
###
|
|
100
|
+
### Step 5 — Write the forwards
|
|
101
101
|
|
|
102
|
-
|
|
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
|
-
###
|
|
104
|
+
### Step 6 — Derive `00-ROLLBACK.sql` (at the end)
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
Via the `sql` capability, **reading the already-written forwards** (not the original `SCRIPTS.sql`): inverse statements in reverse order (last→first), 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
|
-
###
|
|
108
|
+
### Step 7 — Write the `README.md` (3 sections)
|
|
109
109
|
|
|
110
|
-
`## Archivos` (
|
|
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
|
-
###
|
|
112
|
+
### Step 8 — Write or report
|
|
113
113
|
|
|
114
|
-
|
|
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 #
|
|
121
|
-
├── 01-<
|
|
122
|
-
├── 02-<
|
|
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
|
-
|
|
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` ·
|
|
133
|
-
-
|
|
134
|
-
-
|
|
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).
|