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,299 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { execSync } from 'child_process';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checkpoint Manager - Gerencia checkpoints e rollback
|
|
7
|
-
*
|
|
8
|
-
* Responsabilidades:
|
|
9
|
-
* - Criar checkpoints do estado atual
|
|
10
|
-
* - Restaurar estado anterior (rollback)
|
|
11
|
-
* - Gerenciar histórico de checkpoints
|
|
12
|
-
* - Limpar checkpoints antigos
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export interface Checkpoint {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
files: Map<string, string>; // path -> content
|
|
20
|
-
gitStash?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class CheckpointManager {
|
|
24
|
-
private checkpoints: Map<string, Checkpoint>;
|
|
25
|
-
private checkpointDir: string;
|
|
26
|
-
private useGit: boolean;
|
|
27
|
-
|
|
28
|
-
constructor(projectRoot: string = process.cwd()) {
|
|
29
|
-
this.checkpoints = new Map();
|
|
30
|
-
|
|
31
|
-
// Use package-relative path instead of project root
|
|
32
|
-
const packageRoot = path.join(__dirname, '..', '..');
|
|
33
|
-
this.checkpointDir = path.join(packageRoot, '.system', 'checkpoints');
|
|
34
|
-
this.useGit = this.isGitRepository(projectRoot);
|
|
35
|
-
|
|
36
|
-
// Criar diretório de checkpoints se não existir
|
|
37
|
-
if (!fs.existsSync(this.checkpointDir)) {
|
|
38
|
-
fs.mkdirSync(this.checkpointDir, { recursive: true });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Verifica se é um repositório Git
|
|
44
|
-
*/
|
|
45
|
-
private isGitRepository(projectRoot: string): boolean {
|
|
46
|
-
try {
|
|
47
|
-
execSync('git rev-parse --git-dir', {
|
|
48
|
-
cwd: projectRoot,
|
|
49
|
-
stdio: 'ignore'
|
|
50
|
-
});
|
|
51
|
-
return true;
|
|
52
|
-
} catch {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Cria um checkpoint do estado atual
|
|
59
|
-
*/
|
|
60
|
-
async createCheckpoint(name: string, filesToTrack?: string[]): Promise<string> {
|
|
61
|
-
const checkpointId = this.generateCheckpointId();
|
|
62
|
-
|
|
63
|
-
console.log(`\n💾 Criando checkpoint: ${name}...`);
|
|
64
|
-
|
|
65
|
-
const checkpoint: Checkpoint = {
|
|
66
|
-
id: checkpointId,
|
|
67
|
-
name,
|
|
68
|
-
timestamp: Date.now(),
|
|
69
|
-
files: new Map()
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
if (this.useGit) {
|
|
73
|
-
// Usar Git stash se disponível
|
|
74
|
-
try {
|
|
75
|
-
const stashName = `wegho-checkpoint-${checkpointId}`;
|
|
76
|
-
execSync(`git stash push -u -m "${stashName}"`, { stdio: 'ignore' });
|
|
77
|
-
checkpoint.gitStash = stashName;
|
|
78
|
-
console.log(' ✅ Checkpoint criado via Git stash');
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.warn(' ⚠️ Git stash falhou, usando backup manual');
|
|
81
|
-
this.useGit = false; // Fallback para backup manual
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (!this.useGit) {
|
|
86
|
-
// Backup manual de arquivos
|
|
87
|
-
const files = filesToTrack || this.getAllProjectFiles();
|
|
88
|
-
|
|
89
|
-
for (const file of files) {
|
|
90
|
-
try {
|
|
91
|
-
if (fs.existsSync(file)) {
|
|
92
|
-
const content = fs.readFileSync(file, 'utf-8');
|
|
93
|
-
checkpoint.files.set(file, content);
|
|
94
|
-
}
|
|
95
|
-
} catch (error) {
|
|
96
|
-
console.warn(` ⚠️ Não foi possível fazer backup de ${file}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Salvar checkpoint em disco
|
|
101
|
-
this.saveCheckpointToDisk(checkpoint);
|
|
102
|
-
console.log(` ✅ Checkpoint criado: ${checkpoint.files.size} arquivo(s) salvos`);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
this.checkpoints.set(checkpointId, checkpoint);
|
|
106
|
-
|
|
107
|
-
return checkpointId;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Restaura um checkpoint (rollback)
|
|
112
|
-
*/
|
|
113
|
-
async rollback(checkpointId: string): Promise<void> {
|
|
114
|
-
const checkpoint = this.checkpoints.get(checkpointId);
|
|
115
|
-
|
|
116
|
-
if (!checkpoint) {
|
|
117
|
-
throw new Error(`Checkpoint ${checkpointId} não encontrado`);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
console.log(`\n🔄 Fazendo rollback para: ${checkpoint.name}...`);
|
|
121
|
-
|
|
122
|
-
if (checkpoint.gitStash) {
|
|
123
|
-
// Restaurar via Git stash
|
|
124
|
-
try {
|
|
125
|
-
// Encontrar o stash
|
|
126
|
-
const stashList = execSync('git stash list', { encoding: 'utf-8' });
|
|
127
|
-
const stashIndex = stashList
|
|
128
|
-
.split('\n')
|
|
129
|
-
.findIndex(line => line.includes(checkpoint.gitStash!));
|
|
130
|
-
|
|
131
|
-
if (stashIndex >= 0) {
|
|
132
|
-
execSync(`git stash pop stash@{${stashIndex}}`, { stdio: 'inherit' });
|
|
133
|
-
console.log(' ✅ Rollback via Git stash concluído');
|
|
134
|
-
} else {
|
|
135
|
-
throw new Error('Stash não encontrado');
|
|
136
|
-
}
|
|
137
|
-
} catch (error) {
|
|
138
|
-
console.error(' ❌ Erro no rollback via Git:', (error as Error).message);
|
|
139
|
-
throw error;
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
// Restaurar via backup manual
|
|
143
|
-
let restored = 0;
|
|
144
|
-
|
|
145
|
-
for (const [filePath, content] of checkpoint.files) {
|
|
146
|
-
try {
|
|
147
|
-
const dir = path.dirname(filePath);
|
|
148
|
-
if (!fs.existsSync(dir)) {
|
|
149
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
150
|
-
}
|
|
151
|
-
fs.writeFileSync(filePath, content, 'utf-8');
|
|
152
|
-
restored++;
|
|
153
|
-
} catch (error) {
|
|
154
|
-
console.warn(` ⚠️ Não foi possível restaurar ${filePath}`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
console.log(` ✅ Rollback concluído: ${restored} arquivo(s) restaurados`);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Remover checkpoint após uso
|
|
162
|
-
this.deleteCheckpoint(checkpointId);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Deleta um checkpoint
|
|
167
|
-
*/
|
|
168
|
-
deleteCheckpoint(checkpointId: string): void {
|
|
169
|
-
const checkpoint = this.checkpoints.get(checkpointId);
|
|
170
|
-
|
|
171
|
-
if (checkpoint) {
|
|
172
|
-
// Remover arquivo de disco
|
|
173
|
-
const checkpointFile = path.join(this.checkpointDir, `${checkpointId}.json`);
|
|
174
|
-
if (fs.existsSync(checkpointFile)) {
|
|
175
|
-
fs.unlinkSync(checkpointFile);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
this.checkpoints.delete(checkpointId);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Lista todos os checkpoints
|
|
184
|
-
*/
|
|
185
|
-
listCheckpoints(): Checkpoint[] {
|
|
186
|
-
return Array.from(this.checkpoints.values())
|
|
187
|
-
.sort((a, b) => b.timestamp - a.timestamp);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Limpa checkpoints antigos (mais de 24h)
|
|
192
|
-
*/
|
|
193
|
-
cleanOldCheckpoints(): void {
|
|
194
|
-
const oneDayAgo = Date.now() - (24 * 60 * 60 * 1000);
|
|
195
|
-
|
|
196
|
-
for (const [id, checkpoint] of this.checkpoints) {
|
|
197
|
-
if (checkpoint.timestamp < oneDayAgo) {
|
|
198
|
-
this.deleteCheckpoint(id);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Gera ID único para checkpoint
|
|
205
|
-
*/
|
|
206
|
-
private generateCheckpointId(): string {
|
|
207
|
-
return `cp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Obtém todos os arquivos do projeto
|
|
212
|
-
*/
|
|
213
|
-
private getAllProjectFiles(): string[] {
|
|
214
|
-
const files: string[] = [];
|
|
215
|
-
const projectRoot = process.cwd();
|
|
216
|
-
|
|
217
|
-
const scanDir = (dir: string) => {
|
|
218
|
-
try {
|
|
219
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
220
|
-
|
|
221
|
-
for (const entry of entries) {
|
|
222
|
-
const fullPath = path.join(dir, entry.name);
|
|
223
|
-
|
|
224
|
-
// Ignorar node_modules, .next, etc
|
|
225
|
-
if (this.shouldIgnore(entry.name)) continue;
|
|
226
|
-
|
|
227
|
-
if (entry.isDirectory()) {
|
|
228
|
-
scanDir(fullPath);
|
|
229
|
-
} else if (entry.isFile()) {
|
|
230
|
-
files.push(fullPath);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
} catch (error) {
|
|
234
|
-
// Ignora erros de permissão
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
scanDir(projectRoot);
|
|
239
|
-
return files;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Verifica se deve ignorar arquivo/pasta
|
|
244
|
-
*/
|
|
245
|
-
private shouldIgnore(name: string): boolean {
|
|
246
|
-
const ignoreList = [
|
|
247
|
-
'node_modules',
|
|
248
|
-
'.next',
|
|
249
|
-
'.git',
|
|
250
|
-
'dist',
|
|
251
|
-
'build',
|
|
252
|
-
'.agents',
|
|
253
|
-
'coverage',
|
|
254
|
-
'.cache'
|
|
255
|
-
];
|
|
256
|
-
|
|
257
|
-
return ignoreList.includes(name);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Salva checkpoint em disco
|
|
262
|
-
*/
|
|
263
|
-
private saveCheckpointToDisk(checkpoint: Checkpoint): void {
|
|
264
|
-
const checkpointFile = path.join(this.checkpointDir, `${checkpoint.id}.json`);
|
|
265
|
-
|
|
266
|
-
const data = {
|
|
267
|
-
id: checkpoint.id,
|
|
268
|
-
name: checkpoint.name,
|
|
269
|
-
timestamp: checkpoint.timestamp,
|
|
270
|
-
files: Array.from(checkpoint.files.entries())
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
fs.writeFileSync(checkpointFile, JSON.stringify(data, null, 2), 'utf-8');
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Carrega checkpoint do disco
|
|
278
|
-
*/
|
|
279
|
-
private loadCheckpointFromDisk(checkpointId: string): Checkpoint | null {
|
|
280
|
-
const checkpointFile = path.join(this.checkpointDir, `${checkpointId}.json`);
|
|
281
|
-
|
|
282
|
-
if (!fs.existsSync(checkpointFile)) {
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
try {
|
|
287
|
-
const data = JSON.parse(fs.readFileSync(checkpointFile, 'utf-8'));
|
|
288
|
-
|
|
289
|
-
return {
|
|
290
|
-
id: data.id,
|
|
291
|
-
name: data.name,
|
|
292
|
-
timestamp: data.timestamp,
|
|
293
|
-
files: new Map(data.files)
|
|
294
|
-
};
|
|
295
|
-
} catch (error) {
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Script PowerShell para migrar agentes
|
|
2
|
-
# Cria estrutura: .agents/agents/[nome]/
|
|
3
|
-
|
|
4
|
-
$agents = @(
|
|
5
|
-
@{ Name="ai-agents"; Source=".agents\core\ai-agents-agent.ts"; Display="AI Agents Agent" },
|
|
6
|
-
@{ Name="architecture"; Source=".agents\core\architecture-agent.ts"; Display="Architecture Agent" },
|
|
7
|
-
@{ Name="automation"; Source=".agents\core\automation-agent.ts"; Display="Automation Agent" },
|
|
8
|
-
@{ Name="backend"; Source=".agents\core\backend-agent.ts"; Display="Backend Agent" },
|
|
9
|
-
@{ Name="cloud"; Source=".agents\core\cloud-agent.ts"; Display="Cloud Agent" },
|
|
10
|
-
@{ Name="cro"; Source=".agents\core\cro-agent.ts"; Display="CRO Agent" },
|
|
11
|
-
@{ Name="database"; Source=".agents\core\database-agent.ts"; Display="Database Agent" },
|
|
12
|
-
@{ Name="devops"; Source=".agents\core\devops-agent.ts"; Display="DevOps Agent" },
|
|
13
|
-
@{ Name="documentation"; Source=".agents\core\documentation-agent.ts"; Display="Documentation Agent" },
|
|
14
|
-
@{ Name="frontend"; Source=".agents\core\frontend-agent.ts"; Display="Front-End Agent" },
|
|
15
|
-
@{ Name="inventory"; Source=".agents\core\inventory-agent.ts"; Display="Inventory Agent" },
|
|
16
|
-
@{ Name="nextjs"; Source=".agents\core\nextjs-agent.ts"; Display="Next.js Agent" },
|
|
17
|
-
@{ Name="pentest"; Source=".agents\core\pentest-agent.ts"; Display="Pentest Agent" },
|
|
18
|
-
@{ Name="planning"; Source=".agents\core\planning-agent.ts"; Display="Planning Agent" },
|
|
19
|
-
@{ Name="quality"; Source=".agents\core\quality-agent.ts"; Display="Quality Agent" },
|
|
20
|
-
@{ Name="rag"; Source=".agents\core\rag-agent.ts"; Display="RAG Agent" },
|
|
21
|
-
@{ Name="security"; Source=".agents\core\security-agent.ts"; Display="Security Agent" },
|
|
22
|
-
@{ Name="testing"; Source=".agents\core\testing-agent.ts"; Display="Testing Agent" },
|
|
23
|
-
@{ Name="uiux"; Source=".agents\core\uiux-agent.ts"; Display="UI/UX Agent" },
|
|
24
|
-
@{ Name="code-auditor"; Source=".agents\code-auditor-agent.ts"; Display="Code Auditor Agent" },
|
|
25
|
-
@{ Name="project-discovery"; Source=".agents\project-discovery-agent.ts"; Display="Project Discovery Agent" },
|
|
26
|
-
@{ Name="task-analyzer"; Source=".agents\task-analyzer-agent.ts"; Display="Task Analyzer Agent" }
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
Write-Host "`n🚀 Migrando $($agents.Count) agents...`n" -ForegroundColor Cyan
|
|
30
|
-
|
|
31
|
-
foreach ($agent in $agents) {
|
|
32
|
-
$agentDir = ".agents\agents\$($agent.Name)"
|
|
33
|
-
|
|
34
|
-
# Criar pasta
|
|
35
|
-
New-Item -ItemType Directory -Force -Path $agentDir | Out-Null
|
|
36
|
-
|
|
37
|
-
# Copiar arquivo do agente
|
|
38
|
-
if (Test-Path $agent.Source) {
|
|
39
|
-
$content = Get-Content $agent.Source -Raw
|
|
40
|
-
|
|
41
|
-
# Atualizar imports
|
|
42
|
-
$content = $content -replace "from\s+'\.\/base-agent\.js'", "from '../../base/base-agent.js'"
|
|
43
|
-
$content = $content -replace "from\s+'\.\/memory-system\.js'", "from '../../base/memory-system.js'"
|
|
44
|
-
$content = $content -replace "from\s+'\.\/skill-manager\.js'", "from '../../base/skill-manager.js'"
|
|
45
|
-
$content = $content -replace "from\s+'\.\.\/config\.js'", "from '../../config.js'"
|
|
46
|
-
|
|
47
|
-
$content | Set-Content "$agentDir\agent.ts" -Encoding UTF8
|
|
48
|
-
Write-Host "✅ $($agent.Name)/agent.ts" -ForegroundColor Green
|
|
49
|
-
} else {
|
|
50
|
-
Write-Host "⚠️ Arquivo não encontrado: $($agent.Source)" -ForegroundColor Yellow
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
# Copiar specialty.md se existir
|
|
54
|
-
$oldSpecialty = ".agents\memory\$($agent.Name)-agent\specialty.md"
|
|
55
|
-
if (Test-Path $oldSpecialty) {
|
|
56
|
-
Copy-Item $oldSpecialty "$agentDir\specialty.md"
|
|
57
|
-
Write-Host "✅ $($agent.Name)/specialty.md (copiado)" -ForegroundColor Green
|
|
58
|
-
} else {
|
|
59
|
-
# Criar specialty padrão
|
|
60
|
-
$defaultSpecialty = @"
|
|
61
|
-
# $($agent.Display) - Especialidade
|
|
62
|
-
|
|
63
|
-
## Responsabilidades
|
|
64
|
-
- Definir responsabilidades específicas
|
|
65
|
-
|
|
66
|
-
## Expertise
|
|
67
|
-
- Definir áreas de expertise
|
|
68
|
-
|
|
69
|
-
## Regras
|
|
70
|
-
- Arquivos < 500 linhas
|
|
71
|
-
- Não alucinar APIs
|
|
72
|
-
|
|
73
|
-
## Tarefas Típicas
|
|
74
|
-
- Listar tarefas típicas
|
|
75
|
-
"@
|
|
76
|
-
$defaultSpecialty | Set-Content "$agentDir\specialty.md" -Encoding UTF8
|
|
77
|
-
Write-Host "✅ $($agent.Name)/specialty.md (padrão)" -ForegroundColor Gray
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
# Criar README.md
|
|
81
|
-
$readme = @"
|
|
82
|
-
# $($agent.Display)
|
|
83
|
-
|
|
84
|
-
## 🎯 Responsabilidade
|
|
85
|
-
|
|
86
|
-
Agente especializado em tarefas específicas do sistema.
|
|
87
|
-
|
|
88
|
-
## 🛠️ Skills
|
|
89
|
-
|
|
90
|
-
### Skill 1: Validação
|
|
91
|
-
**Propósito**: Analisar e validar código
|
|
92
|
-
**Quando usar**: Durante revisão de código
|
|
93
|
-
|
|
94
|
-
### Skill 2: Aprendizado
|
|
95
|
-
**Propósito**: Aprender com histórico
|
|
96
|
-
**Quando usar**: A cada tarefa executada
|
|
97
|
-
|
|
98
|
-
## 📋 Tarefas Típicas
|
|
99
|
-
|
|
100
|
-
- Validar implementações
|
|
101
|
-
- Gerar recomendações
|
|
102
|
-
- Aplicar best practices
|
|
103
|
-
|
|
104
|
-
## 🔗 Dependências
|
|
105
|
-
|
|
106
|
-
- ``BaseAgent``
|
|
107
|
-
- ``MemorySystem``
|
|
108
|
-
|
|
109
|
-
## 📊 Memória
|
|
110
|
-
|
|
111
|
-
Ver ``memory.md`` para histórico completo.
|
|
112
|
-
"@
|
|
113
|
-
$readme | Set-Content "$agentDir\README.md" -Encoding UTF8
|
|
114
|
-
Write-Host "✅ $($agent.Name)/README.md`n" -ForegroundColor Green
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
Write-Host "`n✅ Migração concluída! $($agents.Count) agents processados.`n" -ForegroundColor Cyan
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# 📝 RELATÓRIO DE MUDANÇAS
|
|
2
|
-
|
|
3
|
-
## 🤖 Agente Responsável
|
|
4
|
-
**[Nome do Agente]**
|
|
5
|
-
|
|
6
|
-
## 📊 Contexto
|
|
7
|
-
- **Nível de contexto**: [Nível] ([Percentual]%)
|
|
8
|
-
- **Status**: [Se está perto do limite, avisar usuário]
|
|
9
|
-
|
|
10
|
-
## ✅ O Que Foi Feito
|
|
11
|
-
- [Ação específica 1]
|
|
12
|
-
- [Ação específica 2]
|
|
13
|
-
- [Ação específica 3]
|
|
14
|
-
- [Arquivos criados/modificados]
|
|
15
|
-
|
|
16
|
-
## 🎯 Por Que Foi Feito
|
|
17
|
-
[Explicação clara da motivação e necessidade das mudanças]
|
|
18
|
-
|
|
19
|
-
- [Razão 1]
|
|
20
|
-
- [Razão 2]
|
|
21
|
-
- [Decisão de arquitetura relevante]
|
|
22
|
-
|
|
23
|
-
## 📊 Antes vs Depois
|
|
24
|
-
|
|
25
|
-
### ANTES
|
|
26
|
-
```[linguagem]
|
|
27
|
-
[Código ou estrutura ANTES da mudança]
|
|
28
|
-
// Ou: "Não existia" se foi criado do zero
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### DEPOIS
|
|
32
|
-
```[linguagem]
|
|
33
|
-
[Código ou estrutura DEPOIS da mudança]
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 🔍 Diferenças Importantes
|
|
37
|
-
- ➕ **Adicionado**: [Funcionalidade nova 1]
|
|
38
|
-
- ➕ **Adicionado**: [Funcionalidade nova 2]
|
|
39
|
-
- ✏️ **Modificado**: [O que mudou]
|
|
40
|
-
- ➖ **Removido**: [O que foi removido, se aplicável]
|
|
41
|
-
|
|
42
|
-
## 💾 Memórias Salvas
|
|
43
|
-
|
|
44
|
-
### ✅ [Nome do Agente] (Boa)
|
|
45
|
-
- [Padrão ou aprendizado positivo 1]
|
|
46
|
-
- [Padrão ou aprendizado positivo 2]
|
|
47
|
-
|
|
48
|
-
### ❌ [Nome do Agente] (Atenção)
|
|
49
|
-
- [Erro quase cometido ou ponto de atenção]
|
|
50
|
-
- [Lição aprendida]
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
**Status**: ✅ Mudanças concluídas e documentadas
|
|
55
|
-
**Próximos Passos**: [Se houver follow-up necessário]
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# 📋 PLANO DE EXECUÇÃO
|
|
2
|
-
|
|
3
|
-
## ⚙️ O Que Será Feito
|
|
4
|
-
- [ ] [Descrever primeira tarefa específica]
|
|
5
|
-
- [ ] [Descrever segunda tarefa específica]
|
|
6
|
-
- [ ] [Descrever terceira tarefa específica]
|
|
7
|
-
- [ ] [Adicionar mais conforme necessário]
|
|
8
|
-
|
|
9
|
-
## 🤖 Agentes que Serão Usados
|
|
10
|
-
- [ ] **[Nome do Agente 1]** - [Responsabilidade específica]
|
|
11
|
-
- [ ] **[Nome do Agente 2]** - [Responsabilidade específica]
|
|
12
|
-
- [ ] **[Nome do Agente 3]** - [Responsabilidade específica]
|
|
13
|
-
|
|
14
|
-
## 📊 Estimativa de Contexto
|
|
15
|
-
**Contexto Atual**: [Nível] ([Percentual]%)
|
|
16
|
-
**Contexto Após Tarefa**: [Nível estimado] (~[Percentual estimado]%)
|
|
17
|
-
**Ação Recomendada**: [Continuar nesta conversa / Iniciar nova conversa após]
|
|
18
|
-
|
|
19
|
-
## 🎯 Critérios de Sucesso
|
|
20
|
-
- ✅ [Critério específico 1]
|
|
21
|
-
- ✅ [Critério específico 2]
|
|
22
|
-
- ✅ [Critério específico 3]
|
|
23
|
-
- ✅ [Testes passando]
|
|
24
|
-
- ✅ [Build OK]
|
|
25
|
-
|
|
26
|
-
## 🚨 Possíveis Bloqueadores
|
|
27
|
-
- ⚠️ [Possível problema 1]
|
|
28
|
-
- ⚠️ [Possível problema 2]
|
|
29
|
-
- ⚠️ [Dependência externa]
|
|
30
|
-
|
|
31
|
-
## 📝 Notas Adicionais
|
|
32
|
-
[Contexto adicional, decisões de arquitetura, ou observações importantes]
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
**Status**: ⏳ Aguardando aprovação para executar
|
|
Binary file
|