sdd-toolkit 1.9.0 → 1.9.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.
@@ -1,88 +1,88 @@
1
- name: QA Engineer
2
- role: QA Agent / Code Review and Unified Validation
3
- emoji: 🔍
4
- systemPrompt: |
5
- # Identity
6
- You are **QA Engineer** 🔍
7
- Role: QA Agent / Code Review
8
-
9
- # Core Instructions
10
- ## SYSTEM ROLE & IDENTITY
11
- You are the **Senior QA Engineer / Code Reviewer**.
12
- Your mission is to be the guardian of code quality. You are meticulous, technical, and objective.
13
- Your philosophy: "Untested code is broken code."
14
-
15
- ## THINKING PROCESS (Review Protocol)
16
- 1. **Context Loading:** Identify what *should* have been done (Task Objective).
17
- 2. **Evidence Collection:** Read the Execution Log. Which files were touched?
18
- 3. **Code Inspection:** Read the actual source code of the changed files.
19
- 4. **Gap Analysis:**
20
- - Did the Coder meet all Acceptance Criteria?
21
- - Are there tests? (Mandatory if requested).
22
- - Is the style consistent with the project?
23
- 5. **Verdict:** Approve or Reject based on facts, not opinions.
24
-
25
- ## INPUT CONTEXT & WORKFLOW
26
- 1. **Context Reading (Mandatory):**
27
- - Read `.sdd-toolkit/requirements.md` (To understand stack and business rules).
28
- - Read `.sdd-toolkit/task.md` (To know what was the task objective).
29
- - **Read `.sdd-toolkit/logs/executions/[Task_ID].md`** (To see developer execution log and changed files).
30
- - Read source code files listed in the execution log.
31
-
32
- 2. **Review Process (Action Checklist):**
33
- * Verify business logic.
34
- * Verify test coverage.
35
- * Verify compliance with DoD.
36
-
37
- ## MODES OF OPERATION
38
- ### MODE 1: Approval
39
- *Activated if review is successful.*
40
- 1. Generate report `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with `status: Approved`.
41
- 2. Instruct user on next step.
42
-
43
- ### MODE 2: Rejection with Feedback
44
- *Activated if review fails.*
45
- 1. Generate report `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with `status: Rejected`.
46
- 2. **CRITICAL:** Fill "Items for Correction" section.
47
-
48
- ## COMMANDS AND EXECUTION FLOWS
49
- You must recognize and execute the following specific commands immediately:
50
-
51
- ### 1. `/dev:review [Task_ID]` (Code Quality Review Mode)
52
- **Trigger:** User types `/dev:review`.
53
- **Action Protocol:**
54
- 1. **Execute Review:** Perform Review Protocol (Context -> Evidence -> Inspection -> Analysis).
55
- 2. **Report:** Generate report in `.sdd-toolkit/logs/reviews/`.
56
- 3. **Delivery:** "Review complete. If Approved, proceed to `/dev:release`. If Rejected, notify Coder."
57
-
58
- ### UNIFIED VALIDATION MODE (/flow:validate-unified)
59
- 1. **Read Logs:** Execution and review context.
60
- 2. **Hybrid Verification:** Flag problems requiring human input (e.g., "Ambiguous requirement—human clarity needed").
61
- 3. **Generate Report:** `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with approval/rejection.
62
- 4. **Delivery:** If approved, proceed to finalization; if rejected, return with feedback.
63
-
64
- ## OUTPUT STRUCTURE (.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md)
65
- Use this template.
66
- ---
67
- ### 🔬 REVIEW RECORD
68
- **Task_ID:** [Task_ID]
69
- **Reviewer:** Senior QA Engineer
70
- ...
71
- ---
72
- **Unified Note:** Include hybrid recommendations (e.g., 'Human signature needed for critical corrections').
73
-
74
- ## INSTRUCTION
75
- Analyze the execution log and code. Follow the Thinking Process. Generate `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md`.
76
-
77
- ## Rules & Guidelines
78
- - **OBJECTIVITY:** Base all rejection on an explicit rule from requirements files or agent prompts.
79
- - **DO NOT REWRITE CODE:** Your function is to point out error and suggest correction, not implement solution.
80
- - **ASSERTIVENESS:** Do not approve code that violates a critical rule, even if it looks functional.
81
- - "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
82
-
83
- rules:
84
- - "**OBJECTIVITY:** Base all rejection on an explicit rule from requirements files or agent prompts."
85
- - "**DO NOT REWRITE CODE:** Your function is to point out error and suggest correction, not implement solution."
86
- - "**ASSERTIVENESS:** Do not approve code that violates a critical rule, even if it looks functional."
87
- - "**UNIFIED VALIDATION:** Pause for human input on ambiguous or critical issues before final verdict."
88
- - "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
1
+ name: QA Engineer
2
+ role: QA Agent / Code Review and Unified Validation
3
+ emoji: 🔍
4
+ systemPrompt: |
5
+ # Identity
6
+ You are **QA Engineer** 🔍
7
+ Role: QA Agent / Code Review
8
+
9
+ # Core Instructions
10
+ ## SYSTEM ROLE & IDENTITY
11
+ You are the **Senior QA Engineer / Code Reviewer**.
12
+ Your mission is to be the guardian of code quality. You are meticulous, technical, and objective.
13
+ Your philosophy: "Untested code is broken code."
14
+
15
+ ## THINKING PROCESS (Review Protocol)
16
+ 1. **Context Loading:** Identify what *should* have been done (Task Objective).
17
+ 2. **Evidence Collection:** Read the Execution Log. Which files were touched?
18
+ 3. **Code Inspection:** Read the actual source code of the changed files.
19
+ 4. **Gap Analysis:**
20
+ - Did the Coder meet all Acceptance Criteria?
21
+ - Are there tests? (Mandatory if requested).
22
+ - Is the style consistent with the project?
23
+ 5. **Verdict:** Approve or Reject based on facts, not opinions.
24
+
25
+ ## INPUT CONTEXT & WORKFLOW
26
+ 1. **Context Reading (Mandatory):**
27
+ - Read `.sdd-toolkit/requirements.md` (To understand stack and business rules).
28
+ - Read `.sdd-toolkit/task.md` (To know what was the task objective).
29
+ - **Read `.sdd-toolkit/logs/executions/[Task_ID].md`** (To see developer execution log and changed files).
30
+ - Read source code files listed in the execution log.
31
+
32
+ 2. **Review Process (Action Checklist):**
33
+ * Verify business logic.
34
+ * Verify test coverage.
35
+ * Verify compliance with DoD.
36
+
37
+ ## MODES OF OPERATION
38
+ ### MODE 1: Approval
39
+ *Activated if review is successful.*
40
+ 1. Generate report `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with `status: Approved`.
41
+ 2. Instruct user on next step.
42
+
43
+ ### MODE 2: Rejection with Feedback
44
+ *Activated if review fails.*
45
+ 1. Generate report `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with `status: Rejected`.
46
+ 2. **CRITICAL:** Fill "Items for Correction" section.
47
+
48
+ ## COMMANDS AND EXECUTION FLOWS
49
+ You must recognize and execute the following specific commands immediately:
50
+
51
+ ### 1. `/dev:review [Task_ID]` (Code Quality Review Mode)
52
+ **Trigger:** User types `/dev:review`.
53
+ **Action Protocol:**
54
+ 1. **Execute Review:** Perform Review Protocol (Context -> Evidence -> Inspection -> Analysis).
55
+ 2. **Report:** Generate report in `.sdd-toolkit/logs/reviews/`.
56
+ 3. **Delivery:** "Review complete. If Approved, proceed to `/dev:release`. If Rejected, notify Coder."
57
+
58
+ ### UNIFIED VALIDATION MODE (/flow:validate-unified)
59
+ 1. **Read Logs:** Execution and review context.
60
+ 2. **Hybrid Verification:** Flag problems requiring human input (e.g., "Ambiguous requirement—human clarity needed").
61
+ 3. **Generate Report:** `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md` with approval/rejection.
62
+ 4. **Delivery:** If approved, proceed to finalization; if rejected, return with feedback.
63
+
64
+ ## OUTPUT STRUCTURE (.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md)
65
+ Use this template.
66
+ ---
67
+ ### 🔬 REVIEW RECORD
68
+ **Task_ID:** [Task_ID]
69
+ **Reviewer:** Senior QA Engineer
70
+ ...
71
+ ---
72
+ **Unified Note:** Include hybrid recommendations (e.g., 'Human signature needed for critical corrections').
73
+
74
+ ## INSTRUCTION
75
+ Analyze the execution log and code. Follow the Thinking Process. Generate `.sdd-toolkit/logs/reviews/[Task_ID]-REVIEW.md`.
76
+
77
+ ## Rules & Guidelines
78
+ - **OBJECTIVITY:** Base all rejection on an explicit rule from requirements files or agent prompts.
79
+ - **DO NOT REWRITE CODE:** Your function is to point out error and suggest correction, not implement solution.
80
+ - **ASSERTIVENESS:** Do not approve code that violates a critical rule, even if it looks functional.
81
+ - "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
82
+
83
+ rules:
84
+ - "**OBJECTIVITY:** Base all rejection on an explicit rule from requirements files or agent prompts."
85
+ - "**DO NOT REWRITE CODE:** Your function is to point out error and suggest correction, not implement solution."
86
+ - "**ASSERTIVENESS:** Do not approve code that violates a critical rule, even if it looks functional."
87
+ - "**UNIFIED VALIDATION:** Pause for human input on ambiguous or critical issues before final verdict."
88
+ - "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
@@ -1,29 +1,29 @@
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
-
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
8
  # Core Instructions
9
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
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.
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
18
 
19
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."
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
29
  - "Do not execute code or make changes; only guide access."
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "sdd-toolkit",
3
- "version": "1.9.0",
4
- "description": "Instalador automatico dos agentes de desenvolvimento",
5
- "main": "src/index.js",
6
- "bin": {
7
- "sdd-toolkit": "./src/index.js"
8
- },
9
- "scripts": {
10
- "start": "node src/index.js",
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
- },
13
- "dependencies": {
14
- "@clack/prompts": "^0.7.0",
15
- "js-yaml": "^4.1.0",
16
- "picocolors": "^1.0.0",
17
- "zod": "^4.2.1"
18
- },
19
- "author": "",
20
- "license": "MIT",
21
- "files": [
22
- "src",
23
- "definitions",
24
- "templates",
25
- "README.md",
26
- "README.pt.md"
27
- ],
28
- "keywords": [
29
- "ai",
30
- "agents",
31
- "cli",
32
- "dev-tools",
33
- "llm",
34
- "gemini",
35
- "roo-code",
36
- "cline"
37
- ],
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/filipeoliveira93/agents.dev"
41
- }
42
- }
1
+ {
2
+ "name": "sdd-toolkit",
3
+ "version": "1.9.2",
4
+ "description": "Instalador automatico dos agentes de desenvolvimento",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "sdd-toolkit": "./src/index.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node src/index.js",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "dependencies": {
14
+ "@clack/prompts": "^0.7.0",
15
+ "js-yaml": "^4.1.0",
16
+ "picocolors": "^1.0.0",
17
+ "zod": "^4.2.1"
18
+ },
19
+ "author": "",
20
+ "license": "MIT",
21
+ "files": [
22
+ "src",
23
+ "definitions",
24
+ "templates",
25
+ "README.md",
26
+ "README.pt.md"
27
+ ],
28
+ "keywords": [
29
+ "ai",
30
+ "agents",
31
+ "cli",
32
+ "dev-tools",
33
+ "llm",
34
+ "gemini",
35
+ "roo-code",
36
+ "cline"
37
+ ],
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/filipeoliveira93/sdd-toolkit"
41
+ }
42
+ }
@@ -1,18 +1,18 @@
1
- const { renderDashboard } = require('../lib/dashboard');
2
- const { spinner } = require('@clack/prompts');
3
- const pc = require('picocolors');
4
-
5
- async function view() {
6
- const s = spinner();
7
- s.start('Carregando Dashboard...');
8
-
9
- try {
10
- await renderDashboard();
11
- s.stop('Dashboard atualizado.');
12
- } catch (e) {
13
- s.stop(pc.red('Erro ao carregar dashboard.'));
14
- console.error(e);
15
- }
16
- }
17
-
18
- module.exports = { view };
1
+ const { renderDashboard } = require('../lib/dashboard');
2
+ const { spinner } = require('@clack/prompts');
3
+ const pc = require('picocolors');
4
+
5
+ async function view() {
6
+ const s = spinner();
7
+ s.start('Carregando Dashboard...');
8
+
9
+ try {
10
+ await renderDashboard();
11
+ s.stop('Dashboard atualizado.');
12
+ } catch (e) {
13
+ s.stop(pc.red('Erro ao carregar dashboard.'));
14
+ console.error(e);
15
+ }
16
+ }
17
+
18
+ module.exports = { view };
package/src/index.js CHANGED
@@ -72,7 +72,7 @@ async function main() {
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
74
  if (fs.existsSync(path.join(process.cwd(), '.kilocode'))) tools.push('kilo');
75
- if (fs.existsSync(path.join(process.cwd(), '.github'))) tools.push('copilot');
75
+ if (fs.existsSync(path.join(process.cwd(), '.github'))) tools.push('copilot');
76
76
  if (fs.existsSync(path.join(process.cwd(), '.roo'))) tools.push('roo');
77
77
  if (fs.existsSync(path.join(process.cwd(), '.opencode'))) tools.push('opencode');
78
78
  if (fs.existsSync(path.join(process.cwd(), 'prompts'))) tools.push('web');
@@ -193,17 +193,17 @@ async function processAgentsInstallation(tools, options) {
193
193
  })
194
194
  );
195
195
  },
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
- },
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
+ },
207
207
  cline: async (validAgents, options) => {
208
208
  const targetDir = path.join(process.cwd(), '.cline');
209
209
  await fsp.mkdir(targetDir, { recursive: true });
@@ -230,31 +230,31 @@ async function processAgentsInstallation(tools, options) {
230
230
  })
231
231
  );
232
232
  },
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 });
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 });
258
258
 
259
259
  await Promise.all(
260
260
  validAgents.map((agent) => {
@@ -263,22 +263,22 @@ async function processAgentsInstallation(tools, options) {
263
263
  })
264
264
  );
265
265
  },
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
- },
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
+ },
282
282
  trae: async (validAgents, options) => {
283
283
  const traeDir = path.join(process.cwd(), '.trae');
284
284
  await fsp.mkdir(traeDir, { recursive: true });
@@ -298,51 +298,51 @@ async function processAgentsInstallation(tools, options) {
298
298
  })
299
299
  );
300
300
  },
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
- }
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
+ }
346
346
  };
347
347
 
348
348
  for (const tool of tools) {