@maestro-ai/cli 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 +59 -0
- package/content/guides/Cat/303/241logo de Stacks para Cloud Moderna.md" +119 -0
- package/content/guides/Cat/303/241logo de Stacks para Hospedagem Compartilhada.md" +147 -0
- package/content/guides/Checklist Mestre de Entrega.md +68 -0
- package/content/guides/Gates de Qualidade.md +209 -0
- package/content/guides/Guia de Adi/303/247/303/243o de Novas Funcionalidades.md" +355 -0
- package/content/guides/Guia de Chaos Engineering.md +267 -0
- package/content/guides/Guia de Debugging com IA.md +135 -0
- package/content/guides/Guia de Estrat/303/251gias de Cache.md" +352 -0
- package/content/guides/Guia de Migrations Zero-Downtime.md +311 -0
- package/content/guides/Guia de Multi-tenancy.md +368 -0
- package/content/guides/Guia de Otimiza/303/247/303/243o de Custos Cloud.md" +195 -0
- package/content/guides/Guia de Refatora/303/247/303/243o de C/303/263digo Legado com IA.md" +162 -0
- package/content/guides/Guia de SLOs e Error Budgets.md +315 -0
- package/content/guides/M/303/251tricas de Efici/303/252ncia do Desenvolvimento com IA.md" +93 -0
- package/content/guides/Rules base.md +90 -0
- package/content/prompts/README.md +203 -0
- package/content/prompts/acessibilidade/analise-acessibilidade.md +257 -0
- package/content/prompts/apis/design-api-rest.md +303 -0
- package/content/prompts/apis/idempotencia.md +254 -0
- package/content/prompts/apis/versionamento.md +313 -0
- package/content/prompts/arquitetura/arquitetura-c4-completo.md +190 -0
- package/content/prompts/arquitetura/clean-architecture.md +151 -0
- package/content/prompts/arquitetura/ddd-bounded-contexts.md +183 -0
- package/content/prompts/arquitetura/ddd-cqrs.md +176 -0
- package/content/prompts/arquitetura/modelo-dominio.md +207 -0
- package/content/prompts/arquitetura/multi-tenancy.md +235 -0
- package/content/prompts/database/migrations-zero-downtime.md +192 -0
- package/content/prompts/database/otimizacao-queries.md +296 -0
- package/content/prompts/desenvolvimento/code-review.md +301 -0
- package/content/prompts/desenvolvimento/gerar-servico.md +271 -0
- package/content/prompts/devops/docker-compose.md +336 -0
- package/content/prompts/devops/feature-flags.md +374 -0
- package/content/prompts/devops/kubernetes-deploy.md +460 -0
- package/content/prompts/devops/pipeline-cicd.md +358 -0
- package/content/prompts/devops/terraform-iac.md +502 -0
- package/content/prompts/escalabilidade/analise-performance.md +240 -0
- package/content/prompts/escalabilidade/analise-performance.txt +94 -0
- package/content/prompts/escalabilidade/caching.md +255 -0
- package/content/prompts/observabilidade/chaos-testing.md +237 -0
- package/content/prompts/observabilidade/estrategia-observabilidade.md +263 -0
- package/content/prompts/observabilidade/estrategia-observabilidade.txt +134 -0
- package/content/prompts/observabilidade/slos.md +215 -0
- package/content/prompts/produto/discovery-inicial.md +203 -0
- package/content/prompts/produto/discovery-inicial.txt +33 -0
- package/content/prompts/requisitos/refinar-requisitos.md +232 -0
- package/content/prompts/requisitos/refinar-requisitos.txt +40 -0
- package/content/prompts/seguranca/analise-seguranca.md +243 -0
- package/content/prompts/seguranca/pentest-checklist.md +333 -0
- package/content/prompts/seguranca/rate-limiting.md +356 -0
- package/content/prompts/seguranca/revisao-lgpd.md +227 -0
- package/content/prompts/seguranca/threat-modeling.md +224 -0
- package/content/prompts/testes/contract-testing.md +340 -0
- package/content/prompts/testes/gerar-testes-unitarios.md +474 -0
- package/content/prompts/testes/testes-e2e.md +460 -0
- package/content/prompts/testes/testes-integracao.md +418 -0
- package/content/prompts/testes/testes-performance.md +458 -0
- package/content/prompts/ux/gerar-ui-stitch.md +151 -0
- package/content/skills/api-patterns/SKILL.md +81 -0
- package/content/skills/api-patterns/api-style.md +42 -0
- package/content/skills/api-patterns/auth.md +24 -0
- package/content/skills/api-patterns/documentation.md +26 -0
- package/content/skills/api-patterns/graphql.md +41 -0
- package/content/skills/api-patterns/rate-limiting.md +31 -0
- package/content/skills/api-patterns/response.md +37 -0
- package/content/skills/api-patterns/rest.md +40 -0
- package/content/skills/api-patterns/scripts/api_validator.py +211 -0
- package/content/skills/api-patterns/security-testing.md +122 -0
- package/content/skills/api-patterns/trpc.md +41 -0
- package/content/skills/api-patterns/versioning.md +22 -0
- package/content/skills/app-builder/SKILL.md +75 -0
- package/content/skills/app-builder/agent-coordination.md +71 -0
- package/content/skills/app-builder/feature-building.md +53 -0
- package/content/skills/app-builder/project-detection.md +34 -0
- package/content/skills/app-builder/scaffolding.md +118 -0
- package/content/skills/app-builder/tech-stack.md +40 -0
- package/content/skills/app-builder/templates/SKILL.md +39 -0
- package/content/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/content/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/content/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/content/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/content/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/content/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/content/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/content/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/content/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/content/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/content/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/content/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/content/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/content/skills/architecture/SKILL.md +55 -0
- package/content/skills/architecture/context-discovery.md +43 -0
- package/content/skills/architecture/examples.md +94 -0
- package/content/skills/architecture/pattern-selection.md +68 -0
- package/content/skills/architecture/patterns-reference.md +50 -0
- package/content/skills/architecture/trade-off-analysis.md +77 -0
- package/content/skills/bash-linux/SKILL.md +199 -0
- package/content/skills/behavioral-modes/SKILL.md +242 -0
- package/content/skills/brainstorming/SKILL.md +163 -0
- package/content/skills/brainstorming/dynamic-questioning.md +350 -0
- package/content/skills/clean-code/SKILL.md +201 -0
- package/content/skills/code-review-checklist/SKILL.md +109 -0
- package/content/skills/database-design/SKILL.md +52 -0
- package/content/skills/database-design/database-selection.md +43 -0
- package/content/skills/database-design/indexing.md +39 -0
- package/content/skills/database-design/migrations.md +48 -0
- package/content/skills/database-design/optimization.md +36 -0
- package/content/skills/database-design/orm-selection.md +30 -0
- package/content/skills/database-design/schema-design.md +56 -0
- package/content/skills/database-design/scripts/schema_validator.py +172 -0
- package/content/skills/deployment-procedures/SKILL.md +241 -0
- package/content/skills/doc.md +177 -0
- package/content/skills/documentation-templates/SKILL.md +194 -0
- package/content/skills/frontend-design/SKILL.md +396 -0
- package/content/skills/frontend-design/animation-guide.md +331 -0
- package/content/skills/frontend-design/color-system.md +311 -0
- package/content/skills/frontend-design/decision-trees.md +418 -0
- package/content/skills/frontend-design/motion-graphics.md +306 -0
- package/content/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/content/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/content/skills/frontend-design/typography-system.md +345 -0
- package/content/skills/frontend-design/ux-psychology.md +541 -0
- package/content/skills/frontend-design/visual-effects.md +383 -0
- package/content/skills/game-development/2d-games/SKILL.md +119 -0
- package/content/skills/game-development/3d-games/SKILL.md +135 -0
- package/content/skills/game-development/SKILL.md +167 -0
- package/content/skills/game-development/game-art/SKILL.md +185 -0
- package/content/skills/game-development/game-audio/SKILL.md +190 -0
- package/content/skills/game-development/game-design/SKILL.md +129 -0
- package/content/skills/game-development/mobile-games/SKILL.md +108 -0
- package/content/skills/game-development/multiplayer/SKILL.md +132 -0
- package/content/skills/game-development/pc-games/SKILL.md +144 -0
- package/content/skills/game-development/vr-ar/SKILL.md +123 -0
- package/content/skills/game-development/web-games/SKILL.md +150 -0
- package/content/skills/geo-fundamentals/SKILL.md +156 -0
- package/content/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/content/skills/i18n-localization/SKILL.md +154 -0
- package/content/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/content/skills/intelligent-routing/SKILL.md +334 -0
- package/content/skills/lint-and-validate/SKILL.md +45 -0
- package/content/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/content/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/content/skills/mcp-builder/SKILL.md +176 -0
- package/content/skills/mobile-design/SKILL.md +394 -0
- package/content/skills/mobile-design/decision-trees.md +516 -0
- package/content/skills/mobile-design/mobile-backend.md +491 -0
- package/content/skills/mobile-design/mobile-color-system.md +420 -0
- package/content/skills/mobile-design/mobile-debugging.md +122 -0
- package/content/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/content/skills/mobile-design/mobile-navigation.md +458 -0
- package/content/skills/mobile-design/mobile-performance.md +767 -0
- package/content/skills/mobile-design/mobile-testing.md +356 -0
- package/content/skills/mobile-design/mobile-typography.md +433 -0
- package/content/skills/mobile-design/platform-android.md +666 -0
- package/content/skills/mobile-design/platform-ios.md +561 -0
- package/content/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/content/skills/mobile-design/touch-psychology.md +537 -0
- package/content/skills/nextjs-best-practices/SKILL.md +203 -0
- package/content/skills/nodejs-best-practices/SKILL.md +333 -0
- package/content/skills/parallel-agents/SKILL.md +175 -0
- package/content/skills/performance-profiling/SKILL.md +143 -0
- package/content/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/content/skills/plan-writing/SKILL.md +152 -0
- package/content/skills/powershell-windows/SKILL.md +167 -0
- package/content/skills/python-patterns/SKILL.md +441 -0
- package/content/skills/react-patterns/SKILL.md +198 -0
- package/content/skills/red-team-tactics/SKILL.md +199 -0
- package/content/skills/seo-fundamentals/SKILL.md +129 -0
- package/content/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/content/skills/server-management/SKILL.md +161 -0
- package/content/skills/systematic-debugging/SKILL.md +109 -0
- package/content/skills/tailwind-patterns/SKILL.md +269 -0
- package/content/skills/tdd-workflow/SKILL.md +149 -0
- package/content/skills/testing-patterns/SKILL.md +178 -0
- package/content/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/content/skills/vulnerability-scanner/SKILL.md +276 -0
- package/content/skills/vulnerability-scanner/checklists.md +121 -0
- package/content/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/content/skills/webapp-testing/SKILL.md +187 -0
- package/content/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/content/specialists/Especialista em Acessibilidade.md +266 -0
- package/content/specialists/Especialista em An/303/241lise de Testes.md" +434 -0
- package/content/specialists/Especialista em Arquitetura Avan/303/247ada.md" +358 -0
- package/content/specialists/Especialista em Arquitetura de Software.md +177 -0
- package/content/specialists/Especialista em Banco de Dados.md +260 -0
- package/content/specialists/Especialista em Contrato de API.md +172 -0
- package/content/specialists/Especialista em Dados e Analytics com IA.md +246 -0
- package/content/specialists/Especialista em Debugging e Troubleshooting.md +191 -0
- package/content/specialists/Especialista em Desenvolvimento Frontend.md +477 -0
- package/content/specialists/Especialista em Desenvolvimento Mobile.md +241 -0
- package/content/specialists/Especialista em Desenvolvimento e Vibe Coding Estruturado.md +417 -0
- package/content/specialists/Especialista em DevOps e Infraestrutura.md +294 -0
- package/content/specialists/Especialista em Documenta/303/247/303/243o T/303/251cnica.md" +227 -0
- package/content/specialists/Especialista em Engenharia de Requisitos com IA.md +299 -0
- package/content/specialists/Especialista em Explora/303/247/303/243o de Codebase.md" +179 -0
- package/content/specialists/Especialista em Gest/303/243o de Produto.md" +179 -0
- package/content/specialists/Especialista em Migra/303/247/303/243o e Moderniza/303/247/303/243o.md" +410 -0
- package/content/specialists/Especialista em Modelagem e Arquitetura de Dom/303/255nio com IA.md" +248 -0
- package/content/specialists/Especialista em Observabilidade.md +415 -0
- package/content/specialists/Especialista em Performance e Escalabilidade.md +373 -0
- package/content/specialists/Especialista em Plano de Execu/303/247/303/243o com IA.md" +341 -0
- package/content/specialists/Especialista em Prototipagem R/303/241pida com Google Stitch.md" +419 -0
- package/content/specialists/Especialista em Seguran/303/247a da Informa/303/247/303/243o.md" +508 -0
- package/content/specialists/Especialista em UX Design.md +453 -0
- package/content/specialists/INDEX.md +43 -0
- package/content/templates/PRD.md +165 -0
- package/content/templates/README.md +65 -0
- package/content/templates/adr.md +103 -0
- package/content/templates/arquitetura.md +279 -0
- package/content/templates/backlog.md +185 -0
- package/content/templates/checklist-seguranca.md +180 -0
- package/content/templates/contexto.md +120 -0
- package/content/templates/criterios-aceite.md +99 -0
- package/content/templates/design-banco.md +270 -0
- package/content/templates/design-doc.md +240 -0
- package/content/templates/feature.md +88 -0
- package/content/templates/historia-backend.md +84 -0
- package/content/templates/historia-frontend.md +75 -0
- package/content/templates/historia-usuario.md +125 -0
- package/content/templates/mapa-navegacao.md +133 -0
- package/content/templates/matriz-rastreabilidade.md +121 -0
- package/content/templates/modelo-dominio.md +219 -0
- package/content/templates/plano-testes.md +199 -0
- package/content/templates/prototipo-stitch.md +138 -0
- package/content/templates/requisitos.md +162 -0
- package/content/templates/slo-sli.md +197 -0
- package/content/workflows/README-MCP.md +363 -0
- package/content/workflows/brainstorm.md +113 -0
- package/content/workflows/create.md +59 -0
- package/content/workflows/debug.md +103 -0
- package/content/workflows/deploy.md +176 -0
- package/content/workflows/enhance.md +63 -0
- package/content/workflows/mcp-debug.md +506 -0
- package/content/workflows/mcp-feature.md +385 -0
- package/content/workflows/mcp-gate.md +413 -0
- package/content/workflows/mcp-next.md +388 -0
- package/content/workflows/mcp-refactor.md +600 -0
- package/content/workflows/mcp-start.md +304 -0
- package/content/workflows/mcp-status.md +400 -0
- package/content/workflows/orchestrate.md +237 -0
- package/content/workflows/plan.md +89 -0
- package/content/workflows/preview.md +81 -0
- package/content/workflows/status.md +86 -0
- package/content/workflows/test.md +144 -0
- package/content/workflows/ui-ux-pro-max.md +296 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.js +138 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.js +50 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -0
- package/package.json +48 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Correção de bugs com fluxo estruturado (Reprodução → Análise → Fix → Regressão)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /mcp-debug - Correção de Bug MCP
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Objetivo
|
|
12
|
+
|
|
13
|
+
Corrigir bugs de forma estruturada usando fluxo de 4 fases do MCP Maestro, com análise de causa raiz e testes de regressão.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quando Usar
|
|
18
|
+
|
|
19
|
+
- Bug reportado em produção ou desenvolvimento
|
|
20
|
+
- Comportamento inesperado que precisa investigação
|
|
21
|
+
- Erro que requer análise sistemática
|
|
22
|
+
|
|
23
|
+
**NÃO usar para:**
|
|
24
|
+
- Nova funcionalidade → Use `/mcp-feature`
|
|
25
|
+
- Refatoração de código → Use `/mcp-refactor`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Fluxo de 4 Fases
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
1. Reprodução do Bug
|
|
33
|
+
↓
|
|
34
|
+
2. Análise de Causa Raiz
|
|
35
|
+
↓
|
|
36
|
+
3. Fix + Testes de Regressão
|
|
37
|
+
↓
|
|
38
|
+
4. Deploy
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Execução
|
|
44
|
+
|
|
45
|
+
### Passo 1: Coleta de Informações
|
|
46
|
+
|
|
47
|
+
**Perguntar ao usuário:**
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
🐛 **Correção de Bug**
|
|
51
|
+
|
|
52
|
+
1. Descreva o bug:
|
|
53
|
+
[Exemplo: Pedido duplicado ao clicar rapidamente no botão "Finalizar"]
|
|
54
|
+
|
|
55
|
+
2. Severidade do bug:
|
|
56
|
+
- **critica**: Sistema inoperante, perda de dados
|
|
57
|
+
- **alta**: Feature principal não funciona
|
|
58
|
+
- **media**: Feature secundária afetada
|
|
59
|
+
- **baixa**: Cosmético, sem impacto funcional
|
|
60
|
+
|
|
61
|
+
Escolha: [critica/alta/media/baixa]
|
|
62
|
+
|
|
63
|
+
3. (Opcional) Como reproduzir:
|
|
64
|
+
[Passos para reproduzir o bug]
|
|
65
|
+
|
|
66
|
+
4. (Opcional) Stack trace ou logs:
|
|
67
|
+
[Cole aqui se disponível]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Passo 2: Iniciar Fluxo de Debugging
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
await mcp_maestro_corrigir_bug({
|
|
76
|
+
descricao: "[descrição fornecida]",
|
|
77
|
+
severidade: "[critica/alta/media/baixa]",
|
|
78
|
+
ticket_id: "[opcional: JIRA-123]"
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**MCP cria contexto de bug e retorna:**
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"bug_id": "BUG-001",
|
|
87
|
+
"fases": [
|
|
88
|
+
"Reprodução",
|
|
89
|
+
"Análise de Causa Raiz",
|
|
90
|
+
"Fix + Regressão",
|
|
91
|
+
"Deploy"
|
|
92
|
+
],
|
|
93
|
+
"fase_atual": 1,
|
|
94
|
+
"prioridade": "[baseada na severidade]"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Passo 3: Fase 1 - Reprodução do Bug
|
|
101
|
+
|
|
102
|
+
**Apresentar:**
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
✅ **Fluxo de Debugging Iniciado** (BUG-001)
|
|
106
|
+
🚨 **Severidade:** [critica/alta/media/baixa]
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
🎯 **Fase 1/4: Reprodução do Bug**
|
|
111
|
+
🤖 **Especialista:** Debugging e Troubleshooting
|
|
112
|
+
|
|
113
|
+
## Reprodução Sistemática
|
|
114
|
+
|
|
115
|
+
Vamos reproduzir o bug de forma controlada:
|
|
116
|
+
|
|
117
|
+
1. **Ambiente**
|
|
118
|
+
- Onde ocorre: [dev/staging/prod]
|
|
119
|
+
- Versão: [commit/tag]
|
|
120
|
+
- Browser/Device: [se aplicável]
|
|
121
|
+
|
|
122
|
+
2. **Passos para Reproduzir**
|
|
123
|
+
1. [Passo 1]
|
|
124
|
+
2. [Passo 2]
|
|
125
|
+
3. [Passo 3]
|
|
126
|
+
|
|
127
|
+
3. **Comportamento Esperado**
|
|
128
|
+
- [O que deveria acontecer]
|
|
129
|
+
|
|
130
|
+
4. **Comportamento Atual**
|
|
131
|
+
- [O que está acontecendo]
|
|
132
|
+
|
|
133
|
+
5. **Evidências**
|
|
134
|
+
- Screenshots: [urls se disponível]
|
|
135
|
+
- Logs: [trechos relevantes]
|
|
136
|
+
- Network: [requests falhando]
|
|
137
|
+
|
|
138
|
+
Conseguiu reproduzir o bug? (S/N)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Passo 4: Fase 2 - Análise de Causa Raiz
|
|
144
|
+
|
|
145
|
+
**Carregar especialista de Debugging:**
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
const especialista = await fetch('maestro://especialista/debugging-troubleshooting');
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Apresentar:**
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
🎯 **Fase 2/4: Análise de Causa Raiz**
|
|
155
|
+
|
|
156
|
+
## Investigação Sistemática
|
|
157
|
+
|
|
158
|
+
### Hipóteses Possíveis
|
|
159
|
+
|
|
160
|
+
Baseado nos sintomas, lista de causas prováveis:
|
|
161
|
+
|
|
162
|
+
1. ❓ **[Hipótese 1 - Mais provável]**
|
|
163
|
+
- Evidência: [log/código que apoia]
|
|
164
|
+
- Como testar: [validação]
|
|
165
|
+
|
|
166
|
+
2. ❓ **[Hipótese 2]**
|
|
167
|
+
- Evidência: [...]
|
|
168
|
+
- Como testar: [...]
|
|
169
|
+
|
|
170
|
+
3. ❓ **[Hipótese 3 - Menos provável]**
|
|
171
|
+
- Evidência: [...]
|
|
172
|
+
- Como testar: [...]
|
|
173
|
+
|
|
174
|
+
### Análise de Código
|
|
175
|
+
|
|
176
|
+
Arquivos suspeitos:
|
|
177
|
+
- `[arquivo1.ts]` - [motivo]
|
|
178
|
+
- `[arquivo2.ts]` - [motivo]
|
|
179
|
+
|
|
180
|
+
Vamos investigar a hipótese 1. [Análise detalhada do código]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Processo de eliminação:**
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
**Testando Hipótese 1:** [descrição]
|
|
187
|
+
|
|
188
|
+
[Análise do código/logs]
|
|
189
|
+
|
|
190
|
+
**Resultado:** ✅ Confirmada / ❌ Descartada
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
🎯 **Causa Raiz Identificada:**
|
|
195
|
+
|
|
196
|
+
[Explicação detalhada do problema]
|
|
197
|
+
|
|
198
|
+
**Por que aconteceu:**
|
|
199
|
+
- [Motivo 1]
|
|
200
|
+
- [Motivo 2]
|
|
201
|
+
|
|
202
|
+
**Onde está o bug:**
|
|
203
|
+
- Arquivo: `[caminho/arquivo.ts]`
|
|
204
|
+
- Linha: [numero]
|
|
205
|
+
- Função: `[nomeFuncao]`
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Passo 5: Fase 3 - Fix + Testes de Regressão
|
|
211
|
+
|
|
212
|
+
**Apresentar:**
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
🎯 **Fase 3/4: Fix + Testes de Regressão**
|
|
216
|
+
|
|
217
|
+
## Correção Proposta
|
|
218
|
+
|
|
219
|
+
```[linguagem]
|
|
220
|
+
// ❌ ANTES (com bug)
|
|
221
|
+
[código com problema]
|
|
222
|
+
|
|
223
|
+
// ✅ DEPOIS (corrigido)
|
|
224
|
+
[código corrigido]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Explicação da correção:**
|
|
228
|
+
[Por que isso resolve o problema]
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Testes de Regressão
|
|
233
|
+
|
|
234
|
+
Para garantir que o fix funciona E não quebra nada:
|
|
235
|
+
|
|
236
|
+
### 1. Teste Unitário (Novo)
|
|
237
|
+
|
|
238
|
+
```[linguagem]
|
|
239
|
+
describe('[NomeDaFuncao]', () => {
|
|
240
|
+
it('should [comportamento esperado]', () => {
|
|
241
|
+
// Arrange
|
|
242
|
+
[setup]
|
|
243
|
+
|
|
244
|
+
// Act
|
|
245
|
+
[execução]
|
|
246
|
+
|
|
247
|
+
// Assert
|
|
248
|
+
[validação]
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('should not [regressão possível]', () => {
|
|
252
|
+
// Testa efeito colateral
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### 2. Teste de Integração
|
|
258
|
+
|
|
259
|
+
[Cenário E2E que valida o fix]
|
|
260
|
+
|
|
261
|
+
### 3. Validação Manual
|
|
262
|
+
|
|
263
|
+
Passos para testar manualmente:
|
|
264
|
+
1. [Passo 1]
|
|
265
|
+
2. [Passo 2]
|
|
266
|
+
3. ✅ [Resultado esperado]
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
Implementar correção e rodar testes? (S/N)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
### Passo 6: Fase 4 - Deploy
|
|
276
|
+
|
|
277
|
+
**Coordenar com `/deploy`:**
|
|
278
|
+
|
|
279
|
+
```markdown
|
|
280
|
+
🎯 **Fase 4/4: Deploy**
|
|
281
|
+
|
|
282
|
+
## Estratégia de Deploy
|
|
283
|
+
|
|
284
|
+
**Severidade: [critica/alta/media/baixa]**
|
|
285
|
+
|
|
286
|
+
### Se Crítica:
|
|
287
|
+
- 🚨 Hotfix imediato
|
|
288
|
+
- Deploy direto em prod após validação em staging
|
|
289
|
+
- Rollback plan pronto
|
|
290
|
+
|
|
291
|
+
### Se Alta:
|
|
292
|
+
- Deploy em staging → validação → prod
|
|
293
|
+
- Comunicar stakeholders
|
|
294
|
+
|
|
295
|
+
### Se Média/Baixa:
|
|
296
|
+
- Incluir no próximo release
|
|
297
|
+
- Documentar no CHANGELOG
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
**Checklist Pré-Deploy:**
|
|
302
|
+
- [ ] Fix implementado
|
|
303
|
+
- [ ] Testes unitários passando
|
|
304
|
+
- [ ] Testes de regressão passando
|
|
305
|
+
- [ ] Code review aprovado
|
|
306
|
+
- [ ] Validado em staging
|
|
307
|
+
|
|
308
|
+
Executar deploy? Use `/deploy [ambiente]`
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Exemplos de Uso
|
|
314
|
+
|
|
315
|
+
### Exemplo 1: Bug Crítico (Duplicação de Pedido)
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
User: /mcp-debug
|
|
319
|
+
|
|
320
|
+
AI: Descreva o bug:
|
|
321
|
+
|
|
322
|
+
User: Pedido duplicado ao clicar rapidamente no botão Finalizar
|
|
323
|
+
|
|
324
|
+
AI: Severidade?
|
|
325
|
+
|
|
326
|
+
User: critica
|
|
327
|
+
|
|
328
|
+
AI: ✅ Fluxo iniciado (BUG-001) - Severidade CRÍTICA
|
|
329
|
+
|
|
330
|
+
🎯 Fase 1: Reprodução
|
|
331
|
+
|
|
332
|
+
Vamos reproduzir de forma controlada:
|
|
333
|
+
1. Criar pedido
|
|
334
|
+
2. Clicar rapidamente 2x em "Finalizar"
|
|
335
|
+
3. Verificar banco de dados
|
|
336
|
+
|
|
337
|
+
Reproduzido ✅
|
|
338
|
+
|
|
339
|
+
[Avança para Fase 2]
|
|
340
|
+
|
|
341
|
+
🎯 Fase 2: Análise de Causa Raiz
|
|
342
|
+
|
|
343
|
+
Hipóteses:
|
|
344
|
+
1. ❓ Falta de debounce no botão (MAIS PROVÁVEL)
|
|
345
|
+
2. ❓ Falta de idempotência no endpoint
|
|
346
|
+
3. ❓ Race condition no banco
|
|
347
|
+
|
|
348
|
+
Analisando código de `CheckoutButton.tsx`...
|
|
349
|
+
|
|
350
|
+
🎯 Causa Raiz: Botão sem debounce + endpoint não idempotente
|
|
351
|
+
|
|
352
|
+
[Avança para Fase 3]
|
|
353
|
+
|
|
354
|
+
🎯 Fase 3: Fix
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
// ❌ ANTES
|
|
358
|
+
<button onClick={handleCheckout}>Finalizar</button>
|
|
359
|
+
|
|
360
|
+
// ✅ DEPOIS
|
|
361
|
+
<button
|
|
362
|
+
onClick={debounce(handleCheckout, 300)}
|
|
363
|
+
disabled={isProcessing}
|
|
364
|
+
>
|
|
365
|
+
Finalizar
|
|
366
|
+
</button>
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
+ Adicionar idempotency key no backend
|
|
370
|
+
|
|
371
|
+
Testes criados ✅
|
|
372
|
+
|
|
373
|
+
[Avança para Fase 4]
|
|
374
|
+
|
|
375
|
+
🎯 Fase 4: Deploy
|
|
376
|
+
|
|
377
|
+
Severidade CRÍTICA → Hotfix imediato
|
|
378
|
+
|
|
379
|
+
Use: /deploy production --hotfix
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Exemplo 2: Bug de UI (Baixa Severidade)
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
User: /mcp-debug Botão de logout desalinhado no mobile
|
|
386
|
+
|
|
387
|
+
AI: Severidade?
|
|
388
|
+
|
|
389
|
+
User: baixa
|
|
390
|
+
|
|
391
|
+
AI: ✅ Fluxo iniciado (BUG-002) - Severidade BAIXA
|
|
392
|
+
|
|
393
|
+
Bug cosmético. Incluir no próximo release.
|
|
394
|
+
|
|
395
|
+
Fase 1: Reprodução ✅
|
|
396
|
+
Fase 2: CSS incorreto identificado
|
|
397
|
+
Fase 3: Fix aplicado
|
|
398
|
+
Fase 4: Agendar para próximo deploy
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## Comandos Relacionados
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
/mcp-debug [descrição] → Inicia fluxo de debugging
|
|
407
|
+
/mcp-next → Avança entre fases
|
|
408
|
+
/deploy --hotfix → Deploy emergencial (bugs críticos)
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Estrutura de Arquivos Gerados
|
|
414
|
+
|
|
415
|
+
```
|
|
416
|
+
docs/
|
|
417
|
+
├── bugs/
|
|
418
|
+
│ └── BUG-001-pedido-duplicado/
|
|
419
|
+
│ ├── 01-reproducao.md
|
|
420
|
+
│ ├── 02-causa-raiz.md
|
|
421
|
+
│ ├── 03-fix-e-testes.md
|
|
422
|
+
│ └── 04-deploy-log.md
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Regras Críticas (Root Cause Analysis)
|
|
428
|
+
|
|
429
|
+
### ✅ SEMPRE:
|
|
430
|
+
|
|
431
|
+
1. Reproduzir bug ANTES de tentar corrigir
|
|
432
|
+
2. Fazer análise de causa raiz (não apenas sintomas)
|
|
433
|
+
3. Adicionar testes que capturam o bug
|
|
434
|
+
4. Validar em staging antes de prod (exceto hotfixes)
|
|
435
|
+
5. Documentar causa raiz para aprendizado
|
|
436
|
+
|
|
437
|
+
### ❌ NUNCA:
|
|
438
|
+
|
|
439
|
+
1. "Corrigir" sem entender a causa
|
|
440
|
+
2. Deploy de fix crítico sem testes
|
|
441
|
+
3. Assumir causa raiz sem evidências
|
|
442
|
+
4. Esquecer de testar efeitos colaterais
|
|
443
|
+
5. Deixar bug sem teste de regressão
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## Matriz de Severidade → Ação
|
|
448
|
+
|
|
449
|
+
| Severidade | SLA | Deploy | Comunicação |
|
|
450
|
+
|------------|-----|--------|-------------|
|
|
451
|
+
| **Crítica** | 1h | Hotfix imediato | Stakeholders + usuários |
|
|
452
|
+
| **Alta** | 4h | Próximo deploy | Stakeholders |
|
|
453
|
+
| **Média** | 1-2 dias | Release agendado | Interno |
|
|
454
|
+
| **Baixa** | 1 semana | Quando conveniente | Changelog |
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
## Protocolo de Hotfix (Bugs Críticos)
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
1. Criar branch: hotfix/BUG-001-pedido-duplicado
|
|
462
|
+
2. Fix + testes
|
|
463
|
+
3. Deploy staging → validar
|
|
464
|
+
4. Deploy prod
|
|
465
|
+
5. Merge back to main
|
|
466
|
+
6. Post-mortem (se necessário)
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## Troubleshooting
|
|
472
|
+
|
|
473
|
+
### Não Consigo Reproduzir
|
|
474
|
+
|
|
475
|
+
**Ação:**
|
|
476
|
+
|
|
477
|
+
```markdown
|
|
478
|
+
Se não conseguiu reproduzir:
|
|
479
|
+
|
|
480
|
+
1. **Coletar mais informações**
|
|
481
|
+
- Logs mais detalhados
|
|
482
|
+
- Request/Response headers
|
|
483
|
+
- Estado do banco no momento
|
|
484
|
+
|
|
485
|
+
2. **Testar em ambiente idêntico**
|
|
486
|
+
- Mesma versão
|
|
487
|
+
- Mesmos dados
|
|
488
|
+
- Mesmo browser/device
|
|
489
|
+
|
|
490
|
+
3. **Race condition?**
|
|
491
|
+
- Tentar com diferentes timings
|
|
492
|
+
- Usar ferramentas de slow-motion (Network throttling)
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Múltiplas Causas Possíveis
|
|
496
|
+
|
|
497
|
+
**Ação:**
|
|
498
|
+
|
|
499
|
+
```markdown
|
|
500
|
+
Se várias hipóteses igualmente prováveis:
|
|
501
|
+
|
|
502
|
+
1. Testar todas sistematicamente
|
|
503
|
+
2. Usar método de bisseção (git bisect)
|
|
504
|
+
3. Adicionar logs temporários
|
|
505
|
+
4. Pair programming com colega
|
|
506
|
+
```
|