sdd-toolkit 1.6.0 → 1.9.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 +262 -62
- package/README.pt.md +320 -121
- package/definitions/{project.yaml → sdd-project.yaml} +32 -12
- package/definitions/sdd.yaml +7 -8
- package/package.json +42 -41
- package/src/index.js +106 -75
- package/src/lib/transformers.js +12 -12
- package/templates/milestones.md +0 -14
- /package/definitions/{coder.yaml → sdd-coder.yaml} +0 -0
- /package/definitions/{feature.yaml → sdd-feature.yaml} +0 -0
- /package/definitions/{log.yaml → sdd-log.yaml} +0 -0
- /package/definitions/{requirements.yaml → sdd-requirements.yaml} +0 -0
- /package/definitions/{review.yaml → sdd-review.yaml} +0 -0
package/src/index.js
CHANGED
|
@@ -71,8 +71,9 @@ async function main() {
|
|
|
71
71
|
if (fs.existsSync(path.join(process.cwd(), '.windsurf'))) tools.push('windsurf');
|
|
72
72
|
if (fs.existsSync(path.join(process.cwd(), '.claude'))) tools.push('claude');
|
|
73
73
|
if (fs.existsSync(path.join(process.cwd(), '.trae'))) tools.push('trae');
|
|
74
|
-
if (fs.existsSync(path.join(process.cwd(), '.
|
|
75
|
-
if (fs.existsSync(path.join(process.cwd(), '.github'))) tools.push('copilot');
|
|
74
|
+
if (fs.existsSync(path.join(process.cwd(), '.kilocode'))) tools.push('kilo');
|
|
75
|
+
if (fs.existsSync(path.join(process.cwd(), '.github'))) tools.push('copilot');
|
|
76
|
+
if (fs.existsSync(path.join(process.cwd(), '.roo'))) tools.push('roo');
|
|
76
77
|
if (fs.existsSync(path.join(process.cwd(), '.opencode'))) tools.push('opencode');
|
|
77
78
|
if (fs.existsSync(path.join(process.cwd(), 'prompts'))) tools.push('web');
|
|
78
79
|
|
|
@@ -135,16 +136,16 @@ async function main() {
|
|
|
135
136
|
message: t('SETUP.TOOL_SELECT'),
|
|
136
137
|
options: [
|
|
137
138
|
{ value: 'gemini', label: t('TOOLS.GEMINI'), hint: '.gemini/commands/dev' },
|
|
138
|
-
{ value: 'roo', label: t('TOOLS.ROO'), hint: '.roo/
|
|
139
|
+
{ value: 'roo', label: t('TOOLS.ROO'), hint: '.roo/commands/*.md' },
|
|
139
140
|
{ value: 'cline', label: t('TOOLS.CLINE'), hint: '.cline/ & custom_modes.json' },
|
|
140
|
-
{ value: 'cursor', label: t('TOOLS.CURSOR'), hint: '.cursor/
|
|
141
|
+
{ value: 'cursor', label: t('TOOLS.CURSOR'), hint: '.cursor/commands/*.mdc' },
|
|
141
142
|
{ value: 'windsurf', label: t('TOOLS.WINDSURF'), hint: '.windsurf/workflows/*.md' },
|
|
142
|
-
{ value: 'claude', label: 'Claude Code', hint: '.claude/commands/
|
|
143
|
+
{ value: 'claude', label: 'Claude Code', hint: '.claude/commands/agents/*.md' },
|
|
143
144
|
{ value: 'trae', label: t('TOOLS.TRAE'), hint: '.trae/instructions.md' },
|
|
144
|
-
{ value: 'kilo', label: t('TOOLS.KILO'), hint: '.
|
|
145
|
-
{ value: 'copilot', label: t('TOOLS.COPILOT'), hint: '.github/
|
|
145
|
+
{ value: 'kilo', label: t('TOOLS.KILO'), hint: '.kilocode/workflows/*.md' },
|
|
146
|
+
{ value: 'copilot', label: t('TOOLS.COPILOT'), hint: '.github/prompts/*.md' },
|
|
146
147
|
{ value: 'web', label: t('TOOLS.WEB'), hint: 'prompts/*.txt' },
|
|
147
|
-
{ value: 'opencode', label: t('TOOLS.OPENCODE'), hint: '.opencode/*.md' }
|
|
148
|
+
{ value: 'opencode', label: t('TOOLS.OPENCODE'), hint: '.opencode/commands/*.md' }
|
|
148
149
|
],
|
|
149
150
|
required: true,
|
|
150
151
|
hint: t('SETUP.TOOL_HINT')
|
|
@@ -192,21 +193,17 @@ async function processAgentsInstallation(tools, options) {
|
|
|
192
193
|
})
|
|
193
194
|
);
|
|
194
195
|
},
|
|
195
|
-
roo: async (validAgents, options) => {
|
|
196
|
-
const targetDir = path.join(process.cwd(), '.roo');
|
|
197
|
-
await fsp.mkdir(targetDir, { recursive: true });
|
|
198
|
-
|
|
199
|
-
await Promise.all(
|
|
200
|
-
validAgents.map((agent) => {
|
|
201
|
-
const md =
|
|
202
|
-
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
203
|
-
})
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
const modes = validAgents.map((agent) => toRooConfig(agent, agent.slug, options));
|
|
207
|
-
const jsonContent = JSON.stringify({ customModes: modes }, null, 2);
|
|
208
|
-
await fsp.writeFile(path.join(process.cwd(), 'roo_custom_modes.json'), jsonContent);
|
|
209
|
-
},
|
|
196
|
+
roo: async (validAgents, options) => {
|
|
197
|
+
const targetDir = path.join(process.cwd(), '.roo', 'commands');
|
|
198
|
+
await fsp.mkdir(targetDir, { recursive: true });
|
|
199
|
+
|
|
200
|
+
await Promise.all(
|
|
201
|
+
validAgents.map((agent) => {
|
|
202
|
+
const md = toOpenCodeAgent(agent, options);
|
|
203
|
+
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
204
|
+
})
|
|
205
|
+
);
|
|
206
|
+
},
|
|
210
207
|
cline: async (validAgents, options) => {
|
|
211
208
|
const targetDir = path.join(process.cwd(), '.cline');
|
|
212
209
|
await fsp.mkdir(targetDir, { recursive: true });
|
|
@@ -233,31 +230,31 @@ async function processAgentsInstallation(tools, options) {
|
|
|
233
230
|
})
|
|
234
231
|
);
|
|
235
232
|
},
|
|
236
|
-
claude: async (validAgents, options) => {
|
|
237
|
-
const targetDir = path.join(process.cwd(), '.claude', 'commands', '
|
|
238
|
-
await fsp.mkdir(targetDir, { recursive: true });
|
|
239
|
-
|
|
240
|
-
await Promise.all(
|
|
241
|
-
validAgents.map((agent) => {
|
|
242
|
-
const md = toClaudeCommand(agent, options);
|
|
243
|
-
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
244
|
-
})
|
|
245
|
-
);
|
|
246
|
-
},
|
|
247
|
-
cursor: async (validAgents, options) => {
|
|
248
|
-
const
|
|
249
|
-
await fsp.mkdir(
|
|
250
|
-
|
|
251
|
-
await Promise.all(
|
|
252
|
-
validAgents.map((agent) => {
|
|
253
|
-
const mdc = toCursorMDC(agent, options);
|
|
254
|
-
return fsp.writeFile(path.join(
|
|
255
|
-
})
|
|
256
|
-
);
|
|
257
|
-
},
|
|
258
|
-
kilo: async (validAgents, options) => {
|
|
259
|
-
const targetDir = path.join(process.cwd(), '.
|
|
260
|
-
await fsp.mkdir(targetDir, { recursive: true });
|
|
233
|
+
claude: async (validAgents, options) => {
|
|
234
|
+
const targetDir = path.join(process.cwd(), '.claude', 'commands', 'agents');
|
|
235
|
+
await fsp.mkdir(targetDir, { recursive: true });
|
|
236
|
+
|
|
237
|
+
await Promise.all(
|
|
238
|
+
validAgents.map((agent) => {
|
|
239
|
+
const md = toClaudeCommand(agent, options);
|
|
240
|
+
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
241
|
+
})
|
|
242
|
+
);
|
|
243
|
+
},
|
|
244
|
+
cursor: async (validAgents, options) => {
|
|
245
|
+
const commandsDir = path.join(process.cwd(), '.cursor', 'commands');
|
|
246
|
+
await fsp.mkdir(commandsDir, { recursive: true });
|
|
247
|
+
|
|
248
|
+
await Promise.all(
|
|
249
|
+
validAgents.map((agent) => {
|
|
250
|
+
const mdc = toCursorMDC(agent, options);
|
|
251
|
+
return fsp.writeFile(path.join(commandsDir, `${agent.slug}.mdc`), mdc);
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
},
|
|
255
|
+
kilo: async (validAgents, options) => {
|
|
256
|
+
const targetDir = path.join(process.cwd(), '.kilocode', 'workflows');
|
|
257
|
+
await fsp.mkdir(targetDir, { recursive: true });
|
|
261
258
|
|
|
262
259
|
await Promise.all(
|
|
263
260
|
validAgents.map((agent) => {
|
|
@@ -266,22 +263,22 @@ async function processAgentsInstallation(tools, options) {
|
|
|
266
263
|
})
|
|
267
264
|
);
|
|
268
265
|
},
|
|
269
|
-
copilot: async (validAgents, options) => {
|
|
270
|
-
const githubDir = path.join(process.cwd(), '.github');
|
|
271
|
-
const
|
|
272
|
-
await fsp.mkdir(
|
|
273
|
-
|
|
274
|
-
await Promise.all(
|
|
275
|
-
validAgents.map((agent) => {
|
|
276
|
-
const md = toCopilotInstructions(agent, options);
|
|
277
|
-
return fsp.writeFile(path.join(
|
|
278
|
-
})
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
const mainAgent = validAgents.find((a) => a.slug.includes('coder')) || validAgents[0];
|
|
282
|
-
const mainInstructions = toCopilotInstructions(mainAgent, options);
|
|
283
|
-
await fsp.writeFile(path.join(githubDir, '
|
|
284
|
-
},
|
|
266
|
+
copilot: async (validAgents, options) => {
|
|
267
|
+
const githubDir = path.join(process.cwd(), '.github');
|
|
268
|
+
const promptsDir = path.join(githubDir, 'prompts');
|
|
269
|
+
await fsp.mkdir(promptsDir, { recursive: true });
|
|
270
|
+
|
|
271
|
+
await Promise.all(
|
|
272
|
+
validAgents.map((agent) => {
|
|
273
|
+
const md = toCopilotInstructions(agent, options);
|
|
274
|
+
return fsp.writeFile(path.join(promptsDir, `${agent.slug}.md`), md);
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
const mainAgent = validAgents.find((a) => a.slug.includes('coder')) || validAgents[0];
|
|
279
|
+
const mainInstructions = toCopilotInstructions(mainAgent, options);
|
|
280
|
+
await fsp.writeFile(path.join(githubDir, 'prompts.md'), mainInstructions);
|
|
281
|
+
},
|
|
285
282
|
trae: async (validAgents, options) => {
|
|
286
283
|
const traeDir = path.join(process.cwd(), '.trae');
|
|
287
284
|
await fsp.mkdir(traeDir, { recursive: true });
|
|
@@ -301,17 +298,51 @@ async function processAgentsInstallation(tools, options) {
|
|
|
301
298
|
})
|
|
302
299
|
);
|
|
303
300
|
},
|
|
304
|
-
opencode: async (validAgents, options) => {
|
|
305
|
-
const targetDir = path.join(process.cwd(), '.opencode', '
|
|
306
|
-
await fsp.mkdir(targetDir, { recursive: true });
|
|
307
|
-
|
|
308
|
-
await Promise.all(
|
|
309
|
-
validAgents.map((agent) => {
|
|
310
|
-
const md = toOpenCodeAgent(agent, options);
|
|
311
|
-
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
312
|
-
})
|
|
313
|
-
);
|
|
314
|
-
|
|
301
|
+
opencode: async (validAgents, options) => {
|
|
302
|
+
const targetDir = path.join(process.cwd(), '.opencode', 'commands');
|
|
303
|
+
await fsp.mkdir(targetDir, { recursive: true });
|
|
304
|
+
|
|
305
|
+
await Promise.all(
|
|
306
|
+
validAgents.map((agent) => {
|
|
307
|
+
const md = toOpenCodeAgent(agent, options);
|
|
308
|
+
return fsp.writeFile(path.join(targetDir, `${agent.slug}.md`), md);
|
|
309
|
+
})
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
// Generate AGENTS.md with interaction rules and agent location
|
|
313
|
+
const agentsMdPath = path.join(process.cwd(), 'AGENTS.md');
|
|
314
|
+
let agentsMdContent = `# Interaction Rules
|
|
315
|
+
|
|
316
|
+
- Always respond to the user in the language they initially interact in; if they interact in English, respond in English, if they interact in Portuguese, respond in Portuguese.
|
|
317
|
+
- If possible, display reasoning in the user's language as well.
|
|
318
|
+
- Be didactic when explaining things, focus on providing complete responses and not just summaries.
|
|
319
|
+
- Whenever possible, provide examples to illustrate concepts.
|
|
320
|
+
|
|
321
|
+
# Allowed Commands
|
|
322
|
+
|
|
323
|
+
- Never execute rm or rm -rf commands without confirming with the user.
|
|
324
|
+
- Whenever possible, use more specific commands instead of generic ones.
|
|
325
|
+
- Be cautious when using commands that may affect critical systems, such as shutdown or reboot.
|
|
326
|
+
- For commands that may affect files or directories, always confirm with the user before executing.
|
|
327
|
+
- Never execute commands that require administrative privileges (sudo, admin) without explicit permission from the user.
|
|
328
|
+
- Avoid running background processes or daemons unless explicitly requested.
|
|
329
|
+
- Be cautious when using commands that alter network settings, firewall configurations, or external connections.
|
|
330
|
+
- Always quote file paths that contain spaces to avoid interpretation errors.
|
|
331
|
+
- For package installation commands (npm install, pip install, etc.), confirm that the user has control over dependencies and versions.
|
|
332
|
+
- Avoid irreversible git operations (such as force push or reset --hard) without confirmation.
|
|
333
|
+
|
|
334
|
+
# Agent Location
|
|
335
|
+
|
|
336
|
+
Custom agents are located in .opencode/commands/`;
|
|
337
|
+
|
|
338
|
+
let userRules = '';
|
|
339
|
+
if (options.globalRules && options.globalRules.trim()) {
|
|
340
|
+
userRules = '\n\n# User Specified Rules\n\n' + options.globalRules.split('\n').filter(line => line.trim()).map(line => '- ' + line.trim()).join('\n');
|
|
341
|
+
}
|
|
342
|
+
agentsMdContent += userRules;
|
|
343
|
+
|
|
344
|
+
await fsp.writeFile(agentsMdPath, agentsMdContent);
|
|
345
|
+
}
|
|
315
346
|
};
|
|
316
347
|
|
|
317
348
|
for (const tool of tools) {
|
package/src/lib/transformers.js
CHANGED
|
@@ -199,18 +199,18 @@ ${allRules.length > 0 ? '## Guidelines\n' + allRules.map(r => `- ${r}`).join('\n
|
|
|
199
199
|
`;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
/**
|
|
203
|
-
* Converte para Claude Code Command (.claude/commands/
|
|
204
|
-
*/
|
|
205
|
-
function toClaudeCommand(agent, options = {}) {
|
|
206
|
-
const languageRule = getLanguageRule(options.locale);
|
|
207
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
208
|
-
|
|
209
|
-
return `---
|
|
210
|
-
name:
|
|
211
|
-
description: ${agent.description || agent.role}
|
|
212
|
-
category:
|
|
213
|
-
---
|
|
202
|
+
/**
|
|
203
|
+
* Converte para Claude Code Command (.claude/commands/agents/*.md)
|
|
204
|
+
*/
|
|
205
|
+
function toClaudeCommand(agent, options = {}) {
|
|
206
|
+
const languageRule = getLanguageRule(options.locale);
|
|
207
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
208
|
+
|
|
209
|
+
return `---
|
|
210
|
+
name: Agent: ${agent.name}
|
|
211
|
+
description: ${agent.description || agent.role}
|
|
212
|
+
category: Agents
|
|
213
|
+
---
|
|
214
214
|
# ${agent.name} ${agent.emoji}
|
|
215
215
|
|
|
216
216
|
Role: ${agent.role}
|
package/templates/milestones.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|