sdd-toolkit 1.0.0 → 1.1.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,104 @@
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
+ 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 };
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Perfis de Stack Técnica
3
+ * Define regras adicionais que serão injetadas nos agentes
4
+ */
5
+
6
+ const STACK_PROFILES = {
7
+ // --- GENERIC ---
8
+ 'generic': {
9
+ label: '🌐 Genérico / Nenhum',
10
+ rules: []
11
+ },
12
+
13
+ // --- FRONTEND ---
14
+ 'frontend-react': {
15
+ label: '🎨 Frontend: React + Tailwind',
16
+ rules: [
17
+ "Prefer Functional Components with Hooks.",
18
+ "Use Tailwind CSS for styling. Avoid inline styles.",
19
+ "Ensure accessibility (a11y) standards are met.",
20
+ "Use strict type checking if TypeScript is enabled.",
21
+ "Prefer React Query or SWR for data fetching."
22
+ ]
23
+ },
24
+ 'frontend-next': {
25
+ label: '🎨 Frontend: Next.js (App Router)',
26
+ rules: [
27
+ "Use App Router directory structure.",
28
+ "Prefer Server Components by default; use 'use client' only when necessary.",
29
+ "Optimize images using next/image.",
30
+ "Use Server Actions for mutations."
31
+ ]
32
+ },
33
+ 'frontend-vue': {
34
+ label: '🎨 Frontend: Vue.js 3 + Pinia',
35
+ rules: [
36
+ "Use Composition API with <script setup>.",
37
+ "Use Pinia for state management.",
38
+ "Prefer Tailwind CSS or Scoped CSS.",
39
+ "Follow the Vue Style Guide Priority A rules."
40
+ ]
41
+ },
42
+ 'frontend-angular': {
43
+ label: '🎨 Frontend: Angular',
44
+ rules: [
45
+ "Use Standalone Components.",
46
+ "Prefer Signals over RxJS for synchronous state.",
47
+ "Strictly follow the Angular Style Guide.",
48
+ "Use Dependency Injection patterns."
49
+ ]
50
+ },
51
+ 'frontend-svelte': {
52
+ label: '🎨 Frontend: SvelteKit',
53
+ rules: [
54
+ "Use Svelte 5 Runes syntax if available.",
55
+ "Leverage SvelteKit's load functions for server-side data.",
56
+ "Keep stores simple and derived."
57
+ ]
58
+ },
59
+
60
+ // --- BACKEND ---
61
+ 'backend-node': {
62
+ label: '⚙️ Backend: Node.js (Express)',
63
+ rules: [
64
+ "Prefer Async/Await over raw Promises.",
65
+ "Follow Error Handling best practices (don't ignore errors).",
66
+ "Use Environment Variables for configuration.",
67
+ "Adhere to RESTful API standards."
68
+ ]
69
+ },
70
+ 'backend-nest': {
71
+ label: '⚙️ Backend: NestJS',
72
+ rules: [
73
+ "Use Dependency Injection strictly.",
74
+ "Follow the module structure.",
75
+ "Use DTOs with ValidationPipe for all inputs.",
76
+ "Prefer TypeORM or Prisma for database interaction."
77
+ ]
78
+ },
79
+ 'backend-python-fastapi': {
80
+ label: '⚙️ Backend: Python (FastAPI)',
81
+ rules: [
82
+ "Use Pydantic models for data validation.",
83
+ "Use Type Hints for function arguments and return values.",
84
+ "Implement async/await for I/O bound operations.",
85
+ "Follow PEP 8 style guidelines."
86
+ ]
87
+ },
88
+ 'backend-python-django': {
89
+ label: '⚙️ Backend: Python (Django)',
90
+ rules: [
91
+ "Use Class-Based Views (CBVs) where appropriate.",
92
+ "Follow the 'Fat Models, Thin Views' philosophy.",
93
+ "Use Django ORM optimizations (select_related, prefetch_related).",
94
+ "Keep settings separated for dev/prod."
95
+ ]
96
+ },
97
+ 'backend-java-spring': {
98
+ label: '⚙️ Backend: Java (Spring Boot)',
99
+ rules: [
100
+ "Use constructor injection over @Autowired.",
101
+ "Follow Google Java Style Guide.",
102
+ "Use Lombok to reduce boilerplate code.",
103
+ "Handle exceptions with @ControllerAdvice."
104
+ ]
105
+ },
106
+ 'backend-csharp': {
107
+ label: '⚙️ Backend: C# (.NET Core)',
108
+ rules: [
109
+ "Follow Microsoft's C# Coding Conventions.",
110
+ "Use Async/Await all the way down.",
111
+ "Prefer LINQ for collection manipulation.",
112
+ "Use Dependency Injection via IServiceCollection."
113
+ ]
114
+ },
115
+ 'backend-go': {
116
+ label: '⚙️ Backend: Go (Golang)',
117
+ rules: [
118
+ "Handle errors explicitly (if err != nil).",
119
+ "Follow strict formatting (gofmt).",
120
+ "Prefer standard library over external dependencies when possible.",
121
+ "Use context for cancellation and timeouts."
122
+ ]
123
+ },
124
+
125
+ // --- MOBILE ---
126
+ 'mobile-react-native': {
127
+ label: '📱 Mobile: React Native',
128
+ rules: [
129
+ "Use Functional Components and Hooks.",
130
+ "Avoid bridge passing heavy data.",
131
+ "Optimize lists with FlatList or FlashList.",
132
+ "Style using StyleSheet objects or styled-components."
133
+ ]
134
+ },
135
+ 'mobile-flutter': {
136
+ label: '📱 Mobile: Flutter',
137
+ rules: [
138
+ "Use const constructors whenever possible.",
139
+ "Prefer Composition over Inheritance.",
140
+ "Manage state with Riverpod or BLoC.",
141
+ "Follow Effective Dart guidelines."
142
+ ]
143
+ },
144
+ 'mobile-ios': {
145
+ label: '📱 Mobile: iOS (SwiftUI)',
146
+ rules: [
147
+ "Use MVVM pattern.",
148
+ "Prefer Structs over Classes for data models.",
149
+ "Use strict concurrency checking.",
150
+ "Follow Apple's Human Interface Guidelines."
151
+ ]
152
+ },
153
+ 'mobile-android': {
154
+ label: '📱 Mobile: Android (Kotlin Compose)',
155
+ rules: [
156
+ "Use Jetpack Compose for UI.",
157
+ "Follow Material Design 3 guidelines.",
158
+ "Use Coroutines and Flow for async work.",
159
+ "Implement Hilt for Dependency Injection."
160
+ ]
161
+ },
162
+
163
+ // --- DATA & AI ---
164
+ 'data-python': {
165
+ label: '📊 Data Science: Python',
166
+ rules: [
167
+ "Use Pandas vectorization over loops.",
168
+ "Document notebooks with Markdown cells explaining logic.",
169
+ "Use Type Hints even in scripts.",
170
+ "Prefer Polars for large datasets if possible."
171
+ ]
172
+ },
173
+
174
+ // --- INFRASTRUCTURE ---
175
+ 'infra-terraform': {
176
+ label: '☁️ Infra: Terraform',
177
+ rules: [
178
+ "Use modules for reusable resources.",
179
+ "Keep state remote and locked.",
180
+ "Format code with `terraform fmt`.",
181
+ "Avoid hardcoding values; use variables."
182
+ ]
183
+ }
184
+ };
185
+
186
+ module.exports = { STACK_PROFILES };
package/src/lib/schema.js CHANGED
@@ -1,13 +1,13 @@
1
- const { z } = require('zod');
2
-
3
- const AgentSchema = z.object({
4
- name: z.string().min(1, "Nome é obrigatório"),
5
- role: z.string().min(1, "Papel (Role) é obrigatório"),
6
- emoji: z.string().optional().default('🤖'),
7
- systemPrompt: z.string().min(10, "System Prompt deve ter pelo menos 10 caracteres"),
8
- rules: z.array(z.string()).optional().default([]),
9
- tools: z.array(z.string()).optional().default([]),
10
- description: z.string().optional()
11
- });
12
-
13
- module.exports = { AgentSchema };
1
+ const { z } = require('zod');
2
+
3
+ const AgentSchema = z.object({
4
+ name: z.string().min(1, "Nome é obrigatório"),
5
+ role: z.string().min(1, "Papel (Role) é obrigatório"),
6
+ emoji: z.string().optional().default('🤖'),
7
+ systemPrompt: z.string().min(10, "System Prompt deve ter pelo menos 10 caracteres"),
8
+ rules: z.array(z.string()).optional().default([]),
9
+ tools: z.array(z.string()).optional().default([]),
10
+ description: z.string().optional()
11
+ });
12
+
13
+ module.exports = { AgentSchema };