@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
@@ -14,106 +14,106 @@ description: >-
14
14
 
15
15
  ## Role
16
16
 
17
- `git` — built-in default. Rebindable in `.workflow/skills.toml` (third-party skill or `off`). This skill encodes invariant 5: **git seguro**.
17
+ `git` — built-in default. Rebindable in `.workflow/skills.toml` (third-party skill or `off`). This skill encodes invariant 5: **safe git**.
18
18
 
19
19
  ## Purpose
20
20
 
21
- Operar git de forma **segura y controlada**: verificar la rama esperada antes de editar, **proponer** commits por fuente, y nunca ejecutar operaciones destructivas o de publicación sin pedido explícito del usuario.
21
+ Operate git in a **safe, controlled** way: verify the expected branch before editing, **propose** commits per source, and never run destructive or publishing operations without the user's explicit request.
22
22
 
23
23
  ## Composed by
24
24
 
25
- - **`plan-exec-loop`** — verifica rama antes de cada edit; propone commits al cerrar/checkpoint.
26
- - **`quick-loop`** — igual, en el atajo liviano.
27
- - **`/w:fix-git`** (comando transversal) — compone la sección *Resolución de conflictos de merge* para resolver un merge en curso en cualquier repo.
25
+ - **`plan-exec-loop`** — verifies the branch before each edit; proposes commits on close/checkpoint.
26
+ - **`quick-loop`** — same, in the lightweight shortcut.
27
+ - **`/w:fix-git`** (transversal command) — composes the *Merge-conflict resolution* section to resolve an in-progress merge in any repo.
28
28
 
29
- (Cualquier flujo que edite código o que el usuario quiera commitear lo usa.)
29
+ (Any flow that edits code, or any user commit request, uses it.)
30
30
 
31
31
  ## Knowledge
32
32
 
33
- ### Operaciones prohibidas sin solicitud explícita del usuario
33
+ ### Operations forbidden without an explicit user request
34
34
 
35
- Lista cerrada. La IA **nunca** las ejecuta por iniciativa propia:
35
+ Closed list. The AI **never** runs them on its own initiative:
36
36
 
37
- - `git commit` (incluye `--amend`)
38
- - `git push` (incluye `--force` / `-f`)
37
+ - `git commit` (includes `--amend`)
38
+ - `git push` (includes `--force` / `-f`)
39
39
  - `git merge` · `git rebase` · `git cherry-pick`
40
- - `git tag` (crear o editar)
41
- - `git reset --hard` · `git restore .` · `git checkout -- .` · `git clean -fd` · `git stash` (cuando hay trabajo sin commit)
40
+ - `git tag` (create or edit)
41
+ - `git reset --hard` · `git restore .` · `git checkout -- .` · `git clean -fd` · `git stash` (when there is uncommitted work)
42
42
 
43
- Y **siempre** prohibido, aún cuando el usuario pida commit: `--no-verify` (respetar los hooks pre-commit), `--force`, trailers `Co-Authored-By`, firmas de modelo.
43
+ And **always** forbidden, even when the user asks for a commit: `--no-verify` (respect the pre-commit hooks), `--force`, `Co-Authored-By` trailers, model signatures.
44
44
 
45
- > **Excepción — merge en curso:** resolver los conflictos de un merge **ya iniciado** (MERGE_HEAD), o iniciado a pedido **explícito** del usuario vía `/w:fix-git`, **sí** está permitido (es solicitud explícita, no iniciativa propia) — ver *Resolución de conflictos de merge*.
45
+ > **Exception — merge in progress:** resolving the conflicts of an **already started** merge (MERGE_HEAD), or one started at the user's **explicit** request via `/w:fix-git`, **is** allowed (it is an explicit request, not own initiative) — see *Merge-conflict resolution*.
46
46
 
47
- ### Operaciones read-only (siempre permitidas, sin preguntar)
47
+ ### Read-only operations (always allowed, no asking)
48
48
 
49
- `status` · `log` · `diff` · `branch --show-current` · `rev-parse` · `show`. `git checkout` (cambio de rama) **no** es read-only: requiere *structured-choice* (capacidad del arnés — ver `../../harness/SKILL.md`; en **Claude Code** es `AskUserQuestion`, máx 4 preguntas/llamada → **≤3 preguntas de contenido + 1 control `flow`**; sin elección estructurada degrada a **markdown numerado**) aunque no sea destructivo (ver verificación de rama).
49
+ `status` · `log` · `diff` · `branch --show-current` · `rev-parse` · `show`. `git checkout` (branch switch) is **not** read-only: it requires *structured-choice* (canonical rule: `../../loops/CHASSIS.md` § *Structured-choice*; per-harness binding: `../../harness/SKILL.md`) even though it is not destructive (see branch verification).
50
50
 
51
- ### Verificación de rama (antes de editar)
51
+ ### Branch verification (before editing)
52
52
 
53
- La rama esperada **nunca se asume desde la rama actual** — el usuario pudo cambiarla a mano. Verificar contra la rama de trabajo declarada por fuente antes de cualquier `Write/Edit`.
53
+ The expected branch is **never assumed from the current branch** — the user may have switched it by hand. Verify against each source's declared work branch before any `Write/Edit`.
54
54
 
55
- **Mecanismo primario**: `aw check-branch --source <alias>` (o `--file <path-del-edit-inminente>`; `--strict` devuelve exit 2 en mismatch — útil como gate). Devuelve ya computados los campos por fuente: `alias`, `path`, `main_branch` (base, default `certificacion`), `expected_work_branch`, `current_branch`, `match` (`current == expected`), `dirty` (cambios sin commit). **Fallback** (repo suelto sin workspace/CLI): computarlos con git read-only directo (`git branch --show-current` + `git status --porcelain`) más la rama declarada por la sesión.
55
+ **Primary mechanism**: `aw check-branch --source <alias>` (or `--file <path-of-the-imminent-edit>`; `--strict` returns exit 2 on mismatch — useful as a gate). It returns the per-source fields already computed: `alias`, `path`, `main_branch` (base), `expected_work_branch`, `current_branch`, `match` (`current == expected`), `dirty` (uncommitted changes). **Fallback** (loose repo without workspace/CLI): compute them with direct read-only git (`git branch --show-current` + `git status --porcelain`) plus the session's declared branch.
56
56
 
57
- Casos:
57
+ Cases:
58
58
 
59
- - **`match=true`** → OK, editar.
60
- - **`match=false, dirty=false`** (Caso A — rama distinta, repo limpio) → *structured-choice*: hacer `git checkout <expected>` / mantener current y actualizar la expectativa de la sesión / cancelar.
61
- - **`match=false, dirty=true`** (Caso B — rama distinta + cambios sin commit) → **pausar y esperar resolución manual**. No proponer checkout (podría perder trabajo). Pedir al usuario commit/stash/discard y avisar cuando continuar.
62
- - **Cross-fuente (hub)**: si las fuentes tocadas apuntan a ramas distintas sin declararlo, **hard gate** — bloquear avance con *structured-choice* (alinear todas / declarar divergencia explícita / cancelar).
63
- - **HEAD detached** → tratar como Caso A.
64
- - **Fuente fuera de git** (`is_repo=false`) → informar, no bloquear.
59
+ - **`match=true`** → OK, edit.
60
+ - **`match=false, dirty=false`** (Case A — different branch, clean repo) → *structured-choice*: `git checkout <expected>` / keep current and update the session's expectation / cancel.
61
+ - **`match=false, dirty=true`** (Case B — different branch + uncommitted changes) → **pause and wait for manual resolution**. Never propose checkout (it could lose work). Ask the user to commit/stash/discard and to say when to continue.
62
+ - **Cross-source (hub)**: if the touched sources point to different branches without declaring it, **hard gate** — block progress with *structured-choice* (align all / declare the divergence explicitly / cancel).
63
+ - **Detached HEAD** → treat as Case A.
64
+ - **Source outside git** (`is_repo=false`) → report, do not block.
65
65
 
66
- ### Commits — propose-then-execute, una fuente a la vez
66
+ ### Commits — propose-then-execute, one source at a time
67
67
 
68
- Ante cualquier pedido o disparo de commit (cierre de loop, "commitea esto", "guardá los cambios"):
68
+ On any commit request or trigger (loop close, "commit this", "save the changes"):
69
69
 
70
- 1. Resolver las fuentes y su estado dirty/rama con `aw sources` (inventario con git status enriquecido; fallback: git directo por fuente).
71
- 2. Si hay 1+ fuentes `dirty=true`, invocar **una sola** *structured-choice* con una pregunta de contenido por fuente dirty (máx 4 simultáneas → **≤3 preguntas de contenido + 1 control `flow`**; si N>3, en tandas):
72
- - Header de la pregunta: el `alias` de la fuente.
73
- - Opciones: "Aprobar sugerido (Recomendado)" con el mensaje canónico / "Saltar esta fuente". `Other` = mensaje custom.
74
- 3. Ejecutar `git -C <path> commit -m "<msg>"` solo en las fuentes aprobadas, **una a una**. Respetar hooks (sin `--no-verify`).
75
- 4. Si una fuente tiene `match=false` (rama distinta a la esperada): **omitirla y abortar su commit**; avisar para alinear la rama primero.
76
- 5. Si todas están `dirty=false` → skip silencioso, informar en chat que no hay nada que commitear.
70
+ 1. Resolve the sources and their dirty/branch state with `aw sources` (inventory with enriched git status; fallback: direct git per source).
71
+ 2. With 1+ `dirty=true` sources, invoke **a single** *structured-choice* with one content question per dirty source (3 per call + `flow` control; N>3 in batches):
72
+ - Question header: the source's `alias`.
73
+ - Options: "Approve suggested (Recommended)" with the canonical message / "Skip this source". `Other` = custom message.
74
+ 3. Run `git -C <path> commit -m "<msg>"` only on the approved sources, **one at a time**. Respect hooks (no `--no-verify`).
75
+ 4. If a source has `match=false` (branch differs from expected): **skip it and abort its commit**; ask to align the branch first.
76
+ 5. If all are `dirty=false` → silent skip; report in chat that there is nothing to commit.
77
77
 
78
- **Bypass** (Regla 5): si el usuario aporta el mensaje literal exacto (`-m "..."`, comillas), commitear directo sin *structured-choice*, pero seguir validando rama, hooks y formato. Si el literal viola el formato, avisar antes de ejecutar.
78
+ **Bypass** (Rule 5): if the user provides the exact literal message (`-m "..."`, quoted), commit directly without *structured-choice*, still validating branch, hooks and format. If the literal violates the format, warn before executing.
79
79
 
80
- ### Formato canónico del mensaje
80
+ ### Canonical message format
81
81
 
82
- - **Una sola línea**, corta (≤72 chars sugerido), descriptiva (qué cambia, no cómo).
83
- - Incluir el código de sesión activa (`session<NNN>` como tag o en el prefijo) cuando aplique.
84
- - Prefijo Conventional Commits **opcional** (`feat:` `fix:` `docs:` `chore:` `refactor:` `test:`).
85
- - **Prohibido**: multi-línea/body, trailers `Co-Authored-By`, firmas de modelo, emojis (salvo pedido explícito), `--no-verify`.
82
+ - **A single line**, short (≤72 chars suggested), descriptive (what changes, not how), written in the user's language.
83
+ - Include the active session code (`session<NNN>` as a tag or prefix) when it applies.
84
+ - Conventional Commits prefix **optional** (`feat:` `fix:` `docs:` `chore:` `refactor:` `test:`).
85
+ - **Forbidden**: multi-line/body, `Co-Authored-By` trailers, model signatures, emojis (unless explicitly requested), `--no-verify`.
86
86
 
87
- Válidos:
87
+ Valid:
88
88
  ```
89
89
  session007: agrega politica de commits controlados
90
90
  feat(session012): nuevo export-scripts
91
91
  fix(session018): corrige drift en hooks.json
92
92
  ```
93
93
 
94
- Fuera de sesión activa: relajar a "1 línea + sin co-author"; el tag `session<NNN>` se omite. El propose-then-execute sigue activo.
94
+ Outside an active session: relax to "1 line + no co-author"; the `session<NNN>` tag is omitted. Propose-then-execute stays active.
95
95
 
96
- ### Resolución de conflictos de merge
96
+ ### Merge-conflict resolution
97
97
 
98
- `git merge` autónomo está prohibido (arriba), **pero** resolver un merge **ya en curso** (MERGE_HEAD) o invocado por el usuario vía `/w:fix-git` **sí** es trabajo sancionado. **Agnóstico al workspace**: opera sobre cualquier repo (no requiere `.workflow/`, flows ni sesiones).
98
+ Autonomous `git merge` is forbidden (above), **but** resolving an **in-progress** merge (MERGE_HEAD), or one invoked by the user via `/w:fix-git`, **is** sanctioned work. **Workspace-agnostic**: it operates on any repo (no `.workflow/`, flows or sessions required).
99
99
 
100
- 1. **Detectar + identificar** con `aw merge-state [<path>|--source <alias>|--all]` (read-only): `is_merging`, `current_branch` (**destino / ours**), `merge_origin` (**origen / theirs**), `conflicted_files`. Si `merge_origin` viene vacío, mirar `.git/MERGE_MSG` o `git log --oneline -1 MERGE_HEAD`.
101
- 2. **Analizar la intención** de cada conflicto **antes** de resolver nunca elegir un lado a ciegas:
102
- - Las tres versiones: `git show :1:<file>` (base) · `:2:<file>` (ours/destino) · `:3:<file>` (theirs/origen).
103
- - El porqué de cada lado: `git log --merge -p -- <file>`; el historial del hunk en cada rama.
104
- - El código alrededor del marcador (coherencia con el resto del archivo).
105
- 3. **Resolver** editando el archivo (quitar `<<<<<<<` / `=======` / `>>>>>>>`): elegir **ours**, **theirs**, **combinar** ambas intenciones, o **reescribir** para satisfacer las dos. `git add <file>` lo resuelto.
106
- 4. **Preguntar** (*structured-choice*) cuando la intención es **ambigua** o los dos lados son **incoherentes** entre (no combinables sin perder algo): una pregunta de contenido por archivo/hunk dudoso (≤3 + control `flow`), opciones "Ours (`<destino>`)" / "Theirs (`<origen>`)" / "Combinar" / "Editar manual". **No inventar** una resolución cuando hay duda real.
107
- 5. **Commit propuesto**: completar el merge es un `git commit` (el merge commit) → **propose-then-execute** como cualquier commit (formato canónico de arriba; fuera de sesión → 1 línea sin tag `session<NNN>`; nunca `--no-verify`/`--amend`/`push`). El hook `git-commit-advisor` lo gatea.
108
- 6. **Escape**: si el merge no debe completarse, `git merge --abort` **tras confirmación** del usuario (*structured-choice*) — deja el repo como antes del merge.
100
+ 1. **Detect + identify** with `aw merge-state [<path>|--source <alias>|--all]` (read-only): `is_merging`, `current_branch` (**destination / ours**), `merge_origin` (**origin / theirs**), `conflicted_files`. If `merge_origin` comes empty, check `.git/MERGE_MSG` or `git log --oneline -1 MERGE_HEAD`.
101
+ 2. **Analyze each conflict's intent** **before** resolvingnever pick a side blindly:
102
+ - The three versions: `git show :1:<file>` (base) · `:2:<file>` (ours/destination) · `:3:<file>` (theirs/origin).
103
+ - Each side's why: `git log --merge -p -- <file>`; the hunk's history on each branch.
104
+ - The code around the marker (coherence with the rest of the file).
105
+ 3. **Resolve** by editing the file (remove `<<<<<<<` / `=======` / `>>>>>>>`): pick **ours**, **theirs**, **combine** both intents, or **rewrite** to satisfy both. `git add <file>` what is resolved.
106
+ 4. **Ask** (*structured-choice*) when the intent is **ambiguous** or both sides are **incoherent** with each other (not combinable without losing something): one content question per doubtful file/hunk (≤3 + `flow` control), options "Ours (`<destination>`)" / "Theirs (`<origin>`)" / "Combine" / "Edit manually". **Never invent** a resolution under real doubt.
107
+ 5. **Proposed commit**: completing the merge is a `git commit` (the merge commit) → **propose-then-execute** like any commit (canonical format above; outside a session → 1 line without the `session<NNN>` tag; never `--no-verify`/`--amend`/`push`). The `git-commit-advisor` hook gates it.
108
+ 6. **Escape hatch**: if the merge must not complete, `git merge --abort` **after user confirmation** (*structured-choice*) — leaves the repo as before the merge.
109
109
 
110
- > **Resume por git**: el estado del merge en `.git` (MERGE_HEAD + índice) **es** el checkpoint; re-correr `/w:fix-git` reanuda desde los conflictos que queden. No hay session ni artefacto.
111
- > **Rebase / cherry-pick**: fuera de v1 (misma resolución de markers; distinto `--continue` / `REBASE_HEAD`).
110
+ > **Resume via git**: the merge state in `.git` (MERGE_HEAD + index) **is** the checkpoint; re-running `/w:fix-git` resumes from the remaining conflicts. No session, no artifact.
111
+ > **Rebase / cherry-pick**: out of v1 (same marker resolution; different `--continue` / `REBASE_HEAD`).
112
112
 
113
113
  ## Output
114
114
 
115
- Ninguno en `docs/`. Produce commits **solo** cuando el usuario aprueba, en los repos fuente. La verificación de rama puede actualizar la expectativa de rama de la sesión si el usuario lo elige.
115
+ Nothing in `docs/`. It produces commits **only** when the user approves, in the source repos. Branch verification may update the session's branch expectation if the user picks that.
116
116
 
117
117
  ## Source
118
118
 
119
- Reciclada de la doctrina vieja: `doctrine/session/references/commits-policy.md` (Reglas 1-5: propose-then-execute, formato canónico, bypass) + `doctrine/session/references/branch-verification.md` (Casos A/B/C, cross-fuente hard gate). La verificación delega lo mecánico al CLI (`aw check-branch`, `aw sources`) — computarlo a mano en cada task pagaba tokens por trabajo que el runtime ya expone; el git read-only directo queda como fallback para repos sin workspace.
119
+ Rationale and history: design (`docs/referencias/workflow-roles/git.md`).
@@ -1,121 +1,124 @@
1
1
  ---
2
2
  name: research
3
3
  description: >
4
- Capacidad de investigación on-demand que los loops componen cuando necesitan evidencia para avanzar.
5
- Investiga INLINE dentro de la sesión activa (no crea una sesión aparte): lee el workspace + repos
6
- asociados + MCPs en modo read-only, produce ANALYSIS-FILE → CONCLUSIONS dentro de esa sesión.
7
- Concluye INCONCLUSIVE si la pregunta no puede responderse con las fuentes disponibles. Discrimina
8
- cuándo investigar ("¿puedo responder leyendo repo/datos?") vs cuándo preguntar al humano
9
- ("¿depende de lo que el usuario quiere?").
4
+ On-demand investigation capability that loops compose when they need evidence to
5
+ move forward. Investigates INLINE inside the active session (never creates a
6
+ separate session): reads the workspace + associated repos + MCPs read-only,
7
+ produces ANALYSIS-FILE CONCLUSIONS inside that session. Concludes INCONCLUSIVE
8
+ when the question cannot be answered with the available sources. Discriminates
9
+ when to investigate ("can I answer by reading repo/data?") vs when to ask the
10
+ human ("does it depend on what the user wants?").
10
11
  ---
11
12
 
12
13
  # research — On-demand investigation capability
13
14
 
14
15
  ## Role
15
16
 
16
- `research` — implementación built-in por defecto. Rebindeable a otra skill (de tercero o `off`) en `.workflow/skills.toml`.
17
+ `research` — built-in default implementation. Rebindable to another skill (third-party or `off`) in `.workflow/skills.toml`.
17
18
 
18
19
  ## Purpose
19
20
 
20
- Resolver preguntas factuales sobre el sistema antes de actuar: leer el repo, rastrear datos vía MCP read-only, producir hallazgos sintetizados. **No crea artefactos de producción** — produce evidencia y conclusiones para que el loop que la compuso pueda avanzar con información de calidad.
21
+ Resolve factual questions about the system before acting: read the repo, trace data via read-only MCP, produce synthesized findings. **It creates no production artifacts** — it produces evidence and conclusions so the composing loop can move forward with quality information.
21
22
 
22
- El discriminador clave:
23
+ The key discriminator:
23
24
 
24
- | La pregunta... | Acción |
25
+ | The question... | Action |
25
26
  |---|---|
26
- | puede responderse leyendo repo / datos (hechos objetivos del sistema) | **investigar** |
27
- | depende de preferencias, prioridades o decisiones del usuario | **preguntar al humano** vía *structured-choice* (capacidad del arnés — ver `../../harness/SKILL.md`). En **Claude Code** es `AskUserQuestion` (máx 4 preguntas/llamada → **≤3 preguntas de contenido + 1 control `flow`**); en un arnés sin elección estructurada, degrada a **markdown numerado**. |
28
- | está parcialmente en el repo y parcialmente en intención del usuario | investigar primero, luego preguntar solo por la parte incierta |
27
+ | can be answered by reading repo / data (objective system facts) | **investigate** |
28
+ | depends on the user's preferences, priorities or decisions | **ask the human** via *structured-choice* (canonical rule: `../../loops/CHASSIS.md` § *Structured-choice*; per-harness binding: `../../harness/SKILL.md`) |
29
+ | is partly in the repo and partly user intent | investigate first, then ask only about the uncertain part |
29
30
 
30
31
  ## Composed by
31
32
 
32
- Todos los loops la cargan on-demand:
33
+ Every loop loads it on demand:
33
34
 
34
- | Loop | Cuándo la compone |
35
+ | Loop | When it composes it |
35
36
  |---|---|
36
- | `spec-refine-loop` | para entender el sistema existente antes de refinar un spec |
37
- | `plan-new-loop` | para descubrir dependencias, integrations, convenciones del repo |
38
- | `plan-exec-loop` | para investigar comportamiento real de un componente antes de modificarlo |
39
- | `quick-loop` | para responder preguntas de orientación sobre el código o datos |
37
+ | `spec-refine-loop` | to understand the existing system before refining a spec |
38
+ | `plan-new-loop` | to discover dependencies, integrations, repo conventions |
39
+ | `plan-exec-loop` | to investigate a component's real behavior before modifying it |
40
+ | `quick-loop` | to answer orientation questions about the code or data |
40
41
 
41
42
  ## Knowledge
42
43
 
43
44
  ### Investigation lifecycle
44
45
 
45
46
  ```
46
- [pregunta del loop] → [investigar inline en la sesión activa] → [recolectar evidencia] → [sintetizar] → [CONCLUSIONS]
47
+ [loop's question] → [investigate inline in the active session] → [collect evidence] → [synthesize] → [CONCLUSIONS]
47
48
 
48
- [nueva hipótesis o gap] → [más evidencia o INCONCLUSIVE]
49
+ [new hypothesis or gap] → [more evidence or INCONCLUSIVE]
49
50
  ```
50
51
 
51
- 1. **Investigar inline** — no se crea una sesión aparte; los artefactos se escriben en la sesión activa del loop (`.workflow/sessions/NNN-<run>/`).
52
- 2. **Recolectar evidencia** — read-only: `Read`, `Grep`, `Glob`, MCP SELECT, `git log`.
53
- 3. **Escribir `ANALYSIS-FILE.md`** (scratchpad opcional) con hallazgos crudos.
54
- 4. **Sintetizar** en `CONCLUSIONS.md` con conclusiones evidenciadas.
55
- 5. **Reportar al loop**: `concluido` si converge; `inconclusive` si no hay material suficiente el loop degrada/difiere el gap.
52
+ 1. **Investigate inline** — no separate session is created; artifacts are written into the loop's active session (`.workflow/sessions/NNN-<run>/`).
53
+ 2. **Collect evidence** — read-only: `Read`, `Grep`, `Glob`, MCP SELECT, `git log`.
54
+ 3. **Write `ANALYSIS-FILE.md`** (optional scratchpad) with raw findings.
55
+ 4. **Synthesize** into `CONCLUSIONS.md` with evidence-backed conclusions.
56
+ 5. **Report to the loop**: `concluded` if it converges; `inconclusive` if there is not enough material — the loop degrades/defers the gap.
56
57
 
57
58
  ### Ask-vs-research discriminator (examples)
58
59
 
59
60
  ```
60
- "¿qué convención de nombres usa este repo?" → investigar (Grep + Read)
61
- "¿qué endpoint necesita el spec?" investigar (leer spec + código)
62
- "¿prefieres enfoque A o B?" preguntar al humano
63
- "¿cuál es el estado de la tabla X?" investigar (MCP read-only)
64
- "¿qué tan urgente es esto para ti?" preguntar al humano
65
- "¿el servicio Y ya tiene auth implementado?" investigar (leer código)
61
+ "what naming convention does this repo use?" → investigate (Grep + Read)
62
+ "which endpoint does the spec need?" investigate (read spec + code)
63
+ "do you prefer approach A or B?" ask the human
64
+ "what is the state of table X?" investigate (read-only MCP)
65
+ "how urgent is this for you?" ask the human
66
+ "does service Y already have auth implemented?" investigate (read code)
66
67
  ```
67
68
 
68
69
  ### Artifact schemas
69
70
 
70
- `ANALYSIS-FILE.md` (scratchpad opcional) y `CONCLUSIONS.md` siguen las **plantillas canónicas** en `artifacts/artifacts-research/` — no se duplican aquí para evitar drift. Para research liviana basta `CONCLUSIONS.md`; `ANALYSIS-FILE.md` es opcional para investigaciones más profundas.
71
+ `ANALYSIS-FILE.md` (optional scratchpad) and `CONCLUSIONS.md` follow the **canonical templates** in `artifacts/artifacts-research/` — never duplicated here, to avoid drift. Light research needs only `CONCLUSIONS.md`; `ANALYSIS-FILE.md` is optional for deeper investigations.
71
72
 
72
73
  ### DB rule (invariant #4)
73
74
 
74
- - **Solo SELECT** — nunca DML/DDL.
75
- - **Escribir la query primero** en el `SCRIPTS.sql` de la sesión activa (tipo A, read-only; ver la plantilla `artifacts/artifacts-core/SCRIPTS.sql`) con su header de propósito + MCP + origen.
76
- - **Si hay >1 MCP candidato sin default declarado**: preguntar al humano cuál usar antes de ejecutar.
77
- - **Cost guard antes de ejecutar**:
78
- - `COUNT(*) ≤ 1.000` o lookup por PK ejecutar directo.
79
- - `1.000–10.000` filas o seq scan tabla pequeña avisar estimado al usuario.
80
- - `> 10.000` filas o seq scan tabla grande confirmación explícita del usuario.
81
- - UPDATE/INSERT/DELETE → rechazar.
75
+ - **SELECT only** — never DML/DDL.
76
+ - **Write the query first** into the active session's `SCRIPTS.sql` (type A, read-only; see the `artifacts/artifacts-core/SCRIPTS.sql` template) with its purpose + MCP + origin header.
77
+ - **With >1 candidate MCP and no declared default**: ask the human which to use before executing.
78
+ - **Cost guard before executing**:
79
+ - `COUNT(*) ≤ 1,000` or PK lookup → run directly.
80
+ - `1,000–10,000` rows or a small-table seq scan tell the user the estimate.
81
+ - `> 10,000` rows or a large-table seq scan → explicit user confirmation.
82
+ - UPDATE/INSERT/DELETE → refuse.
82
83
 
83
84
  ### Code reading rules
84
85
 
85
- - Usar `Grep` y `Read` extensivamente. **Nunca** `Edit/Write` durante investigación.
86
- - Citar con path + líneas: `src/services/Foo.java:142`.
87
- - Si el código está disperso: `Glob` + `Grep` para acotar.
86
+ - Use `Grep` and `Read` extensively. **Never** `Edit/Write` during investigation.
87
+ - Cite with path + lines: `src/services/Foo.java:142`.
88
+ - Scattered code: `Glob` + `Grep` to narrow down.
88
89
 
89
- ### Git read-only (git-safe, invariant #5)
90
+ ### Read-only git (git-safe, invariant #5)
90
91
 
91
- Solo: `git log`, `git show`, `git diff`, `git blame`, `git branch --show-current`.
92
- Nunca durante investigación: `commit`, `push`, `merge`, `rebase`, `reset`, `checkout`.
92
+ Only: `git log`, `git show`, `git diff`, `git blame`, `git branch --show-current`.
93
+ Never during investigation: `commit`, `push`, `merge`, `rebase`, `reset`, `checkout`.
93
94
 
94
95
  ### Inconclusive closure
95
96
 
96
- Si tras investigar los gaps persisten y no pueden cerrarse con las fuentes disponibles:
97
- - Documentar los gaps en `CONCLUSIONS.md#Open`.
98
- - Marcar sesión como `inconclusive`.
99
- - Reportar al loop: qué se pudo y qué no — el loop decide si pregunta al humano.
97
+ If, after investigating, gaps persist and cannot be closed with the available sources:
100
98
 
101
- ### Inline research artifacts (en la sesión activa)
99
+ - Document the gaps in `CONCLUSIONS.md#Open`.
100
+ - Mark the investigation `inconclusive`.
101
+ - Report to the loop: what could and could not be resolved — the loop decides whether to ask the human.
102
+
103
+ ### Inline research artifacts (in the active session)
102
104
 
103
105
  ```
104
- .workflow/sessions/NNN-<run>/ # la sesión del loop (refine/exec/quick)
105
- ├── ANALYSIS-FILE.md # hallazgos crudos (scratchpad opcional)
106
- ├── CONCLUSIONS.md # síntesis + recomendaciones para el loop
107
- └── SCRIPTS.sql # SQL read-only (tipo A), si se usó MCP
106
+ .workflow/sessions/NNN-<run>/ # the loop's session (refine/exec/quick)
107
+ ├── ANALYSIS-FILE.md # raw findings (optional scratchpad)
108
+ ├── CONCLUSIONS.md # synthesis + recommendations for the loop
109
+ └── SCRIPTS.sql # read-only SQL (type A), if MCP was used
108
110
  ```
109
111
 
110
112
  ## Output
111
113
 
112
- Produce, **inline en la sesión activa del loop** (`.workflow/sessions/NNN-<run>/`):
113
- - `ANALYSIS-FILE.md` — hallazgos crudos sin sintetizar (opcional).
114
- - `CONCLUSIONS.md` — conclusiones con evidencia + recomendaciones para el loop.
115
- - `SCRIPTS.sql` — queries read-only (tipo A), solo si se usó MCP.
114
+ Produces, **inline in the loop's active session** (`.workflow/sessions/NNN-<run>/`):
115
+
116
+ - `ANALYSIS-FILE.md` — raw, unsynthesized findings (optional).
117
+ - `CONCLUSIONS.md` — evidence-backed conclusions + recommendations for the loop.
118
+ - `SCRIPTS.sql` — read-only queries (type A), only if MCP was used.
116
119
 
117
- No gradua a `docs/` (invariant #1). El loop que compone esta capacidad consume las conclusiones y actua en consecuencia.
120
+ It never graduates to `docs/` (invariant #1). The composing loop consumes the conclusions and acts on them.
118
121
 
119
122
  ## Source
120
123
 
121
- Reciclado de `analyze-investigate`, `analyze-synthesize` y `analyze-conclude` del bundle viejo. Se conserva: el modelo de investigacion divergente → sintesis → conclusiones; las reglas read-only; el cost guard de queries; la discriminacion de gaps. Se descarta: la terminología de `flow=analyze`, `EVIDENCE.md`/`FINDINGS.md` como nombres canónicos (ahora `ANALYSIS-FILE.md`/`CONCLUSIONS.md`), el lifecycle de sesiones legacy (la research ahora es **inline**, sin sesión propia), y la modulacion por modalidad (technical/incident/data) — la skill de research es de propósito general.
124
+ Rationale and history: design (`docs/referencias/workflow-roles/research.md`).