refacil-sdd-ai 5.2.0 → 5.2.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/LICENSE +21 -0
- package/README.md +17 -9
- package/bin/cli.js +73 -30
- package/lib/repo-ide-sync.js +100 -0
- package/package.json +1 -1
- package/skills/setup/SKILL.md +16 -40
- package/skills/setup/troubleshooting.md +14 -0
- package/templates/methodology-guide.md +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Refacil
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -51,7 +51,14 @@ In each repo where you want to use the methodology, open the IDE and run:
|
|
|
51
51
|
/refacil:setup
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
`/refacil:setup`:
|
|
55
|
+
|
|
56
|
+
1. Scaffolds **`AGENTS.md`**, **`.agents/`**, **`refacil-sdd/changes/`**, and project branch configuration (everything the methodology needs for **this codebase**).
|
|
57
|
+
2. Runs **`refacil-sdd-ai sync-repo-ide`** from the **repository root** so per-repo stubs and excludes match **your IDE selection from `init`** (`~/.refacil-sdd-ai/selected-ides.json`): **`CLAUDE.md`**, **`.cursorrules`**, **`.claudeignore`**, **`.cursorignore`**, **`.opencodeignore`**, plus **`compact-guidance`** / **`testing-policy`** markers when **`AGENTS.md`** / **`.agents/testing.md`** exist (same logic as **`init`** / **`update`** for those files).
|
|
58
|
+
|
|
59
|
+
You can run **`refacil-sdd-ai sync-repo-ide`** manually anytime from the repo root (e.g. after changing IDE selection). It does **not** reinstall global skills — only repo-local files driven by **`selected-ides.json`** (with the same fallback detection as **`update`** when that file is missing).
|
|
60
|
+
|
|
61
|
+
Skills will prompt you to run `/refacil:setup` if the repo index is missing.
|
|
55
62
|
|
|
56
63
|
### Adding a new IDE to an existing installation
|
|
57
64
|
|
|
@@ -91,6 +98,7 @@ npm uninstall -g refacil-sdd-ai
|
|
|
91
98
|
|---|---|
|
|
92
99
|
| `refacil-sdd-ai init` | Install skills and hooks into global IDE user directories |
|
|
93
100
|
| `refacil-sdd-ai update` | Re-copy skills and hooks to the latest version (global) |
|
|
101
|
+
| `refacil-sdd-ai sync-repo-ide` | Repo-only: `CLAUDE.md`, `.cursorrules`, ignore files, compact-guidance + testing-policy markers — IDE list from `selected-ides.json` (same as `/refacil:setup` Step 4b–5). No global reinstall |
|
|
94
102
|
| `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
103
|
| `refacil-sdd-ai clean` | Remove SDD-AI skills and hooks from global IDE user directories |
|
|
96
104
|
| `refacil-sdd-ai help` | Show help |
|
|
@@ -196,7 +204,7 @@ All invoked as `/refacil:<name>` in Claude Code, Cursor, OpenCode, or Codex.
|
|
|
196
204
|
|
|
197
205
|
| Skill | Usage |
|
|
198
206
|
|---|---|
|
|
199
|
-
| `/refacil:setup` | Generate AGENTS.md
|
|
207
|
+
| `/refacil:setup` | Generate AGENTS.md, `.agents/`, `refacil-sdd/changes/`, branch config; **`sync-repo-ide`** (stubs, ignores, session markers for IDEs chosen in **`init`**) |
|
|
200
208
|
| `/refacil:guide` | Interactive guide on which command to use |
|
|
201
209
|
| `/refacil:explore` | Explore the codebase without modifying anything |
|
|
202
210
|
| `/refacil:propose` | Create a change proposal: proposal + specs + design + tasks |
|
|
@@ -509,15 +517,15 @@ Skills, sub-agents, and hooks are installed into the user's global IDE directori
|
|
|
509
517
|
|
|
510
518
|
### Per repo (generated by `/refacil:setup`)
|
|
511
519
|
|
|
512
|
-
The
|
|
520
|
+
The per-repo step is **`/refacil:setup`** once per project. It generates the **project index** (**`AGENTS.md`**, **`.agents/`**, **`refacil-sdd/changes/`**) and invokes **`refacil-sdd-ai sync-repo-ide`**, which writes **stub + ignore files** according to **`~/.refacil-sdd-ai/selected-ides.json`** (no need for `.claude/` / `.cursor/` folders in the repo). **Skills and hooks remain global**, not copied into the project.
|
|
513
521
|
|
|
514
522
|
```
|
|
515
|
-
# Shared
|
|
516
|
-
CLAUDE.md # Minimal index →
|
|
517
|
-
.cursorrules # Cursor
|
|
518
|
-
.claudeignore # Base exclusions (node_modules, dist, .env,
|
|
519
|
-
.cursorignore # Same
|
|
520
|
-
.opencodeignore # Same
|
|
523
|
+
# Shared — project index from /refacil:setup; stubs + ignores from sync-repo-ide / selected IDE list
|
|
524
|
+
CLAUDE.md # Minimal index → AGENTS.md (if Claude Code is in your IDE selection)
|
|
525
|
+
.cursorrules # Same role for Cursor if Cursor is selected
|
|
526
|
+
.claudeignore # Base exclusions (node_modules, dist, .env, …) when Claude is selected
|
|
527
|
+
.cursorignore # Same template as .claudeignore when Cursor is selected
|
|
528
|
+
.opencodeignore # Same when OpenCode is selected
|
|
521
529
|
AGENTS.md # Project index → generated by /refacil:setup
|
|
522
530
|
# Points to .agents/ + includes auto-managed blocks
|
|
523
531
|
# (compact-guidance and bus presentation)
|
package/bin/cli.js
CHANGED
|
@@ -37,6 +37,7 @@ const { handleBus } = require('../lib/commands/bus');
|
|
|
37
37
|
const { handleSdd, autoMigrateOpenspec, findProjectRoot, cmdWriteConfig } = require('../lib/commands/sdd');
|
|
38
38
|
const { syncIgnoreFiles } = require('../lib/ignore-files');
|
|
39
39
|
const { methodologyMigrationPending } = require('../lib/methodology-migration-pending');
|
|
40
|
+
const { resolveSelectedIDEsForRepo, syncRepoIdeFiles } = require('../lib/repo-ide-sync');
|
|
40
41
|
|
|
41
42
|
const packageRoot = path.resolve(__dirname, '..');
|
|
42
43
|
const projectRoot = findProjectRoot();
|
|
@@ -749,33 +750,7 @@ function update() {
|
|
|
749
750
|
|
|
750
751
|
const homeDir = os.homedir();
|
|
751
752
|
|
|
752
|
-
|
|
753
|
-
// Fall back to detection for backward compat (users who had the methodology installed
|
|
754
|
-
// before selected-ides.json existed). In that case, infer selection from IDE dirs
|
|
755
|
-
// already present in this repo and persist the result so future runs use the file.
|
|
756
|
-
let selectedIDEs = readSelectedIDEs();
|
|
757
|
-
if (!selectedIDEs) {
|
|
758
|
-
const detectedIds = detectInstalledIDEs();
|
|
759
|
-
const hasClaudeDir = detectedIds.includes('claude') ||
|
|
760
|
-
fs.existsSync(path.join(globalClaudeDir(homeDir), 'skills')) ||
|
|
761
|
-
fs.existsSync(path.join(projectRoot, '.claude'));
|
|
762
|
-
const hasCursorDir = detectedIds.includes('cursor') ||
|
|
763
|
-
fs.existsSync(path.join(globalCursorDir(homeDir), 'skills')) ||
|
|
764
|
-
fs.existsSync(path.join(projectRoot, '.cursor'));
|
|
765
|
-
const hasOpenCodeDir = detectedIds.includes('opencode') ||
|
|
766
|
-
fs.existsSync(path.join(globalOpenCodeDir(homeDir), 'skills')) ||
|
|
767
|
-
fs.existsSync(path.join(projectRoot, '.opencode'));
|
|
768
|
-
const hasCodexFallback = detectedIds.includes('codex') ||
|
|
769
|
-
fs.existsSync(path.join(globalCodexDir(homeDir), 'skills'));
|
|
770
|
-
selectedIDEs = [
|
|
771
|
-
hasClaudeDir && '.claude',
|
|
772
|
-
hasCursorDir && '.cursor',
|
|
773
|
-
hasOpenCodeDir && '.opencode',
|
|
774
|
-
hasCodexFallback && '.codex',
|
|
775
|
-
].filter(Boolean);
|
|
776
|
-
// Persist for future runs so detection only happens once
|
|
777
|
-
if (selectedIDEs.length > 0) writeSelectedIDEs(selectedIDEs);
|
|
778
|
-
}
|
|
753
|
+
const selectedIDEs = resolveSelectedIDEsForRepo(projectRoot, homeDir);
|
|
779
754
|
|
|
780
755
|
const hasClaudeDir = selectedIDEs.includes('.claude');
|
|
781
756
|
const hasCursorDir = selectedIDEs.includes('.cursor');
|
|
@@ -890,6 +865,69 @@ function update() {
|
|
|
890
865
|
console.log('\n RESTART your IDE session to apply the changes.\n');
|
|
891
866
|
}
|
|
892
867
|
|
|
868
|
+
/**
|
|
869
|
+
* Per-repo CLAUDE.md, .cursorrules, ignore files, and session markers (compact-guidance, testing-policy).
|
|
870
|
+
* IDE list: ~/.refacil-sdd-ai/selected-ides.json, with the same fallback heuristics as `update`.
|
|
871
|
+
* Does not install skills or hooks (use `init` / `update`).
|
|
872
|
+
*/
|
|
873
|
+
function syncRepoIde() {
|
|
874
|
+
console.log('\n refacil-sdd-ai: sync-repo-ide — per-repo files for selected IDEs...\n');
|
|
875
|
+
|
|
876
|
+
const homeDir = os.homedir();
|
|
877
|
+
const { selectedIDEs, ignoreResult, sessionOut } = syncRepoIdeFiles(packageRoot, projectRoot, homeDir);
|
|
878
|
+
|
|
879
|
+
if (selectedIDEs.length === 0) {
|
|
880
|
+
const selPath = path.join(homeDir, '.refacil-sdd-ai', 'selected-ides.json');
|
|
881
|
+
console.log(' No IDE selection found and nothing could be inferred.');
|
|
882
|
+
console.log(` Run: refacil-sdd-ai init (writes ${selPath})\n`);
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
console.log(` IDE selection: ${selectedIDEs.join(', ')}`);
|
|
887
|
+
|
|
888
|
+
try {
|
|
889
|
+
const IDE_TO_IGNORE = { '.claude': '.claudeignore', '.cursor': '.cursorignore', '.opencode': '.opencodeignore' };
|
|
890
|
+
const ignoreNames = selectedIDEs.map((d) => IDE_TO_IGNORE[d]).filter(Boolean).join(', ');
|
|
891
|
+
const s = ignoreResult.claude || ignoreResult.cursor || ignoreResult.opencode;
|
|
892
|
+
if (s && s.status === 'created') {
|
|
893
|
+
console.log(` ${ignoreNames} created`);
|
|
894
|
+
} else if (s && s.status === 'updated') {
|
|
895
|
+
console.log(` ${ignoreNames} updated (${s.added} entries added)`);
|
|
896
|
+
} else if (ignoreNames) {
|
|
897
|
+
console.log(` ${ignoreNames} are up to date`);
|
|
898
|
+
}
|
|
899
|
+
} catch (err) {
|
|
900
|
+
console.error(` Warning: could not sync ignore files: ${err.message}`);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (sessionOut && !sessionOut.ok) {
|
|
904
|
+
console.error(` Warning: session repo sync: ${sessionOut.reason || 'unknown'}`);
|
|
905
|
+
} else if (sessionOut && sessionOut.ok) {
|
|
906
|
+
try {
|
|
907
|
+
if (sessionOut.compact.status === 'error') {
|
|
908
|
+
console.error(` Warning: could not sync compact-guidance: ${sessionOut.compact.message}`);
|
|
909
|
+
} else if (sessionOut.compact.status === 'appended') {
|
|
910
|
+
console.log(' compact-guidance block added to AGENTS.md');
|
|
911
|
+
} else if (sessionOut.compact.status === 'replaced') {
|
|
912
|
+
console.log(' compact-guidance block updated in AGENTS.md');
|
|
913
|
+
}
|
|
914
|
+
if (sessionOut.testing.status === 'error') {
|
|
915
|
+
console.error(` Warning: could not sync testing-policy: ${sessionOut.testing.message}`);
|
|
916
|
+
} else if (sessionOut.testing.status === 'created-file') {
|
|
917
|
+
console.log(' testing-policy: created .agents/testing.md');
|
|
918
|
+
} else if (sessionOut.testing.status === 'appended' || sessionOut.testing.status === 'written-empty') {
|
|
919
|
+
console.log(' testing-policy block added to .agents/testing.md');
|
|
920
|
+
} else if (sessionOut.testing.status === 'replaced') {
|
|
921
|
+
console.log(' testing-policy block updated in .agents/testing.md');
|
|
922
|
+
}
|
|
923
|
+
} catch (err) {
|
|
924
|
+
console.error(` Warning: session repo sync: ${err.message}`);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
console.log('');
|
|
929
|
+
}
|
|
930
|
+
|
|
893
931
|
function clean() {
|
|
894
932
|
console.log('\n refacil-sdd-ai: Removing skills...\n');
|
|
895
933
|
|
|
@@ -983,9 +1021,11 @@ function help() {
|
|
|
983
1021
|
init Install skills globally for Claude Code, Cursor, OpenCode and/or Codex (interactive IDE selector).
|
|
984
1022
|
Use --all to install for all four IDEs without prompting.
|
|
985
1023
|
Use --yes or --defaults to skip interactive branch config prompts.
|
|
986
|
-
Creates CLAUDE.md, .cursorrules
|
|
1024
|
+
Creates repo stubs (CLAUDE.md, .cursorrules, ignores) for selected IDEs; same logic as sync-repo-ide.
|
|
987
1025
|
Migrates any project-level artifacts to global dirs automatically.
|
|
988
|
-
update Re-copy skills for all
|
|
1026
|
+
update Re-copy skills for all selected IDEs to global user dirs
|
|
1027
|
+
sync-repo-ide Same IDE list as update (selected-ides.json): CLAUDE.md, .cursorrules,
|
|
1028
|
+
ignore files, compact-guidance + testing-policy in repo (no global install)
|
|
989
1029
|
migration-pending Same validation as hooks/notify-update: list migrations (exit 1 if any; --json)
|
|
990
1030
|
check-update Sync skills, compact-guidance (AGENTS.md), and testing-policy block (.agents/testing.md) at session start
|
|
991
1031
|
notify-update Notify methodology migration only if applicable (UserPromptSubmit hook)
|
|
@@ -1033,7 +1073,7 @@ function help() {
|
|
|
1033
1073
|
1. npm install -g refacil-sdd-ai
|
|
1034
1074
|
2. refacil-sdd-ai init
|
|
1035
1075
|
3. RESTART your IDE session (Claude Code, Cursor, OpenCode, or Codex)
|
|
1036
|
-
4. Run: /refacil:setup (generates AGENTS.md for
|
|
1076
|
+
4. Run: /refacil:setup (generates AGENTS.md + sync-repo-ide stubs/ignores for selected IDEs)
|
|
1037
1077
|
|
|
1038
1078
|
Global installation paths (this machine):
|
|
1039
1079
|
- Claude Code: ${claudePath}/skills/, ${claudePath}/agents/
|
|
@@ -1070,6 +1110,9 @@ switch (command) {
|
|
|
1070
1110
|
case 'update':
|
|
1071
1111
|
update();
|
|
1072
1112
|
break;
|
|
1113
|
+
case 'sync-repo-ide':
|
|
1114
|
+
syncRepoIde();
|
|
1115
|
+
break;
|
|
1073
1116
|
case 'migration-pending':
|
|
1074
1117
|
migrationPendingCmd();
|
|
1075
1118
|
break;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const {
|
|
7
|
+
globalClaudeDir,
|
|
8
|
+
globalCursorDir,
|
|
9
|
+
globalOpenCodeDir,
|
|
10
|
+
globalCodexDir,
|
|
11
|
+
readSelectedIDEs,
|
|
12
|
+
writeSelectedIDEs,
|
|
13
|
+
} = require('./global-paths');
|
|
14
|
+
const { detectInstalledIDEs } = require('./ide-detection');
|
|
15
|
+
const { createClaudeMd, createCursorRules } = require('./installer');
|
|
16
|
+
const { syncIgnoreFiles } = require('./ignore-files');
|
|
17
|
+
const { syncRepoSessionMarkers } = require('./session-repo-sync');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Same resolution as `update`: persisted `~/.refacil-sdd-ai/selected-ides.json` first;
|
|
21
|
+
* if missing, heuristic detection (global skills dirs, optional project `.claude/` etc.) and persist.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} projectRoot
|
|
24
|
+
* @param {string} [homeDir]
|
|
25
|
+
* @returns {string[]}
|
|
26
|
+
*/
|
|
27
|
+
function resolveSelectedIDEsForRepo(projectRoot, homeDir = os.homedir()) {
|
|
28
|
+
let selectedIDEs = readSelectedIDEs(homeDir);
|
|
29
|
+
if (!selectedIDEs) {
|
|
30
|
+
const detectedIds = detectInstalledIDEs();
|
|
31
|
+
const hasClaudeDir =
|
|
32
|
+
detectedIds.includes('claude') ||
|
|
33
|
+
fs.existsSync(path.join(globalClaudeDir(homeDir), 'skills')) ||
|
|
34
|
+
fs.existsSync(path.join(projectRoot, '.claude'));
|
|
35
|
+
const hasCursorDir =
|
|
36
|
+
detectedIds.includes('cursor') ||
|
|
37
|
+
fs.existsSync(path.join(globalCursorDir(homeDir), 'skills')) ||
|
|
38
|
+
fs.existsSync(path.join(projectRoot, '.cursor'));
|
|
39
|
+
const hasOpenCodeDir =
|
|
40
|
+
detectedIds.includes('opencode') ||
|
|
41
|
+
fs.existsSync(path.join(globalOpenCodeDir(homeDir), 'skills')) ||
|
|
42
|
+
fs.existsSync(path.join(projectRoot, '.opencode'));
|
|
43
|
+
const hasCodexFallback =
|
|
44
|
+
detectedIds.includes('codex') || fs.existsSync(path.join(globalCodexDir(homeDir), 'skills'));
|
|
45
|
+
selectedIDEs = [
|
|
46
|
+
hasClaudeDir && '.claude',
|
|
47
|
+
hasCursorDir && '.cursor',
|
|
48
|
+
hasOpenCodeDir && '.opencode',
|
|
49
|
+
hasCodexFallback && '.codex',
|
|
50
|
+
].filter(Boolean);
|
|
51
|
+
if (selectedIDEs.length > 0) writeSelectedIDEs(selectedIDEs, homeDir);
|
|
52
|
+
}
|
|
53
|
+
return selectedIDEs || [];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Per-repo artifacts for the current IDE selection: CLAUDE.md, .cursorrules, ignore files,
|
|
58
|
+
* compact-guidance / testing-policy (when `AGENTS.md` / `.agents/` exist).
|
|
59
|
+
*
|
|
60
|
+
* Does not install global skills or hooks (use `init` / `update` for that).
|
|
61
|
+
*
|
|
62
|
+
* @param {string} packageRoot
|
|
63
|
+
* @param {string} projectRoot
|
|
64
|
+
* @param {string} [homeDir]
|
|
65
|
+
* @param {{ sessionMarkers?: boolean }} [options]
|
|
66
|
+
* @returns {{
|
|
67
|
+
* selectedIDEs: string[],
|
|
68
|
+
* claudeOk: boolean,
|
|
69
|
+
* cursorOk: boolean,
|
|
70
|
+
* ignoreResult: Record<string, { status: string, added?: number }|undefined>,
|
|
71
|
+
* sessionOut: object | null
|
|
72
|
+
* }}
|
|
73
|
+
*/
|
|
74
|
+
function syncRepoIdeFiles(packageRoot, projectRoot, homeDir = os.homedir(), options = {}) {
|
|
75
|
+
const sessionMarkers = options.sessionMarkers !== false;
|
|
76
|
+
const selectedIDEs = resolveSelectedIDEsForRepo(projectRoot, homeDir);
|
|
77
|
+
|
|
78
|
+
const hasClaude = selectedIDEs.includes('.claude');
|
|
79
|
+
const hasCursor = selectedIDEs.includes('.cursor');
|
|
80
|
+
|
|
81
|
+
let claudeOk = false;
|
|
82
|
+
let cursorOk = false;
|
|
83
|
+
if (hasClaude) claudeOk = createClaudeMd(packageRoot, projectRoot);
|
|
84
|
+
if (hasCursor) cursorOk = createCursorRules(packageRoot, projectRoot);
|
|
85
|
+
|
|
86
|
+
const ignoreResult = syncIgnoreFiles(projectRoot, selectedIDEs);
|
|
87
|
+
|
|
88
|
+
let sessionOut = null;
|
|
89
|
+
if (sessionMarkers) {
|
|
90
|
+
try {
|
|
91
|
+
sessionOut = syncRepoSessionMarkers(projectRoot, packageRoot);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
sessionOut = { ok: false, reason: err.message };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return { selectedIDEs, claudeOk, cursorOk, ignoreResult, sessionOut };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = { resolveSelectedIDEsForRepo, syncRepoIdeFiles };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "refacil-sdd-ai",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "SDD-AI: Specification-Driven Development with AI — development methodology using AI with Claude Code, Cursor, OpenCode and Codex",
|
|
5
5
|
"bin": {
|
|
6
6
|
"refacil-sdd-ai": "./bin/cli.js"
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -179,64 +179,40 @@ Produce neutral placeholders (e.g. “Stack: unknown — see README / add manife
|
|
|
179
179
|
- The CLI (`refacil-sdd-ai check-update` on **SessionStart**, plus `update` / `init`) merges a block between **`<!-- refacil-sdd-ai:testing-policy:start -->`** and **`<!-- refacil-sdd-ai:testing-policy:end -->`** from the package template. If **`.agents/`** exists but **`testing.md`** does not, the file is **created** with a starter **Repo-specific commands** section **below** the markers (safe to edit; not overwritten on sync).
|
|
180
180
|
- Put long-lived baseline/scoped command lines **outside** the markers (see template). Only the marked region is refreshed when the package updates.
|
|
181
181
|
|
|
182
|
-
### Step 4b:
|
|
182
|
+
### Step 4b–5: Per-repo IDE index files, ignores, and session markers (selected IDEs)
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
Only create/update files for IDEs whose directory exists. Never create files for an IDE that is not present.
|
|
184
|
+
**Source of truth for which IDEs apply to this repo** is the same as `refacil-sdd-ai init` / `update`: **`~/.refacil-sdd-ai/selected-ides.json`** (chosen during `init`). If that file is missing, the CLI falls back to detecting installed/global skill dirs — same heuristic as **`refacil-sdd-ai update`**.
|
|
186
185
|
|
|
187
|
-
|
|
188
|
-
- If `.claude/` exists: overwrite `CLAUDE.md`.
|
|
189
|
-
- If `.cursor/` exists: overwrite `.cursorrules`.
|
|
190
|
-
- If both exist: overwrite both.
|
|
191
|
-
- If neither exists: do not create either file; report that no supported IDE folder was detected and suggest running `refacil-sdd-ai init`.
|
|
186
|
+
Do **not** infer IDE targets from `.claude/`, `.cursor/`, `.opencode/` folders in the repository; those dirs are optional and skills are normally **global**.
|
|
192
187
|
|
|
193
|
-
|
|
188
|
+
**Mandatory shell step** (repository root — same cwd rules as `init`):
|
|
194
189
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
# CLAUDE.md
|
|
199
|
-
|
|
200
|
-
Full project context: see `AGENTS.md` (index) and `.agents/` (detail by area).
|
|
201
|
-
If `AGENTS.md` does not exist, run `/refacil:setup`.
|
|
190
|
+
```bash
|
|
191
|
+
refacil-sdd-ai sync-repo-ide
|
|
202
192
|
```
|
|
203
193
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
All project detail, stack, rules and `refacil:*` commands live in `.agents/` and are indexed from `AGENTS.md`. Do not duplicate anything in CLAUDE.md or .cursorrules.
|
|
207
|
-
|
|
208
|
-
### Step 5: Context exclusion files
|
|
209
|
-
|
|
210
|
-
Sync ignore files only for detected IDE directories:
|
|
211
|
-
- `.claude/` → `.claudeignore`
|
|
212
|
-
- `.cursor/` → `.cursorignore`
|
|
213
|
-
- `.opencode/` → `.opencodeignore`
|
|
214
|
-
|
|
215
|
-
Do not create `.claudeignore`, `.cursorignore`, or `.opencodeignore` if the matching IDE directory does not exist.
|
|
194
|
+
This command writes or refreshes:
|
|
216
195
|
|
|
217
|
-
|
|
196
|
+
- **`CLAUDE.md`** when Claude Code is in the IDE selection.
|
|
197
|
+
- **`.cursorrules`** when Cursor is in the IDE selection (thin index toward `AGENTS.md`, same content policy as before).
|
|
198
|
+
- **`.claudeignore`**, **`.cursorignore`**, **`.opencodeignore`** for the matching selected IDEs (`syncIgnoreFiles` — add missing base entries only; never overwrite custom lines).
|
|
199
|
+
- **`compact-guidance`** in **`AGENTS.md`** and **`testing-policy`** block in **`.agents/testing.md`** when those files exist (same behavior as **`init`** / **`update`** tail).
|
|
218
200
|
|
|
219
|
-
|
|
220
|
-
- **Created**: the detected IDE ignore file(s) were created from scratch.
|
|
221
|
-
- **Updated**: missing entries were added.
|
|
222
|
-
- **No changes**: they already had all the entries.
|
|
201
|
+
Report the CLI stdout to the user (created vs up to date, compact-guidance, testing-policy). If it says no IDE selection was found and nothing could be inferred, instruct **`refacil-sdd-ai init`** first, then rerun **`sync-repo-ide`** from the repo root.
|
|
223
202
|
|
|
224
|
-
If the user wants
|
|
203
|
+
If the user wants extra exclusions beyond the base list, they may edit the ignore files after setup.
|
|
225
204
|
|
|
226
205
|
### Step 6: Verify skills
|
|
227
206
|
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
- `.cursor/` detected → check `.cursor/skills/`
|
|
231
|
-
- `.opencode/` detected → check `.opencode/skills/`
|
|
232
|
-
If missing for any detected IDE: run `refacil-sdd-ai init` and restart session.
|
|
207
|
+
- Verify **`refacil-*`** folders under **global** IDE dirs (skills are installed per machine, not per repo): **`~/.claude/skills/`** when Claude is selected, **`~/.cursor/skills/`** when Cursor is selected (OpenCode / Codex: global dirs per upstream docs).
|
|
208
|
+
If missing: run **`refacil-sdd-ai init`** and restart the IDE session.
|
|
233
209
|
- Verify `sdd` subcommand: `refacil-sdd-ai sdd 2>&1 || true` — must show subcommands `status`, `mark-reviewed`, `tasks-update`, `archive`.
|
|
234
210
|
|
|
235
211
|
### Step 7: Final summary
|
|
236
212
|
|
|
237
213
|
```
|
|
238
214
|
=== refacil:setup completed ===
|
|
239
|
-
Node.js / refacil-sdd-ai / refacil-sdd/changes/ / branch config / AGENTS.md /
|
|
215
|
+
Node.js / refacil-sdd-ai / refacil-sdd/changes/ / branch config / AGENTS.md / sync-repo-ide (selected IDEs) / skills OK
|
|
240
216
|
|
|
241
217
|
Restart Claude Code or Cursor session if this is the first skills installation.
|
|
242
218
|
The next step is to review the available flow.
|
|
@@ -17,6 +17,20 @@ Consult this file **only** if a setup step fails. It is not part of the happy pa
|
|
|
17
17
|
- Always run `refacil-sdd-ai init` from the **repository root** (the folder that owns the codebase — commonly where `package.json`, `go.mod`, `pyproject.toml`, or `Cargo.toml` lives), not from inside a subdirectory.
|
|
18
18
|
- If you accidentally ran it from a subdirectory, delete the mistakenly created `.claude/`, `.cursor/`, `.claudeignore`, `.cursorignore`, `.cursorrules`, and `CLAUDE.md` from that subdirectory, then re-run from the correct location.
|
|
19
19
|
|
|
20
|
+
## `/refacil:setup` did not create `CLAUDE.md`, `.cursorignore`, etc.
|
|
21
|
+
|
|
22
|
+
- Those files come from **`refacil-sdd-ai sync-repo-ide`** (run by `/refacil:setup`). Execute it yourself from the **repository root**:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
refacil-sdd-ai sync-repo-ide
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Requires a prior **`refacil-sdd-ai init`** so **`~/.refacil-sdd-ai/selected-ides.json`** exists (or readable global skill dirs so the CLI can infer IDEs).
|
|
29
|
+
|
|
30
|
+
## Wrong directory for `sync-repo-ide`
|
|
31
|
+
|
|
32
|
+
- Same rule as **`init`** / **`update`**: cwd must be the **repository root**. Otherwise stubs and ignores are written next to the wrong folder.
|
|
33
|
+
|
|
20
34
|
## AGENTS.md is missing after init
|
|
21
35
|
|
|
22
36
|
- `refacil-sdd-ai init` does not generate `AGENTS.md` automatically — it is created by `/refacil:setup` inside the IDE.
|
|
@@ -6,7 +6,7 @@ Skills are identical in `.claude/skills/refacil-*/` (Claude Code) and `.cursor/s
|
|
|
6
6
|
|
|
7
7
|
| Command | Description |
|
|
8
8
|
|---------|-------------|
|
|
9
|
-
| `/refacil:setup` | Generate `AGENTS.md`, `.agents/`, `refacil-sdd/changes/`,
|
|
9
|
+
| `/refacil:setup` | Generate `AGENTS.md`, `.agents/`, `refacil-sdd/changes/`, branch config; runs `refacil-sdd-ai sync-repo-ide` for stubs/ignores/markers (`CLAUDE.md`, `.cursorrules`, `*.ignore`, compact-guidance) from **selected IDEs** |
|
|
10
10
|
| `/refacil:guide` | Interactive guide — which command to use |
|
|
11
11
|
| `/refacil:explore` | Explore the codebase without changes |
|
|
12
12
|
| `/refacil:propose` | Create a change proposal |
|