@luanpdd/kit-mcp 1.34.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 (118) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +2 -2
  3. package/bin/mcp.js +6 -6
  4. package/bin/ui.js +74 -74
  5. package/gates/ai-prompt-stability.md +120 -120
  6. package/gates/budget-description.md +68 -68
  7. package/gates/confidence.md +29 -29
  8. package/gates/dependency-check.md +33 -33
  9. package/gates/dept-cycle-prevention.md +179 -179
  10. package/gates/golden-signals-coverage.md +133 -133
  11. package/gates/legacy-refactor-safety.md +178 -178
  12. package/gates/multi-tenant-rls-coverage.md +102 -102
  13. package/gates/no-personal-uuid.md +72 -72
  14. package/gates/obs-agents-mcp-supabase.md +86 -86
  15. package/gates/obs-skills-frontmatter.md +76 -76
  16. package/gates/observability-coverage.md +151 -151
  17. package/gates/omm-no-regression.md +83 -83
  18. package/gates/postmortem-template-required.md +127 -127
  19. package/gates/prr-checklist-coverage.md +128 -128
  20. package/gates/regression.md +32 -32
  21. package/gates/release-pipeline-policy.md +132 -132
  22. package/gates/secrets-scan.md +33 -33
  23. package/gates/service-role-not-in-user-facing.md +113 -113
  24. package/gates/skill-must-include.md +71 -71
  25. package/gates/sync-idempotent.md +62 -62
  26. package/gates/verify-phase-goal.md +34 -34
  27. package/kit/agents/designer-ui.md +216 -216
  28. package/kit/agents/workflow-generator.md +537 -0
  29. package/kit/commands/adicionar-backlog.md +1 -1
  30. package/kit/commands/adicionar-fase.md +1 -1
  31. package/kit/commands/adicionar-tarefa.md +1 -1
  32. package/kit/commands/auditar-observabilidade.md +103 -103
  33. package/kit/commands/auditar-toil.md +129 -129
  34. package/kit/commands/caracterizar-prompt.md +195 -195
  35. package/kit/commands/criar-workflow.md +158 -0
  36. package/kit/commands/definir-perfil.md +1 -1
  37. package/kit/commands/definir-slo.md +108 -108
  38. package/kit/commands/fio.md +1 -1
  39. package/kit/commands/golden-signals.md +142 -142
  40. package/kit/commands/instrumentar-fase.md +200 -200
  41. package/kit/commands/investigar-producao.md +162 -162
  42. package/kit/commands/observabilidade.md +118 -118
  43. package/kit/commands/postmortem.md +179 -179
  44. package/kit/commands/prr.md +205 -205
  45. package/kit/commands/publicar-rapido.md +207 -207
  46. package/kit/commands/risk-budget.md +220 -220
  47. package/kit/commands/sre.md +230 -230
  48. package/kit/file-manifest.json +5 -2
  49. package/kit/framework/references/output-style.md +22 -22
  50. package/kit/hooks/post-apply-migration.js +199 -199
  51. package/kit/hooks/sidecar-tool-publisher.js +210 -210
  52. package/kit/skills/_shared-dados-distribuidos/glossary.md +224 -224
  53. package/kit/skills/_shared-legacy/glossary.md +389 -389
  54. package/kit/skills/_shared-multi-tenant/glossary.md +186 -186
  55. package/kit/skills/_shared-observability/glossary.md +396 -396
  56. package/kit/skills/_shared-sre/glossary.md +712 -712
  57. package/kit/skills/_shared-supabase/glossary.md +234 -234
  58. package/kit/skills/blameless-postmortems/SKILL.md +340 -340
  59. package/kit/skills/burn-rate-alerting/SKILL.md +258 -258
  60. package/kit/skills/cascading-failures/SKILL.md +311 -311
  61. package/kit/skills/core-analysis-loop/SKILL.md +352 -352
  62. package/kit/skills/distributed-tracing/SKILL.md +362 -362
  63. package/kit/skills/dynamic-workflow-authoring/SKILL.md +327 -0
  64. package/kit/skills/eliminating-toil/SKILL.md +243 -243
  65. package/kit/skills/event-based-slos/SKILL.md +296 -296
  66. package/kit/skills/four-golden-signals/SKILL.md +314 -314
  67. package/kit/skills/hermetic-builds/SKILL.md +323 -323
  68. package/kit/skills/legacy-monster-methods/SKILL.md +444 -444
  69. package/kit/skills/llm-as-dependency/SKILL.md +436 -436
  70. package/kit/skills/load-shedding-graceful-degradation/SKILL.md +396 -396
  71. package/kit/skills/observability-driven-development/SKILL.md +315 -315
  72. package/kit/skills/observability-maturity-model/SKILL.md +222 -222
  73. package/kit/skills/opentelemetry-standard/SKILL.md +351 -351
  74. package/kit/skills/production-readiness-review/SKILL.md +305 -305
  75. package/kit/skills/release-engineering/SKILL.md +367 -367
  76. package/kit/skills/retry-strategies/SKILL.md +372 -372
  77. package/kit/skills/sre-risk-management/SKILL.md +221 -221
  78. package/kit/skills/structured-events/SKILL.md +265 -265
  79. package/kit/skills/supabase-cron-queues/SKILL.md +275 -275
  80. package/kit/skills/supabase-database-functions/SKILL.md +332 -332
  81. package/kit/skills/supabase-declarative-schema/SKILL.md +183 -183
  82. package/kit/skills/supabase-pgvector-rag/SKILL.md +253 -253
  83. package/kit/skills/supabase-postgres-style/SKILL.md +138 -138
  84. package/kit/skills/supabase-storage/SKILL.md +234 -234
  85. package/kit/skills/telemetry-pipelines/SKILL.md +259 -259
  86. package/kit/skills/telemetry-sampling/SKILL.md +256 -256
  87. package/kit/skills/ui-anti-padroes-ia/SKILL.md +261 -261
  88. package/kit/skills/ui-contexto-produto/SKILL.md +248 -248
  89. package/kit/skills/ui-cor-estrategia/SKILL.md +213 -213
  90. package/kit/skills/ui-critica-auditoria/SKILL.md +260 -260
  91. package/kit/skills/ui-motion-funcional/SKILL.md +264 -264
  92. package/kit/skills/ui-ritmo-espacial/SKILL.md +259 -259
  93. package/kit/skills/ui-tipografia/SKILL.md +211 -211
  94. package/package.json +1 -1
  95. package/src/cli/index.js +1114 -1114
  96. package/src/cli/render.js +194 -194
  97. package/src/cli/upgrade-check.js +135 -135
  98. package/src/core/error-redaction.js +76 -76
  99. package/src/core/failures.js +153 -153
  100. package/src/core/gate-runner.js +205 -205
  101. package/src/core/gates.js +82 -82
  102. package/src/core/logger.js +170 -170
  103. package/src/core/manifest-verify.js +174 -174
  104. package/src/core/metrics.js +268 -268
  105. package/src/core/notify.js +60 -60
  106. package/src/core/path-safety.js +141 -141
  107. package/src/core/replays.js +120 -120
  108. package/src/core/ui.js +185 -185
  109. package/src/mcp-server/install.js +149 -149
  110. package/src/mcp-server/roots.js +124 -124
  111. package/src/ui/auto-spawn.js +113 -113
  112. package/src/ui/browser.js +78 -78
  113. package/src/ui/client.js +130 -130
  114. package/src/ui/events.js +65 -65
  115. package/src/ui/lockfile.js +191 -191
  116. package/src/ui/port.js +67 -67
  117. package/src/ui/server.js +547 -547
  118. package/src/ui/wrapper.js +129 -129
@@ -1,220 +1,220 @@
1
- ---
2
- name: risk-budget
3
- description: Exibe error budget atual vs risk continuum (cap 3 SRE) — lê .planning/slos/, posiciona no continuum 99% → 99.999%, aplica sabedoria 99.99% e "as reliable as needs to be".
4
- argument-hint: "[<slo_name>] [--format table|json]"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Grep
9
- - Glob
10
- ---
11
-
12
- <objective>
13
- Snapshot read-only de **error budget vs risk continuum** (cap 3 do livro Google SRE) para 1 SLO ou todos. Aplica skill [`sre-risk-management`](../skills/sre-risk-management/SKILL.md) — risk continuum como decisão explícita, error budget como balanço risk × innovation, sabedoria 99.99% (user em smartphone 99% NÃO distingue 99.99% vs 99.999%), "as reliable as needs to be, no more".
14
-
15
- Lê SLOs definidos em [`event-based-slos`](../skills/event-based-slos/SKILL.md) (v1.9) — `.planning/slos/*.md`. Complementa [`burn-rate-status`](./burn-rate-status.md) (v1.9 — burn rate forecast) com **decisão estratégica** sobre target apropriado.
16
-
17
- **Cria/Atualiza:** nada — comando read-only.
18
-
19
- **Após:** o user vê posição de cada SLO no continuum, % budget gasto, custo relativo (1× → 100×+), e recomendação de tier (free/paid/enterprise) consistente com user-perception.
20
- </objective>
21
-
22
- <context>
23
- **Argumentos:** `$ARGUMENTS` — opcional `<slo_name>` para 1 SLO; sem args = todos os SLOs.
24
-
25
- **Flags:**
26
- - `--format <table|json>` — output format (default: `table`)
27
- - `--explain` — incluir bloco "sabedoria 99.99%" + anti-patterns inline (verbose)
28
-
29
- **Pré-requisito:** SLOs definidos em `.planning/slos/*.md` (v1.9 — comando `/observabilidade slo` ou `/definir-slo`).
30
-
31
- **Risk continuum canônico** (cap 3, aplicado inline pela skill):
32
-
33
- | Target | Tolerância 30d | User-perceptible? | Recomendação | Custo relativo |
34
- |---|---|---|---|---|
35
- | 99% | 7.2 h | Sim | Tier free, beta, internal | 1× |
36
- | 99.5% | 3.6 h | Notável | Tier free de produção | 2× |
37
- | 99.9% | 43.2 min | Aceitável para UX | Tier paid default | 5× |
38
- | 99.95% | 21.6 min | Quase imperceptível | Tier enterprise / mission-critical | 10× |
39
- | 99.99% | 4.3 min | Imperceptível em smartphone | Apenas se justificado (raro) | 50×+ |
40
- | 99.999% | 26 s | NÃO perceptível | NUNCA para user-facing | 100×+ |
41
-
42
- **Loop pattern:** rodar via skill `loop` para monitoramento contínuo.
43
-
44
- ```text
45
- /loop 1h /risk-budget
46
- ```
47
-
48
- **Exemplos:**
49
- ```
50
- /risk-budget # todos SLOs, formato table
51
- /risk-budget checkout_success # 1 SLO específico
52
- /risk-budget --format json # output estruturado
53
- /risk-budget login_success --explain # com sabedoria 99.99% + anti-patterns inline
54
- ```
55
- </context>
56
-
57
- <process>
58
-
59
- ## 1. Parsear argumentos
60
-
61
- ```bash
62
- SLO_NAME=$(echo "$ARGUMENTS" | awk '{print $1}' | grep -v '^--' || true)
63
- FORMAT=$(echo "$ARGUMENTS" | grep -oE -- '--format [^ ]+' | awk '{print $2}')
64
- EXPLAIN=$(echo "$ARGUMENTS" | grep -c -- '--explain' || echo 0)
65
-
66
- [ -z "$FORMAT" ] && FORMAT="table"
67
- ```
68
-
69
- ## 2. Listar SLOs
70
-
71
- ```bash
72
- if [ -n "$SLO_NAME" ]; then
73
- SLO_FILES=(".planning/slos/${SLO_NAME}.md")
74
- else
75
- SLO_FILES=(.planning/slos/*.md)
76
- fi
77
-
78
- if [ ${#SLO_FILES[@]} -eq 0 ] || [ ! -f "${SLO_FILES[0]}" ]; then
79
- echo "Nenhum SLO definido em .planning/slos/."
80
- echo "Defina um com: /observabilidade slo <feature> (v1.9)"
81
- exit 0
82
- fi
83
- ```
84
-
85
- ## 3. Para cada SLO, extrair metadados + computar posição no continuum
86
-
87
- Para cada `SLO_FILE`:
88
-
89
- ```bash
90
- SLO_NAME=$(basename "$SLO_FILE" .md)
91
- TARGET=$(grep -m1 -oE 'target.*[0-9.]+' "$SLO_FILE" | grep -oE '[0-9.]+')
92
- WINDOW=$(grep -m1 -oE 'window.*[0-9]+[dh]' "$SLO_FILE" | grep -oE '[0-9]+[dh]' || echo "30d")
93
- TIER_LABEL=$(grep -m1 'tier:' "$SLO_FILE" | sed 's/.*tier: //' || echo "(unset)")
94
- OWNER=$(grep -m1 'owner:' "$SLO_FILE" | sed 's/.*owner: //' || echo "(unset)")
95
- ```
96
-
97
- **Mapear target → posição no risk continuum** (skill `sre-risk-management` Pattern 1):
98
-
99
- | Target faixa | Posição | Custo relativo | Tier típico | User-perceptible |
100
- |---|---|---|---|---|
101
- | < 0.99 | abaixo do continuum (under-spec) | <1× | beta/dev | sim |
102
- | 0.99 ≤ t < 0.995 | 99% | 1× | free, beta, internal | sim (notável) |
103
- | 0.995 ≤ t < 0.999 | 99.5% | 2× | free de produção | notável em paths críticos |
104
- | 0.999 ≤ t < 0.9995 | 99.9% | 5× | paid default | aceitável para UX |
105
- | 0.9995 ≤ t < 0.9999 | 99.95% | 10× | enterprise/mission-critical | quase imperceptível |
106
- | 0.9999 ≤ t < 0.99999 | 99.99% | 50×+ | só com checklist 4-perguntas | imperceptível em smartphone |
107
- | t ≥ 0.99999 | 99.999% | 100×+ | NUNCA para user-facing | NÃO perceptível |
108
-
109
- **Computar budget gasto** (heurística — leitura grosseira do SLO file):
110
-
111
- ```bash
112
- # PT-BR: SLO file pode ter linha "**Budget consumido (snapshot):** XX%" atualizada por job
113
- BUDGET_USED_PCT=$(grep -m1 -oE 'Budget consumido.*[0-9]+%' "$SLO_FILE" | grep -oE '[0-9]+%' || echo "?")
114
-
115
- # PT-BR: se não, sugerir invocar /burn-rate-status (que tem queries live)
116
- if [ "$BUDGET_USED_PCT" = "?" ]; then
117
- BUDGET_USED_PCT="(invoque /burn-rate-status para snapshot live)"
118
- fi
119
- ```
120
-
121
- **Status no continuum** (4 níveis enum — interpretação canônica):
122
-
123
- - `OPTIMAL` — target apropriado para tier; budget < 50% gasto → "as reliable as needs to be"
124
- - `OVER-SPEC` — target acima do necessário (ex: tier free com 99.99%) → desperdício; baixar target
125
- - `UNDER-SPEC` — target abaixo do esperado (ex: enterprise com 99% só) → SLA risk; subir target
126
- - `BUDGET-EXHAUSTED` — budget < 10% restante → freeze releases; revisitar postmortems
127
-
128
- ## 4. Agregar resultados em tabela
129
-
130
- ```
131
- ═══════════════════════════════════════════════════════════
132
- framework ► RISK-BUDGET ▸ {timestamp}
133
- ═══════════════════════════════════════════════════════════
134
-
135
- | SLO | Target | Posição | Tier | Custo relativo | Budget gasto | Status | Decisão |
136
- |---|---|---|---|---|---|---|---|
137
- | checkout_success | 99.9% | 99.9% (5×) | paid | 5× | 23% | OPTIMAL | manter |
138
- | login_success | 99.99% | 99.99% (50×+) | enterprise | 50×+ | 78% | BUDGET-EXHAUSTED | freeze releases; checklist 4-perguntas? |
139
- | search_latency | 99% | 99% (1×) | free | 1× | 15% | OPTIMAL | manter (tier free OK) |
140
- | admin_panel | 99.95% | 99.95% (10×) | (?internal) | 10× | 5% | OVER-SPEC | baixar para 99% (internal tool, custo desperdício) |
141
- ```
142
-
143
- Output JSON (`--format json`) — mesmo conteúdo serializado:
144
-
145
- ```json
146
- {
147
- "timestamp": "2026-05-07T...",
148
- "slos": [
149
- {
150
- "name": "checkout_success",
151
- "target": 0.999,
152
- "position": "99.9%",
153
- "cost_multiplier": "5×",
154
- "tier": "paid",
155
- "budget_used_pct": 23,
156
- "status": "OPTIMAL",
157
- "decision": "manter"
158
- }
159
- ]
160
- }
161
- ```
162
-
163
- ## 5. Modo `--explain` — sabedoria 99.99% + anti-patterns inline
164
-
165
- Se `--explain` setado, anexar após tabela:
166
-
167
- ```markdown
168
- ## Sabedoria 99.99% (cap 3)
169
-
170
- > Smartphone tem ~99% de disponibilidade (sinal cai, bateria acaba, app trava).
171
- > Usuário em 99% smartphone NÃO distingue serviço 99.99% vs 99.999% — ambos
172
- > parecem "sempre funcionando" no contexto dele. Cada nove adicional **multiplica
173
- > custo** mas **divide benefício marginal**. Cliente final (humano em smartphone
174
- > com ISP residencial ~99%) tem disponibilidade no canal de comunicação inferior
175
- > à do seu serviço 99.99%. Essa é a sabedoria 99.99%.
176
-
177
- ## Anti-patterns detectados
178
-
179
- {Para cada SLO em status OVER-SPEC, BUDGET-EXHAUSTED:}
180
- - **{slo_name}** ({status}): {explicação curta}
181
- - {ação recomendada}
182
-
183
- Exemplos:
184
- - **admin_panel** (OVER-SPEC): tier internal com 99.95% (10× custo). Internal tool não exige tier paid.
185
- - Ação: editar `.planning/slos/admin_panel.md` → target: 0.99 (1×); ou remover SLO formal (apenas métrica informativa).
186
- - **login_success** (BUDGET-EXHAUSTED 78%): 99.99% sem checklist 4-perguntas justificada?
187
- - Ação: revisar Pattern "justificar 99.99%+ excepcional" (skill sre-risk-management); se NÃO atende 4 critérios, baixar para 99.95%.
188
- ```
189
-
190
- ## 6. Sugerir próximas ações
191
-
192
- Se algum SLO em status `BUDGET-EXHAUSTED` ou `OVER-SPEC`:
193
-
194
- ```
195
- ## ⚠ Decisões pendentes
196
-
197
- {Para cada SLO em alerta:}
198
- - {slo_name} ({status}): {recomendação curta}
199
- → /investigar-producao "{slo_name} budget exhausted às {timestamp}" # se BUDGET-EXHAUSTED
200
- → editar `.planning/slos/{slo_name}.md` target: {sugestão} # se OVER-SPEC
201
-
202
- ## Cross-refs
203
- - `/burn-rate-status {slo_name}` — burn rate live (forecast ETA)
204
- - `/postmortem --incident "..."` — se budget exhausted virou incident
205
- - `/observabilidade omm` — Capacidade 1 (Embracing Risk) consome este snapshot
206
- ```
207
-
208
- </process>
209
-
210
- <success_criteria>
211
- - [ ] `<slo_name>` opcional + flags `--format` e `--explain` parseadas
212
- - [ ] SLOs listados via glob `.planning/slos/*.md`
213
- - [ ] Cada SLO mapeado para posição no risk continuum (1× a 100×+)
214
- - [ ] 4 status enum: OPTIMAL / OVER-SPEC / UNDER-SPEC / BUDGET-EXHAUSTED
215
- - [ ] Tabela agregada com 8 colunas (SLO, Target, Posição, Tier, Custo relativo, Budget gasto, Status, Decisão)
216
- - [ ] Modo `--explain` anexa sabedoria 99.99% + anti-patterns detectados inline
217
- - [ ] Cross-refs para `/burn-rate-status`, `/postmortem`, `/observabilidade omm` (Capacidade 1 Embracing Risk)
218
- - [ ] Idempotente — rodável em `/loop` sem state acumulado
219
- - [ ] Read-only — comando NÃO modifica arquivos
220
- </success_criteria>
1
+ ---
2
+ name: risk-budget
3
+ description: Exibe error budget atual vs risk continuum (cap 3 SRE) — lê .planning/slos/, posiciona no continuum 99% → 99.999%, aplica sabedoria 99.99% e "as reliable as needs to be".
4
+ argument-hint: "[<slo_name>] [--format table|json]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Grep
9
+ - Glob
10
+ ---
11
+
12
+ <objective>
13
+ Snapshot read-only de **error budget vs risk continuum** (cap 3 do livro Google SRE) para 1 SLO ou todos. Aplica skill [`sre-risk-management`](../skills/sre-risk-management/SKILL.md) — risk continuum como decisão explícita, error budget como balanço risk × innovation, sabedoria 99.99% (user em smartphone 99% NÃO distingue 99.99% vs 99.999%), "as reliable as needs to be, no more".
14
+
15
+ Lê SLOs definidos em [`event-based-slos`](../skills/event-based-slos/SKILL.md) (v1.9) — `.planning/slos/*.md`. Complementa [`burn-rate-status`](./burn-rate-status.md) (v1.9 — burn rate forecast) com **decisão estratégica** sobre target apropriado.
16
+
17
+ **Cria/Atualiza:** nada — comando read-only.
18
+
19
+ **Após:** o user vê posição de cada SLO no continuum, % budget gasto, custo relativo (1× → 100×+), e recomendação de tier (free/paid/enterprise) consistente com user-perception.
20
+ </objective>
21
+
22
+ <context>
23
+ **Argumentos:** `$ARGUMENTS` — opcional `<slo_name>` para 1 SLO; sem args = todos os SLOs.
24
+
25
+ **Flags:**
26
+ - `--format <table|json>` — output format (default: `table`)
27
+ - `--explain` — incluir bloco "sabedoria 99.99%" + anti-patterns inline (verbose)
28
+
29
+ **Pré-requisito:** SLOs definidos em `.planning/slos/*.md` (v1.9 — comando `/observabilidade slo` ou `/definir-slo`).
30
+
31
+ **Risk continuum canônico** (cap 3, aplicado inline pela skill):
32
+
33
+ | Target | Tolerância 30d | User-perceptible? | Recomendação | Custo relativo |
34
+ |---|---|---|---|---|
35
+ | 99% | 7.2 h | Sim | Tier free, beta, internal | 1× |
36
+ | 99.5% | 3.6 h | Notável | Tier free de produção | 2× |
37
+ | 99.9% | 43.2 min | Aceitável para UX | Tier paid default | 5× |
38
+ | 99.95% | 21.6 min | Quase imperceptível | Tier enterprise / mission-critical | 10× |
39
+ | 99.99% | 4.3 min | Imperceptível em smartphone | Apenas se justificado (raro) | 50×+ |
40
+ | 99.999% | 26 s | NÃO perceptível | NUNCA para user-facing | 100×+ |
41
+
42
+ **Loop pattern:** rodar via skill `loop` para monitoramento contínuo.
43
+
44
+ ```text
45
+ /loop 1h /risk-budget
46
+ ```
47
+
48
+ **Exemplos:**
49
+ ```
50
+ /risk-budget # todos SLOs, formato table
51
+ /risk-budget checkout_success # 1 SLO específico
52
+ /risk-budget --format json # output estruturado
53
+ /risk-budget login_success --explain # com sabedoria 99.99% + anti-patterns inline
54
+ ```
55
+ </context>
56
+
57
+ <process>
58
+
59
+ ## 1. Parsear argumentos
60
+
61
+ ```bash
62
+ SLO_NAME=$(echo "$ARGUMENTS" | awk '{print $1}' | grep -v '^--' || true)
63
+ FORMAT=$(echo "$ARGUMENTS" | grep -oE -- '--format [^ ]+' | awk '{print $2}')
64
+ EXPLAIN=$(echo "$ARGUMENTS" | grep -c -- '--explain' || echo 0)
65
+
66
+ [ -z "$FORMAT" ] && FORMAT="table"
67
+ ```
68
+
69
+ ## 2. Listar SLOs
70
+
71
+ ```bash
72
+ if [ -n "$SLO_NAME" ]; then
73
+ SLO_FILES=(".planning/slos/${SLO_NAME}.md")
74
+ else
75
+ SLO_FILES=(.planning/slos/*.md)
76
+ fi
77
+
78
+ if [ ${#SLO_FILES[@]} -eq 0 ] || [ ! -f "${SLO_FILES[0]}" ]; then
79
+ echo "Nenhum SLO definido em .planning/slos/."
80
+ echo "Defina um com: /observabilidade slo <feature> (v1.9)"
81
+ exit 0
82
+ fi
83
+ ```
84
+
85
+ ## 3. Para cada SLO, extrair metadados + computar posição no continuum
86
+
87
+ Para cada `SLO_FILE`:
88
+
89
+ ```bash
90
+ SLO_NAME=$(basename "$SLO_FILE" .md)
91
+ TARGET=$(grep -m1 -oE 'target.*[0-9.]+' "$SLO_FILE" | grep -oE '[0-9.]+')
92
+ WINDOW=$(grep -m1 -oE 'window.*[0-9]+[dh]' "$SLO_FILE" | grep -oE '[0-9]+[dh]' || echo "30d")
93
+ TIER_LABEL=$(grep -m1 'tier:' "$SLO_FILE" | sed 's/.*tier: //' || echo "(unset)")
94
+ OWNER=$(grep -m1 'owner:' "$SLO_FILE" | sed 's/.*owner: //' || echo "(unset)")
95
+ ```
96
+
97
+ **Mapear target → posição no risk continuum** (skill `sre-risk-management` Pattern 1):
98
+
99
+ | Target faixa | Posição | Custo relativo | Tier típico | User-perceptible |
100
+ |---|---|---|---|---|
101
+ | < 0.99 | abaixo do continuum (under-spec) | <1× | beta/dev | sim |
102
+ | 0.99 ≤ t < 0.995 | 99% | 1× | free, beta, internal | sim (notável) |
103
+ | 0.995 ≤ t < 0.999 | 99.5% | 2× | free de produção | notável em paths críticos |
104
+ | 0.999 ≤ t < 0.9995 | 99.9% | 5× | paid default | aceitável para UX |
105
+ | 0.9995 ≤ t < 0.9999 | 99.95% | 10× | enterprise/mission-critical | quase imperceptível |
106
+ | 0.9999 ≤ t < 0.99999 | 99.99% | 50×+ | só com checklist 4-perguntas | imperceptível em smartphone |
107
+ | t ≥ 0.99999 | 99.999% | 100×+ | NUNCA para user-facing | NÃO perceptível |
108
+
109
+ **Computar budget gasto** (heurística — leitura grosseira do SLO file):
110
+
111
+ ```bash
112
+ # PT-BR: SLO file pode ter linha "**Budget consumido (snapshot):** XX%" atualizada por job
113
+ BUDGET_USED_PCT=$(grep -m1 -oE 'Budget consumido.*[0-9]+%' "$SLO_FILE" | grep -oE '[0-9]+%' || echo "?")
114
+
115
+ # PT-BR: se não, sugerir invocar /burn-rate-status (que tem queries live)
116
+ if [ "$BUDGET_USED_PCT" = "?" ]; then
117
+ BUDGET_USED_PCT="(invoque /burn-rate-status para snapshot live)"
118
+ fi
119
+ ```
120
+
121
+ **Status no continuum** (4 níveis enum — interpretação canônica):
122
+
123
+ - `OPTIMAL` — target apropriado para tier; budget < 50% gasto → "as reliable as needs to be"
124
+ - `OVER-SPEC` — target acima do necessário (ex: tier free com 99.99%) → desperdício; baixar target
125
+ - `UNDER-SPEC` — target abaixo do esperado (ex: enterprise com 99% só) → SLA risk; subir target
126
+ - `BUDGET-EXHAUSTED` — budget < 10% restante → freeze releases; revisitar postmortems
127
+
128
+ ## 4. Agregar resultados em tabela
129
+
130
+ ```
131
+ ═══════════════════════════════════════════════════════════
132
+ framework ► RISK-BUDGET ▸ {timestamp}
133
+ ═══════════════════════════════════════════════════════════
134
+
135
+ | SLO | Target | Posição | Tier | Custo relativo | Budget gasto | Status | Decisão |
136
+ |---|---|---|---|---|---|---|---|
137
+ | checkout_success | 99.9% | 99.9% (5×) | paid | 5× | 23% | OPTIMAL | manter |
138
+ | login_success | 99.99% | 99.99% (50×+) | enterprise | 50×+ | 78% | BUDGET-EXHAUSTED | freeze releases; checklist 4-perguntas? |
139
+ | search_latency | 99% | 99% (1×) | free | 1× | 15% | OPTIMAL | manter (tier free OK) |
140
+ | admin_panel | 99.95% | 99.95% (10×) | (?internal) | 10× | 5% | OVER-SPEC | baixar para 99% (internal tool, custo desperdício) |
141
+ ```
142
+
143
+ Output JSON (`--format json`) — mesmo conteúdo serializado:
144
+
145
+ ```json
146
+ {
147
+ "timestamp": "2026-05-07T...",
148
+ "slos": [
149
+ {
150
+ "name": "checkout_success",
151
+ "target": 0.999,
152
+ "position": "99.9%",
153
+ "cost_multiplier": "5×",
154
+ "tier": "paid",
155
+ "budget_used_pct": 23,
156
+ "status": "OPTIMAL",
157
+ "decision": "manter"
158
+ }
159
+ ]
160
+ }
161
+ ```
162
+
163
+ ## 5. Modo `--explain` — sabedoria 99.99% + anti-patterns inline
164
+
165
+ Se `--explain` setado, anexar após tabela:
166
+
167
+ ```markdown
168
+ ## Sabedoria 99.99% (cap 3)
169
+
170
+ > Smartphone tem ~99% de disponibilidade (sinal cai, bateria acaba, app trava).
171
+ > Usuário em 99% smartphone NÃO distingue serviço 99.99% vs 99.999% — ambos
172
+ > parecem "sempre funcionando" no contexto dele. Cada nove adicional **multiplica
173
+ > custo** mas **divide benefício marginal**. Cliente final (humano em smartphone
174
+ > com ISP residencial ~99%) tem disponibilidade no canal de comunicação inferior
175
+ > à do seu serviço 99.99%. Essa é a sabedoria 99.99%.
176
+
177
+ ## Anti-patterns detectados
178
+
179
+ {Para cada SLO em status OVER-SPEC, BUDGET-EXHAUSTED:}
180
+ - **{slo_name}** ({status}): {explicação curta}
181
+ - {ação recomendada}
182
+
183
+ Exemplos:
184
+ - **admin_panel** (OVER-SPEC): tier internal com 99.95% (10× custo). Internal tool não exige tier paid.
185
+ - Ação: editar `.planning/slos/admin_panel.md` → target: 0.99 (1×); ou remover SLO formal (apenas métrica informativa).
186
+ - **login_success** (BUDGET-EXHAUSTED 78%): 99.99% sem checklist 4-perguntas justificada?
187
+ - Ação: revisar Pattern "justificar 99.99%+ excepcional" (skill sre-risk-management); se NÃO atende 4 critérios, baixar para 99.95%.
188
+ ```
189
+
190
+ ## 6. Sugerir próximas ações
191
+
192
+ Se algum SLO em status `BUDGET-EXHAUSTED` ou `OVER-SPEC`:
193
+
194
+ ```
195
+ ## ⚠ Decisões pendentes
196
+
197
+ {Para cada SLO em alerta:}
198
+ - {slo_name} ({status}): {recomendação curta}
199
+ → /investigar-producao "{slo_name} budget exhausted às {timestamp}" # se BUDGET-EXHAUSTED
200
+ → editar `.planning/slos/{slo_name}.md` target: {sugestão} # se OVER-SPEC
201
+
202
+ ## Cross-refs
203
+ - `/burn-rate-status {slo_name}` — burn rate live (forecast ETA)
204
+ - `/postmortem --incident "..."` — se budget exhausted virou incident
205
+ - `/observabilidade omm` — Capacidade 1 (Embracing Risk) consome este snapshot
206
+ ```
207
+
208
+ </process>
209
+
210
+ <success_criteria>
211
+ - [ ] `<slo_name>` opcional + flags `--format` e `--explain` parseadas
212
+ - [ ] SLOs listados via glob `.planning/slos/*.md`
213
+ - [ ] Cada SLO mapeado para posição no risk continuum (1× a 100×+)
214
+ - [ ] 4 status enum: OPTIMAL / OVER-SPEC / UNDER-SPEC / BUDGET-EXHAUSTED
215
+ - [ ] Tabela agregada com 8 colunas (SLO, Target, Posição, Tier, Custo relativo, Budget gasto, Status, Decisão)
216
+ - [ ] Modo `--explain` anexa sabedoria 99.99% + anti-patterns detectados inline
217
+ - [ ] Cross-refs para `/burn-rate-status`, `/postmortem`, `/observabilidade omm` (Capacidade 1 Embracing Risk)
218
+ - [ ] Idempotente — rodável em `/loop` sem state acumulado
219
+ - [ ] Read-only — comando NÃO modifica arquivos
220
+ </success_criteria>