refacil-sdd-ai 4.0.11 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -234,7 +234,7 @@ Se instalan en `.claude/settings.json` **y** `.cursor/settings.json` durante `in
234
234
 
235
235
  | Hook | Evento | Que hace |
236
236
  |---|---|---|
237
- | `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
+ | `check-update` | `SessionStart` | Al inicio borra `.refacil-pending-update` si ya no hay migracion (flags obsoletos). Luego: npm, sync skills, **compact-guidance**. Si hubo sync de skills y **si** hay migracion pendiente, escribe el flag para `notify-update`. |
238
238
  | `notify-update` | `UserPromptSubmit` (Claude Code) / `beforeSubmitPrompt` (Cursor) | Si existe flag y **hay migracion de metodologia pendiente** (misma tabla que `/refacil:update`), inyecta la instruccion o pausa el primer mensaje; si solo hubo sync de skills sin migracion, el flag no se crea o se descarta sin preguntar. |
239
239
  | `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. |
240
240
  | `check-review` | `PreToolUse` (Bash) | Intercepta `git push` y bloquea si falta `.review-passed` en algun cambio activo. |
package/bin/cli.js CHANGED
@@ -46,6 +46,15 @@ function writePendingUpdateFlag(root, fromVersion, toVersion) {
46
46
  } catch (_) {}
47
47
  }
48
48
 
49
+ /** Borra `.refacil-pending-update` si ya no hay migracion (flags viejos o sync de skills sin migracion). */
50
+ function clearStalePendingUpdateFlag(root) {
51
+ const flagPath = path.join(root, '.refacil-pending-update');
52
+ if (!fs.existsSync(flagPath)) return;
53
+ if (!methodologyMigrationPending(root).pending) {
54
+ try { fs.unlinkSync(flagPath); } catch (_) {}
55
+ }
56
+ }
57
+
49
58
  function readStdinPrompt() {
50
59
  try {
51
60
  const raw = fs.readFileSync(0, 'utf8');
@@ -163,10 +172,13 @@ function migrationPendingCmd() {
163
172
  } else {
164
173
  console.log(' Sin migraciones de metodologia pendientes (criterio alineado con hooks y /refacil:update).');
165
174
  }
175
+ clearStalePendingUpdateFlag(projectRoot);
166
176
  process.exit(pending ? 1 : 0);
167
177
  }
168
178
 
169
179
  function checkUpdate() {
180
+ clearStalePendingUpdateFlag(projectRoot);
181
+
170
182
  const { execSync } = require('child_process');
171
183
  let localVersion = getPackageVersion(packageRoot);
172
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "refacil-sdd-ai",
3
- "version": "4.0.11",
3
+ "version": "4.1.0",
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"
@@ -111,12 +111,14 @@ Conjunto requerido de commands: `.claude/commands/opsx/` → `apply.md`, `archiv
111
111
 
112
112
  ## Paso 4: Limpiar flag de actualizacion pendiente
113
113
 
114
- Eliminar el archivo de flag si existe (puede estar en `.claude/` o `.cursor/`):
114
+ Tras migrar, elimina el flag en la raiz del repo si sigue existiendo:
115
115
 
116
116
  ```bash
117
117
  rm -f .refacil-pending-update
118
118
  ```
119
119
 
120
+ Si no hubo cambios (Paso 1 dio exit 0), el flag obsoleto suele borrarse solo al proximo `check-update` (SessionStart) o al ejecutar `refacil-sdd-ai migration-pending` con exit 0; el `rm` manual solo hace falta si aplicaste migraciones a mano o quedo un vestigio.
121
+
120
122
  ## Paso 5: Resumen
121
123
 
122
124
  Informar que archivos se crearon o modificaron. Mencionar que el bloque `compact-guidance` se sincronizara automaticamente en el proximo SessionStart.