@tacuchi/agent-workflow-cli 15.2.0 → 16.1.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/dist/application/templates/session.js +1 -1
- package/package.json +1 -1
- package/skills/w/README.md +14 -14
- package/skills/w/SKILL.md +94 -82
- package/skills/w/artifacts/README.md +1 -1
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +15 -13
- package/skills/w/artifacts/artifacts-core/SESSION.md +1 -1
- package/skills/w/artifacts/artifacts-core/TASKS.md +1 -1
- 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 +103 -98
- 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 -77
- package/skills/w/loops/plan-new-loop/SKILL.md +80 -80
- package/skills/w/loops/plan-refine-loop/SKILL.md +62 -62
- package/skills/w/loops/quick-loop/SKILL.md +79 -79
- package/skills/w/loops/spec-refine-loop/SKILL.md +93 -94
- 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,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: <prompt
|
|
2
|
+
description: Generates a specification draft (docs/specs/NNN-spec-<slug>.md) from a prompt, in a single pass. Step 1 of the SPEC flow; starts no loop.
|
|
3
|
+
argument-hint: <prompt with the requirement or idea>
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
@@ -9,71 +9,72 @@ allowed-tools:
|
|
|
9
9
|
]
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
# spec-new —
|
|
12
|
+
# spec-new — specification draft (single-pass)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Generates `docs/specs/NNN-spec-<slug>.md` in a single pass from the prompt in `$ARGUMENTS`. Starts no loop.
|
|
15
15
|
|
|
16
|
-
> ## ⛔ Single-pass —
|
|
16
|
+
> ## ⛔ Single-pass — NO RESEARCH (hard rule)
|
|
17
17
|
>
|
|
18
|
-
>
|
|
18
|
+
> This command **only paraphrases** the user's input into the draft schema. It is **one sequential pass**: read `$ARGUMENTS` → fill the sections → write the file. Nothing else. It must take **seconds, not minutes**.
|
|
19
19
|
>
|
|
20
|
-
> **
|
|
20
|
+
> **FORBIDDEN**, no exceptions: launching sub-agents/workflows (`Task`/`Agent`/`Workflow`), research sessions, web searches, or deep code investigation — **even if the harness is in a maximum-effort/depth mode** (e.g. ultracode/max-effort in Claude Code).
|
|
21
21
|
>
|
|
22
|
-
>
|
|
22
|
+
> This **overrides** any mode or session instruction saying "run a workflow for every substantial task". Those modes do **not** apply to `spec-new`: this command overrides them. If a section is uncertain, **do not investigate it** — declare it under `## Open questions` or `## Assumptions` and move on.
|
|
23
23
|
>
|
|
24
|
-
>
|
|
24
|
+
> Deep investigation (closing gaps, mapping code, querying DB, autonomous research) is **`spec-refine`** work, not this command's.
|
|
25
25
|
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
29
|
-
4.
|
|
26
|
+
1. Run `aw next-number docs/specs` (the only shell tool needed): it returns JSON — use the `next` field as `NNN`. This command builds the slug.
|
|
27
|
+
2. Derive the `<slug>`: short kebab-case from the Requirement — only `[a-z0-9-]`, ≤ ~5 words / ≤ 40 chars.
|
|
28
|
+
3. Create `docs/specs/NNN-spec-<slug>.md` paraphrasing `$ARGUMENTS` into the draft schema (below). Repo reading: optional and minimal (e.g. one file the user cited) — never a sweep or research.
|
|
29
|
+
4. Show the generated file and the suggested next step (`/w:spec-refine docs/specs/NNN-spec-<slug>.md`).
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Draft schema (`NNN-spec-<slug>.md`)
|
|
32
32
|
|
|
33
33
|
```markdown
|
|
34
34
|
# Spec NNN — <slug>
|
|
35
35
|
|
|
36
36
|
## Origin (opt.)
|
|
37
|
-
|
|
37
|
+
Original prompt / prior doc / reference that originated the spec.
|
|
38
38
|
|
|
39
39
|
## Requirement
|
|
40
|
-
|
|
40
|
+
The what + why (brief). In the user's language.
|
|
41
41
|
|
|
42
42
|
## Context (opt.)
|
|
43
|
-
|
|
43
|
+
Systems / components / sources involved. Known constraints.
|
|
44
44
|
|
|
45
45
|
## Scope
|
|
46
|
-
- In:
|
|
47
|
-
- Out:
|
|
46
|
+
- In: what is included
|
|
47
|
+
- Out: what is NOT included
|
|
48
48
|
|
|
49
49
|
## Acceptance criteria
|
|
50
|
-
- [ ]
|
|
51
|
-
- [ ]
|
|
50
|
+
- [ ] verifiable criterion 1 (EARS / Given-When-Then style recommended)
|
|
51
|
+
- [ ] verifiable criterion 2
|
|
52
52
|
|
|
53
53
|
## Assumptions (opt.)
|
|
54
|
-
|
|
54
|
+
Assumed facts.
|
|
55
55
|
|
|
56
56
|
## Open questions
|
|
57
|
-
|
|
57
|
+
Pending doubts. ← the spec-refine-loop closes them.
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
> **`Open questions`
|
|
60
|
+
> **`Open questions` goes last** — the refined spec **inserts before `Open questions`** `## UI spec` (if there is UI) + `## Refinement decisions` + `## Q&A traceability` (refined schema in the [`spec-refine-loop`](../loops/spec-refine-loop/SKILL.md)). Same skeleton: the draft and the refined spec share the order.
|
|
61
61
|
|
|
62
|
-
**
|
|
63
|
-
- Sin campo `Type` — `plan-new` infiere el cómo.
|
|
64
|
-
- `Scope` siempre lleva `Out` (qué queda fuera).
|
|
65
|
-
- **Acceptance criteria = criterios testables estáticos** (el "qué"): `plan-exec` los valida pero el avance se trackea en el PLAN (sus Tasks), no marcando estos `- [ ]` en el spec; el spec no muta por ejecución, solo por re-refine.
|
|
66
|
-
- Si hay **UI** involucrada, mencionarlo en `Requirement`/`Context`; el `## UI spec` se autora en `spec-refine` (vía capacidad `ui-design`). "UI sin especificar" es un gap de primera clase del refinamiento.
|
|
67
|
-
- Los **gaps** que detecta el loop = secciones débiles del esquema (Requirement vago, Scope sin `Out`, criterios no testables, Open questions abiertas, supuestos no declarados, contradicciones) **+ UI sin especificar** si el requerimiento involucra UI.
|
|
68
|
-
- Alternativa equivalente: el usuario crea el borrador a mano. Ambos caminos producen el mismo `docs/specs/NNN-spec-<slug>.md`.
|
|
62
|
+
**Filling notes:**
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
- No `Type` field — `plan-new` infers the how.
|
|
65
|
+
- `Scope` always carries `Out` (what stays out).
|
|
66
|
+
- **Acceptance criteria = static testable criteria** (the "what"): `plan-exec` validates them, but progress is tracked in the PLAN (its Tasks), never by ticking these `- [ ]` in the spec; the spec never mutates by execution, only by a re-refine.
|
|
67
|
+
- If **UI** is involved, mention it in `Requirement`/`Context`; the `## UI spec` is authored in `spec-refine` (via the `ui-design` capability). "UI unspecified" is a first-class refinement gap.
|
|
68
|
+
- The **gaps** the loop detects = weak sections of the schema (vague Requirement, Scope without `Out`, untestable criteria, open questions, undeclared assumptions, contradictions) **+ UI unspecified** when the requirement involves UI.
|
|
69
|
+
- Equivalent alternative: the user creates the draft by hand. Both paths produce the same `docs/specs/NNN-spec-<slug>.md`.
|
|
70
|
+
|
|
71
|
+
> **Reuse by escalation:** the live escalation from `/w:quick` (see [`../loops/quick-loop/SKILL.md`](../loops/quick-loop/SKILL.md) § *QUICK delta*) materializes its draft following **this same procedure** (steps 1-3: same schema, same NO RESEARCH single-pass hard rule), with `## Origin` = "escalated from `/w:quick`" + the original prompt. No need to type `/w:spec-new`: the consent in the structured-choice equals invoking it.
|
|
71
72
|
|
|
72
73
|
## Plan mode
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
Resolves `NNN` by reading `docs/specs/`, describes the draft it would generate without writing the file.
|
|
75
76
|
|
|
76
77
|
## Resources
|
|
77
78
|
|
|
78
79
|
- Design reference: `docs/referencias/workflow-commands/spec-new.md`
|
|
79
|
-
- Loop
|
|
80
|
+
- Loop that refines this draft: `../loops/spec-refine-loop/SKILL.md`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Starts or resumes the specification refinement loop (spec-refine-loop). Input: docs/specs/NNN-spec-<slug>.md (a draft — from spec-new, hand-written, or materialized by the quick escalation). Updates docs/specs/NNN-spec-<slug>.md in place.
|
|
3
3
|
argument-hint: <docs/specs/NNN-spec-<slug>.md>
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
@@ -10,33 +10,33 @@ allowed-tools:
|
|
|
10
10
|
]
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# spec-refine —
|
|
13
|
+
# spec-refine — trampoline to the refinement loop
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This command does not refine the spec itself: it delegates to `spec-refine-loop` (Layer 2), which iterates, closes gaps and produces the refined spec.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Run the loop
|
|
18
18
|
|
|
19
|
-
`spec-refine-loop` **
|
|
19
|
+
`spec-refine-loop` is **not** a skill invocable by name — it is this command's operating manual (a sibling doc in the bundle). **Load it and execute it end to end**:
|
|
20
20
|
|
|
21
|
-
1. **
|
|
22
|
-
2. **
|
|
21
|
+
1. **Read** `../loops/spec-refine-loop/SKILL.md` (inside the installed `w` skill — e.g. `~/.claude/skills/w/loops/…`).
|
|
22
|
+
2. **Follow** its instructions taking `$ARGUMENTS` as input: it detects state/resume, runs the gap-driven engine, creates and manages sessions, converges and reports.
|
|
23
23
|
|
|
24
|
-
>
|
|
24
|
+
> Do not try `Skill: spec-refine-loop` — it is not registered as a skill. The command **is** the entry; the loop is its body.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## State resolution (resumable)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
The skill detects prior state before starting, **keying off the `CHECKPOINT`** (never the existence of a "refined" file):
|
|
29
29
|
|
|
30
|
-
1.
|
|
31
|
-
2. **
|
|
32
|
-
3. **
|
|
33
|
-
4. **
|
|
30
|
+
1. Find the spec's refinement session under `.workflow/sessions/` and its `CHECKPOINT.md`.
|
|
31
|
+
2. **In progress** (a CHECKPOINT exists) → continue from the recorded progress (resolved gaps, Q&A).
|
|
32
|
+
3. **No progress** (no CHECKPOINT and the spec does **not** have `## Refinement decisions`/`## Q&A traceability`) → start from zero reading the spec (`NNN-spec*.md`).
|
|
33
|
+
4. **Already refined / re-refine on demand** (no open CHECKPOINT but the spec **already has** the 2 sections) → **first-class operation**: while the flow stays in SPEC you can re-run this command over the same spec **as many times as needed** (new requirements, scope changes, re-reads). The loop does `create_or_resume` — it locates the existing refine session (even closed) and **reopens** it instead of duplicating — and re-refines reading the **spec itself**; on `Guardar`, edits in place with confirmation.
|
|
34
34
|
|
|
35
|
-
> **Compat (legacy):**
|
|
35
|
+
> **Compat (legacy):** the `NNN-spec*.md` glob also catches old `NNN-spec.md` / `NNN-spec-refined.md` specs. Re-running spec-refine edits them in place from then on.
|
|
36
36
|
|
|
37
37
|
## Plan mode
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The skill resolves the state and describes the actions the loop would run (gaps it would close, questions it would ask), without starting the iteration.
|
|
40
40
|
|
|
41
41
|
## Resources
|
|
42
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: (
|
|
2
|
+
description: Read-only workspace dashboard — what got done / what is missing / what was discarded, with dates humanized in the user's language. Backed by `aw status`. Transversal command (not a flow); writes nothing.
|
|
3
|
+
argument-hint: (no arguments)
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
@@ -8,22 +8,22 @@ allowed-tools:
|
|
|
8
8
|
]
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# status —
|
|
11
|
+
# status — workspace state (read-only)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Shows, simple and direct, the workspace state grouped as **Done / Missing / Discarded**. Single-pass, read-only: no loop, no sessions, writes nothing in `docs/` or `.workflow/`. **Transversal** command (belongs to no flow).
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Run
|
|
16
16
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
4.
|
|
24
|
-
5.
|
|
17
|
+
1. Run `aw status` (returns JSON; backed by `status-service`).
|
|
18
|
+
2. Render a readable summary from the JSON — do **not** show the raw JSON. Use the `relative` field verbatim (it comes pre-humanized in the user's language — Spanish). Head it with `workspace.name`.
|
|
19
|
+
3. Group into three blocks (the dashboard is user-facing → render it in the user's language; the canonical Spanish labels below):
|
|
20
|
+
- `▸ HECHO` — specs with `refined: true`; plans with their progress (`tasks_done`/`tasks_total`, `progress_pct`); `closed` sessions.
|
|
21
|
+
- `▸ FALTA` — `active` sessions; plans with pending tasks (`tasks_total − tasks_done`); specs with `open_questions > 0`.
|
|
22
|
+
- `▸ DESCARTÓ` — every item in `discarded[]` (`kind: deferred` = deferred in BACKLOG; `kind: excluded` = excluded in CHECKPOINT), with its `text`.
|
|
23
|
+
4. Every line ends with its relative date after ` · ` (e.g. `· ayer en la mañana`). An empty section shows `— (nada)`. Never invent data not present in the JSON.
|
|
24
|
+
5. If `workspace.initialized` is `false` and everything is empty → say the folder is not an agent-workflow workspace (no `.workflow/`) and suggest `/w:workspace-init`.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Suggested format (plain text; user-facing labels in Spanish):
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
Workspace: <name>
|
|
@@ -43,8 +43,10 @@ Workspace: <name>
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Plan mode
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
Same as execution: run `aw status` (read-only) and show the summary. There are no changes to apply.
|
|
47
48
|
|
|
48
49
|
## Resources
|
|
49
|
-
|
|
50
|
+
|
|
51
|
+
- CLI: `aw status` (service `status-service`; dates via `humanize-es`)
|
|
50
52
|
- Design reference: `docs/referencias/workflow-skills/status.md`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: --source alias:path[:
|
|
2
|
+
description: Turns the current folder into an agent-workflow workspace (scaffolding .workflow/ + docs/ + WORKSPACE block + skills.toml). Replaces hub-init + project-init — no project/hub distinction. Run once before any flow; idempotent.
|
|
3
|
+
argument-hint: --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run]
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
@@ -10,30 +10,30 @@ allowed-tools:
|
|
|
10
10
|
]
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# workspace-init — bootstrap
|
|
13
|
+
# workspace-init — workspace bootstrap
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Runs `aw workspace-init` to turn the current folder into an agent-workflow workspace. A workspace has **1+ sources** (repos); "standalone" = a single source. There are no project/hub modes — the model is unified.
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
aw workspace-init --source alias:path[:
|
|
18
|
+
aw workspace-init --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run]
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Interactive steps
|
|
22
22
|
|
|
23
|
-
1. **
|
|
24
|
-
2. **
|
|
25
|
-
3. **
|
|
26
|
-
4. **Multi-
|
|
23
|
+
1. **Detect/confirm sources** — the CLI detects the repo path(s); the user confirms aliases, paths and branches. Multiple `--source` accepted.
|
|
24
|
+
2. **Pick default skills** — the catalog of available capabilities (roles) is presented. Per role: `built-in default`, override to a third-party skill (`skills.sh`), or `off`. The result is written to `.workflow/skills.toml`. Config cascade: `built-in → ~/.workflow/skills.toml (global) → .workflow/skills.toml (workspace)`.
|
|
25
|
+
3. **Write the scaffolding** — creates `.workflow/sessions/`, `docs/` with its taxonomy (`specs/`, `plans/`, `scripts/`, `manuals/`, `diagrams/`, `reports/`), the `WORKSPACE` block in CLAUDE.md/AGENTS.md (sources + metadata), and `.workflow/skills.toml`.
|
|
26
|
+
4. **Multi-source** — with ≥2 sources, configures multi-root visibility (settings.local.json + config, gitignored) and reconciles sources.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
When done, the user can run `/w:spec-new`, `/w:plan-new` or `/w:quick` directly.
|
|
29
29
|
|
|
30
|
-
**
|
|
30
|
+
**Idempotent**: re-running reconciles (no duplicate entries, no overwriting manual configuration).
|
|
31
31
|
|
|
32
32
|
## Plan mode
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Resolves the sources and describes the scaffolding it would create, without writing files. Shows what it would create under `.workflow/` and `docs/`, and what it would write into CLAUDE.md.
|
|
35
35
|
|
|
36
36
|
## Resources
|
|
37
37
|
|
|
38
38
|
- Design reference: `docs/referencias/workflow-commands/workspace-init.md`
|
|
39
|
-
- Skills config: `docs/referencias/workflow-roles/` (
|
|
39
|
+
- Skills config: `docs/referencias/workflow-roles/` (available capabilities/roles and the binding cascade)
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
| Export | Composes | Reads (artifacts / sessions + corpus) | Writes (its ONLY category) |
|
|
26
26
|
|---|---|---|---|
|
|
27
27
|
| [`export-scripts`](export-scripts/SKILL.md) | `sql` | type-B `SCRIPTS.sql` (DDL/DML migrations) across N sessions + standalone `docs/scripts/*.sql` | `docs/scripts/NNN-export-scripts-<date>/` (numbered forwards + `00-ROLLBACK.sql`) |
|
|
28
|
-
| [`export-manuals`](export-manuals/SKILL.md) | — (
|
|
28
|
+
| [`export-manuals`](export-manuals/SKILL.md) | — (prose: ambient conventions) | sessions + `DECISION` + plan-doc (`Solution`, `Final behavior`, `Validations`) + touched code | `docs/manuals/` |
|
|
29
29
|
| [`export-diagrams`](export-diagrams/SKILL.md) | `diagrams` | source code of the sources + plan-doc (`AS-IS` / `TO-BE`, `Impacted`) | `docs/diagrams/` (C4 / mermaid) |
|
|
30
|
-
| [`export-reports`](export-reports/SKILL.md) | — (
|
|
30
|
+
| [`export-reports`](export-reports/SKILL.md) | — (prose: ambient conventions) | corpus of sessions (spec, `CONCLUSIONS`, `DECISION`) + plan-doc state + `docs/` | `docs/reports/` (executive / functional report) |
|
|
31
31
|
|
|
32
32
|
> **Composition over ownership:** an export that owns a derived artifact does **not** own its authoring logic — it **composes a capability role** from [`../roles/`](../roles/) (resolved through `.workflow/skills.toml`): `export-scripts` composes `sql`; `export-diagrams` composes `diagrams`. Swapping the implementation is a one-line config change; it never touches the export. `export-manuals` and `export-reports` produce **prose**, which follows **ambient writing conventions** (the host auto-applies an installed writing skill if present) — they do **not** compose or bind a `writing` role.
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
1. **Layer 1, explicit** — the **user** invokes them (`/w:export-<cat>`). **Never** automatic (no loop fires them).
|
|
37
37
|
2. **Single-pass, read-only over sessions** — they read artifacts/sessions and `docs/`, **synthesize**, and write **only** their own `docs/<category>/` folder. They do **not** mutate sessions and do **not** open/close loops.
|
|
38
38
|
3. **Cross-session** — they consolidate **N** sessions + the `docs/` corpus (dedup, roadmap, continuous numbering).
|
|
39
|
-
4. **No loop, no internal sessions** — options come from **args** (no *structured-choice
|
|
39
|
+
4. **No loop, no internal sessions** — options come from **args** (no lifecycle *structured-choice*; harness capability — see [`../harness/SKILL.md`](../harness/SKILL.md)).
|
|
40
40
|
5. **Git-safe** — they **never** commit, merge, push, `--amend`, or `--no-verify`. The output is a written document the user reviews and commits when ready.
|
|
41
41
|
6. **DB scripts-only** — `export-scripts` ships migration SCRIPTS as a bundle; it **never executes** DDL/DML (a human/DBA applies them).
|
|
42
42
|
|
|
@@ -83,6 +83,6 @@ Exports read the corpus through the CLI — **never hard-coded paths**:
|
|
|
83
83
|
| Export | File | Category | Composes |
|
|
84
84
|
|---|---|---|---|
|
|
85
85
|
| `export-scripts` | [`export-scripts/SKILL.md`](export-scripts/SKILL.md) | `docs/scripts` | `sql` |
|
|
86
|
-
| `export-manuals` | [`export-manuals/SKILL.md`](export-manuals/SKILL.md) | `docs/manuals` | — (
|
|
86
|
+
| `export-manuals` | [`export-manuals/SKILL.md`](export-manuals/SKILL.md) | `docs/manuals` | — (prose: ambient conventions) |
|
|
87
87
|
| `export-diagrams` | [`export-diagrams/SKILL.md`](export-diagrams/SKILL.md) | `docs/diagrams` | `diagrams` |
|
|
88
|
-
| `export-reports` | [`export-reports/SKILL.md`](export-reports/SKILL.md) | `docs/reports` | — (
|
|
88
|
+
| `export-reports` | [`export-reports/SKILL.md`](export-reports/SKILL.md) | `docs/reports` | — (prose: ambient conventions) |
|
|
@@ -1,125 +1,125 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: export-diagrams
|
|
3
|
-
description: "
|
|
3
|
+
description: "Generates the workspace's architecture and flow diagrams in `docs/diagrams/` consolidating the sources' code + the plan-doc (`Current state (AS-IS)` / `Target state (TO-BE)`, `Impacted`) of N sessions. Produces context, containers, components, integrations and data model (when read-only MCP is available). Default `mermaid` (renders on GitHub, `mermaid.ink` link for preview); `c4`/structurizr opt-in via `--engine`. Output in `docs/diagrams/NNN-export-diagrams-YYYY-MM-DD/` (or `.md`). Read-only/report: emits only the diagram source (the reader renders it); never commits nor mutates anything; MCP reads only. Composes the `diagrams` capability. Use for 'system diagram', 'workspace C4', 'architecture/flow map'. User-invoked via `/w:export-diagrams`."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# export-diagrams —
|
|
6
|
+
# export-diagrams — architecture and flow diagrams from code + plan-doc
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Generates a diagram dossier (**architecture and flows**) of the workspace, aggregating the sources' structure and the sessions' delta. **Read-only / report** — it emits only the diagram **source** (Mermaid / DSL); the reader renders it. It never commits, never mutates anything; MCP reads only.
|
|
9
9
|
|
|
10
|
-
>
|
|
10
|
+
> `export-*` family (the only artifact→`docs/` path). Design: `docs/referencias/workflow-exports/export-diagrams.md`.
|
|
11
11
|
|
|
12
12
|
## Category
|
|
13
13
|
|
|
14
|
-
`docs/diagrams` —
|
|
14
|
+
`docs/diagrams` — the **only** `docs/` folder this export writes.
|
|
15
15
|
|
|
16
16
|
## Composes
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
The **`diagrams`** capability (built-in default `diagrams`), resolved via `.workflow/skills.toml`. It contributes the render engine (native Mermaid C4 / Structurizr DSL), the C1–C4 levels and the preview-link convention. 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
|
+
- "System diagram", "workspace C4", "architecture map".
|
|
23
|
+
- "Flow diagram" across touched components / integrations.
|
|
24
|
+
- Technical onboarding; before structural changes (validate the current architecture); technical audit.
|
|
25
25
|
|
|
26
26
|
## What it does
|
|
27
27
|
|
|
28
|
-
1.
|
|
29
|
-
2.
|
|
30
|
-
3. (
|
|
31
|
-
4.
|
|
32
|
-
5.
|
|
33
|
-
6.
|
|
28
|
+
1. Inspects the workspace sources' code (structure, wiring, integrations, technologies).
|
|
29
|
+
2. Reads the plan-doc from the sessions: `Current state (AS-IS)` / `Target state (TO-BE)` and `Impacted` (what changed and where).
|
|
30
|
+
3. (Optional) With read-only MCP available and a data-model request: queries DB schemas (reads only).
|
|
31
|
+
4. Resolves the engine (`--engine`) and consolidates the architecture/flows touched by the N sessions.
|
|
32
|
+
5. Renders the diagrams (composes `diagrams`): context, containers, components, integrations, data model (when it applies).
|
|
33
|
+
6. Writes the dossier to `docs/diagrams/NNN-export-diagrams-YYYY-MM-DD/` with a `README.md` (index + how to read).
|
|
34
34
|
|
|
35
35
|
## What it does NOT do
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- **
|
|
41
|
-
-
|
|
42
|
-
-
|
|
37
|
+
- Run commits, merges, push, or SQL.
|
|
38
|
+
- Mutate sessions, the plan-doc or the code (read-only). MCP **reads only** (never DML/DDL).
|
|
39
|
+
- Write any `docs/` folder other than `docs/diagrams/` (invariant: one category).
|
|
40
|
+
- **Visually render** the diagram: it emits only the source (Mermaid / DSL); the reader renders with their tools (or the `mermaid.ink` link).
|
|
41
|
+
- Validate that the integrations work (that is doctor work) or invent absent components.
|
|
42
|
+
- Overwrite previous dossiers (always next-number).
|
|
43
43
|
|
|
44
44
|
## Read-only sandbox
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
In plan mode it **describes**, never writes: the resolved engine, the levels/sections that would appear (resolved by args), the sources to inspect + detected integrations, and — with a data-model request — the proposed MCP queries with their estimated cost. It does **not** run `Write`, MCP mutations, or effectful `aw next-number`.
|
|
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` —
|
|
54
|
-
- `aw next-number docs/diagrams` —
|
|
52
|
+
- `aw sessions` / `aw release-data [--since sessionNNN] [--source <alias>]` — enumerates the corpus (input for the AS-IS/TO-BE delta).
|
|
53
|
+
- `aw session-artifacts --code <NNN> --dump objetivo` — locates the session and its plan-doc reference; `AS-IS`/`TO-BE`/`Impacted` are read from the plan-doc by its path.
|
|
54
|
+
- `aw next-number docs/diagrams` — deterministic numbering (the CLI handles destination-folder resolution).
|
|
55
55
|
|
|
56
|
-
**Filesystem /
|
|
56
|
+
**Filesystem / code**:
|
|
57
57
|
|
|
58
|
-
-
|
|
59
|
-
- `docs/diagrams/`
|
|
58
|
+
- The declared sources' code (structure, wiring, technology manifests).
|
|
59
|
+
- Existing `docs/diagrams/` (to complement / avoid collisions).
|
|
60
60
|
|
|
61
|
-
**
|
|
61
|
+
**Read-only MCP** (optional, only with a data-model request and configuration): `\d <table>`, `SELECT count(*)`, FK relations for the `erDiagram`. With the cost guard.
|
|
62
62
|
|
|
63
|
-
**Args** (
|
|
63
|
+
**Args** (no lifecycle *structured-choice*; harness capability — see [`../../harness/SKILL.md`](../../harness/SKILL.md)):
|
|
64
64
|
|
|
65
65
|
```
|
|
66
66
|
/w:export-diagrams [--sessions NNN[,NNN]] [--since sessionNNN] [--source <alias>]
|
|
67
67
|
[--engine mermaid|c4] [--scope c4|integrations|data|todo] [--dry-run]
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
| Flag |
|
|
70
|
+
| Flag | Behavior |
|
|
71
71
|
|---|---|
|
|
72
|
-
| `--sessions NNN[,NNN]` |
|
|
73
|
-
| `--since sessionNNN` |
|
|
74
|
-
| `--source <alias>` |
|
|
75
|
-
| `--engine mermaid\|c4` | Default `mermaid` (
|
|
76
|
-
| `--scope` |
|
|
77
|
-
| `--dry-run` |
|
|
72
|
+
| `--sessions NNN[,NNN]` | Discrete filter by code (takes precedence over `--since`); affects the AS-IS/TO-BE delta |
|
|
73
|
+
| `--since sessionNNN` | Only sessions after NNN (exclusive: NNN itself is out; use `--sessions` to include it) |
|
|
74
|
+
| `--source <alias>` | Limits to one source (multi-source workspace) |
|
|
75
|
+
| `--engine mermaid\|c4` | Default `mermaid` (renders on GitHub); `c4` = opt-in Structurizr DSL |
|
|
76
|
+
| `--scope` | Which sections appear: `c4` (context/containers/components), `integrations`, `data` (only with MCP), `todo` (default: all) |
|
|
77
|
+
| `--dry-run` | Propositional report, no files written |
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
No args: `--engine mermaid --scope todo`. The system **snapshot** is always the last known state; `--since`/`--sessions` modulate the delta emphasis (what was touched), not the base snapshot.
|
|
80
80
|
|
|
81
81
|
## Flow
|
|
82
82
|
|
|
83
|
-
###
|
|
83
|
+
### Step 1 — Resolve context and corpus
|
|
84
84
|
|
|
85
|
-
`aw sessions` / `release-data`
|
|
85
|
+
`aw sessions` / `release-data` applying `--sessions`/`--since`/`--source`. The CLI handles destination-folder resolution.
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### Step 2 — Inspect the sources
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Per source: basic structure, internal components (modules, services, commands, hooks, configured MCP), technologies per manifest (`package.json`, `pom.xml`, …), external integrations.
|
|
90
90
|
|
|
91
|
-
###
|
|
91
|
+
### Step 3 — Read the corpus delta
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Per filtered session (`aw session-artifacts --code <NNN> --dump objetivo`): follow the plan-doc reference and read `Current state (AS-IS)` / `Target state (TO-BE)` and `Impacted`. Used to highlight what changed over the current snapshot.
|
|
94
94
|
|
|
95
|
-
###
|
|
95
|
+
### Step 4 — Inspect MCP (optional)
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
If `--scope` includes `data` and read-only MCP exists: `\d <table>`, `count(*)`, FK relations (with the cost guard). Not available → omit the "Data model" section with an inline note.
|
|
98
98
|
|
|
99
|
-
###
|
|
99
|
+
### Step 5 — Render (composes `diagrams`)
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
Per `--engine`: `mermaid` → native Mermaid C4 blocks (`C4Context`/`C4Container`/`C4Component`) and `flowchart` for flows; `c4` → a separate Structurizr `workspace.dsl` + auxiliary embedded Mermaid for offline reading. For every ```` ```mermaid ```` block, add immediately after the closing fence a blockquote with the preview link: `> Ver diagrama renderizado: <https://mermaid.ink/img/BASE64>` (URL-safe base64 of the plain code). Not applicable to `workspace.dsl`.
|
|
102
102
|
|
|
103
|
-
###
|
|
103
|
+
### Step 6 — Write or report
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
With `--dry-run`: print the report; write nothing. Otherwise: `aw next-number docs/diagrams` + write the dossier. **NEVER commit**. Summary to the user: engine, present/omitted sections (e.g. Data omitted without MCP) and the path.
|
|
106
106
|
|
|
107
107
|
## Output location
|
|
108
108
|
|
|
109
109
|
```
|
|
110
110
|
docs/diagrams/NNN-export-diagrams-YYYY-MM-DD/
|
|
111
|
-
├── README.md #
|
|
112
|
-
├── diagrams.md #
|
|
113
|
-
└── workspace.dsl #
|
|
111
|
+
├── README.md # index + how to read + counts
|
|
112
|
+
├── diagrams.md # main document with embedded Mermaid (+ mermaid.ink links)
|
|
113
|
+
└── workspace.dsl # only with --engine c4 (Structurizr)
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## Re-run
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Functionally idempotent: each invocation takes the next `NNN`; it never overwrites previous dossiers. To regenerate: delete the directory and re-invoke.
|
|
119
119
|
|
|
120
120
|
## Resources
|
|
121
121
|
|
|
122
|
-
- Design: `docs/referencias/workflow-exports/export-diagrams.md` ·
|
|
123
|
-
-
|
|
124
|
-
-
|
|
122
|
+
- Design: `docs/referencias/workflow-exports/export-diagrams.md` · family: [`../README.md`](../README.md).
|
|
123
|
+
- Composed capability: `diagrams` (built-in default; see `docs/referencias/workflow-roles/`).
|
|
124
|
+
- Input: plan-doc `AS-IS`/`TO-BE`/`Impacted` (see `docs/plans`).
|
|
125
125
|
- Siblings: [`../export-scripts/SKILL.md`](../export-scripts/SKILL.md) · [`../export-manuals/SKILL.md`](../export-manuals/SKILL.md) · [`../export-reports/SKILL.md`](../export-reports/SKILL.md).
|