kakaroto-config 1.0.0 → 1.0.2
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 +122 -16
- package/bin/install.js +27 -5
- package/bin/release.js +255 -0
- package/config/ARCHITECTURE.md +3 -1
- package/config/CLAUDE.md +4 -0
- package/config/agents/memory-sync.md +87 -19
- package/config/agents/test-fixer.md +24 -0
- package/config/agents/visual-validator.md +17 -0
- package/config/commands/debug/01-reproduce.md +120 -0
- package/config/commands/debug/02-investigate.md +93 -0
- package/config/commands/debug/03-fix.md +110 -0
- package/config/commands/debug/04-verify.md +155 -0
- package/config/commands/debug/05-commit.md +106 -0
- package/config/commands/debug/06-evaluate.md +137 -0
- package/config/commands/debug/playbooks/api.md +21 -0
- package/config/commands/debug/playbooks/backend.md +19 -0
- package/config/commands/debug/playbooks/infra.md +130 -0
- package/config/commands/debug/playbooks/integration.md +16 -0
- package/config/commands/debug/playbooks/job.md +19 -0
- package/config/commands/debug/playbooks/test.md +14 -0
- package/config/commands/debug/playbooks/ui.md +24 -0
- package/config/commands/debug/self-healing.md +99 -0
- package/config/commands/debug/techniques/flow-tracing.md +75 -0
- package/config/commands/debug/techniques/hypothesis-generation.md +30 -0
- package/config/commands/debug/techniques/sequential-thinking-config.md +79 -0
- package/config/commands/debug/templates/diagnosis-script.md +72 -0
- package/config/commands/debug/templates/reproduction-doc.md +60 -0
- package/config/commands/debug/templates/root-cause-doc.md +46 -0
- package/config/commands/debug/validators/criticality-gate.md +40 -0
- package/config/commands/debug/validators/evidence-requirements.md +48 -0
- package/config/commands/debug/validators/fix-permanence.md +56 -0
- package/config/commands/debug/validators/root-cause-validation.md +50 -0
- package/config/commands/debug.md +3 -3
- package/config/commands/feature/01-interview.md +82 -90
- package/config/commands/feature/02-spec.md +22 -98
- package/config/commands/feature/03-planner.md +81 -4
- package/config/commands/feature/04-implement.md +15 -8
- package/config/commands/feature/05-quality.md +23 -5
- package/config/commands/feature/06-commit.md +91 -0
- package/config/commands/feature/07-evaluate.md +129 -0
- package/config/commands/feature.md +1 -7
- package/config/templates/spec-template.md +92 -0
- package/package.json +4 -1
- package/config/commands/debug/01-investigate.md +0 -119
- package/config/commands/debug/02-fix.md +0 -108
- package/config/commands/debug/03-verify.md +0 -66
|
@@ -138,6 +138,23 @@ For each modified component file:
|
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
141
|
+
### 6.5 Form Submit Test (SE form modificado)
|
|
142
|
+
|
|
143
|
+
**Trigger:** Arquivo `*FormModal.tsx` ou `*Form.tsx` modificado.
|
|
144
|
+
|
|
145
|
+
1. Identificar forms modificados via git diff
|
|
146
|
+
2. Navegar ao form (browser_navigate)
|
|
147
|
+
3. Preencher campos com dados válidos (browser_fill_form)
|
|
148
|
+
4. Clicar submit
|
|
149
|
+
5. Verificar:
|
|
150
|
+
- Sem erros de console
|
|
151
|
+
- Toast/mensagem de sucesso aparece
|
|
152
|
+
- Modal fecha ou redireciona
|
|
153
|
+
|
|
154
|
+
**Nota:** Step condicional. Só executar se form de criação/edição foi modificado.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
141
158
|
### 7. Fix Loop (Max 3 Attempts)
|
|
142
159
|
|
|
143
160
|
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Fase 1: Reproduce
|
|
2
|
+
|
|
3
|
+
Responsabilidade: **ONDE** esta o bug + **COMO** reproduzir + **EVIDENCIA** concreta
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Passo 1: Triage
|
|
8
|
+
|
|
9
|
+
Classificar o bug por keywords em $ARGUMENTS:
|
|
10
|
+
|
|
11
|
+
| Categoria | Keywords |
|
|
12
|
+
|-----------|----------|
|
|
13
|
+
| Backend/Service | service, funcao, null, undefined, dados, firestore, db, retorna |
|
|
14
|
+
| API/Endpoint | endpoint, API, request, response, 4xx, 5xx, validation, handler |
|
|
15
|
+
| UI/Frontend | UI, componente, renderiza, tela, botao, estado, react, tsx |
|
|
16
|
+
| Job/Cron | job, cron, schedule, nao executou, analytics, executor |
|
|
17
|
+
| Integration | credencial, token, auth, OAuth, secret, API externa |
|
|
18
|
+
| Test | teste, test, falha, assertion, mock, spec |
|
|
19
|
+
| Infra/Deploy | VM, startup, env, terraform, deploy, container, docker, GCP, faltando |
|
|
20
|
+
|
|
21
|
+
**SE** nenhuma keyword match → Default: **Backend/Service**
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
TRIAGE:
|
|
25
|
+
Keywords encontradas: [...]
|
|
26
|
+
Categoria: [Backend/API/UI/Job/Integration/Test/Infra]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Passo 2: Carregar Contexto
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
mcp__memory__search_nodes({ query: "config" })
|
|
35
|
+
mcp__memory__search_nodes({ query: "<termos-do-bug>" })
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Passo 3: Contexto Rapido
|
|
41
|
+
|
|
42
|
+
### 3.1 Logs de Producao
|
|
43
|
+
|
|
44
|
+
**SE** `.claude/debug-logs.json` existe e `enabled=true`:
|
|
45
|
+
```bash
|
|
46
|
+
{valor de commands.quick}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3.2 Exploracao Basica
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Grep: termos do bug em services/, api/, cron/, components/
|
|
53
|
+
Glob: arquivos com nomes relacionados
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
LOCALIZACAO:
|
|
58
|
+
Arquivos candidatos: [arquivo1.ts, arquivo2.ts]
|
|
59
|
+
Funcoes suspeitas: [funcao1(), funcao2()]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Passo 4: Executar Playbook
|
|
65
|
+
|
|
66
|
+
ACAO: Read ~/.claude/commands/debug/playbooks/{categoria}.md
|
|
67
|
+
|
|
68
|
+
| Categoria | Playbook |
|
|
69
|
+
|-----------|----------|
|
|
70
|
+
| Backend/Service | backend.md |
|
|
71
|
+
| API/Endpoint | api.md |
|
|
72
|
+
| UI/Frontend | ui.md |
|
|
73
|
+
| Job/Cron | job.md |
|
|
74
|
+
| Integration | integration.md |
|
|
75
|
+
| Test | test.md |
|
|
76
|
+
| Infra/Deploy | infra.md |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Passo 5: Criar Artefato
|
|
81
|
+
|
|
82
|
+
ACAO: Read ~/.claude/commands/debug/templates/diagnosis-script.md
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Passo 6: Gate de Reproducao
|
|
87
|
+
|
|
88
|
+
ACAO: Read ~/.claude/commands/debug/validators/evidence-requirements.md
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Passo 7: Persistir Reproducao
|
|
93
|
+
|
|
94
|
+
ACAO: Read ~/.claude/commands/debug/templates/reproduction-doc.md
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Passo 8: Checkpoint
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
TodoWrite({
|
|
102
|
+
todos: [
|
|
103
|
+
{ content: "Reproduce: triage + playbook", status: "completed", activeForm: "Bug triaged" },
|
|
104
|
+
{ content: "Reproduce: artefato + evidencia", status: "completed", activeForm: "Evidence collected" },
|
|
105
|
+
{ content: "Investigate: analisar causa raiz", status: "pending", activeForm: "Analyzing root cause" }
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Output
|
|
113
|
+
|
|
114
|
+
Bug reproduzido com evidencia em `.claude/debug/reproduction.md`.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## PROXIMA FASE
|
|
119
|
+
|
|
120
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/debug/02-investigate.md
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Fase 2: Investigate
|
|
2
|
+
|
|
3
|
+
Responsabilidade: **POR QUE** o bug acontece + **CAUSA RAIZ**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Principio
|
|
8
|
+
|
|
9
|
+
> Fixes corrigem LOGICA, nao filtram SINTOMAS.
|
|
10
|
+
> Antes de propor FILTRO/IGNORE: por que o erro e gerado em primeiro lugar?
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Passo 1: Context
|
|
15
|
+
|
|
16
|
+
**SE** continuacao direta de 01-reproduce: Contexto ja disponivel.
|
|
17
|
+
**SE** retomando sessao: `Read .claude/debug/reproduction.md`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Passo 2: Explorar Codigo
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Grep: termos do bug
|
|
25
|
+
Glob: arquivos com nomes relacionados
|
|
26
|
+
git log --oneline --grep="fix" -- [arquivos suspeitos]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Identificar:
|
|
30
|
+
- Arquivos/funcoes envolvidos
|
|
31
|
+
- Como erros sao tratados nesta area
|
|
32
|
+
- Ha validacao que deveria existir?
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Passo 3: Rastreamento de Fluxo
|
|
37
|
+
|
|
38
|
+
**SE** bug envolve dados incorretos (null, undefined, formato invalido):
|
|
39
|
+
|
|
40
|
+
ACAO: Read ~/.claude/commands/debug/techniques/flow-tracing.md
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Passo 4: Geracao de Hipoteses
|
|
45
|
+
|
|
46
|
+
ACAO: Read ~/.claude/commands/debug/techniques/hypothesis-generation.md
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Passo 5: Sequential Thinking
|
|
51
|
+
|
|
52
|
+
ACAO: Read ~/.claude/commands/debug/techniques/sequential-thinking-config.md
|
|
53
|
+
|
|
54
|
+
**SE** categoria = Infra/Deploy:
|
|
55
|
+
Consultar secao "Fase: Investigate" em playbooks/infra.md
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Passo 6: Validar Causa Raiz
|
|
60
|
+
|
|
61
|
+
ACAO: Read ~/.claude/commands/debug/validators/root-cause-validation.md
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Passo 7: Documentar Causa Raiz
|
|
66
|
+
|
|
67
|
+
ACAO: Read ~/.claude/commands/debug/templates/root-cause-doc.md
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Passo 8: Checkpoint
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
TodoWrite({
|
|
75
|
+
todos: [
|
|
76
|
+
{ content: "Reproduce: bug reproduzido", status: "completed", activeForm: "Bug reproduced" },
|
|
77
|
+
{ content: "Investigate: causa raiz validada", status: "completed", activeForm: "Root cause validated" },
|
|
78
|
+
{ content: "Fix: implementar correcao", status: "pending", activeForm: "Implementing fix" }
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Output
|
|
86
|
+
|
|
87
|
+
Causa raiz documentada em `.claude/debug/root-cause.md`.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## PROXIMA FASE
|
|
92
|
+
|
|
93
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/debug/03-fix.md
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Fase 3: Fix
|
|
2
|
+
|
|
3
|
+
Responsabilidade: Implementar fix de forma AUTONOMA.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Passo 1: Validacao Pre-Fix
|
|
8
|
+
|
|
9
|
+
### 1.1 Revisao da Categorizacao
|
|
10
|
+
|
|
11
|
+
Na fase Investigate voce categorizou seu fix como:
|
|
12
|
+
- [ ] CORRECAO DE LOGICA → Prossiga
|
|
13
|
+
- [ ] FILTRO/IGNORE → **PARE!** Volte para Investigate
|
|
14
|
+
- [ ] WORKAROUND → **PARE!** Volte para Investigate
|
|
15
|
+
|
|
16
|
+
### 1.2 Gate para FILTRO/IGNORE
|
|
17
|
+
|
|
18
|
+
**SE** fix envolve adicionar a lista de ignore/skip/filter:
|
|
19
|
+
1. Por que o erro esta sendo gerado em primeiro lugar?
|
|
20
|
+
2. Esse padrao pode aparecer em erros legitimos?
|
|
21
|
+
3. Existe forma de corrigir a logica em vez de filtrar?
|
|
22
|
+
|
|
23
|
+
**SE nao conseguir justificar**: Volte para 02-investigate.md
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Passo 2: Gate de Criticidade
|
|
28
|
+
|
|
29
|
+
ACAO: Read ~/.claude/commands/debug/validators/criticality-gate.md
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Passo 3: Gate de Permanencia
|
|
34
|
+
|
|
35
|
+
ACAO: Read ~/.claude/commands/debug/validators/fix-permanence.md
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Passo 4: Teste de Regressao
|
|
40
|
+
|
|
41
|
+
### 4.1 Criar Teste que Reproduz o Bug
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
describe('[contexto do bug]', () => {
|
|
45
|
+
it('should [comportamento esperado]', () => {
|
|
46
|
+
// Arrange: setup que causa o bug
|
|
47
|
+
// Act: acao que dispara o bug
|
|
48
|
+
// Assert: verificar comportamento correto
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4.2 Verificar que Teste FALHA
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm test -- --testPathPattern="[arquivo]"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
O teste DEVE falhar antes do fix. Se passar, o teste nao reproduz o bug.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Passo 5: Implementar Fix
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
FIX:
|
|
67
|
+
Arquivo: [arquivo:linha]
|
|
68
|
+
Antes: [codigo atual]
|
|
69
|
+
Depois: [codigo novo]
|
|
70
|
+
Justificativa: [por que resolve a causa raiz]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Regras:
|
|
74
|
+
- APENAS o necessario para resolver a causa raiz
|
|
75
|
+
- NAO refatorar codigo nao relacionado
|
|
76
|
+
- Seguir patterns existentes do projeto
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Passo 6: Verificar Fix
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm test -- --testPathPattern="[arquivo]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Passo 7: Checkpoint
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
TodoWrite({
|
|
92
|
+
todos: [
|
|
93
|
+
{ content: "Investigate: causa raiz identificada", status: "completed", activeForm: "Root cause identified" },
|
|
94
|
+
{ content: "Fix: teste + correcao implementada", status: "completed", activeForm: "Fix implemented" },
|
|
95
|
+
{ content: "Verify: validar quality gates", status: "pending", activeForm: "Validating quality gates" }
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Output
|
|
103
|
+
|
|
104
|
+
Fix implementado. Teste de regressao passando.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## PROXIMA FASE
|
|
109
|
+
|
|
110
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/debug/04-verify.md
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Fase 4: Verify
|
|
2
|
+
|
|
3
|
+
Responsabilidade: Verificar e finalizar de forma AUTONOMA.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Passo 1: Quality Gates
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm test && npx tsc --noEmit && npm run build
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Se falhar:** ACAO: Read ~/.claude/commands/debug/self-healing.md
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Passo 2: Re-executar Reproducao
|
|
18
|
+
|
|
19
|
+
O script de debug DEVE ser re-executado para confirmar resolucao.
|
|
20
|
+
|
|
21
|
+
### 2.1 Executar Script
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx tsx scripts/debug-{nome-do-bug}.ts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**SE** script nao existe: `ls scripts/debug-*.ts` e executar mais recente.
|
|
28
|
+
|
|
29
|
+
### 2.2 Comparacao de Output
|
|
30
|
+
|
|
31
|
+
| Momento | Output |
|
|
32
|
+
|---------|--------|
|
|
33
|
+
| **ANTES** (de `.claude/debug/reproduction.md`) | [output original] |
|
|
34
|
+
| **DEPOIS** | [output atual] |
|
|
35
|
+
|
|
36
|
+
### 2.3 Decision Gate
|
|
37
|
+
|
|
38
|
+
**SE** output ainda mostra bug:
|
|
39
|
+
- Fix NAO resolveu a causa raiz
|
|
40
|
+
- ACAO: Read ~/.claude/commands/debug/self-healing.md
|
|
41
|
+
|
|
42
|
+
**SE** bug resolvido:
|
|
43
|
+
- **SE** categoria = Infra/Deploy: Consultar playbooks/infra.md
|
|
44
|
+
- **SENAO**: Prosseguir para 2.4
|
|
45
|
+
|
|
46
|
+
### 2.4 Converter Script em Teste de Regressao (se aplicavel)
|
|
47
|
+
|
|
48
|
+
**SE** script retornou 0 (bug ausente) E arquivo modificado em `cron/`, `services/`, `api/`, `utils/`:
|
|
49
|
+
|
|
50
|
+
1. Identificar arquivo de teste destino:
|
|
51
|
+
```
|
|
52
|
+
services/foo.ts → services/foo.test.ts
|
|
53
|
+
cron/bar.ts → cron/bar.test.ts (ou criar)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. Converter estrutura do script:
|
|
57
|
+
```
|
|
58
|
+
diagnose() → describe('regression: {bug}')
|
|
59
|
+
// 1. Setup → beforeEach ou inline
|
|
60
|
+
// 2. Reproducao → it('should {comportamento correto}', ...)
|
|
61
|
+
// 3. Verificacao → expect(...).toBe(...)
|
|
62
|
+
bugPresente ? 1 : 0 → expect(bugPresente).toBe(false)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. Adicionar ao arquivo de teste:
|
|
66
|
+
```typescript
|
|
67
|
+
describe('regression: {descricao-do-bug}', () => {
|
|
68
|
+
it('should {comportamento correto apos fix}', async () => {
|
|
69
|
+
// [codigo adaptado do script de debug]
|
|
70
|
+
expect(resultado).toBe(esperado);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
4. Validar: `npm test -- --filter="{arquivo}"`
|
|
76
|
+
|
|
77
|
+
**SE** bug NAO e testavel automaticamente (UI, Infra, Config):
|
|
78
|
+
- Pular conversao, apenas documentar em reproduction.md
|
|
79
|
+
|
|
80
|
+
**NOTA:** A conversao e recomendada, nao obrigatoria. Usar julgamento.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Passo 3: Memory Sync (se bug nao-obvio)
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
mcp__memory__create_entities({
|
|
88
|
+
entities: [{
|
|
89
|
+
name: "{prefix}:bug:{nome-descritivo}",
|
|
90
|
+
entityType: "bug",
|
|
91
|
+
observations: ["Sintoma: [...]", "Causa raiz: [...]", "Solucao: [...]"]
|
|
92
|
+
}]
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Passo 4: Cleanup
|
|
99
|
+
|
|
100
|
+
### 4.1 Script de Debug
|
|
101
|
+
|
|
102
|
+
**SE** script foi convertido em teste (2.4):
|
|
103
|
+
```bash
|
|
104
|
+
rm scripts/debug-{nome-do-bug}.ts # Codigo ja esta no teste
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**SE** script NAO foi convertido (bug nao-testavel):
|
|
108
|
+
```bash
|
|
109
|
+
rm scripts/debug-{nome-do-bug}.ts # Documentacao fica em reproduction.md
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 4.2 Manter Documentacao
|
|
113
|
+
|
|
114
|
+
NAO deletar:
|
|
115
|
+
- `.claude/debug/reproduction.md`
|
|
116
|
+
- `.claude/debug/root-cause.md`
|
|
117
|
+
|
|
118
|
+
### 4.3 Verificar Git Status
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
git status
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**SE** teste de regressao foi criado: deve aparecer arquivo novo ou modificado
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Passo 5: Checkpoint
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
TodoWrite({
|
|
132
|
+
todos: [
|
|
133
|
+
{ content: "Fix: correcao implementada", status: "completed", activeForm: "Fix implemented" },
|
|
134
|
+
{ content: "Verify: quality gates + bug confirmado", status: "completed", activeForm: "Verified" },
|
|
135
|
+
{ content: "Verify: teste de regressao (se aplicavel)", status: "completed", activeForm: "Regression test checked" },
|
|
136
|
+
{ content: "Verify: cleanup feito", status: "completed", activeForm: "Cleanup done" },
|
|
137
|
+
{ content: "Commit: commitar e push", status: "pending", activeForm: "Committing" }
|
|
138
|
+
]
|
|
139
|
+
})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Regras Inviolaveis
|
|
145
|
+
|
|
146
|
+
1. PROIBIDO prosseguir com testes/build falhando
|
|
147
|
+
2. PROIBIDO prosseguir sem re-executar script
|
|
148
|
+
3. PROIBIDO mais de 3 tentativas no self-healing
|
|
149
|
+
4. PROIBIDO deixar script de debug em scripts/ (converter para teste ou deletar)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## PROXIMA FASE
|
|
154
|
+
|
|
155
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/debug/05-commit.md
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Fase 5: Commit & Push
|
|
2
|
+
|
|
3
|
+
## Contexto
|
|
4
|
+
Bug resolvido, verify passou. Commitar e fazer push de forma AUTONOMA.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Passo 1: Verificar Mudancas
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
git status
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Se nao houver mudancas:** Reportar "Nada a commitar" → FIM
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Passo 2: Commit
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git add -A
|
|
22
|
+
git commit -m "$(cat <<'EOF'
|
|
23
|
+
fix: {descricao do bug resolvido em ingles}
|
|
24
|
+
|
|
25
|
+
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
26
|
+
EOF
|
|
27
|
+
)"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Sempre prefixo `fix:`** - workflow e de debug.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Passo 3: Push
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git push
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Se falhar:** Reportar erro ao user.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Passo 4: Memory Sync
|
|
45
|
+
|
|
46
|
+
Sincronizar conhecimento adquirido durante debug (NÃO bugs - esses são efêmeros).
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
Task({
|
|
50
|
+
subagent_type: "memory-sync",
|
|
51
|
+
prompt: "Sincronizar knowledge graph após debug. IMPORTANTE: NÃO salvar o bug em si. Salvar apenas: patterns descobertos, fluxos entendidos, procedimentos documentados, decisões arquiteturais. Se nenhum conhecimento novo significativo foi adquirido, reportar 'Sem alterações'.",
|
|
52
|
+
description: "Sync memory graph"
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**O que salvar:**
|
|
57
|
+
- Pattern novo descoberto durante investigação
|
|
58
|
+
- Fluxo complexo que levou tempo entender
|
|
59
|
+
- Procedimento de debug que pode ser reutilizado
|
|
60
|
+
|
|
61
|
+
**O que NÃO salvar:**
|
|
62
|
+
- O bug em si (fix está no código)
|
|
63
|
+
- Detalhes específicos do erro
|
|
64
|
+
- Stack traces ou logs
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Passo 5: Checkpoint Final
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
TodoWrite({
|
|
72
|
+
todos: [
|
|
73
|
+
{ content: "Reproduce: bug reproduzido", status: "completed", activeForm: "Bug reproduced" },
|
|
74
|
+
{ content: "Investigate: causa raiz identificada", status: "completed", activeForm: "Root cause identified" },
|
|
75
|
+
{ content: "Fix: correcao implementada", status: "completed", activeForm: "Fix implemented" },
|
|
76
|
+
{ content: "Verify: quality gates passando", status: "completed", activeForm: "Quality gates passed" },
|
|
77
|
+
{ content: "Commit: commitado e pushed", status: "completed", activeForm: "Committed and pushed" },
|
|
78
|
+
{ content: "Memory: conhecimento sincronizado", status: "completed", activeForm: "Knowledge synced" }
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Passo 6: Confirmar
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git log --oneline -1
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Reportar ao user: fix commitado e pushed.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Regras
|
|
96
|
+
|
|
97
|
+
1. **1 fix = 1 commit**
|
|
98
|
+
2. **Sempre `fix:` como prefixo**
|
|
99
|
+
3. **Mensagem em ingles**
|
|
100
|
+
4. **NUNCA** --force push
|
|
101
|
+
5. **NUNCA** commitar se verify falhou
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## PROXIMA FASE
|
|
106
|
+
ACAO OBRIGATORIA: Read ~/.claude/commands/debug/06-evaluate.md
|