sdd-toolkit 2.1.0 → 3.0.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.
@@ -66,6 +66,32 @@ function toGeminiTOML(agent, options = {}) {
66
66
  return toml;
67
67
  }
68
68
 
69
+ /**
70
+ * Converte para Gemini CLI Skill (.gemini/skills/<name>/SKILL.md)
71
+ * Ref: https://github.com/google-gemini/gemini-cli
72
+ */
73
+ function toGeminiSkill(agent, options = {}) {
74
+ const languageRule = getLanguageRule(options.locale);
75
+ const allRules = [languageRule, ...(agent.rules || [])];
76
+
77
+ // Generate trigger description for Gemini to know when to activate
78
+ const triggerHints = `Use when working on ${agent.role.toLowerCase()} tasks.`;
79
+
80
+ return `---
81
+ name: ${agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')}
82
+ description: ${agent.description || agent.role}. ${triggerHints}
83
+ ---
84
+ # ${agent.name} ${agent.emoji}
85
+
86
+ **Role**: ${agent.role}
87
+
88
+ ## Instructions
89
+ ${agent.systemPrompt.trim()}
90
+
91
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
92
+ `;
93
+ }
94
+
69
95
  /**
70
96
  * Converte para configuração de Custom Mode do Roo Code / Cline (JSON)
71
97
  */
@@ -89,6 +115,34 @@ function toRooConfig(agent, slug, options = {}) {
89
115
  };
90
116
  }
91
117
 
118
+ /**
119
+ * Converte para Roo Code Skill (.roo/skills/<nome>/SKILL.md)
120
+ * Ref: https://docs.roocode.com/features/skills
121
+ */
122
+ function toRooSkill(agent, options = {}) {
123
+ const languageRule = getLanguageRule(options.locale);
124
+ const allRules = [languageRule, ...(agent.rules || [])];
125
+ const skillName = agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
126
+
127
+ return `---
128
+ name: ${skillName}
129
+ description: ${agent.description || agent.role}. Use when working on ${agent.role.toLowerCase()} tasks.
130
+ ---
131
+ # ${agent.name} ${agent.emoji}
132
+
133
+ **Role**: ${agent.role}
134
+
135
+ ## When to Use
136
+ - Use this skill when working on ${agent.role.toLowerCase()} tasks
137
+ - This skill is helpful for ${agent.description || agent.role}
138
+
139
+ ## Instructions
140
+ ${agent.systemPrompt.trim()}
141
+
142
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
143
+ `;
144
+ }
145
+
92
146
  /**
93
147
  * Converte para Markdown do Kilo Code
94
148
  */
@@ -113,6 +167,30 @@ function toKiloMarkdown(agent, options = {}) {
113
167
  return parts.join('\n');
114
168
  }
115
169
 
170
+ /**
171
+ * Converte para Kilo Code Skill (.kilocode/skills/<name>/SKILL.md)
172
+ * Ref: https://kilo.ai/docs/skills
173
+ */
174
+ function toKiloSkill(agent, options = {}) {
175
+ const languageRule = getLanguageRule(options.locale);
176
+ const allRules = [languageRule, ...(agent.rules || [])];
177
+ const skillName = agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
178
+
179
+ return `---
180
+ name: ${skillName}
181
+ description: ${agent.description || agent.role}. Use when working on ${agent.role.toLowerCase()} tasks.
182
+ ---
183
+ # ${agent.name} ${agent.emoji}
184
+
185
+ **Role**: ${agent.role}
186
+
187
+ ## Instructions
188
+ ${agent.systemPrompt.trim()}
189
+
190
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
191
+ `;
192
+ }
193
+
116
194
  /**
117
195
  * Converte para Instruções do GitHub Copilot (.github/copilot-instructions.md)
118
196
  */
@@ -174,6 +252,34 @@ ${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') :
174
252
  `;
175
253
  }
176
254
 
255
+ /**
256
+ * Converte para Cursor Skill (.cursor/skills/<nome>/SKILL.md)
257
+ * Formato oficial: https://cursor.com/docs/context/skills
258
+ */
259
+ function toCursorSkill(agent, options = {}) {
260
+ const languageRule = getLanguageRule(options.locale);
261
+ const allRules = [languageRule, ...(agent.rules || [])];
262
+ const skillName = agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
263
+
264
+ return `---
265
+ name: ${skillName}
266
+ description: ${agent.description || agent.role}. Use when working on ${agent.role.toLowerCase()} tasks.
267
+ ---
268
+ # ${agent.name} ${agent.emoji}
269
+
270
+ **Role**: ${agent.role}
271
+
272
+ ## When to Use
273
+ - Use this skill when working on ${agent.role.toLowerCase()} tasks
274
+ - This skill is helpful for ${agent.description || agent.role}
275
+
276
+ ## Instructions
277
+ ${agent.systemPrompt.trim()}
278
+
279
+ ${allRules.length > 0 ? '## Rules & Guidelines\\n' + allRules.map(r => `- ${r}`).join('\\n') : ''}
280
+ `;
281
+ }
282
+
177
283
  /**
178
284
  * Converte para Windsurf Workflow (.windsurf/workflows/*.md)
179
285
  * Cascade reconhece esses arquivos como comandos de workflow
@@ -216,6 +322,60 @@ ${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') :
216
322
  `;
217
323
  }
218
324
 
325
+ /**
326
+ * Converte para Claude Code Skill (.claude/skills/<name>/SKILL.md)
327
+ * Ref: https://docs.anthropic.com/en/docs/claude-code/skills
328
+ */
329
+ function toClaudeSkill(agent, options = {}) {
330
+ const languageRule = getLanguageRule(options.locale);
331
+ const allRules = [languageRule, ...(agent.rules || [])];
332
+ const skillName = agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
333
+
334
+ return `---
335
+ name: ${skillName}
336
+ description: ${agent.description || agent.role}. Use when working on ${agent.role.toLowerCase()} tasks.
337
+ ---
338
+ # ${agent.name} ${agent.emoji}
339
+
340
+ **Role**: ${agent.role}
341
+
342
+ ## Instructions
343
+ ${agent.systemPrompt.trim()}
344
+
345
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
346
+ `;
347
+ }
348
+
349
+ /**
350
+ * Converte para Claude Code Subagent (.claude/agents/<name>.md)
351
+ * Ref: https://docs.anthropic.com/en/docs/claude-code/sub-agents
352
+ */
353
+ function toClaudeSubagent(agent, options = {}) {
354
+ const languageRule = getLanguageRule(options.locale);
355
+ const allRules = [languageRule, ...(agent.rules || [])];
356
+
357
+ // Determine tool permissions based on agent role
358
+ const roleLower = (agent.slug || '').toLowerCase();
359
+ const isReadOnly = roleLower.includes('review') || roleLower.includes('security') || roleLower.includes('qa');
360
+ const tools = isReadOnly ? 'Read, Glob, Grep' : 'Read, Edit, Write, Bash';
361
+
362
+ return `---
363
+ name: ${agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')}
364
+ description: ${agent.description || agent.role}
365
+ tools: ${tools}
366
+ model: sonnet
367
+ ---
368
+ # ${agent.name} ${agent.emoji}
369
+
370
+ **Role**: ${agent.role}
371
+
372
+ ## Instructions
373
+ ${agent.systemPrompt.trim()}
374
+
375
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
376
+ `;
377
+ }
378
+
219
379
  /**
220
380
  * Converte para System Prompt Puro (OpenAI/Claude/Web)
221
381
  */
@@ -304,15 +464,79 @@ ${allRules.length > 0 ? '## Constraints\n' + allRules.map(r => `- ${r}`).join('\
304
464
 
305
465
 
306
466
  /**
307
- * Converte para Antigravity Skill (SKILL.md)
467
+ * Converte para Antigravity Skill (.agent/skills/<nome>/SKILL.md)
468
+ * Ref: https://antigravity.google/docs/skills
308
469
  */
309
470
  function toAntigravitySkill(agent, options = {}) {
310
471
  const languageRule = getLanguageRule(options.locale);
311
472
  const allRules = [languageRule, ...(agent.rules || [])];
473
+ const skillName = agent.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
474
+
475
+ return `---
476
+ name: ${skillName}
477
+ description: ${agent.description || agent.role}. Use when working on ${agent.role.toLowerCase()} tasks.
478
+ ---
479
+ # ${agent.name} ${agent.emoji}
480
+
481
+ **Role**: ${agent.role}
482
+
483
+ ## When to Use
484
+ - Use this skill when working on ${agent.role.toLowerCase()} tasks
485
+ - This skill is helpful for ${agent.description || agent.role}
486
+
487
+ ## Instructions
488
+ ${agent.systemPrompt.trim()}
489
+
490
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
491
+ `;
492
+ }
493
+
494
+ /**
495
+ * Converte para Antigravity Workflow (.agent/workflows/<nome>.md)
496
+ * Workflows são invocáveis via /workflow-name
497
+ * Ref: https://antigravity.google/docs/rules-workflows
498
+ */
499
+ function toAntigravityWorkflow(agent, options = {}) {
500
+ const languageRule = getLanguageRule(options.locale);
501
+ const allRules = [languageRule, ...(agent.rules || [])];
502
+
503
+ return `# ${agent.name} ${agent.emoji}
504
+
505
+ ${agent.description || agent.role}
506
+
507
+ ## Steps
508
+
509
+ 1. **Understand the Context**: Review the current codebase and requirements
510
+ 2. **Apply Role**: Act as ${agent.role}
511
+ 3. **Follow Instructions**: Execute according to the guidelines below
512
+
513
+ ## Instructions
514
+
515
+ ${agent.systemPrompt.trim()}
516
+
517
+ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
518
+ `;
519
+ }
520
+
521
+ /**
522
+ * Converte para OpenCode Subagent (.opencode/agents/*.md)
523
+ * Ref: https://opencode.ai/docs/agents
524
+ */
525
+ function toOpenCodeSubagent(agent, options = {}) {
526
+ const languageRule = getLanguageRule(options.locale);
527
+ const allRules = [languageRule, ...(agent.rules || [])];
528
+
529
+ // Determine tool permissions based on agent role
530
+ const roleLower = (agent.slug || '').toLowerCase();
531
+ const isReadOnly = roleLower.includes('review') || roleLower.includes('security') || roleLower.includes('qa');
312
532
 
313
533
  return `---
314
- name: ${agent.name}
315
534
  description: ${agent.description || agent.role}
535
+ mode: subagent
536
+ tools:
537
+ write: ${!isReadOnly}
538
+ edit: ${!isReadOnly}
539
+ bash: ${!isReadOnly}
316
540
  ---
317
541
  # ${agent.name} ${agent.emoji}
318
542
 
@@ -327,14 +551,22 @@ ${allRules.length > 0 ? '## Rules & Guidelines\n' + allRules.map(r => `- ${r}`).
327
551
 
328
552
  module.exports = {
329
553
  toGeminiTOML,
554
+ toGeminiSkill,
330
555
  toRooConfig,
556
+ toRooSkill,
331
557
  toKiloMarkdown,
558
+ toKiloSkill,
332
559
  toCopilotInstructions,
333
560
  toCursorMDC,
561
+ toCursorSkill,
334
562
  toWindsurfRules,
335
563
  toClaudeCommand,
564
+ toClaudeSkill,
565
+ toClaudeSubagent,
336
566
  toPlainSystemPrompt,
337
567
  toOpenCodeSkill,
568
+ toOpenCodeSubagent,
338
569
  toTraeRules,
339
- toAntigravitySkill
570
+ toAntigravitySkill,
571
+ toAntigravityWorkflow
340
572
  };
@@ -1,29 +0,0 @@
1
- name: SDD Helper
2
- role: Agent Access Gateway
3
- emoji: 🔑
4
- systemPrompt: |
5
- # Identity
6
- You are the **SDD Helper** 🔑, providing quick access to all installed agents.
7
-
8
- # Core Instructions
9
- You are the central hub for accessing SDD Toolkit agents. When activated via "/sdd", provide an overview of available agents and how to use them.
10
-
11
- ## Available Agents
12
- - **/sdd.project**: Project Architect 🏛️ - Defines project scope and vision.
13
- - **/sdd.requirements**: Requirements Engineer 🔍 - Analyzes stack and technical requirements.
14
- - **/sdd.feature**: Feature Manager ✨ - Manages features, milestones, and tasks.
15
- - **/sdd.coder**: Coder 💻 - Implements code following SOLID principles.
16
- - **/sdd.review**: QA Engineer 🔍 - Reviews and validates code quality.
17
- - **/sdd.log**: Release Manager 📦 - Consolidates logs and manages changelog.
18
-
19
- ## Usage
20
- - Type "/sdd" to see this help.
21
- - Type "/<agent>" to activate a specific agent (e.g., "/project" for Project Architect).
22
- - For workflows: Use "/flow:debug", "/flow:tdd", "/flow:refactor", etc., within the coding context.
23
-
24
- Always respond in the user's language. If no specific command is given, display this help.
25
-
26
- rules:
27
- - "Respond in the user's language (English by default)."
28
- - "Provide concise, actionable guidance."
29
- - "Do not execute code or make changes; only guide access."