@maestro-ai/cli 1.0.0 → 1.2.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 +161 -29
- package/content/guides/fases-mapeamento.md +35 -0
- package/content/guides/multi-ide.md +32 -0
- package/content/guides/playbook-orquestrador.md +45 -0
- package/content/rules/GEMINI.md +841 -0
- package/content/rules/RULES.md +835 -0
- package/content/rules/adapters/copilot.md +10 -0
- package/content/rules/adapters/cursor.md +10 -0
- package/content/rules/adapters/gemini.md +13 -0
- package/content/rules/adapters/windsurf.md +10 -0
- package/content/rules/quality-gates.md +43 -0
- package/content/rules/validation-rules.md +97 -0
- package/content/templates/estado-template.json +73 -0
- package/content/workflows/avancar-fase.md +84 -0
- package/content/workflows/brainstorm.md +22 -8
- package/content/workflows/continuar-fase.md +64 -0
- package/content/workflows/{mcp-debug.md → corrigir-bug.md} +30 -6
- package/content/workflows/iniciar-projeto.md +59 -0
- package/content/workflows/maestro.md +77 -0
- package/content/workflows/{mcp-feature.md → nova-feature.md} +81 -28
- package/content/workflows/{mcp-refactor.md → refatorar-codigo.md} +33 -10
- package/content/workflows/status-projeto.md +54 -0
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.js +99 -55
- package/dist/index.js +100 -3
- package/package.json +10 -4
- package/content/workflows/README-MCP.md +0 -363
- package/content/workflows/debug.md +0 -103
- package/content/workflows/mcp-next.md +0 -388
- package/content/workflows/mcp-start.md +0 -304
- package/content/workflows/mcp-status.md +0 -400
- package/content/workflows/preview.md +0 -81
- package/content/workflows/status.md +0 -86
- /package/content/workflows/{create.md → create-app.md} +0 -0
- /package/content/workflows/{enhance.md → melhorar-feature.md} +0 -0
- /package/content/workflows/{test.md → testar.md} +0 -0
- /package/content/workflows/{ui-ux-pro-max.md → ux-avancado.md} +0 -0
- /package/content/workflows/{mcp-gate.md → validar-gate.md} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Workflow universal inteligente que detecta estado e toma a próxima ação
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 🤖 Workflow Universal - /maestro
|
|
6
|
+
|
|
7
|
+
## Objetivo
|
|
8
|
+
|
|
9
|
+
Detectar automaticamente o estado do projeto Maestro, validar se o estado reflete os fluxos MCP (7/13/17 fases + Stitch) e decidir a ação adequada, respondendo no chat com contexto completo.
|
|
10
|
+
|
|
11
|
+
## Sincronização com os fluxos MCP
|
|
12
|
+
|
|
13
|
+
Antes de qualquer decisão:
|
|
14
|
+
|
|
15
|
+
1. Ler `.maestro/estado.json` **e** o template original em `packages/cli/content/templates/estado-template.json` para entender a estrutura completa.
|
|
16
|
+
2. Ler `src/src/flows/types.ts` para conhecer `FLUXO_SIMPLES`, `FLUXO_MEDIO`, `FLUXO_COMPLEXO` e a inserção opcional de Stitch (`getFluxoComStitch`).
|
|
17
|
+
3. Verificar se `estado.fases` segue a mesma ordem e quantidade de fases do fluxo correspondente. Se detectar divergências (fase faltando, numeração diferente), listar no resumo e sugerir ao usuário rodar `/iniciar-projeto` ou ajustar manualmente.
|
|
18
|
+
|
|
19
|
+
## Como funciona
|
|
20
|
+
|
|
21
|
+
1. **Ler estado** em `.maestro/estado.json` (se não existir, classificar como `novo_projeto`).
|
|
22
|
+
2. **Validar consistência** comparando `estado.fases` com o fluxo MCP adequado.
|
|
23
|
+
3. **Classificar estado** usando a função mental abaixo.
|
|
24
|
+
4. **Mapear ação** (`/iniciar-projeto`, `/continuar-fase`, `/avancar-fase`).
|
|
25
|
+
5. **Responder** com resumo e próxima ação sugerida.
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
const estado = lerJson('.maestro/estado.json');
|
|
29
|
+
const fluxo = estado?.projeto
|
|
30
|
+
? getFluxoComStitch(estado.projeto.complexidade, estado.projeto.usarStitch)
|
|
31
|
+
: null;
|
|
32
|
+
|
|
33
|
+
if (!estado || !estado.projeto?.nome) {
|
|
34
|
+
return { status: 'novo_projeto', proximaAcao: '/iniciar-projeto' };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const faseAtual = estado.fases[estado.faseAtual];
|
|
38
|
+
if (!faseAtual || faseAtual.status !== 'concluida') {
|
|
39
|
+
return {
|
|
40
|
+
status: 'fase_incompleta',
|
|
41
|
+
proximaAcao: '/continuar-fase',
|
|
42
|
+
fase: estado.faseAtual,
|
|
43
|
+
arquivoFoco: faseAtual?.artefatos?.slice(-1)[0] || fluxo?.fases?.find(f => f.numero === estado.faseAtual)?.entregavel_esperado,
|
|
44
|
+
divergenciasFluxo: compararComFluxo(estado.fases, fluxo?.fases)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
status: 'pronto_para_avancar',
|
|
50
|
+
proximaAcao: '/avancar-fase',
|
|
51
|
+
fase: estado.faseAtual,
|
|
52
|
+
proximaFase: estado.faseAtual + 1,
|
|
53
|
+
divergenciasFluxo: compararComFluxo(estado.fases, fluxo?.fases)
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Template de resposta
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
📋 **Status Detectado:** {status}
|
|
61
|
+
- Projeto: {estado.projeto.nome}
|
|
62
|
+
- Fase atual: {estado.faseAtual}/{totalFases} - {faseAtual.nome}
|
|
63
|
+
- Especialista: {faseAtual.especialista}
|
|
64
|
+
- Arquivo foco: {arquivoFoco}
|
|
65
|
+
|
|
66
|
+
🎯 **Próxima ação sugerida:** {proximaAcao}
|
|
67
|
+
➡️ Execute o comando correspondente ou peça um ajuste específico.
|
|
68
|
+
|
|
69
|
+
{divergenciasFluxo?.length ? `⚠️ Divergências detectadas entre estado e fluxo MCP:
|
|
70
|
+
- ${divergenciasFluxo.join('\n- ')}` : ''}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Regras rápidas
|
|
74
|
+
|
|
75
|
+
- Sempre verificar se há bloqueios (`faseAtual.status === 'bloqueado'`) e destacar no resumo.
|
|
76
|
+
- Se detectar `novo_projeto`, **não** tentar gerar estado: apenas orientar o usuário a rodar `/iniciar-projeto`.
|
|
77
|
+
- Se o usuário preferir outra ação, respeitar e registrar no histórico (se aplicável).
|
|
@@ -2,12 +2,27 @@
|
|
|
2
2
|
description: Adicionar nova feature com fluxo estruturado (Análise → Implementação → Deploy)
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /
|
|
5
|
+
# /nova-feature - Nova Feature Maestro
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## Pré-requisitos e integração com o Maestro
|
|
12
|
+
|
|
13
|
+
1. Execute `/maestro` para garantir que o estado esteja sincronizado com os fluxos MCP (7/13/17 + Stitch).
|
|
14
|
+
2. Carregue o estado antes de qualquer tool:
|
|
15
|
+
```javascript
|
|
16
|
+
const estado = lerJson('.maestro/estado.json');
|
|
17
|
+
function salvarEstado(novoEstado) {
|
|
18
|
+
escreverJson('.maestro/estado.json', novoEstado, { spaces: 2 });
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
3. Use `content/guides/fases-mapeamento.md` para alinhar especialistas, prompts e templates de suporte a features.
|
|
22
|
+
4. Todos os artefatos criados devem ficar dentro de `docs/features/FEATURE-ID/` e ser registrados em `estado.historico`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
11
26
|
## Objetivo
|
|
12
27
|
|
|
13
28
|
Adicionar nova funcionalidade em projeto existente usando fluxo estruturado de 6 fases do MCP Maestro.
|
|
@@ -21,9 +36,9 @@ Adicionar nova funcionalidade em projeto existente usando fluxo estruturado de 6
|
|
|
21
36
|
- Feature que precisa de análise de impacto
|
|
22
37
|
|
|
23
38
|
**NÃO usar para:**
|
|
24
|
-
- Correção de bugs → Use `/
|
|
25
|
-
- Melhorias de código → Use `/
|
|
26
|
-
- Novo projeto → Use `/
|
|
39
|
+
- Correção de bugs → Use `/corrigir-bug`
|
|
40
|
+
- Melhorias de código → Use `/refatorar-codigo`
|
|
41
|
+
- Novo projeto → Use `/iniciar-projeto`
|
|
27
42
|
|
|
28
43
|
---
|
|
29
44
|
|
|
@@ -68,7 +83,7 @@ Adicionar nova funcionalidade em projeto existente usando fluxo estruturado de 6
|
|
|
68
83
|
**Se forneceu argumentos:**
|
|
69
84
|
|
|
70
85
|
```bash
|
|
71
|
-
/
|
|
86
|
+
/nova-feature Sistema de notificações push
|
|
72
87
|
```
|
|
73
88
|
|
|
74
89
|
→ Usar como descrição, pedir apenas impacto
|
|
@@ -77,13 +92,22 @@ Adicionar nova funcionalidade em projeto existente usando fluxo estruturado de 6
|
|
|
77
92
|
|
|
78
93
|
### Passo 2: Iniciar Fluxo de Feature
|
|
79
94
|
|
|
95
|
+
> [!IMPORTANT]
|
|
96
|
+
> **Protocolo stateless:** sempre envie `estado_json` carregado do disco para os tools MCP.
|
|
97
|
+
|
|
80
98
|
```typescript
|
|
99
|
+
const estadoJson = lerArquivo('.maestro/estado.json');
|
|
100
|
+
|
|
81
101
|
await mcp_maestro_nova_feature({
|
|
82
102
|
descricao: "[descrição fornecida]",
|
|
83
|
-
impacto_estimado: "[baixo/médio/alto]"
|
|
103
|
+
impacto_estimado: "[baixo/médio/alto]",
|
|
104
|
+
estado_json: estadoJson,
|
|
105
|
+
diretorio: process.cwd()
|
|
84
106
|
});
|
|
85
107
|
```
|
|
86
108
|
|
|
109
|
+
Após a resposta, atualize `estado.historico` com `acao: "feature_iniciada"`, registrando `feature_id` e impacto.
|
|
110
|
+
|
|
87
111
|
**MCP cria contexto separado para a feature e retorna:**
|
|
88
112
|
|
|
89
113
|
```json
|
|
@@ -146,25 +170,42 @@ Vamos começar. Que **entidades** ou **tabelas** serão afetadas?
|
|
|
146
170
|
|
|
147
171
|
### Passo 4: Avançar Entre Fases (Frontend-First)
|
|
148
172
|
|
|
149
|
-
**Usar `/
|
|
173
|
+
**Usar `/avancar-fase` (via `/maestro`) para conectar com o fluxo principal**
|
|
174
|
+
|
|
175
|
+
Quando estiver trabalhando dentro da feature, o acompanhamento das fases internas segue o mesmo padrão do Maestro. Utilize:
|
|
150
176
|
|
|
151
177
|
```
|
|
152
178
|
Fase 1: Análise ✅
|
|
153
|
-
↓ /
|
|
179
|
+
↓ /avancar-fase (passando o artefato docs/features/FEATURE-ID/01-impacto.md)
|
|
154
180
|
Fase 2: Requisitos ✅
|
|
155
|
-
↓ /
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
181
|
+
↓ /avancar-fase
|
|
182
|
+
...
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Caso precise apenas retomar o trabalho da feature antes de avançar, use `/continuar-fase` com o arquivo da subfase correspondente.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Passo 4: Avançar Entre Fases (Frontend-First)
|
|
190
|
+
|
|
191
|
+
**Mapeie especialistas e templates** usando `guides/fases-mapeamento.md` para cada etapa abaixo e carregue os prompts adequados (ex.: Contrato API → especialista "Contrato de API").
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
Fase 1: Análise ✅
|
|
195
|
+
↓ /avancar-fase (ou `/maestro` → sugere avanço)
|
|
196
|
+
Fase 2: Requisitos ✅
|
|
197
|
+
↓ /avancar-fase
|
|
198
|
+
Fase 3: Design ✅ (gera contrato OpenAPI)
|
|
199
|
+
↓ /avancar-fase
|
|
159
200
|
Fase 4: Implementação
|
|
160
201
|
├─ US-001-CONT (Contrato) ✅
|
|
161
202
|
├─ US-001-FE (Frontend) 🔄 ← Paralelo
|
|
162
|
-
├─ US-001-BE (Backend) 🔄
|
|
203
|
+
├─ US-001-BE (Backend) 🔄 ← Paralelo
|
|
163
204
|
└─ INT-001 (Integração) ⏳ ← Após FE+BE
|
|
164
|
-
↓ /
|
|
205
|
+
↓ /avancar-fase
|
|
165
206
|
Fase 5: Testes ✅
|
|
166
|
-
↓ /
|
|
167
|
-
Fase 6: Deploy ✅
|
|
207
|
+
↓ /avancar-fase
|
|
208
|
+
Fase 6: Deploy ✅ (encerra feature e atualiza estado)
|
|
168
209
|
```
|
|
169
210
|
|
|
170
211
|
**Protocolo Frontend-First:**
|
|
@@ -191,29 +232,41 @@ Fase 6: Deploy ✅
|
|
|
191
232
|
**Na Fase 4 (Implementação):**
|
|
192
233
|
|
|
193
234
|
```typescript
|
|
235
|
+
const estadoJson = lerArquivo('.maestro/estado.json');
|
|
236
|
+
|
|
194
237
|
// Contrato
|
|
195
238
|
await mcp_maestro_implementar_historia({
|
|
196
239
|
historia_id: "US-001-CONT",
|
|
197
|
-
modo: "iniciar"
|
|
240
|
+
modo: "iniciar",
|
|
241
|
+
estado_json: estadoJson,
|
|
242
|
+
diretorio: process.cwd()
|
|
198
243
|
});
|
|
199
244
|
|
|
200
245
|
// Frontend (pode iniciar em paralelo após contrato)
|
|
201
246
|
await mcp_maestro_implementar_historia({
|
|
202
247
|
historia_id: "US-001-FE",
|
|
203
|
-
modo: "iniciar"
|
|
248
|
+
modo: "iniciar",
|
|
249
|
+
estado_json: estadoJson,
|
|
250
|
+
diretorio: process.cwd()
|
|
204
251
|
});
|
|
205
252
|
|
|
206
253
|
// Backend (pode iniciar em paralelo após contrato)
|
|
207
254
|
await mcp_maestro_implementar_historia({
|
|
208
255
|
historia_id: "US-001-BE",
|
|
209
|
-
modo: "iniciar"
|
|
256
|
+
modo: "iniciar",
|
|
257
|
+
estado_json: estadoJson,
|
|
258
|
+
diretorio: process.cwd()
|
|
210
259
|
});
|
|
211
260
|
|
|
212
261
|
// Integração (somente após FE e BE finalizados)
|
|
213
262
|
await mcp_maestro_implementar_historia({
|
|
214
263
|
historia_id: "INT-001",
|
|
215
|
-
modo: "iniciar"
|
|
264
|
+
modo: "iniciar",
|
|
265
|
+
estado_json: estadoJson,
|
|
266
|
+
diretorio: process.cwd()
|
|
216
267
|
});
|
|
268
|
+
|
|
269
|
+
salvarEstado(atualizarHistorico(estado, { acao: 'feature_historia_iniciada', historia: 'INT-001' }));
|
|
217
270
|
```
|
|
218
271
|
|
|
219
272
|
---
|
|
@@ -223,7 +276,7 @@ await mcp_maestro_implementar_historia({
|
|
|
223
276
|
### Exemplo 1: Feature Simples (Impacto Baixo)
|
|
224
277
|
|
|
225
278
|
```
|
|
226
|
-
User: /
|
|
279
|
+
User: /nova-feature Adicionar filtro de data na listagem de pedidos
|
|
227
280
|
|
|
228
281
|
AI: Qual o impacto estimado? (baixo/médio/alto)
|
|
229
282
|
|
|
@@ -244,13 +297,13 @@ AI: ✅ Fluxo de Feature Iniciado (FEAT-001)
|
|
|
244
297
|
|
|
245
298
|
User: Sim
|
|
246
299
|
|
|
247
|
-
AI: [Avança para Fase 2
|
|
300
|
+
AI: [Avança para Fase 2 executando `/maestro` → `/avancar-fase`]
|
|
248
301
|
```
|
|
249
302
|
|
|
250
303
|
### Exemplo 2: Feature Complexa (Impacto Alto)
|
|
251
304
|
|
|
252
305
|
```
|
|
253
|
-
User: /
|
|
306
|
+
User: /nova-feature Sistema de notificações push em tempo real
|
|
254
307
|
|
|
255
308
|
AI: Qual o impacto estimado?
|
|
256
309
|
|
|
@@ -290,10 +343,10 @@ AI: ✅ Fluxo de Feature Iniciado (FEAT-002)
|
|
|
290
343
|
## Comandos Relacionados
|
|
291
344
|
|
|
292
345
|
```
|
|
293
|
-
/
|
|
294
|
-
/
|
|
295
|
-
/
|
|
296
|
-
/
|
|
346
|
+
/nova-feature [descrição] → Inicia fluxo de feature alinhado ao estado
|
|
347
|
+
/continuar-fase → Retoma etapa corrente da feature
|
|
348
|
+
/avancar-fase → Valida gate e registra próxima fase
|
|
349
|
+
/corrigir-bug → Se surgir bug durante a feature
|
|
297
350
|
```
|
|
298
351
|
|
|
299
352
|
---
|
|
@@ -369,7 +422,7 @@ FEAT-001: Sistema de Notificações (Épico)
|
|
|
369
422
|
├─ FEAT-001-B: Frontend (UI)
|
|
370
423
|
└─ FEAT-001-C: Integração (Push)
|
|
371
424
|
|
|
372
|
-
Implementar um por vez com
|
|
425
|
+
Implementar um por vez com `/nova-feature`
|
|
373
426
|
```
|
|
374
427
|
|
|
375
428
|
### Conflito com Feature em Andamento
|
|
@@ -2,12 +2,28 @@
|
|
|
2
2
|
description: Refatoração estruturada de código (Análise → Testes → Refactor → Validação)
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /
|
|
5
|
+
# /refatorar-codigo - Refatoração Maestro
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## Integração obrigatória com o Maestro
|
|
12
|
+
|
|
13
|
+
1. **Sincronize o estado** executando `/maestro` antes de começar. Garanta que não há gates bloqueados.
|
|
14
|
+
2. **Carregue o estado e defina helpers**:
|
|
15
|
+
```javascript
|
|
16
|
+
const estado = lerJson('.maestro/estado.json');
|
|
17
|
+
function salvarEstado(novoEstado) {
|
|
18
|
+
escreverJson('.maestro/estado.json', novoEstado, { spaces: 2 });
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
3. Sempre passe `estado_json` ao chamar qualquer tool MCP (`mcp_maestro_refatorar`, `mcp_maestro_avancar_refatoracao`, etc.).
|
|
22
|
+
4. Atualize `estado.historico` com eventos como `refatoracao_iniciada`, `refatoracao_passo_concluido` e `refatoracao_finalizada`, armazenando `refactor_id` e arquivos afetados.
|
|
23
|
+
5. Use `content/guides/fases-mapeamento.md` para escolher especialistas de apoio (Arquitetura, Performance, Testes) conforme o foco da refatoração.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
11
27
|
## Objetivo
|
|
12
28
|
|
|
13
29
|
Refatorar código de forma segura e estruturada usando fluxo de 5 fases do MCP Maestro, com testes de caracterização e validação contínua.
|
|
@@ -22,8 +38,8 @@ Refatorar código de forma segura e estruturada usando fluxo de 5 fases do MCP M
|
|
|
22
38
|
- Migrar para novo padrão ou arquitetura
|
|
23
39
|
|
|
24
40
|
**NÃO usar para:**
|
|
25
|
-
- Adicionar funcionalidade → Use `/
|
|
26
|
-
- Corrigir bugs → Use `/
|
|
41
|
+
- Adicionar funcionalidade → Use `/nova-feature`
|
|
42
|
+
- Corrigir bugs → Use `/corrigir-bug`
|
|
27
43
|
|
|
28
44
|
---
|
|
29
45
|
|
|
@@ -75,10 +91,16 @@ Refatorar código de forma segura e estruturada usando fluxo de 5 fases do MCP M
|
|
|
75
91
|
### Passo 2: Iniciar Fluxo de Refatoração
|
|
76
92
|
|
|
77
93
|
```typescript
|
|
94
|
+
const estadoJson = lerArquivo('.maestro/estado.json');
|
|
95
|
+
|
|
78
96
|
await mcp_maestro_refatorar({
|
|
79
97
|
area: "[área fornecida]",
|
|
80
|
-
motivo: "[motivo]"
|
|
98
|
+
motivo: "[motivo]",
|
|
99
|
+
estado_json: estadoJson,
|
|
100
|
+
diretorio: process.cwd()
|
|
81
101
|
});
|
|
102
|
+
|
|
103
|
+
salvarEstado(registrarHistorico(estado, { acao: 'refatoracao_iniciada', area, motivo }));
|
|
82
104
|
```
|
|
83
105
|
|
|
84
106
|
**MCP cria contexto e retorna:**
|
|
@@ -397,7 +419,7 @@ Use: `/deploy production`
|
|
|
397
419
|
### Exemplo 1: Refatorar Serviço Complexo
|
|
398
420
|
|
|
399
421
|
```
|
|
400
|
-
User: /
|
|
422
|
+
User: /refatorar-codigo
|
|
401
423
|
|
|
402
424
|
AI: Qual área deseja refatorar?
|
|
403
425
|
|
|
@@ -435,7 +457,7 @@ AI: [Fase 2: Cria testes de caracterização]
|
|
|
435
457
|
|
|
436
458
|
Todos passando. Pronto para refatorar!
|
|
437
459
|
|
|
438
|
-
User: /
|
|
460
|
+
User: /avancar-fase (ou `/maestro` para validar e avançar)
|
|
439
461
|
|
|
440
462
|
AI: [Fase 3: Refatoração]
|
|
441
463
|
|
|
@@ -463,7 +485,7 @@ AI: [Fase 3: Refatoração]
|
|
|
463
485
|
### Exemplo 2: Migração de Padrão
|
|
464
486
|
|
|
465
487
|
```
|
|
466
|
-
User: /
|
|
488
|
+
User: /refatorar-codigo Migrar de callback para async/await
|
|
467
489
|
|
|
468
490
|
AI: Motivo?
|
|
469
491
|
|
|
@@ -496,9 +518,10 @@ AI: ✅ Refactor initiated
|
|
|
496
518
|
## Comandos Relacionados
|
|
497
519
|
|
|
498
520
|
```
|
|
499
|
-
/
|
|
500
|
-
/
|
|
501
|
-
/
|
|
521
|
+
/refatorar-codigo [área] → Inicia refatoração integrada ao estado
|
|
522
|
+
/continuar-fase → Retoma passo atual (usa análise do artefato)
|
|
523
|
+
/avancar-fase → Valida gate pós-refatoração
|
|
524
|
+
/status-projeto → Ver progresso e métricas
|
|
502
525
|
```
|
|
503
526
|
|
|
504
527
|
---
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Mostra o status completo do projeto Maestro e recomenda próximas ações
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 📊 Workflow de Status - /status-projeto
|
|
6
|
+
|
|
7
|
+
## 1. Ler estado
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
const estado = lerJson('.maestro/estado.json');
|
|
11
|
+
if (!estado) throw new Error('Projeto ainda não inicializado. Execute /iniciar-projeto.');
|
|
12
|
+
const fases = Object.values(estado.fases || {});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 2. Calcular métricas
|
|
16
|
+
|
|
17
|
+
- Fases concluídas (`status === 'concluida'`).
|
|
18
|
+
- Progresso percentual: `concluidas / totalFases`.
|
|
19
|
+
- Score médio (ignorar `null`).
|
|
20
|
+
- Bloqueios: fases com `status === 'bloqueado'`.
|
|
21
|
+
- Próxima ação sugerida: se há bloqueio → listar; se fase atual não concluída → `/continuar-fase`; caso contrário → `/avancar-fase`.
|
|
22
|
+
|
|
23
|
+
## 3. Resposta padrão
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
🎯 **Projeto:** {estado.projeto.nome}
|
|
27
|
+
📈 **Progresso:** {progresso}% ({fasesConcluidas}/{totalFases})
|
|
28
|
+
🔄 **Fase Atual:** {faseAtual.numero}/{totalFases} - {faseAtual.nome}
|
|
29
|
+
👤 **Especialista:** {faseAtual.especialista}
|
|
30
|
+
📊 **Score Médio:** {scoreMedio}
|
|
31
|
+
|
|
32
|
+
## 📋 Detalhes
|
|
33
|
+
| Fase | Status | Score | Especialista | Últ. Atualização |
|
|
34
|
+
|------|--------|-------|--------------|------------------|
|
|
35
|
+
{linhas}
|
|
36
|
+
|
|
37
|
+
{bloqueios ? `⚠️ Bloqueios detectados:` + lista : ''}
|
|
38
|
+
|
|
39
|
+
🎯 **Próximas ações sugeridas:**
|
|
40
|
+
- {acao1}
|
|
41
|
+
- {acao2}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 4. Recomendações
|
|
45
|
+
|
|
46
|
+
Baseie-se em heurísticas simples:
|
|
47
|
+
- Ritmo lento (`diasFase > media`) → sugerir revisão.
|
|
48
|
+
- Score baixo (< mínimo + 5) → recomendar `/continuar-fase` focando na validação.
|
|
49
|
+
- Próxima fase crítica (ex.: Prototipagem, Arquitetura) → antecipar especialistas/artefatos.
|
|
50
|
+
|
|
51
|
+
## 5. Complementos
|
|
52
|
+
|
|
53
|
+
- Se o usuário pedir filtros (ex.: "status completo"), incluir lista detalhada dos artefatos por fase.
|
|
54
|
+
- Caso não exista `estado.fases`, instruir execução de `/iniciar-projeto`.
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface InitOptions {
|
|
2
2
|
force?: boolean;
|
|
3
3
|
minimal?: boolean;
|
|
4
|
+
ide?: 'windsurf' | 'cursor' | 'antigravity';
|
|
4
5
|
}
|
|
5
|
-
export declare function init(options
|
|
6
|
+
export declare function init(options: InitOptions): Promise<void>;
|
|
6
7
|
export {};
|
package/dist/commands/init.js
CHANGED
|
@@ -5,7 +5,27 @@ import fse from 'fs-extra';
|
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
8
|
+
const IDE_CONFIGS = {
|
|
9
|
+
windsurf: {
|
|
10
|
+
path: '.windsurfrules',
|
|
11
|
+
header: '',
|
|
12
|
+
workflowsDir: '.windsurf/workflows',
|
|
13
|
+
skillsDir: '.windsurf/skills'
|
|
14
|
+
},
|
|
15
|
+
cursor: {
|
|
16
|
+
path: '.cursorrules',
|
|
17
|
+
header: '',
|
|
18
|
+
workflowsDir: '.cursor/commands',
|
|
19
|
+
skillsDir: '.cursor/skills'
|
|
20
|
+
},
|
|
21
|
+
antigravity: {
|
|
22
|
+
path: '.gemini/GEMINI.md',
|
|
23
|
+
header: '---\ntrigger: always_on\nsystem: maestro\nversion: 1.0.0\n---\n\n',
|
|
24
|
+
workflowsDir: '.agent/workflows',
|
|
25
|
+
skillsDir: '.agent/skills'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export async function init(options) {
|
|
9
29
|
const cwd = process.cwd();
|
|
10
30
|
const spinner = ora();
|
|
11
31
|
console.log(chalk.blue.bold('\n🎯 Maestro - Inicializando projeto\n'));
|
|
@@ -25,7 +45,8 @@ export async function init(options = {}) {
|
|
|
25
45
|
await fse.writeJSON(join(cwd, '.maestro', 'config.json'), {
|
|
26
46
|
version: '1.0.0',
|
|
27
47
|
initialized: new Date().toISOString(),
|
|
28
|
-
|
|
48
|
+
ide: options.ide || 'windsurf',
|
|
49
|
+
mcpFree: true
|
|
29
50
|
}, { spaces: 2 });
|
|
30
51
|
spinner.succeed('Estrutura .maestro/ criada');
|
|
31
52
|
// 2. Copiar content para .maestro/content/ (se não minimal)
|
|
@@ -42,29 +63,41 @@ export async function init(options = {}) {
|
|
|
42
63
|
}
|
|
43
64
|
spinner.succeed('Content copiado para .maestro/content/');
|
|
44
65
|
}
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
66
|
+
// 4. Configurar IDE específica
|
|
67
|
+
const ideConfig = IDE_CONFIGS[options.ide];
|
|
68
|
+
spinner.start(`Configurando IDE: ${options.ide}...`);
|
|
69
|
+
// Ler RULES.md base
|
|
70
|
+
const rulesPath = join(contentSource, 'rules', 'RULES.md');
|
|
71
|
+
let rulesContent = '';
|
|
72
|
+
if (await fse.pathExists(rulesPath)) {
|
|
73
|
+
rulesContent = await fse.readFile(rulesPath, 'utf-8');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
rulesContent = generateDefaultRules();
|
|
51
77
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
// Criar diretórios específicos da IDE
|
|
79
|
+
await fse.ensureDir(join(cwd, dirname(ideConfig.path)));
|
|
80
|
+
await fse.ensureDir(join(cwd, ideConfig.workflowsDir));
|
|
81
|
+
await fse.ensureDir(join(cwd, ideConfig.skillsDir));
|
|
82
|
+
// Copiar workflows para diretório específico da IDE
|
|
55
83
|
const workflowsSrc = join(contentSource, 'workflows');
|
|
56
|
-
const workflowsDest = join(cwd,
|
|
84
|
+
const workflowsDest = join(cwd, ideConfig.workflowsDir);
|
|
57
85
|
if (await fse.pathExists(workflowsSrc)) {
|
|
58
86
|
await fse.copy(workflowsSrc, workflowsDest, { overwrite: options.force });
|
|
59
87
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
88
|
+
// Copiar skills para diretório específico da IDE
|
|
89
|
+
const skillsSrc = join(contentSource, 'skills');
|
|
90
|
+
const skillsDest = join(cwd, ideConfig.skillsDir);
|
|
91
|
+
if (await fse.pathExists(skillsSrc)) {
|
|
92
|
+
await fse.copy(skillsSrc, skillsDest, { overwrite: options.force });
|
|
93
|
+
}
|
|
94
|
+
// Gerar arquivo de regras
|
|
95
|
+
const targetPath = join(cwd, ideConfig.path);
|
|
96
|
+
const content = ideConfig.header + rulesContent;
|
|
97
|
+
await fse.writeFile(targetPath, content);
|
|
98
|
+
spinner.succeed(`IDE ${options.ide} configurada com sucesso!`);
|
|
66
99
|
// Resumo
|
|
67
|
-
console.log(chalk.green.bold(
|
|
100
|
+
console.log(chalk.green.bold(`\n✅ Maestro inicializado para ${options.ide}\n`));
|
|
68
101
|
console.log(chalk.dim('Estrutura criada:'));
|
|
69
102
|
console.log(chalk.dim(' .maestro/'));
|
|
70
103
|
console.log(chalk.dim(' ├── config.json'));
|
|
@@ -76,14 +109,13 @@ export async function init(options = {}) {
|
|
|
76
109
|
console.log(chalk.dim(' ├── guides/'));
|
|
77
110
|
console.log(chalk.dim(' └── prompts/'));
|
|
78
111
|
}
|
|
79
|
-
console.log(chalk.dim(
|
|
80
|
-
console.log(chalk.dim(
|
|
81
|
-
console.log(chalk.dim(
|
|
82
|
-
console.log(chalk.
|
|
83
|
-
console.log(
|
|
84
|
-
console.log('
|
|
85
|
-
console.log(
|
|
86
|
-
console.log(' 2. Inicie um novo projeto com: @mcp:maestro iniciar_projeto');
|
|
112
|
+
console.log(chalk.dim(` ${ideConfig.workflowsDir}/`));
|
|
113
|
+
console.log(chalk.dim(` ${ideConfig.skillsDir}/`));
|
|
114
|
+
console.log(chalk.dim(` ${ideConfig.path}`));
|
|
115
|
+
console.log(chalk.blue('\n🎯 Próximos passos:'));
|
|
116
|
+
console.log(` 1. Abra sua ${options.ide}`);
|
|
117
|
+
console.log(' 2. Digite: /maestro');
|
|
118
|
+
console.log(' 3. Comece a desenvolver!');
|
|
87
119
|
console.log('');
|
|
88
120
|
}
|
|
89
121
|
catch (error) {
|
|
@@ -92,47 +124,59 @@ export async function init(options = {}) {
|
|
|
92
124
|
process.exit(1);
|
|
93
125
|
}
|
|
94
126
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
97
|
-
trigger: always_on
|
|
98
|
-
system: maestro
|
|
99
|
-
version: 1.0.0
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
# Maestro - Desenvolvimento Assistido por IA
|
|
103
|
-
|
|
104
|
-
> Este projeto utiliza o sistema Maestro para desenvolvimento estruturado.
|
|
127
|
+
function generateDefaultRules() {
|
|
128
|
+
return `# Maestro File System - AI Rules
|
|
105
129
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
\`\`\`json
|
|
109
|
-
{
|
|
110
|
-
"mcpServers": {
|
|
111
|
-
"maestro": {
|
|
112
|
-
"serverUrl": "https://maestro.deluna.dev.br/mcp"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
\`\`\`
|
|
130
|
+
> Este arquivo define como a IA deve se comportar ao trabalhar com o sistema Maestro File System.
|
|
117
131
|
|
|
118
132
|
## Como Usar
|
|
119
133
|
|
|
120
|
-
1. **Iniciar projeto**: Use \`
|
|
121
|
-
2. **Avançar fases**: Use \`
|
|
122
|
-
3. **Ver status**: Use
|
|
134
|
+
1. **Iniciar projeto**: Use \`/iniciar-projeto\` para começar
|
|
135
|
+
2. **Avançar fases**: Use \`/avancar-fase\` para avançar
|
|
136
|
+
3. **Ver status**: Use \`/status-projeto\` para ver progresso
|
|
137
|
+
4. **Continuar**: Use \`/continuar\` para retomar trabalho
|
|
123
138
|
|
|
124
139
|
## Estrutura Local
|
|
125
140
|
|
|
126
141
|
| Pasta | Conteúdo |
|
|
127
142
|
|-------|----------|
|
|
128
143
|
| \`.maestro/estado.json\` | Estado do projeto (fonte da verdade) |
|
|
129
|
-
| \`.maestro/SYSTEM.md\` | Contexto atual para IA |
|
|
130
144
|
| \`.maestro/content/\` | Especialistas, templates, prompts |
|
|
131
|
-
| \`.
|
|
132
|
-
| \`.
|
|
145
|
+
| \`.windsurf/workflows/\` | Workflows para Windsurf |
|
|
146
|
+
| \`.windsurf/skills/\` | Skills especializadas |
|
|
147
|
+
| \`.cursor/commands/\` | Commands para Cursor |
|
|
148
|
+
| \`.cursor/skills/\` | Skills especializadas |
|
|
149
|
+
| \`.agent/workflows/\` | Workflows para Antigravity |
|
|
150
|
+
| \`.agent/skills/\` | Skills especializadas |
|
|
151
|
+
|
|
152
|
+
## Comandos Disponíveis
|
|
153
|
+
|
|
154
|
+
### Gerenciamento de Projeto
|
|
155
|
+
- \`/maestro\` - Comando universal inteligente
|
|
156
|
+
- \`/iniciar-projeto\` - Iniciar novo projeto
|
|
157
|
+
- \`/avancar-fase\` - Avançar para próxima fase
|
|
158
|
+
- \`/status-projeto\` - Ver status e progresso
|
|
159
|
+
- \`/continuar\` - Continuar fase atual
|
|
160
|
+
|
|
161
|
+
### Desenvolvimento
|
|
162
|
+
- \`/nova-feature\` - Criar nova funcionalidade
|
|
163
|
+
- \`/corrigir-bug\` - Debugging estruturado
|
|
164
|
+
- \`/refatorar-codigo\` - Refatoração segura
|
|
165
|
+
|
|
166
|
+
## Especialistas IA
|
|
167
|
+
|
|
168
|
+
- Gestão de Produto
|
|
169
|
+
- Engenharia de Requisitos
|
|
170
|
+
- UX Design
|
|
171
|
+
- Arquitetura de Software
|
|
172
|
+
- E mais 20 especialistas disponíveis
|
|
173
|
+
|
|
174
|
+
## Orquestração Local
|
|
175
|
+
|
|
176
|
+
Este sistema opera 100% localmente, sem dependência de MCP remoto. A IA detecta automaticamente os arquivos e workflows disponíveis.
|
|
133
177
|
|
|
134
178
|
## Estado do Projeto
|
|
135
179
|
|
|
136
|
-
O estado é mantido em \`.maestro/estado.json\` e
|
|
180
|
+
O estado é mantido em \`.maestro/estado.json\` e serve como fonte da verdade para o progresso do projeto.
|
|
137
181
|
`;
|
|
138
182
|
}
|