sdd-toolkit 1.1.0 → 1.5.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/src/lib/docs.js CHANGED
@@ -1,104 +1,68 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const pc = require('picocolors');
4
-
5
- /**
6
- * Gera o guia de workflow e a estrutura de pastas necessária para os agentes
7
- */
8
- function generateWorkflowGuide(baseDir) {
9
- const docsDir = path.join(baseDir, 'docs');
10
- const logsDir = path.join(docsDir, 'logs');
11
-
12
- // Cria a estrutura de pastas recursivamente (Funciona em Windows, Mac e Linux)
13
- if (!fs.existsSync(logsDir)) {
14
- fs.mkdirSync(logsDir, { recursive: true });
15
- }
16
-
17
- // Conteúdo do README.md
18
- const content = `# 🤖 Agent Workflow Guide
19
-
20
- Este documento descreve o fluxo de desenvolvimento padrão usando os Agentes instalados.
21
- O sistema segue um processo **Waterfall** para planejamento (precisão) e **Iterativo** para execução.
22
-
23
- ---
24
-
25
- ## 1. 🏗️ Project Spec (@Project Architect)
26
- **Role:** O Visionário.
27
- **Goal:** Traduzir sua ideia vaga em uma Especificação concreta com "Project Principles" definidos.
28
- - **Comando:** \\
29
- /dev:project "Eu quero um App de Todo que..."
30
- - **Saída:**
31
- \`docs/project.md\`
32
-
33
- ## 2. 🧱 Requirements Engineering (@Requirements Engineer)
34
- **Role:** O Tech Lead.
35
- **Goal:** Fechar decisões técnicas (Stack, Banco de Dados, Libs).
36
- - **Why?** Evita que o Coder "invente" arquitetura. Cria o "Contrato".
37
- - **Comando:**
38
- /dev:requirements
39
- - **Saída:**
40
- \`docs/requirements.md\`
41
-
42
- ## 3. 🗺️ Roadmap Strategy (@Milestone Manager)
43
- **Role:** O Estrategista.
44
- **Goal:** Fatiar o projeto em fases de entrega (MVPs).
45
- - **Comando:**
46
- /dev:milestone
47
- - **Saída:**
48
- \`docs/milestones.md\`
49
-
50
- ## 4. 📋 Task Planning (@Task Planner)
51
- **Role:** O Gerente.
52
- **Goal:** Quebrar um Milestone específico em tarefas atômicas para desenvolvedores.
53
- - **Why?** IAs falham com contextos gigantes. Tarefas pequenas = Código perfeito.
54
- - **Comando:**
55
- /dev:tasks <Milestone_ID>
56
- - **Saída:**
57
- \`docs/task.md\`
58
-
59
- ## 5. 🕵️ Blueprint Audit (@Auditor)
60
- **Role:** O Guardião.
61
- **Goal:** Validar consistência entre **Requirements** e **Tasks**.
62
- - **Comando:**
63
- /dev:auditor
64
- - **Saída:**
65
- \`audit_report.md\`
66
-
67
- ## 6. 💻 Implementation (@Coder)
68
- **Role:** O Construtor.
69
- **Goal:** Executar *uma tarefa por vez* do arquivo
70
- \`task.md\`.
71
- - **Comando:**
72
- /dev:coder <Task_ID>
73
- - **Buffer:**
74
- \`work_log.md\`
75
-
76
- ## 7. ⚖️ Quality Assurance (@QA Engineer)
77
- **Role:** O Inspetor.
78
- **Goal:** Verificar se a implementação bate com os Requisitos.
79
- - **Comando:**
80
- /dev:review <Task_ID>
81
- - **Saída:**
82
- \`docs/logs/review_log.md\`
83
-
84
- ## 8. 📦 Release Management (@Release Manager)
85
- **Role:** O Historiador.
86
- **Goal:** Consolidar o
87
- \`work_log.md\` em um
88
- \`changelog.md\` permanente.
89
- - **Comando:**
90
- /dev:log
91
- - **Saída:**
92
- \`changelog.md\`
93
- `;
94
-
95
- const readmePath = path.join(docsDir, 'README.md');
96
- if (!fs.existsSync(readmePath)) {
97
- fs.writeFileSync(readmePath, content);
98
- return true;
99
- }
100
-
101
- return true; // Retorna true indicando que a estrutura foi garantida
102
- }
103
-
104
- module.exports = { generateWorkflowGuide };
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ /**
5
+ * Generates the necessary folder structure for the agents
6
+ * Implements Smart Scaffolding: Only creates missing files/folders.
7
+ */
8
+ function generateWorkflowGuide(baseDir) {
9
+ const docsDir = path.join(baseDir, 'docs');
10
+
11
+ // 1. Define folder structure based on new logging architecture
12
+ const folders = [
13
+ path.join(docsDir, 'logs'),
14
+ path.join(docsDir, 'logs', 'executions'),
15
+ path.join(docsDir, 'logs', 'reviews'),
16
+ path.join(docsDir, 'logs', 'archive'),
17
+ ];
18
+
19
+ let stats = { created: 0, verified: 0 };
20
+
21
+ // Create folders
22
+ folders.forEach(dir => {
23
+ if (!fs.existsSync(dir)) {
24
+ fs.mkdirSync(dir, { recursive: true });
25
+ stats.created++;
26
+ } else {
27
+ stats.verified++;
28
+ }
29
+ });
30
+
31
+ // 2. Define Templates Mapping
32
+ // Assumes templates are located in project_root/templates/
33
+ // __dirname is src/lib/, so templates is ../../templates
34
+ const templatesDir = path.join(__dirname, '..', '..', 'templates');
35
+
36
+ const templateFiles = [
37
+ { src: 'guidelines.md', dest: 'guidelines.md' },
38
+ { src: 'project.md', dest: 'project.md' },
39
+ { src: 'requirements.md', dest: 'requirements.md' },
40
+ { src: 'milestones.md', dest: 'milestones.md' },
41
+ { src: 'task.md', dest: 'task.md' }
42
+ ];
43
+
44
+ // Create files if they don't exist
45
+ templateFiles.forEach(tpl => {
46
+ const destPath = path.join(docsDir, tpl.dest);
47
+ if (!fs.existsSync(destPath)) {
48
+ try {
49
+ // Ensure template exists before reading
50
+ const templatePath = path.join(templatesDir, tpl.src);
51
+ if (fs.existsSync(templatePath)) {
52
+ const content = fs.readFileSync(templatePath, 'utf8');
53
+ fs.writeFileSync(destPath, content);
54
+ stats.created++;
55
+ }
56
+ } catch (e) {
57
+ // Fail silently/warn, do not crash the installer
58
+ console.warn(`Warning: Could not scaffold ${tpl.dest}`);
59
+ }
60
+ } else {
61
+ stats.verified++;
62
+ }
63
+ });
64
+
65
+ return stats;
66
+ }
67
+
68
+ module.exports = { generateWorkflowGuide };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Internal i18n Engine
3
+ */
4
+ const { TRANSLATIONS } = require('./messages');
5
+
6
+ let currentLocale = 'en';
7
+
8
+ function setLocale(locale) {
9
+ // Normalize logic (pt-br -> pt_br) if passed incorrectly, though prompts usually give controlled values
10
+ const normalized = locale.toLowerCase().replace('-', '_');
11
+
12
+ if (TRANSLATIONS[normalized]) {
13
+ currentLocale = normalized;
14
+ } else {
15
+ // Fallback to en
16
+ currentLocale = 'en';
17
+ }
18
+ }
19
+
20
+ function getLocale() {
21
+ return currentLocale;
22
+ }
23
+
24
+ /**
25
+ * Retrieves a string from the dictionary based on dot notation.
26
+ * e.g. t('INTRO.TITLE')
27
+ */
28
+ function t(path, ...args) {
29
+ const keys = path.split('.');
30
+ let value = TRANSLATIONS[currentLocale];
31
+
32
+ // Traverse the object for the current locale
33
+ for (const key of keys) {
34
+ if (value && value[key]) {
35
+ value = value[key];
36
+ } else {
37
+ value = undefined;
38
+ break;
39
+ }
40
+ }
41
+
42
+ // If not found, Try Fallback to EN
43
+ if (!value) {
44
+ let fallback = TRANSLATIONS['en'];
45
+ for (const k of keys) {
46
+ if (fallback && fallback[k]) fallback = fallback[k];
47
+ else {
48
+ fallback = undefined;
49
+ break;
50
+ }
51
+ }
52
+ value = fallback;
53
+ }
54
+
55
+ // If still not found, return the path itself as a debug marker
56
+ if (!value) return path;
57
+
58
+ if (typeof value === 'function') {
59
+ return value(...args);
60
+ }
61
+
62
+ return value;
63
+ }
64
+
65
+ module.exports = { t, setLocale, getLocale };
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Centralized User-Facing Strings
3
+ * Used for future Internationalization (i18n)
4
+ */
5
+
6
+ const EN = {
7
+ INTRO: {
8
+ TITLE: ' UNIVERSAL SPEC CLI ',
9
+ UPGRADE_TITLE: ' SDD TOOLKIT: UPGRADE MODE ',
10
+ },
11
+ GENERAL: {
12
+ CANCELLED: 'Operation cancelled.',
13
+ },
14
+ UPGRADE: {
15
+ NO_CONFIG: 'No existing configuration detected for upgrade. Starting standard installation.',
16
+ NO_CONFIG_TITLE: 'Info',
17
+ DETECTED_TOOLS: (tools) => `Tools detected: ${tools}`,
18
+ DETECTED_TITLE: 'Upgrading...',
19
+ SUCCESS: 'Agents updated successfully! 🚀',
20
+ },
21
+ SCAFFOLD: {
22
+ LOADING: 'Checking workspace structure...',
23
+ SUCCESS: '✔ Folder structure (docs/) created.',
24
+ ALREADY_EXISTS: '✔ Folder structure (docs/) verified.',
25
+ ERROR: 'Failed to verify workspace structure.',
26
+ },
27
+ SETUP: {
28
+ STACK_SELECT: 'What is your technology Stack profile?',
29
+ GLOBAL_RULES: 'Do you want to add any Global Rules for ALL agents?',
30
+ GLOBAL_RULES_HINT: 'Ex: Always reply in English; Use Conventional Commits...',
31
+ TOOL_SELECT: 'Which tools do you want to install the Agents for?',
32
+ TOOL_HINT: 'Space to select, Enter to confirm',
33
+ NO_TOOLS: 'No tools selected. Operation cancelled.',
34
+ SUCCESS: 'Setup completed successfully! 🚀',
35
+ },
36
+ INSTALL: {
37
+ LOADING: 'Loading definitions...',
38
+ NO_AGENTS: 'No valid agents found.',
39
+ INSTALLING: (tools) => `Installing agents for: ${tools}...`,
40
+ FINISHED: 'Installation finished!',
41
+ ROO_WARNING: 'Remember to configure Custom Modes in settings.json for Roo/Cline.',
42
+ ROO_WARNING_TITLE: 'Warning',
43
+ FAILED: 'Failed',
44
+ },
45
+ TOOLS: {
46
+ GEMINI: 'Gemini CLI',
47
+ ROO: 'Roo Code',
48
+ CLINE: 'Cline',
49
+ CURSOR: 'Cursor',
50
+ WINDSURF: 'Windsurf',
51
+ TRAE: 'Trae IDE',
52
+ KILO: 'Kilo Code',
53
+ COPILOT: 'GitHub Copilot',
54
+ WEB: 'OpenAI / Claude',
55
+ OPENCODE: 'OpenCode',
56
+ },
57
+ LANGUAGE_RULES: {
58
+ EN: 'Always reply in English unless told otherwise.',
59
+ PT_BR: 'Responda sempre em Português (Brasil), a menos que solicitado o contrário.',
60
+ ES: 'Responda siempre en Español, a menos que se solicite lo contrario.',
61
+ }
62
+ };
63
+
64
+ const PT_BR = {
65
+ INTRO: {
66
+ TITLE: ' UNIVERSAL SPEC CLI ',
67
+ UPGRADE_TITLE: ' SDD TOOLKIT: MODO ATUALIZAÇÃO ',
68
+ },
69
+ GENERAL: {
70
+ CANCELLED: 'Operação cancelada.',
71
+ },
72
+ UPGRADE: {
73
+ NO_CONFIG: 'Nenhuma configuração existente detectada. Iniciando instalação padrão.',
74
+ NO_CONFIG_TITLE: 'Info',
75
+ DETECTED_TOOLS: (tools) => `Ferramentas detectadas: ${tools}`,
76
+ DETECTED_TITLE: 'Atualizando...',
77
+ SUCCESS: 'Agentes atualizados com sucesso! 🚀',
78
+ },
79
+ SCAFFOLD: {
80
+ LOADING: 'Verificando estrutura do workspace...',
81
+ SUCCESS: '✔ Estrutura de pastas (docs/) criada.',
82
+ ALREADY_EXISTS: '✔ Estrutura de pastas (docs/) verificada.',
83
+ ERROR: 'Falha ao verificar estrutura do workspace.',
84
+ },
85
+ SETUP: {
86
+ STACK_SELECT: 'Qual é o perfil de tecnologia (Stack)?',
87
+ GLOBAL_RULES: 'Deseja adicionar Regras Globais para TODOS os agentes?',
88
+ GLOBAL_RULES_HINT: 'Ex: Sempre responda em Português; Use Conventional Commits...',
89
+ TOOL_SELECT: 'Para quais ferramentas você deseja instalar os Agentes?',
90
+ TOOL_HINT: 'Espaço para selecionar, Enter para confirmar',
91
+ NO_TOOLS: 'Nenhuma ferramenta selecionada. Operação cancelada.',
92
+ SUCCESS: 'Instalação concluída com sucesso! 🚀',
93
+ },
94
+ INSTALL: {
95
+ LOADING: 'Carregando definições...',
96
+ NO_AGENTS: 'Nenhum agente válido encontrado.',
97
+ INSTALLING: (tools) => `Instalando agentes para: ${tools}...`,
98
+ FINISHED: 'Instalação finalizada!',
99
+ ROO_WARNING: 'Lembre-se de configurar os Custom Modes em settings.json para Roo/Cline.',
100
+ ROO_WARNING_TITLE: 'Aviso',
101
+ FAILED: 'Falhou',
102
+ },
103
+ TOOLS: {
104
+ GEMINI: 'Gemini CLI',
105
+ ROO: 'Roo Code',
106
+ CLINE: 'Cline',
107
+ CURSOR: 'Cursor',
108
+ WINDSURF: 'Windsurf',
109
+ TRAE: 'Trae IDE',
110
+ KILO: 'Kilo Code',
111
+ COPILOT: 'GitHub Copilot',
112
+ WEB: 'OpenAI / Claude',
113
+ OPENCODE: 'OpenCode',
114
+ },
115
+ LANGUAGE_RULES: {
116
+ EN: 'Always reply in English unless told otherwise.',
117
+ PT_BR: 'Responda sempre em Português (Brasil), a menos que solicitado o contrário.',
118
+ ES: 'Responda siempre en Español, a menos que se solicite lo contrario.',
119
+ }
120
+ };
121
+
122
+ const ES = {
123
+ INTRO: {
124
+ TITLE: ' UNIVERSAL SPEC CLI ',
125
+ UPGRADE_TITLE: ' SDD TOOLKIT: MODO ACTUALIZACIÓN ',
126
+ },
127
+ GENERAL: {
128
+ CANCELLED: 'Operación cancelada.',
129
+ },
130
+ UPGRADE: {
131
+ NO_CONFIG: 'No se detectó configuración existente. Iniciando instalación estándar.',
132
+ NO_CONFIG_TITLE: 'Info',
133
+ DETECTED_TOOLS: (tools) => `Herramientas detectadas: ${tools}`,
134
+ DETECTED_TITLE: 'Actualizando...',
135
+ SUCCESS: '¡Agentes actualizados con éxito! 🚀',
136
+ },
137
+ SCAFFOLD: {
138
+ LOADING: 'Verificando estructura del espacio de trabajo...',
139
+ SUCCESS: '✔ Estructura de carpetas (docs/) creada.',
140
+ ALREADY_EXISTS: '✔ Estructura de carpetas (docs/) verificada.',
141
+ ERROR: 'Fallo al verificar estructura del espacio de trabajo.',
142
+ },
143
+ SETUP: {
144
+ STACK_SELECT: '¿Cuál es su perfil tecnológico (Stack)?',
145
+ GLOBAL_RULES: '¿Desea agregar Reglas Globales para TODOS los agentes?',
146
+ GLOBAL_RULES_HINT: 'Ej: Siempre responda en Español; Use Conventional Commits...',
147
+ TOOL_SELECT: '¿Para qué herramientas desea instalar los Agentes?',
148
+ TOOL_HINT: 'Espacio para seleccionar, Enter para confirmar',
149
+ NO_TOOLS: 'Ninguna herramienta seleccionada. Operación cancelada.',
150
+ SUCCESS: '¡Instalación completada con éxito! 🚀',
151
+ },
152
+ INSTALL: {
153
+ LOADING: 'Cargando definiciones...',
154
+ NO_AGENTS: 'No se encontraron agentes válidos.',
155
+ INSTALLING: (tools) => `Instalando agentes para: ${tools}...`,
156
+ FINISHED: '¡Instalación finalizada!',
157
+ ROO_WARNING: 'Recuerde configurar los Modos Personalizados en settings.json para Roo/Cline.',
158
+ ROO_WARNING_TITLE: 'Aviso',
159
+ FAILED: 'Falló',
160
+ },
161
+ TOOLS: {
162
+ GEMINI: 'Gemini CLI',
163
+ ROO: 'Roo Code',
164
+ CLINE: 'Cline',
165
+ CURSOR: 'Cursor',
166
+ WINDSURF: 'Windsurf',
167
+ TRAE: 'Trae IDE',
168
+ KILO: 'Kilo Code',
169
+ COPILOT: 'GitHub Copilot',
170
+ WEB: 'OpenAI / Claude',
171
+ OPENCODE: 'OpenCode',
172
+ },
173
+ LANGUAGE_RULES: {
174
+ EN: 'Always reply in English unless told otherwise.',
175
+ PT_BR: 'Responda sempre em Português (Brasil), a menos que solicitado o contrário.',
176
+ ES: 'Responda siempre en Español, a menos que se solicite lo contrario.',
177
+ }
178
+ };
179
+
180
+ const TRANSLATIONS = {
181
+ en: EN,
182
+ pt_br: PT_BR,
183
+ es: ES
184
+ };
185
+
186
+ module.exports = { TRANSLATIONS, MESSAGES: EN };
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Perfis de Stack Técnica
3
- * Define regras adicionais que serão injetadas nos agentes
2
+ * Technical Stack Profiles
3
+ * Defines additional rules to be injected into agents
4
4
  */
5
5
 
6
6
  const STACK_PROFILES = {
7
7
  // --- GENERIC ---
8
8
  'generic': {
9
- label: '🌐 Genérico / Nenhum',
9
+ label: '🌐 Generic / None',
10
10
  rules: []
11
11
  },
12
12
 
@@ -183,4 +183,4 @@ const STACK_PROFILES = {
183
183
  }
184
184
  };
185
185
 
186
- module.exports = { STACK_PROFILES };
186
+ module.exports = { STACK_PROFILES };