sdd-toolkit 1.9.2 → 2.0.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/definitions/sdd-coder.yaml +161 -71
- package/definitions/sdd-feature.yaml +139 -73
- package/definitions/sdd-log.yaml +70 -61
- package/definitions/sdd-project.yaml +163 -51
- package/definitions/sdd-requirements.yaml +70 -70
- package/definitions/sdd-review.yaml +106 -88
- package/definitions/sdd.yaml +12 -12
- package/package.json +1 -1
- package/src/commands/view.js +18 -18
- package/src/index.js +98 -98
- package/src/lib/dashboard.js +187 -187
- package/src/lib/docs.js +71 -69
- package/src/lib/i18n.js +65 -65
- package/src/lib/messages.js +234 -234
- package/src/lib/profiles.js +186 -186
- package/src/lib/schema.js +13 -13
- package/src/lib/transformers.js +326 -332
- package/src/scripts/archive.js +55 -56
- package/src/scripts/reset.js +19 -19
- package/src/scripts/status.js +50 -58
- package/templates/context.md +22 -0
- package/templates/guidelines.md +9 -9
- package/templates/project.md +28 -28
- package/templates/requirements.md +15 -15
- package/templates/system.md +20 -0
- package/templates/task.md +11 -11
- package/README.pt.md +0 -334
package/src/lib/transformers.js
CHANGED
|
@@ -1,332 +1,326 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
parts.push(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
toWindsurfRules,
|
|
328
|
-
toClaudeCommand,
|
|
329
|
-
toPlainSystemPrompt,
|
|
330
|
-
toTraeRules,
|
|
331
|
-
toOpenCodeAgent
|
|
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
|
+
*/
|
|
27
|
+
function toGeminiTOML(agent, options = {}) {
|
|
28
|
+
const languageRule = getLanguageRule(options.locale);
|
|
29
|
+
// Escapa aspas duplas na descrição
|
|
30
|
+
const description = (agent.description || agent.role).replace(/"/g, '\"');
|
|
31
|
+
|
|
32
|
+
// Constrói o prompt completo
|
|
33
|
+
const parts = [
|
|
34
|
+
`# Identity`,
|
|
35
|
+
`You are **${agent.name}** ${agent.emoji}`,
|
|
36
|
+
`Role: ${agent.role}\n`,
|
|
37
|
+
`# Core Instructions`,
|
|
38
|
+
agent.systemPrompt.trim(),
|
|
39
|
+
'\n'
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
43
|
+
|
|
44
|
+
if (allRules.length > 0) {
|
|
45
|
+
parts.push(`# Rules & Guidelines`);
|
|
46
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
47
|
+
parts.push('\n');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const fullPrompt = parts.join('\n');
|
|
51
|
+
const escapedPrompt = fullPrompt.replace(/"""/g, '\"\"\"');
|
|
52
|
+
|
|
53
|
+
// Monta o TOML final
|
|
54
|
+
let toml = `description = "${description}"\n`;
|
|
55
|
+
toml += `prompt = """\n${escapedPrompt}\n"""\n`;
|
|
56
|
+
|
|
57
|
+
if (allRules.length > 0) {
|
|
58
|
+
toml += 'rules = [\n';
|
|
59
|
+
allRules.forEach(rule => {
|
|
60
|
+
const escaped = rule.replace(/\\/g, '\\\\').replace(/"/g, '\"');
|
|
61
|
+
toml += ` "${escaped}",\n`;
|
|
62
|
+
});
|
|
63
|
+
toml += ']\n';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return toml;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Converte para configuração de Custom Mode do Roo Code / Cline (JSON)
|
|
71
|
+
*/
|
|
72
|
+
function toRooConfig(agent, slug, options = {}) {
|
|
73
|
+
const languageRule = getLanguageRule(options.locale);
|
|
74
|
+
const parts = [
|
|
75
|
+
`# ${agent.name} (${agent.role})`,
|
|
76
|
+
`\n${agent.systemPrompt.trim()}\n`
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
80
|
+
|
|
81
|
+
if (allRules.length > 0) {
|
|
82
|
+
parts.push(`## Rules & Guidelines`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
slug: slug,
|
|
87
|
+
roleDefinition: parts.join('\n'),
|
|
88
|
+
groups: ["read", "edit", "browser", "command", "mcp"]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Converte para Markdown do Kilo Code
|
|
94
|
+
*/
|
|
95
|
+
function toKiloMarkdown(agent, options = {}) {
|
|
96
|
+
const languageRule = getLanguageRule(options.locale);
|
|
97
|
+
const parts = [
|
|
98
|
+
`<!--- Kilo Code Agent Config --->`,
|
|
99
|
+
`# ${agent.name} ${agent.emoji}`,
|
|
100
|
+
`**Role**: ${agent.role}\n`,
|
|
101
|
+
`## Instructions`,
|
|
102
|
+
agent.systemPrompt.trim(),
|
|
103
|
+
'\n'
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
107
|
+
|
|
108
|
+
if (allRules.length > 0) {
|
|
109
|
+
parts.push(`## Constraints`);
|
|
110
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return parts.join('\n');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Converte para Instruções do GitHub Copilot (.github/copilot-instructions.md)
|
|
118
|
+
*/
|
|
119
|
+
function toCopilotInstructions(agent, options = {}) {
|
|
120
|
+
const languageRule = getLanguageRule(options.locale);
|
|
121
|
+
const parts = [
|
|
122
|
+
`<!-- GitHub Copilot Instructions for ${agent.name} -->`,
|
|
123
|
+
`# Identity and Role`,
|
|
124
|
+
`You are **${agent.name}** ${agent.emoji}.`,
|
|
125
|
+
`**Role**: ${agent.role}`,
|
|
126
|
+
`\n## Core Instructions`,
|
|
127
|
+
agent.systemPrompt.trim(),
|
|
128
|
+
'\n'
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
132
|
+
|
|
133
|
+
if (allRules.length > 0) {
|
|
134
|
+
parts.push(`## Rules & Guidelines`);
|
|
135
|
+
allRules.forEach(rule => parts.push(`- ${rule}`));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Adiciona uma seção de estilo de resposta para garantir conformidade
|
|
139
|
+
parts.push(`\n## Response Style`);
|
|
140
|
+
parts.push(`- Be concise and objective.`);
|
|
141
|
+
parts.push(`- Follow the project conventions defined in the workspace.`);
|
|
142
|
+
|
|
143
|
+
return parts.join('\n');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Converte para Cursor Rules (.mdc)
|
|
148
|
+
* Inclui Frontmatter para Contexto
|
|
149
|
+
*/
|
|
150
|
+
function toCursorMDC(agent, options = {}) {
|
|
151
|
+
const languageRule = getLanguageRule(options.locale);
|
|
152
|
+
// Tenta inferir globs baseados no papel do agente
|
|
153
|
+
let globs = "*";
|
|
154
|
+
const roleLower = agent.slug.toLowerCase();
|
|
155
|
+
|
|
156
|
+
if (roleLower.includes('test') || roleLower.includes('qa')) globs = "*.test.*, *.spec.*, **/tests/**";
|
|
157
|
+
if (roleLower.includes('css') || roleLower.includes('style')) globs = "*.css, *.scss, *.tailwind";
|
|
158
|
+
if (roleLower.includes('sql') || roleLower.includes('db')) globs = "*.sql, *.prisma, *.schema";
|
|
159
|
+
|
|
160
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
161
|
+
|
|
162
|
+
return `---
|
|
163
|
+
description: ${agent.description || agent.role}
|
|
164
|
+
globs: ${globs}
|
|
165
|
+
---
|
|
166
|
+
# ${agent.name} ${agent.emoji}
|
|
167
|
+
|
|
168
|
+
Role: ${agent.role}
|
|
169
|
+
|
|
170
|
+
## Instructions
|
|
171
|
+
${agent.systemPrompt.trim()}
|
|
172
|
+
|
|
173
|
+
${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Converte para Windsurf Workflow (.windsurf/workflows/*.md)
|
|
179
|
+
* Cascade reconhece esses arquivos como comandos de workflow
|
|
180
|
+
*/
|
|
181
|
+
function toWindsurfRules(agent, options = {}) {
|
|
182
|
+
const languageRule = getLanguageRule(options.locale);
|
|
183
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
184
|
+
|
|
185
|
+
return `# ${agent.name} ${agent.emoji} Rules
|
|
186
|
+
|
|
187
|
+
Role: ${agent.role}
|
|
188
|
+
|
|
189
|
+
## Core Logic
|
|
190
|
+
${agent.systemPrompt.trim()}
|
|
191
|
+
|
|
192
|
+
${allRules.length > 0 ? '## Guidelines\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
193
|
+
`;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Converte para Claude Code Command (.claude/commands/agents/*.md)
|
|
198
|
+
*/
|
|
199
|
+
function toClaudeCommand(agent, options = {}) {
|
|
200
|
+
const languageRule = getLanguageRule(options.locale);
|
|
201
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
202
|
+
|
|
203
|
+
return `---
|
|
204
|
+
name: Agent: ${agent.name}
|
|
205
|
+
description: ${agent.description || agent.role}
|
|
206
|
+
category: Agents
|
|
207
|
+
---
|
|
208
|
+
# ${agent.name} ${agent.emoji}
|
|
209
|
+
|
|
210
|
+
Role: ${agent.role}
|
|
211
|
+
|
|
212
|
+
## Instructions
|
|
213
|
+
${agent.systemPrompt.trim()}
|
|
214
|
+
|
|
215
|
+
${allRules.length > 0 ? '## Rules\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Converte para System Prompt Puro (OpenAI/Claude/Web)
|
|
221
|
+
*/
|
|
222
|
+
function toPlainSystemPrompt(agent, options = {}) {
|
|
223
|
+
const languageRule = getLanguageRule(options.locale);
|
|
224
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
225
|
+
|
|
226
|
+
return `You are ${agent.name} ${agent.emoji}
|
|
227
|
+
Role: ${agent.role}
|
|
228
|
+
|
|
229
|
+
[SYSTEM INSTRUCTIONS]
|
|
230
|
+
${agent.systemPrompt.trim()}
|
|
231
|
+
|
|
232
|
+
${allRules.length > 0 ? '[GUIDELINES]\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Converte para Trae Instructions
|
|
238
|
+
*/
|
|
239
|
+
function toTraeRules(agent, options = {}) {
|
|
240
|
+
const languageRule = getLanguageRule(options.locale);
|
|
241
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
242
|
+
|
|
243
|
+
return `<!-- Trae Workspace Rules -->
|
|
244
|
+
# ${agent.name} ${agent.emoji}
|
|
245
|
+
|
|
246
|
+
**Role**: ${agent.role}
|
|
247
|
+
|
|
248
|
+
## Context & Instructions
|
|
249
|
+
${agent.systemPrompt.trim()}
|
|
250
|
+
|
|
251
|
+
${allRules.length > 0 ? '## Constraints\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
252
|
+
`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Converte para OpenCode Agent (.opencode/agent/*.md)
|
|
257
|
+
*/
|
|
258
|
+
function toOpenCodeAgent(agent, options = {}) {
|
|
259
|
+
const languageRule = getLanguageRule(options.locale);
|
|
260
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
261
|
+
|
|
262
|
+
// Configurar permissões baseado no tipo de agente
|
|
263
|
+
const isReadOnly = agent.slug.includes('review') || agent.slug.includes('audit') || agent.name.includes('Architect') || agent.role.includes('QA') || agent.role.includes('Review');
|
|
264
|
+
const tools = {
|
|
265
|
+
write: !isReadOnly,
|
|
266
|
+
edit: !isReadOnly,
|
|
267
|
+
bash: !isReadOnly
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const frontmatter = {
|
|
271
|
+
description: agent.description || agent.role,
|
|
272
|
+
mode: 'subagent',
|
|
273
|
+
temperature: 0.3,
|
|
274
|
+
tools
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const frontmatterStr = Object.entries(frontmatter)
|
|
278
|
+
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
279
|
+
.join('\n');
|
|
280
|
+
|
|
281
|
+
return `---
|
|
282
|
+
${frontmatterStr}
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
# ${agent.name} ${agent.emoji}
|
|
286
|
+
|
|
287
|
+
**Role**: ${agent.role}
|
|
288
|
+
|
|
289
|
+
${agent.systemPrompt.trim()}
|
|
290
|
+
|
|
291
|
+
## Rules
|
|
292
|
+
${allRules.map(rule => `- ${rule}`).join('\n')}
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Converte para Trae Instructions
|
|
298
|
+
*/
|
|
299
|
+
function toTraeRules(agent, options = {}) {
|
|
300
|
+
const languageRule = getLanguageRule(options.locale);
|
|
301
|
+
const allRules = [languageRule, ...(agent.rules || [])];
|
|
302
|
+
|
|
303
|
+
return `<!-- Trae Workspace Rules -->
|
|
304
|
+
# ${agent.name} ${agent.emoji}
|
|
305
|
+
|
|
306
|
+
**Role**: ${agent.role}
|
|
307
|
+
|
|
308
|
+
## Context & Instructions
|
|
309
|
+
${agent.systemPrompt.trim()}
|
|
310
|
+
|
|
311
|
+
${allRules.length > 0 ? '## Constraints\n' + allRules.map(r => `- ${r}`).join('\n') : ''}
|
|
312
|
+
`;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
module.exports = {
|
|
316
|
+
toGeminiTOML,
|
|
317
|
+
toRooConfig,
|
|
318
|
+
toKiloMarkdown,
|
|
319
|
+
toCopilotInstructions,
|
|
320
|
+
toCursorMDC,
|
|
321
|
+
toWindsurfRules,
|
|
322
|
+
toClaudeCommand,
|
|
323
|
+
toPlainSystemPrompt,
|
|
324
|
+
toOpenCodeAgent,
|
|
325
|
+
toTraeRules
|
|
326
|
+
};
|