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
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Pentest Agent - Especialidade
|
|
2
|
-
|
|
3
|
-
## Responsabilidades
|
|
4
|
-
- Definir responsabilidades especÃficas
|
|
5
|
-
|
|
6
|
-
## Expertise
|
|
7
|
-
- Definir áreas de expertise
|
|
8
|
-
|
|
9
|
-
## Regras
|
|
10
|
-
- Arquivos < 500 linhas
|
|
11
|
-
- Não alucinar APIs
|
|
12
|
-
|
|
13
|
-
## Tarefas TÃpicas
|
|
14
|
-
- Listar tarefas tÃpicas
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# Planning Agent
|
|
2
|
-
|
|
3
|
-
## 🎯 Responsabilidade
|
|
4
|
-
|
|
5
|
-
Criar planos de implementação, quebrar tarefas complexas, estimar esforço e validar viabilidade técnica.
|
|
6
|
-
|
|
7
|
-
## 🛠️ Skills Disponíveis
|
|
8
|
-
|
|
9
|
-
*Skills de planejamento serão mapeadas quando adicionadas*
|
|
10
|
-
|
|
11
|
-
#### [concise-planning](../../skills/concise-planning/)
|
|
12
|
-
**Propósito**: Planejamento conciso
|
|
13
|
-
**Quando usar**: Criar planos objetivos
|
|
14
|
-
|
|
15
|
-
#### [executing-plans](../../skills/executing-plans/)
|
|
16
|
-
**Propósito**: Execução de planos
|
|
17
|
-
**Quando usar**: Implementar roadmaps
|
|
18
|
-
|
|
19
|
-
#### [kaizen](../../skills/kaizen/)
|
|
20
|
-
**Propósito**: Melhoria contínua
|
|
21
|
-
**Quando usar**: Otimização incremental
|
|
22
|
-
|
|
23
|
-
#### [launch-strategy](../../skills/launch-strategy/)
|
|
24
|
-
**Propósito**: Estratégia de lançamento
|
|
25
|
-
**Quando usar**: Planejar go-to-market
|
|
26
|
-
|
|
27
|
-
#### [ai-product](../../skills/ai-product/)
|
|
28
|
-
**Propósito**: Produtos com IA
|
|
29
|
-
**Quando usar**: Planejar produtos AI-powered
|
|
30
|
-
|
|
31
|
-
#### [ai-wrapper-product](../../skills/ai-wrapper-product/)
|
|
32
|
-
**Propósito**: Wrappers de IA
|
|
33
|
-
**Quando usar**: Produtos wrapper de LLMs
|
|
34
|
-
|
|
35
|
-
#### [app-builder](../../skills/app-builder/)
|
|
36
|
-
**Propósito**: Construção de apps
|
|
37
|
-
**Quando usar**: Scaffolding de aplicativos
|
|
38
|
-
|
|
39
|
-
#### [micro-saas-launcher](../../skills/micro-saas-launcher/)
|
|
40
|
-
**Propósito**: Micro-SaaS
|
|
41
|
-
**Quando usar**: Lançar produtos SaaS pequenos
|
|
42
|
-
|
|
43
|
-
#### [brand-guidelines-anthropic](../../skills/brand-guidelines-anthropic/)
|
|
44
|
-
**Propósito**: Branding Anthropic
|
|
45
|
-
**Quando usar**: Referência de brand guidelines
|
|
46
|
-
|
|
47
|
-
#### [brand-guidelines-community](../../skills/brand-guidelines-community/)
|
|
48
|
-
**Propósito**: Branding community
|
|
49
|
-
**Quando usar**: Guidelines de comunidade
|
|
50
|
-
|
|
51
|
-
#### [notion-template-business](../../skills/notion-template-business/)
|
|
52
|
-
**Propósito**: Templates Notion
|
|
53
|
-
**Quando usar**: Organização de projetos
|
|
54
|
-
|
|
55
|
-
#### [brainstorming](../../skills/brainstorming/)
|
|
56
|
-
**Propósito**: Brainstorming estruturado
|
|
57
|
-
**Quando usar**: Gerar ideias
|
|
58
|
-
|
|
59
|
-
#### [voice-agents](../../skills/voice-agents/)
|
|
60
|
-
**Propósito**: Agentes de voz
|
|
61
|
-
**Quando usar**: Assistentes de voz
|
|
62
|
-
|
|
63
|
-
#### [mcp-builder](../../skills/mcp-builder/)
|
|
64
|
-
**Propósito**: Model Context Protocol builder
|
|
65
|
-
**Quando usar**: Criar MCP servers
|
|
66
|
-
|
|
67
|
-
#### [cc-skill-strategic-compact](../../skills/cc-skill-strategic-compact/)
|
|
68
|
-
**Propósito**: Estratégia compacta
|
|
69
|
-
**Quando usar**: Decisões estratégicas
|
|
70
|
-
|
|
71
|
-
#### [subagent-driven-development](../../skills/subagent-driven-development/)
|
|
72
|
-
**Propósito**: Desenvolvimento com subagentes
|
|
73
|
-
**Quando usar**: Delegar a subagentes
|
|
74
|
-
|
|
75
|
-
#### [loki-mode](../../skills/loki-mode/)
|
|
76
|
-
**Propósito**: Modo Loki
|
|
77
|
-
**Quando usar**: Comportamento específico
|
|
78
|
-
|
|
79
|
-
#### [blockrun](../../skills/blockrun/)
|
|
80
|
-
**Propósito**: Blockrun framework
|
|
81
|
-
**Quando usar**: Workflows baseados em blocos
|
|
82
|
-
|
|
83
|
-
## 📋 Tarefas Típicas
|
|
84
|
-
|
|
85
|
-
- ✅ Criar planos de implementação
|
|
86
|
-
- ✅ Decompor tarefas complexas
|
|
87
|
-
- ✅ Estimar esforço e tempo
|
|
88
|
-
- ✅ Identificar dependências
|
|
89
|
-
- ✅ Validar viabilidade
|
|
90
|
-
- ✅ Definir milestones
|
|
91
|
-
|
|
92
|
-
## 🔗 Dependências
|
|
93
|
-
|
|
94
|
-
- `BaseAgent`
|
|
95
|
-
- `MemorySystem`
|
|
96
|
-
- `SkillManager`
|
|
97
|
-
|
|
98
|
-
## 🔄 Fluxo de Trabalho
|
|
99
|
-
|
|
100
|
-
1. **Consulta memória**: Busca planos similares
|
|
101
|
-
2. **Carrega skills**: planning patterns
|
|
102
|
-
3. **Executa planejamento**: Cria roadmap detalhado
|
|
103
|
-
4. **Registra resultado**: Salva plano em memory.md
|
|
104
|
-
|
|
105
|
-
## 📊 Memória
|
|
106
|
-
|
|
107
|
-
Ver [memory.md](./memory.md) para histórico de planos criados.
|
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { BaseAgent, TaskContext, TaskResult } from '../../base/base-agent.js';
|
|
2
|
-
import { InventoryAgent } from './inventory-agent.js';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Planning Agent - Cria planos de implementação automáticos
|
|
8
|
-
*
|
|
9
|
-
* Responsabilidades:
|
|
10
|
-
* - Analisar tarefa e criar plano detalhado
|
|
11
|
-
* - Definir arquitetura de solução
|
|
12
|
-
* - Listar arquivos a criar/modificar
|
|
13
|
-
* - Estimar esforço e complexidade
|
|
14
|
-
* - Validar viabilidade técnica
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export interface ImplementationPlan {
|
|
18
|
-
title: string;
|
|
19
|
-
description: string;
|
|
20
|
-
architecture: {
|
|
21
|
-
components: string[];
|
|
22
|
-
apis: string[];
|
|
23
|
-
database: string[];
|
|
24
|
-
dependencies: string[];
|
|
25
|
-
};
|
|
26
|
-
files: {
|
|
27
|
-
create: Array<{
|
|
28
|
-
path: string;
|
|
29
|
-
type: 'component' | 'api' | 'hook' | 'util' | 'type' | 'config';
|
|
30
|
-
purpose: string;
|
|
31
|
-
}>;
|
|
32
|
-
modify: Array<{
|
|
33
|
-
path: string;
|
|
34
|
-
changes: string;
|
|
35
|
-
}>;
|
|
36
|
-
delete: string[];
|
|
37
|
-
};
|
|
38
|
-
steps: string[];
|
|
39
|
-
estimatedTime: string;
|
|
40
|
-
complexity: 'low' | 'medium' | 'high';
|
|
41
|
-
risks: string[];
|
|
42
|
-
dependencies: string[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export class PlanningAgent extends BaseAgent {
|
|
46
|
-
private inventoryAgent: InventoryAgent;
|
|
47
|
-
private projectRoot: string;
|
|
48
|
-
|
|
49
|
-
constructor(memoryPath: string, projectRoot: string = process.cwd()) {
|
|
50
|
-
super('planning-agent', memoryPath);
|
|
51
|
-
this.projectRoot = projectRoot;
|
|
52
|
-
this.inventoryAgent = new InventoryAgent(projectRoot, memoryPath);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Cria um plano de implementação completo
|
|
57
|
-
*/
|
|
58
|
-
async createImplementationPlan(taskDescription: string): Promise<ImplementationPlan> {
|
|
59
|
-
console.log('\nðŸ—ï¸ Criando plano de implementação...\n');
|
|
60
|
-
|
|
61
|
-
// 1. Analisar tarefa
|
|
62
|
-
const taskAnalysis = this.analyzeTask(taskDescription);
|
|
63
|
-
|
|
64
|
-
// 2. Consultar inventário para entender projeto
|
|
65
|
-
const inventory = await this.consultInventory();
|
|
66
|
-
|
|
67
|
-
// 3. Definir arquitetura
|
|
68
|
-
const architecture = this.defineArchitecture(taskAnalysis, inventory);
|
|
69
|
-
|
|
70
|
-
// 4. Planejar arquivos
|
|
71
|
-
const files = this.planFiles(taskAnalysis, architecture, inventory);
|
|
72
|
-
|
|
73
|
-
// 5. Criar passos de execução
|
|
74
|
-
const steps = this.createExecutionSteps(architecture, files);
|
|
75
|
-
|
|
76
|
-
// 6. Estimar esforço
|
|
77
|
-
const { estimatedTime, complexity } = this.estimateEffort(files, architecture);
|
|
78
|
-
|
|
79
|
-
// 7. Identificar riscos
|
|
80
|
-
const risks = this.identifyRisks(taskAnalysis, architecture);
|
|
81
|
-
|
|
82
|
-
// 8. Listar dependências
|
|
83
|
-
const dependencies = this.listDependencies(architecture);
|
|
84
|
-
|
|
85
|
-
const plan: ImplementationPlan = {
|
|
86
|
-
title: taskAnalysis.title,
|
|
87
|
-
description: taskAnalysis.description,
|
|
88
|
-
architecture,
|
|
89
|
-
files,
|
|
90
|
-
steps,
|
|
91
|
-
estimatedTime,
|
|
92
|
-
complexity,
|
|
93
|
-
risks,
|
|
94
|
-
dependencies
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// Exibir plano
|
|
98
|
-
this.displayPlan(plan);
|
|
99
|
-
|
|
100
|
-
return plan;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Analisa a tarefa e extrai informações chave
|
|
105
|
-
*/
|
|
106
|
-
private analyzeTask(taskDescription: string): {
|
|
107
|
-
title: string;
|
|
108
|
-
description: string;
|
|
109
|
-
type: string;
|
|
110
|
-
keywords: string[];
|
|
111
|
-
} {
|
|
112
|
-
const lower = taskDescription.toLowerCase();
|
|
113
|
-
|
|
114
|
-
// Detectar tipo de tarefa
|
|
115
|
-
let type = 'feature';
|
|
116
|
-
if (lower.includes('criar') || lower.includes('adicionar')) type = 'create';
|
|
117
|
-
if (lower.includes('modificar') || lower.includes('atualizar')) type = 'update';
|
|
118
|
-
if (lower.includes('remover') || lower.includes('deletar')) type = 'delete';
|
|
119
|
-
if (lower.includes('corrigir') || lower.includes('bug')) type = 'fix';
|
|
120
|
-
|
|
121
|
-
// Extrair keywords importantes
|
|
122
|
-
const keywords: string[] = [];
|
|
123
|
-
if (lower.includes('autenticação') || lower.includes('login')) keywords.push('auth');
|
|
124
|
-
if (lower.includes('dashboard') || lower.includes('painel')) keywords.push('dashboard');
|
|
125
|
-
if (lower.includes('formulário') || lower.includes('form')) keywords.push('form');
|
|
126
|
-
if (lower.includes('api') || lower.includes('endpoint')) keywords.push('api');
|
|
127
|
-
if (lower.includes('banco') || lower.includes('database')) keywords.push('database');
|
|
128
|
-
if (lower.includes('componente') || lower.includes('component')) keywords.push('component');
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
title: this.extractTitle(taskDescription),
|
|
132
|
-
description: taskDescription,
|
|
133
|
-
type,
|
|
134
|
-
keywords
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Extrai tÃtulo da tarefa
|
|
140
|
-
*/
|
|
141
|
-
private extractTitle(taskDescription: string): string {
|
|
142
|
-
// Remove palavras de ação e retorna o resto
|
|
143
|
-
return taskDescription
|
|
144
|
-
.replace(/^(criar|adicionar|modificar|atualizar|remover|deletar|corrigir)\s+/i, '')
|
|
145
|
-
.trim()
|
|
146
|
-
.split(' ')
|
|
147
|
-
.slice(0, 5)
|
|
148
|
-
.join(' ');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Consulta inventário do projeto
|
|
153
|
-
*/
|
|
154
|
-
private async consultInventory(): Promise<any> {
|
|
155
|
-
try {
|
|
156
|
-
const inventoryPath = path.join(this.projectRoot, '.agents', 'memory', 'inventory-agent', 'inventory');
|
|
157
|
-
|
|
158
|
-
if (!fs.existsSync(inventoryPath)) {
|
|
159
|
-
return { components: [], apis: [], types: [] };
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const components = this.loadInventoryFile(path.join(inventoryPath, 'components.json'));
|
|
163
|
-
const apis = this.loadInventoryFile(path.join(inventoryPath, 'endpoints.json'));
|
|
164
|
-
const types = this.loadInventoryFile(path.join(inventoryPath, 'types.json'));
|
|
165
|
-
|
|
166
|
-
return { components, apis, types };
|
|
167
|
-
} catch (error) {
|
|
168
|
-
console.warn('âš ï¸ Não foi possÃvel carregar inventário completo');
|
|
169
|
-
return { components: [], apis: [], types: [] };
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Carrega arquivo de inventário
|
|
175
|
-
*/
|
|
176
|
-
private loadInventoryFile(filePath: string): any[] {
|
|
177
|
-
try {
|
|
178
|
-
if (fs.existsSync(filePath)) {
|
|
179
|
-
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
180
|
-
}
|
|
181
|
-
} catch (error) {
|
|
182
|
-
// Ignora erro
|
|
183
|
-
}
|
|
184
|
-
return [];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Define arquitetura da solução
|
|
189
|
-
*/
|
|
190
|
-
private defineArchitecture(taskAnalysis: any, inventory: any): ImplementationPlan['architecture'] {
|
|
191
|
-
const architecture: ImplementationPlan['architecture'] = {
|
|
192
|
-
components: [],
|
|
193
|
-
apis: [],
|
|
194
|
-
database: [],
|
|
195
|
-
dependencies: []
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
// Baseado nas keywords, definir componentes necessários
|
|
199
|
-
if (taskAnalysis.keywords.includes('auth')) {
|
|
200
|
-
architecture.components.push('AuthProvider', 'LoginForm', 'ProtectedRoute');
|
|
201
|
-
architecture.apis.push('/api/auth/login', '/api/auth/logout', '/api/auth/session');
|
|
202
|
-
architecture.database.push('users', 'sessions');
|
|
203
|
-
architecture.dependencies.push('@supabase/auth-helpers-nextjs');
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (taskAnalysis.keywords.includes('dashboard')) {
|
|
207
|
-
architecture.components.push('DashboardLayout', 'StatsCard', 'ChartWidget');
|
|
208
|
-
architecture.apis.push('/api/dashboard/stats');
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (taskAnalysis.keywords.includes('form')) {
|
|
212
|
-
architecture.components.push('FormComponent', 'FormField', 'FormValidation');
|
|
213
|
-
architecture.dependencies.push('react-hook-form', 'zod');
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return architecture;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Planeja arquivos a criar/modificar
|
|
221
|
-
*/
|
|
222
|
-
private planFiles(taskAnalysis: any, architecture: any, inventory: any): ImplementationPlan['files'] {
|
|
223
|
-
const files: ImplementationPlan['files'] = {
|
|
224
|
-
create: [],
|
|
225
|
-
modify: [],
|
|
226
|
-
delete: []
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// Criar componentes
|
|
230
|
-
for (const component of architecture.components) {
|
|
231
|
-
files.create.push({
|
|
232
|
-
path: `components/${component}.tsx`,
|
|
233
|
-
type: 'component',
|
|
234
|
-
purpose: `Componente ${component}`
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Criar APIs
|
|
239
|
-
for (const api of architecture.apis) {
|
|
240
|
-
const apiPath = api.replace('/api/', 'app/api/') + '/route.ts';
|
|
241
|
-
files.create.push({
|
|
242
|
-
path: apiPath,
|
|
243
|
-
type: 'api',
|
|
244
|
-
purpose: `Endpoint ${api}`
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Modificar layout se necessário
|
|
249
|
-
if (architecture.components.length > 0) {
|
|
250
|
-
files.modify.push({
|
|
251
|
-
path: 'app/layout.tsx',
|
|
252
|
-
changes: 'Adicionar providers necessários'
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return files;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Cria passos de execução
|
|
261
|
-
*/
|
|
262
|
-
private createExecutionSteps(architecture: any, files: any): string[] {
|
|
263
|
-
const steps: string[] = [];
|
|
264
|
-
|
|
265
|
-
if (architecture.database.length > 0) {
|
|
266
|
-
steps.push('1. Criar/atualizar tabelas no banco de dados');
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
if (architecture.dependencies.length > 0) {
|
|
270
|
-
steps.push('2. Instalar dependências necessárias');
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (files.create.length > 0) {
|
|
274
|
-
steps.push('3. Criar novos arquivos');
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
if (files.modify.length > 0) {
|
|
278
|
-
steps.push('4. Modificar arquivos existentes');
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
steps.push('5. Validar implementação');
|
|
282
|
-
steps.push('6. Executar testes');
|
|
283
|
-
|
|
284
|
-
return steps;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Estima esforço necessário
|
|
289
|
-
*/
|
|
290
|
-
private estimateEffort(files: any, architecture: any): { estimatedTime: string; complexity: 'low' | 'medium' | 'high' } {
|
|
291
|
-
const totalFiles = files.create.length + files.modify.length;
|
|
292
|
-
const hasDatabaseChanges = architecture.database.length > 0;
|
|
293
|
-
const hasAPIs = architecture.apis.length > 0;
|
|
294
|
-
|
|
295
|
-
let minutes = totalFiles * 5; // 5min por arquivo base
|
|
296
|
-
|
|
297
|
-
if (hasDatabaseChanges) minutes += 15;
|
|
298
|
-
if (hasAPIs) minutes += totalFiles * 3;
|
|
299
|
-
|
|
300
|
-
let complexity: 'low' | 'medium' | 'high' = 'low';
|
|
301
|
-
if (totalFiles > 5 || hasDatabaseChanges) complexity = 'medium';
|
|
302
|
-
if (totalFiles > 10 || (hasDatabaseChanges && hasAPIs)) complexity = 'high';
|
|
303
|
-
|
|
304
|
-
return {
|
|
305
|
-
estimatedTime: `${minutes}min`,
|
|
306
|
-
complexity
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Identifica riscos potenciais
|
|
312
|
-
*/
|
|
313
|
-
private identifyRisks(taskAnalysis: any, architecture: any): string[] {
|
|
314
|
-
const risks: string[] = [];
|
|
315
|
-
|
|
316
|
-
if (architecture.database.length > 0) {
|
|
317
|
-
risks.push('Mudanças no banco de dados podem afetar dados existentes');
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (architecture.apis.length > 3) {
|
|
321
|
-
risks.push('Múltiplos endpoints podem ter impacto em performance');
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (architecture.dependencies.length > 0) {
|
|
325
|
-
risks.push('Novas dependências aumentam bundle size');
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return risks;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Lista dependências necessárias
|
|
333
|
-
*/
|
|
334
|
-
private listDependencies(architecture: any): string[] {
|
|
335
|
-
return architecture.dependencies || [];
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Exibe plano formatado
|
|
340
|
-
*/
|
|
341
|
-
private displayPlan(plan: ImplementationPlan): void {
|
|
342
|
-
console.log(`📋 TÃtulo: ${plan.title}`);
|
|
343
|
-
console.log(`📠Descrição: ${plan.description}`);
|
|
344
|
-
console.log(`â±ï¸ Tempo estimado: ${plan.estimatedTime}`);
|
|
345
|
-
console.log(`🎯 Complexidade: ${plan.complexity.toUpperCase()}\n`);
|
|
346
|
-
|
|
347
|
-
console.log('ðŸ—ï¸ Arquitetura:');
|
|
348
|
-
if (plan.architecture.components.length > 0) {
|
|
349
|
-
console.log(` Componentes: ${plan.architecture.components.join(', ')}`);
|
|
350
|
-
}
|
|
351
|
-
if (plan.architecture.apis.length > 0) {
|
|
352
|
-
console.log(` APIs: ${plan.architecture.apis.join(', ')}`);
|
|
353
|
-
}
|
|
354
|
-
if (plan.architecture.database.length > 0) {
|
|
355
|
-
console.log(` Banco: ${plan.architecture.database.join(', ')}`);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
console.log(`\n📠Arquivos (${plan.files.create.length} criar, ${plan.files.modify.length} modificar):`);
|
|
359
|
-
plan.files.create.slice(0, 5).forEach(f => console.log(` ✨ ${f.path}`));
|
|
360
|
-
if (plan.files.create.length > 5) {
|
|
361
|
-
console.log(` ... e mais ${plan.files.create.length - 5} arquivo(s)`);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (plan.risks.length > 0) {
|
|
365
|
-
console.log(`\nâš ï¸ Riscos:`);
|
|
366
|
-
plan.risks.forEach(r => console.log(` - ${r}`));
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
console.log('');
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
async executeTask(taskDescription: string, context: TaskContext): Promise<TaskResult> {
|
|
373
|
-
try {
|
|
374
|
-
const plan = await this.createImplementationPlan(taskDescription);
|
|
375
|
-
|
|
376
|
-
return {
|
|
377
|
-
success: true,
|
|
378
|
-
details: `Plano criado: ${plan.files.create.length} arquivos a criar`,
|
|
379
|
-
recommendations: plan.steps
|
|
380
|
-
};
|
|
381
|
-
} catch (error) {
|
|
382
|
-
return {
|
|
383
|
-
success: false,
|
|
384
|
-
details: `Erro ao criar plano: ${(error as Error).message}`
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Planning Agent - Especialidade
|
|
2
|
-
|
|
3
|
-
## Responsabilidades
|
|
4
|
-
- Definir responsabilidades especÃficas
|
|
5
|
-
|
|
6
|
-
## Expertise
|
|
7
|
-
- Definir áreas de expertise
|
|
8
|
-
|
|
9
|
-
## Regras
|
|
10
|
-
- Arquivos < 500 linhas
|
|
11
|
-
- Não alucinar APIs
|
|
12
|
-
|
|
13
|
-
## Tarefas TÃpicas
|
|
14
|
-
- Listar tarefas tÃpicas
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Project Discovery Agent
|
|
2
|
-
|
|
3
|
-
## 🎯 Responsabilidade
|
|
4
|
-
|
|
5
|
-
Analisar estrutura de projetos existentes, descobrir padrões, mapear dependências e entender arquitetura.
|
|
6
|
-
|
|
7
|
-
## 🛠️ Skills Disponíveis
|
|
8
|
-
|
|
9
|
-
*Skills de discovery serão mapeadas quando adicionadas*
|
|
10
|
-
|
|
11
|
-
## 📋 Tarefas Típicas
|
|
12
|
-
|
|
13
|
-
- ✅ Mapear estrutura do projeto
|
|
14
|
-
- ✅ Descobrir dependências
|
|
15
|
-
- ✅ Identificar padrões usados
|
|
16
|
-
- ✅ Analisar configurações
|
|
17
|
-
- ✅ Listar componentes principais
|
|
18
|
-
- ✅ Criar overview do projeto
|
|
19
|
-
|
|
20
|
-
## 🔗 Dependências
|
|
21
|
-
|
|
22
|
-
- `BaseAgent`
|
|
23
|
-
- `MemorySystem`
|
|
24
|
-
- `SkillManager`
|
|
25
|
-
|
|
26
|
-
## 🔄 Fluxo de Trabalho
|
|
27
|
-
|
|
28
|
-
1. **Consulta memória**: Busca análises similares
|
|
29
|
-
2. **Carrega skills**: discovery patterns
|
|
30
|
-
3. **Executa discovery**: Mapeia projeto
|
|
31
|
-
4. **Registra resultado**: Salva mapa em memory.md
|
|
32
|
-
|
|
33
|
-
## 📊 Memória
|
|
34
|
-
|
|
35
|
-
Ver [memory.md](./memory.md) para histórico de projetos analisados.
|