adi_dev_workflow 1.2.0 → 1.3.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/frameworks/skills/ministack-intent-expert/SKILL.md +0 -2
- package/frameworks/skills/ministack-scope-expert/SKILL.md +0 -4
- package/frameworks/skills/ministack-tasks-expert/SKILL.md +204 -0
- package/frameworks/skills/ministack-tasks-expert/templates/task_plan_template.md +78 -0
- package/frameworks/skills/ministack-tasks-expert/templates/task_template.md +103 -0
- package/frameworks/skills/ministack-tech-direction-expert/SKILL.md +230 -0
- package/frameworks/skills/ministack-tech-direction-expert/evals/evals.json +1 -0
- package/frameworks/skills/ministack-tech-direction-expert/templates/tech_direction-template.md +17 -0
- package/frameworks/skills/prompt-engineer-expert/SKILL.md +232 -0
- package/frameworks/skills/prompt-engineer-expert/templates/prompt_template.md +139 -0
- package/frameworks/skills/sdd-prd-expert/SKILL.md +0 -2
- package/frameworks/skills/sdd-task-plan-expert/SKILL.md +0 -2
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/benchmark.json +99 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/benchmark.md +64 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/with_skill/outputs/response.md +134 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/with_skill/outputs/transcript.md +68 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/with_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/without_skill/outputs/response.md +525 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/without_skill/outputs/transcript.md +30 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-1-happy-path/without_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/with_skill/outputs/response.md +1126 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/with_skill/outputs/transcript.md +131 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/with_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/without_skill/outputs/response.md +452 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/without_skill/outputs/transcript.md +78 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-2-spec-simples/without_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/with_skill/outputs/response.md +101 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/with_skill/outputs/transcript.md +133 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/with_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/without_skill/outputs/response.md +248 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/without_skill/outputs/transcript.md +49 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/eval-3-sem-user-stories/without_skill/timing.json +5 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-1/review.html +1325 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/benchmark.json +94 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/benchmark.md +67 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/with_skill/outputs/response.md +117 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/with_skill/outputs/transcript.md +91 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/with_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/without_skill/outputs/response.md +694 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/without_skill/outputs/transcript.md +45 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-1-happy-path/without_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/with_skill/outputs/response.md +1087 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/with_skill/outputs/transcript.md +124 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/with_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/without_skill/outputs/response.md +458 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/without_skill/outputs/transcript.md +84 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-2-spec-simples/without_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/eval_metadata.json +12 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/with_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/with_skill/outputs/response.md +70 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/with_skill/outputs/transcript.md +148 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/with_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/without_skill/grading.json +32 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/without_skill/outputs/response.md +249 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/without_skill/outputs/transcript.md +80 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/eval-3-sem-user-stories/without_skill/timing.json +1 -0
- package/frameworks/skills/sdd-task-plan-expert-workspace/iteration-2/review.html +1325 -0
- package/frameworks/skills/sdd-tech-direction-expert/SKILL.md +235 -0
- package/frameworks/skills/sdd-tech-direction-expert/evals/evals.json +1 -0
- package/frameworks/skills/sdd-tech-direction-expert/templates/tech_direction-template.md +23 -0
- package/frameworks/skills/sdd-tech-spec-expert/SKILL.md +317 -0
- package/frameworks/skills/sdd-tech-spec-expert/evals/evals.json +199 -0
- package/frameworks/skills/sdd-tech-spec-expert/templates/spec_tech_template.md +290 -0
- package/frameworks/skills/sdd-tech-spec-expert/templates/tech_direction-template.md +23 -0
- package/frameworks/skills/taskcard-expert/SKILL.md +0 -4
- package/package.json +1 -1
- package/src/cli.js +27 -2
- package/src/installer.js +185 -106
package/src/installer.js
CHANGED
|
@@ -6,64 +6,176 @@ import { transformContent } from './transformer.js';
|
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const FRAMEWORKS_DIR = join(__dirname, '..', 'frameworks');
|
|
8
8
|
|
|
9
|
-
const FRAMEWORK_MAP = {
|
|
10
|
-
sdd: {
|
|
11
|
-
commands: 'sdd',
|
|
12
|
-
skills: ['sdd-prd-expert', 'sdd-spec-tech-expert', 'sdd-task-plan-expert', 'sdd-qa-expert'],
|
|
13
|
-
},
|
|
14
|
-
ministack: {
|
|
15
|
-
commands: 'ministack',
|
|
16
|
-
skills: ['ministack-intent-expert', 'ministack-scope-expert', 'ministack-expert', 'ministack-qa-expert'],
|
|
17
|
-
},
|
|
18
|
-
taskcard: {
|
|
19
|
-
commands: 'taskcard',
|
|
20
|
-
skills: ['taskcard-expert', 'taskcard-qa-expert'],
|
|
21
|
-
},
|
|
22
|
-
shared: {
|
|
23
|
-
commands: null, // root-level commands
|
|
24
|
-
skills: [],
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
9
|
const IDE_DIRS = {
|
|
29
10
|
claude: '.claude',
|
|
30
11
|
cursor: '.cursor',
|
|
31
12
|
};
|
|
32
13
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
// Prefixos usados para rotear skills e commands ao framework correto.
|
|
15
|
+
// Qualquer skill sem prefixo conhecido vai para 'shared'.
|
|
16
|
+
const FRAMEWORK_PREFIXES = {
|
|
17
|
+
sdd: 'sdd',
|
|
18
|
+
ministack: 'ministack',
|
|
19
|
+
taskcard: 'taskcard',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
async function exists(path) {
|
|
23
|
+
try {
|
|
24
|
+
await stat(path);
|
|
25
|
+
return true;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function listDirs(dir) {
|
|
32
|
+
if (!(await exists(dir))) return [];
|
|
33
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
34
|
+
return entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function listFiles(dir) {
|
|
38
|
+
if (!(await exists(dir))) return [];
|
|
39
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
40
|
+
return entries.filter((e) => e.isFile()).map((e) => e.name);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function skillFramework(skillName) {
|
|
44
|
+
for (const [fw, prefix] of Object.entries(FRAMEWORK_PREFIXES)) {
|
|
45
|
+
if (skillName === prefix || skillName.startsWith(prefix + '-')) return fw;
|
|
46
|
+
}
|
|
47
|
+
return 'shared';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function copyFile(src, dest, target) {
|
|
51
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
52
|
+
if (src.endsWith('.md')) {
|
|
53
|
+
const content = await readFile(src, 'utf-8');
|
|
54
|
+
const transformed = transformContent(content, target);
|
|
55
|
+
await writeFile(dest, transformed, 'utf-8');
|
|
56
|
+
} else {
|
|
57
|
+
const content = await readFile(src);
|
|
58
|
+
await writeFile(dest, content);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
36
62
|
async function copyDir(src, dest, target) {
|
|
37
63
|
await mkdir(dest, { recursive: true });
|
|
38
64
|
const entries = await readdir(src, { withFileTypes: true });
|
|
39
|
-
|
|
40
65
|
for (const entry of entries) {
|
|
41
66
|
const srcPath = join(src, entry.name);
|
|
42
67
|
const destPath = join(dest, entry.name);
|
|
43
|
-
|
|
44
68
|
if (entry.isDirectory()) {
|
|
45
69
|
await copyDir(srcPath, destPath, target);
|
|
46
|
-
} else if (entry.name.endsWith('.md')) {
|
|
47
|
-
const content = await readFile(srcPath, 'utf-8');
|
|
48
|
-
const transformed = transformContent(content, target);
|
|
49
|
-
await writeFile(destPath, transformed, 'utf-8');
|
|
50
70
|
} else {
|
|
51
|
-
|
|
52
|
-
await writeFile(destPath, content);
|
|
71
|
+
await copyFile(srcPath, destPath, target);
|
|
53
72
|
}
|
|
54
73
|
}
|
|
55
74
|
}
|
|
56
75
|
|
|
76
|
+
async function countMarkdownRecursive(dir) {
|
|
77
|
+
let count = 0;
|
|
78
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
const full = join(dir, entry.name);
|
|
81
|
+
if (entry.isDirectory()) count += await countMarkdownRecursive(full);
|
|
82
|
+
else if (entry.name.endsWith('.md')) count++;
|
|
83
|
+
}
|
|
84
|
+
return count;
|
|
85
|
+
}
|
|
86
|
+
|
|
57
87
|
/**
|
|
58
|
-
*
|
|
88
|
+
* Constroi o plano de instalacao varrendo frameworks/ e mapeando cada item
|
|
89
|
+
* (skill, command, agent, template, config) para seu destino no IDE.
|
|
90
|
+
* Cada item e marcado com `overwrite: true` se o destino ja existir.
|
|
59
91
|
*/
|
|
60
|
-
async function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
async function buildPlan({ cwd, target, frameworks }) {
|
|
93
|
+
const ideDir = join(cwd, IDE_DIRS[target]);
|
|
94
|
+
const selected = new Set(frameworks);
|
|
95
|
+
const items = [];
|
|
96
|
+
|
|
97
|
+
// Skills: detectadas automaticamente por prefixo
|
|
98
|
+
const skillNames = await listDirs(join(FRAMEWORKS_DIR, 'skills'));
|
|
99
|
+
for (const name of skillNames) {
|
|
100
|
+
const fw = skillFramework(name);
|
|
101
|
+
if (!selected.has(fw)) continue;
|
|
102
|
+
items.push({
|
|
103
|
+
category: 'skills',
|
|
104
|
+
kind: 'dir',
|
|
105
|
+
src: join(FRAMEWORKS_DIR, 'skills', name),
|
|
106
|
+
dest: join(ideDir, 'skills', name),
|
|
107
|
+
label: `skills/${name}`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Commands: subdir por framework + arquivos root-level para 'shared'
|
|
112
|
+
const commandDirs = await listDirs(join(FRAMEWORKS_DIR, 'commands'));
|
|
113
|
+
for (const name of commandDirs) {
|
|
114
|
+
if (!FRAMEWORK_PREFIXES[name] || !selected.has(name)) continue;
|
|
115
|
+
items.push({
|
|
116
|
+
category: 'commands',
|
|
117
|
+
kind: 'dir',
|
|
118
|
+
src: join(FRAMEWORKS_DIR, 'commands', name),
|
|
119
|
+
dest: join(ideDir, 'commands', name),
|
|
120
|
+
label: `commands/${name}/`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (selected.has('shared')) {
|
|
124
|
+
const rootCmds = await listFiles(join(FRAMEWORKS_DIR, 'commands'));
|
|
125
|
+
for (const name of rootCmds) {
|
|
126
|
+
if (!name.endsWith('.md')) continue;
|
|
127
|
+
items.push({
|
|
128
|
+
category: 'commands',
|
|
129
|
+
kind: 'file',
|
|
130
|
+
src: join(FRAMEWORKS_DIR, 'commands', name),
|
|
131
|
+
dest: join(ideDir, 'commands', name),
|
|
132
|
+
label: `commands/${name}`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Agents, templates, config: pertencem a 'shared'
|
|
138
|
+
if (selected.has('shared')) {
|
|
139
|
+
for (const name of await listFiles(join(FRAMEWORKS_DIR, 'agents'))) {
|
|
140
|
+
if (!name.endsWith('.md')) continue;
|
|
141
|
+
items.push({
|
|
142
|
+
category: 'agents',
|
|
143
|
+
kind: 'file',
|
|
144
|
+
src: join(FRAMEWORKS_DIR, 'agents', name),
|
|
145
|
+
dest: join(ideDir, 'agents', name),
|
|
146
|
+
label: `agents/${name}`,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
for (const name of await listFiles(join(FRAMEWORKS_DIR, 'templates'))) {
|
|
150
|
+
if (!name.endsWith('.md')) continue;
|
|
151
|
+
items.push({
|
|
152
|
+
category: 'templates',
|
|
153
|
+
kind: 'file',
|
|
154
|
+
src: join(FRAMEWORKS_DIR, 'templates', name),
|
|
155
|
+
dest: join(ideDir, 'templates', name),
|
|
156
|
+
label: `templates/${name}`,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
for (const name of await listFiles(join(FRAMEWORKS_DIR, 'config'))) {
|
|
160
|
+
items.push({
|
|
161
|
+
category: 'config',
|
|
162
|
+
kind: 'file',
|
|
163
|
+
src: join(FRAMEWORKS_DIR, 'config', name),
|
|
164
|
+
dest: join(ideDir, 'config', name),
|
|
165
|
+
label: `config/${name}`,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
for (const item of items) {
|
|
171
|
+
item.overwrite = await exists(item.dest);
|
|
66
172
|
}
|
|
173
|
+
|
|
174
|
+
return { ideDir, items };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export async function planInstall(options) {
|
|
178
|
+
return buildPlan(options);
|
|
67
179
|
}
|
|
68
180
|
|
|
69
181
|
/**
|
|
@@ -73,81 +185,48 @@ async function exists(path) {
|
|
|
73
185
|
* @param {string} options.cwd - Current working directory
|
|
74
186
|
* @param {'claude'|'cursor'} options.target - Target IDE
|
|
75
187
|
* @param {string[]} options.frameworks - Frameworks to install ('sdd', 'ministack', 'taskcard', 'shared')
|
|
76
|
-
* @
|
|
188
|
+
* @param {(labels: string[]) => Promise<boolean>} [options.confirmOverwrite] - Called when items will be overwritten
|
|
189
|
+
* @returns {Object} Summary of installed items (or { cancelled: true })
|
|
77
190
|
*/
|
|
78
|
-
export async function install({ cwd, target, frameworks }) {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const skillsDir = join(ideDir, 'skills');
|
|
82
|
-
const templatesDir = join(ideDir, 'templates');
|
|
83
|
-
const agentsDir = join(ideDir, 'agents');
|
|
84
|
-
|
|
85
|
-
const summary = { commands: 0, skills: 0, templates: 0, agents: 0, config: 0 };
|
|
86
|
-
|
|
87
|
-
for (const fw of frameworks) {
|
|
88
|
-
const config = FRAMEWORK_MAP[fw];
|
|
89
|
-
if (!config) continue;
|
|
90
|
-
|
|
91
|
-
// Copy commands
|
|
92
|
-
if (fw === 'shared') {
|
|
93
|
-
// Root-level commands (generate-prompt.md, sync-tasks-to-linear.md)
|
|
94
|
-
await mkdir(commandsDir, { recursive: true });
|
|
95
|
-
const srcCmds = join(FRAMEWORKS_DIR, 'commands');
|
|
96
|
-
const entries = await readdir(srcCmds, { withFileTypes: true });
|
|
97
|
-
|
|
98
|
-
for (const entry of entries) {
|
|
99
|
-
if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
100
|
-
const content = await readFile(join(srcCmds, entry.name), 'utf-8');
|
|
101
|
-
const transformed = transformContent(content, target);
|
|
102
|
-
await writeFile(join(commandsDir, entry.name), transformed, 'utf-8');
|
|
103
|
-
summary.commands++;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
191
|
+
export async function install({ cwd, target, frameworks, confirmOverwrite }) {
|
|
192
|
+
const plan = await buildPlan({ cwd, target, frameworks });
|
|
193
|
+
const overwrites = plan.items.filter((i) => i.overwrite);
|
|
106
194
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const tplEntries = await readdir(srcTemplates);
|
|
112
|
-
summary.templates += tplEntries.filter((f) => f.endsWith('.md')).length;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Shared agents
|
|
116
|
-
const srcAgents = join(FRAMEWORKS_DIR, 'agents');
|
|
117
|
-
if (await exists(srcAgents)) {
|
|
118
|
-
await copyDir(srcAgents, agentsDir, target);
|
|
119
|
-
const agentEntries = await readdir(srcAgents);
|
|
120
|
-
summary.agents += agentEntries.filter((f) => f.endsWith('.md')).length;
|
|
121
|
-
}
|
|
195
|
+
if (overwrites.length > 0 && typeof confirmOverwrite === 'function') {
|
|
196
|
+
const ok = await confirmOverwrite(overwrites.map((i) => i.label));
|
|
197
|
+
if (!ok) return { cancelled: true };
|
|
198
|
+
}
|
|
122
199
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
200
|
+
const summary = {
|
|
201
|
+
skills: 0,
|
|
202
|
+
commands: 0,
|
|
203
|
+
templates: 0,
|
|
204
|
+
agents: 0,
|
|
205
|
+
config: 0,
|
|
206
|
+
overwritten: overwrites.length,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
for (const item of plan.items) {
|
|
210
|
+
if (item.kind === 'dir') {
|
|
211
|
+
await copyDir(item.src, item.dest, target);
|
|
132
212
|
} else {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const srcCmdDir = join(FRAMEWORKS_DIR, 'commands', config.commands);
|
|
136
|
-
const destCmdDir = join(commandsDir, config.commands);
|
|
137
|
-
await copyDir(srcCmdDir, destCmdDir, target);
|
|
138
|
-
const entries = await readdir(srcCmdDir);
|
|
139
|
-
summary.commands += entries.filter((f) => f.endsWith('.md')).length;
|
|
140
|
-
}
|
|
213
|
+
await copyFile(item.src, item.dest, target);
|
|
214
|
+
}
|
|
141
215
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
216
|
+
if (item.category === 'skills') {
|
|
217
|
+
summary.skills++;
|
|
218
|
+
} else if (item.category === 'commands') {
|
|
219
|
+
if (item.kind === 'dir') {
|
|
220
|
+
summary.commands += await countMarkdownRecursive(item.src);
|
|
221
|
+
} else {
|
|
222
|
+
summary.commands++;
|
|
150
223
|
}
|
|
224
|
+
} else if (item.category === 'agents') {
|
|
225
|
+
summary.agents++;
|
|
226
|
+
} else if (item.category === 'templates') {
|
|
227
|
+
summary.templates++;
|
|
228
|
+
} else if (item.category === 'config') {
|
|
229
|
+
summary.config++;
|
|
151
230
|
}
|
|
152
231
|
}
|
|
153
232
|
|