@maestro-ai/cli 1.2.0 → 1.3.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/content/guides/fases-mapeamento.md +31 -32
- package/content/guides/guide-brainstorm.md +38 -0
- package/content/guides/guide-orquestracao.md +45 -0
- package/content/guides/guide-testes.md +51 -0
- package/content/guides/guide-troubleshooting.md +43 -0
- package/content/guides/guide-validacao.md +50 -0
- package/content/guides/internal/automated-events.md +27 -0
- package/content/guides/internal/automated-map.md +56 -0
- package/content/guides/internal/automated-stitch.md +51 -0
- package/content/guides/internal/automated-system.md +46 -0
- package/content/guides/mapa-sistema.md +86 -0
- package/content/guides/workflows-avancados.md +62 -0
- package/content/rules/GEMINI.md +70 -762
- package/content/rules/RULES.md +71 -761
- package/content/rules/complexity-rules.md +43 -0
- package/content/rules/quality-gates.md +55 -43
- package/content/rules/security-rules.md +40 -0
- package/content/rules/structure-rules.md +63 -0
- package/content/rules/validation-rules.md +56 -97
- package/content/workflows/{maestro.md → 00-maestro.md} +7 -6
- package/content/workflows/01-iniciar-projeto.md +59 -0
- package/content/workflows/02-avancar-fase.md +72 -0
- package/content/workflows/04-implementar-historia.md +64 -0
- package/content/workflows/05-nova-feature.md +39 -0
- package/content/workflows/06-corrigir-bug.md +34 -0
- package/content/workflows/07-refatorar-codigo.md +34 -0
- package/dist/commands/init.js +17 -16
- package/package.json +1 -1
- package/content/workflows/avancar-fase.md +0 -84
- package/content/workflows/brainstorm.md +0 -127
- package/content/workflows/corrigir-bug.md +0 -530
- package/content/workflows/create-app.md +0 -59
- package/content/workflows/iniciar-projeto.md +0 -59
- package/content/workflows/melhorar-feature.md +0 -63
- package/content/workflows/nova-feature.md +0 -438
- package/content/workflows/orchestrate.md +0 -237
- package/content/workflows/plan.md +0 -89
- package/content/workflows/refatorar-codigo.md +0 -623
- package/content/workflows/status-projeto.md +0 -54
- package/content/workflows/testar.md +0 -144
- package/content/workflows/ux-avancado.md +0 -296
- package/content/workflows/validar-gate.md +0 -413
- /package/content/workflows/{continuar-fase.md → 03-continuar-fase.md} +0 -0
- /package/content/workflows/{deploy.md → 08-deploy-projeto.md} +0 -0
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Adicionar nova feature com fluxo estruturado (Análise → Implementação → Deploy)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /nova-feature - Nova Feature Maestro
|
|
6
|
-
|
|
7
|
-
$ARGUMENTS
|
|
8
|
-
|
|
9
|
-
---
|
|
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
|
-
|
|
26
|
-
## Objetivo
|
|
27
|
-
|
|
28
|
-
Adicionar nova funcionalidade em projeto existente usando fluxo estruturado de 6 fases do MCP Maestro.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Quando Usar
|
|
33
|
-
|
|
34
|
-
- Adicionar feature em produto já existente
|
|
35
|
-
- Feature que impacta arquitetura, modelo ou API
|
|
36
|
-
- Feature que precisa de análise de impacto
|
|
37
|
-
|
|
38
|
-
**NÃO usar para:**
|
|
39
|
-
- Correção de bugs → Use `/corrigir-bug`
|
|
40
|
-
- Melhorias de código → Use `/refatorar-codigo`
|
|
41
|
-
- Novo projeto → Use `/iniciar-projeto`
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Fluxo de 6 Fases
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
1. Análise de Impacto
|
|
49
|
-
↓
|
|
50
|
-
2. Refinamento de Requisitos
|
|
51
|
-
↓
|
|
52
|
-
3. Design/Arquitetura
|
|
53
|
-
↓
|
|
54
|
-
4. Implementação (Contrato → FE/BE paralelo → Integração)
|
|
55
|
-
↓
|
|
56
|
-
5. Testes
|
|
57
|
-
↓
|
|
58
|
-
6. Deploy
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Execução
|
|
64
|
-
|
|
65
|
-
### Passo 1: Coleta de Informações
|
|
66
|
-
|
|
67
|
-
**Perguntar ao usuário:**
|
|
68
|
-
|
|
69
|
-
```markdown
|
|
70
|
-
🆕 **Nova Feature**
|
|
71
|
-
|
|
72
|
-
1. Descreva a funcionalidade a ser adicionada:
|
|
73
|
-
[Exemplo: Sistema de notificações push para usuários]
|
|
74
|
-
|
|
75
|
-
2. Qual o impacto estimado?
|
|
76
|
-
- **baixo**: Pequena mudança, sem impacto em arquitetura
|
|
77
|
-
- **médio**: Mudança moderada, pode afetar alguns módulos
|
|
78
|
-
- **alto**: Grande mudança, afeta arquitetura core
|
|
79
|
-
|
|
80
|
-
Escolha: [baixo/médio/alto]
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Se forneceu argumentos:**
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
/nova-feature Sistema de notificações push
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
→ Usar como descrição, pedir apenas impacto
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
### Passo 2: Iniciar Fluxo de Feature
|
|
94
|
-
|
|
95
|
-
> [!IMPORTANT]
|
|
96
|
-
> **Protocolo stateless:** sempre envie `estado_json` carregado do disco para os tools MCP.
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
const estadoJson = lerArquivo('.maestro/estado.json');
|
|
100
|
-
|
|
101
|
-
await mcp_maestro_nova_feature({
|
|
102
|
-
descricao: "[descrição fornecida]",
|
|
103
|
-
impacto_estimado: "[baixo/médio/alto]",
|
|
104
|
-
estado_json: estadoJson,
|
|
105
|
-
diretorio: process.cwd()
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Após a resposta, atualize `estado.historico` com `acao: "feature_iniciada"`, registrando `feature_id` e impacto.
|
|
110
|
-
|
|
111
|
-
**MCP cria contexto separado para a feature e retorna:**
|
|
112
|
-
|
|
113
|
-
```json
|
|
114
|
-
{
|
|
115
|
-
"feature_id": "FEAT-001",
|
|
116
|
-
"fases": [
|
|
117
|
-
"Análise de Impacto",
|
|
118
|
-
"Refinamento",
|
|
119
|
-
"Design",
|
|
120
|
-
"Implementação",
|
|
121
|
-
"Testes",
|
|
122
|
-
"Deploy"
|
|
123
|
-
],
|
|
124
|
-
"fase_atual": 1
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
### Passo 3: Fase 1 - Análise de Impacto
|
|
131
|
-
|
|
132
|
-
**Apresentar:**
|
|
133
|
-
|
|
134
|
-
```markdown
|
|
135
|
-
✅ **Fluxo de Feature Iniciado** (FEAT-001)
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
🎯 **Fase 1/6: Análise de Impacto**
|
|
140
|
-
🤖 **Especialista:** Arquitetura de Software
|
|
141
|
-
|
|
142
|
-
## Análise de Impacto
|
|
143
|
-
|
|
144
|
-
Antes de implementar, vamos analisar:
|
|
145
|
-
|
|
146
|
-
1. **Modelo de Dados** - Novas entidades ou alterações?
|
|
147
|
-
- Tabelas afetadas:
|
|
148
|
-
- Novos campos:
|
|
149
|
-
- Relacionamentos:
|
|
150
|
-
|
|
151
|
-
2. **APIs** - Novos endpoints ou mudanças?
|
|
152
|
-
- Endpoints novos:
|
|
153
|
-
- Endpoints modificados:
|
|
154
|
-
- Breaking changes:
|
|
155
|
-
|
|
156
|
-
3. **Arquitetura** - Novos serviços ou refatorações?
|
|
157
|
-
- Novos módulos:
|
|
158
|
-
- Dependências:
|
|
159
|
-
- Integrações externas:
|
|
160
|
-
|
|
161
|
-
4. **Frontend** - Componentes e páginas?
|
|
162
|
-
- Novos componentes:
|
|
163
|
-
- Páginas afetadas:
|
|
164
|
-
- Mudanças de UX:
|
|
165
|
-
|
|
166
|
-
Vamos começar. Que **entidades** ou **tabelas** serão afetadas?
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
### Passo 4: Avançar Entre Fases (Frontend-First)
|
|
172
|
-
|
|
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:
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
Fase 1: Análise ✅
|
|
179
|
-
↓ /avancar-fase (passando o artefato docs/features/FEATURE-ID/01-impacto.md)
|
|
180
|
-
Fase 2: Requisitos ✅
|
|
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
|
|
200
|
-
Fase 4: Implementação
|
|
201
|
-
├─ US-001-CONT (Contrato) ✅
|
|
202
|
-
├─ US-001-FE (Frontend) 🔄 ← Paralelo
|
|
203
|
-
├─ US-001-BE (Backend) 🔄 ← Paralelo
|
|
204
|
-
└─ INT-001 (Integração) ⏳ ← Após FE+BE
|
|
205
|
-
↓ /avancar-fase
|
|
206
|
-
Fase 5: Testes ✅
|
|
207
|
-
↓ /avancar-fase
|
|
208
|
-
Fase 6: Deploy ✅ (encerra feature e atualiza estado)
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
**Protocolo Frontend-First:**
|
|
212
|
-
|
|
213
|
-
1. **Contrato primeiro** (CONT-001)
|
|
214
|
-
- Gera OpenAPI YAML
|
|
215
|
-
- Gera types para FE e BE
|
|
216
|
-
- Gera mock server
|
|
217
|
-
|
|
218
|
-
2. **FE e BE em paralelo**
|
|
219
|
-
- Frontend desenvolve contra mock
|
|
220
|
-
- Backend implementa contrato
|
|
221
|
-
- Ambos seguem types gerados
|
|
222
|
-
|
|
223
|
-
3. **Integração no final**
|
|
224
|
-
- Remove mocks
|
|
225
|
-
- Conecta FE com BE real
|
|
226
|
-
- Testes E2E
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
### Passo 5: Implementar História
|
|
231
|
-
|
|
232
|
-
**Na Fase 4 (Implementação):**
|
|
233
|
-
|
|
234
|
-
```typescript
|
|
235
|
-
const estadoJson = lerArquivo('.maestro/estado.json');
|
|
236
|
-
|
|
237
|
-
// Contrato
|
|
238
|
-
await mcp_maestro_implementar_historia({
|
|
239
|
-
historia_id: "US-001-CONT",
|
|
240
|
-
modo: "iniciar",
|
|
241
|
-
estado_json: estadoJson,
|
|
242
|
-
diretorio: process.cwd()
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
// Frontend (pode iniciar em paralelo após contrato)
|
|
246
|
-
await mcp_maestro_implementar_historia({
|
|
247
|
-
historia_id: "US-001-FE",
|
|
248
|
-
modo: "iniciar",
|
|
249
|
-
estado_json: estadoJson,
|
|
250
|
-
diretorio: process.cwd()
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
// Backend (pode iniciar em paralelo após contrato)
|
|
254
|
-
await mcp_maestro_implementar_historia({
|
|
255
|
-
historia_id: "US-001-BE",
|
|
256
|
-
modo: "iniciar",
|
|
257
|
-
estado_json: estadoJson,
|
|
258
|
-
diretorio: process.cwd()
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
// Integração (somente após FE e BE finalizados)
|
|
262
|
-
await mcp_maestro_implementar_historia({
|
|
263
|
-
historia_id: "INT-001",
|
|
264
|
-
modo: "iniciar",
|
|
265
|
-
estado_json: estadoJson,
|
|
266
|
-
diretorio: process.cwd()
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
salvarEstado(atualizarHistorico(estado, { acao: 'feature_historia_iniciada', historia: 'INT-001' }));
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
## Exemplos de Uso
|
|
275
|
-
|
|
276
|
-
### Exemplo 1: Feature Simples (Impacto Baixo)
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
User: /nova-feature Adicionar filtro de data na listagem de pedidos
|
|
280
|
-
|
|
281
|
-
AI: Qual o impacto estimado? (baixo/médio/alto)
|
|
282
|
-
|
|
283
|
-
User: baixo
|
|
284
|
-
|
|
285
|
-
AI: ✅ Fluxo de Feature Iniciado (FEAT-001)
|
|
286
|
-
|
|
287
|
-
🎯 Fase 1/6: Análise de Impacto
|
|
288
|
-
|
|
289
|
-
## Análise Rápida
|
|
290
|
-
|
|
291
|
-
Impacto baixo detectado. Feature simples:
|
|
292
|
-
- Frontend: Adicionar DatePicker component
|
|
293
|
-
- Backend: Adicionar parâmetro `?date_from` e `?date_to` em GET /orders
|
|
294
|
-
- Banco: Sem mudanças (usa índice existente)
|
|
295
|
-
|
|
296
|
-
Correto? Vamos para refinamento?
|
|
297
|
-
|
|
298
|
-
User: Sim
|
|
299
|
-
|
|
300
|
-
AI: [Avança para Fase 2 executando `/maestro` → `/avancar-fase`]
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### Exemplo 2: Feature Complexa (Impacto Alto)
|
|
304
|
-
|
|
305
|
-
```
|
|
306
|
-
User: /nova-feature Sistema de notificações push em tempo real
|
|
307
|
-
|
|
308
|
-
AI: Qual o impacto estimado?
|
|
309
|
-
|
|
310
|
-
User: alto
|
|
311
|
-
|
|
312
|
-
AI: ✅ Fluxo de Feature Iniciado (FEAT-002)
|
|
313
|
-
|
|
314
|
-
🎯 Fase 1/6: Análise de Impacto
|
|
315
|
-
|
|
316
|
-
## Análise Profunda Necessária
|
|
317
|
-
|
|
318
|
-
Impacto alto detectado. Feature complexa:
|
|
319
|
-
|
|
320
|
-
**Modelo de Dados:**
|
|
321
|
-
- Nova tabela: `notifications`
|
|
322
|
-
- Novo relacionamento: `users` ← `notifications`
|
|
323
|
-
|
|
324
|
-
**Arquitetura:**
|
|
325
|
-
- Novo serviço: `NotificationService`
|
|
326
|
-
- Integração: Firebase Cloud Messaging (FCM)
|
|
327
|
-
- Infraestrutura: WebSocket server
|
|
328
|
-
|
|
329
|
-
**Frontend:**
|
|
330
|
-
- Service Worker para push
|
|
331
|
-
- Componente NotificationBell
|
|
332
|
-
- Página de configurações
|
|
333
|
-
|
|
334
|
-
**Backend:**
|
|
335
|
-
- Endpoints: POST /notifications, GET /notifications
|
|
336
|
-
- Job: NotificationDispatcherJob
|
|
337
|
-
|
|
338
|
-
Vamos detalhar cada parte. Começando pelo modelo de dados...
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
## Comandos Relacionados
|
|
344
|
-
|
|
345
|
-
```
|
|
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
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
## Estrutura de Arquivos Gerados
|
|
355
|
-
|
|
356
|
-
```
|
|
357
|
-
docs/
|
|
358
|
-
├── features/
|
|
359
|
-
│ └── FEAT-001-filtro-data/
|
|
360
|
-
│ ├── 01-impacto.md
|
|
361
|
-
│ ├── 02-requisitos.md
|
|
362
|
-
│ ├── 03-design.md
|
|
363
|
-
│ ├── 04-contrato.yaml
|
|
364
|
-
│ ├── 05-plano-testes.md
|
|
365
|
-
│ └── 06-deploy-plan.md
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## Regras Críticas
|
|
371
|
-
|
|
372
|
-
### ✅ SEMPRE:
|
|
373
|
-
|
|
374
|
-
1. Fazer análise de impacto antes de implementar
|
|
375
|
-
2. Gerar contrato de API antes de FE/BE
|
|
376
|
-
3. Testar integração após FE+BE prontos
|
|
377
|
-
4. Documentar mudanças em ADR se impacto alto
|
|
378
|
-
|
|
379
|
-
### ❌ NUNCA:
|
|
380
|
-
|
|
381
|
-
1. Pular análise de impacto (Fase 1)
|
|
382
|
-
2. Implementar FE/BE antes do contrato
|
|
383
|
-
3. Fazer breaking changes sem versionamento de API
|
|
384
|
-
4. Deploy sem testes E2E
|
|
385
|
-
|
|
386
|
-
---
|
|
387
|
-
|
|
388
|
-
## Frontend-First Protocol
|
|
389
|
-
|
|
390
|
-
> [!TIP]
|
|
391
|
-
> **Para features que envolvem Frontend + Backend:**
|
|
392
|
-
>
|
|
393
|
-
> ```
|
|
394
|
-
> 1. CONT (Contrato API)
|
|
395
|
-
> ├── Gera: openapi.yaml
|
|
396
|
-
> ├── Gera: types (FE + BE)
|
|
397
|
-
> └── Gera: Mock Server
|
|
398
|
-
>
|
|
399
|
-
> 2. Paralelo ⚡
|
|
400
|
-
> ├── FE (contra mock)
|
|
401
|
-
> └── BE (implementa contrato)
|
|
402
|
-
>
|
|
403
|
-
> 3. INT (Integração)
|
|
404
|
-
> ├── Remove mocks
|
|
405
|
-
> ├── Conecta FE ↔ BE real
|
|
406
|
-
> └── Testes E2E
|
|
407
|
-
> ```
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
## Troubleshooting
|
|
412
|
-
|
|
413
|
-
### Feature Muito Grande
|
|
414
|
-
|
|
415
|
-
**Sintoma:** Fase de implementação com 20+ histórias
|
|
416
|
-
|
|
417
|
-
**Solução:** Quebrar em features menores (épicos):
|
|
418
|
-
|
|
419
|
-
```
|
|
420
|
-
FEAT-001: Sistema de Notificações (Épico)
|
|
421
|
-
├─ FEAT-001-A: Backend (API + Jobs)
|
|
422
|
-
├─ FEAT-001-B: Frontend (UI)
|
|
423
|
-
└─ FEAT-001-C: Integração (Push)
|
|
424
|
-
|
|
425
|
-
Implementar um por vez com `/nova-feature`
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
### Conflito com Feature em Andamento
|
|
429
|
-
|
|
430
|
-
**Sintoma:** Duas features modificando mesma área
|
|
431
|
-
|
|
432
|
-
**Solução:** Finalizar uma antes de iniciar outra, ou:
|
|
433
|
-
|
|
434
|
-
```
|
|
435
|
-
1. Criar branch separada para cada feature
|
|
436
|
-
2. Definir ordem de merge (feature A → main → feature B merge)
|
|
437
|
-
3. Coordenar com /mcp-status para ver dependências
|
|
438
|
-
```
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Coordinate multiple agents for complex tasks. Use for multi-perspective analysis, comprehensive reviews, or tasks requiring different domain expertise.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Multi-Agent Orchestration
|
|
6
|
-
|
|
7
|
-
You are now in **ORCHESTRATION MODE**. Your task: coordinate specialized agents to solve this complex problem.
|
|
8
|
-
|
|
9
|
-
## Task to Orchestrate
|
|
10
|
-
$ARGUMENTS
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 🔴 CRITICAL: Minimum Agent Requirement
|
|
15
|
-
|
|
16
|
-
> ⚠️ **ORCHESTRATION = MINIMUM 3 DIFFERENT AGENTS**
|
|
17
|
-
>
|
|
18
|
-
> If you use fewer than 3 agents, you are NOT orchestrating - you're just delegating.
|
|
19
|
-
>
|
|
20
|
-
> **Validation before completion:**
|
|
21
|
-
> - Count invoked agents
|
|
22
|
-
> - If `agent_count < 3` → STOP and invoke more agents
|
|
23
|
-
> - Single agent = FAILURE of orchestration
|
|
24
|
-
|
|
25
|
-
### Agent Selection Matrix
|
|
26
|
-
|
|
27
|
-
| Task Type | REQUIRED Agents (minimum) |
|
|
28
|
-
|-----------|---------------------------|
|
|
29
|
-
| **Web App** | frontend-specialist, backend-specialist, test-engineer |
|
|
30
|
-
| **API** | backend-specialist, security-auditor, test-engineer |
|
|
31
|
-
| **UI/Design** | frontend-specialist, seo-specialist, performance-optimizer |
|
|
32
|
-
| **Database** | database-architect, backend-specialist, security-auditor |
|
|
33
|
-
| **Full Stack** | project-planner, frontend-specialist, backend-specialist, devops-engineer |
|
|
34
|
-
| **Debug** | debugger, explorer-agent, test-engineer |
|
|
35
|
-
| **Security** | security-auditor, penetration-tester, devops-engineer |
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Pre-Flight: Mode Check
|
|
40
|
-
|
|
41
|
-
| Current Mode | Task Type | Action |
|
|
42
|
-
|--------------|-----------|--------|
|
|
43
|
-
| **plan** | Any | ✅ Proceed with planning-first approach |
|
|
44
|
-
| **edit** | Simple execution | ✅ Proceed directly |
|
|
45
|
-
| **edit** | Complex/multi-file | ⚠️ Ask: "This task requires planning. Switch to plan mode?" |
|
|
46
|
-
| **ask** | Any | ⚠️ Ask: "Ready to orchestrate. Switch to edit or plan mode?" |
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 🔴 STRICT 2-PHASE ORCHESTRATION
|
|
51
|
-
|
|
52
|
-
### PHASE 1: PLANNING (Sequential - NO parallel agents)
|
|
53
|
-
|
|
54
|
-
| Step | Agent | Action |
|
|
55
|
-
|------|-------|--------|
|
|
56
|
-
| 1 | `project-planner` | Create docs/PLAN.md |
|
|
57
|
-
| 2 | (optional) `explorer-agent` | Codebase discovery if needed |
|
|
58
|
-
|
|
59
|
-
> 🔴 **NO OTHER AGENTS during planning!** Only project-planner and explorer-agent.
|
|
60
|
-
|
|
61
|
-
### ⏸️ CHECKPOINT: User Approval
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
After PLAN.md is complete, ASK:
|
|
65
|
-
|
|
66
|
-
"✅ Plan oluşturuldu: docs/PLAN.md
|
|
67
|
-
|
|
68
|
-
Onaylıyor musunuz? (Y/N)
|
|
69
|
-
- Y: Implementation başlatılır
|
|
70
|
-
- N: Planı düzeltirim"
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
> 🔴 **DO NOT proceed to Phase 2 without explicit user approval!**
|
|
74
|
-
|
|
75
|
-
### PHASE 2: IMPLEMENTATION (Parallel agents after approval)
|
|
76
|
-
|
|
77
|
-
| Parallel Group | Agents |
|
|
78
|
-
|----------------|--------|
|
|
79
|
-
| Foundation | `database-architect`, `security-auditor` |
|
|
80
|
-
| Core | `backend-specialist`, `frontend-specialist` |
|
|
81
|
-
| Polish | `test-engineer`, `devops-engineer` |
|
|
82
|
-
|
|
83
|
-
> ✅ After user approval, invoke multiple agents in PARALLEL.
|
|
84
|
-
|
|
85
|
-
## Available Agents (17 total)
|
|
86
|
-
|
|
87
|
-
| Agent | Domain | Use When |
|
|
88
|
-
|-------|--------|----------|
|
|
89
|
-
| `project-planner` | Planning | Task breakdown, PLAN.md |
|
|
90
|
-
| `explorer-agent` | Discovery | Codebase mapping |
|
|
91
|
-
| `frontend-specialist` | UI/UX | React, Vue, CSS, HTML |
|
|
92
|
-
| `backend-specialist` | Server | API, Node.js, Python |
|
|
93
|
-
| `database-architect` | Data | SQL, NoSQL, Schema |
|
|
94
|
-
| `security-auditor` | Security | Vulnerabilities, Auth |
|
|
95
|
-
| `penetration-tester` | Security | Active testing |
|
|
96
|
-
| `test-engineer` | Testing | Unit, E2E, Coverage |
|
|
97
|
-
| `devops-engineer` | Ops | CI/CD, Docker, Deploy |
|
|
98
|
-
| `mobile-developer` | Mobile | React Native, Flutter |
|
|
99
|
-
| `performance-optimizer` | Speed | Lighthouse, Profiling |
|
|
100
|
-
| `seo-specialist` | SEO | Meta, Schema, Rankings |
|
|
101
|
-
| `documentation-writer` | Docs | README, API docs |
|
|
102
|
-
| `debugger` | Debug | Error analysis |
|
|
103
|
-
| `game-developer` | Games | Unity, Godot |
|
|
104
|
-
| `orchestrator` | Meta | Coordination |
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Orchestration Protocol
|
|
109
|
-
|
|
110
|
-
### Step 1: Analyze Task Domains
|
|
111
|
-
Identify ALL domains this task touches:
|
|
112
|
-
```
|
|
113
|
-
□ Security → security-auditor, penetration-tester
|
|
114
|
-
□ Backend/API → backend-specialist
|
|
115
|
-
□ Frontend/UI → frontend-specialist
|
|
116
|
-
□ Database → database-architect
|
|
117
|
-
□ Testing → test-engineer
|
|
118
|
-
□ DevOps → devops-engineer
|
|
119
|
-
□ Mobile → mobile-developer
|
|
120
|
-
□ Performance → performance-optimizer
|
|
121
|
-
□ SEO → seo-specialist
|
|
122
|
-
□ Planning → project-planner
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Step 2: Phase Detection
|
|
126
|
-
|
|
127
|
-
| If Plan Exists | Action |
|
|
128
|
-
|----------------|--------|
|
|
129
|
-
| NO `docs/PLAN.md` | → Go to PHASE 1 (planning only) |
|
|
130
|
-
| YES `docs/PLAN.md` + user approved | → Go to PHASE 2 (implementation) |
|
|
131
|
-
|
|
132
|
-
### Step 3: Execute Based on Phase
|
|
133
|
-
|
|
134
|
-
**PHASE 1 (Planning):**
|
|
135
|
-
```
|
|
136
|
-
Use the project-planner agent to create PLAN.md
|
|
137
|
-
→ STOP after plan is created
|
|
138
|
-
→ ASK user for approval
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
**PHASE 2 (Implementation - after approval):**
|
|
142
|
-
```
|
|
143
|
-
Invoke agents in PARALLEL:
|
|
144
|
-
Use the frontend-specialist agent to [task]
|
|
145
|
-
Use the backend-specialist agent to [task]
|
|
146
|
-
Use the test-engineer agent to [task]
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**🔴 CRITICAL: Context Passing (MANDATORY)**
|
|
150
|
-
|
|
151
|
-
When invoking ANY subagent, you MUST include:
|
|
152
|
-
|
|
153
|
-
1. **Original User Request:** Full text of what user asked
|
|
154
|
-
2. **Decisions Made:** All user answers to Socratic questions
|
|
155
|
-
3. **Previous Agent Work:** Summary of what previous agents did
|
|
156
|
-
4. **Current Plan State:** If plan files exist in workspace, include them
|
|
157
|
-
|
|
158
|
-
**Example with FULL context:**
|
|
159
|
-
```
|
|
160
|
-
Use the project-planner agent to create PLAN.md:
|
|
161
|
-
|
|
162
|
-
**CONTEXT:**
|
|
163
|
-
- User Request: "Öğrenciler için sosyal platform, mock data ile"
|
|
164
|
-
- Decisions: Tech=Vue 3, Layout=Grid Widget, Auth=Mock, Design=Genç Dinamik
|
|
165
|
-
- Previous Work: Orchestrator asked 6 questions, user chose all options
|
|
166
|
-
- Current Plan: playful-roaming-dream.md exists in workspace with initial structure
|
|
167
|
-
|
|
168
|
-
**TASK:** Create detailed PLAN.md based on ABOVE decisions. Do NOT infer from folder name.
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
> ⚠️ **VIOLATION:** Invoking subagent without full context = subagent will make wrong assumptions!
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
### Step 4: Verification (MANDATORY)
|
|
175
|
-
The LAST agent must run appropriate verification scripts:
|
|
176
|
-
```bash
|
|
177
|
-
python .agent/skills/vulnerability-scanner/scripts/security_scan.py .
|
|
178
|
-
python .agent/skills/lint-and-validate/scripts/lint_runner.py .
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Step 5: Synthesize Results
|
|
182
|
-
Combine all agent outputs into unified report.
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Output Format
|
|
187
|
-
|
|
188
|
-
```markdown
|
|
189
|
-
## 🎼 Orchestration Report
|
|
190
|
-
|
|
191
|
-
### Task
|
|
192
|
-
[Original task summary]
|
|
193
|
-
|
|
194
|
-
### Mode
|
|
195
|
-
[Current Antigravity Agent mode: plan/edit/ask]
|
|
196
|
-
|
|
197
|
-
### Agents Invoked (MINIMUM 3)
|
|
198
|
-
| # | Agent | Focus Area | Status |
|
|
199
|
-
|---|-------|------------|--------|
|
|
200
|
-
| 1 | project-planner | Task breakdown | ✅ |
|
|
201
|
-
| 2 | frontend-specialist | UI implementation | ✅ |
|
|
202
|
-
| 3 | test-engineer | Verification scripts | ✅ |
|
|
203
|
-
|
|
204
|
-
### Verification Scripts Executed
|
|
205
|
-
- [x] security_scan.py → Pass/Fail
|
|
206
|
-
- [x] lint_runner.py → Pass/Fail
|
|
207
|
-
|
|
208
|
-
### Key Findings
|
|
209
|
-
1. **[Agent 1]**: Finding
|
|
210
|
-
2. **[Agent 2]**: Finding
|
|
211
|
-
3. **[Agent 3]**: Finding
|
|
212
|
-
|
|
213
|
-
### Deliverables
|
|
214
|
-
- [ ] PLAN.md created
|
|
215
|
-
- [ ] Code implemented
|
|
216
|
-
- [ ] Tests passing
|
|
217
|
-
- [ ] Scripts verified
|
|
218
|
-
|
|
219
|
-
### Summary
|
|
220
|
-
[One paragraph synthesis of all agent work]
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## 🔴 EXIT GATE
|
|
226
|
-
|
|
227
|
-
Before completing orchestration, verify:
|
|
228
|
-
|
|
229
|
-
1. ✅ **Agent Count:** `invoked_agents >= 3`
|
|
230
|
-
2. ✅ **Scripts Executed:** At least `security_scan.py` ran
|
|
231
|
-
3. ✅ **Report Generated:** Orchestration Report with all agents listed
|
|
232
|
-
|
|
233
|
-
> **If any check fails → DO NOT mark orchestration complete. Invoke more agents or run scripts.**
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
**Begin orchestration now. Select 3+ agents, execute sequentially, run verification scripts, synthesize results.**
|