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,44 +1,44 @@
1
- ---
2
- name: refacil:reply
3
- description: Responder la última pregunta dirigida a esta sesión en el bus. El broker autocompleta el correlationId.
4
- user-invocable: true
5
- ---
6
-
7
- # refacil:reply — Responder una pregunta del bus
8
-
9
- Envía una respuesta a la última pregunta dirigida a esta sesión. **$ARGUMENTS** = texto de la respuesta.
10
-
11
- ## Instrucciones
12
-
13
- ### Paso 1: Ejecutar reply
14
-
15
- Ejecuta vía `Bash`:
16
-
17
- ```bash
18
- refacil-sdd-ai bus reply --text "<respuesta>"
19
- ```
20
-
21
- El broker:
22
- - Busca automáticamente el último `ask` dirigido a esta sesión en la sala
23
- - Usa su `correlationId` para que el que preguntó (si está en `ask --wait`) reciba la respuesta directo
24
- - Broadcast a toda la sala como mensaje `kind=reply`
25
-
26
- ### Paso 2: Confirmar
27
-
28
- Reporta al usuario que la respuesta se envió.
29
-
30
- ## Cuándo usar `reply` vs `say`
31
-
32
- - **`reply`**: siempre que estés respondiendo algo que te preguntaron. Esto permite que el otro lado en `ask --wait` desbloquee automáticamente.
33
- - **`say`**: anuncio general sin relación con una pregunta previa.
34
-
35
- ## Reglas
36
-
37
- - Si acabas de **implementar** un cambio pedido por otro agente y este `reply` es el **cierre** (hecho / PR / bloqueo), incluye ese resumen en el texto; es el canal por defecto para contestar a quien hizo el `ask` original (mismo hilo).
38
- - Entrecomilla correctamente el texto.
39
- - Responde solo desde tu conocimiento de ESTE repo. Si la pregunta cae fuera de tu scope, dilo explícitamente: `"fuera de mi alcance, esto lo sabe el repo X"`.
40
- - Si no hay pregunta pendiente dirigida a ti y no quieres engancharla, usa `/refacil:say` en su lugar.
41
- - Si te hicieron múltiples preguntas y quieres responder una específica más vieja, pasa `--correlation <id>` explícito:
42
- ```bash
43
- refacil-sdd-ai bus reply --text "..." --correlation <id>
44
- ```
1
+ ---
2
+ name: refacil:reply
3
+ description: Reply to the last question directed to this session on the bus. The broker autocompletes the correlationId.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # refacil:reply — Reply to a bus question
8
+
9
+ Sends a response to the last question directed to this session. **$ARGUMENTS** = response text.
10
+
11
+ ## Instructions
12
+
13
+ ### Step 1: Execute reply
14
+
15
+ Run via `Bash`:
16
+
17
+ ```bash
18
+ refacil-sdd-ai bus reply --text "<response>"
19
+ ```
20
+
21
+ The broker:
22
+ - Automatically finds the last `ask` directed to this session in the room
23
+ - Uses its `correlationId` so the asker (if in `ask --wait`) receives the response directly
24
+ - Broadcasts to the entire room as a `kind=reply` message
25
+
26
+ ### Step 2: Confirm
27
+
28
+ Report to the user that the response was sent.
29
+
30
+ ## When to use `reply` vs `say`
31
+
32
+ - **`reply`**: always when you are responding to something you were asked. This allows the other side in `ask --wait` to unblock automatically.
33
+ - **`say`**: general announcement unrelated to a previous question.
34
+
35
+ ## Rules
36
+
37
+ - If you just **implemented** a change requested by another agent and this `reply` is the **close** (done / PR / blocked), include that summary in the text; it is the default channel to respond to whoever made the original `ask` (same thread).
38
+ - Correctly quote the text.
39
+ - Respond only from your knowledge of THIS repo. If the question falls outside your scope, say it explicitly: `"out of my scope, repo X knows about this"`.
40
+ - If there is no pending question directed to you and you do not want to link it, use `/refacil:say` instead.
41
+ - If you were asked multiple questions and want to respond to a specific older one, pass `--correlation <id>` explicitly:
42
+ ```bash
43
+ refacil-sdd-ai bus reply --text "..." --correlation <id>
44
+ ```
@@ -1,126 +1,163 @@
1
- ---
2
- name: refacil:review
3
- description: Review de codigo con el checklist de calidad del equipo construye un briefing con archivos cambiados y tipo de proyecto, delega al sub-agente refacil-auditor y procesa el veredicto
4
- user-invocable: true
5
- ---
6
-
7
- # refacil:review — Entrypoint del Review
8
-
9
- Este skill es un **wrapper delgado** que delega el review pesado al sub-agente `refacil-auditor`. Antes de delegar, construye un **briefing estructurado** con los archivos cambiados y el tipo de proyecto ya detectados el sub-agente arranca evaluando, no descubriendo.
10
-
11
- **Prerequisitos**: perfil `agents` de `refacil-prereqs/SKILL.md` + modo de salida de `METHODOLOGY-CONTRACT.md`.
12
-
13
- ## Flujo
14
-
15
- ### Paso 0: Resolver alcance
16
-
17
- - Determina el alcance del review ANTES de invocar al sub-agente. Prioriza este orden:
18
- 1) Argumento del usuario (`$ARGUMENTS`)
19
- 2) Cambio activo en `openspec/changes/`
20
- 3) Cambios no commiteados (`git diff`)
21
- - Si hay multiples cambios activos en `openspec/changes/` y no hay `$ARGUMENTS`, **detente** y pide al usuario seleccionar explicitamente cual cambio revisar. **No invoques al sub-agente con scope ambiguo.**
22
-
23
- **Review ya aprobado**: Si el cambio objetivo ya tiene `.review-passed`, verifica si hay cambios posteriores al review (existencia del marcador: **`METHODOLOGY-CONTRACT.md` §8**):
24
- 1. Lee la `date` del `.review-passed`.
25
- 2. Compara con `git log --since="[date]" --oneline` y `git status --porcelain`.
26
- 3. **Si hay cambios nuevos**: elimina el `.review-passed` anterior y continua (construye briefing e invoca al sub-agente).
27
- 4. **Si NO hay cambios nuevos**: informa al usuario y termina sin invocar al sub-agente:
28
- ```
29
- El cambio [nombre] ya tiene review aprobado ([verdict] [date]) y no hay cambios posteriores.
30
- ```
31
-
32
- ### Paso 0.5: Construir briefing para el sub-agente (reduce tool calls del auditor)
33
-
34
- Antes de invocar al sub-agente, extrae el contexto que de otro modo el auditor calcularía por su cuenta:
35
-
36
- 1. **Archivos cambiados** — ejecuta `git diff --name-only HEAD` y `git status --porcelain`. La union es el scope bloqueante. (Si ya lo corriste en Paso 0 para verificar cambios post-review, reutiliza ese resultado.)
37
-
38
- 2. **Tipo de proyecto** — lee `package.json` (si existe) e inspecciona las dependencias:
39
- - Indicadores backend: `@nestjs/*`, `express`, `fastify`, `koa`, `typeorm`, `prisma`, `pg`, `mongoose`, `bullmq`, `amqplib`
40
- - Indicadores frontend: `react`, `vue`, `angular`, `next`, `nuxt`, `svelte`, `vite`, `@tanstack/*`
41
- - Si ambos `fullstack`; si solo backend `backend`; si solo frontend `frontend`; si no hay `package.json` o ninguno aplica → lee las primeras 20 lineas de `AGENTS.md` para inferir.
42
-
43
- 3. **Objetivo del cambio** (solo si hay cambio activo en `openspec/changes/`) lee la primera seccion de `proposal.md`. Extrae el objetivo en 1-2 oraciones. Si el scope es `git-diff` sin cambio activo → `null`.
44
-
45
- Construye el bloque BRIEFING:
46
-
47
- ```
48
- BRIEFING:
49
- scope: <changeName | "git-diff">
50
- changedFiles: [ruta/archivo-1.ts, ruta/archivo-2.ts, ...]
51
- projectType: backend | frontend | fullstack | library
52
- changeObjective: <objetivo en 1-2 oraciones, o null>
53
- mode: conciso | detailed
54
- ```
55
-
56
- ### Paso 1: Delegar al sub-agente refacil-auditor
57
-
58
- Invoca al sub-agente `refacil-auditor` pasandole el BRIEFING del paso anterior.
59
-
60
- El sub-agente:
61
- - Usa `changedFiles` del briefing como scope bloqueante (sin re-correr git diff).
62
- - Usa `projectType` para cargar directamente los checklists correctos (sin detection phase).
63
- - Usa `changeObjective` como contexto de intencion (sin releer proposal.md).
64
- - Lee los checklists y los archivos del scope bloqueante.
65
- - Evalua cada item con PASS/FAIL/N/A + severidad en cada FAIL.
66
- - Retorna UN solo mensaje con el reporte + bloque JSON fenced como ` ```refacil-review-result `.
67
-
68
- ### Paso 2: Procesar el reporte del sub-agente
69
-
70
- Muestra al usuario el **reporte conciso** (todo lo anterior al bloque `refacil-review-result`). No muestres el bloque JSON — es metadata interna.
71
-
72
- **Si el sub-agente retorno `SCOPE_ERROR: <razon>`**: propaga el error al usuario y pide clarificacion. No escribas marker.
73
-
74
- ### Paso 3: Crear marcador `.review-passed` (si aplica)
75
-
76
- Parsea el bloque ` ```refacil-review-result ` del sub-agente. Si `verdict` es **APROBADO** o **APROBADO CON OBSERVACIONES** y `changeName` no es null:
77
-
78
- **Ruta:** `openspec/changes/<changeName>/.review-passed`
79
-
80
- **Contenido (el JSON parseado del bloque, verbatim):**
81
- ```json
82
- {
83
- "verdict": "APROBADO|APROBADO CON OBSERVACIONES",
84
- "date": "<ISO>",
85
- "changeName": "<nombre-cambio>",
86
- "summary": "<resumen 1 linea>",
87
- "failCount": <int — solo FAILs en codigo nuevo>,
88
- "preexistingCount": <int FAILs preexistentes, no bloqueantes>,
89
- "blockers": false
90
- }
91
- ```
92
-
93
- **No crees el marker si:**
94
- - `verdict` es `REQUIERE CORRECCIONES`.
95
- - `changeName` es null.
96
- - El sub-agente retorno `SCOPE_ERROR`.
97
-
98
- ### Paso 4: Recomendar siguiente paso
99
-
100
- Segun el `verdict` parseado, agrega al final de tu respuesta:
101
-
102
- **Si APROBADO o APROBADO CON OBSERVACIONES:**
103
- ```
104
- El siguiente paso es archivar el cambio.
105
- Quieres que continue con /refacil:archive?
106
- ```
107
-
108
- **Si REQUIERE CORRECCIONES:**
109
- ```
110
- Una vez aplicadas las correcciones, el siguiente paso es re-verificar la implementacion.
111
- Quieres que continue con /refacil:verify?
112
- ```
113
-
114
- ## Reglas
115
-
116
- - **Siempre construye el briefing (Paso 0.5) antes de delegar** — es la pieza clave que reduce el costo del sub-agente.
117
- - **Siempre delega al sub-agente**. No repliques la logica de checklists ni de evaluacion aqui.
118
- - **El marker lo crea este skill, no el sub-agente**.
119
- - **No muestres el bloque JSON al usuario**.
120
- - Si el sub-agente retorno algo fuera de formato (sin bloque JSON parseable y no es `SCOPE_ERROR`), informa al usuario: "El reviewer retorno un reporte no estructurado — no se creo marker. Revisa el reporte manualmente."
121
- - **Continuidad del flujo**: si el usuario confirma afirmativamente ("si", "ok", "dale", "continua", etc.) la pregunta de continuidad, invocar inmediatamente el **Skill tool** correspondiente: `skill: "refacil:archive"` si el veredicto es APROBADO/APROBADO CON OBSERVACIONES, o `skill: "refacil:verify"` si es REQUIERE CORRECCIONES. (Ver `METHODOLOGY-CONTRACT.md §5`.)
122
-
123
- ## Ver tambien
124
-
125
- - Sub-agente: `.claude/agents/refacil-auditor.md` (fuente: `refacil-sdd-ai/agents/auditor.md`)
126
- - Checklists: `checklist.md`, `checklist-back.md`, `checklist-front.md` en este mismo directorio.
1
+ ---
2
+ name: refacil:review
3
+ description: Code review with the team quality checklist — builds a briefing with changed files and project type, delegates to the refacil-auditor sub-agent, and processes the verdict
4
+ user-invocable: true
5
+ ---
6
+
7
+ # refacil:review — Review Entrypoint
8
+
9
+ This skill is a **thin wrapper** that delegates the heavy review to the `refacil-auditor` sub-agent. Before delegating, it builds a **structured briefing** with the changed files and detected project typethe sub-agent starts evaluating, not discovering.
10
+
11
+ **Prerequisites**: `agents` profile from `refacil-prereqs/SKILL.md` + output mode from `METHODOLOGY-CONTRACT.md`.
12
+
13
+ ## Flow
14
+
15
+ ### Step 0: Resolve scope
16
+
17
+ - Determine the review scope BEFORE invoking the sub-agent. Prioritize in this order:
18
+ 1) User argument (`$ARGUMENTS`)
19
+ 2) Active change in `refacil-sdd/changes/`
20
+ 3) Uncommitted changes (`git diff`)
21
+ - If there are multiple active changes in `refacil-sdd/changes/` and no `$ARGUMENTS`, **stop** and ask the user to explicitly select which change to review. **Do not invoke the sub-agent with ambiguous scope.**
22
+
23
+ ### Step 0.3: Git working tree snapshot (run once)
24
+
25
+ After scope is unambiguous (you are **not** stopping for multiple active changes), collect git state **exactly once** for this skill invocation:
26
+
27
+ 1. Run `git diff --name-only HEAD` set `pathsFromDiff`.
28
+ 2. Run `git status --porcelain` → parse each line (strip the first two status columns) → set `pathsFromStatus`.
29
+ 3. **`changedFilesUnion`** = sorted unique union of `pathsFromDiff` and `pathsFromStatus` (drop empty entries).
30
+
31
+ **Rules:**
32
+ - Reuse **`changedFilesUnion`** and the **same** `git status --porcelain` interpretation everywhere below — **do not** run `git diff --name-only` or `git status --porcelain` again in this skill.
33
+ - If a later step needs “is the working tree non-empty?”, derive it from the snapshot (e.g. non-empty `changedFilesUnion` or any porcelain line) instead of re-running `git status`.
34
+
35
+ If you already have a `changeName`, run `refacil-sdd-ai sdd status <changeName> --json` to get the change status (artifacts, tasks, reviewPassed).
36
+
37
+ **Review already approved**: If `reviewPassed` is `true` in the status JSON (or if the target change already has `.review-passed`), verify if there are changes after the review (marker existence: **`METHODOLOGY-CONTRACT.md` §8**):
38
+ 1. Read the `date` from `.review-passed`.
39
+ 2. Compare with `git log --since="[date]" --oneline` and **reuse the Step 0.3 snapshot** for working-tree activity (do not run `git status` again).
40
+ 3. **If there are new changes** (commits since marker date and/or paths in `changedFilesUnion`): delete the previous `.review-passed` and continue (build briefing and invoke the sub-agent).
41
+ 4. **If there are NO new changes**: inform the user and finish without invoking the sub-agent:
42
+ ```
43
+ The change [name] already has an approved review ([verdict] [date]) and there are no subsequent changes.
44
+ ```
45
+
46
+ ### Step 0.4: Incremental scope (CA-07 — only if re-running after REQUIERE CORRECCIONES)
47
+
48
+ If `changeName` is not null, check whether `refacil-sdd/changes/<changeName>/.review-last-fails.json` exists (read by explicit path — it is NOT a dotfile but may be hidden in listings):
49
+
50
+ - **If the file EXISTS**: read `failedFiles` from it. Compute:
51
+ `incrementalScope = failedFiles changedFilesUnion`
52
+ - If `incrementalScope` is empty (CR-02): fall back to `changedFilesUnion` and add a comment in the briefing: `"# warning: incremental scope was empty — using full changedFilesUnion"`.
53
+ - Use `incrementalScope` as `changedFiles` in the briefing (Step 0.5), instead of the full `changedFilesUnion`.
54
+ - **If the file does NOT exist**: use `changedFilesUnion` as `changedFiles` normally.
55
+
56
+ ### Step 0.5: Build briefing for the sub-agent (reduces auditor tool calls)
57
+
58
+ Before invoking the sub-agent, extract the context that the auditor would otherwise calculate on its own:
59
+
60
+ 1. **Changed files** — use the scope resolved in Step 0.4 (`incrementalScope` if available, otherwise `changedFilesUnion`). Do not run `git diff` or `git status` again.
61
+
62
+ 2. **Project type** — read `package.json` (if it exists) and inspect the dependencies:
63
+ - Backend indicators: `@nestjs/*`, `express`, `fastify`, `koa`, `typeorm`, `prisma`, `pg`, `mongoose`, `bullmq`, `amqplib`
64
+ - Frontend indicators: `react`, `vue`, `angular`, `next`, `nuxt`, `svelte`, `vite`, `@tanstack/*`
65
+ - If both `fullstack`; if only backend `backend`; if only frontend → `frontend`; if no `package.json` or none applies → read the first 20 lines of `AGENTS.md` to infer.
66
+
67
+ 3. **Change objective** (only if there is an active change in `refacil-sdd/changes/`) — read the first section of `proposal.md`. Extract the objective in 1-2 sentences. If the scope is `git-diff` without an active change → `null`.
68
+
69
+ 4. **Cross-skill memory** — if `changeName` is not null and `refacil-sdd/changes/<changeName>/memory.yaml` exists, read it and extract `stackDetected`, `touchedFiles`. Include them in the briefing so the auditor skips re-discovery. If the file does not exist, omit — do not block (CR-04).
70
+
71
+ 5. **Mode** — default `concise`. If re-running after a prior `REQUIERE CORRECCIONES` (i.e., `.review-last-fails.json` was found with non-empty `failedFiles` in Step 0.4): set `mode: focused` — the auditor re-evaluates only the failing checklist items on the `failedFiles` (CR-05: focused mode still reads those files). Otherwise keep `concise`.
72
+
73
+ Build the BRIEFING block:
74
+
75
+ ```
76
+ BRIEFING:
77
+ scope: <changeName | "git-diff">
78
+ changedFiles: [path/file-1.ts, path/file-2.ts, ...]
79
+ projectType: backend | frontend | fullstack | library
80
+ changeObjective: <objective in 1-2 sentences, or null>
81
+ mode: concise | detailed | focused
82
+ stackDetected: <from memory.yaml, or omit>
83
+ touchedFiles: [...] # from memory.yaml — omit if not present
84
+ ```
85
+
86
+ ### Step 1: Delegate to the refacil-auditor sub-agent
87
+
88
+ Invoke the `refacil-auditor` sub-agent passing it the BRIEFING from the previous step.
89
+
90
+ The sub-agent:
91
+ - Uses `changedFiles` from the briefing as the blocking scope (without re-running git diff).
92
+ - Uses `projectType` to directly load the correct checklists (without a detection phase).
93
+ - Uses `changeObjective` as intent context (without re-reading proposal.md).
94
+ - Reads the checklists and the blocking scope files.
95
+ - Evaluates each item with PASS/FAIL/N/A + severity for each FAIL.
96
+ - Returns ONE single message with the report + JSON block fenced as ` ```refacil-review-result `.
97
+
98
+ ### Step 2: Process the sub-agent report
99
+
100
+ Show the user the **concise report** (everything before the `refacil-review-result` block). Do not show the JSON block — it is internal metadata.
101
+
102
+ **If the sub-agent returned `SCOPE_ERROR: <reason>`**: propagate the error to the user and ask for clarification. Do not write a marker.
103
+
104
+ ### Step 2.5: Persist or clean incremental-scope state (CA-06/CA-08/CA-09/CR-01)
105
+
106
+ Parse the `refacil-review-result` block from the sub-agent.
107
+
108
+ **If `verdict` is `REQUIERE CORRECCIONES`**:
109
+ - Only if `changeName` is not null (CR-01) AND the block includes a `failedFiles` field (CA-09 backward compat):
110
+ - Write `refacil-sdd/changes/<changeName>/.review-last-fails.json` with content: `{ "failedFiles": [...] }` using the `failedFiles` array from the JSON block.
111
+ - If `changeName` is null or `failedFiles` is absent: skip silently — existing behavior unchanged.
112
+
113
+ **If `verdict` is `APROBADO` or `APROBADO CON OBSERVACIONES`**:
114
+ - If `refacil-sdd/changes/<changeName>/.review-last-fails.json` exists: delete it (CA-08) — run `rm -f "refacil-sdd/changes/<changeName>/.review-last-fails.json"`.
115
+
116
+ ### Step 3: Create `.review-passed` marker (if applicable)
117
+
118
+ Parse the ` ```refacil-review-result ` block from the sub-agent. If `verdict` is **APROBADO** or **APROBADO CON OBSERVACIONES** and `changeName` is not null:
119
+
120
+ Run the following command to write the marker:
121
+
122
+ ```bash
123
+ refacil-sdd-ai sdd mark-reviewed <changeName> \
124
+ --verdict "<verdict>" \
125
+ --summary "<1-line summary>" \
126
+ --fail-count <failCount> \
127
+ --preexisting-count <preexistingCount>
128
+ ```
129
+
130
+ Where the values are extracted from the sub-agent's `refacil-review-result` block:
131
+ - `<verdict>`: the value of `verdict` (APROBADO, APROBADO CON OBSERVACIONES, etc.)
132
+ - `<summary>`: the value of `summary`
133
+ - `<failCount>`: FAILs in new code (default 0)
134
+ - `<preexistingCount>`: pre-existing non-blocking FAILs (default 0)
135
+
136
+ **Do NOT run the command if:**
137
+ - `verdict` is `REQUIERE CORRECCIONES`.
138
+ - `changeName` is null.
139
+ - The sub-agent returned `SCOPE_ERROR`.
140
+
141
+ ### Step 4: Recommend next step
142
+
143
+ According to the parsed `verdict`, add at the end of your response:
144
+
145
+ **If APROBADO or APROBADO CON OBSERVACIONES:**
146
+ ```
147
+ The next step is to archive the change.
148
+ Do you want me to continue with /refacil:archive?
149
+ ```
150
+
151
+ **If REQUIERE CORRECCIONES:**
152
+ ```
153
+ Once the corrections are applied, the next step is to re-verify the implementation.
154
+ Do you want me to continue with /refacil:verify?
155
+ ```
156
+
157
+ ## Rules
158
+
159
+ - **Always build the briefing (Step 0.5) before delegating** — it is the key piece that reduces the sub-agent cost.
160
+ - **Always delegate to the sub-agent**. Do not replicate checklist or evaluation logic here.
161
+ - **The marker is created by this skill, not the sub-agent**.
162
+ - If the sub-agent returned something out of format (no parseable JSON block and not `SCOPE_ERROR`), inform the user: "The reviewer returned an unstructured report — no marker was created. Review the report manually."
163
+ - **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question, immediately invoke the corresponding **Skill tool**: `skill: "refacil:archive"` if the verdict is APROBADO/APROBADO CON OBSERVACIONES, or `skill: "refacil:verify"` if REQUIERE CORRECCIONES. (See `METHODOLOGY-CONTRACT.md §5`.)