refacil-sdd-ai 5.0.10 → 5.1.1
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 +36 -24
- package/lib/hooks.js +21 -2
- package/lib/installer.js +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,10 +89,10 @@ npm uninstall -g refacil-sdd-ai
|
|
|
89
89
|
|
|
90
90
|
| Command | Description |
|
|
91
91
|
|---|---|
|
|
92
|
-
| `refacil-sdd-ai init` | Install skills and hooks
|
|
93
|
-
| `refacil-sdd-ai update` | Re-copy skills and hooks to the latest version |
|
|
92
|
+
| `refacil-sdd-ai init` | Install skills and hooks into global IDE user directories |
|
|
93
|
+
| `refacil-sdd-ai update` | Re-copy skills and hooks to the latest version (global) |
|
|
94
94
|
| `refacil-sdd-ai migration-pending [--json]` | Same detection as hooks/`notify-update`; exit 1 if migration is pending; on exit 0 also deletes obsolete `.refacil-pending-update` (same as at the start of `check-update`) |
|
|
95
|
-
| `refacil-sdd-ai clean` | Remove SDD-AI skills and hooks from
|
|
95
|
+
| `refacil-sdd-ai clean` | Remove SDD-AI skills and hooks from global IDE user directories |
|
|
96
96
|
| `refacil-sdd-ai help` | Show help |
|
|
97
97
|
|
|
98
98
|
### Internal hooks (invoked automatically — not for manual use)
|
|
@@ -184,7 +184,7 @@ refacil-sdd-ai sdd config --json
|
|
|
184
184
|
|
|
185
185
|
> The `join/leave/say/ask/reply/attend/inbox` subcommands also exist as **IDE skills** (`/refacil:join`, etc.). In most cases use the skills; the CLI commands are for scripting or debugging.
|
|
186
186
|
>
|
|
187
|
-
> **Cross-repo coordination** (ask requests, room agreements, `/refacil:propose`, closing to the requester): after `init`, the file **`BUS-CROSS-REPO.md`** is available in
|
|
187
|
+
> **Cross-repo coordination** (ask requests, room agreements, `/refacil:propose`, closing to the requester): after `init`, the file **`BUS-CROSS-REPO.md`** is available in `~/.claude/skills/refacil-prereqs/` and `~/.cursor/skills/refacil-prereqs/`.
|
|
188
188
|
|
|
189
189
|
---
|
|
190
190
|
|
|
@@ -320,7 +320,7 @@ Installed during `init` / `update` for each selected IDE. The same four behavior
|
|
|
320
320
|
|
|
321
321
|
| Behavior | Claude Code | Cursor | OpenCode |
|
|
322
322
|
|---|---|---|---|
|
|
323
|
-
| **check-update** | `SessionStart` hook in
|
|
323
|
+
| **check-update** | `SessionStart` hook in `~/.claude/settings.json` | `SessionStart` hook in `~/.cursor/hooks.json` | `session.created` handler in the global OpenCode plugin |
|
|
324
324
|
| **notify-update** | `UserPromptSubmit` hook | `beforeSubmitPrompt` hook | `tui.prompt.append` handler |
|
|
325
325
|
| **compact-bash** | `PreToolUse` (Bash) hook | `PreToolUse` (Bash) hook | `tool.execute.before` handler for bash tool |
|
|
326
326
|
| **check-review** | `PreToolUse` (Bash) hook | `PreToolUse` (Bash) hook | `tool.execute.before` handler for bash tool |
|
|
@@ -332,7 +332,7 @@ Installed during `init` / `update` for each selected IDE. The same four behavior
|
|
|
332
332
|
| `compact-bash` | Silently rewrites bare Bash commands. No extra turns, the IDE does not see the change. Requires Claude Code >= 2.1.89 for the `updatedInput` path. |
|
|
333
333
|
| `check-review` | Intercepts `git push` and blocks if `.review-passed` is missing in any active change. |
|
|
334
334
|
|
|
335
|
-
> **OpenCode plugin**: a single file
|
|
335
|
+
> **OpenCode plugin**: a single file installed in the global OpenCode plugins directory implements all four behaviors. It loads `lib/compact/rules.js` from the package to reuse the same rewrite rules — no duplicated logic. If the rules file is not resolvable, compact-bash is disabled gracefully with a warning to stderr; the plugin never crashes the session.
|
|
336
336
|
|
|
337
337
|
> **Why two hooks for updates?** `SessionStart` does the silent sync when opening the session without user interaction. `notify-update` on `UserPromptSubmit` / `beforeSubmitPrompt` injects the instruction just before the agent processes the next user message, ensuring it is not ignored.
|
|
338
338
|
|
|
@@ -470,31 +470,41 @@ Local bus (WebSocket over `127.0.0.1`) so agents across different repos can comm
|
|
|
470
470
|
|
|
471
471
|
---
|
|
472
472
|
|
|
473
|
-
## What Gets Installed
|
|
473
|
+
## What Gets Installed
|
|
474
474
|
|
|
475
|
-
|
|
475
|
+
### Global user directories (once, shared across all repos)
|
|
476
|
+
|
|
477
|
+
Skills, sub-agents, and hooks are installed into the user's global IDE directories — not into any project repo. Only the IDEs selected during `init` receive files.
|
|
476
478
|
|
|
477
479
|
```
|
|
478
480
|
# Claude Code (if selected)
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
.claude/.sdd-version # Installed methodology version (used by check-update)
|
|
481
|
+
~/.claude/skills/refacil-*/ # Skills (includes refacil-prereqs: METHODOLOGY-CONTRACT.md, BUS-CROSS-REPO.md, …)
|
|
482
|
+
~/.claude/agents/refacil-*.md # Read-only sub-agents: auditor, investigator, validator
|
|
483
|
+
# Write sub-agents: tester, implementer, debugger, proposer
|
|
484
|
+
~/.claude/settings.json # SDD hooks merged in: check-update, notify-update, check-review, compact-bash
|
|
484
485
|
|
|
485
486
|
# Cursor (if selected)
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
# OpenCode
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
487
|
+
~/.cursor/skills/refacil-*/ # Cursor skills (auto-transformed frontmatter: readonly + model:inherit)
|
|
488
|
+
~/.cursor/agents/refacil-*.md # Cursor sub-agents (readonly:true/false + model:inherit, auto-generated)
|
|
489
|
+
~/.cursor/hooks.json # SDD hooks merged in (same four behaviors)
|
|
490
|
+
|
|
491
|
+
# OpenCode (if selected) — macOS/Linux: ~/.config/opencode/ Windows: %APPDATA%\opencode
|
|
492
|
+
~/.config/opencode/skills/refacil-*/ # OpenCode skills
|
|
493
|
+
~/.config/opencode/agents/refacil-*.md # OpenCode sub-agents (permission block + mode:subagent)
|
|
494
|
+
~/.config/opencode/plugins/refacil-hooks.js # Plugin: session.created + tui.prompt.append + tool.execute.before
|
|
495
|
+
|
|
496
|
+
# refacil-sdd-ai state
|
|
497
|
+
~/.refacil-sdd-ai/
|
|
498
|
+
selected-ides.json # IDE selection saved on init, reused by update
|
|
499
|
+
config.yaml # Global config: baseBranch, protectedBranches, artifactLanguage
|
|
500
|
+
sdd-version # Installed methodology version (used by check-update)
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Per repo (generated by `/refacil:setup`)
|
|
497
504
|
|
|
505
|
+
The only per-repo step is running `/refacil:setup` once per project. It generates the project index — no IDE skills or hooks are written to the repo.
|
|
506
|
+
|
|
507
|
+
```
|
|
498
508
|
# Shared (IDE-agnostic)
|
|
499
509
|
CLAUDE.md # Minimal index → points to AGENTS.md
|
|
500
510
|
.cursorrules # Cursor format equivalent of CLAUDE.md
|
|
@@ -512,6 +522,8 @@ refacil-sdd/ # SDD artifacts store
|
|
|
512
522
|
specs/ # Persistent specifications synced from archived changes
|
|
513
523
|
```
|
|
514
524
|
|
|
525
|
+
> **Migration from project-level installs**: the `check-update` hook (SessionStart) automatically detects and removes any leftover project-level `refacil-*` skills, agents, hooks, and empty IDE directories from older versions.
|
|
526
|
+
|
|
515
527
|
---
|
|
516
528
|
|
|
517
529
|
## Technologies
|
package/lib/hooks.js
CHANGED
|
@@ -332,8 +332,8 @@ function removeProjectLevelHooks(projectRoot) {
|
|
|
332
332
|
if (fs.existsSync(claudeSettingsPath)) {
|
|
333
333
|
try {
|
|
334
334
|
const settings = JSON.parse(fs.readFileSync(claudeSettingsPath, 'utf8'));
|
|
335
|
+
let changed = false;
|
|
335
336
|
if (settings && settings.hooks) {
|
|
336
|
-
let changed = false;
|
|
337
337
|
for (const event of Object.keys(settings.hooks)) {
|
|
338
338
|
if (!Array.isArray(settings.hooks[event])) continue;
|
|
339
339
|
const before = settings.hooks[event].length;
|
|
@@ -344,7 +344,16 @@ function removeProjectLevelHooks(projectRoot) {
|
|
|
344
344
|
if (settings.hooks[event].length === 0) delete settings.hooks[event];
|
|
345
345
|
}
|
|
346
346
|
if (Object.keys(settings.hooks).length === 0) delete settings.hooks;
|
|
347
|
-
|
|
347
|
+
} else if (settings && Object.keys(settings).length === 0) {
|
|
348
|
+
// Already empty stub — treat as changed so it gets deleted below
|
|
349
|
+
changed = true;
|
|
350
|
+
}
|
|
351
|
+
if (changed) {
|
|
352
|
+
if (Object.keys(settings).length === 0) {
|
|
353
|
+
fs.unlinkSync(claudeSettingsPath);
|
|
354
|
+
} else {
|
|
355
|
+
fs.writeFileSync(claudeSettingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
356
|
+
}
|
|
348
357
|
}
|
|
349
358
|
} catch (_) {}
|
|
350
359
|
}
|
|
@@ -386,6 +395,16 @@ function removeProjectLevelHooks(projectRoot) {
|
|
|
386
395
|
}
|
|
387
396
|
} catch (_) {}
|
|
388
397
|
}
|
|
398
|
+
|
|
399
|
+
// Remove IDE root dirs if now empty (hooks cleanup may have been the last file)
|
|
400
|
+
for (const ideDir of ['.claude', '.cursor', '.opencode']) {
|
|
401
|
+
const idePath = path.join(projectRoot, ideDir);
|
|
402
|
+
try {
|
|
403
|
+
if (fs.existsSync(idePath) && fs.readdirSync(idePath).length === 0) {
|
|
404
|
+
fs.rmdirSync(idePath);
|
|
405
|
+
}
|
|
406
|
+
} catch (_) {}
|
|
407
|
+
}
|
|
389
408
|
}
|
|
390
409
|
|
|
391
410
|
// ── Fachada pública ──────────────────────────────────────────────────────────
|
package/lib/installer.js
CHANGED
|
@@ -356,13 +356,15 @@ function removeProjectLevelArtifacts(projectRoot) {
|
|
|
356
356
|
fs.rmdirSync(ocPluginsDir);
|
|
357
357
|
}
|
|
358
358
|
} catch (_) {}
|
|
359
|
-
// Remove
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
fs.
|
|
364
|
-
|
|
365
|
-
|
|
359
|
+
// Remove IDE root dirs if now empty
|
|
360
|
+
for (const ideDir of ['.opencode', '.cursor', '.claude']) {
|
|
361
|
+
const idePath = path.join(projectRoot, ideDir);
|
|
362
|
+
try {
|
|
363
|
+
if (fs.existsSync(idePath) && fs.readdirSync(idePath).length === 0) {
|
|
364
|
+
fs.rmdirSync(idePath);
|
|
365
|
+
}
|
|
366
|
+
} catch (_) {}
|
|
367
|
+
}
|
|
366
368
|
|
|
367
369
|
return removed;
|
|
368
370
|
}
|
package/package.json
CHANGED