refacil-sdd-ai 4.2.4 → 4.4.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 (47) hide show
  1. package/README.md +239 -214
  2. package/agents/auditor.md +189 -184
  3. package/agents/debugger.md +201 -204
  4. package/agents/implementer.md +150 -149
  5. package/agents/investigator.md +80 -89
  6. package/agents/proposer.md +219 -124
  7. package/agents/tester.md +140 -144
  8. package/agents/validator.md +153 -145
  9. package/bin/cli.js +158 -116
  10. package/lib/bus/askFulfillment.js +17 -17
  11. package/lib/bus/broker.js +599 -599
  12. package/lib/bus/ui/app.js +318 -318
  13. package/lib/commands/sdd.js +447 -0
  14. package/lib/hooks.js +236 -236
  15. package/lib/installer.js +58 -2
  16. package/lib/methodology-migration-pending.js +101 -136
  17. package/package.json +4 -6
  18. package/skills/apply/SKILL.md +139 -120
  19. package/skills/archive/SKILL.md +105 -107
  20. package/skills/ask/SKILL.md +78 -78
  21. package/skills/attend/SKILL.md +70 -70
  22. package/skills/bug/SKILL.md +121 -128
  23. package/skills/explore/SKILL.md +73 -63
  24. package/skills/guide/SKILL.md +79 -79
  25. package/skills/inbox/SKILL.md +43 -43
  26. package/skills/join/SKILL.md +82 -82
  27. package/skills/prereqs/BUS-CROSS-REPO.md +55 -55
  28. package/skills/prereqs/METHODOLOGY-CONTRACT.md +122 -115
  29. package/skills/prereqs/SKILL.md +30 -37
  30. package/skills/propose/SKILL.md +103 -102
  31. package/skills/reply/SKILL.md +44 -44
  32. package/skills/review/SKILL.md +163 -126
  33. package/skills/review/checklist-back.md +92 -92
  34. package/skills/review/checklist-front.md +72 -72
  35. package/skills/review/checklist.md +114 -114
  36. package/skills/say/SKILL.md +38 -38
  37. package/skills/setup/SKILL.md +85 -141
  38. package/skills/setup/troubleshooting.md +38 -35
  39. package/skills/test/SKILL.md +104 -94
  40. package/skills/test/testing-patterns.md +63 -63
  41. package/skills/up-code/SKILL.md +108 -108
  42. package/skills/update/SKILL.md +109 -132
  43. package/skills/verify/SKILL.md +159 -132
  44. package/templates/compact-guidance.md +45 -45
  45. package/templates/methodology-guide.md +46 -42
  46. package/config/openspec-config.yaml +0 -8
  47. package/skills/prereqs/OPENSPEC-DELTAS.md +0 -51
@@ -1,106 +1,109 @@
1
1
  ---
2
2
  name: refacil:archive
3
- description: Archivar un cambio completadomueve artefactos a archive y sincroniza specs
3
+ description: Archive a completed changemove artifacts to archive and sync specs
4
4
  user-invocable: true
5
5
  ---
6
6
 
7
- # refacil:archive — Archivar Cambio Completado
7
+ # refacil:archive — Archive Completed Change
8
8
 
9
- Este comando envuelve la funcionalidad de OpenSpec archive (que internamente llama a sync-specs) y agrega verificaciones previas del equipo.
9
+ This command archives completed SDD changes (bug fixes manually, regular changes via `refacil-sdd-ai sdd archive`), syncs `refacil-sdd/specs/`, and enforces team pre-verification checks.
10
10
 
11
- **Prerequisitos**: perfil `openspec` de `refacil-prereqs/SKILL.md` + reglas de `METHODOLOGY-CONTRACT.md`.
11
+ **Prerequisites**: `sdd` profile from `refacil-prereqs/SKILL.md` + rules from `METHODOLOGY-CONTRACT.md`.
12
12
 
13
- ## Instrucciones
13
+ ## Instructions
14
14
 
15
- ### Paso 1: Verificaciones previas (aporte Refacil)
15
+ ### Step 1: Pre-verification checks
16
16
 
17
- Antes de archivar, verifica que el cambio esta realmente completo:
17
+ Before archiving, run `refacil-sdd-ai sdd status <changeName> --json` and parse the JSON to get the change status.
18
18
 
19
- 1. **Tasks completadas**: Busca el `tasks.md` del cambio y verifica que todas las tasks tienen checkbox marcado (`[x]`). Si hay tasks sin completar, informa al usuario y pregunta si quiere continuar de todas formas.
19
+ Verify the change is truly complete:
20
20
 
21
- 2. **Tests pasan**: Resuelve y ejecuta el comando de tests segun `refacil-prereqs/METHODOLOGY-CONTRACT.md`. Si hay tests que fallan, informa y pregunta si quiere continuar.
21
+ 1. **Tasks completed**: Use the `tasksProgress` (or `tasks`) field from the JSON — verify that `tasks.pending === 0`. If there are incomplete tasks, inform the user and ask if they want to continue anyway.
22
22
 
23
- 3. **Sin archivos pendientes**: Ejecuta `git status` y verifica si hay cambios sin commitear relacionados al feature. Si los hay, sugiere hacer commit antes de archivar.
23
+ 2. **Tests pass**: Resolve and run the test command according to `refacil-prereqs/METHODOLOGY-CONTRACT.md`. If there are failing tests, inform and ask if they want to continue.
24
24
 
25
- 4. **Review aprobado (bloqueante)**: Verifica que existe el archivo `.review-passed` en la carpeta del cambio (`openspec/changes/[nombre-cambio]/.review-passed`) siguiendo **`METHODOLOGY-CONTRACT.md` §8** (dotfile; no concluyas por listados sin dotfiles). Si NO existe, **detener el archivado** e informar al usuario:
25
+ 3. **No pending files**: Run `git status` and verify if there are uncommitted changes related to the feature. If there are, suggest committing before archiving.
26
+
27
+ 4. **Review approved (blocking)**: Verify that the `.review-passed` file exists in the change folder (`refacil-sdd/changes/[change-name]/.review-passed`) following **`METHODOLOGY-CONTRACT.md` §8** (dotfile; do not conclude by listings without dotfiles). If it does NOT exist, **stop the archiving** and inform the user:
26
28
  ```
27
- No se puede archivar: el cambio no tiene review aprobado.
28
- Ejecuta /refacil:review primero.
29
+ Cannot archive: the change does not have an approved review.
30
+ Run /refacil:review first.
29
31
  ```
30
- Esta verificacion es **obligatoria y bloqueante** — no se puede saltar.
32
+ This verification is **mandatory and blocking** — it cannot be skipped.
31
33
 
32
- Si alguna de las verificaciones 1-3 falla, informa al usuario pero permite que decida si continuar.
33
- Si la verificacion 4 falla, el archivado no puede continuar.
34
+ If any of checks 1-3 fail, inform the user but allow them to decide whether to continue.
35
+ If check 4 fails, archiving cannot continue.
34
36
 
35
- ### Paso 1.5: Solicitar links de Jira (trazabilidadobligatorio)
37
+ ### Step 1.5: Request Jira links (traceabilitymandatory)
36
38
 
37
- Antes de proceder al archivado, solicita al usuario los links de Jira asociados al cambio:
39
+ Before proceeding to archiving, ask the user for the Jira links associated with the change:
38
40
 
39
41
  ```
40
- Link de Jira asociado a este cambio (si son varios, sepáralos con comas):
42
+ Jira link(s) associated with this change (if multiple, separate with commas):
41
43
  ```
42
44
 
43
- **Reglas:**
44
- - El usuario puede ingresar uno o múltiples links separados por comas en un solo mensaje.
45
- - Si el usuario no proporciona ningún link (responde vacío, "n", "no", "ninguno", Enter en blanco), **bloquear el archivado** y volver a solicitar:
45
+ **Rules:**
46
+ - The user may enter one or multiple links separated by commas in a single message.
47
+ - If the user provides no link (answers empty, "n", "no", "none", blank Enter), **block the archiving** and ask again:
46
48
  ```
47
- No se puede archivar sin al menos un link de Jira.
48
- Proporciona el link de la tarea que originó este cambio para continuar.
49
+ Cannot archive without at least one Jira link.
50
+ Provide the link to the task that originated this change to continue.
49
51
  ```
50
- - Repetir hasta recibir al menos una URL válida.
51
- - Guardar los links en `jiraTasks` para usarlos al escribir `review.yaml` en los pasos siguientes.
52
+ - Repeat until at least one valid URL is received.
53
+ - Save the links in `jiraTasks` to use when writing `review.yaml` in the following steps.
54
+
55
+ ### Step 2: Determine change type
52
56
 
53
- ### Paso 2: Determinar tipo de cambio
57
+ Inspect the change folder in `refacil-sdd/changes/`:
54
58
 
55
- Inspecciona la carpeta del cambio en `openspec/changes/`:
59
+ - **It is a bug fix** if the folder name starts with `fix-` (created by `refacil:bug`).
60
+ - **It is a regular change** in any other case (created by `refacil:propose`).
56
61
 
57
- - **Es un bug fix** si el nombre de la carpeta empieza con `fix-` (creado por `refacil:bug`).
58
- - **Es un cambio regular** en cualquier otro caso (creado por `refacil:propose`).
62
+ Depending on the type, follow the corresponding step:
59
63
 
60
- Segun el tipo, sigue el paso correspondiente:
64
+ ### Step 2A: Bug fix Manual archiving (no `sdd archive` CLI)
61
65
 
62
- ### Paso 2A: Bug fix Archivado manual (sin OpenSpec)
66
+ Bug fixes only contain `summary.md` (and optionally `.review-passed`); they are not full proposal/spec/design/task trees. Archive them with **git mv** / **mv** per the steps below — **do not** use `refacil-sdd-ai sdd archive` for these folders.
63
67
 
64
- Los bug fixes solo contienen `summary.md` (y opcionalmente `.review-passed`), no tienen los artefactos completos que OpenSpec espera. Por eso se archivan **sin delegar a OpenSpec**.
68
+ 0. **Delete memory.yaml if present** (CA-18): run `rm -f "refacil-sdd/changes/[fix-name]/memory.yaml"` before moving the folder.
65
69
 
66
- 1. **Mover a archive (operacion de move, no copy)**: traslada la carpeta completa del fix desde `openspec/changes/[nombre-fix]/` a `openspec/changes/archive/[fecha-ISO]-[nombre-fix]/`. La carpeta de origen **debe quedar eliminada** al finalizar.
70
+ 1. **Move to archive (move operation, not copy)**: transfer the full fix folder from `refacil-sdd/changes/[fix-name]/` to `refacil-sdd/changes/archive/[ISO-date]-[fix-name]/`. The source folder **must be eliminated** when done.
67
71
 
68
- Orden de ejecucion recomendado (determinista y cross-platform):
69
- 1. Asegurar que existe el directorio `openspec/changes/archive/` (crearlo si no existe).
70
- 2. Preferir un **move atomico** con `git mv "openspec/changes/[nombre-fix]" "openspec/changes/archive/[fecha-ISO]-[nombre-fix]"` cuando el fix ya esta bajo control de git (mueve y stagea de una).
71
- 3. Si `git mv` no aplica (archivos no trackeados o error), usar en su lugar:
72
- - Linux/macOS: `mv "openspec/changes/[nombre-fix]" "openspec/changes/archive/[fecha-ISO]-[nombre-fix]"`
73
- - Windows (bash de Claude Code): el mismo `mv` funciona sobre rutas POSIX (`/c/Users/...`). **No usar `cp -r` sin el `rm -rf` posterior** es la causa raiz tipica del bug en que la carpeta de origen sobrevive.
74
- 4. **Verificacion obligatoria post-move**: ejecutar una listado/test de existencia para confirmar que:
75
- - `openspec/changes/[nombre-fix]/` **ya NO existe**.
76
- - `openspec/changes/archive/[fecha-ISO]-[nombre-fix]/` **SI existe** y contiene `summary.md` (+ `.review-passed` si lo habia).
77
- 5. Si la verificacion falla (la carpeta de origen sobrevivio), eliminarla explicitamente con `rm -rf "openspec/changes/[nombre-fix]"` y re-verificar. No continuar al paso 2 hasta que el estado sea consistente.
72
+ Recommended execution order (deterministic and cross-platform):
73
+ 1. Ensure the `refacil-sdd/changes/archive/` directory exists (create if not present).
74
+ 2. Prefer an **atomic move** with `git mv "refacil-sdd/changes/[fix-name]" "refacil-sdd/changes/archive/[ISO-date]-[fix-name]"` when the fix is already under git control (moves and stages at once).
75
+ 3. If `git mv` does not apply (untracked files or error), use instead:
76
+ - Linux/macOS/Windows: `mv "refacil-sdd/changes/[fix-name]" "refacil-sdd/changes/archive/[ISO-date]-[fix-name]"`. Always use `mv` (not `cp -r`) — verify source no longer exists after the move.
77
+ 4. **Mandatory post-move verification**: run a listing/existence test to confirm:
78
+ - `refacil-sdd/changes/[fix-name]/` **no longer exists**.
79
+ - `refacil-sdd/changes/archive/[ISO-date]-[fix-name]/` **does exist** and contains `summary.md` (+ `.review-passed` if it existed).
80
+ 5. If the verification fails (source folder survived), explicitly delete it with `rm -rf "refacil-sdd/changes/[fix-name]"` and re-verify. Do not continue to step 2 until the state is consistent.
78
81
 
79
- 2. **Documentar en specs**: Lee el `summary.md` y el `.review-passed` del fix (desde la ruta **archivada** en `openspec/changes/archive/[fecha-ISO]-[nombre-fix]/`, ya no desde la ruta original), y crea un spec individual para el bug en `openspec/specs/[nombre-descriptivo]/spec.md`.
82
+ 2. **Document in specs**: Read the `summary.md` and `.review-passed` from the fix (from the **archived** path at `refacil-sdd/changes/archive/[ISO-date]-[fix-name]/`, no longer from the original path), and create an individual spec for the bug at `refacil-sdd/specs/[descriptive-name]/spec.md`.
80
83
 
81
- **Nombre de la carpeta en specs**: Usa una descripcion corta y clara del bug en kebab-case (ej. `fix-session-timeout-redis`, `fix-null-pointer-payment-callback`). **NO uses IDs de tickets** (REF-123, JIRA-456, etc.) — el nombre debe ser descriptivo para que `/refacil:explore` pueda encontrar y entender el fix sin contexto externo.
84
+ **Spec folder name**: Use a short, clear kebab-case description of the bug (e.g. `fix-session-timeout-redis`, `fix-null-pointer-payment-callback`). **Do NOT use ticket IDs** (REF-123, JIRA-456, etc.) — the name must be descriptive so `/refacil:explore` can find and understand the fix without external context.
82
85
 
83
- Contenido del `spec.md` (formato OpenSpec estandar):
86
+ Content of `spec.md` (Refacil SDD spec layout):
84
87
  ```markdown
85
- # [nombre-descriptivo] Specification
88
+ # [descriptive-name] Specification
86
89
 
87
90
  ## Purpose
88
- Corregir [descripcion clara del bug] para restaurar el comportamiento esperado sin introducir regresiones.
91
+ Fix [clear bug description] to restore expected behavior without introducing regressions.
89
92
 
90
93
  ## Requirements
91
- ### Requirement: [comportamiento esperado principal]
92
- El sistema SHALL [comportamiento correcto despues del fix].
94
+ ### Requirement: [main expected behavior]
95
+ The system SHALL [correct behavior after the fix].
93
96
 
94
- #### Scenario: Bug corregido en condicion original
95
- - **WHEN** [condicion que antes fallaba]
96
- - **THEN** el sistema SHALL [resultado esperado]
97
+ #### Scenario: Bug fixed in original condition
98
+ - **WHEN** [condition that previously failed]
99
+ - **THEN** the system SHALL [expected result]
97
100
 
98
- #### Scenario: Flujo normal permanece estable
99
- - **WHEN** [condicion normal]
100
- - **THEN** el sistema SHALL [comportamiento normal sin regresion]
101
+ #### Scenario: Normal flow remains stable
102
+ - **WHEN** [normal condition]
103
+ - **THEN** the system SHALL [normal behavior without regression]
101
104
  ```
102
105
 
103
- 3. **Persistir metadata de review separada**: crea `openspec/specs/[nombre-descriptivo]/review.yaml` con los campos de `.review-passed` más los links de Jira del Paso 1.5:
106
+ 3. **Persist review metadata separately**: create `refacil-sdd/specs/[descriptive-name]/review.yaml` with the fields from `.review-passed` plus the Jira links from Step 1.5:
104
107
  ```yaml
105
108
  verdict: APROBADO|APROBADO CON OBSERVACIONES
106
109
  date: 2026-04-10T00:00:00.000Z
@@ -109,83 +112,78 @@ Los bug fixes solo contienen `summary.md` (y opcionalmente `.review-passed`), no
109
112
  failCount: 0
110
113
  blockers: false
111
114
  jiraTasks:
112
- - https://tu-empresa.atlassian.net/browse/REF-123
115
+ - https://your-company.atlassian.net/browse/REF-123
113
116
  ```
114
117
 
115
- 4. Continua al **Paso 3**.
118
+ 4. Continue to **Step 3**.
116
119
 
117
- ### Paso 2B: Cambio regularDelegar a OpenSpec archive
120
+ ### Step 2B: Regular changeArchive with native CLI
118
121
 
119
- 1. Lee `openspec-archive-change/SKILL.md` en `.claude/skills/` o `.cursor/skills/`.
120
- 2. Lee `OPENSPEC-DELTAS.md` en `refacil-prereqs` (seccion **archive**).
121
- 3. Sigue OpenSpec con argumento **$ARGUMENTS** (sync de specs segun deltas).
122
+ The spec and review evidence are written **before** running the CLI archive command, while the artifacts are still at their original paths. The CLI only moves the folder — it never syncs specs.
122
123
 
123
- 4. **Verificar sincronizacion**: Despues de que OpenSpec archive, verifica que `openspec/specs/` fue actualizada:
124
- - Revisa si hay archivos nuevos o modificados en `openspec/specs/`
125
- - Si la sincronizacion no ocurrio (OpenSpec la salto o fallo), ejecuta manualmente:
126
- - Lee la especificacion del cambio archivado: `specs.md` si existe **y** todos los `.md` bajo `specs/` de esa carpeta (misma regla que `refacil:apply`)
127
- - Busca el spec principal relevante en `openspec/specs/`
128
- - Si existe, integra los cambios (ADDED → agregar, MODIFIED → actualizar, REMOVED → eliminar)
129
- - Si NO existe, crea un spec principal nuevo con nombre descriptivo
124
+ 1. **Sync spec to `refacil-sdd/specs/` (before archiving)**:
125
+ - Read `refacil-sdd/changes/<changeName>/specs.md` (and all `.md` under `specs/` if that subfolder exists).
126
+ - Determine the spec folder name: use `<changeName>` unless a more descriptive name is clearly better.
127
+ - If `refacil-sdd/specs/<specName>/spec.md` already exists, integrate the changes (ADDED add, MODIFIED update, REMOVED delete sections).
128
+ - If it does NOT exist, create `refacil-sdd/specs/<specName>/spec.md` with the content derived from `specs.md` (convert acceptance/rejection criteria into Requirements + Scenarios format).
130
129
 
131
- 5. **Persistir evidencia de review en specs (obligatorio)**:
132
- - Lee `openspec/changes/[nombre-cambio]/.review-passed` **antes** de mover/archivar (o desde la ruta archivada si ya fue movido).
133
- - Toma sus campos (`verdict`, `date`, `summary`, `failCount`, `blockers`, `changeName`).
134
- - Crea/actualiza `review.yaml` en cada carpeta de spec afectada (`openspec/specs/<spec-name>/review.yaml`).
135
- - Formato de `review.yaml` (incluye `jiraTasks` del Paso 1.5):
130
+ 2. **Persist review evidence (before archiving)**:
131
+ - Read `refacil-sdd/changes/<changeName>/.review-passed` (dotfile use `ls -la` or read by explicit path, not directory listing).
132
+ - Create/update `refacil-sdd/specs/<specName>/review.yaml` with its fields plus `jiraTasks` from Step 1.5:
136
133
  ```yaml
137
134
  verdict: APROBADO|APROBADO CON OBSERVACIONES
138
135
  date: 2026-04-10T00:00:00.000Z
139
- changeName: nombre-del-cambio
136
+ changeName: change-name
140
137
  summary: "..."
141
138
  failCount: 0
142
139
  blockers: false
143
140
  jiraTasks:
144
- - https://tu-empresa.atlassian.net/browse/REF-123
145
- - https://tu-empresa.atlassian.net/browse/REF-124
141
+ - https://your-company.atlassian.net/browse/REF-123
146
142
  ```
147
- - Si el cambio sincroniza multiples specs, crea/actualiza `review.yaml` en cada una con los mismos `jiraTasks`.
148
- - Si el `review.yaml` ya existe, agregar/actualizar solo `jiraTasks` sin eliminar los demás campos.
149
- - Si no se puede determinar con precision los specs afectados, crea/actualiza `openspec/specs/review-metadata.yaml` con un registro por cambio.
143
+ - If `review.yaml` already exists, update only the fields that changed without removing others.
144
+
145
+ 3. **Delete memory.yaml if present** (CA-18): before running the CLI archive, delete `refacil-sdd/changes/<changeName>/memory.yaml` if it exists run `rm -f "refacil-sdd/changes/<changeName>/memory.yaml"`. This is part of the archive cleanup.
146
+
147
+ 4. **Run the CLI archive**: `refacil-sdd-ai sdd archive <changeName>` — this moves the change to `refacil-sdd/changes/archive/<date>-<changeName>/`.
148
+ 5. Verify the command completed successfully (exit 0) and the original folder no longer exists.
150
149
 
151
- 6. Continua al **Paso 3**.
150
+ 6. Continue to **Step 3**.
152
151
 
153
- El objetivo es que `openspec/specs/` documente como funciona el sistema HOY.
152
+ The goal is for `refacil-sdd/specs/` to document how the system works TODAY.
154
153
 
155
- ### Paso 3: Confirmar
154
+ ### Step 3: Confirm
156
155
 
157
- Antes de mostrar el resumen, ejecutar una **verificacion final de limpieza** (aplica tanto a bug fixes como a cambios regulares):
156
+ Before showing the summary, run a **final cleanup verification** (applies to both bug fixes and regular changes):
158
157
 
159
- - `openspec/changes/[nombre-original]/` **NO debe existir** (solo la version archivada debe sobrevivir en `openspec/changes/archive/...`).
160
- - Si la carpeta de origen sobrevivio por cualquier razon (fallo del move, OpenSpec dejo residuos, copia en vez de mover), eliminarla explicitamente con `rm -rf "openspec/changes/[nombre-original]"` antes de confirmar al usuario.
158
+ - `refacil-sdd/changes/[original-name]/` **must NOT exist** (only the archived version must survive in `refacil-sdd/changes/archive/...`).
159
+ - If the source folder survived for any reason (failed move, partial copy, interrupted move), explicitly delete it with `rm -rf "refacil-sdd/changes/[original-name]"` before confirming to the user.
161
160
 
162
161
  ```
163
- === Cambio archivado ===
164
- Cambio: [nombre]
165
- Tipo: [Bug fix | Cambio regular]
166
- Ubicacion: openspec/changes/archive/[fecha]-[nombre]/
167
- Carpeta original eliminada: SI
168
- Specs sincronizadas: SI
162
+ === Change archived ===
163
+ Change: [name]
164
+ Type: [Bug fix | Regular change]
165
+ Location: refacil-sdd/changes/archive/[date]-[name]/
166
+ Original folder deleted: YES
167
+ Specs synced: YES
169
168
  Tests: PASS
170
169
 
171
- El cambio ha sido completado y archivado exitosamente.
170
+ The change has been completed and archived successfully.
172
171
  ```
173
172
 
174
- ### Paso 4: Recomendar subir codigo
173
+ ### Step 4: Recommend pushing the code
175
174
 
176
- Despues de confirmar el archivado, recomienda al usuario subir los cambios al remoto:
175
+ After confirming the archiving, recommend the user push the changes to the remote:
177
176
 
178
177
  ```
179
- El siguiente paso es subir el cambio y crear el PR.
180
- Quieres que continue con /refacil:up-code?
178
+ The next step is to push the change and create the PR.
179
+ Do you want me to continue with /refacil:up-code?
181
180
  ```
182
181
 
183
- ## Reglas
182
+ ## Rules
184
183
 
185
- - Siempre verificar completitud antes de archivar
186
- - **Continuidad del flujo**: si el usuario confirma afirmativamente ("si", "ok", "dale", "continua", etc.) la pregunta de continuidad del Paso 4, invocar inmediatamente el **Skill tool** con `skill: "refacil:up-code"`. No describirlo en texto ni esperar que el usuario escriba `/refacil:up-code`. (Ver `METHODOLOGY-CONTRACT.md §5`.)
187
- - La sincronizacion de specs es OBLIGATORIA en la metodologia Refacil
188
- - La metadata de `.review-passed` debe persistirse separada en YAML (`review.yaml`) dentro de cada carpeta de spec
189
- - No eliminar artefactos, solo moverlos a archive/ para trazabilidad
190
- - **La carpeta original en `openspec/changes/[nombre]/` NO debe sobrevivir al archivado** — ni para bug fixes (Paso 2A) ni para cambios regulares (Paso 2B). Usar `git mv` o `mv` (no `cp -r`) y verificar explicitamente. Si queda residuo, borrarlo con `rm -rf` antes del Paso 3.
191
- - Usa modo de salida **conciso** por defecto y **detallado** solo si el usuario lo pide (ver `METHODOLOGY-CONTRACT.md`)
184
+ - Always verify completeness before archiving
185
+ - **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question in Step 4, immediately invoke the **Skill tool** with `skill: "refacil:up-code"`. Do not describe it in text or wait for the user to type `/refacil:up-code`. (See `METHODOLOGY-CONTRACT.md §5`.)
186
+ - Spec synchronization is MANDATORY in the Refacil methodology
187
+ - The `.review-passed` metadata must be persisted separately in YAML (`review.yaml`) inside each spec folder
188
+ - Do not delete artifacts, only move them to archive/ for traceability
189
+ - **The original folder in `refacil-sdd/changes/[name]/` must NOT survive archiving** — neither for bug fixes (Step 2A) nor for regular changes (Step 2B). Use `git mv` or `mv` (not `cp -r`) and verify explicitly. If residue remains, delete it with `rm -rf` before Step 3.
@@ -1,78 +1,78 @@
1
- ---
2
- name: refacil:ask
3
- description: Preguntar algo dirigido a otra sesión del bus. Opcionalmente bloquea esperando la respuesta (--wait N segundos) para flujo automático LLM a LLM.
4
- user-invocable: true
5
- ---
6
-
7
- # refacil:ask — Pregunta dirigida a otra sesión
8
-
9
- Envía una pregunta dirigida a una sesión de la sala, o a **todas las demás** sesiones de la sala con `@all` (alias: `*`, `everyone`). **$ARGUMENTS** incluye `@<destino>` y el texto.
10
-
11
- ## Instrucciones
12
-
13
- ### Paso 1: Identificar destino y texto
14
-
15
- Formato esperado de $ARGUMENTS:
16
- ```
17
- @<nombre-sesion> "pregunta..."
18
- ```
19
-
20
- Extrae:
21
- - `destino`: nombre de sesión sin el `@`
22
- - `texto`: la pregunta
23
-
24
- Si el destino no es claro, usa `/refacil:rooms` (vía `refacil-sdd-ai bus rooms`) para listar sesiones activas y pide aclaración al usuario.
25
-
26
- **Broadcast dirigido (`@all`)**: el broker emite un `ask` por cada miembro (excepto quien pregunta), mismo `correlationId`. Cada receptor puede `/refacil:reply` por su lado. Con `--wait`, el CLI sigue devolviendo **la primera** respuesta que llegue (no espera a todos).
27
-
28
- ### Paso 1.5: Pregunta informativa vs. solicitud de cambio (en el repo destino)
29
-
30
- Quien está en la sala llegó con **`/refacil:join`** (y el repo con metodologia Refacil): **ya conoce SDD-AI**; **no** hace falta pegar en el `ask` la guía ni explicar de nuevo qué es `/refacil:propose`. Basta con que el mensaje sea **claro en alcance y criterios** para que el otro agente ejecute **su** flujo (`propose`, `apply`, etc.) sin improvisar parches.
31
-
32
- Antes de redactar el `--text`, clasifica lo que vas a pedir a `@<destino>`:
33
-
34
- | Tipo | Ejemplos | Cómo redactar el `ask` |
35
- |------|----------|-------------------------|
36
- | **Solo información** | "¿Qué payload envía Z?", "¿Dónde está el handler de X?" | Pregunta concreta. |
37
- | **Solicitud de cambio** en el **repo del destino** | "Agregá campo W al contrato", "Corregí el bug en el servicio que vive en tu repo", "Alineá el consumer con la spec" | Describe **qué** hay que lograr, **dónde** aplica, criterios de aceptación o enlaces a spec/conversación. El destinatario canaliza eso con **`/refacil:propose`** (y lo que siga) en **su** repo; no pidas "solo un cambio rápido" opaco cuando el impacto es código versionable, salvo orden **explícita** del usuario humano en contrario. |
38
-
39
- Si mezclas consulta + cambio, separa en dos mensajes o deja claro qué parte es solo lectura y qué parte es trabajo versionable en el otro repo.
40
-
41
- ### Paso 2: Decidir si usar `--wait`
42
-
43
- Dos modos:
44
-
45
- **Modo bloqueante (recomendado cuando necesitas la respuesta para continuar)**:
46
- ```bash
47
- refacil-sdd-ai bus ask --to <destino> --text "<pregunta>" --wait 180
48
- ```
49
- - El CLI bloquea hasta recibir la respuesta o pasar el timeout (default sugerido: 60-180s)
50
- - Si el otro lado está en `/refacil:attend`, la respuesta vuelve automáticamente
51
- - Si llega la respuesta: el CLI la imprime y puedes continuar con esa info
52
- - Si hay timeout: avisa al usuario y sugiere `/refacil:inbox` más tarde
53
-
54
- **Modo fire-and-forget**:
55
- ```bash
56
- refacil-sdd-ai bus ask --to <destino> --text "<pregunta>"
57
- ```
58
- - No bloquea; retorna inmediatamente tras enviar
59
- - Úsalo cuando no sabes si el otro lado está activo o no necesitas la respuesta ahora
60
-
61
- ### Paso 3: Ejecutar
62
-
63
- Usa `Bash` con el comando elegido.
64
-
65
- ### Paso 4: Procesar resultado
66
-
67
- - Si `--wait` trajo respuesta: úsala como contexto para continuar tu trabajo; no reportes solo el mensaje, continúa con el flujo que el usuario te pidió.
68
- - Si `--wait` expiró: informa al usuario y propón `/refacil:inbox` para revisar más tarde.
69
- - Si fire-and-forget: confirma al usuario que se envió.
70
-
71
- ## Reglas
72
-
73
- - Entrecomilla correctamente el texto de la pregunta.
74
- - Si el texto tiene comillas, escápalas con `\`.
75
- - Nunca envíes secretos, tokens ni datos sensiblesel bus persiste los mensajes 7 días en disco local.
76
- - Si el destino no existe en la sala, el mensaje queda en el `inbox.jsonl` y se entregará cuando se una.
77
- - Si **acordaste** con otra sesion que ellos cambien su repo, ellos deben usar **`/refacil:propose`** alli y **avisarte por el bus** al terminar; si te piden cambios a ti, tu haces lo mismo aqui. Convencion completa: `refacil-prereqs/BUS-CROSS-REPO.md`.
78
- - Los **`ask` que son solicitudes de cambio** deben ser **sustantivos en alcance** (Paso 1.5): el receptor ya usa la metodologia; no repitas la guía en el texto. No uses el bus para pedir quick fixes opacos cuando el impacto exige SDD-AI.
1
+ ---
2
+ name: refacil:ask
3
+ description: Ask something directed to another session on the bus. Optionally blocks waiting for the response (--wait N seconds) for automatic LLM-to-LLM flow.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # refacil:ask — Directed question to another session
8
+
9
+ Sends a directed question to a session in the room, or to **all other sessions** in the room with `@all` (aliases: `*`, `everyone`). **$ARGUMENTS** includes `@<destination>` and the text.
10
+
11
+ ## Instructions
12
+
13
+ ### Step 1: Identify destination and text
14
+
15
+ Expected format of $ARGUMENTS:
16
+ ```
17
+ @<session-name> "question..."
18
+ ```
19
+
20
+ Extract:
21
+ - `destination`: session name without the `@`
22
+ - `text`: the question
23
+
24
+ If the destination is not clear, use `/refacil:rooms` (via `refacil-sdd-ai bus rooms`) to list active sessions and ask the user for clarification.
25
+
26
+ **Directed broadcast (`@all`)**: the broker emits an `ask` for each member (except the asker), same `correlationId`. Each receiver can `/refacil:reply` on their side. With `--wait`, the CLI returns **the first** response that arrives (does not wait for all).
27
+
28
+ ### Step 1.5: Informational question vs. change request (in the destination repo)
29
+
30
+ Whoever is in the room arrived via **`/refacil:join`** (and the repo with Refacil methodology): **they already know SDD-AI**; **no need** to paste the guide or re-explain what `/refacil:propose` is. It is enough that the message is **clear in scope and criteria** so the other agent runs **their** flow (`propose`, `apply`, etc.) without improvising patches.
31
+
32
+ Before drafting the `--text`, classify what you are going to ask `@<destination>`:
33
+
34
+ | Type | Examples | How to draft the `ask` |
35
+ |------|----------|------------------------|
36
+ | **Information only** | "What payload does Z send?", "Where is the X handler?" | Concrete question. |
37
+ | **Change request** in the **destination repo** | "Add field W to the contract", "Fix the bug in the service that lives in your repo", "Align the consumer with the spec" | Describe **what** must be achieved, **where** it applies, acceptance criteria or links to spec/conversation. The recipient channels that with **`/refacil:propose`** (and what follows) in **their** repo; do not ask for "just a quick change" when the impact is versionable code, unless the **human user** explicitly orders otherwise. |
38
+
39
+ If you mix query + change, separate into two messages or make clear which part is read-only and which is versionable work in the other repo.
40
+
41
+ ### Step 2: Decide whether to use `--wait`
42
+
43
+ Two modes:
44
+
45
+ **Blocking mode (recommended when you need the response to continue)**:
46
+ ```bash
47
+ refacil-sdd-ai bus ask --to <destination> --text "<question>" --wait 180
48
+ ```
49
+ - The CLI blocks until it receives the response or the timeout passes (default suggested: 60-180s)
50
+ - If the other side is in `/refacil:attend`, the response comes back automatically
51
+ - If the response arrives: the CLI prints it and you can continue with that info
52
+ - If timeout: notify the user and suggest `/refacil:inbox` later
53
+
54
+ **Fire-and-forget mode**:
55
+ ```bash
56
+ refacil-sdd-ai bus ask --to <destination> --text "<question>"
57
+ ```
58
+ - Does not block; returns immediately after sending
59
+ - Use it when you do not know if the other side is active or you do not need the response now
60
+
61
+ ### Step 3: Execute
62
+
63
+ Use `Bash` with the chosen command.
64
+
65
+ ### Step 4: Process result
66
+
67
+ - If `--wait` brought a response: use it as context to continue your work; do not just report the message, continue with the flow the user asked for.
68
+ - If `--wait` expired: inform the user and propose `/refacil:inbox` to review later.
69
+ - If fire-and-forget: confirm to the user that it was sent.
70
+
71
+ ## Rules
72
+
73
+ - Correctly quote the question text.
74
+ - If the text has quotes, escape them with `\`.
75
+ - Never send secrets, tokens, or sensitive datathe bus persists messages 7 days on local disk.
76
+ - If the destination does not exist in the room, the message is stored in `inbox.jsonl` and will be delivered when they join.
77
+ - If you **agreed** with another session that they will change their repo, they must use **`/refacil:propose`** there and **notify you via bus** when done; if they request changes from you, you do the same here. Full convention: `refacil-prereqs/BUS-CROSS-REPO.md`.
78
+ - **`ask`s that are change requests** must be **substantive in scope** (Step 1.5): the recipient already uses the methodology; do not repeat the guide in the text. Do not use the bus to request opaque quick fixes when the impact requires SDD-AI.