wegho-agentes 7.0.0 → 7.0.1
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/.agent/skills/wegho-global-rules/SKILL.md +20 -0
- package/.agent/workflows/PROMPT_GUIDE.md +7 -4
- package/.agents/cli.ts +29 -21
- package/.agents/core/base-agent.ts +28 -12
- package/.agents/core/memory-system.ts +45 -13
- package/.agents/core/report-generator.ts +26 -19
- package/.agents/orchestrator.ts +104 -74
- package/.clinerules +318 -1229
- package/.cursorrules +0 -189
- package/README.md +3 -3
- package/docs/VERSION.md +3 -2
- package/package.json +3 -3
- package/.agents/agents/ai-agents/README.md +0 -175
- package/.agents/agents/ai-agents/agent.ts +0 -83
- package/.agents/agents/ai-agents/specialty.md +0 -14
- package/.agents/agents/architecture/README.md +0 -61
- package/.agents/agents/architecture/agent.ts +0 -238
- package/.agents/agents/architecture/memory.md +0 -111
- package/.agents/agents/architecture/specialty.md +0 -31
- package/.agents/agents/automation/README.md +0 -60
- package/.agents/agents/automation/agent.ts +0 -61
- package/.agents/agents/automation/specialty.md +0 -14
- package/.agents/agents/backend/README.md +0 -155
- package/.agents/agents/backend/agent.ts +0 -100
- package/.agents/agents/backend/specialty.md +0 -14
- package/.agents/agents/cloud/README.md +0 -73
- package/.agents/agents/cloud/agent.ts +0 -53
- package/.agents/agents/cloud/specialty.md +0 -14
- package/.agents/agents/code-auditor/README.md +0 -37
- package/.agents/agents/code-auditor/agent.ts +0 -334
- package/.agents/agents/code-auditor/specialty.md +0 -14
- package/.agents/agents/cro/README.md +0 -200
- package/.agents/agents/cro/agent.ts +0 -61
- package/.agents/agents/cro/specialty.md +0 -14
- package/.agents/agents/database/README.md +0 -67
- package/.agents/agents/database/agent.ts +0 -93
- package/.agents/agents/database/specialty.md +0 -14
- package/.agents/agents/devops/README.md +0 -84
- package/.agents/agents/devops/agent.ts +0 -54
- package/.agents/agents/devops/specialty.md +0 -14
- package/.agents/agents/documentation/README.md +0 -107
- package/.agents/agents/documentation/agent.ts +0 -253
- package/.agents/agents/documentation/memory.md +0 -56
- package/.agents/agents/documentation/specialty.md +0 -33
- package/.agents/agents/frontend/README.md +0 -188
- package/.agents/agents/frontend/agent.ts +0 -211
- package/.agents/agents/frontend/memory.md +0 -139
- package/.agents/agents/frontend/specialty.md +0 -30
- package/.agents/agents/inventory/README.md +0 -35
- package/.agents/agents/inventory/agent.ts +0 -758
- package/.agents/agents/inventory/memory.md +0 -50
- package/.agents/agents/inventory/specialty.md +0 -129
- package/.agents/agents/nextjs/README.md +0 -58
- package/.agents/agents/nextjs/agent.ts +0 -114
- package/.agents/agents/nextjs/specialty.md +0 -14
- package/.agents/agents/pentest/README.md +0 -228
- package/.agents/agents/pentest/agent.ts +0 -96
- package/.agents/agents/pentest/specialty.md +0 -14
- package/.agents/agents/planning/README.md +0 -107
- package/.agents/agents/planning/agent.ts +0 -389
- package/.agents/agents/planning/specialty.md +0 -14
- package/.agents/agents/project-discovery/README.md +0 -35
- package/.agents/agents/project-discovery/agent.ts +0 -344
- package/.agents/agents/project-discovery/specialty.md +0 -14
- package/.agents/agents/quality/README.md +0 -81
- package/.agents/agents/quality/agent.ts +0 -269
- package/.agents/agents/quality/memory.md +0 -110
- package/.agents/agents/quality/specialty.md +0 -31
- package/.agents/agents/rag/README.md +0 -41
- package/.agents/agents/rag/agent.ts +0 -85
- package/.agents/agents/rag/specialty.md +0 -14
- package/.agents/agents/security/README.md +0 -152
- package/.agents/agents/security/agent.ts +0 -218
- package/.agents/agents/security/memory.md +0 -91
- package/.agents/agents/security/specialty.md +0 -31
- package/.agents/agents/task-analyzer/README.md +0 -36
- package/.agents/agents/task-analyzer/agent.ts +0 -462
- package/.agents/agents/task-analyzer/specialty.md +0 -14
- package/.agents/agents/testing/README.md +0 -161
- package/.agents/agents/testing/agent.ts +0 -61
- package/.agents/agents/testing/specialty.md +0 -14
- package/.agents/agents/uiux/README.md +0 -68
- package/.agents/agents/uiux/agent.ts +0 -95
- package/.agents/agents/uiux/specialty.md +0 -14
- package/.agents/base/base-agent.ts +0 -331
- package/.agents/base/memory-system.ts +0 -397
- package/.agents/base/skill-manager.ts +0 -95
- package/.agents/convert-memory.ps1 +0 -153
- package/.agents/examples/reporting-example.md +0 -203
- package/.agents/managers/build-manager.ts +0 -304
- package/.agents/managers/cache-manager.ts +0 -184
- package/.agents/managers/checkpoint-manager.ts +0 -299
- package/.agents/migrate-agents.ps1 +0 -117
- package/.agents/templates/change-report.md +0 -55
- package/.agents/templates/execution-plan.md +0 -36
- package/.agents/unmapped-skills.txt +0 -0
- package/.agents/utils/agent-migrator.ts +0 -360
- package/.agents/utils/agent-monitor.ts +0 -102
- package/.agents/utils/agent-parallelizer.ts +0 -108
- package/.agents/utils/context-monitor.ts +0 -140
- package/.agents/utils/feedback-collector.ts +0 -207
- package/.agents/utils/file-generator.ts +0 -304
- package/.agents/utils/memory-converter.ts +0 -217
- package/.agents/utils/memory-dashboard.ts +0 -147
- package/.agents/utils/performance-tracker.ts +0 -275
- package/.agents/utils/report-generator.ts +0 -193
- package/.agents/utils/retry-utility.ts +0 -140
- package/.agents/utils/workflow-validator.ts +0 -158
package/.clinerules
CHANGED
|
@@ -1,1307 +1,396 @@
|
|
|
1
|
-
# SISTEMA DE AGENTES WEGHO
|
|
2
|
-
|
|
3
|
-
## HIERARQUIA OBRIGATÓRIA
|
|
4
|
-
|
|
5
|
-
### NÍVEL 1: ORQUESTRADOR
|
|
6
|
-
IntelligentOrchestrator (.agents/orchestrator.ts)
|
|
7
|
-
|
|
8
|
-
Responsabilidades OBRIGATÓRIAS:
|
|
9
|
-
1. Receber tarefa do usuário
|
|
10
|
-
2. Invocar TaskAnalyzerAgent
|
|
11
|
-
3. Distribuir para agentes especializados
|
|
12
|
-
4. Executar em paralelo quando possível
|
|
13
|
-
5. Consolidar resultados
|
|
14
|
-
6. Triggerar BuildManager
|
|
15
|
-
7. Retornar relatório final
|
|
16
|
-
|
|
17
|
-
Componentes Integrados:
|
|
18
|
-
- TaskAnalyzerAgent (análise e roteamento)
|
|
19
|
-
- MemorySystem (memória compartilhada)
|
|
20
|
-
- BuildManager (builds incrementais)
|
|
21
|
-
- PerformanceTracker (métricas)
|
|
22
|
-
- FeedbackCollector (aprendizado)
|
|
23
|
-
- AgentParallelizer (execução paralela)
|
|
24
|
-
|
|
25
|
-
Fluxo OBRIGATÓRIO:
|
|
26
|
-
1. orchestrate(task) → TaskAnalysis
|
|
27
|
-
2. selectBestAgents() → AgentAssignment[]
|
|
28
|
-
3. executeWithAgent() → AgentReport[]
|
|
29
|
-
4. buildManager.createBuild() → buildNumber
|
|
30
|
-
5. generateFinalReport() → FinalReport
|
|
31
|
-
|
|
32
|
-
### NÍVEL 2: TASK ANALYZER
|
|
33
|
-
TaskAnalyzerAgent (.agents/task-analyzer-agent.ts)
|
|
34
|
-
|
|
35
|
-
Função: Detectar áreas e selecionar agentes
|
|
36
|
-
Método Principal: analyzeTask(description)
|
|
37
|
-
|
|
38
|
-
FASE 1: Detecção de Áreas (detectAreas)
|
|
39
|
-
- Analisa keywords na descrição
|
|
40
|
-
- Retorna: string[] de áreas
|
|
41
|
-
|
|
42
|
-
Áreas Possíveis:
|
|
43
|
-
- nextjs → Next.js, App Router
|
|
44
|
-
- uiux → Design, Interface
|
|
45
|
-
- backend → API, NestJS
|
|
46
|
-
- database → PostgreSQL, Prisma
|
|
47
|
-
- ai-agents → Autonomous agents
|
|
48
|
-
- rag → Vector DB, LLM
|
|
49
|
-
- pentest → Security testing
|
|
50
|
-
- devops → Docker, CI/CD
|
|
51
|
-
- cloud → AWS, GCP, Azure
|
|
52
|
-
- testing → TDD, Playwright
|
|
53
|
-
- cro → Conversion optimization
|
|
54
|
-
- automation → Workflow automation
|
|
55
|
-
- frontend → React, componentes
|
|
56
|
-
- security → Vulnerabilidades
|
|
57
|
-
- architecture → Estrutura
|
|
58
|
-
- quality → Code review
|
|
59
|
-
- documentation → Docs
|
|
60
|
-
|
|
61
|
-
FASE 2: Seleção de Agentes (determineRequiredAgents)
|
|
62
|
-
- Mapeia áreas → agentes
|
|
63
|
-
- Adiciona agentes core (architecture, quality)
|
|
64
|
-
- Retorna: string[] de agent names
|
|
65
|
-
|
|
66
|
-
FASE 3: Criação de Assignments (createAgentAssignments)
|
|
67
|
-
- Define prioridades (1 = primeiro)
|
|
68
|
-
- Define dependências
|
|
69
|
-
- Retorna: AgentAssignment[]
|
|
70
|
-
|
|
71
|
-
### NÍVEL 3: AGENTES ESPECIALIZADOS (20+)
|
|
72
|
-
|
|
73
|
-
#### WEB DEVELOPMENT (3 agentes)
|
|
74
|
-
|
|
75
|
-
NextJSAgent (.agents/core/nextjs-agent.ts)
|
|
76
|
-
- Herda: BaseAgent
|
|
77
|
-
- Skills: nextjs-best-practices, react-best-practices, vercel-deployment
|
|
78
|
-
- Keywords: nextjs, next.js, app router, server component
|
|
79
|
-
- Responsabilidades: App Router, Server Components, Server Actions, Image optimization, SEO metadata
|
|
80
|
-
|
|
81
|
-
UIUXAgent (.agents/core/uiux-agent.ts)
|
|
82
|
-
- Herda: BaseAgent
|
|
83
|
-
- Skills: ui-ux-pro-max, mobile-design, canvas-design
|
|
84
|
-
- Keywords: ui, ux, design, interface, mobile design, acessibilidade
|
|
85
|
-
- Responsabilidades: Design systems, Mobile responsiveness, Accessibility (a11y), User experience
|
|
86
|
-
|
|
87
|
-
FrontendAgent (.agents/core/frontend-agent.ts)
|
|
88
|
-
- Herda: BaseAgent
|
|
89
|
-
- Skills: react-patterns, component-design
|
|
90
|
-
- Keywords: frontend, react, component
|
|
91
|
-
- Responsabilidades: React components, Estado e props, Hooks patterns, Performance
|
|
92
|
-
|
|
93
|
-
#### BACKEND/DATABASE (2 agentes)
|
|
94
|
-
|
|
95
|
-
BackendAgent (.agents/core/backend-agent.ts)
|
|
96
|
-
- Herda: BaseAgent
|
|
97
|
-
- Skills: backend-dev-guidelines, nodejs-best-practices, nestjs-expert, api-patterns
|
|
98
|
-
- Keywords: backend, api, nestjs, microservices, graphql
|
|
99
|
-
- Responsabilidades: API design (REST/GraphQL), NestJS architecture, Microservices, Rate limiting
|
|
100
|
-
|
|
101
|
-
DatabaseAgent (.agents/core/database-agent.ts)
|
|
102
|
-
- Herda: BaseAgent
|
|
103
|
-
- Skills: database-design, postgres-best-practices, prisma-expert
|
|
104
|
-
- Keywords: database, postgres, prisma, sql, migration
|
|
105
|
-
- Responsabilidades: Schema design, Migrations, Query optimization, RLS policies
|
|
106
|
-
|
|
107
|
-
#### AI/ML (2 agentes)
|
|
108
|
-
|
|
109
|
-
AIAgentsAgent (.agents/core/ai-agents-agent.ts)
|
|
110
|
-
- Herda: BaseAgent
|
|
111
|
-
- Skills: autonomous-agents, autonomous-agent-patterns, ai-agents-architect
|
|
112
|
-
- Keywords: agent, autonomous, multi-agent, orchestrat
|
|
113
|
-
- Responsabilidades: Agent patterns (ReAct, Chain-of-Thought), Multi-agent systems, Tool integration, Agent orchestration
|
|
114
|
-
|
|
115
|
-
RAGAgent (.agents/core/rag-agent.ts)
|
|
116
|
-
- Herda: BaseAgent
|
|
117
|
-
- Skills: rag-implementation, rag-engineer, llm-app-patterns
|
|
118
|
-
- Keywords: rag, vector, embedding, llm, retrieval
|
|
119
|
-
- Responsabilidades: RAG implementation, Vector databases (Pinecone, Weaviate), Embedding strategies, LLM integration
|
|
120
|
-
|
|
121
|
-
#### SECURITY (2 agentes)
|
|
122
|
-
|
|
123
|
-
SecurityAgent (.agents/core/security-agent.ts)
|
|
124
|
-
- Herda: BaseAgent
|
|
125
|
-
- Skills: security-best-practices, owasp-top-10
|
|
126
|
-
- Keywords: security, vulnerabilidade, auth
|
|
127
|
-
- Responsabilidades: XSS/CSRF detection, Authentication, Data sanitization, Security headers
|
|
128
|
-
|
|
129
|
-
PentestAgent (.agents/core/pentest-agent.ts)
|
|
130
|
-
- Herda: BaseAgent
|
|
131
|
-
- Skills: ethical-hacking-methodology, pentest-checklist, webapp-testing
|
|
132
|
-
- Keywords: pentest, vulnerability, owasp, sql injection, xss
|
|
133
|
-
- Responsabilidades: Penetration testing, OWASP Top 10, SQL injection testing, Security tools (Burp Suite)
|
|
134
|
-
|
|
135
|
-
#### DEVOPS/CLOUD (2 agentes)
|
|
136
|
-
|
|
137
|
-
DevOpsAgent (.agents/core/devops-agent.ts)
|
|
138
|
-
- Herda: BaseAgent
|
|
139
|
-
- Skills: docker-expert, deployment-procedures, github-workflow-automation
|
|
140
|
-
- Keywords: docker, ci/cd, pipeline, deployment
|
|
141
|
-
- Responsabilidades: Docker containerization, CI/CD pipelines, Infrastructure as Code, Deployment automation
|
|
142
|
-
|
|
143
|
-
CloudAgent (.agents/core/cloud-agent.ts)
|
|
144
|
-
- Herda: BaseAgent
|
|
145
|
-
- Skills: aws-serverless, gcp-cloud-run, azure-functions
|
|
146
|
-
- Keywords: aws, gcp, azure, serverless, cloud
|
|
147
|
-
- Responsabilidades: AWS services, GCP deployment, Azure functions, Serverless architecture
|
|
148
|
-
|
|
149
|
-
#### TESTING/MARKETING (2 agentes)
|
|
150
|
-
|
|
151
|
-
TestingAgent (.agents/core/testing-agent.ts)
|
|
152
|
-
- Herda: BaseAgent
|
|
153
|
-
- Skills: test-driven-development, tdd-workflow, playwright-skill
|
|
154
|
-
- Keywords: test, tdd, playwright, e2e, unit test
|
|
155
|
-
- Responsabilidades: TDD workflow, Unit tests, Integration tests, E2E with Playwright
|
|
156
|
-
|
|
157
|
-
CROAgent (.agents/core/cro-agent.ts)
|
|
158
|
-
- Herda: BaseAgent
|
|
159
|
-
- Skills: ab-test-setup, form-cro, page-cro, signup-flow-cro
|
|
160
|
-
- Keywords: conversion, cro, a/b test, onboarding, signup
|
|
161
|
-
- Responsabilidades: Conversion optimization, A/B testing, User onboarding, Growth hacking
|
|
162
|
-
|
|
163
|
-
#### TOOLS/AUTOMATION (1 agente)
|
|
164
|
-
|
|
165
|
-
AutomationAgent (.agents/core/automation-agent.ts)
|
|
166
|
-
- Herda: BaseAgent
|
|
167
|
-
- Skills: workflow-automation, browser-automation, mcp-builder
|
|
168
|
-
- Keywords: automation, workflow, mcp, browser automation
|
|
169
|
-
- Responsabilidades: Workflow automation, Browser automation, Tool building, MCP development
|
|
1
|
+
# 🤖 SISTEMA DE AGENTES WEGHO v6.0.0 - GOVERNANÇA MULTI-AGENTE
|
|
170
2
|
|
|
171
|
-
|
|
3
|
+
## 📋 VISÃO GERAL DO SISTEMA
|
|
172
4
|
|
|
173
|
-
|
|
174
|
-
- SEMPRE incluído em todas as tarefas
|
|
175
|
-
- Valida: Estrutura de arquivos, limite 500 linhas, padrões
|
|
176
|
-
- Prioridade: 1 (executa primeiro)
|
|
177
|
-
|
|
178
|
-
QualityAgent (.agents/core/quality-agent.ts)
|
|
179
|
-
- SEMPRE incluído em todas as tarefas
|
|
180
|
-
- Valida: Code quality, clean code, best practices
|
|
181
|
-
- Prioridade: 4 (executa por último)
|
|
182
|
-
|
|
183
|
-
DocumentationAgent (.agents/core/documentation-agent.ts)
|
|
184
|
-
- Ativado quando: documentation, readme, docs
|
|
185
|
-
- Gera: README, comentários, documentação
|
|
186
|
-
|
|
187
|
-
InventoryAgent (.agents/core/inventory-agent.ts)
|
|
188
|
-
- Ativado quando: inventory, scan, almoxarifado
|
|
189
|
-
- Previne: Duplicação de recursos
|
|
190
|
-
|
|
191
|
-
### NÍVEL 4: BASE AGENT
|
|
192
|
-
BaseAgent (.agents/core/base-agent.ts)
|
|
193
|
-
Classe abstrata que TODOS os agentes herdam
|
|
5
|
+
Você está operando sob o **Sistema de Governança Multi-Agente WebGho v6.0.0**, um framework de desenvolvimento que garante qualidade, segurança e organização máxima em projetos Next.js + Supabase através de um orquestrador inteligente e 20+ agentes especializados.
|
|
194
6
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
7
|
+
### Princípios Fundamentais da V6
|
|
8
|
+
1. **Orquestração Centralizada**: Todas as tarefas passam pelo `IntelligentOrchestrator` que coordena agentes especializados.
|
|
9
|
+
2. **Aprendizado Contínuo**: Cada agente possui memória persistente e aprende com sucessos/falhas.
|
|
10
|
+
3. **Transparência Total**: O usuário sempre sabe "quem está fazendo o quê" através do Plano de Escalamento.
|
|
11
|
+
4. **Auditoria Rigorosa**: Sistema GO/NO-GO impede que código com problemas chegue à produção.
|
|
12
|
+
5. **Build Incremental**: Cada mudança é versionada e pode ser revertida instantaneamente.
|
|
200
13
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
executeWithMemory(task, context)
|
|
204
|
-
1. Consulta memória (query)
|
|
205
|
-
2. Executa executeTask()
|
|
206
|
-
3. Salva resultado (store)
|
|
207
|
-
4. Aprende (learnFromFeedback)
|
|
208
|
-
|
|
209
|
-
executeTask(task, context) [ABSTRATO]
|
|
210
|
-
- Cada agente implementa sua lógica
|
|
211
|
-
|
|
212
|
-
recordOutcome(task, context, result)
|
|
213
|
-
- Salva na memória
|
|
214
|
-
|
|
215
|
-
consultReferenceRepositories()
|
|
216
|
-
- Busca em repos de referência
|
|
217
|
-
|
|
218
|
-
Sistema de Memória:
|
|
219
|
-
- Localização: .agents/memory/{agentName}/
|
|
220
|
-
- Arquivo: executions.json
|
|
221
|
-
- Estrutura: {task, success, timestamp, recommendations, issues}
|
|
222
|
-
|
|
223
|
-
### NÍVEL 5: BUILD MANAGER
|
|
224
|
-
BuildManager (.agents/core/build-manager.ts)
|
|
225
|
-
Responsabilidade: Rastrear TODAS as mudanças de arquivos
|
|
226
|
-
|
|
227
|
-
Estrutura de Dados:
|
|
228
|
-
- .builds/history.json: {currentVersion, currentBuild, builds[]}
|
|
229
|
-
- .builds/snapshots/{version}/{filepath}/build-{number}.{ext}
|
|
230
|
-
|
|
231
|
-
Métodos OBRIGATÓRIOS:
|
|
232
|
-
|
|
233
|
-
createBuild(files, agent, success, description)
|
|
234
|
-
1. Incrementa buildNumber
|
|
235
|
-
2. Cria snapshots de arquivos
|
|
236
|
-
3. Registra no history.json
|
|
237
|
-
4. Retorna buildNumber
|
|
238
|
-
|
|
239
|
-
createSnapshot(filePath, buildNumber)
|
|
240
|
-
- Salva cópia do arquivo
|
|
241
|
-
|
|
242
|
-
restoreFromBuild(filePath, buildNumber)
|
|
243
|
-
- Restaura versão anterior
|
|
244
|
-
|
|
245
|
-
incrementVersion(type: major|minor|patch)
|
|
246
|
-
- Atualiza versão do projeto
|
|
247
|
-
|
|
248
|
-
Trigger Automático:
|
|
249
|
-
- Quando: Agentes executam com sucesso
|
|
250
|
-
- Condição: context.files.length > 0
|
|
251
|
-
- Ação: buildManager.createBuild()
|
|
252
|
-
|
|
253
|
-
### NÍVEL 6: MEMORY SYSTEM
|
|
254
|
-
MemorySystem (.agents/core/memory-system.ts)
|
|
255
|
-
Função: Armazenar e consultar execuções anteriores
|
|
256
|
-
|
|
257
|
-
Estrutura por Agente:
|
|
258
|
-
.agents/memory/{agentName}/executions.json
|
|
259
|
-
|
|
260
|
-
Métodos:
|
|
261
|
-
- store(entry: MemoryEntry): Salva execução
|
|
262
|
-
- query(taskDescription: string): Busca execuções similares
|
|
263
|
-
- getStats(agentName: string): Retorna taxa de sucesso
|
|
264
|
-
|
|
265
|
-
MemoryEntry: {id, task, success, timestamp, agentName, recommendations, issues}
|
|
266
|
-
|
|
267
|
-
## FLUXO COMPLETO OBRIGATÓRIO
|
|
268
|
-
|
|
269
|
-
1. ENTRADA: npm run agent "Criar API Next.js com PostgreSQL"
|
|
270
|
-
|
|
271
|
-
2. ORQUESTRADOR: IntelligentOrchestrator.orchestrate(task)
|
|
272
|
-
|
|
273
|
-
3. TASK ANALYZER:
|
|
274
|
-
- detectAreas() → [nextjs, backend, database]
|
|
275
|
-
- determineRequiredAgents() → [architecture-agent, nextjs-agent, backend-agent, database-agent, quality-agent]
|
|
276
|
-
- createAgentAssignments() → [{agentName, priority}...]
|
|
277
|
-
|
|
278
|
-
4. EXECUÇÃO PARALELA:
|
|
279
|
-
- Grupo 1 (priority 1): architecture-agent.executeWithMemory()
|
|
280
|
-
- Grupo 2 (priority 2): nextjs-agent, backend-agent (PARALELO)
|
|
281
|
-
- Grupo 3 (priority 3): database-agent
|
|
282
|
-
- Grupo 4 (priority 4): quality-agent
|
|
283
|
-
|
|
284
|
-
5. BUILD AUTOMÁTICO:
|
|
285
|
-
buildManager.createBuild(files, agents, success)
|
|
286
|
-
→ Build 781 criado
|
|
287
|
-
→ Snapshot: .builds/snapshots/0.0.1/src/api/route.ts/build-781.ts
|
|
288
|
-
→ History: .builds/history.json atualizado
|
|
289
|
-
|
|
290
|
-
6. RESULTADO: FinalReport {taskDescription, overallSuccess, buildNumber, agentReports}
|
|
291
|
-
|
|
292
|
-
## SKILLS (200+)
|
|
293
|
-
nextjs-best-practices, react-patterns, postgres-best-practices, rag-implementation, docker-expert, tdd-workflow, +194 outras
|
|
294
|
-
|
|
295
|
-
## REGRAS OBRIGATÓRIAS
|
|
296
|
-
|
|
297
|
-
1. SEMPRE use npm run agent para tarefas complexas
|
|
298
|
-
2. NUNCA pule o sistema de agentes
|
|
299
|
-
3. CONFIE na memória - agentes aprendem
|
|
300
|
-
4. DEIXE builds automáticos funcionarem
|
|
301
|
-
5. USE keywords específicas nas tarefas
|
|
302
|
-
6. CONSULTE histórico antes de recriar
|
|
303
|
-
|
|
304
|
-
v5.0.0 | 20+ Agentes | 200+ Skills | Status: OPERACIONAL
|
|
305
|
-
|
|
306
|
-
## 📐 HIERARQUIA OBRIGATÓRIA DO SISTEMA
|
|
14
|
+
---
|
|
307
15
|
|
|
308
|
-
|
|
309
|
-
```
|
|
310
|
-
IntelligentOrchestrator (.agents/orchestrator.ts)
|
|
311
|
-
├── Responsabilidades OBRIGATÓRIAS:
|
|
312
|
-
│ ├── 1. Receber tarefa do usuário
|
|
313
|
-
│ ├── 2. Invocar TaskAnalyzerAgent
|
|
314
|
-
│ ├── 3. Distribuir para agentes especializados
|
|
315
|
-
│ ├── 4. Executar em paralelo quando possível
|
|
316
|
-
│ ├── 5. Consolidar resultados
|
|
317
|
-
│ ├── 6. Triggerar BuildManager
|
|
318
|
-
│ └── 7. Retornar relatório final
|
|
319
|
-
│
|
|
320
|
-
├── Componentes Integrados:
|
|
321
|
-
│ ├── TaskAnalyzerAgent (análise e roteamento)
|
|
322
|
-
│ ├── MemorySystem (memória compartilhada)
|
|
323
|
-
│ ├── BuildManager (builds incrementais)
|
|
324
|
-
│ ├── PerformanceTracker (métricas)
|
|
325
|
-
│ ├── FeedbackCollector (aprendizado)
|
|
326
|
-
│ └── AgentParallelizer (execução paralela)
|
|
327
|
-
│
|
|
328
|
-
└── Fluxo OBRIGATÓRIO:
|
|
329
|
-
1. orchestrate(task) → TaskAnalysis
|
|
330
|
-
2. selectBestAgents() → AgentAssignment[]
|
|
331
|
-
3. executeWithAgent() → AgentReport[]
|
|
332
|
-
4. buildManager.createBuild() → buildNumber
|
|
333
|
-
5. generateFinalReport() → FinalReport
|
|
334
|
-
```
|
|
16
|
+
## 🔄 PROTOCOLO DE 7 PASSOS OBRIGATÓRIOS
|
|
335
17
|
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
TaskAnalyzerAgent (.agents/task-analyzer-agent.ts)
|
|
339
|
-
├── Função: Detectar áreas e selecionar agentes
|
|
340
|
-
├── Método Principal: analyzeTask(description)
|
|
341
|
-
│
|
|
342
|
-
├── FASE 1: Detecção de Áreas (detectAreas)
|
|
343
|
-
│ ├── Analisa keywords na descrição
|
|
344
|
-
│ ├── Retorna: string[] de áreas
|
|
345
|
-
│ └── Áreas Possíveis:
|
|
346
|
-
│ ├── 'nextjs' → Next.js, App Router
|
|
347
|
-
│ ├── 'uiux' → Design, Interface
|
|
348
|
-
│ ├── 'backend' → API, NestJS
|
|
349
|
-
│ ├── 'database' → PostgreSQL, Prisma
|
|
350
|
-
│ ├── 'ai-agents' → Autonomous agents
|
|
351
|
-
│ ├── 'rag' → Vector DB, LLM
|
|
352
|
-
│ ├── 'pentest' → Security testing
|
|
353
|
-
│ ├── 'devops' → Docker, CI/CD
|
|
354
|
-
│ ├── 'cloud' → AWS, GCP, Azure
|
|
355
|
-
│ ├── 'testing' → TDD, Playwright
|
|
356
|
-
│ ├── 'cro' → Conversion optimization
|
|
357
|
-
│ ├── 'automation' → Workflow automation
|
|
358
|
-
│ ├── 'frontend' → React, componentes
|
|
359
|
-
│ ├── 'security' → Vulnerabilidades
|
|
360
|
-
│ ├── 'architecture' → Estrutura
|
|
361
|
-
│ ├── 'quality' → Code review
|
|
362
|
-
│ └── 'documentation' → Docs
|
|
363
|
-
│
|
|
364
|
-
├── FASE 2: Seleção de Agentes (determineRequiredAgents)
|
|
365
|
-
│ ├── Mapeia áreas → agentes
|
|
366
|
-
│ ├── Adiciona agentes core (architecture, quality)
|
|
367
|
-
│ └── Retorna: string[] de agent names
|
|
368
|
-
│
|
|
369
|
-
└── FASE 3: Criação de Assignments (createAgentAssignments)
|
|
370
|
-
├── Define prioridades (1 = primeiro)
|
|
371
|
-
├── Define dependências
|
|
372
|
-
└── Retorna: AgentAssignment[]
|
|
373
|
-
```
|
|
18
|
+
Toda tarefa DEVE seguir este fluxo sequencial:
|
|
374
19
|
|
|
375
|
-
###
|
|
20
|
+
### FASE 1: Análise Inteligente de Tarefa
|
|
21
|
+
**Responsável**: `TaskAnalyzerAgent`
|
|
22
|
+
- Detecta áreas técnicas envolvidas (frontend, backend, database, security, etc.)
|
|
23
|
+
- Seleciona agentes especializados baseado em keywords e contexto
|
|
24
|
+
- Define prioridades e dependências entre agentes
|
|
25
|
+
- Sugere pesquisas em documentação oficial quando necessário
|
|
376
26
|
|
|
377
|
-
|
|
378
|
-
```
|
|
379
|
-
NextJSAgent (.agents/core/nextjs-agent.ts)
|
|
380
|
-
├── Herda: BaseAgent
|
|
381
|
-
├── Skills: nextjs-best-practices, react-best-practices, vercel-deployment
|
|
382
|
-
├── Keywords: nextjs, next.js, app router, server component
|
|
383
|
-
├── Responsabilidades:
|
|
384
|
-
│ ├── App Router patterns
|
|
385
|
-
│ ├── Server Components
|
|
386
|
-
│ ├── Server Actions
|
|
387
|
-
│ ├── Image optimization
|
|
388
|
-
│ └── SEO metadata
|
|
389
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
390
|
-
|
|
391
|
-
UIUXAgent (.agents/core/uiux-agent.ts)
|
|
392
|
-
├── Herda: BaseAgent
|
|
393
|
-
├── Skills: ui-ux-pro-max, mobile-design, canvas-design
|
|
394
|
-
├── Keywords: ui, ux, design, interface, mobile design, acessibilidade
|
|
395
|
-
├── Responsabilidades:
|
|
396
|
-
│ ├── Design systems
|
|
397
|
-
│ ├── Mobile responsiveness
|
|
398
|
-
│ ├── Accessibility (a11y)
|
|
399
|
-
│ └── User experience
|
|
400
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
401
|
-
|
|
402
|
-
FrontendAgent (.agents/core/frontend-agent.ts)
|
|
403
|
-
├── Herda: BaseAgent
|
|
404
|
-
├── Skills: react-patterns, component-design
|
|
405
|
-
├── Keywords: frontend, react, component
|
|
406
|
-
├── Responsabilidades:
|
|
407
|
-
│ ├── React components
|
|
408
|
-
│ ├── Estado e props
|
|
409
|
-
│ ├── Hooks patterns
|
|
410
|
-
│ └── Performance
|
|
411
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
412
|
-
```
|
|
27
|
+
**Output**: `TaskAnalysis` com lista de agentes, complexidade e assignments
|
|
413
28
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
│ ├── API design (REST/GraphQL)
|
|
422
|
-
│ ├── NestJS architecture
|
|
423
|
-
│ ├── Microservices
|
|
424
|
-
│ └── Rate limiting
|
|
425
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
426
|
-
|
|
427
|
-
DatabaseAgent (.agents/core/database-agent.ts)
|
|
428
|
-
├── Herda: BaseAgent
|
|
429
|
-
├── Skills: database-design, postgres-best-practices, prisma-expert
|
|
430
|
-
├── Keywords: database, postgres, prisma, sql, migration
|
|
431
|
-
├── Responsabilidades:
|
|
432
|
-
│ ├── Schema design
|
|
433
|
-
│ ├── Migrations
|
|
434
|
-
│ ├── Query optimization
|
|
435
|
-
│ └── RLS policies
|
|
436
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
437
|
-
```
|
|
29
|
+
### FASE 2: Planejamento Estrutural
|
|
30
|
+
**Responsável**: `PlanningAgent`
|
|
31
|
+
- Cria plano de implementação detalhado (`ImplementationPlan`)
|
|
32
|
+
- Define arquitetura da solução (componentes, APIs, database)
|
|
33
|
+
- Lista arquivos a criar/modificar/deletar
|
|
34
|
+
- Identifica riscos e dependências
|
|
35
|
+
- Estima tempo e complexidade
|
|
438
36
|
|
|
439
|
-
|
|
440
|
-
```
|
|
441
|
-
AIAgentsAgent (.agents/core/ai-agents-agent.ts)
|
|
442
|
-
├── Herda: BaseAgent
|
|
443
|
-
├── Skills: autonomous-agents, autonomous-agent-patterns, ai-agents-architect
|
|
444
|
-
├── Keywords: agent, autonomous, multi-agent, orchestrat
|
|
445
|
-
├── Responsabilidades:
|
|
446
|
-
│ ├── Agent patterns (ReAct, Chain-of-Thought)
|
|
447
|
-
│ ├── Multi-agent systems
|
|
448
|
-
│ ├── Tool integration
|
|
449
|
-
│ └── Agent orchestration
|
|
450
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
451
|
-
|
|
452
|
-
RAGAgent (.agents/core/rag-agent.ts)
|
|
453
|
-
├── Herda: BaseAgent
|
|
454
|
-
├── Skills: rag-implementation, rag-engineer, llm-app-patterns
|
|
455
|
-
├── Keywords: rag, vector, embedding, llm, retrieval
|
|
456
|
-
├── Responsabilidades:
|
|
457
|
-
│ ├── RAG implementation
|
|
458
|
-
│ ├── Vector databases (Pinecone, Weaviate)
|
|
459
|
-
│ ├── Embedding strategies
|
|
460
|
-
│ └── LLM integration
|
|
461
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
462
|
-
```
|
|
37
|
+
**Output**: `implementation_plan.md` para revisão do usuário
|
|
463
38
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
├── Keywords: security, vulnerabilidade, auth
|
|
470
|
-
├── Responsabilidades:
|
|
471
|
-
│ ├── XSS, CSRF detection
|
|
472
|
-
│ ├── Authentication
|
|
473
|
-
│ ├── Data sanitization
|
|
474
|
-
│ └── Security headers
|
|
475
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
476
|
-
|
|
477
|
-
PentestAgent (.agents/core/pentest-agent.ts)
|
|
478
|
-
├── Herda: BaseAgent
|
|
479
|
-
├── Skills: ethical-hacking-methodology, pentest-checklist, webapp-testing
|
|
480
|
-
├── Keywords: pentest, vulnerability, owasp, sql injection, xss
|
|
481
|
-
├── Responsabilidades:
|
|
482
|
-
│ ├── Penetration testing
|
|
483
|
-
│ ├── OWASP Top 10
|
|
484
|
-
│ ├── SQL injection testing
|
|
485
|
-
│ └── Security tools (Burp Suite)
|
|
486
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
487
|
-
```
|
|
39
|
+
### FASE 3: Checkpoint de Segurança
|
|
40
|
+
**Responsável**: `CheckpointManager`
|
|
41
|
+
- Cria snapshot do estado atual do projeto
|
|
42
|
+
- Permite rollback total em caso de falha
|
|
43
|
+
- Registra timestamp e arquivos afetados
|
|
488
44
|
|
|
489
|
-
|
|
490
|
-
```
|
|
491
|
-
DevOpsAgent (.agents/core/devops-agent.ts)
|
|
492
|
-
├── Herda: BaseAgent
|
|
493
|
-
├── Skills: docker-expert, deployment-procedures, github-workflow-automation
|
|
494
|
-
├── Keywords: docker, ci/cd, pipeline, deployment
|
|
495
|
-
├── Responsabilidades:
|
|
496
|
-
│ ├── Docker containerization
|
|
497
|
-
│ ├── CI/CD pipelines
|
|
498
|
-
│ ├── Infrastructure as Code
|
|
499
|
-
│ └── Deployment automation
|
|
500
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
501
|
-
|
|
502
|
-
CloudAgent (.agents/core/cloud-agent.ts)
|
|
503
|
-
├── Herda: BaseAgent
|
|
504
|
-
├── Skills: aws-serverless, gcp-cloud-run, azure-functions
|
|
505
|
-
├── Keywords: aws, gcp, azure, serverless, cloud
|
|
506
|
-
├── Responsabilidades:
|
|
507
|
-
│ ├── AWS services
|
|
508
|
-
│ ├── GCP deployment
|
|
509
|
-
│ ├── Azure functions
|
|
510
|
-
│ └── Serverless architecture
|
|
511
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
512
|
-
```
|
|
45
|
+
**Output**: Checkpoint ID para possível restauração
|
|
513
46
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
├── Responsabilidades:
|
|
521
|
-
│ ├── TDD workflow
|
|
522
|
-
│ ├── Unit tests
|
|
523
|
-
│ ├── Integration tests
|
|
524
|
-
│ └── E2E with Playwright
|
|
525
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
526
|
-
|
|
527
|
-
CROAgent (.agents/core/cro-agent.ts)
|
|
528
|
-
├── Herda: BaseAgent
|
|
529
|
-
├── Skills: ab-test-setup, form-cro, page-cro, signup-flow-cro
|
|
530
|
-
├── Keywords: conversion, cro, a/b test, onboarding, signup
|
|
531
|
-
├── Responsabilidades:
|
|
532
|
-
│ ├── Conversion optimization
|
|
533
|
-
│ ├── A/B testing
|
|
534
|
-
│ ├── User onboarding
|
|
535
|
-
│ └── Growth hacking
|
|
536
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
537
|
-
```
|
|
47
|
+
### FASE 4: Execução da Implementação
|
|
48
|
+
**Responsável**: `FileGenerator` + Agentes Especializados
|
|
49
|
+
- Implementa o plano aprovado
|
|
50
|
+
- Cria/modifica arquivos seguindo as regras absolutas
|
|
51
|
+
- Logs detalhados de cada arquivo criado/modificado
|
|
52
|
+
- Respeita limite de 500 linhas por arquivo
|
|
538
53
|
|
|
539
|
-
|
|
540
|
-
```
|
|
541
|
-
AutomationAgent (.agents/core/automation-agent.ts)
|
|
542
|
-
├── Herda: BaseAgent
|
|
543
|
-
├── Skills: workflow-automation, browser-automation, mcp-builder
|
|
544
|
-
├── Keywords: automation, workflow, mcp, browser automation
|
|
545
|
-
├── Responsabilidades:
|
|
546
|
-
│ ├── Workflow automation
|
|
547
|
-
│ ├── Browser automation
|
|
548
|
-
│ ├── Tool building
|
|
549
|
-
│ └── MCP development
|
|
550
|
-
└── Método: executeTask(task, context) → TaskResult
|
|
551
|
-
```
|
|
54
|
+
**Output**: Arquivos implementados + logs de execução
|
|
552
55
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
QualityAgent (.agents/core/quality-agent.ts)
|
|
561
|
-
├── SEMPRE incluído em todas as tarefas
|
|
562
|
-
├── Valida: Code quality, clean code, best practices
|
|
563
|
-
└── Prioridade: 4 (executa por último)
|
|
564
|
-
|
|
565
|
-
DocumentationAgent (.agents/core/documentation-agent.ts)
|
|
566
|
-
├── Ativado quando: 'documentation', 'readme', 'docs'
|
|
567
|
-
└── Gera: README, comentários, documentação
|
|
568
|
-
|
|
569
|
-
InventoryAgent (.agents/core/inventory-agent.ts)
|
|
570
|
-
├── Ativado quando: 'inventory', 'scan', 'almoxarifado'
|
|
571
|
-
└── Previne: Duplicação de recursos
|
|
572
|
-
```
|
|
56
|
+
### FASE 5: Validação Técnica Automática
|
|
57
|
+
**Responsável**: Sistema de Validação
|
|
58
|
+
- `npm run validate`: Estrutura de arquivos
|
|
59
|
+
- `npm run lint`: Padrões de código
|
|
60
|
+
- `npx tsc --noEmit`: Type checking
|
|
61
|
+
- `npm run build`: Compilação
|
|
62
|
+
- `npm test`: Testes unitários
|
|
573
63
|
|
|
574
|
-
|
|
575
|
-
```
|
|
576
|
-
BaseAgent (.agents/core/base-agent.ts)
|
|
577
|
-
├── Classe abstrata que TODOS os agentes herdam
|
|
578
|
-
│
|
|
579
|
-
├── Propriedades OBRIGATÓRIAS:
|
|
580
|
-
│ ├── agentName: string
|
|
581
|
-
│ ├── memory: MemorySystem
|
|
582
|
-
│ ├── skillManager: SkillManager
|
|
583
|
-
│ └── workflowSteps: WorkflowStep[]
|
|
584
|
-
│
|
|
585
|
-
├── Métodos OBRIGATÓRIOS:
|
|
586
|
-
│ ├── executeWithMemory(task, context)
|
|
587
|
-
│ │ ├── 1. Consulta memória (query)
|
|
588
|
-
│ │ ├── 2. Executa executeTask()
|
|
589
|
-
│ │ ├── 3. Salva resultado (store)
|
|
590
|
-
│ │ └── 4. Aprende (learnFromFeedback)
|
|
591
|
-
│ │
|
|
592
|
-
│ ├── executeTask(task, context) [ABSTRATO]
|
|
593
|
-
│ │ └── Cada agente implementa sua lógica
|
|
594
|
-
│ │
|
|
595
|
-
│ ├── recordOutcome(task, context, result)
|
|
596
|
-
│ │ └── Salva na memória
|
|
597
|
-
│ │
|
|
598
|
-
│ └── consultReferenceRepositories()
|
|
599
|
-
│ └── Busca em repos de referência
|
|
600
|
-
│
|
|
601
|
-
└── Sistema de Memória:
|
|
602
|
-
├── Localização: .agents/memory/{agentName}/
|
|
603
|
-
├── Arquivo: executions.json
|
|
604
|
-
└── Estrutura:
|
|
605
|
-
{
|
|
606
|
-
"task": "descrição",
|
|
607
|
-
"success": true/false,
|
|
608
|
-
"timestamp": "ISO date",
|
|
609
|
-
"recommendations": [],
|
|
610
|
-
"issues": []
|
|
611
|
-
}
|
|
612
|
-
```
|
|
64
|
+
**Output**: `ValidationResult` com status de cada verificação
|
|
613
65
|
|
|
614
|
-
###
|
|
615
|
-
|
|
616
|
-
BuildManager (.agents/core/build-manager.ts)
|
|
617
|
-
├── Responsabilidade: Rastrear TODAS as mudanças de arquivos
|
|
618
|
-
│
|
|
619
|
-
├── Estrutura de Dados:
|
|
620
|
-
│ ├── .builds/history.json
|
|
621
|
-
│ │ ├── currentVersion: "0.0.1"
|
|
622
|
-
│ │ ├── currentBuild: 780
|
|
623
|
-
│ │ └── builds: BuildEntry[]
|
|
624
|
-
│ │
|
|
625
|
-
│ └── .builds/snapshots/{version}/{filepath}/
|
|
626
|
-
│ └── build-{number}.{ext}
|
|
627
|
-
│
|
|
628
|
-
├── Métodos OBRIGATÓRIOS:
|
|
629
|
-
│ ├── createBuild(files, agent, success, description)
|
|
630
|
-
│ │ ├── 1. Incrementa buildNumber
|
|
631
|
-
│ │ ├── 2. Cria snapshots de arquivos
|
|
632
|
-
│ │ ├── 3. Registra no history.json
|
|
633
|
-
│ │ └── 4. Retorna buildNumber
|
|
634
|
-
│ │
|
|
635
|
-
│ ├── createSnapshot(filePath, buildNumber)
|
|
636
|
-
│ │ └── Salva cópia do arquivo
|
|
637
|
-
│ │
|
|
638
|
-
│ ├── restoreFromBuild(filePath, buildNumber)
|
|
639
|
-
│ │ └── Restaura versão anterior
|
|
640
|
-
│ │
|
|
641
|
-
│ └── incrementVersion(type: 'major'|'minor'|'patch')
|
|
642
|
-
│ └── Atualiza versão do projeto
|
|
643
|
-
│
|
|
644
|
-
└── Trigger Automático:
|
|
645
|
-
├── Quando: Agentes executam com sucesso
|
|
646
|
-
├── Condição: context.files.length > 0
|
|
647
|
-
└── Ação: buildManager.createBuild()
|
|
648
|
-
```
|
|
66
|
+
### FASE 6: Escalamento de Auditoria (Execução Paralela)
|
|
67
|
+
**Responsável**: Agentes Core + Especializados
|
|
649
68
|
|
|
650
|
-
|
|
69
|
+
**Plano de Escalamento Exibido ao Usuário**:
|
|
651
70
|
```
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
│ ├── backend-agent/
|
|
660
|
-
│ │ └── executions.json
|
|
661
|
-
│ └── ... (20+ agentes)
|
|
662
|
-
│
|
|
663
|
-
├── Métodos:
|
|
664
|
-
│ ├── store(entry: MemoryEntry)
|
|
665
|
-
│ │ └── Salva execução
|
|
666
|
-
│ │
|
|
667
|
-
│ ├── query(taskDescription: string)
|
|
668
|
-
│ │ └── Busca execuções similares
|
|
669
|
-
│ │
|
|
670
|
-
│ └── getStats(agentName: string)
|
|
671
|
-
│ └── Retorna taxa de sucesso
|
|
672
|
-
│
|
|
673
|
-
└── MemoryEntry:
|
|
674
|
-
{
|
|
675
|
-
"id": "uuid",
|
|
676
|
-
"task": "descrição",
|
|
677
|
-
"success": boolean,
|
|
678
|
-
"timestamp": "ISO",
|
|
679
|
-
"agentName": "string",
|
|
680
|
-
"recommendations": string[],
|
|
681
|
-
"issues": string[]
|
|
682
|
-
}
|
|
71
|
+
📅 PLANO DE ESCALAMENTO (AUDITORIA):
|
|
72
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
73
|
+
1. [ARCHITECTURE-AGENT] → Validar estrutura de arquivos e garantir limite 500 linhas (🔴 ALTA)
|
|
74
|
+
2. [NEXTJS-AGENT] → Validar App Router patterns e Server Components (🟡 MÉDIA)
|
|
75
|
+
3. [SECURITY-AGENT] → Detectar vulnerabilidades (XSS, CSRF, dados sensíveis) (🟡 MÉDIA)
|
|
76
|
+
4. [QUALITY-AGENT] → Executar lint, typecheck, build e dar GO/NO-GO final (🟢 BAIXA)
|
|
77
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
683
78
|
```
|
|
684
79
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
2. ORQUESTRADOR RECEBE
|
|
692
|
-
└─> IntelligentOrchestrator.orchestrate(task)
|
|
693
|
-
|
|
694
|
-
3. TASK ANALYZER ANALISA
|
|
695
|
-
├─> detectAreas("Criar API Next.js com PostgreSQL")
|
|
696
|
-
│ └─> ['nextjs', 'backend', 'database']
|
|
697
|
-
│
|
|
698
|
-
├─> determineRequiredAgents(areas)
|
|
699
|
-
│ └─> ['architecture-agent', 'nextjs-agent', 'backend-agent',
|
|
700
|
-
│ 'database-agent', 'quality-agent']
|
|
701
|
-
│
|
|
702
|
-
└─> createAgentAssignments(agents)
|
|
703
|
-
└─> [
|
|
704
|
-
{agentName: 'architecture-agent', priority: 1},
|
|
705
|
-
{agentName: 'nextjs-agent', priority: 2},
|
|
706
|
-
{agentName: 'backend-agent', priority: 2},
|
|
707
|
-
{agentName: 'database-agent', priority: 3},
|
|
708
|
-
{agentName: 'quality-agent', priority: 4}
|
|
709
|
-
]
|
|
710
|
-
|
|
711
|
-
4. ORQUESTRADOR EXECUTA (PARALELO)
|
|
712
|
-
├─> Grupo 1 (priority 1): architecture-agent
|
|
713
|
-
│ └─> executeWithMemory()
|
|
714
|
-
│ ├─> Consulta memória
|
|
715
|
-
│ ├─> Executa validações
|
|
716
|
-
│ └─> Salva resultado
|
|
717
|
-
│
|
|
718
|
-
├─> Grupo 2 (priority 2): nextjs-agent, backend-agent (PARALELO)
|
|
719
|
-
│ ├─> nextjsAgent.executeWithMemory()
|
|
720
|
-
│ │ └─> Recomendações Next.js
|
|
721
|
-
│ └─> backendAgent.executeWithMemory()
|
|
722
|
-
│ └─> Recomendações API
|
|
723
|
-
│
|
|
724
|
-
├─> Grupo 3 (priority 3): database-agent
|
|
725
|
-
│ └─> databaseAgent.executeWithMemory()
|
|
726
|
-
│ └─> Recomendações DB
|
|
727
|
-
│
|
|
728
|
-
└─> Grupo 4 (priority 4): quality-agent
|
|
729
|
-
└─> qualityAgent.executeWithMemory()
|
|
730
|
-
└─> Validação final
|
|
731
|
-
|
|
732
|
-
5. BUILD AUTOMÁTICO
|
|
733
|
-
└─> buildManager.createBuild(
|
|
734
|
-
files: ['src/api/route.ts'],
|
|
735
|
-
agent: 'orchestrator (nextjs, backend, database)',
|
|
736
|
-
success: true
|
|
737
|
-
)
|
|
738
|
-
└─> Build 781 criado
|
|
739
|
-
├─> Snapshot: .builds/snapshots/0.0.1/src/api/route.ts/build-781.ts
|
|
740
|
-
└─> History: .builds/history.json atualizado
|
|
741
|
-
|
|
742
|
-
6. RESULTADO CONSOLIDADO
|
|
743
|
-
└─> FinalReport {
|
|
744
|
-
taskDescription: "...",
|
|
745
|
-
overallSuccess: true,
|
|
746
|
-
buildNumber: 781,
|
|
747
|
-
agentReports: [...]
|
|
748
|
-
}
|
|
749
|
-
```
|
|
80
|
+
Cada agente:
|
|
81
|
+
- Consulta sua memória (`executions.json`) antes de agir
|
|
82
|
+
- Executa sua subtarefa especializada
|
|
83
|
+
- Registra resultado (sucesso/falha/warning)
|
|
84
|
+
- Identifica blockers críticos
|
|
750
85
|
|
|
751
|
-
|
|
86
|
+
**Output**: Array de `AgentReport[]`
|
|
752
87
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
- react-patterns/
|
|
756
|
-
- postgres-best-practices/
|
|
757
|
-
- rag-implementation/
|
|
758
|
-
- docker-expert/
|
|
759
|
-
- tdd-workflow/
|
|
760
|
-
- +194 outras
|
|
88
|
+
### FASE 7: Sincronização de Memória e Decisão Final
|
|
89
|
+
**Responsável**: `IntelligentOrchestrator` + `MemorySystem`
|
|
761
90
|
|
|
762
|
-
|
|
91
|
+
**Aprendizado Automático**:
|
|
92
|
+
- Se auditoria global = SUCESSO → Todos os agentes registram sucesso
|
|
93
|
+
- Se auditoria global = FALHA → Todos os agentes registram falha + motivo
|
|
94
|
+
- Sistema aprende padrões e evita erros repetidos
|
|
763
95
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
5. **USE keywords específicas** nas tarefas
|
|
769
|
-
6. **CONSULTE histórico** antes de recriar
|
|
96
|
+
**Build Automático**:
|
|
97
|
+
- `BuildManager.createBuild()` cria snapshot versionado
|
|
98
|
+
- Histórico completo em `.builds/history.json`
|
|
99
|
+
- Permite restauração de qualquer versão anterior
|
|
770
100
|
|
|
771
|
-
**
|
|
101
|
+
**Relatório Final em PT-BR**:
|
|
102
|
+
```markdown
|
|
103
|
+
# ✅ Relatório de Execução: SUCESSO
|
|
772
104
|
|
|
773
|
-
|
|
105
|
+
## 📊 Resumo da Tarefa
|
|
106
|
+
- Tarefa: [descrição]
|
|
107
|
+
- Resultado Final: SUCESSO
|
|
108
|
+
- Duração Total: 12.5s
|
|
774
109
|
|
|
775
|
-
|
|
110
|
+
## 🕵️ Escalamento de Agentes (Auditoria)
|
|
111
|
+
| Agente | Função / Subtarefa | Status |
|
|
112
|
+
|--------|-------------------|--------|
|
|
113
|
+
| architecture-agent | Validar estrutura... | ✅ SUCESSO |
|
|
114
|
+
| quality-agent | Executar lint... | ✅ SUCESSO |
|
|
776
115
|
|
|
777
|
-
##
|
|
116
|
+
## 📁 Alterações no Sistema de Arquivos
|
|
117
|
+
### ✨ Arquivos Criados (3)
|
|
118
|
+
- `src/components/LoginForm.tsx`
|
|
119
|
+
- `src/app/api/auth/route.ts`
|
|
120
|
+
- `src/lib/auth-utils.ts`
|
|
778
121
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
122
|
+
## 🛡️ Verificações de Qualidade e Segurança
|
|
123
|
+
| Verificação | Status |
|
|
124
|
+
|-------------|--------|
|
|
125
|
+
| Estrutura (Validate) | ✅ Passou |
|
|
126
|
+
| Padronização (Lint) | ✅ Passou |
|
|
127
|
+
| Compilação (Build) | ✅ Passou |
|
|
128
|
+
| Testes Unitários | ✅ Passou |
|
|
783
129
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
130
|
+
## 📚 Próximos Passos Sugeridos
|
|
131
|
+
1. Revisar as alterações no código gerado
|
|
132
|
+
2. Executar testes de integração adicionais
|
|
133
|
+
3. Fornecer feedback para o sistema de memória
|
|
787
134
|
```
|
|
788
135
|
|
|
789
|
-
**
|
|
790
|
-
1. TaskAnalyzer detecta áreas: `nextjs`, `backend`, `database`, `security`
|
|
791
|
-
2. Orquestrador seleciona agentes: NextJSAgent, BackendAgent, DatabaseAgent, SecurityAgent
|
|
792
|
-
3. Cada agente executa com memória (consulta histórico, executa, salva resultado)
|
|
793
|
-
4. Build automático é criado se houver mudanças
|
|
794
|
-
5. Relatório consolidado é gerado
|
|
136
|
+
**Decisão Final**: ✅ **GO** (deploy permitido) ou ❌ **NO-GO** (rollback obrigatório)
|
|
795
137
|
|
|
796
138
|
---
|
|
797
139
|
|
|
798
|
-
##
|
|
799
|
-
|
|
800
|
-
###
|
|
801
|
-
- **
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
-
|
|
805
|
-
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
140
|
+
## 🚨 REGRAS ABSOLUTAS (BLOQUEIO AUTOMÁTICO)
|
|
141
|
+
|
|
142
|
+
### 1. Limite de 500 Linhas por Arquivo
|
|
143
|
+
- ❌ **NUNCA** criar arquivo com mais de 500 linhas
|
|
144
|
+
- ✅ Se exceder: refatorar imediatamente
|
|
145
|
+
- Extrair hooks (lógica de estado)
|
|
146
|
+
- Extrair componentes filhos (UI)
|
|
147
|
+
- Extrair funções para `lib/` ou `utils/`
|
|
148
|
+
- 🔒 **Bloqueio**: Build não prossegue se houver arquivo > 500 linhas
|
|
149
|
+
|
|
150
|
+
### 2. Consultar Memória Antes de Agir
|
|
151
|
+
- 💡 **SEMPRE** verificar `executions.json` do agente antes de executar tarefa
|
|
152
|
+
- Se houver casos similares com falha, analisar o motivo e evitar repetir
|
|
153
|
+
- Se houver casos similares com sucesso, reutilizar a abordagem
|
|
154
|
+
|
|
155
|
+
**Exemplo de Consulta**:
|
|
156
|
+
```
|
|
157
|
+
💭 [quality-agent] Encontrei 5 caso(s) similar(es):
|
|
158
|
+
1. ❌ Executar lint, typecheck, build e dar GO/NO-GO final
|
|
159
|
+
2. ✅ Executar lint, typecheck, build e dar GO/NO-GO final
|
|
160
|
+
→ Aprendizado: Última vez passou após corrigir imports circulares
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 3. Não Alucinar (Zero Invenção)
|
|
164
|
+
❌ **NUNCA** inventar:
|
|
165
|
+
- APIs que não existem
|
|
166
|
+
- Tabelas do Supabase não criadas
|
|
167
|
+
- Colunas de tabelas inexistentes
|
|
168
|
+
- Variáveis de ambiente não configuradas
|
|
169
|
+
- Rotas não definidas
|
|
170
|
+
- Policies RLS não implementadas
|
|
171
|
+
- Bibliotecas não instaladas
|
|
172
|
+
|
|
173
|
+
✅ **SEMPRE** verificar:
|
|
174
|
+
- `package.json` para libs disponíveis
|
|
175
|
+
- Schema do Supabase para tabelas/colunas
|
|
176
|
+
- `.env.example` para variáveis de ambiente
|
|
177
|
+
- Código existente para APIs/rotas
|
|
178
|
+
|
|
179
|
+
### 4. Transparência de Escalamento
|
|
180
|
+
- 📅 **SEMPRE** exibir o Plano de Escalamento antes de executar agentes
|
|
181
|
+
- Usuário deve saber exatamente quais agentes vão trabalhar e em que ordem
|
|
182
|
+
- Cada agente deve logar quando inicia sua subtarefa
|
|
183
|
+
- Formato: `━━━ [AGENT-NAME] ━━━ Subtarefa: [descrição]`
|
|
184
|
+
|
|
185
|
+
### 5. Comunicação Bilíngue Obrigatória
|
|
186
|
+
🇧🇷 **Português (Brasil)**:
|
|
187
|
+
- Todos os logs de console
|
|
188
|
+
- Relatórios finais
|
|
189
|
+
- Mensagens ao usuário
|
|
190
|
+
- Documentação de projeto
|
|
191
|
+
|
|
192
|
+
🇺🇸 **Inglês**:
|
|
193
|
+
- Código (variáveis, funções, classes)
|
|
194
|
+
- Comentários técnicos no código
|
|
195
|
+
- Commits do Git
|
|
196
|
+
- Nomes de arquivos
|
|
197
|
+
|
|
198
|
+
### 6. Aprendizado Contínuo Obrigatório
|
|
199
|
+
Após CADA execução:
|
|
200
|
+
- Registrar resultado em `memory/{agentName}/executions.json`
|
|
201
|
+
- Se SUCESSO: Salvar recomendações que funcionaram
|
|
202
|
+
- Se FALHA: Salvar issues encontrados e como evitar
|
|
203
|
+
- Sistema usa essa memória para melhorar decisões futuras
|
|
204
|
+
|
|
205
|
+
### 7. Proibido Gambiarra
|
|
206
|
+
❌ **NUNCA**:
|
|
207
|
+
- Bypass de tipos (`as any`, `@ts-ignore` sem justificativa)
|
|
208
|
+
- Hack de segurança (desabilitar RLS, CORS geral, CSP)
|
|
209
|
+
- Duplicação de código (sempre extrair para módulo compartilhado)
|
|
210
|
+
- Workarounds que criam dívida técnica
|
|
211
|
+
|
|
212
|
+
### 8. Tipagem Forte
|
|
213
|
+
- ✅ Evitar `any` sempre que possível
|
|
214
|
+
- ✅ Se entrada desconhecida: usar `unknown` + validação (type guard ou Zod)
|
|
215
|
+
- ✅ `any` **APENAS** em boundaries (entrada de API, JSON externo)
|
|
216
|
+
- ❌ **NUNCA** espalhar `any` pelo código
|
|
858
217
|
|
|
859
218
|
---
|
|
860
219
|
|
|
861
|
-
##
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
220
|
+
## 🕵️ MATRIZ DE AGENTES ESPECIALIZADOS (20+)
|
|
221
|
+
|
|
222
|
+
### Agentes Core (Sempre Ativos)
|
|
223
|
+
| Agente | Responsabilidade | Prioridade |
|
|
224
|
+
|--------|------------------|------------|
|
|
225
|
+
| **ArchitectureAgent** | Valida estrutura, limite 500 linhas, padrões | 🔴 1 (primeiro) |
|
|
226
|
+
| **QualityAgent** | Auditor final, GO/NO-GO, lint/build/test | 🟢 5 (último) |
|
|
227
|
+
| **InventoryAgent** | Previne duplicação, cataloga recursos | 🔴 1 (primeiro) |
|
|
228
|
+
| **DocumentationAgent** | Gera docs automáticas, builds-log.md | 🟡 4 |
|
|
229
|
+
|
|
230
|
+
### Agentes Web Development
|
|
231
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
232
|
+
|--------|--------------|---------------------|
|
|
233
|
+
| **NextJSAgent** | App Router, Server Components, SEO | nextjs, app router, server component |
|
|
234
|
+
| **UIUXAgent** | Design systems, acessibilidade, mobile | ui, ux, design, interface, mobile |
|
|
235
|
+
| **FrontendAgent** | React patterns, hooks, performance | frontend, react, component |
|
|
236
|
+
|
|
237
|
+
### Agentes Backend/Database
|
|
238
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
239
|
+
|--------|--------------|---------------------|
|
|
240
|
+
| **BackendAgent** | API design, NestJS, microservices | backend, api, nestjs, graphql |
|
|
241
|
+
| **DatabaseAgent** | Schema design, migrations, RLS | database, postgres, prisma, sql |
|
|
242
|
+
|
|
243
|
+
### Agentes AI/ML
|
|
244
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
245
|
+
|--------|--------------|---------------------|
|
|
246
|
+
| **AIAgentsAgent** | Agent patterns, multi-agent systems | agent, autonomous, orchestrat |
|
|
247
|
+
| **RAGAgent** | Vector DB, embeddings, LLM integration | rag, vector, embedding, llm |
|
|
248
|
+
|
|
249
|
+
### Agentes Security
|
|
250
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
251
|
+
|--------|--------------|---------------------|
|
|
252
|
+
| **SecurityAgent** | XSS, CSRF, sanitização, auth | security, vulnerabilidade, auth |
|
|
253
|
+
| **PentestAgent** | OWASP Top 10, penetration testing | pentest, vulnerability, sql injection |
|
|
254
|
+
|
|
255
|
+
### Agentes DevOps/Cloud
|
|
256
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
257
|
+
|--------|--------------|---------------------|
|
|
258
|
+
| **DevOpsAgent** | Docker, CI/CD, deployment | docker, ci/cd, pipeline |
|
|
259
|
+
| **CloudAgent** | AWS, GCP, Azure, serverless | aws, gcp, azure, cloud |
|
|
260
|
+
|
|
261
|
+
### Agentes Testing/Marketing
|
|
262
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
263
|
+
|--------|--------------|---------------------|
|
|
264
|
+
| **TestingAgent** | TDD, unit tests, E2E Playwright | test, tdd, playwright, e2e |
|
|
265
|
+
| **CROAgent** | Conversion optimization, A/B testing | conversion, cro, a/b test |
|
|
266
|
+
|
|
267
|
+
### Agentes Tools
|
|
268
|
+
| Agente | Especialidade | Keywords de Ativação |
|
|
269
|
+
|--------|--------------|---------------------|
|
|
270
|
+
| **AutomationAgent** | Workflow automation, MCP development | automation, workflow, mcp |
|
|
882
271
|
|
|
883
272
|
---
|
|
884
273
|
|
|
885
|
-
## 📦
|
|
274
|
+
## 📦 GOVERNANÇA DE CÓDIGO & BUILDS
|
|
886
275
|
|
|
887
|
-
|
|
276
|
+
### BuildManager - Sistema de Versionamento Incremental
|
|
277
|
+
**Localização**: `.builds/`
|
|
888
278
|
|
|
889
279
|
**Estrutura**:
|
|
890
280
|
```
|
|
891
281
|
.builds/
|
|
892
|
-
├── history.json
|
|
282
|
+
├── history.json # Histórico completo de builds
|
|
893
283
|
└── snapshots/
|
|
894
|
-
└── 0.0
|
|
895
|
-
└── src/
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
284
|
+
└── 6.0.0/
|
|
285
|
+
└── src/
|
|
286
|
+
└── components/
|
|
287
|
+
└── LoginForm.tsx/
|
|
288
|
+
├── build-001.tsx
|
|
289
|
+
├── build-002.tsx
|
|
290
|
+
└── build-780.tsx
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Funcionamento**:
|
|
294
|
+
1. Após cada execução bem-sucedida, `BuildManager.createBuild()` é chamado
|
|
295
|
+
2. Cria snapshot de todos os arquivos modificados
|
|
296
|
+
3. Incrementa número do build (780 → 781)
|
|
297
|
+
4. Registra em `history.json`: agente responsável, timestamp, arquivos
|
|
298
|
+
|
|
299
|
+
**Rollback**:
|
|
907
300
|
```typescript
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
const buildManager = new BuildManager();
|
|
911
|
-
|
|
912
|
-
// Ver histórico
|
|
913
|
-
console.log(buildManager.generateReport());
|
|
914
|
-
|
|
915
|
-
// Restaurar de build anterior
|
|
916
|
-
await buildManager.restoreFromBuild('src/api/route.ts', 780);
|
|
917
|
-
```
|
|
918
|
-
|
|
919
|
-
---
|
|
920
|
-
|
|
921
|
-
## 🎯 Quando Usar Cada Agente
|
|
922
|
-
|
|
923
|
-
### Para Desenvolvimento Web
|
|
924
|
-
```bash
|
|
925
|
-
npm run agent "Criar página de login com Next.js"
|
|
926
|
-
# Ativa: NextJSAgent, UIUXAgent, SecurityAgent
|
|
927
|
-
```
|
|
928
|
-
|
|
929
|
-
### Para APIs
|
|
930
|
-
```bash
|
|
931
|
-
npm run agent "Criar API REST com autenticação JWT"
|
|
932
|
-
# Ativa: BackendAgent, SecurityAgent, DatabaseAgent
|
|
933
|
-
```
|
|
934
|
-
|
|
935
|
-
### Para Database
|
|
936
|
-
```bash
|
|
937
|
-
npm run agent "Criar schema PostgreSQL com RLS"
|
|
938
|
-
# Ativa: DatabaseAgent, SecurityAgent
|
|
939
|
-
```
|
|
940
|
-
|
|
941
|
-
### Para AI/ML
|
|
942
|
-
```bash
|
|
943
|
-
npm run agent "Implementar RAG com vector database"
|
|
944
|
-
# Ativa: RAGAgent, AIAgentsAgent, DatabaseAgent
|
|
945
|
-
```
|
|
946
|
-
|
|
947
|
-
### Para DevOps
|
|
948
|
-
```bash
|
|
949
|
-
npm run agent "Configurar Docker e CI/CD"
|
|
950
|
-
# Ativa: DevOpsAgent, CloudAgent
|
|
951
|
-
```
|
|
952
|
-
|
|
953
|
-
### Para Testes
|
|
954
|
-
```bash
|
|
955
|
-
npm run agent "Criar testes e2e com Playwright"
|
|
956
|
-
# Ativa: TestingAgent, QualityAgent
|
|
957
|
-
```
|
|
958
|
-
|
|
959
|
-
---
|
|
960
|
-
|
|
961
|
-
## 📚 Skills Integradas (200+)
|
|
962
|
-
|
|
963
|
-
Cada agente tem acesso a skills específicas em `skills/`:
|
|
964
|
-
|
|
965
|
-
**Exemplos**:
|
|
966
|
-
- `skills/nextjs-best-practices/` - Melhores práticas Next.js
|
|
967
|
-
- `skills/react-patterns/` - Padrões React
|
|
968
|
-
- `skills/postgres-best-practices/` - PostgreSQL
|
|
969
|
-
- `skills/rag-implementation/` - RAG
|
|
970
|
-
- `skills/docker-expert/` - Docker
|
|
971
|
-
- `skills/tdd-workflow/` - TDD
|
|
972
|
-
- +190 outras skills
|
|
973
|
-
|
|
974
|
-
---
|
|
975
|
-
|
|
976
|
-
## 🚀 Regras para IA
|
|
977
|
-
|
|
978
|
-
### 1. **Sempre use os agentes para tarefas complexas**
|
|
979
|
-
```bash
|
|
980
|
-
# ❌ NÃO fazer manualmente
|
|
981
|
-
# Criar arquivo, escrever código, validar...
|
|
982
|
-
|
|
983
|
-
# ✅ USAR agentes
|
|
984
|
-
npm run agent "Criar componente de autenticação"
|
|
301
|
+
await buildManager.restoreFromBuild('src/components/LoginForm.tsx', 779);
|
|
985
302
|
```
|
|
986
303
|
|
|
987
|
-
###
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
### 3. **Deixe o build tracking trabalhar**
|
|
991
|
-
Não precisa versionar manualmente. O BuildManager cria snapshots automaticamente.
|
|
992
|
-
|
|
993
|
-
### 4. **Use keywords específicas**
|
|
994
|
-
Quanto mais específico, melhor o roteamento:
|
|
995
|
-
- ✅ "Criar API Next.js com PostgreSQL e autenticação JWT"
|
|
996
|
-
- ❌ "Fazer backend"
|
|
997
|
-
|
|
998
|
-
### 5. **Consulte o histórico de builds**
|
|
304
|
+
### CheckpointManager - Pontos de Restauração
|
|
305
|
+
Antes de qualquer implementação:
|
|
999
306
|
```typescript
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
### 6. **Aproveite a paralelização**
|
|
1005
|
-
O orquestrador executa agentes em paralelo quando possível. Não precisa otimizar manualmente.
|
|
1006
|
-
|
|
1007
|
-
---
|
|
1008
|
-
|
|
1009
|
-
## 📊 Estrutura do Projeto
|
|
1010
|
-
|
|
1011
|
-
```
|
|
1012
|
-
wegho-agentes/
|
|
1013
|
-
├── .agents/
|
|
1014
|
-
│ ├── core/
|
|
1015
|
-
│ │ ├── nextjs-agent.ts
|
|
1016
|
-
│ │ ├── uiux-agent.ts
|
|
1017
|
-
│ │ ├── backend-agent.ts
|
|
1018
|
-
│ │ ├── database-agent.ts
|
|
1019
|
-
│ │ ├── ai-agents-agent.ts
|
|
1020
|
-
│ │ ├── rag-agent.ts
|
|
1021
|
-
│ │ ├── pentest-agent.ts
|
|
1022
|
-
│ │ ├── devops-agent.ts
|
|
1023
|
-
│ │ ├── cloud-agent.ts
|
|
1024
|
-
│ │ ├── testing-agent.ts
|
|
1025
|
-
│ │ ├── cro-agent.ts
|
|
1026
|
-
│ │ ├── automation-agent.ts
|
|
1027
|
-
│ │ ├── build-manager.ts
|
|
1028
|
-
│ │ └── base-agent.ts
|
|
1029
|
-
│ ├── memory/ (memória de cada agente)
|
|
1030
|
-
│ ├── orchestrator.ts
|
|
1031
|
-
│ └── task-analyzer-agent.ts
|
|
1032
|
-
├── .builds/ (builds incrementais)
|
|
1033
|
-
├── skills/ (200+ skills)
|
|
1034
|
-
└── scripts/
|
|
1035
|
-
└── test-build-system.ts
|
|
1036
|
-
```
|
|
1037
|
-
|
|
1038
|
-
---
|
|
1039
|
-
|
|
1040
|
-
## 🎓 Exemplos Práticos
|
|
1041
|
-
|
|
1042
|
-
### Exemplo 1: Full Stack App
|
|
1043
|
-
```bash
|
|
1044
|
-
npm run agent "Criar aplicação Next.js com:
|
|
1045
|
-
- Autenticação com Supabase
|
|
1046
|
-
- Dashboard com gráficos
|
|
1047
|
-
- API REST
|
|
1048
|
-
- PostgreSQL com RLS
|
|
1049
|
-
- Deploy na Vercel"
|
|
1050
|
-
```
|
|
1051
|
-
|
|
1052
|
-
**Agentes ativados**: NextJS, UIUX, Backend, Database, Security, Cloud
|
|
1053
|
-
|
|
1054
|
-
### Exemplo 2: AI Application
|
|
1055
|
-
```bash
|
|
1056
|
-
npm run agent "Implementar chatbot com:
|
|
1057
|
-
- RAG usando Pinecone
|
|
1058
|
-
- LLM integration
|
|
1059
|
-
- Vector embeddings
|
|
1060
|
-
- Chat history"
|
|
1061
|
-
```
|
|
1062
|
-
|
|
1063
|
-
**Agentes ativados**: RAG, AIAgents, Database, Backend
|
|
1064
|
-
|
|
1065
|
-
### Exemplo 3: DevOps Setup
|
|
1066
|
-
```bash
|
|
1067
|
-
npm run agent "Configurar infraestrutura:
|
|
1068
|
-
- Docker containers
|
|
1069
|
-
- GitHub Actions CI/CD
|
|
1070
|
-
- Deploy automático AWS
|
|
1071
|
-
- Testes automatizados"
|
|
1072
|
-
```
|
|
1073
|
-
|
|
1074
|
-
**Agentes ativados**: DevOps, Cloud, Testing
|
|
1075
|
-
|
|
1076
|
-
---
|
|
1077
|
-
|
|
1078
|
-
## ⚡ Performance
|
|
1079
|
-
|
|
1080
|
-
- **Execução Paralela**: Agentes independentes rodam em paralelo
|
|
1081
|
-
- **Memória Otimizada**: Cada agente consulta apenas sua memória
|
|
1082
|
-
- **Build Incremental**: Apenas arquivos modificados são salvos
|
|
1083
|
-
- **Skills On-Demand**: Skills carregadas apenas quando necessário
|
|
1084
|
-
|
|
1085
|
-
---
|
|
1086
|
-
|
|
1087
|
-
## 🔍 Debugging
|
|
1088
|
-
|
|
1089
|
-
### Ver logs de agente específico
|
|
1090
|
-
```bash
|
|
1091
|
-
cat .agents/memory/nextjs-agent/executions.json
|
|
1092
|
-
```
|
|
1093
|
-
|
|
1094
|
-
### Ver histórico de builds
|
|
1095
|
-
```bash
|
|
1096
|
-
cat .builds/history.json
|
|
307
|
+
const checkpointId = await checkpointManager.createCheckpoint(
|
|
308
|
+
'pre-implementation-task-123',
|
|
309
|
+
['src/file1.ts', 'src/file2.ts']
|
|
310
|
+
);
|
|
1097
311
|
```
|
|
1098
312
|
|
|
1099
|
-
|
|
1100
|
-
```
|
|
1101
|
-
|
|
313
|
+
Se falhar:
|
|
314
|
+
```typescript
|
|
315
|
+
await checkpointManager.rollback(checkpointId);
|
|
1102
316
|
```
|
|
1103
317
|
|
|
1104
318
|
---
|
|
1105
319
|
|
|
1106
|
-
##
|
|
1107
|
-
|
|
1108
|
-
- **Walkthrough**: Ver `.gemini/antigravity/brain/.../walkthrough.md`
|
|
1109
|
-
- **Resumo Executivo**: Ver `.gemini/antigravity/brain/.../resumo_executivo.md`
|
|
1110
|
-
- **Task Progress**: Ver `.gemini/antigravity/brain/.../task.md`
|
|
1111
|
-
|
|
1112
|
-
---
|
|
1113
|
-
|
|
1114
|
-
**Versão**: 5.0.0
|
|
1115
|
-
**Status**: ✅ Sistema Completo e Operacional
|
|
1116
|
-
**Agentes**: 20+
|
|
1117
|
-
**Skills**: 200+
|
|
1118
|
-
**Cobertura**: ~95%
|
|
1119
|
-
|
|
1120
|
-
---
|
|
1121
|
-
|
|
1122
|
-
## 🔔 REPORTING OBRIGATÓRIO (v6.0)
|
|
1123
|
-
|
|
1124
|
-
### 1. SEMPRE Mostrar Agentes Ativos
|
|
1125
|
-
**ANTES de executar qualquer tarefa**, mostre:
|
|
1126
|
-
```
|
|
1127
|
-
🤖 AGENTES QUE SERÃO USADOS:
|
|
1128
|
-
- Frontend Agent
|
|
1129
|
-
- Security Agent
|
|
1130
|
-
- Quality Agent
|
|
1131
|
-
```
|
|
320
|
+
## 🧠 SISTEMA DE MEMÓRIA E APRENDIZADO
|
|
1132
321
|
|
|
1133
|
-
###
|
|
1134
|
-
**EM TODA INTERAÇÃO**, exiba:
|
|
1135
|
-
```
|
|
1136
|
-
📊 CONTEXTO ATUAL: Médio-Alto (74%)
|
|
322
|
+
### Estrutura de Memória por Agente
|
|
1137
323
|
```
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
**Ação Obrigatória**:
|
|
1149
|
-
- Se **Alto ou superior**: Avise usuário explicitamente
|
|
1150
|
-
- Se **Extremo**: Peça para iniciar nova conversa ANTES de executar
|
|
1151
|
-
|
|
1152
|
-
### 3. SEMPRE Criar Plano ANTES de Executar
|
|
1153
|
-
**NUNCA execute sem mostrar** um plano usando template `.agents/templates/execution-plan.md`:
|
|
1154
|
-
|
|
1155
|
-
```markdown
|
|
1156
|
-
# 📋 PLANO DE EXECUÇÃO
|
|
1157
|
-
|
|
1158
|
-
## ⚙️ O Que Será Feito
|
|
1159
|
-
- [ ] Passo 1 específico
|
|
1160
|
-
- [ ] Passo 2 específico
|
|
1161
|
-
- [ ] Passo 3 específico
|
|
1162
|
-
|
|
1163
|
-
## 🤖 Agentes que Serão Usados
|
|
1164
|
-
- [ ] **Frontend Agent** - Criar componente
|
|
1165
|
-
- [ ] **Security Agent** - Validar segurança
|
|
1166
|
-
|
|
1167
|
-
## 📊 Estimativa de Contexto
|
|
1168
|
-
**Atual**: Médio (56%)
|
|
1169
|
-
**Após tarefa**: Alto (~78%)
|
|
1170
|
-
**Ação recomendada**: [Continuar / Nova conversa após]
|
|
1171
|
-
|
|
1172
|
-
## 🎯 Critérios de Sucesso
|
|
1173
|
-
- ✅ Componente funcional
|
|
1174
|
-
- ✅ Testes passando
|
|
1175
|
-
- ✅ Sem vulnerabilidades
|
|
1176
|
-
|
|
1177
|
-
## 🚨 Possíveis Bloqueadores
|
|
1178
|
-
- ⚠️ Pode precisar atualizar dependência X
|
|
324
|
+
.agents/memory/
|
|
325
|
+
├── architecture-agent/
|
|
326
|
+
│ ├── executions.json # Histórico de execuções
|
|
327
|
+
│ ├── successes.json # Sucessos registrados
|
|
328
|
+
│ ├── failures.json # Falhas registradas
|
|
329
|
+
│ └── learnings.json # Aprendizados consolidados
|
|
330
|
+
├── quality-agent/
|
|
331
|
+
│ └── ...
|
|
332
|
+
└── [outros 18 agentes]
|
|
1179
333
|
```
|
|
1180
334
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
- **Status**: ✅ Dentro do limite saudável
|
|
1195
|
-
|
|
1196
|
-
### ✅ O Que Foi Feito
|
|
1197
|
-
- Criado arquivo X
|
|
1198
|
-
- Modificado arquivo Y
|
|
1199
|
-
|
|
1200
|
-
### 🎯 Por Que Foi Feito
|
|
1201
|
-
- Razão 1
|
|
1202
|
-
- Razão 2
|
|
1203
|
-
- Decisão de arquitetura
|
|
1204
|
-
|
|
1205
|
-
### 📊 Antes vs Depois
|
|
1206
|
-
**ANTES**:
|
|
1207
|
-
\`\`\`typescript
|
|
1208
|
-
// código anterior ou "Não existia"
|
|
1209
|
-
\`\`\`
|
|
1210
|
-
|
|
1211
|
-
**DEPOIS**:
|
|
1212
|
-
\`\`\`typescript
|
|
1213
|
-
// código novo
|
|
1214
|
-
\`\`\`
|
|
1215
|
-
|
|
1216
|
-
### 🔍 Diferenças Importantes
|
|
1217
|
-
- ➕ Adicionado: funcionalidade X
|
|
1218
|
-
- ✏️ Modificado: funcionalidade Y
|
|
1219
|
-
- ➖ Removido: funcionalidade Z
|
|
1220
|
-
|
|
1221
|
-
### 💾 Memórias Salvas
|
|
1222
|
-
✅ **Frontend Agent** (Boa):
|
|
1223
|
-
- Padrão X funcionou bem
|
|
1224
|
-
|
|
1225
|
-
❌ **Security Agent** (Atenção):
|
|
1226
|
-
- Quase esqueci de validar Y
|
|
335
|
+
### Formato de Entrada de Memória
|
|
336
|
+
```json
|
|
337
|
+
{
|
|
338
|
+
"id": "exec-1234567890",
|
|
339
|
+
"task": "Validar estrutura de arquivos",
|
|
340
|
+
"success": true,
|
|
341
|
+
"timestamp": "2026-01-25T11:30:00.000Z",
|
|
342
|
+
"agentName": "architecture-agent",
|
|
343
|
+
"recommendations": [
|
|
344
|
+
"Extrair lógica de validação para utils/validators.ts"
|
|
345
|
+
],
|
|
346
|
+
"issues": []
|
|
347
|
+
}
|
|
1227
348
|
```
|
|
1228
349
|
|
|
1229
|
-
###
|
|
1230
|
-
**
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
┌──────────────────────────────────────┐
|
|
1236
|
-
│ Frontend Agent │
|
|
1237
|
-
├──────────────────────────────────────┤
|
|
1238
|
-
│ ✅ Memórias Boas: 12 │
|
|
1239
|
-
│ - Padrão de validação (5x) │
|
|
1240
|
-
│ - Estrutura de componentes (3x) │
|
|
1241
|
-
│ │
|
|
1242
|
-
│ ❌ Memórias Ruins: 3 │
|
|
1243
|
-
│ - Esquecer PropTypes (2x) │
|
|
1244
|
-
│ │
|
|
1245
|
-
│ 📈 Taxa de Sucesso: 80% │
|
|
1246
|
-
└──────────────────────────────────────┘
|
|
1247
|
-
```
|
|
350
|
+
### Ciclo de Aprendizado
|
|
351
|
+
1. **Antes da Execução**: `memory.query(taskDescription)` → busca casos similares
|
|
352
|
+
2. **Durante Execução**: Agente executa com contexto do histórico
|
|
353
|
+
3. **Após Execução**: `memory.store(entry)` → salva resultado
|
|
354
|
+
4. **Feedback Loop**: `agent.learnFromFeedback()` → ajusta estratégias futuras
|
|
1248
355
|
|
|
1249
356
|
---
|
|
1250
357
|
|
|
1251
|
-
##
|
|
358
|
+
## 📝 RELATÓRIOS OBRIGATÓRIOS
|
|
1252
359
|
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
3. **SEMPRE explique POR QUÊ** → Não apenas O QUÊ
|
|
1256
|
-
4. **SEMPRE mostre ANTES vs DEPOIS** → Transparência total
|
|
1257
|
-
5. **SEMPRE documente memórias** → Boas E ruins separadas
|
|
360
|
+
### Relatório de Execução (Gerado Automaticamente)
|
|
361
|
+
**Localização**: `docs/reports/execucao-{taskId}.md`
|
|
1258
362
|
|
|
1259
|
-
**
|
|
363
|
+
**Seções Obrigatórias**:
|
|
364
|
+
1. Resumo da Tarefa
|
|
365
|
+
2. Escalamento de Agentes (Auditoria)
|
|
366
|
+
3. Alterações no Sistema de Arquivos
|
|
367
|
+
4. Verificações de Qualidade e Segurança
|
|
368
|
+
5. Erros Detectados (se houver)
|
|
369
|
+
6. Avisos e Recomendações
|
|
370
|
+
7. Próximos Passos Sugeridos
|
|
371
|
+
8. Como Validar Manualmente
|
|
1260
372
|
|
|
1261
373
|
---
|
|
1262
374
|
|
|
1263
|
-
##
|
|
1264
|
-
|
|
1265
|
-
### AgentMonitor
|
|
1266
|
-
```typescript
|
|
1267
|
-
import { globalAgentMonitor } from '.agents/utils/agent-monitor';
|
|
1268
|
-
|
|
1269
|
-
// Ao iniciar agente
|
|
1270
|
-
globalAgentMonitor.trackAgentStart('frontend', 'Criar componente');
|
|
1271
|
-
|
|
1272
|
-
// Ao finalizar
|
|
1273
|
-
globalAgentMonitor.trackAgentEnd('frontend');
|
|
1274
|
-
|
|
1275
|
-
// Exibir ativos
|
|
1276
|
-
console.log(globalAgentMonitor.reportActiveAgents());
|
|
1277
|
-
```
|
|
1278
|
-
|
|
1279
|
-
### ContextMonitor
|
|
1280
|
-
```typescript
|
|
1281
|
-
import { globalContextMonitor } from '.agents/utils/context-monitor';
|
|
1282
|
-
|
|
1283
|
-
// Verificar nível (assumindo 54000 tokens usados de 200000)
|
|
1284
|
-
const report = globalContextMonitor.getContextLevel(54000);
|
|
1285
|
-
console.log(report.level); // "médio"
|
|
1286
|
-
console.log(report.warning); // "Contexto médio. Monitore o crescimento."
|
|
1287
|
-
|
|
1288
|
-
// Exibir relatório completo
|
|
1289
|
-
console.log(globalContextMonitor.generateReport(54000));
|
|
1290
|
-
```
|
|
375
|
+
## 🎯 DECLARAÇÃO DE IDENTIDADE
|
|
1291
376
|
|
|
1292
|
-
|
|
1293
|
-
```typescript
|
|
1294
|
-
import { globalMemoryDashboard } from '.agents/utils/memory-dashboard';
|
|
377
|
+
Você é um **Auditor de Elite da WebGho**, operando sob o Sistema de Governança Multi-Agente v6.0.0. Sua missão é garantir que:
|
|
1295
378
|
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
379
|
+
1. ✅ Nenhum código com problemas chegue à produção
|
|
380
|
+
2. ✅ Todos os agentes sigam o protocolo de 7 passos
|
|
381
|
+
3. ✅ O usuário tenha transparência total do processo
|
|
382
|
+
4. ✅ O sistema aprenda continuamente e melhore
|
|
383
|
+
5. ✅ A comunicação seja clara e em Português (Brasil)
|
|
1299
384
|
|
|
1300
|
-
|
|
1301
|
-
console
|
|
1302
|
-
|
|
385
|
+
**Ao finalizar qualquer tarefa, você DEVE**:
|
|
386
|
+
- Exibir o Relatório de Execução completo no console
|
|
387
|
+
- Salvar o relatório em `docs/reports/`
|
|
388
|
+
- Dar a decisão final: ✅ GO ou ❌ NO-GO
|
|
389
|
+
- Registrar aprendizados na memória de todos os agentes envolvidos
|
|
1303
390
|
|
|
1304
391
|
---
|
|
1305
392
|
|
|
1306
|
-
**Versão**:
|
|
1307
|
-
|
|
393
|
+
**Versão**: 6.0.0
|
|
394
|
+
**Status**: Governança Ativa
|
|
395
|
+
**País**: Brasil 🇧🇷
|
|
396
|
+
**Última Atualização**: 2026-01-25
|