@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.
- package/bin/cli.js +2 -2
- package/bin/mcp.js +6 -6
- package/bin/ui.js +74 -74
- package/gates/ai-prompt-stability.md +120 -120
- package/gates/budget-description.md +68 -68
- package/gates/confidence.md +29 -29
- package/gates/dependency-check.md +33 -33
- package/gates/dept-cycle-prevention.md +179 -179
- package/gates/golden-signals-coverage.md +133 -133
- package/gates/legacy-refactor-safety.md +178 -178
- package/gates/multi-tenant-rls-coverage.md +102 -102
- package/gates/no-personal-uuid.md +72 -72
- package/gates/obs-agents-mcp-supabase.md +86 -86
- package/gates/obs-skills-frontmatter.md +76 -76
- package/gates/observability-coverage.md +151 -151
- package/gates/omm-no-regression.md +83 -83
- package/gates/postmortem-template-required.md +127 -127
- package/gates/prr-checklist-coverage.md +128 -128
- package/gates/regression.md +32 -32
- package/gates/release-pipeline-policy.md +132 -132
- package/gates/secrets-scan.md +33 -33
- package/gates/service-role-not-in-user-facing.md +113 -113
- package/gates/skill-must-include.md +71 -71
- package/gates/sync-idempotent.md +62 -62
- package/gates/verify-phase-goal.md +34 -34
- package/kit/agents/designer-ui.md +216 -216
- package/kit/agents/workflow-generator.md +537 -167
- package/kit/commands/adicionar-backlog.md +1 -1
- package/kit/commands/adicionar-fase.md +1 -1
- package/kit/commands/adicionar-tarefa.md +1 -1
- package/kit/commands/auditar-observabilidade.md +103 -103
- package/kit/commands/auditar-toil.md +129 -129
- package/kit/commands/caracterizar-prompt.md +195 -195
- package/kit/commands/criar-workflow.md +158 -158
- package/kit/commands/definir-perfil.md +1 -1
- package/kit/commands/definir-slo.md +108 -108
- package/kit/commands/fio.md +1 -1
- package/kit/commands/golden-signals.md +142 -142
- package/kit/commands/instrumentar-fase.md +200 -200
- package/kit/commands/investigar-producao.md +162 -162
- package/kit/commands/observabilidade.md +118 -118
- package/kit/commands/postmortem.md +179 -179
- package/kit/commands/prr.md +205 -205
- package/kit/commands/publicar-rapido.md +207 -207
- package/kit/commands/risk-budget.md +220 -220
- package/kit/commands/sre.md +230 -230
- package/kit/file-manifest.json +424 -424
- package/kit/framework/references/output-style.md +22 -22
- package/kit/hooks/post-apply-migration.js +199 -199
- package/kit/hooks/sidecar-tool-publisher.js +210 -210
- package/kit/skills/_shared-dados-distribuidos/glossary.md +224 -224
- package/kit/skills/_shared-legacy/glossary.md +389 -389
- package/kit/skills/_shared-multi-tenant/glossary.md +186 -186
- package/kit/skills/_shared-observability/glossary.md +396 -396
- package/kit/skills/_shared-sre/glossary.md +712 -712
- package/kit/skills/_shared-supabase/glossary.md +234 -234
- package/kit/skills/blameless-postmortems/SKILL.md +340 -340
- package/kit/skills/burn-rate-alerting/SKILL.md +258 -258
- package/kit/skills/cascading-failures/SKILL.md +311 -311
- package/kit/skills/core-analysis-loop/SKILL.md +352 -352
- package/kit/skills/distributed-tracing/SKILL.md +362 -362
- package/kit/skills/dynamic-workflow-authoring/SKILL.md +327 -223
- package/kit/skills/eliminating-toil/SKILL.md +243 -243
- package/kit/skills/event-based-slos/SKILL.md +296 -296
- package/kit/skills/four-golden-signals/SKILL.md +314 -314
- package/kit/skills/hermetic-builds/SKILL.md +323 -323
- package/kit/skills/legacy-monster-methods/SKILL.md +444 -444
- package/kit/skills/llm-as-dependency/SKILL.md +436 -436
- package/kit/skills/load-shedding-graceful-degradation/SKILL.md +396 -396
- package/kit/skills/observability-driven-development/SKILL.md +315 -315
- package/kit/skills/observability-maturity-model/SKILL.md +222 -222
- package/kit/skills/opentelemetry-standard/SKILL.md +351 -351
- package/kit/skills/production-readiness-review/SKILL.md +305 -305
- package/kit/skills/release-engineering/SKILL.md +367 -367
- package/kit/skills/retry-strategies/SKILL.md +372 -372
- package/kit/skills/sre-risk-management/SKILL.md +221 -221
- package/kit/skills/structured-events/SKILL.md +265 -265
- package/kit/skills/supabase-cron-queues/SKILL.md +275 -275
- package/kit/skills/supabase-database-functions/SKILL.md +332 -332
- package/kit/skills/supabase-declarative-schema/SKILL.md +183 -183
- package/kit/skills/supabase-pgvector-rag/SKILL.md +253 -253
- package/kit/skills/supabase-postgres-style/SKILL.md +138 -138
- package/kit/skills/supabase-storage/SKILL.md +234 -234
- package/kit/skills/telemetry-pipelines/SKILL.md +259 -259
- package/kit/skills/telemetry-sampling/SKILL.md +256 -256
- package/kit/skills/ui-anti-padroes-ia/SKILL.md +261 -261
- package/kit/skills/ui-contexto-produto/SKILL.md +248 -248
- package/kit/skills/ui-cor-estrategia/SKILL.md +213 -213
- package/kit/skills/ui-critica-auditoria/SKILL.md +260 -260
- package/kit/skills/ui-motion-funcional/SKILL.md +264 -264
- package/kit/skills/ui-ritmo-espacial/SKILL.md +259 -259
- package/kit/skills/ui-tipografia/SKILL.md +211 -211
- package/package.json +1 -1
- package/src/cli/index.js +1114 -1114
- package/src/cli/render.js +194 -194
- package/src/cli/upgrade-check.js +135 -135
- package/src/core/error-redaction.js +76 -76
- package/src/core/failures.js +153 -153
- package/src/core/gate-runner.js +205 -205
- package/src/core/gates.js +82 -82
- package/src/core/logger.js +170 -170
- package/src/core/manifest-verify.js +174 -174
- package/src/core/metrics.js +268 -268
- package/src/core/notify.js +60 -60
- package/src/core/path-safety.js +141 -141
- package/src/core/replays.js +120 -120
- package/src/core/ui.js +185 -185
- package/src/mcp-server/install.js +149 -149
- package/src/mcp-server/roots.js +124 -124
- package/src/ui/auto-spawn.js +113 -113
- package/src/ui/browser.js +78 -78
- package/src/ui/client.js +130 -130
- package/src/ui/events.js +65 -65
- package/src/ui/lockfile.js +191 -191
- package/src/ui/port.js +67 -67
- package/src/ui/server.js +547 -547
- 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>
|