@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,237 @@
|
|
|
1
|
+
# Prompt: Chaos Engineering
|
|
2
|
+
|
|
3
|
+
> **Prioridade**: 🟢 BAIXA
|
|
4
|
+
> **Aplicável a**: Projetos Nível 3 com alta disponibilidade
|
|
5
|
+
> **Pré-requisito**: SLOs definidos
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Prompt Base: Planejar Experimento
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Atue como engenheiro de confiabilidade (SRE).
|
|
13
|
+
|
|
14
|
+
Quero realizar experimentos de chaos engineering em:
|
|
15
|
+
- Sistema: [DESCREVA ARQUITETURA]
|
|
16
|
+
- Criticidade: [SLO DE DISPONIBILIDADE]
|
|
17
|
+
- Ambiente alvo: [staging/produção com X% do tráfego]
|
|
18
|
+
|
|
19
|
+
Objetivos:
|
|
20
|
+
1. Validar resiliência a [TIPO DE FALHA]
|
|
21
|
+
2. Testar [mecanismo: failover, circuit breaker, retry]
|
|
22
|
+
3. Medir tempo de detecção e recuperação
|
|
23
|
+
|
|
24
|
+
Gere:
|
|
25
|
+
|
|
26
|
+
1. **Hipótese**
|
|
27
|
+
- Quando [FALHA], o sistema deve [COMPORTAMENTO]
|
|
28
|
+
- Impacto esperado nos SLOs: [MÁXIMO ACEITÁVEL]
|
|
29
|
+
|
|
30
|
+
2. **Plano de Experimento**
|
|
31
|
+
- Escopo e blast radius
|
|
32
|
+
- Duração
|
|
33
|
+
- Métricas a observar
|
|
34
|
+
- Kill switch
|
|
35
|
+
|
|
36
|
+
3. **Pré-requisitos**
|
|
37
|
+
- Observabilidade necessária
|
|
38
|
+
- Alertas que devem disparar
|
|
39
|
+
- Time de standby
|
|
40
|
+
|
|
41
|
+
4. **Execução**
|
|
42
|
+
- Comandos/ferramenta para injetar falha
|
|
43
|
+
- Checklist de monitoramento
|
|
44
|
+
- Critérios para abortar
|
|
45
|
+
|
|
46
|
+
5. **Pós-experimento**
|
|
47
|
+
- Template de relatório
|
|
48
|
+
- Ações de follow-up
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Prompt: Experimento de Network Failure
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Preciso testar o comportamento quando há falha de rede entre serviços.
|
|
57
|
+
|
|
58
|
+
Arquitetura:
|
|
59
|
+
[DESCREVA: ex. Serviço A chama Serviço B via REST]
|
|
60
|
+
|
|
61
|
+
Cenário:
|
|
62
|
+
- Inserir latência de 5 segundos
|
|
63
|
+
- Depois, simular timeout completo (conexão refused)
|
|
64
|
+
|
|
65
|
+
Stack: [DESCREVA]
|
|
66
|
+
Ferramenta: [Toxiproxy/tc netem/Chaos Mesh]
|
|
67
|
+
|
|
68
|
+
Gere:
|
|
69
|
+
1. Hipótese de comportamento esperado
|
|
70
|
+
2. Configuração da ferramenta
|
|
71
|
+
3. O que observar (métricas, logs)
|
|
72
|
+
4. Resultados esperados (circuit breaker, fallback)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Prompt: Experimento de Database Failure
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Preciso testar o comportamento quando o banco de dados falha.
|
|
81
|
+
|
|
82
|
+
Setup:
|
|
83
|
+
- Banco: [PostgreSQL/MySQL com réplica]
|
|
84
|
+
- ORM: [Prisma/TypeORM/etc]
|
|
85
|
+
- Failover automático: [sim/não]
|
|
86
|
+
|
|
87
|
+
Cenários a testar:
|
|
88
|
+
1. Primary fica lento (queries demoram 10s)
|
|
89
|
+
2. Primary falha completamente
|
|
90
|
+
3. Réplica fica dessincronizada
|
|
91
|
+
|
|
92
|
+
Gere experimentos para cada cenário com:
|
|
93
|
+
- Como injetar a falha
|
|
94
|
+
- Comportamento esperado da aplicação
|
|
95
|
+
- Métricas críticas
|
|
96
|
+
- Critérios de sucesso
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Prompt: Game Day Planning
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
Quero organizar um Game Day (simulação de incidente) para o time.
|
|
105
|
+
|
|
106
|
+
Contexto:
|
|
107
|
+
- Sistema: [DESCREVA]
|
|
108
|
+
- Participantes: [X pessoas, roles]
|
|
109
|
+
- Duração: [2-4 horas]
|
|
110
|
+
|
|
111
|
+
O exercício deve:
|
|
112
|
+
1. Simular um incidente realista
|
|
113
|
+
2. Testar detecção e resposta
|
|
114
|
+
3. Validar runbooks
|
|
115
|
+
4. Treinar comunicação
|
|
116
|
+
|
|
117
|
+
Crie:
|
|
118
|
+
1. Cenário de incidente (o que vai "quebrar")
|
|
119
|
+
2. Timeline de eventos injetados
|
|
120
|
+
3. Pontos de observação para facilitadores
|
|
121
|
+
4. Template de retrospectiva
|
|
122
|
+
5. Métricas de sucesso do Game Day
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Exemplo: Plano de Experimento
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
Experiment:
|
|
131
|
+
Name: Service Dependency Timeout
|
|
132
|
+
Date: 2024-01-20
|
|
133
|
+
Lead: @engineer
|
|
134
|
+
|
|
135
|
+
Hypothesis: >
|
|
136
|
+
Quando o Payment Service não responder por 30 segundos,
|
|
137
|
+
o Checkout Service deve usar circuit breaker e retornar
|
|
138
|
+
erro gracioso em < 5 segundos, com fallback para modo offline.
|
|
139
|
+
|
|
140
|
+
Scope:
|
|
141
|
+
Environment: production
|
|
142
|
+
BlastRadius: 5% of traffic (canary deployment)
|
|
143
|
+
Duration: 10 minutes
|
|
144
|
+
Services: checkout-service, payment-service
|
|
145
|
+
|
|
146
|
+
Steady State:
|
|
147
|
+
Availability: 99.9%
|
|
148
|
+
Latency_p99: 500ms
|
|
149
|
+
Error_Rate: 0.1%
|
|
150
|
+
|
|
151
|
+
Injection:
|
|
152
|
+
Tool: Toxiproxy
|
|
153
|
+
Action: Add 30s latency to payment-service:8080
|
|
154
|
+
Command: |
|
|
155
|
+
toxiproxy-cli toxic add -t latency -a latency=30000 payment-service
|
|
156
|
+
|
|
157
|
+
Kill_Switch:
|
|
158
|
+
Auto:
|
|
159
|
+
- If error_rate > 1% for 2 minutes
|
|
160
|
+
- If latency_p99 > 5000ms for 1 minute
|
|
161
|
+
Manual:
|
|
162
|
+
- toxiproxy-cli toxic remove payment-service
|
|
163
|
+
- kubectl rollout undo deployment/checkout-canary
|
|
164
|
+
|
|
165
|
+
Monitoring:
|
|
166
|
+
Dashboards:
|
|
167
|
+
- url: https://grafana.internal/d/checkout-slo
|
|
168
|
+
- url: https://grafana.internal/d/payment-health
|
|
169
|
+
Alerts_Expected:
|
|
170
|
+
- payment-service-high-latency
|
|
171
|
+
- checkout-circuit-breaker-open
|
|
172
|
+
|
|
173
|
+
Communication:
|
|
174
|
+
Before: Anunciar no #engineering 15 min antes
|
|
175
|
+
During: Atualizações a cada 5 min no #incidents
|
|
176
|
+
After: Resumo no #engineering
|
|
177
|
+
|
|
178
|
+
Team:
|
|
179
|
+
Lead: @maria (executa experimento)
|
|
180
|
+
Observer: @joao (monitora métricas)
|
|
181
|
+
Oncall: @pedro (standby para reverter)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Prompt: Analisar Resultados
|
|
187
|
+
|
|
188
|
+
```text
|
|
189
|
+
Conduzi um experimento de chaos engineering:
|
|
190
|
+
|
|
191
|
+
Hipótese: [DESCREVA]
|
|
192
|
+
|
|
193
|
+
Resultados observados:
|
|
194
|
+
- [MÉTRICAS COLETADAS]
|
|
195
|
+
- [LOGS RELEVANTES]
|
|
196
|
+
- [ALERTAS DISPARADOS]
|
|
197
|
+
|
|
198
|
+
Incidentes durante o experimento:
|
|
199
|
+
- [SE HOUVE]
|
|
200
|
+
|
|
201
|
+
Analise:
|
|
202
|
+
1. A hipótese foi confirmada ou refutada?
|
|
203
|
+
2. Que fraquezas foram descobertas?
|
|
204
|
+
3. Os mecanismos de resiliência funcionaram?
|
|
205
|
+
4. Que ações de melhoria são recomendadas?
|
|
206
|
+
5. Próximos experimentos sugeridos
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Checklist de Experimento
|
|
212
|
+
|
|
213
|
+
### Antes
|
|
214
|
+
- [ ] Hipótese documentada
|
|
215
|
+
- [ ] Escopo e blast radius definidos
|
|
216
|
+
- [ ] Métricas baseline coletadas
|
|
217
|
+
- [ ] Kill switch configurado e testado
|
|
218
|
+
- [ ] Time informado
|
|
219
|
+
- [ ] Janela de manutenção acordada
|
|
220
|
+
|
|
221
|
+
### Durante
|
|
222
|
+
- [ ] Dashboards abertos
|
|
223
|
+
- [ ] Alertas monitorados
|
|
224
|
+
- [ ] Comunicação ativa
|
|
225
|
+
- [ ] Pronto para abortar se necessário
|
|
226
|
+
|
|
227
|
+
### Depois
|
|
228
|
+
- [ ] Relatório escrito
|
|
229
|
+
- [ ] Descobertas compartilhadas
|
|
230
|
+
- [ ] Tickets de melhoria criados
|
|
231
|
+
- [ ] Data do próximo experimento
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Referências
|
|
236
|
+
|
|
237
|
+
Consulte: [Guia de Chaos Engineering](../03-guias/Guia%20de%20Chaos%20Engineering.md)
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# Prompt: Estratégia de Observabilidade
|
|
2
|
+
|
|
3
|
+
> **Quando usar**: Fase de arquitetura ou antes de ir para produção
|
|
4
|
+
> **Especialista**: [Observabilidade](../../02-especialistas/Especialista%20em%20Observabilidade.md) ou [DevOps](../../02-especialistas/Especialista%20em%20DevOps%20e%20Infraestrutura.md)
|
|
5
|
+
> **Nível**: Médio a Complexo
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Fluxo de Contexto
|
|
10
|
+
|
|
11
|
+
Antes de usar este prompt, tenha em mãos:
|
|
12
|
+
- `docs/CONTEXTO.md` - Entendimento atual do projeto
|
|
13
|
+
- `docs/05-arquitetura/arquitetura.md` - Arquitetura do sistema
|
|
14
|
+
|
|
15
|
+
Após gerar, salve o resultado em:
|
|
16
|
+
- `docs/08-observabilidade/estrategia-observabilidade.md`
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Prompt Completo
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
Atue como SRE sênior especialista em observabilidade.
|
|
24
|
+
|
|
25
|
+
## Contexto do Projeto
|
|
26
|
+
|
|
27
|
+
[COLE O CONTEÚDO DE docs/CONTEXTO.md]
|
|
28
|
+
|
|
29
|
+
## Arquitetura
|
|
30
|
+
|
|
31
|
+
Componentes: [DESCREVA API, WORKERS, BANCO, CACHE, etc]
|
|
32
|
+
Stack: [TECNOLOGIAS]
|
|
33
|
+
Cloud: [AWS/GCP/Azure/On-premise]
|
|
34
|
+
Criticidade: [ALTA/MÉDIA/BAIXA]
|
|
35
|
+
SLA esperado: [UPTIME % - ex: 99.9%]
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Sua Missão
|
|
40
|
+
|
|
41
|
+
Projete a estratégia de observabilidade baseada nos 3 pilares:
|
|
42
|
+
|
|
43
|
+
### 1. Logging
|
|
44
|
+
|
|
45
|
+
#### 1.1 Formato Estruturado
|
|
46
|
+
Defina estrutura JSON padrão:
|
|
47
|
+
- Campos obrigatórios em todo log
|
|
48
|
+
- Campos por tipo de evento (request, error, business)
|
|
49
|
+
- Contexto a incluir (traceId, userId, etc)
|
|
50
|
+
|
|
51
|
+
#### 1.2 Níveis de Log
|
|
52
|
+
Quando usar cada nível:
|
|
53
|
+
- ERROR: [Quando usar, exemplos]
|
|
54
|
+
- WARN: [Quando usar, exemplos]
|
|
55
|
+
- INFO: [Quando usar, exemplos]
|
|
56
|
+
- DEBUG: [Quando usar, exemplos]
|
|
57
|
+
|
|
58
|
+
#### 1.3 O que Logar
|
|
59
|
+
- Requests HTTP (entrada e saída)
|
|
60
|
+
- Erros e exceptions (com stack trace)
|
|
61
|
+
- Eventos de negócio importantes
|
|
62
|
+
- Decisões do sistema (cache hit/miss, fallbacks)
|
|
63
|
+
- Auditoria (quem fez o quê)
|
|
64
|
+
|
|
65
|
+
#### 1.4 O que NÃO Logar
|
|
66
|
+
- PII (dados pessoais) - mascarar
|
|
67
|
+
- Tokens, secrets, passwords
|
|
68
|
+
- Payloads grandes (limitar tamanho)
|
|
69
|
+
- Health checks (ou log em nível menor)
|
|
70
|
+
|
|
71
|
+
#### 1.5 Onde Enviar
|
|
72
|
+
- Agregador sugerido (CloudWatch, Datadog, ELK, etc)
|
|
73
|
+
- Retenção por ambiente
|
|
74
|
+
- Estratégia de sampling para alto volume
|
|
75
|
+
|
|
76
|
+
### 2. Métricas
|
|
77
|
+
|
|
78
|
+
#### 2.1 RED Metrics (para serviços)
|
|
79
|
+
- **Rate**: requests/second
|
|
80
|
+
- **Errors**: error rate %
|
|
81
|
+
- **Duration**: latency percentiles (p50, p95, p99)
|
|
82
|
+
|
|
83
|
+
#### 2.2 USE Metrics (para recursos)
|
|
84
|
+
- **Utilization**: % de uso (CPU, memory, disk)
|
|
85
|
+
- **Saturation**: queue depth, waiting threads
|
|
86
|
+
- **Errors**: resource errors (OOM, disk full)
|
|
87
|
+
|
|
88
|
+
#### 2.3 Métricas de Negócio
|
|
89
|
+
[Sugerir 5-10 métricas específicas do domínio]
|
|
90
|
+
- Exemplo: agendamentos_criados_total
|
|
91
|
+
- Exemplo: valor_transacoes_sum
|
|
92
|
+
|
|
93
|
+
#### 2.4 Instrumentação
|
|
94
|
+
- Como expor métricas (Prometheus, StatsD, etc)
|
|
95
|
+
- Labels/dimensions importantes
|
|
96
|
+
- Naming convention
|
|
97
|
+
|
|
98
|
+
### 3. Tracing Distribuído
|
|
99
|
+
|
|
100
|
+
#### 3.1 Setup
|
|
101
|
+
- SDK recomendado (OpenTelemetry)
|
|
102
|
+
- Propagação de contexto entre serviços
|
|
103
|
+
- Instrumentação automática vs manual
|
|
104
|
+
|
|
105
|
+
#### 3.2 O que Instrumentar
|
|
106
|
+
- HTTP calls (in e out)
|
|
107
|
+
- Database queries (com query sanitizada)
|
|
108
|
+
- Cache operations
|
|
109
|
+
- Message queues (publish e consume)
|
|
110
|
+
- Serviços externos (APIs third-party)
|
|
111
|
+
|
|
112
|
+
#### 3.3 Sampling Strategy
|
|
113
|
+
- Estratégia recomendada (head-based vs tail-based)
|
|
114
|
+
- Taxa de amostragem por ambiente
|
|
115
|
+
- Always sample em erros
|
|
116
|
+
|
|
117
|
+
### 4. SLOs e Error Budget
|
|
118
|
+
|
|
119
|
+
#### 4.1 SLIs (Service Level Indicators)
|
|
120
|
+
| SLI | Fórmula | Medição |
|
|
121
|
+
|-----|---------|---------|
|
|
122
|
+
| Disponibilidade | (requests ok / total) * 100 | Prometheus |
|
|
123
|
+
| Latência | p95 < threshold | Histogram |
|
|
124
|
+
| Throughput | requests/sec | Counter |
|
|
125
|
+
|
|
126
|
+
#### 4.2 SLOs (Service Level Objectives)
|
|
127
|
+
| SLI | SLO | Janela |
|
|
128
|
+
|-----|-----|--------|
|
|
129
|
+
| Disponibilidade | [X%] | 30 dias |
|
|
130
|
+
| Latência p95 | < [X]ms | - |
|
|
131
|
+
| Error rate | < [X%] | 1 hora |
|
|
132
|
+
|
|
133
|
+
#### 4.3 Error Budget
|
|
134
|
+
- Cálculo: 100% - SLO = Budget
|
|
135
|
+
- Exemplo: SLO 99.9% = 43.2 min/mês de downtime permitido
|
|
136
|
+
- Ações quando budget está baixo
|
|
137
|
+
|
|
138
|
+
### 5. Alertas
|
|
139
|
+
|
|
140
|
+
#### 5.1 Alertas Críticos (P1 - Acordar de madrugada)
|
|
141
|
+
- Sistema fora do ar
|
|
142
|
+
- Error rate > X%
|
|
143
|
+
- Latência > X por Y minutos
|
|
144
|
+
|
|
145
|
+
#### 5.2 Alertas de Warning (P2 - Horário comercial)
|
|
146
|
+
- Error budget consumindo rápido
|
|
147
|
+
- Recursos próximos do limite
|
|
148
|
+
- Anomalias detectadas
|
|
149
|
+
|
|
150
|
+
#### 5.3 Multi-Window Burn Rate
|
|
151
|
+
Configuração para evitar false positives:
|
|
152
|
+
- Fast burn: 5% budget em 1h → alerta
|
|
153
|
+
- Slow burn: 10% budget em 6h → alerta
|
|
154
|
+
|
|
155
|
+
### 6. Dashboards
|
|
156
|
+
|
|
157
|
+
#### 6.1 Dashboard Principal (Four Golden Signals)
|
|
158
|
+
- Latência (p50, p95, p99)
|
|
159
|
+
- Tráfego (requests/sec)
|
|
160
|
+
- Erros (error rate %)
|
|
161
|
+
- Saturação (CPU, memory, connections)
|
|
162
|
+
|
|
163
|
+
#### 6.2 Dashboard de Debug
|
|
164
|
+
- Métricas detalhadas por endpoint
|
|
165
|
+
- Database query times
|
|
166
|
+
- Cache hit rates
|
|
167
|
+
- External API latencies
|
|
168
|
+
|
|
169
|
+
### 7. Runbook Template
|
|
170
|
+
|
|
171
|
+
Para cada alerta, documentar:
|
|
172
|
+
- O que significa o alerta
|
|
173
|
+
- Impacto para o usuário
|
|
174
|
+
- Passos de diagnóstico
|
|
175
|
+
- Ações de mitigação
|
|
176
|
+
- Escalation path
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Exemplo de Uso
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
Atue como SRE sênior especialista em observabilidade.
|
|
185
|
+
|
|
186
|
+
## Contexto do Projeto
|
|
187
|
+
|
|
188
|
+
Sistema de agendamento para salões de beleza.
|
|
189
|
+
API em produção, precisamos de observabilidade completa.
|
|
190
|
+
|
|
191
|
+
## Arquitetura
|
|
192
|
+
|
|
193
|
+
Componentes:
|
|
194
|
+
- API NestJS (2 pods no Kubernetes)
|
|
195
|
+
- PostgreSQL RDS
|
|
196
|
+
- Redis ElastiCache
|
|
197
|
+
- Worker de notificações (1 pod)
|
|
198
|
+
|
|
199
|
+
Stack: Node.js, TypeScript
|
|
200
|
+
Cloud: AWS
|
|
201
|
+
Criticidade: MÉDIA
|
|
202
|
+
SLA esperado: 99.9%
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Resposta Esperada
|
|
208
|
+
|
|
209
|
+
### Logs - Formato JSON
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"timestamp": "2024-01-01T10:00:00Z",
|
|
214
|
+
"level": "info",
|
|
215
|
+
"message": "Request processed",
|
|
216
|
+
"service": "api",
|
|
217
|
+
"traceId": "abc123",
|
|
218
|
+
"spanId": "def456",
|
|
219
|
+
"userId": "user-123",
|
|
220
|
+
"method": "POST",
|
|
221
|
+
"path": "/api/agendamentos",
|
|
222
|
+
"statusCode": 201,
|
|
223
|
+
"durationMs": 45
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Métricas RED
|
|
228
|
+
|
|
229
|
+
```prometheus
|
|
230
|
+
# Rate
|
|
231
|
+
http_requests_total{service="api", method="POST", path="/api/agendamentos", status="201"}
|
|
232
|
+
|
|
233
|
+
# Errors
|
|
234
|
+
rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])
|
|
235
|
+
|
|
236
|
+
# Duration
|
|
237
|
+
histogram_quantile(0.95, http_request_duration_seconds{service="api"})
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### SLOs
|
|
241
|
+
|
|
242
|
+
| SLI | SLO | Error Budget |
|
|
243
|
+
|-----|-----|--------------|
|
|
244
|
+
| Success rate (2xx/3xx) | 99.9% | 43 min/mês |
|
|
245
|
+
| Latency p95 | < 300ms | - |
|
|
246
|
+
| Disponibilidade | 99.9% | 43 min/mês |
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Checklist Pós-Geração
|
|
251
|
+
|
|
252
|
+
- [ ] Formato de log estruturado definido
|
|
253
|
+
- [ ] Níveis de log com exemplos
|
|
254
|
+
- [ ] RED metrics para serviços
|
|
255
|
+
- [ ] USE metrics para recursos
|
|
256
|
+
- [ ] Métricas de negócio específicas do domínio
|
|
257
|
+
- [ ] OpenTelemetry configurado
|
|
258
|
+
- [ ] SLIs e SLOs definidos
|
|
259
|
+
- [ ] Error budget calculado
|
|
260
|
+
- [ ] Alertas P1 e P2 separados
|
|
261
|
+
- [ ] Dashboard principal desenhado
|
|
262
|
+
- [ ] Runbook template criado
|
|
263
|
+
- [ ] Salvar em `docs/08-observabilidade/estrategia-observabilidade.md`
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Atue como SRE sênior especialista em observabilidade.
|
|
2
|
+
|
|
3
|
+
Sistema:
|
|
4
|
+
- Arquitetura: [DESCREVA COMPONENTES]
|
|
5
|
+
- Stack: [TECNOLOGIAS]
|
|
6
|
+
- Criticidade: [ALTA/MÉDIA/BAIXA]
|
|
7
|
+
- SLA esperado: [UPTIME %]
|
|
8
|
+
|
|
9
|
+
Projete a estratégia de observabilidade:
|
|
10
|
+
|
|
11
|
+
## 1. Logging
|
|
12
|
+
|
|
13
|
+
### 1.1 Formato
|
|
14
|
+
- Estrutura JSON recomendada
|
|
15
|
+
- Campos obrigatórios
|
|
16
|
+
- Contexto a incluir
|
|
17
|
+
|
|
18
|
+
### 1.2 Níveis
|
|
19
|
+
- Quando usar cada nível (error, warn, info, debug)
|
|
20
|
+
- Exemplos
|
|
21
|
+
|
|
22
|
+
### 1.3 O que logar
|
|
23
|
+
- Requests HTTP
|
|
24
|
+
- Erros e exceptions
|
|
25
|
+
- Eventos de negócio
|
|
26
|
+
- Decisões do sistema
|
|
27
|
+
|
|
28
|
+
### 1.4 O que NÃO logar
|
|
29
|
+
- PII
|
|
30
|
+
- Tokens/secrets
|
|
31
|
+
- Payloads grandes
|
|
32
|
+
|
|
33
|
+
## 2. Métricas
|
|
34
|
+
|
|
35
|
+
### 2.1 RED Metrics (para serviços)
|
|
36
|
+
- Rate: requests/second
|
|
37
|
+
- Errors: error rate
|
|
38
|
+
- Duration: latency percentiles
|
|
39
|
+
|
|
40
|
+
### 2.2 USE Metrics (para recursos)
|
|
41
|
+
- Utilization: % uso
|
|
42
|
+
- Saturation: queue depth
|
|
43
|
+
- Errors: resource errors
|
|
44
|
+
|
|
45
|
+
### 2.3 Métricas de Negócio
|
|
46
|
+
- [Métricas específicas do domínio]
|
|
47
|
+
|
|
48
|
+
### 2.4 Instrumentação
|
|
49
|
+
- Como expor métricas
|
|
50
|
+
- Labels/dimensions
|
|
51
|
+
|
|
52
|
+
## 3. Tracing Distribuído
|
|
53
|
+
|
|
54
|
+
### 3.1 Setup
|
|
55
|
+
- SDK recomendado (OpenTelemetry)
|
|
56
|
+
- Propagação de contexto
|
|
57
|
+
|
|
58
|
+
### 3.2 O que instrumentar
|
|
59
|
+
- HTTP calls
|
|
60
|
+
- Database queries
|
|
61
|
+
- Cache operations
|
|
62
|
+
- Message queues
|
|
63
|
+
|
|
64
|
+
### 3.3 Sampling
|
|
65
|
+
- Estratégia recomendada
|
|
66
|
+
- Taxa de amostragem
|
|
67
|
+
|
|
68
|
+
## 4. SLOs e Alertas
|
|
69
|
+
|
|
70
|
+
### 4.1 SLOs
|
|
71
|
+
| SLI | SLO | Janela |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| Disponibilidade | X% | 30 dias |
|
|
74
|
+
| Latência p95 | < Xms | - |
|
|
75
|
+
|
|
76
|
+
### 4.2 Error Budget
|
|
77
|
+
- Cálculo
|
|
78
|
+
- Ações quando baixo
|
|
79
|
+
|
|
80
|
+
### 4.3 Alertas
|
|
81
|
+
- Alertas críticos (P1)
|
|
82
|
+
- Alertas de warning (P2)
|
|
83
|
+
- Multi-window burn rate
|
|
84
|
+
|
|
85
|
+
## 5. Dashboards
|
|
86
|
+
|
|
87
|
+
### 5.1 Dashboard Principal
|
|
88
|
+
- Métricas no painel principal
|
|
89
|
+
- Layout sugerido
|
|
90
|
+
|
|
91
|
+
### 5.2 Dashboard de Debug
|
|
92
|
+
- Métricas detalhadas
|
|
93
|
+
|
|
94
|
+
## 6. Runbook Template
|
|
95
|
+
|
|
96
|
+
Para cada alerta, estrutura do runbook.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Resposta Esperada (Exemplo)
|
|
101
|
+
|
|
102
|
+
### Logs - Formato JSON
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"timestamp": "2024-01-01T10:00:00Z",
|
|
106
|
+
"level": "info",
|
|
107
|
+
"message": "Request processed",
|
|
108
|
+
"traceId": "abc123",
|
|
109
|
+
"spanId": "def456",
|
|
110
|
+
"userId": "user-123",
|
|
111
|
+
"method": "POST",
|
|
112
|
+
"path": "/api/orders",
|
|
113
|
+
"statusCode": 201,
|
|
114
|
+
"durationMs": 45
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Métricas RED
|
|
119
|
+
```
|
|
120
|
+
# Rate
|
|
121
|
+
http_requests_total{method, path, status}
|
|
122
|
+
|
|
123
|
+
# Errors
|
|
124
|
+
http_requests_total{status=~"5.."}
|
|
125
|
+
|
|
126
|
+
# Duration
|
|
127
|
+
http_request_duration_seconds{method, path} (histogram)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### SLOs
|
|
131
|
+
| SLI | SLO | Error Budget |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| Success rate (2xx/3xx) | 99.9% | 43 min/mês |
|
|
134
|
+
| Latency p95 | < 200ms | - |
|