izanagi-ai 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +53 -0
- package/CHANGELOG.md +198 -0
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/ROADMAP.md +131 -0
- package/RULES.md +202 -0
- package/SYSTEM.md +201 -0
- package/agents/INDEX.md +40 -0
- package/agents/architect-agent.json +15 -0
- package/agents/bug-hunter-agent.json +14 -0
- package/agents/database-agent.json +14 -0
- package/agents/devops-agent.json +15 -0
- package/agents/docs-agent.json +15 -0
- package/agents/pm-agent.json +14 -0
- package/agents/professor-agent.json +15 -0
- package/agents/security-agent.json +14 -0
- package/agents/senior-engineer-agent.json +16 -0
- package/agents/techlead-agent.json +15 -0
- package/architecture/clean-architecture.md +98 -0
- package/architecture/cqrs-specialist.md +102 -0
- package/architecture/ddd-specialist.md +97 -0
- package/architecture/event-driven-architect.md +79 -0
- package/architecture/hexagonal-architecture.md +96 -0
- package/architecture/microservices-expert.md +83 -0
- package/architecture/monolith-expert.md +67 -0
- package/architecture/repository-pattern.md +73 -0
- package/architecture/unit-of-work.md +92 -0
- package/backend/README.md +29 -0
- package/bin/nexus.js +8 -0
- package/core/compression-engine.md +194 -0
- package/core/context-engine.md +239 -0
- package/core/decision-engine.md +377 -0
- package/core/evolution-engine.md +169 -0
- package/core/planning-engine.md +201 -0
- package/core/quality-gates.md +233 -0
- package/core/reflection-engine.md +182 -0
- package/core/skill-resolver.json +169 -0
- package/core/token-manager.md +152 -0
- package/database/database-engineer.md +244 -0
- package/database/mysql-specialist.md +61 -0
- package/database/postgresql-specialist.md +70 -0
- package/database/redis-specialist.md +73 -0
- package/database/sql-optimizer.md +95 -0
- package/database/sqlserver-specialist.md +69 -0
- package/devops/ci-cd-specialist.md +101 -0
- package/devops/devops-engineer.md +358 -0
- package/devops/docker-expert.md +105 -0
- package/devops/git-expert.md +76 -0
- package/devops/git-flow-specialist.md +71 -0
- package/devops/kubernetes-specialist.md +84 -0
- package/devops/linux-specialist.md +82 -0
- package/devops/windows-specialist.md +43 -0
- package/dist/cli/commands/compile.d.ts +2 -0
- package/dist/cli/commands/compile.d.ts.map +1 -0
- package/dist/cli/commands/compile.js +44 -0
- package/dist/cli/commands/compile.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +88 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +26 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/list.d.ts +2 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +50 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/run.d.ts +2 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +49 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +72 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/installer.d.ts +5 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +86 -0
- package/dist/installer.js.map +1 -0
- package/dist/postinstall.d.ts +2 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +8 -0
- package/dist/postinstall.js.map +1 -0
- package/frontend/README.md +19 -0
- package/memory/context-recovery.md +49 -0
- package/memory/conversation-summarizer.md +65 -0
- package/memory/long-term-project-memory.md +58 -0
- package/memory/memory-manager.md +299 -0
- package/memory/session-compression.md +182 -0
- package/memory/smart-recall.md +37 -0
- package/optimization/compact-example.md +87 -0
- package/optimization/cost-optimizer.md +53 -0
- package/optimization/prompt-optimizer.md +194 -0
- package/optimization/token-audit.md +177 -0
- package/optimization/token-reducer.md +202 -0
- package/package.json +67 -0
- package/security/owasp-auditor.md +249 -0
- package/security/pentest-reviewer.md +109 -0
- package/security/security-engineer.md +238 -0
- package/skills/INDEX.md +434 -0
- package/skills/accessibility-reviewer.md +63 -0
- package/skills/agentic-coding.md +56 -0
- package/skills/ai-agent/SKILL.md +107 -0
- package/skills/ai-agent-dev/SKILL.md +117 -0
- package/skills/alternative-solution-generator.md +72 -0
- package/skills/architecture-patterns/SKILL.md +113 -0
- package/skills/breaking-change-detector.md +84 -0
- package/skills/bug-hunter.md +234 -0
- package/skills/bug-prevention.md +75 -0
- package/skills/chaos-engineering/SKILL.md +108 -0
- package/skills/clean-code-validator.md +218 -0
- package/skills/cloud-architect/SKILL.md +78 -0
- package/skills/cloud-infra/SKILL.md +99 -0
- package/skills/code-auditor.md +24 -0
- package/skills/complexity-analyzer.md +102 -0
- package/skills/confidence-estimator.md +53 -0
- package/skills/continuous-improvement.md +46 -0
- package/skills/continuous-learning-engine.md +51 -0
- package/skills/cto-advisor.md +66 -0
- package/skills/data-engineer/SKILL.md +76 -0
- package/skills/data-engineering/SKILL.md +82 -0
- package/skills/debug-specialist.md +215 -0
- package/skills/dependency-analyzer.md +78 -0
- package/skills/design-pattern-advisor.md +78 -0
- package/skills/documentation-writer.md +66 -0
- package/skills/dry-kiss-yagni-validator.md +114 -0
- package/skills/economia-tokens/SKILL.md +40 -0
- package/skills/er-diagram-builder.md +85 -0
- package/skills/feature-flags/SKILL.md +95 -0
- package/skills/frontend/SKILL.md +327 -0
- package/skills/frontend-dev/SKILL.md +178 -0
- package/skills/graphql/SKILL.md +104 -0
- package/skills/hallucination-detection.md +49 -0
- package/skills/handoff-sessao/SKILL.md +32 -0
- package/skills/i18n-l10n/SKILL.md +103 -0
- package/skills/iac-terraform/SKILL.md +98 -0
- package/skills/legacy-migration/SKILL.md +91 -0
- package/skills/logging-expert.md +78 -0
- package/skills/mcp-server-dev.md +33 -0
- package/skills/memoria-projeto/SKILL.md +49 -0
- package/skills/mobile-dev/SKILL.md +82 -0
- package/skills/mobile-engineer/SKILL.md +74 -0
- package/skills/monitoring-specialist.md +59 -0
- package/skills/observability-expert.md +60 -0
- package/skills/performance-optimizer.md +239 -0
- package/skills/principal-engineer.md +55 -0
- package/skills/privacy-engineer/SKILL.md +79 -0
- package/skills/professor-modo/SKILL.md +33 -0
- package/skills/project-manager.md +74 -0
- package/skills/prompt-engineering.md +27 -0
- package/skills/qa/SKILL.md +231 -0
- package/skills/qa-engineer/SKILL.md +222 -0
- package/skills/readme-generator.md +42 -0
- package/skills/refactoring-specialist.md +250 -0
- package/skills/release-planner.md +70 -0
- package/skills/requirement-analyzer.md +65 -0
- package/skills/risk-analyzer.md +73 -0
- package/skills/root-cause-analyzer.md +210 -0
- package/skills/scalability-expert.md +73 -0
- package/skills/security-privacy/SKILL.md +98 -0
- package/skills/self-correction.md +54 -0
- package/skills/self-critique.md +42 -0
- package/skills/senior-code-reviewer.md +193 -0
- package/skills/sequence-diagram-builder.md +56 -0
- package/skills/serverless-edge/SKILL.md +103 -0
- package/skills/software-architect.md +356 -0
- package/skills/solid-validator.md +332 -0
- package/skills/sre-reliability/SKILL.md +115 -0
- package/skills/staff-engineer.md +61 -0
- package/skills/task-planner.md +61 -0
- package/skills/tech-lead.md +59 -0
- package/skills/technical-debt-analyzer.md +81 -0
- package/skills/technical-writer.md +39 -0
- package/skills/tradeoff-analyzer.md +79 -0
- package/skills/uml-generator.md +72 -0
- package/skills/ux-reviewer.md +61 -0
- package/skills/wasm/SKILL.md +133 -0
- package/skills/web-perf-engineer/SKILL.md +75 -0
- package/skills/web-perf-seo/SKILL.md +111 -0
- package/skills/websocket-realtime/SKILL.md +107 -0
- package/teaching/adaptive-teaching.md +37 -0
- package/teaching/code-explainer.md +172 -0
- package/teaching/interactive-teaching.md +41 -0
- package/teaching/learning-tracker.md +63 -0
- package/teaching/mentor-mode.md +200 -0
- package/teaching/professor-mode.md +222 -0
- package/testing/e2e-test-engineer.md +68 -0
- package/testing/integration-test-engineer.md +74 -0
- package/testing/mocking-specialist.md +78 -0
- package/testing/unit-test-engineer.md +209 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend
|
|
3
|
+
description: |
|
|
4
|
+
Skill de frontend para o Portal. Contém todos os design tokens do Tailwind CSS,
|
|
5
|
+
padrões de design identificados nas páginas existentes, e boas práticas de Next.js + Tailwind.
|
|
6
|
+
Use esta skill para criar ou editar componentes visuais, garantindo consistência com o design system existente.
|
|
7
|
+
Antes de criar novas classes ou variáveis, consulte a lista de tokens existentes abaixo.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Skill Frontend — Portal
|
|
11
|
+
|
|
12
|
+
## 🎨 Design Tokens Existentes (`tailwind.config.js`)
|
|
13
|
+
|
|
14
|
+
Antes de criar qualquer estilização, **consulte os tokens abaixo**. Priorize SEMPRE o uso de tokens existentes.
|
|
15
|
+
|
|
16
|
+
### Cores Customizadas
|
|
17
|
+
|
|
18
|
+
| Token Tailwind | Valor | Uso |
|
|
19
|
+
|----------------|-------|-----|
|
|
20
|
+
| `brand-blue` | `#1e40af` | Cor primária da marca. Botões, links, headers |
|
|
21
|
+
| `brand-light-blue` | `#3b82f6` | Variante clara do azul. Hovers, destaques |
|
|
22
|
+
| `brand-dark-blue` | `#1e3a8a` | Variante escura. Hover de botões, textos de destaque |
|
|
23
|
+
| `brand-green` | `#059669` | Cor secundária. Badges de sucesso, benefícios |
|
|
24
|
+
| `modal-cancel-bg` | `#f1f5f9` | Background do botão cancelar em modais |
|
|
25
|
+
| `modal-cancel-bg-hover` | `#e2e8f0` | Hover do botão cancelar |
|
|
26
|
+
| `modal-cancel-border` | `#e2e8f0` | Borda do botão cancelar |
|
|
27
|
+
| `modal-cancel-text` | `#4b5563` | Texto do botão cancelar |
|
|
28
|
+
| `modal-divider` | `rgba(0,0,0,0.06)` | Divider sutil dentro de modais |
|
|
29
|
+
|
|
30
|
+
**Como usar:**
|
|
31
|
+
```tsx
|
|
32
|
+
<button className="bg-brand-blue text-white hover:bg-brand-dark-blue">
|
|
33
|
+
Enviar
|
|
34
|
+
</button>
|
|
35
|
+
|
|
36
|
+
<div className="text-brand-blue">Link azul da marca</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Gradientes (Background Image)
|
|
40
|
+
|
|
41
|
+
| Token | Valor | Uso |
|
|
42
|
+
|-------|-------|-----|
|
|
43
|
+
| `bg-brand-gradient` | `linear-gradient(90deg, #1e40af, #3b82f6)` | Gradiente horizontal da marca |
|
|
44
|
+
| `bg-brand-gradient-2` | `linear-gradient(120deg, #1a3fad 0%, #0f2680 55%, #163ba0 100%)` | Gradiente de ângulo da marca |
|
|
45
|
+
| `bg-modal-card` | `linear-gradient(145deg, #ffffff 0%, #f8faff 100%)` | Background de cards de modal |
|
|
46
|
+
| `bg-modal-header` | `linear-gradient(90deg, #1d4ed8 0%, #2563eb 60%, #3b82f6 100%)` | Header de modal |
|
|
47
|
+
| `bg-modal-btn` | `linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%)` | Botão de modal |
|
|
48
|
+
| `bg-modal-btn-hover` | `linear-gradient(90deg, #1e40af 0%, #1d4ed8 100%)` | Hover do botão de modal |
|
|
49
|
+
|
|
50
|
+
**Como usar:**
|
|
51
|
+
```tsx
|
|
52
|
+
<div className="bg-brand-gradient text-white">
|
|
53
|
+
Banner com gradiente
|
|
54
|
+
</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Sombras (Box Shadow)
|
|
58
|
+
|
|
59
|
+
| Token | Valor | Uso |
|
|
60
|
+
|-------|-------|-----|
|
|
61
|
+
| `shadow-modal-card` | `0 25px 60px rgba(0,0,0,0.25), 0 8px 24px rgba(59,130,246,0.12)` | Sombra elevada para modais |
|
|
62
|
+
| `shadow-modal-img` | `0 4px 16px rgba(0,0,0,0.10)` | Sombra suave para imagens |
|
|
63
|
+
| `shadow-modal-btn` | `0 2px 10px rgba(37,99,235,0.35)` | Sombra de botão azul |
|
|
64
|
+
| `shadow-modal-btn-hover` | `0 4px 16px rgba(37,99,235,0.45)` | Sombra de botão azul em hover |
|
|
65
|
+
|
|
66
|
+
### Backdrop Blur
|
|
67
|
+
|
|
68
|
+
| Token | Valor | Uso |
|
|
69
|
+
|-------|-------|-----|
|
|
70
|
+
| `backdrop-blur-modal` | `4px` | Blur de fundo em overlays de modal |
|
|
71
|
+
|
|
72
|
+
### Animações
|
|
73
|
+
|
|
74
|
+
| Token | Keyframe | Efeito |
|
|
75
|
+
|-------|----------|--------|
|
|
76
|
+
| `animate-modal-in` | `modalIn 0.22s ease-out` | Entrada suave do modal (translateY + scale) |
|
|
77
|
+
|
|
78
|
+
### Plugin Ativo
|
|
79
|
+
|
|
80
|
+
- **`@tailwindcss/typography`** — Classe `.prose` para conteúdo rico (posts, artigos)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 📐 Padrões de Design Identificados
|
|
85
|
+
|
|
86
|
+
### Layout de Página Pública
|
|
87
|
+
|
|
88
|
+
Toda page pública segue exatamente esta estrutura:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<main>
|
|
92
|
+
<Header />
|
|
93
|
+
<PageHeader title="..." subtitle="..." breadcrumb={[...]} />
|
|
94
|
+
|
|
95
|
+
<section className="py-16 bg-gray-50">
|
|
96
|
+
<div className="container mx-auto px-4">
|
|
97
|
+
{/* conteúdo */}
|
|
98
|
+
</div>
|
|
99
|
+
</section>
|
|
100
|
+
|
|
101
|
+
<Footer />
|
|
102
|
+
</main>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Cards e Containers
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
// Card principal
|
|
109
|
+
<div className="bg-white rounded-lg shadow-lg p-8">
|
|
110
|
+
|
|
111
|
+
// Card compacto
|
|
112
|
+
<div className="bg-white shadow-lg rounded-2xl p-6">
|
|
113
|
+
|
|
114
|
+
// Container de seção
|
|
115
|
+
<div className="container mx-auto px-4">
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Formulários
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// Wrapper do formulário
|
|
122
|
+
<form className="space-y-4">
|
|
123
|
+
{/* ou space-y-6 para formulários maiores */}
|
|
124
|
+
</form>
|
|
125
|
+
|
|
126
|
+
// Label padrão
|
|
127
|
+
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
128
|
+
Nome <span className="text-red-600">*</span>
|
|
129
|
+
</label>
|
|
130
|
+
|
|
131
|
+
// Input padrão
|
|
132
|
+
<input className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-blue focus:border-transparent" />
|
|
133
|
+
|
|
134
|
+
// Select padrão
|
|
135
|
+
<select className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-blue focus:border-transparent">
|
|
136
|
+
|
|
137
|
+
// Textarea padrão
|
|
138
|
+
<textarea rows={6} className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-blue focus:border-transparent" />
|
|
139
|
+
|
|
140
|
+
// Erro de validação
|
|
141
|
+
<p className="text-red-500 text-sm mt-1">{errors.campo.message}</p>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Botões
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
// Botão primário (azul)
|
|
148
|
+
<button className="w-full bg-brand-blue text-white px-6 py-3 rounded-lg font-semibold hover:bg-brand-dark-blue transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2">
|
|
149
|
+
|
|
150
|
+
// Botão simples
|
|
151
|
+
<button className="w-full bg-blue-500 text-white font-semibold py-2 rounded-lg hover:bg-blue-600 transition-colors">
|
|
152
|
+
|
|
153
|
+
// Botão com loading
|
|
154
|
+
{loading ? (
|
|
155
|
+
<>
|
|
156
|
+
<Loader className="w-5 h-5 animate-spin" />
|
|
157
|
+
Enviando...
|
|
158
|
+
</>
|
|
159
|
+
) : (
|
|
160
|
+
<>
|
|
161
|
+
<Send className="w-5 h-5" />
|
|
162
|
+
Enviar
|
|
163
|
+
</>
|
|
164
|
+
)}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Grids Responsivos
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
// 2 colunas (mobile: 1)
|
|
171
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
172
|
+
|
|
173
|
+
// 3 colunas com sidebar (mobile: 1)
|
|
174
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
175
|
+
|
|
176
|
+
// 2 colunas + sidebar
|
|
177
|
+
<div className="lg:col-span-2"> {/* conteúdo principal */}
|
|
178
|
+
<div> {/* sidebar */}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Feedbacks
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
// Sucesso
|
|
185
|
+
<div className="bg-green-50 border border-green-200 text-green-800 px-4 py-3 rounded-lg mb-6">
|
|
186
|
+
|
|
187
|
+
// Erro
|
|
188
|
+
<div className="bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded-lg mb-6">
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Informações de Contato / Sidebar
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<div className="flex items-start gap-3">
|
|
195
|
+
<Icon className="w-5 h-5 text-brand-blue mt-1 flex-shrink-0" />
|
|
196
|
+
<div>
|
|
197
|
+
<p className="font-semibold text-gray-800">Título</p>
|
|
198
|
+
<p className="text-gray-600 text-sm">Conteúdo</p>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Tipografia
|
|
204
|
+
|
|
205
|
+
| Uso | Classes |
|
|
206
|
+
|-----|---------|
|
|
207
|
+
| Título de página | `text-2xl font-bold text-gray-800` |
|
|
208
|
+
| Subtítulo | `text-gray-600` |
|
|
209
|
+
| Título de card | `text-xl font-bold text-gray-800` |
|
|
210
|
+
| Título de formulário | `text-xl font-semibold mb-4 text-center` |
|
|
211
|
+
| Label | `block text-sm font-medium text-gray-700` |
|
|
212
|
+
| Texto secundário | `text-gray-600 text-sm` |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 🆕 Adicionando Novos Design Tokens
|
|
217
|
+
|
|
218
|
+
Quando precisar criar um **novo token**, adicione-o no `tailwind.config.js`:
|
|
219
|
+
|
|
220
|
+
### Passo a passo:
|
|
221
|
+
|
|
222
|
+
1. **Verifique** se já existe um token que atende sua necessidade (consulte tabelas acima)
|
|
223
|
+
2. Se não existe, **crie com prefixo semântico** do componente/contexto:
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
// tailwind.config.js → theme.extend
|
|
227
|
+
colors: {
|
|
228
|
+
// Prefixo do contexto + propósito
|
|
229
|
+
"card-border": "#e5e7eb",
|
|
230
|
+
"sidebar-bg": "#f8fafc",
|
|
231
|
+
"alert-success": "#059669",
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
3. **Nunca** use cores hardcoded inline quando o token existir:
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
// ✅ BOM
|
|
239
|
+
<div className="bg-brand-blue">
|
|
240
|
+
|
|
241
|
+
// ❌ RUIM
|
|
242
|
+
<div className="bg-[#1e40af]">
|
|
243
|
+
// ou pior:
|
|
244
|
+
<div style={{ backgroundColor: '#1e40af' }}>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## ⚡ Boas Práticas Next.js
|
|
250
|
+
|
|
251
|
+
### `"use client"` — Quando usar
|
|
252
|
+
- ✅ Componentes com `useState`, `useEffect`, `useRef`
|
|
253
|
+
- ✅ Event handlers (`onClick`, `onChange`, `onSubmit`)
|
|
254
|
+
- ✅ Hooks customizados
|
|
255
|
+
- ❌ **NÃO** usar em pages que são puramente estáticas
|
|
256
|
+
|
|
257
|
+
### Importações
|
|
258
|
+
- Usar `@/` para imports absolutos (configurado no `tsconfig.json`)
|
|
259
|
+
- Agrupar imports: React → Next.js → libs externas → componentes → utils → types
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
// 1. React
|
|
263
|
+
import { useState, useEffect } from "react";
|
|
264
|
+
|
|
265
|
+
// 2. Next.js
|
|
266
|
+
import { useRouter } from "next/navigation";
|
|
267
|
+
|
|
268
|
+
// 3. Libs externas
|
|
269
|
+
import { z } from "zod";
|
|
270
|
+
import axios from "axios";
|
|
271
|
+
|
|
272
|
+
// 4. Componentes
|
|
273
|
+
import Header from "@/components/Header";
|
|
274
|
+
import Footer from "@/components/Footer";
|
|
275
|
+
|
|
276
|
+
// 5. Utils/Services
|
|
277
|
+
import { formatCPF } from "@/utils/validCPF";
|
|
278
|
+
|
|
279
|
+
// 6. Types
|
|
280
|
+
import type { Post } from "@/types";
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Imagens
|
|
284
|
+
- Usar `OptimizedImage` (componente do projeto) para lazy loading
|
|
285
|
+
- Imagens estáticas em `public/images/`
|
|
286
|
+
- Imagens dinâmicas via Supabase Storage
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## ⚡ Boas Práticas Tailwind
|
|
291
|
+
|
|
292
|
+
### Mobile-first
|
|
293
|
+
- Sempre estilizar para **mobile primeiro**, depois adicionar breakpoints
|
|
294
|
+
- Breakpoints: `sm:` (640px), `md:` (768px), `lg:` (1024px), `xl:` (1280px)
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
// ✅ Mobile-first
|
|
298
|
+
<div className="px-4 md:px-8 lg:px-16">
|
|
299
|
+
|
|
300
|
+
// ❌ Desktop-first
|
|
301
|
+
<div className="px-16 sm:px-4">
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Responsividade de Grid
|
|
305
|
+
```tsx
|
|
306
|
+
// Padrão do projeto: 1 col mobile → 2 col tablet → 3 col desktop
|
|
307
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Hover e Transições
|
|
311
|
+
- Sempre incluir `transition-colors` em botões e links
|
|
312
|
+
- Usar `duration-300` para transições suaves
|
|
313
|
+
- Padrão de desabilitado: `disabled:opacity-50 disabled:cursor-not-allowed`
|
|
314
|
+
|
|
315
|
+
### Organização de Classes
|
|
316
|
+
Ordenar classes Tailwind por:
|
|
317
|
+
1. Layout (display, position, grid, flex)
|
|
318
|
+
2. Sizing (width, height, padding, margin)
|
|
319
|
+
3. Typography (font, text)
|
|
320
|
+
4. Visual (background, border, shadow)
|
|
321
|
+
5. States (hover, focus, disabled)
|
|
322
|
+
6. Animation (transition, animate)
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
// Exemplo ordenado
|
|
326
|
+
<button className="flex items-center justify-center gap-2 w-full px-6 py-3 text-white font-semibold bg-brand-blue rounded-lg shadow-lg hover:bg-brand-dark-blue focus:ring-2 transition-colors duration-300">
|
|
327
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-dev
|
|
3
|
+
description: |
|
|
4
|
+
Agente Dev Frontend Sênior para o Portal. Responsável por toda edição visual,
|
|
5
|
+
criação de componentes, estilização com Tailwind CSS e implementação de páginas.
|
|
6
|
+
Atua como um dev React/Next.js/TypeScript sênior com foco em qualidade visual,
|
|
7
|
+
performance e consistência com o design system existente.
|
|
8
|
+
Ative este agente para qualquer tarefa de criação, edição ou refatoração de componentes visuais.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Agente: Dev Frontend Sênior
|
|
12
|
+
|
|
13
|
+
## 🧑💻 Perfil
|
|
14
|
+
|
|
15
|
+
Você é um **Desenvolvedor Frontend Sênior** com 8+ anos de experiência em React, Next.js e Tailwind CSS. Você trabalha no Portal, um site institucional da Associação Nacional dos Servidores da Previdência.
|
|
16
|
+
|
|
17
|
+
### Sua Expertise:
|
|
18
|
+
- React 18 com Server Components e Client Components
|
|
19
|
+
- Next.js 14 App Router (pages, layouts, API routes)
|
|
20
|
+
- TypeScript strict (tipagem rigorosa)
|
|
21
|
+
- Tailwind CSS com design tokens customizados
|
|
22
|
+
- Supabase (Auth, Database, Storage)
|
|
23
|
+
- Acessibilidade (WCAG 2.1)
|
|
24
|
+
- Performance e otimização de renders
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 📋 Antes de Começar Qualquer Tarefa
|
|
29
|
+
|
|
30
|
+
### 1. Leia a Skill `frontend`
|
|
31
|
+
Antes de criar ou editar qualquer componente, **leia obrigatoriamente** a skill `frontend` em `.agents/skills/frontend/SKILL.md`. Ela contém:
|
|
32
|
+
- Todos os **design tokens** do `tailwind.config.js`
|
|
33
|
+
- **Padrões de design** identificados nas pages existentes
|
|
34
|
+
- Boas práticas de **Next.js** e **Tailwind**
|
|
35
|
+
|
|
36
|
+
### 2. Consulte a Arquitetura
|
|
37
|
+
Leia `.agents/ARCHITECTURE.md` para entender onde cada arquivo deve ser colocado.
|
|
38
|
+
|
|
39
|
+
### 3. Consulte as Regras
|
|
40
|
+
Leia `.agents/AGENTS.md` para seguir as boas práticas de SOLID, DDD e Clean Code.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🎯 Responsabilidades
|
|
45
|
+
|
|
46
|
+
### O que você FAZ:
|
|
47
|
+
- ✅ Criar e editar componentes React (`.tsx`)
|
|
48
|
+
- ✅ Estilizar com Tailwind CSS usando os tokens existentes
|
|
49
|
+
- ✅ Criar novas pages seguindo o padrão do projeto
|
|
50
|
+
- ✅ Adicionar novos design tokens no `tailwind.config.js` quando necessário
|
|
51
|
+
- ✅ Implementar formulários com React Hook Form + Zod
|
|
52
|
+
- ✅ Garantir responsividade mobile-first
|
|
53
|
+
- ✅ Refatorar componentes para melhor legibilidade e reutilização
|
|
54
|
+
- ✅ Implementar animações e transições suaves
|
|
55
|
+
|
|
56
|
+
### O que você NÃO FAZ:
|
|
57
|
+
- ❌ Alterar lógica de backend (API routes, Supabase queries)
|
|
58
|
+
- ❌ Modificar configurações de deploy
|
|
59
|
+
- ❌ Alterar estrutura do banco de dados
|
|
60
|
+
- ❌ Modificar autenticação ou RLS policies
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 🔧 Workflow de Edição Visual
|
|
65
|
+
|
|
66
|
+
### Ao receber uma tarefa de criação/edição:
|
|
67
|
+
|
|
68
|
+
1. **Identificar o escopo**
|
|
69
|
+
- É um componente novo ou edição de existente?
|
|
70
|
+
- Quais páginas são afetadas?
|
|
71
|
+
- Precisa de novo design token?
|
|
72
|
+
|
|
73
|
+
2. **Consultar tokens existentes**
|
|
74
|
+
- Verificar `tailwind.config.js` para cores, gradientes, sombras
|
|
75
|
+
- Verificar `_variables.scss` para variáveis CSS globais
|
|
76
|
+
- Verificar `globals.css` para classes utilitárias customizadas
|
|
77
|
+
|
|
78
|
+
3. **Implementar seguindo os padrões**
|
|
79
|
+
- Usar a estrutura de página padrão: `Header → PageHeader → content → Footer`
|
|
80
|
+
- Reutilizar componentes existentes sempre que possível
|
|
81
|
+
- Manter consistência visual com outras páginas
|
|
82
|
+
|
|
83
|
+
4. **Se precisar de novo token**
|
|
84
|
+
- Adicionar no `tailwind.config.js` com prefixo semântico
|
|
85
|
+
- Documentar na skill `frontend` o novo token
|
|
86
|
+
- Nunca usar valor hardcoded quando um token resolve
|
|
87
|
+
|
|
88
|
+
5. **Verificar resultado**
|
|
89
|
+
- Testar em mobile (375px)
|
|
90
|
+
- Testar em tablet (768px)
|
|
91
|
+
- Testar em desktop (1280px)
|
|
92
|
+
- Verificar loading states e error states
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 📦 Template de Novo Componente
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
"use client";
|
|
100
|
+
|
|
101
|
+
import { useState } from "react";
|
|
102
|
+
|
|
103
|
+
interface NomeComponenteProps {
|
|
104
|
+
/** Descrição da prop obrigatória */
|
|
105
|
+
title: string;
|
|
106
|
+
/** Descrição da prop opcional */
|
|
107
|
+
subtitle?: string;
|
|
108
|
+
/** Callback de ação */
|
|
109
|
+
onAction?: () => void;
|
|
110
|
+
/** Conteúdo filho */
|
|
111
|
+
children?: React.ReactNode;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default function NomeComponente({
|
|
115
|
+
title,
|
|
116
|
+
subtitle,
|
|
117
|
+
onAction,
|
|
118
|
+
children,
|
|
119
|
+
}: NomeComponenteProps) {
|
|
120
|
+
const [isActive, setIsActive] = useState(false);
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div className="bg-white rounded-lg shadow-lg p-6">
|
|
124
|
+
<h2 className="text-xl font-bold text-gray-800">{title}</h2>
|
|
125
|
+
{subtitle && <p className="text-gray-600 mt-1">{subtitle}</p>}
|
|
126
|
+
<div className="mt-4">{children}</div>
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 📄 Template de Nova Page
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
"use client";
|
|
136
|
+
|
|
137
|
+
import Header from "@/components/Header";
|
|
138
|
+
import PageHeader from "@/components/PageHeader";
|
|
139
|
+
import Footer from "@/components/Footer";
|
|
140
|
+
|
|
141
|
+
export default function NomeDaPagina() {
|
|
142
|
+
return (
|
|
143
|
+
<main>
|
|
144
|
+
<Header />
|
|
145
|
+
<PageHeader
|
|
146
|
+
title="Título da Página"
|
|
147
|
+
subtitle="Subtítulo descritivo"
|
|
148
|
+
breadcrumb={[
|
|
149
|
+
{ label: "Home", href: "/" },
|
|
150
|
+
{ label: "Seção", href: "/secao" },
|
|
151
|
+
{ label: "Página Atual" },
|
|
152
|
+
]}
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
<section className="py-16 bg-gray-50">
|
|
156
|
+
<div className="container mx-auto px-4">
|
|
157
|
+
{/* Conteúdo da página */}
|
|
158
|
+
</div>
|
|
159
|
+
</section>
|
|
160
|
+
|
|
161
|
+
<Footer />
|
|
162
|
+
</main>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## ⚠️ Regras Invioláveis
|
|
170
|
+
|
|
171
|
+
1. **SEMPRE** usar tokens do `tailwind.config.js` antes de criar novos
|
|
172
|
+
2. **NUNCA** usar `style={{}}` inline — sempre Tailwind classes
|
|
173
|
+
3. **NUNCA** usar `any` — tipar todas as props e variáveis
|
|
174
|
+
4. **SEMPRE** mobile-first — base classes para mobile, breakpoints para desktop
|
|
175
|
+
5. **SEMPRE** incluir `transition-colors` em botões e links interativos
|
|
176
|
+
6. **NUNCA** criar componente acima de 200 linhas — extrair sub-componentes
|
|
177
|
+
7. **SEMPRE** usar `@/` para imports (nunca caminhos relativos `../../`)
|
|
178
|
+
8. **SEMPRE** manter a estrutura de page: `Header → PageHeader → content → Footer`
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graphql
|
|
3
|
+
description: |
|
|
4
|
+
Skill de GraphQL para o Portal. Contém padrões de schema design, resolver patterns,
|
|
5
|
+
Apollo Client/Server, caching, subscriptions e boas práticas de performance.
|
|
6
|
+
Use esta skill para implementar ou revisar APIs GraphQL.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill GraphQL — Portal
|
|
10
|
+
|
|
11
|
+
## Schema Design
|
|
12
|
+
|
|
13
|
+
### Princípios
|
|
14
|
+
- **Schema-first**: definir schema.graphql antes de implementar resolvers
|
|
15
|
+
- **Node interface**: todo tipo tem `id: ID!` e implementa `Node`
|
|
16
|
+
- **Connection pattern**: listas usam `Connection` type (Relay spec) para paginação
|
|
17
|
+
- **Input types**: mutations recebem `Input!` types, nunca args soltos
|
|
18
|
+
|
|
19
|
+
### Naming Conventions
|
|
20
|
+
| Elemento | Padrão | Exemplo |
|
|
21
|
+
|----------|--------|---------|
|
|
22
|
+
| Types | PascalCase | `Associated`, `NewsPost` |
|
|
23
|
+
| Fields | camelCase | `fullName`, `createdAt` |
|
|
24
|
+
| Inputs | PascalCase + `Input` | `CreatePostInput` |
|
|
25
|
+
| Payloads | PascalCase + `Payload` | `CreatePostPayload` |
|
|
26
|
+
| Enums | PascalCase + `Enum` | `PostStatusEnum` |
|
|
27
|
+
| Arguments | camelCase | `first, after, filter` |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Apollo Client (Frontend)
|
|
32
|
+
|
|
33
|
+
### Setup
|
|
34
|
+
```tsx
|
|
35
|
+
import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client";
|
|
36
|
+
|
|
37
|
+
const client = new ApolloClient({
|
|
38
|
+
link: createHttpLink({ uri: "/api/graphql" }),
|
|
39
|
+
cache: new InMemoryCache({
|
|
40
|
+
typePolicies: {
|
|
41
|
+
Query: { fields: { posts: { merge: false } } },
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Fragment Colocation
|
|
48
|
+
```tsx
|
|
49
|
+
const POST_FRAGMENT = gql`
|
|
50
|
+
fragment PostFields on Post {
|
|
51
|
+
id title excerpt publishedAt
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
// Componente consome apenas o fragment que precisa
|
|
56
|
+
function PostCard({ post }: { post: PostFieldsFragment }) { ... }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Apollo Server (Backend)
|
|
62
|
+
|
|
63
|
+
### Codegen First (GraphQL Codegen)
|
|
64
|
+
```yaml
|
|
65
|
+
generates:
|
|
66
|
+
src/types/graphql.ts:
|
|
67
|
+
plugins:
|
|
68
|
+
- typescript
|
|
69
|
+
- typescript-resolvers
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Resolver Pattern
|
|
73
|
+
```tsx
|
|
74
|
+
const resolvers: Resolvers = {
|
|
75
|
+
Query: {
|
|
76
|
+
posts: async (_, args, { dataSources }) =>
|
|
77
|
+
dataSources.posts.findAll(args),
|
|
78
|
+
},
|
|
79
|
+
Post: {
|
|
80
|
+
author: async (parent, _, { dataSources }) =>
|
|
81
|
+
dataSources.users.findById(parent.authorId),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Performance
|
|
89
|
+
|
|
90
|
+
- **DataLoader**: sempre usar para N+1 problem
|
|
91
|
+
- **Persisted Queries**: reduzir overhead de rede
|
|
92
|
+
- **@defer / @stream**: usar para loading progressivo (quando disponível)
|
|
93
|
+
- **Query complexity**: limitar profundidade máxima (3-5 níveis)
|
|
94
|
+
- **Batch queries**: ApolloCache com merge policies
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Segurança
|
|
99
|
+
|
|
100
|
+
- **Depth limiting**: evitar queries recursivas maliciosas
|
|
101
|
+
- **Auth directives**: `@auth(requires: ADMIN)` nos campos protegidos
|
|
102
|
+
- **Rate limiting**: por query complexity, não por request count
|
|
103
|
+
- **Persisted queries only**: em produção, aceitar apenas queries pré-registradas
|
|
104
|
+
- **Validation**: Zod schema nos inputs de mutation (além do GraphQL type system)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Skill: Hallucination Detection
|
|
2
|
+
|
|
3
|
+
> Version 1.0.0 | Priority: High (Future)
|
|
4
|
+
> Dependencies: Reflection Engine
|
|
5
|
+
> Compatibility: ">=1.0.0"
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Identity
|
|
10
|
+
|
|
11
|
+
Hallucination Detection estimates confidence in statements the agent makes. Flags low-confidence statements and qualifies them. Detects contradictions and unverifiable claims.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Confidence Levels
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
high (90%+):
|
|
19
|
+
- "Laravel is a PHP framework" (established fact)
|
|
20
|
+
- Code from project context (verifiable)
|
|
21
|
+
|
|
22
|
+
medium (70-90%):
|
|
23
|
+
- "This pattern is commonly used for..." (general knowledge)
|
|
24
|
+
- Recommendations based on best practices
|
|
25
|
+
|
|
26
|
+
low (50-70%):
|
|
27
|
+
- "This might be the best approach for your case" (opinion)
|
|
28
|
+
- Estimating effort without full context
|
|
29
|
+
|
|
30
|
+
flag (< 50%):
|
|
31
|
+
- "I'm not certain, but..." (clearly uncertain)
|
|
32
|
+
- Should ask user for clarification
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Detection Patterns
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
- Vague or unspecific statements ("someone said", "I think")
|
|
39
|
+
- Conflicting statements within same response
|
|
40
|
+
- Claims without evidence or reasoning
|
|
41
|
+
- Made-up libraries, methods, or versions
|
|
42
|
+
- Incorrect API usage
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Changelog
|
|
48
|
+
|
|
49
|
+
### 1.0.0 — Initial release. Confidence levels, detection patterns.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handoff-sessao
|
|
3
|
+
description: Grava um resumo curto do estado da tarefa em andamento para retomar na próxima sessão sem perder contexto e sem precisar reexplicar tudo de novo. Use quando o usuário disser "vou parar por aqui", "continuo depois", "pausa" ou quando a conversa estiver ficando muito longa e perto do limite de contexto.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Handoff de sessão
|
|
7
|
+
|
|
8
|
+
Complementa a skill `memoria-projeto`, mas para o "estado da tarefa em progresso" (não para conhecimento permanente do projeto).
|
|
9
|
+
|
|
10
|
+
## Quando acionar
|
|
11
|
+
|
|
12
|
+
- Usuário indica que vai parar/continuar depois.
|
|
13
|
+
- A tarefa está pela metade (ex. feature com 3 de 5 passos feitos).
|
|
14
|
+
- O contexto da conversa está grande e prestes a ser resumido/perdido.
|
|
15
|
+
|
|
16
|
+
## O que gravar
|
|
17
|
+
|
|
18
|
+
Escreva (ou atualize) `.agents/memoria/em-andamento.md` com no máximo estes campos, curtos:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
## <nome da tarefa> — <data>
|
|
22
|
+
- Objetivo: <1 linha>
|
|
23
|
+
- Feito: <lista curta do que já foi feito>
|
|
24
|
+
- Falta: <lista curta do que falta>
|
|
25
|
+
- Próximo passo concreto: <1 linha — o que fazer assim que retomar>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Regras
|
|
29
|
+
|
|
30
|
+
- Sobrescreva a entrada da mesma tarefa em vez de acumular várias entradas desatualizadas — isso é estado atual, não histórico.
|
|
31
|
+
- Quando a tarefa for concluída, apague a entrada dela deste arquivo (o que vale a pena lembrar para sempre já deve ter ido para `decisoes.md` ou `erros-corrigidos.md` via a skill `memoria-projeto`).
|
|
32
|
+
- Ao retomar uma sessão, leia este arquivo primeiro se ele existir — economiza o usuário ter que reexplicar onde parou.
|