@luanpdd/kit-mcp 1.35.0 → 1.36.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.
Files changed (117) hide show
  1. package/bin/cli.js +2 -2
  2. package/bin/mcp.js +6 -6
  3. package/bin/ui.js +74 -74
  4. package/gates/ai-prompt-stability.md +120 -120
  5. package/gates/budget-description.md +68 -68
  6. package/gates/confidence.md +29 -29
  7. package/gates/dependency-check.md +33 -33
  8. package/gates/dept-cycle-prevention.md +179 -179
  9. package/gates/golden-signals-coverage.md +133 -133
  10. package/gates/legacy-refactor-safety.md +178 -178
  11. package/gates/multi-tenant-rls-coverage.md +102 -102
  12. package/gates/no-personal-uuid.md +72 -72
  13. package/gates/obs-agents-mcp-supabase.md +86 -86
  14. package/gates/obs-skills-frontmatter.md +76 -76
  15. package/gates/observability-coverage.md +151 -151
  16. package/gates/omm-no-regression.md +83 -83
  17. package/gates/postmortem-template-required.md +127 -127
  18. package/gates/prr-checklist-coverage.md +128 -128
  19. package/gates/regression.md +32 -32
  20. package/gates/release-pipeline-policy.md +132 -132
  21. package/gates/secrets-scan.md +33 -33
  22. package/gates/service-role-not-in-user-facing.md +113 -113
  23. package/gates/skill-must-include.md +71 -71
  24. package/gates/sync-idempotent.md +62 -62
  25. package/gates/verify-phase-goal.md +34 -34
  26. package/kit/agents/designer-ui.md +216 -216
  27. package/kit/agents/workflow-generator.md +537 -167
  28. package/kit/commands/adicionar-backlog.md +1 -1
  29. package/kit/commands/adicionar-fase.md +1 -1
  30. package/kit/commands/adicionar-tarefa.md +1 -1
  31. package/kit/commands/auditar-observabilidade.md +103 -103
  32. package/kit/commands/auditar-toil.md +129 -129
  33. package/kit/commands/caracterizar-prompt.md +195 -195
  34. package/kit/commands/criar-workflow.md +158 -158
  35. package/kit/commands/definir-perfil.md +1 -1
  36. package/kit/commands/definir-slo.md +108 -108
  37. package/kit/commands/fio.md +1 -1
  38. package/kit/commands/golden-signals.md +142 -142
  39. package/kit/commands/instrumentar-fase.md +200 -200
  40. package/kit/commands/investigar-producao.md +162 -162
  41. package/kit/commands/observabilidade.md +118 -118
  42. package/kit/commands/postmortem.md +179 -179
  43. package/kit/commands/prr.md +205 -205
  44. package/kit/commands/publicar-rapido.md +207 -207
  45. package/kit/commands/risk-budget.md +220 -220
  46. package/kit/commands/sre.md +230 -230
  47. package/kit/file-manifest.json +424 -424
  48. package/kit/framework/references/output-style.md +22 -22
  49. package/kit/hooks/post-apply-migration.js +199 -199
  50. package/kit/hooks/sidecar-tool-publisher.js +210 -210
  51. package/kit/skills/_shared-dados-distribuidos/glossary.md +224 -224
  52. package/kit/skills/_shared-legacy/glossary.md +389 -389
  53. package/kit/skills/_shared-multi-tenant/glossary.md +186 -186
  54. package/kit/skills/_shared-observability/glossary.md +396 -396
  55. package/kit/skills/_shared-sre/glossary.md +712 -712
  56. package/kit/skills/_shared-supabase/glossary.md +234 -234
  57. package/kit/skills/blameless-postmortems/SKILL.md +340 -340
  58. package/kit/skills/burn-rate-alerting/SKILL.md +258 -258
  59. package/kit/skills/cascading-failures/SKILL.md +311 -311
  60. package/kit/skills/core-analysis-loop/SKILL.md +352 -352
  61. package/kit/skills/distributed-tracing/SKILL.md +362 -362
  62. package/kit/skills/dynamic-workflow-authoring/SKILL.md +327 -223
  63. package/kit/skills/eliminating-toil/SKILL.md +243 -243
  64. package/kit/skills/event-based-slos/SKILL.md +296 -296
  65. package/kit/skills/four-golden-signals/SKILL.md +314 -314
  66. package/kit/skills/hermetic-builds/SKILL.md +323 -323
  67. package/kit/skills/legacy-monster-methods/SKILL.md +444 -444
  68. package/kit/skills/llm-as-dependency/SKILL.md +436 -436
  69. package/kit/skills/load-shedding-graceful-degradation/SKILL.md +396 -396
  70. package/kit/skills/observability-driven-development/SKILL.md +315 -315
  71. package/kit/skills/observability-maturity-model/SKILL.md +222 -222
  72. package/kit/skills/opentelemetry-standard/SKILL.md +351 -351
  73. package/kit/skills/production-readiness-review/SKILL.md +305 -305
  74. package/kit/skills/release-engineering/SKILL.md +367 -367
  75. package/kit/skills/retry-strategies/SKILL.md +372 -372
  76. package/kit/skills/sre-risk-management/SKILL.md +221 -221
  77. package/kit/skills/structured-events/SKILL.md +265 -265
  78. package/kit/skills/supabase-cron-queues/SKILL.md +275 -275
  79. package/kit/skills/supabase-database-functions/SKILL.md +332 -332
  80. package/kit/skills/supabase-declarative-schema/SKILL.md +183 -183
  81. package/kit/skills/supabase-pgvector-rag/SKILL.md +253 -253
  82. package/kit/skills/supabase-postgres-style/SKILL.md +138 -138
  83. package/kit/skills/supabase-storage/SKILL.md +234 -234
  84. package/kit/skills/telemetry-pipelines/SKILL.md +259 -259
  85. package/kit/skills/telemetry-sampling/SKILL.md +256 -256
  86. package/kit/skills/ui-anti-padroes-ia/SKILL.md +261 -261
  87. package/kit/skills/ui-contexto-produto/SKILL.md +248 -248
  88. package/kit/skills/ui-cor-estrategia/SKILL.md +213 -213
  89. package/kit/skills/ui-critica-auditoria/SKILL.md +260 -260
  90. package/kit/skills/ui-motion-funcional/SKILL.md +264 -264
  91. package/kit/skills/ui-ritmo-espacial/SKILL.md +259 -259
  92. package/kit/skills/ui-tipografia/SKILL.md +211 -211
  93. package/package.json +1 -1
  94. package/src/cli/index.js +1114 -1114
  95. package/src/cli/render.js +194 -194
  96. package/src/cli/upgrade-check.js +135 -135
  97. package/src/core/error-redaction.js +76 -76
  98. package/src/core/failures.js +153 -153
  99. package/src/core/gate-runner.js +205 -205
  100. package/src/core/gates.js +82 -82
  101. package/src/core/logger.js +170 -170
  102. package/src/core/manifest-verify.js +174 -174
  103. package/src/core/metrics.js +268 -268
  104. package/src/core/notify.js +60 -60
  105. package/src/core/path-safety.js +141 -141
  106. package/src/core/replays.js +120 -120
  107. package/src/core/ui.js +185 -185
  108. package/src/mcp-server/install.js +149 -149
  109. package/src/mcp-server/roots.js +124 -124
  110. package/src/ui/auto-spawn.js +113 -113
  111. package/src/ui/browser.js +78 -78
  112. package/src/ui/client.js +130 -130
  113. package/src/ui/events.js +65 -65
  114. package/src/ui/lockfile.js +191 -191
  115. package/src/ui/port.js +67 -67
  116. package/src/ui/server.js +547 -547
  117. package/src/ui/wrapper.js +129 -129
@@ -1,305 +1,305 @@
1
- ---
2
- name: production-readiness-review
3
- description: Use antes de aceitar serviço em produção — PRR checklist 6 axes (System/Instrumentation/Emergency/Capacity/Change/Performance), 3 engagement models, handoff dev→SRE.
4
- ---
5
-
6
- # SRE — Production Readiness Review (PRR)
7
-
8
- ## Quando usar
9
-
10
- LLM carrega esta skill ao avaliar serviço/feature antes de produção, conduzir handoff dev→SRE, ou definir engagement model. Trigger phrases:
11
-
12
- - "PRR", "production readiness review"
13
- - "production-bound", "ready for prod"
14
- - "handoff dev to SRE"
15
- - "engagement model", "early engagement"
16
- - "SRE platform", "frameworks readiness"
17
- - "Google SRE cap 32"
18
- - "system architecture / instrumentation / emergency response / capacity / change / performance"
19
-
20
- ## Regras absolutas
21
-
22
- - **PRR é GATE, não recomendação** — feature/serviço sem PRR aprovado NÃO entra em produção real (apenas dogfooding/staging). Sem gate, "production-ready" vira slogan; com gate, vira invariante.
23
- - **6 axes obrigatórios** — System Architecture, Instrumentation/Metrics/Monitoring, Emergency Response, Capacity Planning, Change Management, Performance. Pular um axe = aprovação inválida (lacuna oculta vira incident em 6 meses).
24
- - **3 engagement models — escolher conforme custo do serviço** — Simple PRR (serviços pequenos/internal), Early Engagement (serviços críticos), Frameworks/SRE Platform (serviços built on top of platform). Modelo errado = ou over-investment (Simple para tier-1) ou under-investment (Early para internal tool).
25
- - **PRR é ANTES, não DEPOIS** — não "deploy primeiro, fazer PRR depois". PRR conclusão é pré-requisito de aceitar tráfego real (≥ 1% de usuários).
26
- - **PRR é EVIDENCE-BASED, não opinião** — cada item do checklist tem critério verificável (load test report, runbook URL, dashboard link). "Acreditamos que está pronto" ≠ PRR aprovado.
27
- - **Action items P0 = blocker; P1 = scheduled** — gaps P0 (sem instrumentação básica, sem rollback, sem on-call) bloqueiam aprovação. Gaps P1 (otimização capacidade, runbook adicional) viram tasks com due date — não bloqueiam, mas são tracked.
28
- - **Reviewer ≠ time dev** — PRR conduzido por SRE ou par externo ao time dev (eyes-on-code novos, viés reduzido). Auto-PRR pelo time dev = oversight.
29
- - **PRR é vivo, não one-shot** — após mudança maior (rewrite, novo dependency, RPS 10×), re-run PRR. Statement "passou PRR uma vez em 2024" não é evidence em 2026.
30
-
31
- ## Patterns canônicos
32
-
33
- ### Pattern: checklist canônico PRR — 6 axes detalhados
34
-
35
- ````markdown
36
- ```markdown
37
- # PRR Checklist — <serviço/feature> — <data>
38
-
39
- Reviewer: @<sre-or-external>
40
- Status: Draft | In Review | Approved | Blocked
41
-
42
- ---
43
-
44
- ## Axe 1: System Architecture
45
-
46
- - [ ] **Redundância**: serviço tolera falha de N instâncias (N=1 mínimo, N=2 ideal). Evidence: deployment manifest (replicas: 2+).
47
- - [ ] **Single point of failure mapeado**: SPOFs documentados; mitigation plan claro. Evidence: arch diagram + SPOF list.
48
- - [ ] **Failure modes mapeados**: top 5 modos de falha conhecidos com impact + mitigation. Evidence: failure mode analysis doc.
49
- - [ ] **Load balancing strategy**: round-robin / least-conn / consistent-hash documentado. Evidence: LB config.
50
- - [ ] **Graceful degradation**: serviço degrada (não crasha) sob carga ou dependency failure. Evidence: chaos test report ou load test config.
51
-
52
- ## Axe 2: Instrumentation, Metrics, Monitoring
53
-
54
- - [ ] **4 golden signals presentes**: Latency (histogram), Traffic (counter), Errors (counter por error.type), Saturation (gauge). Evidence: dashboard URL + queries.
55
- - [ ] **SLI/SLO definidos**: ao menos 1 SLO por jornada crítica do user (ver [event-based-slos](../event-based-slos/SKILL.md)). Evidence: SLO.md em `.planning/slos/`.
56
- - [ ] **Alertas SLO burn-rate**: NÃO threshold em CPU/mem/etc. Evidence: alert rules em código + correlação com SLO definido.
57
- - [ ] **Logs estruturados**: wide events com campos canônicos (`user.id`, `request.id`, `error.type`, `result.success`, `duration_ms`, `build_id`). Evidence: log query exemplo.
58
- - [ ] **Traces propagados**: W3C TraceContext header em hops cross-service. Evidence: trace exemplo cross-service.
59
-
60
- ## Axe 3: Emergency Response
61
-
62
- - [ ] **Runbook existe e foi testado**: passos para incident comuns (5+ scenarios). Evidence: URL do runbook + log do último teste.
63
- - [ ] **On-call rotation definida**: schedule visível, ≥ 2 pessoas, escalation policy. Evidence: PagerDuty/Opsgenie schedule.
64
- - [ ] **Page routing**: alertas SLO → on-call específico (não generic). Evidence: alert routing rules.
65
- - [ ] **Escalation policy**: timeline clara (page → 5 min ack → 15 min escalate to L2 → 30 min L3). Evidence: doc.
66
- - [ ] **Wheel of Misfortune realizado nos últimos 90d**: time praticou response em incident histórico. Evidence: data + participantes.
67
-
68
- ## Axe 4: Capacity Planning
69
-
70
- - [ ] **Load test executado**: pico esperado × 2 testado; report com latency degradation curve. Evidence: load test report.
71
- - [ ] **RPS limit documentado**: serviço sabe seu max sustainable RPS por instance. Evidence: number + source.
72
- - [ ] **Auto-scaling testado**: scale-up + scale-down funcionam sem intervenção manual. Evidence: scaling test log.
73
- - [ ] **Quota/rate-limit por tenant**: tenant abusivo não derruba serviço para outros. Evidence: rate-limit config.
74
- - [ ] **Headroom ≥ 30%**: capacidade atual / pico esperado ≥ 1.3. Evidence: cálculo + dashboard.
75
-
76
- ## Axe 5: Change Management
77
-
78
- - [ ] **Canary release**: deploys vão para 1% → 10% → 100% com hold em cada estágio. Evidence: CI pipeline config.
79
- - [ ] **Feature flags**: features novas atrás de flag (deploy ≠ release). Evidence: feature flag service.
80
- - [ ] **Rollback automatizado**: SLO burn rate > N nos primeiros M min após deploy → rollback automático. Evidence: rollback automation config.
81
- - [ ] **CI/CD gates obrigatórios**: testes + lint + security scan + load test (em paths críticos). Evidence: CI config.
82
- - [ ] **Deploy frequency mensurado**: time conhece sua deploy cadence (commits/dia ou /semana). Evidence: metric URL.
83
-
84
- ## Axe 6: Performance
85
-
86
- - [ ] **Latency baseline (p50/p95/p99/p99.9)**: número conhecido para cada percentil principal. Evidence: dashboard query.
87
- - [ ] **Error budget definido**: SLO target × window definidos; budget calculado. Evidence: SLO.md.
88
- - [ ] **Saturation tracked**: CPU / memory / connection pool / queue depth — recurso mais escasso identificado. Evidence: gauge query.
89
- - [ ] **Long tail (p99.9) monitored**: não só p50; alerta se p99.9 > N×p50 (regression detection). Evidence: query.
90
- - [ ] **Risk continuum justificado**: target SLO escolhido com base em risk × innovation, não default 99.99%. Evidence: justificativa em SLO.md (ver [sre-risk-management](../sre-risk-management/SKILL.md)).
91
-
92
- ---
93
-
94
- ## Action Items
95
-
96
- | # | Axe | Item | Severity | Owner | Due |
97
- |---|-----|------|----------|-------|-----|
98
- | 1 | 2 | Adicionar saturation gauge em /api/v1/orders | P0 | @bob | 2026-05-15 |
99
- | 2 | 4 | Documentar RPS limit em runbook | P1 | @alice | 2026-05-22 |
100
-
101
- ## Decisão
102
-
103
- - [x] **Approved** — service production-ready
104
- - [ ] **Approved with conditions** — P1s tracked, P0s blockers em release próximo
105
- - [ ] **Blocked** — P0 gaps; service NÃO aceita tráfego real até resolução
106
-
107
- ## Reviewer signature
108
-
109
- Reviewer: @<sre>
110
- Date: YYYY-MM-DD
111
- ```
112
- ````
113
-
114
- ### Pattern: 3 engagement models — quando usar cada
115
-
116
- | Modelo | Quando usar | SRE involvement | Custo SRE |
117
- |---|---|---|---|
118
- | **Simple PRR** | Serviços pequenos, internal tools, dogfood-only | Reviewer 1 sessão; checklist preenchido por dev | Baixo (4-8h) |
119
- | **Early Engagement** | Serviços críticos (tier-1), customer-facing, expected RPS > 1k/s | SRE participa do design; junior review em milestones; full PRR pré-launch | Médio (semanas) |
120
- | **Frameworks / SRE Platform** | Serviços built on top of plataforma SRE-blessed (lib + templates + gates já PRR-ready) | SRE manteve plataforma; dev usa scaffolds; PRR é confirmação que dev seguiu plataforma | Baixo recorrente, alto setup inicial |
121
-
122
- Modelo escolhido pelo **custo de outage** do serviço:
123
-
124
- - Outage < $1k/min → Simple PRR (1 sessão, checklist)
125
- - Outage $1k-100k/min → Early Engagement (SRE no design)
126
- - Outage > $100k/min OR > 10 microserviços similares → Platform (libs/scaffolds eliminam toil de PRR)
127
-
128
- ### Pattern: handoff dev → SRE — sequência canônica
129
-
130
- ```text
131
- 1. Dev declara intenção: "Esse serviço vai produção em 2026-MM-DD."
132
- 2. Reviewer SRE aceita engagement model (Simple/Early/Platform).
133
- 3. Dev preenche PRR checklist (6 axes) com evidence em cada item.
134
- 4. Reviewer abre PRR-REPORT.md em .planning/prr/<service>.md, score cada axe (Pass/Fail/N-A).
135
- 5. Reviewer + dev discutem gaps:
136
- - P0 (blocker): dev resolve antes de production ship
137
- - P1 (scheduled): owner + due date; tracked em roadmap
138
- - P2 (optional): documentado mas não obrigatório
139
- 6. Após P0s resolvidos, reviewer marca Approved e assina.
140
- 7. Dev ship (canary 1% → 100%).
141
- 8. Pós-launch: SRE review SLO compliance em 7d, 30d, 90d.
142
- 9. Re-PRR triggered em mudanças maiores (rewrite, RPS 10×, novo dependency tier-1).
143
- ```
144
-
145
- ### Pattern: SRE Platform como amplificador
146
-
147
- ```text
148
- Plataforma SRE consiste em:
149
-
150
- 1. Library/SDK que codifica boas práticas (otel-by-default, structured-logging-by-default,
151
- 4-golden-signals-by-default, rate-limit-by-default, circuit-breaker-by-default)
152
- 2. Scaffolds/templates de novo serviço (kit-mcp 's `/sre`, e.g., `/sre new-service <name>`)
153
- 3. CI gates que verificam adequação à plataforma (gates de Phase 41:
154
- golden-signals-coverage, postmortem-template-required, prr-checklist-coverage)
155
- 4. Runbook templates por categoria de serviço (HTTP API, async worker, batch job)
156
-
157
- Resultado: novo serviço nasce com 80% do PRR já passado por design.
158
- PRR vira confirmação ("você usou a plataforma?"), não auditoria de zero.
159
-
160
- Trade-off: setup inicial alto (semanas-meses para escrever plataforma).
161
- Recomendado para org com 10+ microserviços similares.
162
- ```
163
-
164
- ### Pattern: PRR-REPORT.md template canônico
165
-
166
- ````markdown
167
- ```markdown
168
- # PRR-REPORT — <serviço/feature> — <data>
169
-
170
- **Reviewer:** @<sre-or-external>
171
- **Engagement model:** Simple PRR | Early Engagement | Frameworks/Platform
172
- **Status:** Approved | Approved with conditions | Blocked
173
-
174
- ## Sumário executivo
175
-
176
- Resultado por axe (1-2 linhas cada):
177
-
178
- | Axe | Score | Status |
179
- |-----|-------|--------|
180
- | 1. System Architecture | 5/5 | Pass |
181
- | 2. Instrumentation, Metrics, Monitoring | 4/5 | Pass with gaps |
182
- | 3. Emergency Response | 3/5 | Fail (P0) |
183
- | 4. Capacity Planning | 4/5 | Pass with gaps |
184
- | 5. Change Management | 5/5 | Pass |
185
- | 6. Performance | 4/5 | Pass with gaps |
186
-
187
- ## Detalhamento por axe
188
-
189
- [seção por axe com itens checked + evidence + gaps]
190
-
191
- ## Action Items
192
-
193
- [tabela com P0/P1/P2 + owner + due]
194
-
195
- ## Aprovação
196
-
197
- [Approved / Approved with conditions / Blocked]
198
- [Assinatura + data]
199
- ```
200
- ````
201
-
202
- ## Anti-patterns
203
-
204
- ### ANTI: PRR depois do launch
205
-
206
- ```text
207
- ANTI: fazer PRR após serviço já em produção.
208
-
209
- PROBLEMA: gaps P0 já causaram incidents (sem instrumentação significa SEV1 cego);
210
- valor de gate perdido; PRR vira post-mortem disfarçado.
211
-
212
- CERTO: PRR ANTES de aceitar tráfego real (≥ 1%); blocker se P0 pendente.
213
- PRR conclusão é pré-requisito de aceitar tráfego, não follow-up.
214
- ```
215
-
216
- ### ANTI: auto-PRR pelo time dev
217
-
218
- ```text
219
- ANTI: time dev preenche checklist + auto-aprova.
220
-
221
- PROBLEMA: confirmation bias (dev acredita que serviço é maduro); itens vagos
222
- passam ("Sim, temos monitoring"); gaps invisíveis até incident.
223
-
224
- CERTO: reviewer EXTERNO ao time (SRE ou outro time dev sênior); evidence-based
225
- em cada item; dev preenche, externo verifica.
226
- ```
227
-
228
- ### ANTI: pular axes "menos relevantes"
229
-
230
- ```text
231
- ANTI: "Esse serviço é simples, não precisa de capacity planning."
232
-
233
- PROBLEMA: axe pulado vira lacuna; "simples" é subjetivo; decisão baseada em
234
- assumption sem evidence.
235
-
236
- CERTO: TODOS os 6 axes preenchidos. Item N/A é resposta válida (com justificativa)
237
- — pular silenciosamente NÃO é. Para serviços pequenos, model "Simple PRR"
238
- cobre os 6 em 4-8h.
239
- ```
240
-
241
- ### ANTI: PRR como rubber stamp
242
-
243
- ```text
244
- ANTI: reviewer aprova sem ler evidence; meeting 15 min; checklist marcado "looks good".
245
-
246
- PROBLEMA: first-incident (em 3-6 meses) revela 5+ gaps; reviewer responsabilidade
247
- compartilhada por incident.
248
-
249
- CERTO: reviewer aplica time-budget (4-8h Simple, dias Early); evidence verificada
250
- em cada item; não-OK = blocker, não "todos têm gaps".
251
- ```
252
-
253
- ### ANTI: engagement model errado para custo
254
-
255
- ```text
256
- ANTI: Simple PRR para tier-1 (outage > $100k/min) OU Early Engagement para internal
257
- tool com 5 usuários.
258
-
259
- PROBLEMA: Simple para tier-1 — SRE não engajou no design; problemas estruturais
260
- inviáveis de fix pós-launch; tier-1 com instabilidade. Early para
261
- internal tool — over-investment SRE; deslocamento de trabalho importante.
262
-
263
- CERTO: escolher model conforme custo de outage (regra do glossário: < $1k/min =
264
- Simple, > $100k/min = Platform).
265
- ```
266
-
267
- ### ANTI: PRR one-shot
268
-
269
- ```text
270
- ANTI: passou PRR em 2024, foi para prod, nunca re-PRR'd.
271
-
272
- PROBLEMA: 2 anos depois — dependency new, RPS 10×, código rewrote, time rotated;
273
- PRR original irrelevante.
274
-
275
- CERTO: re-PRR triggered em (a) rewrite > 50%, (b) RPS escala > 10×, (c) novo
276
- dependency tier-1, (d) time-of-record rotation > 50%, (e) anualmente como
277
- hygiene.
278
- ```
279
-
280
- ## Verificação
281
-
282
- Antes de marcar PRR como `Approved`:
283
-
284
- 1. **6 axes preenchidos** — System Architecture, Instrumentation/Metrics/Monitoring, Emergency Response, Capacity Planning, Change Management, Performance
285
- 2. **Cada item tem evidence** — não checkbox vago; evidence concreta (URL/query/doc) em cada
286
- 3. **Engagement model escolhido apropriadamente** — Simple PRR/Early Engagement/Frameworks-Platform conforme custo de outage
287
- 4. **Reviewer ≠ time dev** — reviewer externo ou SRE
288
- 5. **P0s todos resolvidos** — gaps P0 são blockers; nenhum aberto pré-launch
289
- 6. **P1s tracked com owner + due** — escalonados em roadmap próximo
290
- 7. **PRR-REPORT.md em `.planning/prr/<service>.md`** — formato canônico
291
- 8. **Re-PRR trigger documentado** — quando re-PRR é triggered (rewrite, RPS 10×, etc.)
292
-
293
- ## Ver também
294
-
295
- - [`_shared-sre/glossary.md`](../_shared-sre/glossary.md) — termos canônicos PRR, 6 axes, 3 engagement models
296
- - [`four-golden-signals`](../four-golden-signals/SKILL.md) — Axe 2 (Instrumentation) exige os 4 signals
297
- - [`event-based-slos`](../event-based-slos/SKILL.md) (v1.9) — Axe 6 (Performance) exige SLO definido
298
- - [`burn-rate-alerting`](../burn-rate-alerting/SKILL.md) (v1.9) — Axe 2 (Instrumentation) exige SLO burn-rate alerts
299
- - [`sre-risk-management`](../sre-risk-management/SKILL.md) — Axe 6 (Performance) requer risk continuum justificativa
300
- - [`blameless-postmortems`](../blameless-postmortems/SKILL.md) — Axe 3 (Emergency Response) exige postmortem culture
301
- - [`eliminating-toil`](../eliminating-toil/SKILL.md) — Axe 5 (Change Management) verifica deploy não é toil
302
-
303
- ---
304
-
305
- *Material-fonte: Site Reliability Engineering — Beyer, Jones, Petoff, Murphy (Google/O'Reilly, 2016) — Cap 32: "The Evolving SRE Engagement Model".*
1
+ ---
2
+ name: production-readiness-review
3
+ description: Use antes de aceitar serviço em produção — PRR checklist 6 axes (System/Instrumentation/Emergency/Capacity/Change/Performance), 3 engagement models, handoff dev→SRE.
4
+ ---
5
+
6
+ # SRE — Production Readiness Review (PRR)
7
+
8
+ ## Quando usar
9
+
10
+ LLM carrega esta skill ao avaliar serviço/feature antes de produção, conduzir handoff dev→SRE, ou definir engagement model. Trigger phrases:
11
+
12
+ - "PRR", "production readiness review"
13
+ - "production-bound", "ready for prod"
14
+ - "handoff dev to SRE"
15
+ - "engagement model", "early engagement"
16
+ - "SRE platform", "frameworks readiness"
17
+ - "Google SRE cap 32"
18
+ - "system architecture / instrumentation / emergency response / capacity / change / performance"
19
+
20
+ ## Regras absolutas
21
+
22
+ - **PRR é GATE, não recomendação** — feature/serviço sem PRR aprovado NÃO entra em produção real (apenas dogfooding/staging). Sem gate, "production-ready" vira slogan; com gate, vira invariante.
23
+ - **6 axes obrigatórios** — System Architecture, Instrumentation/Metrics/Monitoring, Emergency Response, Capacity Planning, Change Management, Performance. Pular um axe = aprovação inválida (lacuna oculta vira incident em 6 meses).
24
+ - **3 engagement models — escolher conforme custo do serviço** — Simple PRR (serviços pequenos/internal), Early Engagement (serviços críticos), Frameworks/SRE Platform (serviços built on top of platform). Modelo errado = ou over-investment (Simple para tier-1) ou under-investment (Early para internal tool).
25
+ - **PRR é ANTES, não DEPOIS** — não "deploy primeiro, fazer PRR depois". PRR conclusão é pré-requisito de aceitar tráfego real (≥ 1% de usuários).
26
+ - **PRR é EVIDENCE-BASED, não opinião** — cada item do checklist tem critério verificável (load test report, runbook URL, dashboard link). "Acreditamos que está pronto" ≠ PRR aprovado.
27
+ - **Action items P0 = blocker; P1 = scheduled** — gaps P0 (sem instrumentação básica, sem rollback, sem on-call) bloqueiam aprovação. Gaps P1 (otimização capacidade, runbook adicional) viram tasks com due date — não bloqueiam, mas são tracked.
28
+ - **Reviewer ≠ time dev** — PRR conduzido por SRE ou par externo ao time dev (eyes-on-code novos, viés reduzido). Auto-PRR pelo time dev = oversight.
29
+ - **PRR é vivo, não one-shot** — após mudança maior (rewrite, novo dependency, RPS 10×), re-run PRR. Statement "passou PRR uma vez em 2024" não é evidence em 2026.
30
+
31
+ ## Patterns canônicos
32
+
33
+ ### Pattern: checklist canônico PRR — 6 axes detalhados
34
+
35
+ ````markdown
36
+ ```markdown
37
+ # PRR Checklist — <serviço/feature> — <data>
38
+
39
+ Reviewer: @<sre-or-external>
40
+ Status: Draft | In Review | Approved | Blocked
41
+
42
+ ---
43
+
44
+ ## Axe 1: System Architecture
45
+
46
+ - [ ] **Redundância**: serviço tolera falha de N instâncias (N=1 mínimo, N=2 ideal). Evidence: deployment manifest (replicas: 2+).
47
+ - [ ] **Single point of failure mapeado**: SPOFs documentados; mitigation plan claro. Evidence: arch diagram + SPOF list.
48
+ - [ ] **Failure modes mapeados**: top 5 modos de falha conhecidos com impact + mitigation. Evidence: failure mode analysis doc.
49
+ - [ ] **Load balancing strategy**: round-robin / least-conn / consistent-hash documentado. Evidence: LB config.
50
+ - [ ] **Graceful degradation**: serviço degrada (não crasha) sob carga ou dependency failure. Evidence: chaos test report ou load test config.
51
+
52
+ ## Axe 2: Instrumentation, Metrics, Monitoring
53
+
54
+ - [ ] **4 golden signals presentes**: Latency (histogram), Traffic (counter), Errors (counter por error.type), Saturation (gauge). Evidence: dashboard URL + queries.
55
+ - [ ] **SLI/SLO definidos**: ao menos 1 SLO por jornada crítica do user (ver [event-based-slos](../event-based-slos/SKILL.md)). Evidence: SLO.md em `.planning/slos/`.
56
+ - [ ] **Alertas SLO burn-rate**: NÃO threshold em CPU/mem/etc. Evidence: alert rules em código + correlação com SLO definido.
57
+ - [ ] **Logs estruturados**: wide events com campos canônicos (`user.id`, `request.id`, `error.type`, `result.success`, `duration_ms`, `build_id`). Evidence: log query exemplo.
58
+ - [ ] **Traces propagados**: W3C TraceContext header em hops cross-service. Evidence: trace exemplo cross-service.
59
+
60
+ ## Axe 3: Emergency Response
61
+
62
+ - [ ] **Runbook existe e foi testado**: passos para incident comuns (5+ scenarios). Evidence: URL do runbook + log do último teste.
63
+ - [ ] **On-call rotation definida**: schedule visível, ≥ 2 pessoas, escalation policy. Evidence: PagerDuty/Opsgenie schedule.
64
+ - [ ] **Page routing**: alertas SLO → on-call específico (não generic). Evidence: alert routing rules.
65
+ - [ ] **Escalation policy**: timeline clara (page → 5 min ack → 15 min escalate to L2 → 30 min L3). Evidence: doc.
66
+ - [ ] **Wheel of Misfortune realizado nos últimos 90d**: time praticou response em incident histórico. Evidence: data + participantes.
67
+
68
+ ## Axe 4: Capacity Planning
69
+
70
+ - [ ] **Load test executado**: pico esperado × 2 testado; report com latency degradation curve. Evidence: load test report.
71
+ - [ ] **RPS limit documentado**: serviço sabe seu max sustainable RPS por instance. Evidence: number + source.
72
+ - [ ] **Auto-scaling testado**: scale-up + scale-down funcionam sem intervenção manual. Evidence: scaling test log.
73
+ - [ ] **Quota/rate-limit por tenant**: tenant abusivo não derruba serviço para outros. Evidence: rate-limit config.
74
+ - [ ] **Headroom ≥ 30%**: capacidade atual / pico esperado ≥ 1.3. Evidence: cálculo + dashboard.
75
+
76
+ ## Axe 5: Change Management
77
+
78
+ - [ ] **Canary release**: deploys vão para 1% → 10% → 100% com hold em cada estágio. Evidence: CI pipeline config.
79
+ - [ ] **Feature flags**: features novas atrás de flag (deploy ≠ release). Evidence: feature flag service.
80
+ - [ ] **Rollback automatizado**: SLO burn rate > N nos primeiros M min após deploy → rollback automático. Evidence: rollback automation config.
81
+ - [ ] **CI/CD gates obrigatórios**: testes + lint + security scan + load test (em paths críticos). Evidence: CI config.
82
+ - [ ] **Deploy frequency mensurado**: time conhece sua deploy cadence (commits/dia ou /semana). Evidence: metric URL.
83
+
84
+ ## Axe 6: Performance
85
+
86
+ - [ ] **Latency baseline (p50/p95/p99/p99.9)**: número conhecido para cada percentil principal. Evidence: dashboard query.
87
+ - [ ] **Error budget definido**: SLO target × window definidos; budget calculado. Evidence: SLO.md.
88
+ - [ ] **Saturation tracked**: CPU / memory / connection pool / queue depth — recurso mais escasso identificado. Evidence: gauge query.
89
+ - [ ] **Long tail (p99.9) monitored**: não só p50; alerta se p99.9 > N×p50 (regression detection). Evidence: query.
90
+ - [ ] **Risk continuum justificado**: target SLO escolhido com base em risk × innovation, não default 99.99%. Evidence: justificativa em SLO.md (ver [sre-risk-management](../sre-risk-management/SKILL.md)).
91
+
92
+ ---
93
+
94
+ ## Action Items
95
+
96
+ | # | Axe | Item | Severity | Owner | Due |
97
+ |---|-----|------|----------|-------|-----|
98
+ | 1 | 2 | Adicionar saturation gauge em /api/v1/orders | P0 | @bob | 2026-05-15 |
99
+ | 2 | 4 | Documentar RPS limit em runbook | P1 | @alice | 2026-05-22 |
100
+
101
+ ## Decisão
102
+
103
+ - [x] **Approved** — service production-ready
104
+ - [ ] **Approved with conditions** — P1s tracked, P0s blockers em release próximo
105
+ - [ ] **Blocked** — P0 gaps; service NÃO aceita tráfego real até resolução
106
+
107
+ ## Reviewer signature
108
+
109
+ Reviewer: @<sre>
110
+ Date: YYYY-MM-DD
111
+ ```
112
+ ````
113
+
114
+ ### Pattern: 3 engagement models — quando usar cada
115
+
116
+ | Modelo | Quando usar | SRE involvement | Custo SRE |
117
+ |---|---|---|---|
118
+ | **Simple PRR** | Serviços pequenos, internal tools, dogfood-only | Reviewer 1 sessão; checklist preenchido por dev | Baixo (4-8h) |
119
+ | **Early Engagement** | Serviços críticos (tier-1), customer-facing, expected RPS > 1k/s | SRE participa do design; junior review em milestones; full PRR pré-launch | Médio (semanas) |
120
+ | **Frameworks / SRE Platform** | Serviços built on top of plataforma SRE-blessed (lib + templates + gates já PRR-ready) | SRE manteve plataforma; dev usa scaffolds; PRR é confirmação que dev seguiu plataforma | Baixo recorrente, alto setup inicial |
121
+
122
+ Modelo escolhido pelo **custo de outage** do serviço:
123
+
124
+ - Outage < $1k/min → Simple PRR (1 sessão, checklist)
125
+ - Outage $1k-100k/min → Early Engagement (SRE no design)
126
+ - Outage > $100k/min OR > 10 microserviços similares → Platform (libs/scaffolds eliminam toil de PRR)
127
+
128
+ ### Pattern: handoff dev → SRE — sequência canônica
129
+
130
+ ```text
131
+ 1. Dev declara intenção: "Esse serviço vai produção em 2026-MM-DD."
132
+ 2. Reviewer SRE aceita engagement model (Simple/Early/Platform).
133
+ 3. Dev preenche PRR checklist (6 axes) com evidence em cada item.
134
+ 4. Reviewer abre PRR-REPORT.md em .planning/prr/<service>.md, score cada axe (Pass/Fail/N-A).
135
+ 5. Reviewer + dev discutem gaps:
136
+ - P0 (blocker): dev resolve antes de production ship
137
+ - P1 (scheduled): owner + due date; tracked em roadmap
138
+ - P2 (optional): documentado mas não obrigatório
139
+ 6. Após P0s resolvidos, reviewer marca Approved e assina.
140
+ 7. Dev ship (canary 1% → 100%).
141
+ 8. Pós-launch: SRE review SLO compliance em 7d, 30d, 90d.
142
+ 9. Re-PRR triggered em mudanças maiores (rewrite, RPS 10×, novo dependency tier-1).
143
+ ```
144
+
145
+ ### Pattern: SRE Platform como amplificador
146
+
147
+ ```text
148
+ Plataforma SRE consiste em:
149
+
150
+ 1. Library/SDK que codifica boas práticas (otel-by-default, structured-logging-by-default,
151
+ 4-golden-signals-by-default, rate-limit-by-default, circuit-breaker-by-default)
152
+ 2. Scaffolds/templates de novo serviço (kit-mcp 's `/sre`, e.g., `/sre new-service <name>`)
153
+ 3. CI gates que verificam adequação à plataforma (gates de Phase 41:
154
+ golden-signals-coverage, postmortem-template-required, prr-checklist-coverage)
155
+ 4. Runbook templates por categoria de serviço (HTTP API, async worker, batch job)
156
+
157
+ Resultado: novo serviço nasce com 80% do PRR já passado por design.
158
+ PRR vira confirmação ("você usou a plataforma?"), não auditoria de zero.
159
+
160
+ Trade-off: setup inicial alto (semanas-meses para escrever plataforma).
161
+ Recomendado para org com 10+ microserviços similares.
162
+ ```
163
+
164
+ ### Pattern: PRR-REPORT.md template canônico
165
+
166
+ ````markdown
167
+ ```markdown
168
+ # PRR-REPORT — <serviço/feature> — <data>
169
+
170
+ **Reviewer:** @<sre-or-external>
171
+ **Engagement model:** Simple PRR | Early Engagement | Frameworks/Platform
172
+ **Status:** Approved | Approved with conditions | Blocked
173
+
174
+ ## Sumário executivo
175
+
176
+ Resultado por axe (1-2 linhas cada):
177
+
178
+ | Axe | Score | Status |
179
+ |-----|-------|--------|
180
+ | 1. System Architecture | 5/5 | Pass |
181
+ | 2. Instrumentation, Metrics, Monitoring | 4/5 | Pass with gaps |
182
+ | 3. Emergency Response | 3/5 | Fail (P0) |
183
+ | 4. Capacity Planning | 4/5 | Pass with gaps |
184
+ | 5. Change Management | 5/5 | Pass |
185
+ | 6. Performance | 4/5 | Pass with gaps |
186
+
187
+ ## Detalhamento por axe
188
+
189
+ [seção por axe com itens checked + evidence + gaps]
190
+
191
+ ## Action Items
192
+
193
+ [tabela com P0/P1/P2 + owner + due]
194
+
195
+ ## Aprovação
196
+
197
+ [Approved / Approved with conditions / Blocked]
198
+ [Assinatura + data]
199
+ ```
200
+ ````
201
+
202
+ ## Anti-patterns
203
+
204
+ ### ANTI: PRR depois do launch
205
+
206
+ ```text
207
+ ANTI: fazer PRR após serviço já em produção.
208
+
209
+ PROBLEMA: gaps P0 já causaram incidents (sem instrumentação significa SEV1 cego);
210
+ valor de gate perdido; PRR vira post-mortem disfarçado.
211
+
212
+ CERTO: PRR ANTES de aceitar tráfego real (≥ 1%); blocker se P0 pendente.
213
+ PRR conclusão é pré-requisito de aceitar tráfego, não follow-up.
214
+ ```
215
+
216
+ ### ANTI: auto-PRR pelo time dev
217
+
218
+ ```text
219
+ ANTI: time dev preenche checklist + auto-aprova.
220
+
221
+ PROBLEMA: confirmation bias (dev acredita que serviço é maduro); itens vagos
222
+ passam ("Sim, temos monitoring"); gaps invisíveis até incident.
223
+
224
+ CERTO: reviewer EXTERNO ao time (SRE ou outro time dev sênior); evidence-based
225
+ em cada item; dev preenche, externo verifica.
226
+ ```
227
+
228
+ ### ANTI: pular axes "menos relevantes"
229
+
230
+ ```text
231
+ ANTI: "Esse serviço é simples, não precisa de capacity planning."
232
+
233
+ PROBLEMA: axe pulado vira lacuna; "simples" é subjetivo; decisão baseada em
234
+ assumption sem evidence.
235
+
236
+ CERTO: TODOS os 6 axes preenchidos. Item N/A é resposta válida (com justificativa)
237
+ — pular silenciosamente NÃO é. Para serviços pequenos, model "Simple PRR"
238
+ cobre os 6 em 4-8h.
239
+ ```
240
+
241
+ ### ANTI: PRR como rubber stamp
242
+
243
+ ```text
244
+ ANTI: reviewer aprova sem ler evidence; meeting 15 min; checklist marcado "looks good".
245
+
246
+ PROBLEMA: first-incident (em 3-6 meses) revela 5+ gaps; reviewer responsabilidade
247
+ compartilhada por incident.
248
+
249
+ CERTO: reviewer aplica time-budget (4-8h Simple, dias Early); evidence verificada
250
+ em cada item; não-OK = blocker, não "todos têm gaps".
251
+ ```
252
+
253
+ ### ANTI: engagement model errado para custo
254
+
255
+ ```text
256
+ ANTI: Simple PRR para tier-1 (outage > $100k/min) OU Early Engagement para internal
257
+ tool com 5 usuários.
258
+
259
+ PROBLEMA: Simple para tier-1 — SRE não engajou no design; problemas estruturais
260
+ inviáveis de fix pós-launch; tier-1 com instabilidade. Early para
261
+ internal tool — over-investment SRE; deslocamento de trabalho importante.
262
+
263
+ CERTO: escolher model conforme custo de outage (regra do glossário: < $1k/min =
264
+ Simple, > $100k/min = Platform).
265
+ ```
266
+
267
+ ### ANTI: PRR one-shot
268
+
269
+ ```text
270
+ ANTI: passou PRR em 2024, foi para prod, nunca re-PRR'd.
271
+
272
+ PROBLEMA: 2 anos depois — dependency new, RPS 10×, código rewrote, time rotated;
273
+ PRR original irrelevante.
274
+
275
+ CERTO: re-PRR triggered em (a) rewrite > 50%, (b) RPS escala > 10×, (c) novo
276
+ dependency tier-1, (d) time-of-record rotation > 50%, (e) anualmente como
277
+ hygiene.
278
+ ```
279
+
280
+ ## Verificação
281
+
282
+ Antes de marcar PRR como `Approved`:
283
+
284
+ 1. **6 axes preenchidos** — System Architecture, Instrumentation/Metrics/Monitoring, Emergency Response, Capacity Planning, Change Management, Performance
285
+ 2. **Cada item tem evidence** — não checkbox vago; evidence concreta (URL/query/doc) em cada
286
+ 3. **Engagement model escolhido apropriadamente** — Simple PRR/Early Engagement/Frameworks-Platform conforme custo de outage
287
+ 4. **Reviewer ≠ time dev** — reviewer externo ou SRE
288
+ 5. **P0s todos resolvidos** — gaps P0 são blockers; nenhum aberto pré-launch
289
+ 6. **P1s tracked com owner + due** — escalonados em roadmap próximo
290
+ 7. **PRR-REPORT.md em `.planning/prr/<service>.md`** — formato canônico
291
+ 8. **Re-PRR trigger documentado** — quando re-PRR é triggered (rewrite, RPS 10×, etc.)
292
+
293
+ ## Ver também
294
+
295
+ - [`_shared-sre/glossary.md`](../_shared-sre/glossary.md) — termos canônicos PRR, 6 axes, 3 engagement models
296
+ - [`four-golden-signals`](../four-golden-signals/SKILL.md) — Axe 2 (Instrumentation) exige os 4 signals
297
+ - [`event-based-slos`](../event-based-slos/SKILL.md) (v1.9) — Axe 6 (Performance) exige SLO definido
298
+ - [`burn-rate-alerting`](../burn-rate-alerting/SKILL.md) (v1.9) — Axe 2 (Instrumentation) exige SLO burn-rate alerts
299
+ - [`sre-risk-management`](../sre-risk-management/SKILL.md) — Axe 6 (Performance) requer risk continuum justificativa
300
+ - [`blameless-postmortems`](../blameless-postmortems/SKILL.md) — Axe 3 (Emergency Response) exige postmortem culture
301
+ - [`eliminating-toil`](../eliminating-toil/SKILL.md) — Axe 5 (Change Management) verifica deploy não é toil
302
+
303
+ ---
304
+
305
+ *Material-fonte: Site Reliability Engineering — Beyer, Jones, Petoff, Murphy (Google/O'Reilly, 2016) — Cap 32: "The Evolving SRE Engagement Model".*