sdd-toolkit 1.5.0 → 1.6.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 +139 -155
- package/README.pt.md +135 -0
- package/definitions/{dev.coder.yaml → coder.yaml} +15 -22
- package/definitions/feature.yaml +74 -0
- package/definitions/log.yaml +61 -0
- package/definitions/project.yaml +108 -0
- package/definitions/requirements.yaml +71 -0
- package/definitions/review.yaml +88 -0
- package/definitions/sdd.yaml +30 -0
- package/package.json +1 -1
- package/src/commands/view.js +18 -0
- package/src/index.js +335 -284
- package/src/lib/agents.js +1 -1
- package/src/lib/dashboard.js +188 -0
- package/src/lib/docs.js +2 -1
- package/src/lib/messages.js +57 -9
- package/src/lib/transformers.js +332 -246
- package/src/scripts/archive.js +5 -5
- package/src/scripts/reset.js +4 -4
- package/src/scripts/status.js +7 -7
- package/templates/milestones.md +1 -1
- package/definitions/dev.auditor.yaml +0 -66
- package/definitions/dev.feature.yaml +0 -105
- package/definitions/dev.log.yaml +0 -90
- package/definitions/dev.milestone.yaml +0 -75
- package/definitions/dev.ops.yaml +0 -51
- package/definitions/dev.project.yaml +0 -106
- package/definitions/dev.requirements.yaml +0 -91
- package/definitions/dev.review.yaml +0 -61
- package/definitions/dev.tasks.yaml +0 -84
package/src/lib/transformers.js
CHANGED
|
@@ -1,246 +1,332 @@
|
|
|
1
|
-
const { TRANSLATIONS } = require('./messages');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the language rule based on the locale
|
|
5
|
-
* @param {string} locale - 'en', 'pt-br', 'es', etc.
|
|
6
|
-
*/
|
|
7
|
-
function getLanguageRule(locale = 'en') {
|
|
8
|
-
const normalized = locale.toLowerCase().replace('-', '_');
|
|
9
|
-
|
|
10
|
-
// Mapping locale slug to property key in messages
|
|
11
|
-
const keyMap = {
|
|
12
|
-
'en': 'EN',
|
|
13
|
-
'pt_br': 'PT_BR',
|
|
14
|
-
'es': 'ES'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const ruleKey = keyMap[normalized] || 'EN';
|
|
18
|
-
|
|
19
|
-
// Get dictionary for the target locale or fallback to EN
|
|
20
|
-
const dict = TRANSLATIONS[normalized] || TRANSLATIONS['en'];
|
|
21
|
-
|
|
22
|
-
return dict.LANGUAGE_RULES[ruleKey];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Converte definição do agente para TOML do Gemini CLI
|
|
27
|
-
*/
|
|
28
|
-
function toGeminiTOML(agent, options = {}) {
|
|
29
|
-
const languageRule = getLanguageRule(options.locale);
|
|
30
|
-
// Escapa aspas duplas na descrição
|
|
31
|
-
const description = (agent.description || agent.role).replace(/"/g, '
|
|
32
|
-
|
|
33
|
-
// Constrói o prompt completo
|
|
34
|
-
const parts = [
|
|
35
|
-
`# Identity`,
|
|
36
|
-
`You are **${agent.name}** ${agent.emoji}`,
|
|
37
|
-
`Role: ${agent.role}\n`,
|
|
38
|
-
`# Core Instructions`,
|
|
39
|
-
agent.systemPrompt.trim(),
|
|
40
|
-
'\n'
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
44
|
-
|
|
45
|
-
if (allRules.length > 0) {
|
|
46
|
-
parts.push(`# Rules & Guidelines`);
|
|
47
|
-
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
48
|
-
parts.push('\n');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const fullPrompt = parts.join('\n');
|
|
52
|
-
|
|
53
|
-
// Escapa aspas triplas para o bloco multilinha TOML
|
|
54
|
-
const escapedPrompt = fullPrompt.replace(/"""/g, '
|
|
55
|
-
|
|
56
|
-
// Monta o TOML final
|
|
57
|
-
let toml = `description = "${description}"\n`;
|
|
58
|
-
toml += `prompt = """\n${escapedPrompt}\n"""\n`;
|
|
59
|
-
|
|
60
|
-
// Mantém rules como array separado se a ferramenta suportar (Gemini CLI suporta)
|
|
61
|
-
if (allRules.length > 0) {
|
|
62
|
-
toml += 'rules = [\n';
|
|
63
|
-
allRules.forEach(rule => {
|
|
64
|
-
const escaped = rule.replace(/\\/g, '\\\\').replace(/"/g, '
|
|
65
|
-
toml += ` "${escaped}",\n`;
|
|
66
|
-
});
|
|
67
|
-
toml += ']\n';
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return toml;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Converte para configuração de Custom Mode do Roo Code / Cline (JSON)
|
|
75
|
-
*/
|
|
76
|
-
function toRooConfig(agent, slug, options = {}) {
|
|
77
|
-
const languageRule = getLanguageRule(options.locale);
|
|
78
|
-
const promptParts = [
|
|
79
|
-
`# ${agent.name} (${agent.role})`,
|
|
80
|
-
`\n${agent.systemPrompt.trim()}\n`
|
|
81
|
-
];
|
|
82
|
-
|
|
83
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
84
|
-
|
|
85
|
-
if (allRules.length > 0) {
|
|
86
|
-
promptParts.push(`## Rules & Guidelines`);
|
|
87
|
-
allRules.forEach(rule => promptParts.push(`- ${rule}`));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
slug: slug,
|
|
92
|
-
name: `${agent.emoji} ${agent.name}`,
|
|
93
|
-
roleDefinition: promptParts.join('\n'),
|
|
94
|
-
groups: ["read", "edit", "browser", "command", "mcp"]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Converte para Markdown do Kilo Code
|
|
100
|
-
*/
|
|
101
|
-
function toKiloMarkdown(agent, options = {}) {
|
|
102
|
-
const languageRule = getLanguageRule(options.locale);
|
|
103
|
-
const parts = [
|
|
104
|
-
`<!--- Kilo Code Agent Config --->`,
|
|
105
|
-
`# ${agent.name} ${agent.emoji}`,
|
|
106
|
-
`**Role**: ${agent.role}\n`,
|
|
107
|
-
`## Instructions`,
|
|
108
|
-
agent.systemPrompt.trim(),
|
|
109
|
-
'\n'
|
|
110
|
-
];
|
|
111
|
-
|
|
112
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
113
|
-
|
|
114
|
-
if (allRules.length > 0) {
|
|
115
|
-
parts.push(`## Constraints`);
|
|
116
|
-
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return parts.join('\n');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Converte para Instruções do GitHub Copilot (.github/copilot-instructions.md)
|
|
124
|
-
*/
|
|
125
|
-
function toCopilotInstructions(agent, options = {}) {
|
|
126
|
-
const languageRule = getLanguageRule(options.locale);
|
|
127
|
-
const parts = [
|
|
128
|
-
`<!-- GitHub Copilot Instructions for ${agent.name} -->`,
|
|
129
|
-
`# Identity and Role`,
|
|
130
|
-
`You are **${agent.name}** ${agent.emoji}.`,
|
|
131
|
-
`**Role**: ${agent.role}`,
|
|
132
|
-
`\n## Core Instructions`,
|
|
133
|
-
agent.systemPrompt.trim(),
|
|
134
|
-
'\n'
|
|
135
|
-
];
|
|
136
|
-
|
|
137
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
138
|
-
|
|
139
|
-
if (allRules.length > 0) {
|
|
140
|
-
parts.push(`## Rules & Guidelines`);
|
|
141
|
-
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Adiciona uma seção de estilo de resposta para garantir conformidade
|
|
145
|
-
parts.push(`\n## Response Style`);
|
|
146
|
-
parts.push(`- Be concise and objective.`);
|
|
147
|
-
parts.push(`- Follow the project conventions defined in the workspace.`);
|
|
148
|
-
|
|
149
|
-
return parts.join('\n');
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Converte para Cursor Rules (.mdc)
|
|
154
|
-
* Inclui Frontmatter para Contexto
|
|
155
|
-
*/
|
|
156
|
-
function toCursorMDC(agent, options = {}) {
|
|
157
|
-
const languageRule = getLanguageRule(options.locale);
|
|
158
|
-
// Tenta inferir globs baseados no papel do agente
|
|
159
|
-
let globs = "*";
|
|
160
|
-
const roleLower = agent.slug.toLowerCase();
|
|
161
|
-
|
|
162
|
-
if (roleLower.includes('test') || roleLower.includes('qa')) globs = "*.test.*, *.spec.*, **/tests/**";
|
|
163
|
-
if (roleLower.includes('css') || roleLower.includes('style')) globs = "*.css, *.scss, *.tailwind";
|
|
164
|
-
if (roleLower.includes('sql') || roleLower.includes('db')) globs = "*.sql, *.prisma, *.schema";
|
|
165
|
-
|
|
166
|
-
const allRules = [languageRule, ...(agent.rules || [])];
|
|
167
|
-
|
|
168
|
-
return `---
|
|
169
|
-
description: ${agent.description || agent.role}
|
|
170
|
-
globs: ${globs}
|
|
171
|
-
---
|
|
172
|
-
# ${agent.name} ${agent.emoji}
|
|
173
|
-
|
|
174
|
-
Role: ${agent.role}
|
|
175
|
-
|
|
176
|
-
## Instructions
|
|
177
|
-
${agent.systemPrompt.trim()}
|
|
178
|
-
|
|
179
|
-
${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
180
|
-
`;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Converte para Windsurf (.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
${
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
1
|
+
const { TRANSLATIONS } = require('./messages');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns the language rule based on the locale
|
|
5
|
+
* @param {string} locale - 'en', 'pt-br', 'es', etc.
|
|
6
|
+
*/
|
|
7
|
+
function getLanguageRule(locale = 'en') {
|
|
8
|
+
const normalized = locale.toLowerCase().replace('-', '_');
|
|
9
|
+
|
|
10
|
+
// Mapping locale slug to property key in messages
|
|
11
|
+
const keyMap = {
|
|
12
|
+
'en': 'EN',
|
|
13
|
+
'pt_br': 'PT_BR',
|
|
14
|
+
'es': 'ES'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const ruleKey = keyMap[normalized] || 'EN';
|
|
18
|
+
|
|
19
|
+
// Get dictionary for the target locale or fallback to EN
|
|
20
|
+
const dict = TRANSLATIONS[normalized] || TRANSLATIONS['en'];
|
|
21
|
+
|
|
22
|
+
return dict.LANGUAGE_RULES[ruleKey];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Converte definição do agente para TOML do Gemini CLI
|
|
27
|
+
*/
|
|
28
|
+
function toGeminiTOML(agent, options = {}) {
|
|
29
|
+
const languageRule = getLanguageRule(options.locale);
|
|
30
|
+
// Escapa aspas duplas na descrição
|
|
31
|
+
const description = (agent.description || agent.role).replace(/"/g, '\"');
|
|
32
|
+
|
|
33
|
+
// Constrói o prompt completo
|
|
34
|
+
const parts = [
|
|
35
|
+
`# Identity`,
|
|
36
|
+
`You are **${agent.name}** ${agent.emoji}`,
|
|
37
|
+
`Role: ${agent.role}\n`,
|
|
38
|
+
`# Core Instructions`,
|
|
39
|
+
agent.systemPrompt.trim(),
|
|
40
|
+
'\n'
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
44
|
+
|
|
45
|
+
if (allRules.length > 0) {
|
|
46
|
+
parts.push(`# Rules & Guidelines`);
|
|
47
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
48
|
+
parts.push('\n');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const fullPrompt = parts.join('\n');
|
|
52
|
+
|
|
53
|
+
// Escapa aspas triplas para o bloco multilinha TOML
|
|
54
|
+
const escapedPrompt = fullPrompt.replace(/"""/g, '\"\"\"');
|
|
55
|
+
|
|
56
|
+
// Monta o TOML final
|
|
57
|
+
let toml = `description = "${description}"\n`;
|
|
58
|
+
toml += `prompt = """\n${escapedPrompt}\n"""\n`;
|
|
59
|
+
|
|
60
|
+
// Mantém rules como array separado se a ferramenta suportar (Gemini CLI suporta)
|
|
61
|
+
if (allRules.length > 0) {
|
|
62
|
+
toml += 'rules = [\n';
|
|
63
|
+
allRules.forEach(rule => {
|
|
64
|
+
const escaped = rule.replace(/\\/g, '\\\\').replace(/"/g, '\"');
|
|
65
|
+
toml += ` "${escaped}",\n`;
|
|
66
|
+
});
|
|
67
|
+
toml += ']\n';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return toml;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Converte para configuração de Custom Mode do Roo Code / Cline (JSON)
|
|
75
|
+
*/
|
|
76
|
+
function toRooConfig(agent, slug, options = {}) {
|
|
77
|
+
const languageRule = getLanguageRule(options.locale);
|
|
78
|
+
const promptParts = [
|
|
79
|
+
`# ${agent.name} (${agent.role})`,
|
|
80
|
+
`\n${agent.systemPrompt.trim()}\n`
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
84
|
+
|
|
85
|
+
if (allRules.length > 0) {
|
|
86
|
+
promptParts.push(`## Rules & Guidelines`);
|
|
87
|
+
allRules.forEach(rule => promptParts.push(`- ${rule}`));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
slug: slug,
|
|
92
|
+
name: `${agent.emoji} ${agent.name}`,
|
|
93
|
+
roleDefinition: promptParts.join('\n'),
|
|
94
|
+
groups: ["read", "edit", "browser", "command", "mcp"]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Converte para Markdown do Kilo Code
|
|
100
|
+
*/
|
|
101
|
+
function toKiloMarkdown(agent, options = {}) {
|
|
102
|
+
const languageRule = getLanguageRule(options.locale);
|
|
103
|
+
const parts = [
|
|
104
|
+
`<!--- Kilo Code Agent Config --->`,
|
|
105
|
+
`# ${agent.name} ${agent.emoji}`,
|
|
106
|
+
`**Role**: ${agent.role}\n`,
|
|
107
|
+
`## Instructions`,
|
|
108
|
+
agent.systemPrompt.trim(),
|
|
109
|
+
'\n'
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
113
|
+
|
|
114
|
+
if (allRules.length > 0) {
|
|
115
|
+
parts.push(`## Constraints`);
|
|
116
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return parts.join('\n');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Converte para Instruções do GitHub Copilot (.github/copilot-instructions.md)
|
|
124
|
+
*/
|
|
125
|
+
function toCopilotInstructions(agent, options = {}) {
|
|
126
|
+
const languageRule = getLanguageRule(options.locale);
|
|
127
|
+
const parts = [
|
|
128
|
+
`<!-- GitHub Copilot Instructions for ${agent.name} -->`,
|
|
129
|
+
`# Identity and Role`,
|
|
130
|
+
`You are **${agent.name}** ${agent.emoji}.`,
|
|
131
|
+
`**Role**: ${agent.role}`,
|
|
132
|
+
`\n## Core Instructions`,
|
|
133
|
+
agent.systemPrompt.trim(),
|
|
134
|
+
'\n'
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
138
|
+
|
|
139
|
+
if (allRules.length > 0) {
|
|
140
|
+
parts.push(`## Rules & Guidelines`);
|
|
141
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Adiciona uma seção de estilo de resposta para garantir conformidade
|
|
145
|
+
parts.push(`\n## Response Style`);
|
|
146
|
+
parts.push(`- Be concise and objective.`);
|
|
147
|
+
parts.push(`- Follow the project conventions defined in the workspace.`);
|
|
148
|
+
|
|
149
|
+
return parts.join('\n');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Converte para Cursor Rules (.mdc)
|
|
154
|
+
* Inclui Frontmatter para Contexto
|
|
155
|
+
*/
|
|
156
|
+
function toCursorMDC(agent, options = {}) {
|
|
157
|
+
const languageRule = getLanguageRule(options.locale);
|
|
158
|
+
// Tenta inferir globs baseados no papel do agente
|
|
159
|
+
let globs = "*";
|
|
160
|
+
const roleLower = agent.slug.toLowerCase();
|
|
161
|
+
|
|
162
|
+
if (roleLower.includes('test') || roleLower.includes('qa')) globs = "*.test.*, *.spec.*, **/tests/**";
|
|
163
|
+
if (roleLower.includes('css') || roleLower.includes('style')) globs = "*.css, *.scss, *.tailwind";
|
|
164
|
+
if (roleLower.includes('sql') || roleLower.includes('db')) globs = "*.sql, *.prisma, *.schema";
|
|
165
|
+
|
|
166
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
167
|
+
|
|
168
|
+
return `---
|
|
169
|
+
description: ${agent.description || agent.role}
|
|
170
|
+
globs: ${globs}
|
|
171
|
+
---
|
|
172
|
+
# ${agent.name} ${agent.emoji}
|
|
173
|
+
|
|
174
|
+
Role: ${agent.role}
|
|
175
|
+
|
|
176
|
+
## Instructions
|
|
177
|
+
${agent.systemPrompt.trim()}
|
|
178
|
+
|
|
179
|
+
${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Converte para Windsurf Workflow (.windsurf/workflows/*.md)
|
|
185
|
+
* Cascade reconhece esses arquivos como comandos de workflow
|
|
186
|
+
*/
|
|
187
|
+
function toWindsurfRules(agent, options = {}) {
|
|
188
|
+
const languageRule = getLanguageRule(options.locale);
|
|
189
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
190
|
+
|
|
191
|
+
return `# ${agent.name} ${agent.emoji} Rules
|
|
192
|
+
|
|
193
|
+
Role: ${agent.role}
|
|
194
|
+
|
|
195
|
+
## Core Logic
|
|
196
|
+
${agent.systemPrompt.trim()}
|
|
197
|
+
|
|
198
|
+
${allRules.length > 0 ? '## Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Converte para Claude Code Command (.claude/commands/openspec/*.md)
|
|
204
|
+
*/
|
|
205
|
+
function toClaudeCommand(agent, options = {}) {
|
|
206
|
+
const languageRule = getLanguageRule(options.locale);
|
|
207
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
208
|
+
|
|
209
|
+
return `---
|
|
210
|
+
name: OpenSpec: ${agent.name}
|
|
211
|
+
description: ${agent.description || agent.role}
|
|
212
|
+
category: OpenSpec
|
|
213
|
+
---
|
|
214
|
+
# ${agent.name} ${agent.emoji}
|
|
215
|
+
|
|
216
|
+
Role: ${agent.role}
|
|
217
|
+
|
|
218
|
+
## Instructions
|
|
219
|
+
${agent.systemPrompt.trim()}
|
|
220
|
+
|
|
221
|
+
${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
222
|
+
`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Converte para System Prompt Puro (OpenAI/Claude/Web)
|
|
227
|
+
*/
|
|
228
|
+
function toPlainSystemPrompt(agent, options = {}) {
|
|
229
|
+
const languageRule = getLanguageRule(options.locale);
|
|
230
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
231
|
+
|
|
232
|
+
return `You are ${agent.name} ${agent.emoji}
|
|
233
|
+
Role: ${agent.role}
|
|
234
|
+
|
|
235
|
+
[SYSTEM INSTRUCTIONS]
|
|
236
|
+
${agent.systemPrompt.trim()}
|
|
237
|
+
|
|
238
|
+
${allRules.length > 0 ? '[GUIDELINES]\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
239
|
+
`;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Converte para Trae Instructions
|
|
244
|
+
*/
|
|
245
|
+
function toTraeRules(agent, options = {}) {
|
|
246
|
+
const languageRule = getLanguageRule(options.locale);
|
|
247
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
248
|
+
|
|
249
|
+
return `<!-- Trae Workspace Rules -->
|
|
250
|
+
# ${agent.name} ${agent.emoji}
|
|
251
|
+
|
|
252
|
+
**Role**: ${agent.role}
|
|
253
|
+
|
|
254
|
+
## Context & Instructions
|
|
255
|
+
${agent.systemPrompt.trim()}
|
|
256
|
+
|
|
257
|
+
${allRules.length > 0 ? '## Constraints\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Converte para OpenCode Agent (.opencode/agent/*.md)
|
|
263
|
+
*/
|
|
264
|
+
function toOpenCodeAgent(agent, options = {}) {
|
|
265
|
+
const languageRule = getLanguageRule(options.locale);
|
|
266
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
267
|
+
|
|
268
|
+
// Configurar permissões baseado no tipo de agente
|
|
269
|
+
const isReadOnly = agent.slug.includes('review') || agent.slug.includes('audit') || agent.name.includes('Architect') || agent.role.includes('QA') || agent.role.includes('Review');
|
|
270
|
+
const tools = {
|
|
271
|
+
write: !isReadOnly,
|
|
272
|
+
edit: !isReadOnly,
|
|
273
|
+
bash: !isReadOnly
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const frontmatter = {
|
|
277
|
+
description: agent.description || agent.role,
|
|
278
|
+
mode: 'subagent',
|
|
279
|
+
temperature: 0.3,
|
|
280
|
+
tools
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const frontmatterStr = Object.entries(frontmatter)
|
|
284
|
+
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
285
|
+
.join('\n');
|
|
286
|
+
|
|
287
|
+
return `---
|
|
288
|
+
${frontmatterStr}
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
# ${agent.name} ${agent.emoji}
|
|
292
|
+
|
|
293
|
+
**Role**: ${agent.role}
|
|
294
|
+
|
|
295
|
+
${agent.systemPrompt.trim()}
|
|
296
|
+
|
|
297
|
+
## Rules
|
|
298
|
+
${allRules.map(rule => `- ${rule}`).join('\n')}
|
|
299
|
+
`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Converte para Trae Instructions
|
|
304
|
+
*/
|
|
305
|
+
function toTraeRules(agent, options = {}) {
|
|
306
|
+
const languageRule = getLanguageRule(options.locale);
|
|
307
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
308
|
+
|
|
309
|
+
return `<!-- Trae Workspace Rules -->
|
|
310
|
+
# ${agent.name} ${agent.emoji}
|
|
311
|
+
|
|
312
|
+
**Role**: ${agent.role}
|
|
313
|
+
|
|
314
|
+
## Context & Instructions
|
|
315
|
+
${agent.systemPrompt.trim()}
|
|
316
|
+
|
|
317
|
+
${allRules.length > 0 ? '## Constraints\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
module.exports = {
|
|
322
|
+
toGeminiTOML,
|
|
323
|
+
toRooConfig,
|
|
324
|
+
toKiloMarkdown,
|
|
325
|
+
toCopilotInstructions,
|
|
326
|
+
toCursorMDC,
|
|
327
|
+
toWindsurfRules,
|
|
328
|
+
toClaudeCommand,
|
|
329
|
+
toPlainSystemPrompt,
|
|
330
|
+
toTraeRules,
|
|
331
|
+
toOpenCodeAgent
|
|
332
|
+
};
|
package/src/scripts/archive.js
CHANGED
|
@@ -2,11 +2,11 @@ const fs = require('fs');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const readline = require('readline');
|
|
4
4
|
|
|
5
|
-
const docsDir = path.join(process.cwd(), '
|
|
5
|
+
const docsDir = path.join(process.cwd(), '.sdd-toolkit');
|
|
6
6
|
const archiveDir = path.join(docsDir, 'archive');
|
|
7
7
|
|
|
8
8
|
// Files to archive (Ephemeral context)
|
|
9
|
-
const filesToArchive = ['
|
|
9
|
+
const filesToArchive = ['project.md', 'task.md', 'audit_report.md', 'requirements.md', 'milestones.md'];
|
|
10
10
|
|
|
11
11
|
// Files to keep (Long-term context)
|
|
12
12
|
// - guidelines.md (Laws)
|
|
@@ -19,7 +19,7 @@ const rl = readline.createInterface({
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
console.log('📦 SDD SESSION ARCHIVER');
|
|
22
|
-
console.log('This will move current Spec, Plan, and Audit reports to
|
|
22
|
+
console.log('This will move current Spec, Plan, and Audit reports to .sdd-toolkit/archive/.');
|
|
23
23
|
console.log('Your Work Log and Context will remain untouched.\n');
|
|
24
24
|
|
|
25
25
|
// Check if there is anything to archive
|
|
@@ -40,7 +40,7 @@ rl.question('Enter a name for this feature/session (e.g., "auth-system"): ', (na
|
|
|
40
40
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
console.log(`\nMoving files to:
|
|
43
|
+
console.log(`\nMoving files to: .sdd-toolkit/archive/${folderName}/
|
|
44
44
|
`);
|
|
45
45
|
|
|
46
46
|
existingFiles.forEach(file => {
|
|
@@ -51,6 +51,6 @@ rl.question('Enter a name for this feature/session (e.g., "auth-system"): ', (na
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
console.log('\n✅ Session archived successfully!');
|
|
54
|
-
console.log('You are ready to start a new feature with /
|
|
54
|
+
console.log('You are ready to start a new feature with /spec');
|
|
55
55
|
rl.close();
|
|
56
56
|
});
|
package/src/scripts/reset.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const docsDir = path.join(process.cwd(), '
|
|
4
|
+
const docsDir = path.join(process.cwd(), '.sdd-toolkit');
|
|
5
5
|
|
|
6
6
|
console.log('⚠️ WARNING: This will wipe all documentation (Spec, Plan, Context).');
|
|
7
7
|
console.log('Your source code (src/) will NOT be touched.');
|
|
8
8
|
console.log('Are you sure? (Run with --force to execute)');
|
|
9
9
|
|
|
10
10
|
if (process.argv.includes('--force')) {
|
|
11
|
-
['
|
|
11
|
+
['project.md', 'task.md', 'requirements.md', 'milestones.md', 'guidelines.md', 'audit_report.md'].forEach(file => {
|
|
12
12
|
const p = path.join(docsDir, file);
|
|
13
13
|
if (fs.existsSync(p)) {
|
|
14
14
|
fs.unlinkSync(p);
|
|
15
|
-
console.log(`Deleted:
|
|
15
|
+
console.log(`Deleted: .sdd-toolkit/${file}`);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
console.log('✅ Wipe complete. You can start fresh with /
|
|
18
|
+
console.log('✅ Wipe complete. You can start fresh with /explore');
|
|
19
19
|
}
|