wegho-agentes 4.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.
Files changed (94) hide show
  1. package/.agents/AGENT_WORKFLOW.md +528 -0
  2. package/.agents/AI_COMPATIBILITY.md +332 -0
  3. package/.agents/CLI.md +222 -0
  4. package/.agents/README.md +130 -0
  5. package/.agents/cli.js +389 -0
  6. package/.agents/code-auditor-agent.ts +333 -0
  7. package/.agents/config.ts +145 -0
  8. package/.agents/context-loader.ts +300 -0
  9. package/.agents/core/agent-parallelizer.test.ts +94 -0
  10. package/.agents/core/agent-parallelizer.ts +108 -0
  11. package/.agents/core/architecture-agent.ts +237 -0
  12. package/.agents/core/base-agent.ts +311 -0
  13. package/.agents/core/cache-manager.test.ts +147 -0
  14. package/.agents/core/cache-manager.ts +184 -0
  15. package/.agents/core/documentation-agent.ts +183 -0
  16. package/.agents/core/feedback-collector.ts +207 -0
  17. package/.agents/core/frontend-agent.ts +210 -0
  18. package/.agents/core/inventory-agent.ts +582 -0
  19. package/.agents/core/memory-system.ts +397 -0
  20. package/.agents/core/quality-agent.ts +268 -0
  21. package/.agents/core/retry-utility.test.ts +165 -0
  22. package/.agents/core/retry-utility.ts +140 -0
  23. package/.agents/core/security-agent.ts +217 -0
  24. package/.agents/core/workflow-validator.test.ts +171 -0
  25. package/.agents/core/workflow-validator.ts +158 -0
  26. package/.agents/domains/README.md +53 -0
  27. package/.agents/domains/logistics/route-agent.ts +177 -0
  28. package/.agents/domains/news/cms-agent.ts +158 -0
  29. package/.agents/domains/news/seo-agent.ts +170 -0
  30. package/.agents/domains/production/production-control-agent.ts +169 -0
  31. package/.agents/example-learning-system.js +118 -0
  32. package/.agents/init.ts +164 -0
  33. package/.agents/memory/architecture-agent/failures.json +1 -0
  34. package/.agents/memory/architecture-agent/learnings.json +1 -0
  35. package/.agents/memory/architecture-agent/specialty.md +31 -0
  36. package/.agents/memory/architecture-agent/successes.json +16 -0
  37. package/.agents/memory/cms-agent/failures.json +1 -0
  38. package/.agents/memory/cms-agent/learnings.json +1 -0
  39. package/.agents/memory/cms-agent/specialty.md +30 -0
  40. package/.agents/memory/cms-agent/successes.json +16 -0
  41. package/.agents/memory/documentation-agent/failures.json +1 -0
  42. package/.agents/memory/documentation-agent/learnings.json +1 -0
  43. package/.agents/memory/documentation-agent/specialty.md +33 -0
  44. package/.agents/memory/documentation-agent/successes.json +16 -0
  45. package/.agents/memory/frontend-agent/failures.json +1 -0
  46. package/.agents/memory/frontend-agent/learnings.json +1 -0
  47. package/.agents/memory/frontend-agent/specialty.md +30 -0
  48. package/.agents/memory/frontend-agent/successes.json +16 -0
  49. package/.agents/memory/inventory-agent/failures.json +1 -0
  50. package/.agents/memory/inventory-agent/inventory/index.json +8 -0
  51. package/.agents/memory/inventory-agent/inventory/types.json +77716 -0
  52. package/.agents/memory/inventory-agent/inventory/variables.json +405 -0
  53. package/.agents/memory/inventory-agent/learnings.json +1 -0
  54. package/.agents/memory/inventory-agent/specialty.md +129 -0
  55. package/.agents/memory/inventory-agent/successes.json +30 -0
  56. package/.agents/memory/production-control-agent/failures.json +1 -0
  57. package/.agents/memory/production-control-agent/learnings.json +1 -0
  58. package/.agents/memory/production-control-agent/specialty.md +29 -0
  59. package/.agents/memory/production-control-agent/successes.json +16 -0
  60. package/.agents/memory/quality-agent/failures.json +16 -0
  61. package/.agents/memory/quality-agent/learnings.json +1 -0
  62. package/.agents/memory/quality-agent/specialty.md +31 -0
  63. package/.agents/memory/quality-agent/successes.json +1 -0
  64. package/.agents/memory/reference-repositories.json +271 -0
  65. package/.agents/memory/route-agent/failures.json +1 -0
  66. package/.agents/memory/route-agent/learnings.json +1 -0
  67. package/.agents/memory/route-agent/specialty.md +29 -0
  68. package/.agents/memory/route-agent/successes.json +16 -0
  69. package/.agents/memory/security-agent/failures.json +1 -0
  70. package/.agents/memory/security-agent/learnings.json +1 -0
  71. package/.agents/memory/security-agent/specialty.md +31 -0
  72. package/.agents/memory/security-agent/successes.json +16 -0
  73. package/.agents/memory/seo-agent/failures.json +1 -0
  74. package/.agents/memory/seo-agent/learnings.json +1 -0
  75. package/.agents/memory/seo-agent/specialty.md +31 -0
  76. package/.agents/memory/seo-agent/successes.json +16 -0
  77. package/.agents/orchestrator.ts +438 -0
  78. package/.agents/project-discovery-agent.ts +342 -0
  79. package/.agents/security/pentesting-agent.py +387 -0
  80. package/.agents/security/python-bridge.ts +193 -0
  81. package/.agents/security/vulnerability-db.json +201 -0
  82. package/.agents/task-analyzer-agent.ts +346 -0
  83. package/.agents/test-init-context.js +67 -0
  84. package/INSTALL.md +300 -0
  85. package/LICENSE +21 -0
  86. package/README.md +315 -0
  87. package/docs/AGENT_RULES.md +292 -0
  88. package/docs/BUILD_HISTORY.md +65 -0
  89. package/docs/DESIGN_SYSTEM.md +256 -0
  90. package/docs/LEARNING_SYSTEM.md +326 -0
  91. package/docs/SYMBOLS_TREE.md +182 -0
  92. package/docs/VERSION.md +6 -0
  93. package/docs/architecture.md +111 -0
  94. package/package.json +60 -0
package/INSTALL.md ADDED
@@ -0,0 +1,300 @@
1
+ # 🚀 Instalação do Sistema de Agentes Inteligentes
2
+
3
+ ## 📋 Pré-requisitos
4
+
5
+ - Node.js >= 18.0.0
6
+ - npm ou yarn
7
+ - TypeScript >= 5.0.0
8
+
9
+ ---
10
+
11
+ ## 🔧 Instalação
12
+
13
+ ### **1. Clone o Repositório**
14
+
15
+ ```bash
16
+ git clone https://github.com/cordeirinhocaleb-stack/wegho-agentes.git
17
+ cd wegho-agentes
18
+ ```
19
+
20
+ ### **2. Instale as Dependências**
21
+
22
+ ```bash
23
+ npm install
24
+ ```
25
+
26
+ ### **3. Execute a Inicialização (IMPORTANTE!)**
27
+
28
+ ```bash
29
+ npm run init
30
+ ```
31
+
32
+ Este comando irá:
33
+
34
+ 1. ✅ Pedir sua permissão para escanear o projeto
35
+ 2. ✅ Inicializar o orquestrador
36
+ 3. ✅ Criar memória inicial para **TODOS os 10 agentes**:
37
+ - 🎨 Frontend Agent
38
+ - 🔒 Security Agent
39
+ - 🏗️ Architecture Agent
40
+ - ✅ Quality Agent
41
+ - 📚 Documentation Agent
42
+ - 🏭 **Inventory Agent** (Almoxarifado)
43
+ - 📰 CMS Agent
44
+ - 🔍 SEO Agent
45
+ - 🏭 Production Control Agent
46
+ - 🚚 Route Agent
47
+ 4. ✅ Escanear seu projeto completo
48
+ 5. ✅ Catalogar **TODOS** os recursos no almoxarifado (Inventory Agent)
49
+
50
+ ---
51
+
52
+ ## 🎯 O que Acontece na Inicialização
53
+
54
+ ### **Fluxo Completo:**
55
+
56
+ ```
57
+ ┌─────────────────────────────────────────────────────────┐
58
+ │ 1. Sistema pede permissão para escanear projeto │
59
+ └─────────────────────────────────────────────────────────┘
60
+
61
+ ┌─────────────────────────────────────────────────────────┐
62
+ │ 2. Orquestrador inicializa cada agente │
63
+ │ (em ordem de prioridade) │
64
+ └─────────────────────────────────────────────────────────┘
65
+
66
+ ┌─────────────────────────────────────────────────────────┐
67
+ │ 3. Cada agente cria sua memória inicial: │
68
+ │ - specialty.md (especialidade) │
69
+ │ - successes.json (sucessos) │
70
+ │ - failures.json (falhas) │
71
+ │ - learnings.json (aprendizados) │
72
+ └─────────────────────────────────────────────────────────┘
73
+
74
+ ┌─────────────────────────────────────────────────────────┐
75
+ │ 4. Inventory Agent escaneia TUDO: │
76
+ │ - Componentes (.tsx, .jsx) │
77
+ │ - Variáveis (exports) │
78
+ │ - Endpoints (API routes) │
79
+ │ - Tipos (TypeScript) │
80
+ │ - Banco de dados (schema) │
81
+ └─────────────────────────────────────────────────────────┘
82
+
83
+ ┌─────────────────────────────────────────────────────────┐
84
+ │ 5. Sistema pronto para uso! 🎉 │
85
+ └─────────────────────────────────────────────────────────┘
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 📂 Estrutura Criada
91
+
92
+ Após a inicialização, você terá:
93
+
94
+ ```
95
+ seu-projeto/
96
+ ├── .agents/
97
+ │ ├── memory/
98
+ │ │ ├── frontend-agent/
99
+ │ │ │ ├── specialty.md
100
+ │ │ │ ├── successes.json
101
+ │ │ │ ├── failures.json
102
+ │ │ │ └── learnings.json
103
+ │ │ │
104
+ │ │ ├── security-agent/
105
+ │ │ │ └── ... (mesma estrutura)
106
+ │ │ │
107
+ │ │ ├── inventory-agent/
108
+ │ │ │ ├── specialty.md
109
+ │ │ │ ├── successes.json
110
+ │ │ │ ├── failures.json
111
+ │ │ │ ├── learnings.json
112
+ │ │ │ └── inventory/ # 🏭 ALMOXARIFADO
113
+ │ │ │ ├── components.json # Todos os componentes
114
+ │ │ │ ├── variables.json # Todas as variáveis
115
+ │ │ │ ├── endpoints.json # Todos os endpoints
116
+ │ │ │ ├── tables.json # Todas as tabelas
117
+ │ │ │ ├── types.json # Todos os tipos
118
+ │ │ │ └── index.json # Índice geral
119
+ │ │ │
120
+ │ │ └── ... (outros 7 agentes)
121
+ │ │
122
+ │ └── ... (código dos agentes)
123
+ ```
124
+
125
+ ---
126
+
127
+ ## 🎬 Exemplo de Saída da Inicialização
128
+
129
+ ```bash
130
+ $ npm run init
131
+
132
+ ============================================================
133
+ 🤖 BEM-VINDO AO SISTEMA DE AGENTES INTELIGENTES
134
+ ============================================================
135
+
136
+ Este é o processo de inicialização do sistema.
137
+ O orquestrador irá preparar TODOS os agentes para trabalhar.
138
+
139
+ ❓ Posso escanear seu projeto e criar a memória inicial para todos os agentes? (s/n): s
140
+
141
+ ✅ Permissão concedida! Iniciando...
142
+
143
+ 📦 Inicializando agentes...
144
+
145
+ ============================================================
146
+ 🤖 Inicializando: Inventory Agent
147
+ ============================================================
148
+
149
+ 🔍 [inventory-agent] Escaneando projeto...
150
+ ✅ [inventory-agent] Scan completo: 247 itens catalogados
151
+
152
+ ✅ Inventory Agent inicializado com sucesso!
153
+ Inventário completo: 247 itens catalogados
154
+
155
+ ============================================================
156
+ 🤖 Inicializando: Frontend Agent
157
+ ============================================================
158
+
159
+ ✅ Frontend Agent inicializado com sucesso!
160
+
161
+ ============================================================
162
+ 🤖 Inicializando: Security Agent
163
+ ============================================================
164
+
165
+ ✅ Security Agent inicializado com sucesso!
166
+
167
+ ... (outros agentes)
168
+
169
+ ============================================================
170
+ 🏭 INVENTORY AGENT - Escaneando Projeto Completo
171
+ ============================================================
172
+
173
+ 🔍 [inventory-agent] Escaneando projeto...
174
+ ✅ [inventory-agent] Scan completo: 247 itens catalogados
175
+
176
+ ✅ Scan completo do projeto finalizado!
177
+ Inventário completo: 247 itens catalogados
178
+
179
+ 📊 Resumo do Inventário:
180
+ Total de 247 itens no almoxarifado
181
+
182
+ ============================================================
183
+ 🎉 INICIALIZAÇÃO COMPLETA!
184
+ ============================================================
185
+
186
+ ✅ Todos os agentes foram inicializados e estão prontos para trabalhar!
187
+ ✅ Memória inicial criada para cada agente
188
+ ✅ Inventário completo do projeto catalogado
189
+
190
+ 📚 Próximos passos:
191
+ 1. Execute tarefas usando: npm run task "sua tarefa"
192
+ 2. Consulte a documentação em: .agents/README.md
193
+ 3. Veja o inventário em: .agents/memory/inventory-agent/inventory/
194
+
195
+ 🤖 Sistema de Agentes Inteligentes pronto para uso!
196
+ ```
197
+
198
+ ---
199
+
200
+ ## ✅ Verificação
201
+
202
+ Para verificar se tudo foi instalado corretamente:
203
+
204
+ ```bash
205
+ # Verificar se memória foi criada
206
+ ls .agents/memory/
207
+
208
+ # Verificar inventário
209
+ ls .agents/memory/inventory-agent/inventory/
210
+
211
+ # Ver resumo do inventário
212
+ cat .agents/memory/inventory-agent/inventory/index.json
213
+ ```
214
+
215
+ ---
216
+
217
+ ## 🚀 Uso Após Instalação
218
+
219
+ ### **Executar uma Tarefa**
220
+
221
+ ```bash
222
+ npm run task "Criar componente de login"
223
+ ```
224
+
225
+ ### **Consultar Inventário**
226
+
227
+ ```bash
228
+ # Ver todos os componentes
229
+ cat .agents/memory/inventory-agent/inventory/components.json
230
+
231
+ # Ver todos os endpoints
232
+ cat .agents/memory/inventory-agent/inventory/endpoints.json
233
+ ```
234
+
235
+ ### **Verificar Memória de um Agente**
236
+
237
+ ```bash
238
+ # Ver sucessos do Frontend Agent
239
+ cat .agents/memory/frontend-agent/successes.json
240
+
241
+ # Ver aprendizados do Security Agent
242
+ cat .agents/memory/security-agent/learnings.json
243
+ ```
244
+
245
+ ---
246
+
247
+ ## 🔄 Reinicializar Sistema
248
+
249
+ Se precisar reinicializar (limpar memória e recomeçar):
250
+
251
+ ```bash
252
+ # Remover memória existente
253
+ rm -rf .agents/memory/
254
+
255
+ # Executar inicialização novamente
256
+ npm run init
257
+ ```
258
+
259
+ ---
260
+
261
+ ## 🆘 Problemas Comuns
262
+
263
+ ### **Erro: "Permission denied"**
264
+
265
+ ```bash
266
+ # Dar permissão de execução
267
+ chmod +x .agents/init.ts
268
+ ```
269
+
270
+ ### **Erro: "tsx not found"**
271
+
272
+ ```bash
273
+ # Instalar tsx globalmente
274
+ npm install -g tsx
275
+
276
+ # Ou usar npx
277
+ npx tsx .agents/init.ts
278
+ ```
279
+
280
+ ### **Erro: "Cannot find module 'glob'"**
281
+
282
+ ```bash
283
+ # Instalar dependências
284
+ npm install
285
+ ```
286
+
287
+ ---
288
+
289
+ ## 📚 Documentação Completa
290
+
291
+ - [README Principal](../README.md)
292
+ - [Guia de Agentes](.agents/README.md)
293
+ - [Sistema de Memória](docs/LEARNING_SYSTEM.md)
294
+ - [Inventory Agent](.agents/memory/inventory-agent/specialty.md)
295
+
296
+ ---
297
+
298
+ ## 🎉 Pronto!
299
+
300
+ Seu sistema de agentes está **100% configurado** e pronto para uso! 🚀
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WebGho Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,315 @@
1
+ # Sistema de Agentes WebGho v4.0.0
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-blue)](https://www.typescriptlang.org/)
6
+ [![NPM Version](https://img.shields.io/badge/npm-4.0.0-red)](https://www.npmjs.com/package/wegho-agentes)
7
+
8
+ Sistema de agentes especializados para garantir **qualidade**, **segurança** e **organização** em projetos **Next.js + Supabase**.
9
+
10
+ ---
11
+
12
+ ## 🎯 O Que São os Agentes?
13
+
14
+ **10 agentes autônomos** que trabalham em conjunto:
15
+
16
+ ### **Agentes Core (6)**
17
+ 1. 🏭 **Inventory Agent** - Almoxarifado central que cataloga TUDO e **impede duplicação**
18
+ 2. 🎨 **Front-End** - UI/UX, acessibilidade, performance
19
+ 3. 🔒 **Security** - Vulnerabilidades (XSS, CSRF), RLS, validações
20
+ 4. 📚 **Documentation** - Docs automáticas (builds, símbolos, changelog)
21
+ 5. 🏗️ **Architecture** - Organização, 500 linhas/arquivo, duplicação
22
+ 6. ✅ **Quality** - Lint, TypeCheck, Build, Audit (GO/NO-GO)
23
+
24
+ ### **Agentes de Domínio (4)**
25
+ 7. 📰 **CMS Agent** - Validação de conteúdo e estrutura
26
+ 8. 🔍 **SEO Agent** - Otimização para motores de busca
27
+ 9. 🏭 **Production Control** - Monitoramento de produção
28
+ 10. 🚚 **Route Agent** - Otimização de rotas logísticas
29
+
30
+ ### 🆕 **NOVIDADES v4.0.0**
31
+
32
+ #### 🏭 **Inventory Agent (Almoxarifado Central)**
33
+ - ✅ Cataloga **TODOS** os recursos do projeto (componentes, variáveis, endpoints, tipos, banco)
34
+ - ✅ **Impede duplicação** de código - agentes consultam antes de criar
35
+ - ✅ Busca inteligente (exata, fuzzy, textual)
36
+ - ✅ Organização centralizada de recursos
37
+
38
+ #### 🚀 **Sistema de Inicialização Automática**
39
+ - ✅ `npm run init` - Inicialização guiada
40
+ - ✅ Pede permissão para escanear projeto
41
+ - ✅ Cria memória inicial para **TODOS os 10 agentes**
42
+ - ✅ Organiza almoxarifado automaticamente
43
+
44
+ #### 🧠 **Sistema de Aprendizado Contínuo**
45
+ - ✨ **Memória Persistente**: Cada agente registra sucessos e falhas
46
+ - 🎯 **Seleção Inteligente**: Orquestrador escolhe melhores agentes baseado em histórico
47
+ - 📊 **Feedback Loop**: Aprende com suas preferências e evita repetir erros
48
+ - 🚀 **Melhoria Contínua**: Agentes ficam mais inteligentes a cada tarefa
49
+
50
+ #### 🤖 **Compatibilidade com Múltiplas IAs**
51
+ - ✅ Gemini 3 Pro / Flash
52
+ - ✅ Claude Sonnet 4.5 (incluindo modo Thinking)
53
+ - ✅ GPT-4o5
54
+ - ✅ Guia de compatibilidade completo
55
+
56
+ ---
57
+
58
+ ## 🚀 Instalação Rápida
59
+
60
+ ### **Via NPM (Recomendado)**
61
+
62
+ ```bash
63
+ # Instalar o pacote
64
+ npm install wegho-agentes
65
+
66
+ # Inicializar sistema (IMPORTANTE!)
67
+ npm run init
68
+ ```
69
+
70
+ O comando `npm run init` irá:
71
+ 1. ✅ Pedir permissão para escanear seu projeto
72
+ 2. ✅ Inicializar todos os 10 agentes
73
+ 3. ✅ Criar memória inicial para cada agente
74
+ 4. ✅ Catalogar todos os recursos no Inventory Agent
75
+
76
+ ### **Via Git Clone**
77
+
78
+ ```bash
79
+ # Clone o repositório
80
+ git clone https://github.com/cordeirinhocaleb-stack/wegho-agentes.git
81
+
82
+ # Copie para seu projeto
83
+ cp -r wegho-agentes/.agents seu-projeto/
84
+ cp -r wegho-agentes/docs seu-projeto/
85
+
86
+ # Inicialize
87
+ cd seu-projeto
88
+ npm run init
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 📋 Pré-requisitos
94
+
95
+ - ✅ Node.js >= 18.0.0
96
+ - ✅ TypeScript >= 5.0.0
97
+ - ✅ Projeto Next.js (recomendado App Router)
98
+ - ✅ Supabase (opcional, para Database Security Agent)
99
+
100
+ ---
101
+
102
+ ## 🛠 Uso Básico
103
+
104
+ ### 1. Iniciar Contexto
105
+
106
+ Antes de **qualquer implementação**, carregue o contexto do projeto:
107
+
108
+ ```bash
109
+ node .agents/test-init-context.js
110
+ ```
111
+
112
+ Isso carrega:
113
+ - ✅ `DESIGN_SYSTEM.md` - Sistema de design
114
+ - ✅ `SYMBOLS_TREE.md` - Estrutura do código
115
+ - ✅ `BUILD_HISTORY.md` - Histórico de mudanças
116
+ - ✅ `AGENT_RULES.md` - Regras consolidadas
117
+ - ✅ Domínio detectado (news/production/logistics/generic)
118
+
119
+ ### 2. Desenvolvimento com Agentes
120
+
121
+ Os agentes seguem o **Processo de 6 Passos Obrigatórios**:
122
+
123
+ ```
124
+ 1. Arquitetura → Valida estrutura
125
+ 2. Front-End → Valida UI/UX (se aplicável)
126
+ 3. Security FE → Detecta vulnerabilidades
127
+ 4. Tech Lead → Integra + limpa código
128
+ 5. Database Sec → Valida RLS/policies (se aplicável)
129
+ 6. Audit Final → GO/NO-GO (lint, build, tests)
130
+ ```
131
+
132
+ ### 3. Validação Automática
133
+
134
+ Exemplo de validação de componente:
135
+
136
+ ```typescript
137
+ import { FrontEndAgent } from './.agents/core/frontend-agent';
138
+
139
+ const agent = new FrontEndAgent();
140
+ const result = await agent.validateComponent('components/MyComponent.tsx');
141
+
142
+ if (!result.passed) {
143
+ console.error('❌ Issues:', result.issues);
144
+ // Bloqueia commit/deploy
145
+ }
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 📚 Estrutura do Sistema
151
+
152
+ ```
153
+ .agents/
154
+ ├── core/ # 5 Agentes Base
155
+ │ ├── frontend-agent.ts # UI/UX
156
+ │ ├── security-agent.ts # Segurança
157
+ │ ├── documentation-agent.ts # Docs
158
+ │ ├── architecture-agent.ts # Arquitetura
159
+ │ └── quality-agent.ts # Quality (Auditor)
160
+ ├── domains/ # Agentes Especializados
161
+ │ ├── news/ # CMS, SEO, Content, Analytics
162
+ │ ├── production/ # Control, Quality, Shipping, Inventory
163
+ │ └── logistics/ # Route, Fleet, Warehouse, Tracking
164
+ ├── config.ts # Configurações
165
+ ├── context-loader.ts # Sistema "iniciar contexto"
166
+ ├── orchestrator.ts # Coordenador dos 6 passos
167
+ └── README.md # Este arquivo
168
+
169
+ docs/
170
+ ├── DESIGN_SYSTEM.md # Sistema de design do projeto
171
+ ├── SYMBOLS_TREE.md # Árvore hierárquica de código
172
+ ├── BUILD_HISTORY.md # Histórico de builds
173
+ ├── AGENT_RULES.md # Regras consolidadas
174
+ └── builds/ # Builds detalhados (build-XXX.md)
175
+ ```
176
+
177
+ ---
178
+
179
+ ## 🚨 Regras Absolutas
180
+
181
+ 1. ❌ **Máximo 500 linhas** por arquivo (bloqueio automático)
182
+ 2. ❌ **Não alucinar** (APIs, tabelas, bibliotecas inexistentes)
183
+ 3. ✅ **Priorizar libs existentes** (justificar novas)
184
+ 4. ✅ **Fonte de verdade**: Código → Docs Oficiais → Padrões
185
+ 5. ✅ **Mudanças mínimas** (sem refactor por estética)
186
+ 6. ❌ **Sem gambiarra** (sem `@ts-ignore`, bypass de tipos)
187
+ 7. ✅ **Entregas obrigatórias** (arquivos + por quê + validação)
188
+ 8. ✅ **Tipagem forte** (evitar `any`, usar `unknown` + guards)
189
+
190
+ ---
191
+
192
+ ## 🔧 Configuração
193
+
194
+ Edite `.agents/config.ts`:
195
+
196
+ ```typescript
197
+ export const DEFAULT_CONFIG: AgentConfig = {
198
+ domain: 'generic', // ou 'news', 'production', 'logistics'
199
+ enabledAgents: ['frontend', 'security', 'documentation', 'architecture', 'quality'],
200
+ autoDocumentation: true,
201
+ buildTracking: true,
202
+ maxFileLines: 500,
203
+ };
204
+ ```
205
+
206
+ ---
207
+
208
+ ## 📊 Domínios Suportados
209
+
210
+ | Domínio | Descrição | Agentes Especializados |
211
+ |---------|-----------|------------------------|
212
+ | **Generic** | Projeto padrão | Apenas core (5) |
213
+ | **News** | Site de Notícias | CMS, SEO, Content, Analytics |
214
+ | **Production** | Produção/Expedição | Control, Quality, Shipping, Inventory |
215
+ | **Logistics** | Logística | Route, Fleet, Warehouse, Tracking |
216
+
217
+ ---
218
+
219
+ ## 🧪 Exemplos de Uso
220
+
221
+ ### Validar Arquivo Individual
222
+
223
+ ```bash
224
+ # Criar script personalizado
225
+ cat > validate.js << 'EOF'
226
+ const { FrontEndAgent } = require('./.agents/core/frontend-agent');
227
+ const agent = new FrontEndAgent();
228
+
229
+ (async () => {
230
+ const result = await agent.validateComponent(process.argv[2]);
231
+ console.log(agent.generateReport([result]));
232
+ })();
233
+ EOF
234
+
235
+ node validate.js components/MyComponent.tsx
236
+ ```
237
+
238
+ ### Integrar com Git Hooks (Husky)
239
+
240
+ ```json
241
+ // package.json
242
+ {
243
+ "husky": {
244
+ "hooks": {
245
+ "pre-commit": "node .agents/pre-commit-check.js"
246
+ }
247
+ }
248
+ }
249
+ ```
250
+
251
+ ### Integrar com CI/CD (GitHub Actions)
252
+
253
+ ```yaml
254
+ # .github/workflows/agents.yml
255
+ name: Agents Validation
256
+ on: [pull_request]
257
+
258
+ jobs:
259
+ validate:
260
+ runs-on: ubuntu-latest
261
+ steps:
262
+ - uses: actions/checkout@v3
263
+ - uses: actions/setup-node@v3
264
+ with:
265
+ node-version: 18
266
+ - run: node .agents/test-init-context.js
267
+ - run: npm run lint
268
+ - run: npm run build
269
+ ```
270
+
271
+ ---
272
+
273
+ ## 📖 Documentação Completa
274
+
275
+ - [Guia de Instalação](./docs/installation.md)
276
+ - [Regras Detalhadas](./docs/AGENT_RULES.md)
277
+ - [Sistema de Design](./docs/DESIGN_SYSTEM.md)
278
+ - [Árvore de Símbolos](./docs/SYMBOLS_TREE.md)
279
+ - [Histórico de Builds](./docs/BUILD_HISTORY.md)
280
+ - **[🧠 Sistema de Aprendizado](./docs/LEARNING_SYSTEM.md)** ← NOVO!
281
+
282
+ ---
283
+
284
+ ## 🤝 Contribuindo
285
+
286
+ Contribuições são bem-vindas! Por favor:
287
+
288
+ 1. Fork o repositório
289
+ 2. Crie uma branch (`git checkout -b feature/minha-feature`)
290
+ 3. Commit suas mudanças (`git commit -m 'feat: adiciona nova feature'`)
291
+ 4. Push para a branch (`git push origin feature/minha-feature`)
292
+ 5. Abra um Pull Request
293
+
294
+ ---
295
+
296
+ ## 📝 Licença
297
+
298
+ Este projeto está sob a licença MIT. Veja [LICENSE](./LICENSE) para mais detalhes.
299
+
300
+ ---
301
+
302
+ ## 🆘 Suporte
303
+
304
+ - 📧 Email: suporte@webgho.com
305
+ - 🐛 Issues: [GitHub Issues](https://github.com/webgho/agentes/issues)
306
+ - 📖 Docs: https://www.webgho.agentes.com
307
+
308
+ ---
309
+
310
+ ## ✨ Créditos
311
+
312
+ Desenvolvido por **WebGho Team** com foco em qualidade, segurança e produtividade.
313
+
314
+ **Versão**: 2.0.0 (com Sistema de Aprendizado)
315
+ **Última atualização**: 2026-01-22