kakaroto-config 1.0.1 → 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/bin/release.js +255 -0
- package/config/ARCHITECTURE.md +20 -26
- 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 +65 -63
- package/config/commands/debug/02-investigate.md +40 -34
- package/config/commands/debug/03-fix.md +32 -45
- package/config/commands/debug/04-verify.md +108 -34
- package/config/commands/debug/05-commit.md +33 -3
- 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 +1 -1
- 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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Tecnica: Sequential Thinking para Causa Raiz
|
|
2
|
+
|
|
3
|
+
**OBRIGATORIO**: Usar `mcp__sequential-thinking__sequentialthinking` para analise profunda.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Configuracao Inicial
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
mcp__sequential-thinking__sequentialthinking({
|
|
11
|
+
thought: "[hipotese inicial baseada em evidencias]",
|
|
12
|
+
nextThoughtNeeded: true,
|
|
13
|
+
thoughtNumber: 1,
|
|
14
|
+
totalThoughts: 8 // MINIMO 8 thoughts
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Regras para Cada Thought
|
|
21
|
+
|
|
22
|
+
Cada thought DEVE conter:
|
|
23
|
+
|
|
24
|
+
1. **Hipotese especifica**: "Acredito que o bug acontece porque..."
|
|
25
|
+
2. **Busca de evidencia**: Usar Grep/Read para encontrar arquivo:linha
|
|
26
|
+
3. **Avaliacao**: A evidencia suporta ou refuta a hipotese?
|
|
27
|
+
4. **Proxima acao**:
|
|
28
|
+
- SE suporta: Ir mais fundo ("Por que isso acontece?")
|
|
29
|
+
- SE refuta: Marcar `isRevision: true` e tentar alternativa
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Parametros Especiais
|
|
34
|
+
|
|
35
|
+
| Parametro | Quando Usar |
|
|
36
|
+
|-----------|-------------|
|
|
37
|
+
| `isRevision: true` | Quando descartando hipotese anterior |
|
|
38
|
+
| `revisesThought: N` | Indicar qual thought esta sendo revisado |
|
|
39
|
+
| `branchFromThought: N` | Quando explorando caminho alternativo |
|
|
40
|
+
| `branchId: "hipotese-2"` | Identificar o branch atual |
|
|
41
|
+
| `needsMoreThoughts: true` | Se precisa ir mais fundo |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Criterios de Parada
|
|
46
|
+
|
|
47
|
+
Somente definir `nextThoughtNeeded: false` quando:
|
|
48
|
+
|
|
49
|
+
- [ ] Chegou em algo que PODE SER MUDADO no codigo
|
|
50
|
+
- [ ] Tem EVIDENCIA concreta (arquivo:linha + codigo)
|
|
51
|
+
- [ ] Nao ha mais "por que?" logico para perguntar
|
|
52
|
+
- [ ] A causa identificada explica TODOS os sintomas
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Exemplo de Fluxo
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Thought 1: "Hipotese: erro em validateInput()"
|
|
60
|
+
→ Grep encontra validacao em services/videoService.ts:45
|
|
61
|
+
→ Evidencia: funcao nao valida campo X
|
|
62
|
+
|
|
63
|
+
Thought 2: "Por que nao valida campo X?"
|
|
64
|
+
→ Read services/videoService.ts
|
|
65
|
+
→ Evidencia: schema Zod nao inclui X (linha 12)
|
|
66
|
+
|
|
67
|
+
Thought 3: "Por que schema nao inclui X?"
|
|
68
|
+
→ git log mostra: adicionado em commit abc123
|
|
69
|
+
→ Evidencia: campo X e novo, schema desatualizado
|
|
70
|
+
|
|
71
|
+
Thought 4 (isRevision=true): "Mas wait, X deveria ser opcional..."
|
|
72
|
+
→ Re-analisando: o problema e que X e required no destino
|
|
73
|
+
|
|
74
|
+
Thought 5: "Onde X e required?"
|
|
75
|
+
→ Grep encontra em api/handlers/upload.ts:78
|
|
76
|
+
→ Evidencia: handler espera X mas nao recebe
|
|
77
|
+
|
|
78
|
+
... continua ate causa raiz confirmada ...
|
|
79
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Template: Script de Diagnostico
|
|
2
|
+
|
|
3
|
+
Para bugs Backend/API/Job/Integration, criar `scripts/debug-{descricao}.ts`.
|
|
4
|
+
|
|
5
|
+
**Exit codes:**
|
|
6
|
+
- 0: Bug NAO presente (comportamento correto)
|
|
7
|
+
- 1: Bug PRESENTE (comportamento incorreto)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Template
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
#!/usr/bin/env npx tsx
|
|
15
|
+
/**
|
|
16
|
+
* Diagnostico: {descricao do bug}
|
|
17
|
+
* Bug: {$ARGUMENTS}
|
|
18
|
+
* Data: {timestamp}
|
|
19
|
+
*/
|
|
20
|
+
import { config } from 'dotenv';
|
|
21
|
+
config();
|
|
22
|
+
|
|
23
|
+
async function diagnose(): Promise<boolean> {
|
|
24
|
+
console.log('='.repeat(60));
|
|
25
|
+
console.log('DIAGNOSTICO: {nome}');
|
|
26
|
+
console.log('='.repeat(60));
|
|
27
|
+
console.log('');
|
|
28
|
+
|
|
29
|
+
// 1. Setup
|
|
30
|
+
console.log('1. Setup...');
|
|
31
|
+
// [codigo de setup]
|
|
32
|
+
|
|
33
|
+
// 2. Reproducao
|
|
34
|
+
console.log('');
|
|
35
|
+
console.log('2. Reproduzindo cenario...');
|
|
36
|
+
// [codigo que reproduz o cenario do bug]
|
|
37
|
+
|
|
38
|
+
// 3. Verificacao
|
|
39
|
+
console.log('');
|
|
40
|
+
console.log('3. Verificando resultado...');
|
|
41
|
+
// [verificar se resultado esta correto]
|
|
42
|
+
|
|
43
|
+
const resultado = /* valor obtido */;
|
|
44
|
+
const esperado = /* valor esperado */;
|
|
45
|
+
const bugPresente = resultado !== esperado;
|
|
46
|
+
|
|
47
|
+
// 4. Resultado
|
|
48
|
+
console.log('');
|
|
49
|
+
console.log('='.repeat(60));
|
|
50
|
+
console.log('RESULTADO');
|
|
51
|
+
console.log('='.repeat(60));
|
|
52
|
+
console.log('Esperado:', esperado);
|
|
53
|
+
console.log('Obtido:', resultado);
|
|
54
|
+
console.log('Bug presente:', bugPresente ? 'SIM' : 'NAO');
|
|
55
|
+
|
|
56
|
+
return bugPresente;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
diagnose()
|
|
60
|
+
.then(bugPresente => process.exit(bugPresente ? 1 : 0))
|
|
61
|
+
.catch(err => {
|
|
62
|
+
console.error('Erro fatal:', err);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Artefatos Alternativos
|
|
70
|
+
|
|
71
|
+
**Para UI:** screenshot + snapshot do Playwright
|
|
72
|
+
**Para Test:** output do npm test com stack trace
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Template: Documentacao de Reproducao
|
|
2
|
+
|
|
3
|
+
Salvar em `.claude/debug/reproduction.md`.
|
|
4
|
+
|
|
5
|
+
**O output original DEVE ser salvo na integra para comparacao em 04-verify.**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Template
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Reproducao: {descricao curta do bug}
|
|
13
|
+
|
|
14
|
+
**Data:** {timestamp}
|
|
15
|
+
**Bug:** {$ARGUMENTS}
|
|
16
|
+
|
|
17
|
+
## Triage
|
|
18
|
+
- Keywords: {lista}
|
|
19
|
+
- Categoria: {categoria}
|
|
20
|
+
|
|
21
|
+
## Contexto
|
|
22
|
+
- Logs de producao: {sim/nao}
|
|
23
|
+
- Arquivos identificados: {lista}
|
|
24
|
+
|
|
25
|
+
## Reproducao
|
|
26
|
+
- Playbook: {backend/api/ui/job/integration/test/infra}
|
|
27
|
+
- Artefato: {path do script ou screenshot}
|
|
28
|
+
- Exit code: {0 ou 1}
|
|
29
|
+
|
|
30
|
+
### Passos Executados
|
|
31
|
+
1. {passo}
|
|
32
|
+
2. {passo}
|
|
33
|
+
|
|
34
|
+
### Input
|
|
35
|
+
{dados de entrada}
|
|
36
|
+
|
|
37
|
+
### Output Esperado
|
|
38
|
+
{o que deveria acontecer}
|
|
39
|
+
|
|
40
|
+
### Output Real (EVIDENCIA) - SALVAR NA INTEGRA
|
|
41
|
+
|
|
42
|
+
\`\`\`
|
|
43
|
+
{COPIAR OUTPUT COMPLETO DO SCRIPT AQUI}
|
|
44
|
+
{Este output sera comparado em 04-verify}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
### Exit Code Original
|
|
48
|
+
- **Exit code:** {0 ou 1}
|
|
49
|
+
- **Bug presente:** {SIM ou NAO}
|
|
50
|
+
|
|
51
|
+
## Observacoes
|
|
52
|
+
{hipoteses formadas durante reproducao}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Nota para 04-verify
|
|
58
|
+
|
|
59
|
+
O output acima sera comparado com re-execucao do script.
|
|
60
|
+
Se mudar de "Bug presente: SIM" para "NAO", o fix funcionou.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Template: Documentacao de Causa Raiz
|
|
2
|
+
|
|
3
|
+
Criar arquivo `.claude/debug/root-cause.md`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
# Causa Raiz: {descricao curta}
|
|
11
|
+
|
|
12
|
+
**Data:** {timestamp}
|
|
13
|
+
**Bug:** {referencia a reproduction.md}
|
|
14
|
+
|
|
15
|
+
## Classificacao do Fluxo
|
|
16
|
+
- [ ] ORIGEM / [ ] TRANSFORMACAO / [ ] USO
|
|
17
|
+
|
|
18
|
+
## Hipoteses Testadas
|
|
19
|
+
| # | Hipotese | Resultado | Evidencia |
|
|
20
|
+
|---|----------|-----------|-----------|
|
|
21
|
+
| 1 | [causa A] | Refutada | [por que] |
|
|
22
|
+
| 2 | [causa B] | CONFIRMADA | arquivo:linha |
|
|
23
|
+
|
|
24
|
+
## Causa Raiz
|
|
25
|
+
**Arquivo:** {path}
|
|
26
|
+
**Linha:** {numero}
|
|
27
|
+
**Codigo Atual:**
|
|
28
|
+
\`\`\`typescript
|
|
29
|
+
{codigo problematico}
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
**Problema:** {explicacao clara}
|
|
33
|
+
|
|
34
|
+
## Fix Proposto
|
|
35
|
+
**Tipo:** CORRECAO DE LOGICA / FILTRO / WORKAROUND
|
|
36
|
+
**Codigo Novo:**
|
|
37
|
+
\`\`\`typescript
|
|
38
|
+
{codigo corrigido}
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
## Validacao
|
|
42
|
+
- [x] Pode ser mudado no codigo
|
|
43
|
+
- [x] Suportada por evidencia
|
|
44
|
+
- [x] Explica todos os sintomas
|
|
45
|
+
- [x] Resolve causa, nao esconde sintoma
|
|
46
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Validator: Criticality Gate
|
|
2
|
+
|
|
3
|
+
Gate de criticidade - paths criticos requerem aprovacao.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Lista de Paths Criticos
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
PATHS_CRITICOS:
|
|
11
|
+
- **/auth/**
|
|
12
|
+
- **/payment/**
|
|
13
|
+
- **/migration*/**
|
|
14
|
+
- **/oauth*
|
|
15
|
+
- **/credential*
|
|
16
|
+
- **/secret*
|
|
17
|
+
- api/middleware.ts
|
|
18
|
+
- services/*Service.ts (core services)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Decision Gate
|
|
24
|
+
|
|
25
|
+
**SE** arquivos afetados ∩ PATHS_CRITICOS **nao vazio**:
|
|
26
|
+
|
|
27
|
+
1. Documentar fix planejado:
|
|
28
|
+
- Causa raiz (com evidencia)
|
|
29
|
+
- Arquivos a modificar
|
|
30
|
+
- Mudancas propostas
|
|
31
|
+
- Riscos identificados
|
|
32
|
+
|
|
33
|
+
2. Chamar `EnterPlanMode`
|
|
34
|
+
- Escrever plano de fix em `.claude/plans/debug-fix-{timestamp}.md`
|
|
35
|
+
- User aprova ou rejeita via ExitPlanMode
|
|
36
|
+
|
|
37
|
+
3. Apos aprovacao: Prosseguir para implementacao
|
|
38
|
+
|
|
39
|
+
**SENAO** (nao critico):
|
|
40
|
+
Prosseguir direto para implementacao (autonomia total)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Validator: Evidence Requirements
|
|
2
|
+
|
|
3
|
+
Gate de reproducao - criterios de evidencia por categoria.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Criterios de Evidencia por Categoria
|
|
8
|
+
|
|
9
|
+
| Categoria | Evidencia Minima Requerida |
|
|
10
|
+
|-----------|---------------------------|
|
|
11
|
+
| Backend | Output do script mostrando comportamento incorreto |
|
|
12
|
+
| API | Response body com status code ou mensagem de erro |
|
|
13
|
+
| UI | Screenshot/snapshot mostrando o bug + console errors |
|
|
14
|
+
| Job | Log entry mostrando falha ou comportamento errado |
|
|
15
|
+
| Integration | Erro da API externa ou credencial invalida |
|
|
16
|
+
| Test | Stack trace com linha da assertion que falha |
|
|
17
|
+
| Infra/Deploy | Log de startup mostrando erro ou env var faltando |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Decision Gate
|
|
22
|
+
|
|
23
|
+
**SE** reproduziu com sucesso (tem evidencia):
|
|
24
|
+
- Documentar em `REPRODUCAO`
|
|
25
|
+
- Prosseguir para persistir reproducao
|
|
26
|
+
|
|
27
|
+
**SE NAO** reproduziu apos executar playbook:
|
|
28
|
+
- Tentar proximo playbook mais provavel (se categoria incerta)
|
|
29
|
+
- **SE** 3 tentativas falharam:
|
|
30
|
+
- Usar `AskUserQuestion` para obter mais detalhes
|
|
31
|
+
- Documentar o que foi tentado
|
|
32
|
+
- **NAO prosseguir ate reproduzir**
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Formato de Documentacao
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
REPRODUCAO:
|
|
40
|
+
- Categoria: [Backend/API/UI/Job/Integration/Test]
|
|
41
|
+
- Playbook usado: [backend/api/ui/job/integration/test/infra]
|
|
42
|
+
- Passos executados: [lista]
|
|
43
|
+
- Input: [dados de entrada]
|
|
44
|
+
- Output esperado: [o que deveria acontecer]
|
|
45
|
+
- Output real: [o que aconteceu - EVIDENCIA]
|
|
46
|
+
- Artefato: [scripts/debug-X.ts ou screenshot]
|
|
47
|
+
- Reproduzido: SIM/NAO
|
|
48
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Validator: Fix Permanence
|
|
2
|
+
|
|
3
|
+
Gate de permanencia - fix deve sobreviver a eventos de infra.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Checklist de Sobrevivencia
|
|
8
|
+
|
|
9
|
+
O fix proposto sobrevive a:
|
|
10
|
+
|
|
11
|
+
| Evento | Sobrevive? | Justificativa |
|
|
12
|
+
|--------|------------|---------------|
|
|
13
|
+
| Docker container restart | [ ] SIM / [ ] NAO | |
|
|
14
|
+
| VM restart | [ ] SIM / [ ] NAO | |
|
|
15
|
+
| `/deploy` (build + push + reset) | [ ] SIM / [ ] NAO | |
|
|
16
|
+
| `terraform apply` | [ ] SIM / [ ] NAO | |
|
|
17
|
+
| VM destroy/create | [ ] SIM / [ ] NAO | |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Gate de Correcao Manual
|
|
22
|
+
|
|
23
|
+
**SE** fix envolveu correcao manual de arquivo de config:
|
|
24
|
+
|
|
25
|
+
| Pergunta | Resposta |
|
|
26
|
+
|----------|----------|
|
|
27
|
+
| Arquivo e gerado por algum processo? | [ ] SIM / [ ] NAO |
|
|
28
|
+
| SE SIM: Processo gerador foi corrigido? | [ ] SIM / [ ] NAO |
|
|
29
|
+
| Fix sobrevive a re-geracao? | [ ] SIM / [ ] NAO |
|
|
30
|
+
|
|
31
|
+
**SE** qualquer resposta = NAO:
|
|
32
|
+
- Fix e PALIATIVO (sera perdido)
|
|
33
|
+
- **OBRIGATORIO**: Voltar para Investigate
|
|
34
|
+
- ACAO: Read ~/.claude/commands/debug/techniques/flow-tracing.md (Passo 4.1)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Decision Gate
|
|
39
|
+
|
|
40
|
+
**SE** qualquer item = NAO:
|
|
41
|
+
- O fix e TEMPORARIO (hotfix/paliativo)
|
|
42
|
+
- Documentar: "Este fix sera perdido em [evento]"
|
|
43
|
+
- **OBRIGATORIO**: Implementar fix PERMANENTE que sobreviva a todos os eventos
|
|
44
|
+
|
|
45
|
+
**SE** todos = SIM:
|
|
46
|
+
- Prosseguir para implementacao
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Red Flags
|
|
51
|
+
|
|
52
|
+
> **NUNCA** declare um bug como "resolvido" se o fix nao sobrevive a `/deploy`.
|
|
53
|
+
>
|
|
54
|
+
> Fix manual na VM e um HOTFIX, nao uma solucao.
|
|
55
|
+
>
|
|
56
|
+
> Corrigir arquivo de config SEM verificar processo gerador = bug retorna no proximo deploy.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Validator: Root Cause Validation
|
|
2
|
+
|
|
3
|
+
Validar causa raiz antes de propor fix.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Checklist Obrigatoria
|
|
8
|
+
|
|
9
|
+
A causa raiz identificada DEVE passar em TODAS:
|
|
10
|
+
|
|
11
|
+
- [ ] Algo que voce pode MUDAR no codigo
|
|
12
|
+
- [ ] Suportada por evidencia de codigo (arquivo:linha)
|
|
13
|
+
- [ ] Explica TODOS os sintomas observados na reproducao
|
|
14
|
+
- [ ] **O fix vai RESOLVER o problema, nao apenas ESCONDER?**
|
|
15
|
+
- [ ] **Se um erro legitimo acontecer, ele ainda sera reportado?**
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Teste do Devil's Advocate
|
|
20
|
+
|
|
21
|
+
Antes de prosseguir, responder:
|
|
22
|
+
|
|
23
|
+
1. **"Em que situacao meu fix pode dar ERRADO?"**
|
|
24
|
+
Resposta: [descreva cenario]
|
|
25
|
+
|
|
26
|
+
2. **"Meu fix resolve a CAUSA ou apenas esconde o SINTOMA?"**
|
|
27
|
+
Resposta: [CAUSA / SINTOMA - se SINTOMA, volte ao Passo 2]
|
|
28
|
+
|
|
29
|
+
3. **"Se eu adicionar a uma lista de ignore, por que nao posso corrigir a logica?"**
|
|
30
|
+
Resposta: [justifique ou admita que pode corrigir a logica]
|
|
31
|
+
|
|
32
|
+
4. **"Meu fix sobrevive a um /deploy? E terraform apply? E VM restart?"**
|
|
33
|
+
Resposta: [SIM para todos / especificar qual falha]
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Categorizacao do Fix Proposto
|
|
38
|
+
|
|
39
|
+
Classifique seu fix:
|
|
40
|
+
- [ ] **CORRECAO DE LOGICA**: Mudar comportamento incorreto → Preferivel
|
|
41
|
+
- [ ] **FILTRO/IGNORE**: Adicionar a lista de coisas a ignorar → REQUER JUSTIFICATIVA
|
|
42
|
+
- [ ] **WORKAROUND**: Contornar sem resolver → REQUER JUSTIFICATIVA
|
|
43
|
+
|
|
44
|
+
**SE FILTRO ou WORKAROUND**: Documente por que CORRECAO DE LOGICA nao e possivel.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Decision Gate
|
|
49
|
+
|
|
50
|
+
**SE** nao validar: voltar a investigacao com nova hipotese via Sequential Thinking.
|
package/config/commands/debug.md
CHANGED
|
@@ -10,7 +10,7 @@ ACAO OBRIGATORIA: Read ~/.claude/commands/debug/01-reproduce.md
|
|
|
10
10
|
Seguir instrucoes. Cada fase aponta para a proxima.
|
|
11
11
|
|
|
12
12
|
## Fluxo
|
|
13
|
-
Reproduce → Investigate → Fix → Verify → Commit → Fim (SEM PARADAS)
|
|
13
|
+
Reproduce → Investigate → Fix → Verify → Commit → Evaluate → Fim (SEM PARADAS)
|
|
14
14
|
|
|
15
15
|
## Regras
|
|
16
16
|
1. ZERO paradas até o final
|
|
@@ -1,114 +1,83 @@
|
|
|
1
1
|
# Fase 1: Interview
|
|
2
2
|
|
|
3
|
-
## Passo 1:
|
|
3
|
+
## Passo 1: Entender o Request
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Analisar $ARGUMENTS para identificar:
|
|
6
|
+
- Qual feature está sendo solicitada
|
|
7
|
+
- Termos-chave para busca
|
|
8
|
+
- Área provável do codebase (api/, components/, services/)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Passo 2: Buscar Contexto Específico
|
|
13
|
+
|
|
14
|
+
Baseado no Passo 1, carregar APENAS o necessário:
|
|
15
|
+
|
|
16
|
+
### 2.1 Memory (se relevante)
|
|
6
17
|
```
|
|
7
|
-
mcp__memory__search_nodes({ query: "
|
|
8
|
-
mcp__memory__search_nodes({ query: "<termos-da-feature>" })
|
|
18
|
+
mcp__memory__search_nodes({ query: "<termos-específicos-da-feature>" })
|
|
9
19
|
```
|
|
10
20
|
|
|
11
|
-
###
|
|
21
|
+
### 2.2 Codebase (áreas identificadas)
|
|
12
22
|
```
|
|
13
|
-
|
|
14
|
-
Read:
|
|
15
|
-
Grep: termos relacionados à feature
|
|
23
|
+
Grep: termos em <área-específica>/
|
|
24
|
+
Read: arquivos diretamente relacionados
|
|
16
25
|
```
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
- Como components similares funcionam
|
|
20
|
-
- Como services são estruturados
|
|
21
|
-
- Como erros são tratados
|
|
22
|
-
- Como loading states funcionam
|
|
27
|
+
**Evitar:** `Glob: **/*.ts` ou buscas genéricas em todo codebase.
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Passo 3: Identificar Patterns (sob demanda)
|
|
32
|
+
|
|
33
|
+
Após encontrar código relevante, identificar:
|
|
34
|
+
- Como components/services similares funcionam
|
|
35
|
+
- Como erros são tratados nessa área
|
|
36
|
+
- Patterns específicos a seguir
|
|
29
37
|
|
|
30
38
|
---
|
|
31
39
|
|
|
32
|
-
## Passo
|
|
40
|
+
## Passo 4: Reflexão
|
|
33
41
|
|
|
34
42
|
Usar `mcp__sequential-thinking__sequentialthinking`:
|
|
35
43
|
|
|
36
|
-
1. **O que descobri** - Síntese
|
|
37
|
-
2. **O que ainda posso descobrir** - Gaps que consigo preencher explorando mais
|
|
38
|
-
3. **O que APENAS o user pode responder** - Decisões de produto, preferências
|
|
39
|
-
4. **
|
|
40
|
-
5. **Formular perguntas mínimas** - Só o essencial que não consegui descobrir
|
|
44
|
+
1. **O que descobri** - Síntese do contexto carregado
|
|
45
|
+
2. **O que ainda posso descobrir** - Gaps que consigo preencher explorando mais
|
|
46
|
+
3. **O que APENAS o user pode responder** - Decisões de produto, preferências UX
|
|
47
|
+
4. **Formular perguntas mínimas** - Só o essencial
|
|
41
48
|
|
|
42
|
-
`totalThoughts`:
|
|
49
|
+
`totalThoughts`: 4
|
|
43
50
|
|
|
44
51
|
---
|
|
45
52
|
|
|
46
|
-
## Passo
|
|
53
|
+
## Passo 5: Perguntas ao User (APENAS decisões de produto)
|
|
47
54
|
|
|
48
55
|
**Usar AskUserQuestion para todas as perguntas.**
|
|
49
56
|
|
|
50
|
-
###
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
question: "Qual problema principal essa feature resolve?",
|
|
56
|
-
header: "Problema",
|
|
57
|
-
multiSelect: false,
|
|
58
|
-
options: [
|
|
59
|
-
{ label: "Eficiência", description: "Processo manual que precisa ser automatizado" },
|
|
60
|
-
{ label: "Funcionalidade", description: "Capacidade que não existe hoje" },
|
|
61
|
-
{ label: "UX", description: "Experiência que precisa melhorar" }
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
question: "Qual escopo para primeira versão?",
|
|
66
|
-
header: "Escopo",
|
|
67
|
-
multiSelect: false,
|
|
68
|
-
options: [
|
|
69
|
-
{ label: "MVP mínimo", description: "Só o essencial" },
|
|
70
|
-
{ label: "MVP completo", description: "Casos principais cobertos" },
|
|
71
|
-
{ label: "Feature completa", description: "Todos os casos de uso" }
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
})
|
|
76
|
-
```
|
|
57
|
+
### Perguntas típicas (adaptar ao contexto):
|
|
58
|
+
- **Problema**: Qual problema principal resolve? (Eficiência/Funcionalidade/UX)
|
|
59
|
+
- **Escopo**: MVP mínimo ou feature completa?
|
|
60
|
+
- **Design**: Tem referência ou seguir patterns existentes?
|
|
61
|
+
- **Trade-offs**: Se encontrar 2 approaches, qual preferir?
|
|
77
62
|
|
|
78
|
-
|
|
63
|
+
Exemplo de uso:
|
|
79
64
|
```javascript
|
|
80
65
|
AskUserQuestion({
|
|
81
66
|
questions: [{
|
|
82
|
-
question: "
|
|
83
|
-
header: "
|
|
84
|
-
multiSelect: false,
|
|
67
|
+
question: "[pergunta específica]",
|
|
68
|
+
header: "[2-3 palavras]",
|
|
85
69
|
options: [
|
|
86
|
-
{ label: "
|
|
87
|
-
{ label: "
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}]
|
|
91
|
-
})
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 3.3 Trade-offs (apenas se houver decisão com impacto)
|
|
95
|
-
```javascript
|
|
96
|
-
AskUserQuestion({
|
|
97
|
-
questions: [{
|
|
98
|
-
question: "Encontrei 2 approaches. Qual prefere?",
|
|
99
|
-
header: "Approach",
|
|
100
|
-
multiSelect: false,
|
|
101
|
-
options: [
|
|
102
|
-
{ label: "Approach A", description: "[trade-off A]" },
|
|
103
|
-
{ label: "Approach B", description: "[trade-off B]" }
|
|
104
|
-
]
|
|
70
|
+
{ label: "[opção]", description: "[trade-off]" },
|
|
71
|
+
{ label: "[opção]", description: "[trade-off]" }
|
|
72
|
+
],
|
|
73
|
+
multiSelect: false
|
|
105
74
|
}]
|
|
106
75
|
})
|
|
107
76
|
```
|
|
108
77
|
|
|
109
78
|
---
|
|
110
79
|
|
|
111
|
-
## Passo
|
|
80
|
+
## Passo 6: Apresentar Descobertas
|
|
112
81
|
|
|
113
82
|
Mostrar ao user:
|
|
114
83
|
- Services/patterns encontrados
|
|
@@ -118,23 +87,46 @@ Mostrar ao user:
|
|
|
118
87
|
|
|
119
88
|
---
|
|
120
89
|
|
|
121
|
-
## Passo
|
|
90
|
+
## Passo 7: Persistir Interview
|
|
122
91
|
|
|
123
|
-
|
|
92
|
+
### 7.1 Gerar slug
|
|
93
|
+
Primeira palavra do problema + data. Exemplo: `filtro-2026-01-10.md`
|
|
124
94
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
95
|
+
### 7.2 Salvar respostas
|
|
96
|
+
```
|
|
97
|
+
Write .claude/interviews/{slug}.md
|
|
98
|
+
Write .claude/interviews/current.md (cópia do conteúdo)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 7.3 Formato do arquivo
|
|
102
|
+
```markdown
|
|
103
|
+
# Interview: {feature-name}
|
|
104
|
+
|
|
105
|
+
## Contexto Descoberto
|
|
106
|
+
- Services encontrados: [lista]
|
|
107
|
+
- Patterns identificados: [lista]
|
|
108
|
+
- Código reutilizável: [arquivos:linhas]
|
|
109
|
+
|
|
110
|
+
## Perguntas e Respostas
|
|
111
|
+
| # | Pergunta | Resposta | Impacto na Implementação |
|
|
112
|
+
|---|----------|----------|--------------------------|
|
|
113
|
+
| 1 | [pergunta] | [resposta] | [como afeta] |
|
|
114
|
+
|
|
115
|
+
## Decisões Implícitas
|
|
116
|
+
- [decisões inferidas do contexto ou defaults do projeto]
|
|
117
|
+
|
|
118
|
+
## Termos-chave para Busca
|
|
119
|
+
- [termos que outras fases podem usar para grep/search]
|
|
135
120
|
```
|
|
136
121
|
|
|
137
|
-
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Passo 8: Checkpoint
|
|
125
|
+
|
|
126
|
+
Usar TodoWrite para registrar items da fase Interview como "completed".
|
|
127
|
+
Adicionar "Spec: gerar especificacao" como "pending".
|
|
128
|
+
|
|
129
|
+
**Gate:** Todos items de Interview devem estar "completed" E interviews/current.md deve existir.
|
|
138
130
|
|
|
139
131
|
---
|
|
140
132
|
|