refacil-sdd-ai 4.0.3 → 4.0.4

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/README.md CHANGED
@@ -72,7 +72,7 @@ npm uninstall -g refacil-sdd-ai
72
72
  | Comando | Descripcion |
73
73
  |---|---|
74
74
  | `refacil-sdd-ai check-update` | (`SessionStart`) Verifica nueva version, sincroniza skills y `compact-guidance` en AGENTS.md |
75
- | `refacil-sdd-ai notify-update` | (`Stop` / `afterAgentResponse`) Notifica al LLM sobre migraciones pendientes al finalizar la primera respuesta; el agente ejecuta `/refacil:update` automaticamente |
75
+ | `refacil-sdd-ai notify-update` | (`UserPromptSubmit` / `beforeSubmitPrompt`) Pregunta al usuario si desea ejecutar `/refacil:update` cuando hay migraciones pendientes |
76
76
  | `refacil-sdd-ai check-review` | (`PreToolUse`) Bloquea `git push` si falta `.review-passed` en algun cambio activo |
77
77
  | `refacil-sdd-ai compact-bash` | (`PreToolUse`) Reescribe comandos Bash bare via `updatedInput` |
78
78
 
@@ -234,13 +234,13 @@ Se instalan en `.claude/settings.json` **y** `.cursor/settings.json` durante `in
234
234
  | Hook | Evento | Que hace |
235
235
  |---|---|---|
236
236
  | `check-update` | `SessionStart` | Chequea nueva version en npm, la instala, sincroniza skills y **sincroniza el bloque `compact-guidance`** en `AGENTS.md`. Si hubo actualizacion, escribe un flag de notificacion para el siguiente hook. |
237
- | `notify-update` | `Stop` (Claude Code) / `afterAgentResponse` (Cursor) | Al finalizar la primera respuesta del agente, lee el flag de actualizacion pendiente. Si existe, inyecta la instruccion de ejecutar `/refacil:update` — el agente la ejecuta automaticamente y el usuario ve el resultado al final. El flag se borra tras notificar. |
237
+ | `notify-update` | `UserPromptSubmit` (Claude Code) / `beforeSubmitPrompt` (Cursor) | Antes de procesar el siguiente mensaje del usuario, lee el flag de actualizacion pendiente. Si existe, inyecta la instruccion para que el agente pregunte al usuario si desea ejecutar `/refacil:update`. El flag se borra tras notificar. |
238
238
  | `compact-bash` | `PreToolUse` (Bash) | Reescribe silenciosamente comandos Bash bare via `updatedInput`. Sin turnos extra, sin que el IDE vea el cambio. Requiere Claude Code >= 2.1.89. |
239
239
  | `check-review` | `PreToolUse` (Bash) | Intercepta `git push` y bloquea si falta `.review-passed` en algun cambio activo. |
240
240
 
241
241
  Los cuatro hooks se instalan en `.claude/settings.json` (Claude Code) y `.cursor/settings.json` (Cursor) con la misma logica parametrica.
242
242
 
243
- > **Por que dos hooks para el update?** `SessionStart` hace el sync silencioso al abrir la sesion sin interaccion del usuario. `notify-update` en `Stop` se dispara al finalizar la primera respuesta del agente la instruccion queda al final visible para el usuario y Claude la ejecuta automaticamente en el siguiente turno.
243
+ > **Por que dos hooks para el update?** `SessionStart` hace el sync silencioso al abrir la sesion sin interaccion del usuario. `notify-update` en `UserPromptSubmit` / `beforeSubmitPrompt` inyecta la instruccion justo antes de que el agente procese el siguiente mensaje del usuario, garantizando que no se ignore.
244
244
 
245
245
  ### Gate de review en el push
246
246
 
package/bin/cli.js CHANGED
@@ -57,8 +57,9 @@ function notifyUpdate() {
57
57
 
58
58
  const fromLabel = info.from ? `v${info.from}` : 'version desconocida';
59
59
  console.log(
60
- `[refacil-sdd-ai] La metodologia fue actualizada (${fromLabel} → v${info.to}). ` +
61
- 'Ejecuta /refacil:update ahora para aplicar las migraciones pendientes e informa el resultado al usuario.',
60
+ `[refacil-sdd-ai] La metodologia SDD-AI fue actualizada (${fromLabel} → v${info.to}). ` +
61
+ 'IMPORTANTE: antes de continuar, pregunta al usuario si desea aplicar las migraciones pendientes ' +
62
+ 'y, si confirma, ejecuta /refacil:update.',
62
63
  );
63
64
  }
64
65
 
package/lib/hooks.js CHANGED
@@ -31,8 +31,8 @@ function installHooks(ideDir, projectRoot) {
31
31
  changed = true;
32
32
  }
33
33
 
34
- // Claude Code usa "Stop"; Cursor usa "afterAgentResponse" (equivalente al fin de turno del agente)
35
- const notifyEvent = ideDir === '.cursor' ? 'afterAgentResponse' : 'Stop';
34
+ // Claude Code usa "UserPromptSubmit"; Cursor usa "beforeSubmitPrompt"
35
+ const notifyEvent = ideDir === '.cursor' ? 'beforeSubmitPrompt' : 'UserPromptSubmit';
36
36
  if (!settings.hooks[notifyEvent]) settings.hooks[notifyEvent] = [];
37
37
 
38
38
  const hasNotifyHook = settings.hooks[notifyEvent].some((h) => h._sdd_notify === true);
@@ -101,7 +101,7 @@ function uninstallHooks(ideDir, projectRoot) {
101
101
  if (settings.hooks.SessionStart.length === 0) delete settings.hooks.SessionStart;
102
102
  }
103
103
 
104
- for (const notifyEvent of ['Stop', 'afterAgentResponse']) {
104
+ for (const notifyEvent of ['UserPromptSubmit', 'beforeSubmitPrompt', 'Stop', 'afterAgentResponse']) {
105
105
  if (Array.isArray(settings.hooks[notifyEvent])) {
106
106
  const original = settings.hooks[notifyEvent].length;
107
107
  settings.hooks[notifyEvent] = settings.hooks[notifyEvent].filter((h) => h._sdd_notify !== true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "refacil-sdd-ai",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "SDD-AI: Specification-Driven Development with AI — metodologia de desarrollo con IA usando OpenSpec, Claude Code y Cursor",
5
5
  "bin": {
6
6
  "refacil-sdd-ai": "./bin/cli.js"