sdd-flow-kit 1.0.1 → 1.0.2
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/dist/steps/setupProject.js +22 -8
- package/package.json +1 -1
|
@@ -160,13 +160,28 @@ function skillInstallPath(projectRoot, agent) {
|
|
|
160
160
|
return null;
|
|
161
161
|
return node_path_1.default.join(projectRoot, rel);
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
163
|
+
function allSkillInstallPaths(projectRoot) {
|
|
164
|
+
const agents = ["cursor", "claude-code", "codex", "openclaw"];
|
|
165
|
+
return agents
|
|
166
|
+
.map((agent) => skillInstallPath(projectRoot, agent))
|
|
167
|
+
.filter((p) => Boolean(p));
|
|
168
|
+
}
|
|
169
|
+
async function installAgentSkill(projectRoot) {
|
|
170
|
+
const targets = allSkillInstallPaths(projectRoot);
|
|
171
|
+
if (targets.length === 0)
|
|
166
172
|
return;
|
|
167
173
|
const template = await (0, templates_1.loadTemplateText)("artifacts/06-agent-skill.template.md");
|
|
168
|
-
const
|
|
169
|
-
|
|
174
|
+
for (const target of targets) {
|
|
175
|
+
const agentName = target.includes("/.cursor/")
|
|
176
|
+
? "cursor"
|
|
177
|
+
: target.includes("/.claude/")
|
|
178
|
+
? "claude-code"
|
|
179
|
+
: target.includes("/.codex/")
|
|
180
|
+
? "codex"
|
|
181
|
+
: "openclaw";
|
|
182
|
+
const content = template.replaceAll("{{AGENT_NAME}}", agentName);
|
|
183
|
+
await (0, fs_1.writeTextFileEnsuredDir)(target, content);
|
|
184
|
+
}
|
|
170
185
|
}
|
|
171
186
|
function renderVars(template, vars) {
|
|
172
187
|
let out = template;
|
|
@@ -249,15 +264,14 @@ async function setupProject(options) {
|
|
|
249
264
|
plannedActions.push("environment already ready, no setup needed");
|
|
250
265
|
}
|
|
251
266
|
if (options.dryRun) {
|
|
252
|
-
const skillPath
|
|
253
|
-
if (skillPath) {
|
|
267
|
+
for (const skillPath of allSkillInstallPaths(options.projectRoot)) {
|
|
254
268
|
plannedActions.push(`would install skill: ${skillPath}`);
|
|
255
269
|
}
|
|
256
270
|
const { dir } = docSkillDirName(selectedKind);
|
|
257
271
|
plannedActions.push(`would install docs skill: ${node_path_1.default.join(options.projectRoot, "docs", dir)}`);
|
|
258
272
|
}
|
|
259
273
|
else {
|
|
260
|
-
await installAgentSkill(options.projectRoot
|
|
274
|
+
await installAgentSkill(options.projectRoot);
|
|
261
275
|
skillInstalled = true;
|
|
262
276
|
await installDocsSkill(options.projectRoot, selectedKind);
|
|
263
277
|
docsSkillInstalled = true;
|