kakaroto-config 1.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/README.md +48 -0
- package/bin/install.js +101 -0
- package/config/ARCHITECTURE.md +474 -0
- package/config/CLAUDE.md +24 -0
- package/config/agents/code-reviewer.md +265 -0
- package/config/agents/code-simplifier.md +151 -0
- package/config/agents/dry-enforcer.md +227 -0
- package/config/agents/memory-sync.md +140 -0
- package/config/agents/terraform-validator.md +275 -0
- package/config/agents/test-fixer.md +355 -0
- package/config/agents/visual-validator.md +296 -0
- package/config/commands/debug/01-investigate.md +119 -0
- package/config/commands/debug/02-fix.md +108 -0
- package/config/commands/debug/03-verify.md +66 -0
- package/config/commands/debug.md +19 -0
- package/config/commands/feature/01-interview.md +151 -0
- package/config/commands/feature/02-spec.md +174 -0
- package/config/commands/feature/03-planner.md +123 -0
- package/config/commands/feature/04-implement.md +74 -0
- package/config/commands/feature/05-quality.md +122 -0
- package/config/commands/feature.md +19 -0
- package/config/commands/gate.md +313 -0
- package/package.json +26 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Fase 3: Planner
|
|
2
|
+
|
|
3
|
+
## Passo 0: Context
|
|
4
|
+
|
|
5
|
+
SE continuacao direta de 02-spec (mesma sessao):
|
|
6
|
+
Contexto ja disponivel, prosseguir
|
|
7
|
+
|
|
8
|
+
SE retomando sessao interrompida:
|
|
9
|
+
```
|
|
10
|
+
Read .claude/specs/current.md
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Passo 1: Pensamento Estruturado
|
|
16
|
+
|
|
17
|
+
Usar `mcp__sequential-thinking__sequentialthinking` para planejar:
|
|
18
|
+
|
|
19
|
+
1. **Thought 1**: Quais são as dependências entre tarefas?
|
|
20
|
+
2. **Thought 2**: Qual ordem minimiza retrabalho?
|
|
21
|
+
3. **Thought 3**: Quais riscos podem bloquear implementação?
|
|
22
|
+
4. **Thought 4**: Onde reutilizar código vs criar novo?
|
|
23
|
+
5. **Thought 5**: Quais testes preciso para cada tarefa?
|
|
24
|
+
|
|
25
|
+
`totalThoughts`: 5-7
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Passo 2: Análise Anti-Duplicação (OBRIGATÓRIO)
|
|
30
|
+
|
|
31
|
+
### 2.1 Mapeamento de Código Reutilizável
|
|
32
|
+
| Necessidade | Código Existente | Arquivo:Linha | Ação |
|
|
33
|
+
|-------------|------------------|---------------|------|
|
|
34
|
+
| [o que precisa] | [helper/service] | [path:line] | Reutilizar/Estender/Criar |
|
|
35
|
+
|
|
36
|
+
### 2.2 Oportunidades de Abstração
|
|
37
|
+
Se 3+ lugares usam padrão similar, criar abstração:
|
|
38
|
+
| Padrão Repetido | Locais | Proposta |
|
|
39
|
+
|-----------------|--------|----------|
|
|
40
|
+
| [código duplicado] | [arquivos] | [helper/hook] |
|
|
41
|
+
|
|
42
|
+
### 2.3 Checklist
|
|
43
|
+
- [ ] Justifiquei cada arquivo NOVO?
|
|
44
|
+
- [ ] Verifiquei helpers similares existentes?
|
|
45
|
+
- [ ] Código novo pode ser generalizado?
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Passo 3: Breakdown de Tarefas
|
|
50
|
+
|
|
51
|
+
Criar lista ordenada baseada na spec:
|
|
52
|
+
|
|
53
|
+
| # | Tarefa | Arquivos | Depende de |
|
|
54
|
+
|---|--------|----------|------------|
|
|
55
|
+
| 1 | [tarefa] | [arquivos] | - |
|
|
56
|
+
| 1.1 | Testes para tarefa 1 | [*.test.ts] | 1 |
|
|
57
|
+
| 2 | [tarefa] | [arquivos] | 1 |
|
|
58
|
+
| 2.1 | Testes para tarefa 2 | [*.test.ts] | 2 |
|
|
59
|
+
|
|
60
|
+
**Regras:**
|
|
61
|
+
- Tarefas pequenas (< 30 min)
|
|
62
|
+
- Uma responsabilidade por tarefa
|
|
63
|
+
- Toda função nova = teste correspondente
|
|
64
|
+
- Dependências claras
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Passo 4: Resumo de Arquivos
|
|
69
|
+
|
|
70
|
+
**Criar:**
|
|
71
|
+
- [novos arquivos]
|
|
72
|
+
|
|
73
|
+
**Modificar:**
|
|
74
|
+
- [arquivos existentes]
|
|
75
|
+
|
|
76
|
+
**Deletar:**
|
|
77
|
+
- [arquivos a remover]
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Passo 5: Riscos
|
|
82
|
+
|
|
83
|
+
| Risco | Probabilidade | Mitigação |
|
|
84
|
+
|-------|---------------|-----------|
|
|
85
|
+
| [risco] | Alta/Média/Baixa | [como reduzir] |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Passo 6: Quality Gates
|
|
90
|
+
|
|
91
|
+
Apos implementacao:
|
|
92
|
+
- [ ] `npm test` passa
|
|
93
|
+
- [ ] `npx tsc --noEmit` sem erros
|
|
94
|
+
- [ ] `npm run build` sucesso
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Passo 7: Persistir Plano
|
|
99
|
+
|
|
100
|
+
1. Usar mesmo slug da spec (gerado em 02-spec)
|
|
101
|
+
|
|
102
|
+
2. Salvar plano:
|
|
103
|
+
```
|
|
104
|
+
Write .claude/plans/{slug}.md
|
|
105
|
+
Write .claude/plans/current.md (copia do conteudo)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Output
|
|
111
|
+
|
|
112
|
+
1. Salvar plano (usar TodoWrite para tracking)
|
|
113
|
+
2. Chamar `EnterPlanMode`
|
|
114
|
+
3. **AGUARDAR aprovacao do user**
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Pos-Aprovacao
|
|
119
|
+
|
|
120
|
+
Apos user aprovar via EnterPlanMode:
|
|
121
|
+
|
|
122
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/feature/04-implement.md
|
|
123
|
+
Executar implementacao de forma AUTONOMA.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Fase 4: Implement
|
|
2
|
+
|
|
3
|
+
## Contexto
|
|
4
|
+
Plano foi aprovado. Executar de forma AUTÔNOMA até o fim.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Passo 1: Setup
|
|
9
|
+
|
|
10
|
+
### 1.1 Carregar Contexto
|
|
11
|
+
```
|
|
12
|
+
Read .claude/specs/current.md (spec e o contrato)
|
|
13
|
+
Read .claude/plans/current.md (plano aprovado)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 1.2 Usar TodoWrite
|
|
17
|
+
Registrar todas as tarefas do plano aprovado.
|
|
18
|
+
Marcar como `in_progress` conforme executa.
|
|
19
|
+
|
|
20
|
+
### 1.3 Relembrar Spec
|
|
21
|
+
A spec e o contrato. Implementacao DEVE seguir a spec.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Passo 2: Implementação
|
|
26
|
+
|
|
27
|
+
Para cada tarefa do plano:
|
|
28
|
+
|
|
29
|
+
1. **Marcar in_progress** (TodoWrite)
|
|
30
|
+
2. **Implementar** seguindo spec e patterns do projeto
|
|
31
|
+
3. **Criar teste** para cada função nova
|
|
32
|
+
4. **Marcar completed** (TodoWrite)
|
|
33
|
+
|
|
34
|
+
### Regras de Código
|
|
35
|
+
- Funções < 50 linhas
|
|
36
|
+
- Max 2 níveis de nesting
|
|
37
|
+
- Tipos explícitos em exports
|
|
38
|
+
- Reutilizar código existente (mapeado na spec)
|
|
39
|
+
|
|
40
|
+
### Regras de Testes
|
|
41
|
+
- Toda função exportada = teste
|
|
42
|
+
- Happy path + edge cases + erros
|
|
43
|
+
- Seguir pattern de testes existentes no projeto
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Passo 3: Verificação Rápida
|
|
48
|
+
|
|
49
|
+
Após implementar cada módulo:
|
|
50
|
+
```bash
|
|
51
|
+
npm test -- --testPathPattern="[arquivo]"
|
|
52
|
+
npx tsc --noEmit
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Se falhar: corrigir e continuar (não parar).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Output
|
|
60
|
+
|
|
61
|
+
Implementação completa.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
## PRÓXIMA FASE
|
|
65
|
+
AÇÃO OBRIGATÓRIA: Read ~/.claude/commands/feature/05-quality.md
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Regras Invioláveis
|
|
70
|
+
|
|
71
|
+
1. **PROIBIDO** pedir confirmação ao user
|
|
72
|
+
2. **PROIBIDO** abandonar por erro (corrigir e continuar)
|
|
73
|
+
3. **PROIBIDO** modificar escopo (seguir spec aprovada)
|
|
74
|
+
4. **PROIBIDO** pular testes
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Fase 5: Quality
|
|
2
|
+
|
|
3
|
+
## Contexto
|
|
4
|
+
Implementação completa. Executar quality gates de forma AUTÔNOMA.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Passo 1: Agents de Qualidade
|
|
9
|
+
|
|
10
|
+
Executar em ordem (SE falhar, corrigir e continuar):
|
|
11
|
+
|
|
12
|
+
### 1.0 Test Fixer (BASELINE)
|
|
13
|
+
Garantir que codigo implementado passa nos testes ANTES de refatorar.
|
|
14
|
+
```javascript
|
|
15
|
+
Task({
|
|
16
|
+
subagent_type: "test-fixer",
|
|
17
|
+
prompt: "Rodar npm test. Se falhar, corrigir. NAO criar testes novos ainda - apenas garantir baseline funciona.",
|
|
18
|
+
description: "Baseline test check"
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
SE FAIL: Corrigir antes de prosseguir.
|
|
22
|
+
|
|
23
|
+
### 1.1 Code Simplifier
|
|
24
|
+
```javascript
|
|
25
|
+
Task({
|
|
26
|
+
subagent_type: "code-simplifier",
|
|
27
|
+
prompt: "Simplificar codigo implementado. Reduzir complexidade. Melhorar legibilidade.",
|
|
28
|
+
description: "Simplify new code"
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 1.2 DRY Enforcer
|
|
33
|
+
```javascript
|
|
34
|
+
Task({
|
|
35
|
+
subagent_type: "dry-enforcer",
|
|
36
|
+
prompt: "Detectar duplicacoes no codigo novo. Sugerir abstracoes. Reutilizar codigo existente.",
|
|
37
|
+
description: "Remove duplications"
|
|
38
|
+
})
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 1.3 Test Fixer (VERIFICACAO)
|
|
42
|
+
Garantir que refatoracoes nao quebraram nada.
|
|
43
|
+
```javascript
|
|
44
|
+
Task({
|
|
45
|
+
subagent_type: "test-fixer",
|
|
46
|
+
prompt: "Rodar npm test apos refatoracoes. Corrigir testes que falharem. Criar testes faltantes para funcoes novas.",
|
|
47
|
+
description: "Post-refactor test fix"
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 1.4 Code Reviewer
|
|
52
|
+
```javascript
|
|
53
|
+
Task({
|
|
54
|
+
subagent_type: "code-reviewer",
|
|
55
|
+
prompt: "Review final do codigo. Verificar qualidade, seguranca, patterns do projeto.",
|
|
56
|
+
description: "Final code review"
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 1.5 Visual Validator (SE modificou UI)
|
|
61
|
+
Apenas se modificou: `components/`, `pages/`, `app/`, `*.css`, `*.tsx`
|
|
62
|
+
```javascript
|
|
63
|
+
Task({
|
|
64
|
+
subagent_type: "visual-validator",
|
|
65
|
+
prompt: "Validar UI. Iniciar dev server. Verificar erros de console. Testar fluxos modificados.",
|
|
66
|
+
description: "Validate UI changes"
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 1.6 Terraform Validator (SE modificou env/terraform)
|
|
71
|
+
Apenas se modificou: `.env*`, `terraform/**/*.tf`, `terraform/**/*.tfvars*`, `variables.tf`
|
|
72
|
+
```javascript
|
|
73
|
+
Task({
|
|
74
|
+
subagent_type: "terraform-validator",
|
|
75
|
+
prompt: "Validar consistência Terraform. Verificar variáveis em .env.example, variables.tf, main.tf, tfvars.example. Corrigir inconsistências.",
|
|
76
|
+
description: "Validate Terraform config"
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Passo 2: Quality Gates Finais
|
|
83
|
+
|
|
84
|
+
Rodar em sequência:
|
|
85
|
+
```bash
|
|
86
|
+
npm test
|
|
87
|
+
npx tsc --noEmit
|
|
88
|
+
npm run build
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Se falhar:** Corrigir e rodar novamente. Não prosseguir até passar.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Passo 3: Memory Sync
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
Task({
|
|
99
|
+
subagent_type: "memory-sync",
|
|
100
|
+
prompt: "Sincronizar knowledge graph. Atualizar entidades obsoletas. Criar novas para patterns/conhecimento adquirido.",
|
|
101
|
+
description: "Sync memory graph"
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Passo 4: Relatório Final
|
|
108
|
+
|
|
109
|
+
Reportar ao user:
|
|
110
|
+
- Feature implementada
|
|
111
|
+
- Testes criados/passando
|
|
112
|
+
- Build sucesso
|
|
113
|
+
- Arquivos criados/modificados
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Regras Invioláveis
|
|
118
|
+
|
|
119
|
+
1. **PROIBIDO** pular agents de qualidade
|
|
120
|
+
2. **PROIBIDO** prosseguir com testes falhando
|
|
121
|
+
3. **PROIBIDO** prosseguir com build falhando
|
|
122
|
+
4. **PROIBIDO** perguntar ao user (só reportar no final)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
model: opus
|
|
3
|
+
---
|
|
4
|
+
# Feature Workflow
|
|
5
|
+
|
|
6
|
+
Desenvolver: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## INICIAR
|
|
9
|
+
AÇÃO OBRIGATÓRIA: Read ~/.claude/commands/feature/01-interview.md
|
|
10
|
+
Seguir instruções. Cada fase aponta para a próxima.
|
|
11
|
+
|
|
12
|
+
## Fluxo
|
|
13
|
+
Interview → Spec → Planner → [APROVAÇÃO] → Implement → Quality → Fim
|
|
14
|
+
|
|
15
|
+
## Regras
|
|
16
|
+
1. PROIBIDO parar entre fases (exceto EnterPlanMode)
|
|
17
|
+
2. PROIBIDO AskUserQuestion para aprovar spec/planner
|
|
18
|
+
3. PROIBIDO pedir confirmação após aprovação do plano
|
|
19
|
+
4. Erros: corrigir e continuar, não abandonar
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Quality Gate
|
|
2
|
+
|
|
3
|
+
Validacao completa do codigo: **current changes** vs **origin/main**
|
|
4
|
+
|
|
5
|
+
**Mode:** Orquestra agents especializados para validacao abrangente. Corrige problemas automaticamente.
|
|
6
|
+
|
|
7
|
+
**Uso:** Rodar antes de push para main, ou periodicamente para garantir qualidade.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Context Loading (OBRIGATORIO)
|
|
12
|
+
|
|
13
|
+
Carregar contexto do projeto:
|
|
14
|
+
- `mcp__memory__search_nodes({ query: "config" })` - escopo, comandos, quality gates
|
|
15
|
+
- `mcp__memory__search_nodes({ query: "ambiente" })` - local/producao
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Phase 0: Test Coverage Gate (BLOQUEANTE)
|
|
20
|
+
|
|
21
|
+
**Esta fase e BLOQUEANTE. Validacao NAO passa sem testes.**
|
|
22
|
+
|
|
23
|
+
### Verificar Cobertura
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Identificar arquivos de codigo modificados (excluindo testes)
|
|
27
|
+
git diff origin/main...HEAD --name-only | grep -E '\.(ts|tsx)$' | grep -v '\.test\.' | grep -v '\.d\.ts'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Para cada arquivo em `services/`, `utils/`, `api/`, `cron/`:
|
|
31
|
+
1. Verificar se existe `[arquivo].test.ts` correspondente
|
|
32
|
+
2. Se NAO existe: **FAIL** - invocar `test-fixer` para criar
|
|
33
|
+
|
|
34
|
+
### Se Cobertura Insuficiente
|
|
35
|
+
|
|
36
|
+
1. Invocar `Task` tool com `subagent_type: test-fixer`
|
|
37
|
+
2. NAO prosseguir ate testes existirem
|
|
38
|
+
3. Testes devem PASSAR antes de continuar para Phase 1
|
|
39
|
+
|
|
40
|
+
**Somente prosseguir quando todos os arquivos de codigo tiverem testes correspondentes.**
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Phase 1: Initial Quality Gates
|
|
45
|
+
|
|
46
|
+
Buscar comandos de quality gates na memory (ex: `quality_gates`).
|
|
47
|
+
|
|
48
|
+
Rodar:
|
|
49
|
+
```bash
|
|
50
|
+
npm run test && npx tsc --noEmit && npm run build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Se algum falhar, delegue para `test-fixer` agent para corrigir antes de prosseguir.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Phase 2: Diff Analysis
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git fetch origin main
|
|
61
|
+
git diff origin/main...HEAD --stat
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Identificar:
|
|
65
|
+
- Arquivos modificados
|
|
66
|
+
- Linhas adicionadas/removidas
|
|
67
|
+
- Se arquivos de ambiente/config mudaram
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Phase 3: Agent Delegation
|
|
72
|
+
|
|
73
|
+
Based on changes detected, invoke appropriate agents **using Task tool with subagent_type**.
|
|
74
|
+
|
|
75
|
+
**IMPORTANTE:** Todos os agents sao TOTALMENTE AUTONOMOS - eles irao identificar E CORRIGIR problemas automaticamente.
|
|
76
|
+
|
|
77
|
+
**Ordem de execucao:**
|
|
78
|
+
`test-fixer (baseline) -> code-simplifier -> dry-enforcer -> test-fixer (verificacao) -> code-reviewer -> visual-validator (se UI) -> terraform-validator (se env)`
|
|
79
|
+
|
|
80
|
+
### 3.1 Test Fixer (BASELINE)
|
|
81
|
+
|
|
82
|
+
Garantir que codigo implementado passa nos testes ANTES de refatorar.
|
|
83
|
+
|
|
84
|
+
**Invoke:** `Task` tool with `subagent_type: test-fixer`
|
|
85
|
+
|
|
86
|
+
**Prompt:** "Rodar npm test. Se falhar, corrigir. NAO criar testes novos ainda - apenas garantir baseline funciona."
|
|
87
|
+
|
|
88
|
+
**Expected output:**
|
|
89
|
+
- All tests passing
|
|
90
|
+
- Baseline funcionando
|
|
91
|
+
|
|
92
|
+
**If tests fail:** Fix before proceeding. NAO prosseguir ate baseline passar.
|
|
93
|
+
|
|
94
|
+
### 3.2 Code Simplification
|
|
95
|
+
|
|
96
|
+
**Invoke:** `Task` tool with `subagent_type: code-simplifier`
|
|
97
|
+
|
|
98
|
+
**Expected output:**
|
|
99
|
+
- Dead code removed
|
|
100
|
+
- Naming improved
|
|
101
|
+
- Structure simplified
|
|
102
|
+
- Magic values extracted
|
|
103
|
+
|
|
104
|
+
### 3.3 DRY Analysis
|
|
105
|
+
|
|
106
|
+
**Invoke:** `Task` tool with `subagent_type: dry-enforcer`
|
|
107
|
+
|
|
108
|
+
**Expected output:**
|
|
109
|
+
- Unused existing code that should have been used
|
|
110
|
+
- Duplications within new code
|
|
111
|
+
- Abstraction opportunities
|
|
112
|
+
|
|
113
|
+
**If issues found:** Fix before proceeding.
|
|
114
|
+
|
|
115
|
+
### 3.4 Test Fixer (VERIFICACAO)
|
|
116
|
+
|
|
117
|
+
Garantir que refatoracoes nao quebraram nada.
|
|
118
|
+
|
|
119
|
+
**Invoke:** `Task` tool with `subagent_type: test-fixer`
|
|
120
|
+
|
|
121
|
+
**Prompt:** "Rodar npm test apos refatoracoes. Corrigir testes que falharem. Criar testes faltantes para funcoes novas."
|
|
122
|
+
|
|
123
|
+
**Expected output:**
|
|
124
|
+
- All tests passing
|
|
125
|
+
- New functions have tests
|
|
126
|
+
- No skipped tests without justification
|
|
127
|
+
|
|
128
|
+
**If tests fail:** Fix before proceeding.
|
|
129
|
+
|
|
130
|
+
### 3.5 Code Review
|
|
131
|
+
|
|
132
|
+
**Invoke:** `Task` tool with `subagent_type: code-reviewer`
|
|
133
|
+
|
|
134
|
+
**Expected output:**
|
|
135
|
+
- Security issues (CRITICAL)
|
|
136
|
+
- Type safety violations (CRITICAL)
|
|
137
|
+
- Code quality issues (HIGH/MEDIUM)
|
|
138
|
+
- Environment compatibility issues
|
|
139
|
+
|
|
140
|
+
**If CRITICAL issues found:** Fix before proceeding.
|
|
141
|
+
|
|
142
|
+
### 3.6 Visual Validation (SE UI)
|
|
143
|
+
|
|
144
|
+
**Detect UI changes:**
|
|
145
|
+
```bash
|
|
146
|
+
git diff origin/main...HEAD --name-only | grep -E '\.(tsx|css|scss)$' | grep -v '\.test\.' | grep -v '\.spec\.'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**If UI files found:**
|
|
150
|
+
|
|
151
|
+
**Invoke:** `Task` tool with `subagent_type: visual-validator`
|
|
152
|
+
|
|
153
|
+
**Expected output:**
|
|
154
|
+
- All pages load without console errors
|
|
155
|
+
- Modified components render correctly
|
|
156
|
+
- Interactions work (modals open, etc.)
|
|
157
|
+
|
|
158
|
+
**Behavior:**
|
|
159
|
+
- Agent is FULLY AUTONOMOUS
|
|
160
|
+
- Starts dev server, opens headless browser
|
|
161
|
+
- Navigates to modified screens
|
|
162
|
+
- Auto-fixes errors (max 3 attempts)
|
|
163
|
+
- Only returns when working OR exhausted attempts
|
|
164
|
+
|
|
165
|
+
**If FAIL after 3 attempts:** BLOCK gate, report errors to user.
|
|
166
|
+
|
|
167
|
+
### 3.7 Environment Validation (SE env)
|
|
168
|
+
|
|
169
|
+
**Detect env changes:**
|
|
170
|
+
```bash
|
|
171
|
+
git diff origin/main...HEAD --name-only | grep -E '\.env|terraform/|\.tfvars'
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**If env/terraform files found:**
|
|
175
|
+
|
|
176
|
+
**Invoke:** `Task` tool with `subagent_type: terraform-validator`
|
|
177
|
+
|
|
178
|
+
**Expected output:**
|
|
179
|
+
- All env vars consistent across files (.env.example, variables.tf, main.tf, tfvars.example)
|
|
180
|
+
- No hardcoded paths in code
|
|
181
|
+
- Path pattern: `process.env.VAR || './default'`
|
|
182
|
+
- Auth works in both environments
|
|
183
|
+
|
|
184
|
+
**Behavior:**
|
|
185
|
+
- Agent is FULLY AUTONOMOUS
|
|
186
|
+
- Extracts variables from all config files
|
|
187
|
+
- Compares sets and identifies inconsistencies
|
|
188
|
+
- Auto-fixes missing variables in each file
|
|
189
|
+
- Searches and fixes hardcoded paths
|
|
190
|
+
- Runs `npx tsc --noEmit` to verify no errors introduced
|
|
191
|
+
|
|
192
|
+
**If FAIL:** BLOCK gate, report inconsistencies to user.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Phase 4: Agent Results Aggregation
|
|
197
|
+
|
|
198
|
+
Collect results from all agents (na ordem de execucao):
|
|
199
|
+
|
|
200
|
+
| Agent | Status | Issues Found | Fixed |
|
|
201
|
+
|-------|--------|--------------|-------|
|
|
202
|
+
| test-fixer (baseline) | PASS/FAIL | X | X |
|
|
203
|
+
| code-simplifier | PASS/FAIL | X | X |
|
|
204
|
+
| dry-enforcer | PASS/FAIL | X | X |
|
|
205
|
+
| test-fixer (verificacao) | PASS/FAIL | X | X |
|
|
206
|
+
| code-reviewer | PASS/FAIL | X | X |
|
|
207
|
+
| visual-validator | SKIP/PASS/FAIL | X | X |
|
|
208
|
+
| terraform-validator | SKIP/PASS/FAIL | X | X |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Phase 5: Final Verification
|
|
213
|
+
|
|
214
|
+
Re-run all quality gates after agent fixes:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm run test && npx tsc --noEmit && npm run build
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
All must pass before proceeding.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Phase 6: Boundaries Check
|
|
225
|
+
|
|
226
|
+
Buscar `codebase_scope` e `forbidden_paths` na memory.
|
|
227
|
+
|
|
228
|
+
- [ ] Somente arquivos dentro do escopo modificados
|
|
229
|
+
- [ ] Nenhuma mudanca em arquivos proibidos
|
|
230
|
+
|
|
231
|
+
If boundary violated, revert those changes.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Phase 7: Summary Report
|
|
236
|
+
|
|
237
|
+
Gerar relatorio consolidado:
|
|
238
|
+
|
|
239
|
+
```markdown
|
|
240
|
+
## Quality Gate Report
|
|
241
|
+
|
|
242
|
+
**Status:** PASSED / FAILED
|
|
243
|
+
**Date:** [timestamp]
|
|
244
|
+
**Branch:** [current branch]
|
|
245
|
+
**Commits:** [count] commits ahead of origin/main
|
|
246
|
+
|
|
247
|
+
### Agent Analysis Summary
|
|
248
|
+
|
|
249
|
+
| Agent | Status | Issues Found | Fixed |
|
|
250
|
+
|-------|--------|--------------|-------|
|
|
251
|
+
| test-fixer (baseline) | [PASS/FAIL] | X | X |
|
|
252
|
+
| code-simplifier | [PASS/FAIL] | X | X |
|
|
253
|
+
| dry-enforcer | [PASS/FAIL] | X | X |
|
|
254
|
+
| test-fixer (verificacao) | [PASS/FAIL] | X | X |
|
|
255
|
+
| code-reviewer | [PASS/FAIL] | X | X |
|
|
256
|
+
| visual-validator | [SKIP/PASS/FAIL] | X | X |
|
|
257
|
+
| terraform-validator | [SKIP/PASS/FAIL] | X | X |
|
|
258
|
+
|
|
259
|
+
### Quality Gates
|
|
260
|
+
|
|
261
|
+
| Gate | Status |
|
|
262
|
+
|------|--------|
|
|
263
|
+
| Tests | PASS/FAIL |
|
|
264
|
+
| TypeScript | PASS/FAIL |
|
|
265
|
+
| Build | PASS/FAIL |
|
|
266
|
+
| Boundaries | PASS/FAIL |
|
|
267
|
+
|
|
268
|
+
### Key Findings
|
|
269
|
+
|
|
270
|
+
- [List of significant issues found and fixed]
|
|
271
|
+
|
|
272
|
+
### Recommendations
|
|
273
|
+
|
|
274
|
+
- [Any manual actions needed]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Manual Fallback
|
|
280
|
+
|
|
281
|
+
If agent delegation is not working, fall back to manual checklist:
|
|
282
|
+
|
|
283
|
+
<details>
|
|
284
|
+
<summary>Manual Security Scan</summary>
|
|
285
|
+
|
|
286
|
+
| Vulnerability | Pattern | Action |
|
|
287
|
+
|--------------|---------|--------|
|
|
288
|
+
| Hardcoded Secrets | API keys, tokens in code | Move to env var |
|
|
289
|
+
| `eval()` usage | `eval()`, `new Function()` | Remove or replace |
|
|
290
|
+
| Command Injection | `child_process.exec()` with vars | Use `execFile()` |
|
|
291
|
+
| Sensitive Logs | Passwords, tokens in `console.log` | Remove or redact |
|
|
292
|
+
|
|
293
|
+
</details>
|
|
294
|
+
|
|
295
|
+
<details>
|
|
296
|
+
<summary>Manual Code Cleanup</summary>
|
|
297
|
+
|
|
298
|
+
- [ ] Delete unused imports
|
|
299
|
+
- [ ] Delete unused variables
|
|
300
|
+
- [ ] Delete commented-out code
|
|
301
|
+
- [ ] Rename generic variables
|
|
302
|
+
- [ ] Functions < 50 lines
|
|
303
|
+
- [ ] Nesting < 3 levels
|
|
304
|
+
|
|
305
|
+
</details>
|
|
306
|
+
|
|
307
|
+
<details>
|
|
308
|
+
<summary>Manual DRY Check</summary>
|
|
309
|
+
|
|
310
|
+
- [ ] Checked existing helpers before creating new?
|
|
311
|
+
- [ ] No duplicated functionality?
|
|
312
|
+
|
|
313
|
+
</details>
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kakaroto-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Claude Code configuration by Pedro Jahara - autonomous workflows for /feature, /debug, /gate",
|
|
5
|
+
"bin": {
|
|
6
|
+
"kakaroto-config": "./bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"config"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"claude",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"anthropic",
|
|
16
|
+
"ai",
|
|
17
|
+
"config",
|
|
18
|
+
"workflow"
|
|
19
|
+
],
|
|
20
|
+
"author": "Pedro Jahara",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/pedrojahara/kakaroto-config"
|
|
25
|
+
}
|
|
26
|
+
}
|