@luanpdd/kit-mcp 1.8.1 → 1.10.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/CHANGELOG.md +86 -0
- package/README.md +97 -1
- package/gates/golden-signals-coverage.md +133 -0
- package/gates/obs-agents-mcp-supabase.md +86 -0
- package/gates/obs-skills-frontmatter.md +76 -0
- package/gates/omm-no-regression.md +83 -0
- package/gates/postmortem-template-required.md +127 -0
- package/gates/prr-checklist-coverage.md +128 -0
- package/gates/skill-must-include.md +21 -19
- package/kit/agents/burn-rate-forecaster.md +160 -0
- package/kit/agents/golden-signals-instrumenter.md +241 -0
- package/kit/agents/incident-investigator.md +245 -0
- package/kit/agents/observability-instrumenter.md +200 -0
- package/kit/agents/omm-auditor.md +251 -0
- package/kit/agents/postmortem-writer.md +282 -0
- package/kit/agents/prr-conductor.md +288 -0
- package/kit/agents/slo-engineer.md +224 -0
- package/kit/agents/supabase-architect.md +62 -0
- package/kit/agents/supabase-auth-bootstrapper.md +17 -0
- package/kit/agents/supabase-edge-fn-writer.md +124 -0
- package/kit/agents/supabase-migration-writer.md +98 -0
- package/kit/agents/supabase-realtime-implementer.md +23 -0
- package/kit/agents/supabase-rls-writer.md +17 -0
- package/kit/agents/supabase-storage-implementer.md +174 -0
- package/kit/agents/toil-auditor.md +277 -0
- package/kit/commands/auditar-marco.md +102 -1
- package/kit/commands/auditar-observabilidade.md +103 -0
- package/kit/commands/auditar-toil.md +129 -0
- package/kit/commands/burn-rate-status.md +140 -0
- package/kit/commands/concluir-marco.md +73 -1
- package/kit/commands/definir-slo.md +108 -0
- package/kit/commands/discutir-fase.md +26 -0
- package/kit/commands/forense.md +83 -1
- package/kit/commands/golden-signals.md +142 -0
- package/kit/commands/instrumentar-fase.md +200 -0
- package/kit/commands/investigar-producao.md +162 -0
- package/kit/commands/observabilidade.md +116 -0
- package/kit/commands/planejar-fase.md +20 -0
- package/kit/commands/postmortem.md +179 -0
- package/kit/commands/prr.md +205 -0
- package/kit/commands/risk-budget.md +220 -0
- package/kit/commands/sre.md +227 -0
- package/kit/commands/verificar-trabalho.md +26 -0
- package/kit/skills/_shared-observability/glossary.md +396 -0
- package/kit/skills/_shared-sre/glossary.md +573 -0
- package/kit/skills/blameless-postmortems/SKILL.md +340 -0
- package/kit/skills/burn-rate-alerting/SKILL.md +258 -0
- package/kit/skills/core-analysis-loop/SKILL.md +352 -0
- package/kit/skills/distributed-tracing/SKILL.md +362 -0
- package/kit/skills/eliminating-toil/SKILL.md +243 -0
- package/kit/skills/event-based-slos/SKILL.md +296 -0
- package/kit/skills/four-golden-signals/SKILL.md +297 -0
- package/kit/skills/observability-driven-development/SKILL.md +315 -0
- package/kit/skills/observability-maturity-model/SKILL.md +222 -0
- package/kit/skills/opentelemetry-standard/SKILL.md +351 -0
- package/kit/skills/production-readiness-review/SKILL.md +305 -0
- package/kit/skills/sre-risk-management/SKILL.md +221 -0
- package/kit/skills/structured-events/SKILL.md +265 -0
- package/kit/skills/telemetry-pipelines/SKILL.md +259 -0
- package/kit/skills/telemetry-sampling/SKILL.md +256 -0
- package/package.json +1 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prr
|
|
3
|
+
description: Invoca prr-conductor — Production Readiness Review scored em 6 axes (cap 32); modos --service <name> ou --feature <desc>; offline fallback se MCP ausente.
|
|
4
|
+
argument-hint: "(--service <name> | --feature \"<desc>\") [--engagement simple|early|platform] [--reviewer @sre]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- Task
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Conduzir **Production Readiness Review** (PRR — cap 32 do livro Google SRE) para serviço/feature antes de production. Invoca o agente [`prr-conductor`](../agents/prr-conductor.md) que aplica a skill [`production-readiness-review`](../skills/production-readiness-review/SKILL.md) — checklist canônico **6 axes** + **3 engagement models** + handoff dev→SRE.
|
|
17
|
+
|
|
18
|
+
**6 axes obrigatórios** (pular um = aprovação inválida):
|
|
19
|
+
1. System Architecture — design, dependencies, blast radius, isolation
|
|
20
|
+
2. Instrumentation/Metrics/Monitoring — 4 golden signals, SLOs, alerting
|
|
21
|
+
3. Emergency Response — runbooks, on-call, rollback, communication
|
|
22
|
+
4. Capacity Planning — load testing, scaling, headroom
|
|
23
|
+
5. Change Management — canary, feature flags, rollback < 60s
|
|
24
|
+
6. Performance — latency budgets, throughput, optimization
|
|
25
|
+
|
|
26
|
+
**Cria/Atualiza:**
|
|
27
|
+
- `.planning/prr/<service>.md` (Modo A) OR `.planning/prr/feature-<slug>.md` (Modo B) — PRR-REPORT.md scored
|
|
28
|
+
|
|
29
|
+
**Após:** o user tem decisão `Approved` / `Approved with conditions` / `Blocked` + lista canônica de P0 items por axe + reviewer signature. Phase 40 INT-FW-V2-02 integra `/concluir-marco` com gate PRR opcional.
|
|
30
|
+
</objective>
|
|
31
|
+
|
|
32
|
+
<context>
|
|
33
|
+
**Argumentos:** `$ARGUMENTS` — comando suporta **2 modos mutuamente exclusivos**.
|
|
34
|
+
|
|
35
|
+
**Modo A: `--service <name>` (audit de serviço existente)**
|
|
36
|
+
|
|
37
|
+
Para serviços já em production OU prestes a entrar — agent lê schema (Supabase MCP), Edge Functions code, SLOs definidos (`.planning/slos/`), advisors. Output: `.planning/prr/<service>.md`.
|
|
38
|
+
|
|
39
|
+
**Modo B: `--feature <description>` (audit pré-launch)**
|
|
40
|
+
|
|
41
|
+
Para feature em design/dev — agent lê design docs, SLOs propostos, código WIP. Output: `.planning/prr/feature-<slug>.md`.
|
|
42
|
+
|
|
43
|
+
**Engagement models (cap 32):**
|
|
44
|
+
- `simple` — outage cost < $1k/min OR internal tool — 4-8h, 1 sessão
|
|
45
|
+
- `early` — outage cost $1k-100k/min OR customer-facing — semanas, SRE no design
|
|
46
|
+
- `platform` — outage cost > $100k/min OR built on Frameworks/SRE Platform — PRR é confirmação
|
|
47
|
+
|
|
48
|
+
**Flags:**
|
|
49
|
+
- `--engagement <simple|early|platform>` — engagement model (default: AskUserQuestion baseado em outage cost)
|
|
50
|
+
- `--reviewer <@handle>` — handle do reviewer SRE (default: AskUserQuestion — **NUNCA pode ser team dev**, anti-pattern auto-PRR)
|
|
51
|
+
- `--outage-cost <usd>` — custo de outage por minuto (default: AskUserQuestion para escolher engagement)
|
|
52
|
+
- `--output <path>` — caminho do output (override de default canônico)
|
|
53
|
+
|
|
54
|
+
**Exemplos:**
|
|
55
|
+
```
|
|
56
|
+
/prr --service orders-api # Modo A — defaults
|
|
57
|
+
/prr --service orders-api --engagement early --reviewer @ops-lead # Modo A com config
|
|
58
|
+
/prr --feature "RAG sobre documentos privados" --reviewer @sre # Modo B
|
|
59
|
+
/prr --service edge-process-emails --engagement simple # Edge Function simples
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Pré-requisito (Full mode):** projeto Supabase configurado, `mcp__supabase__*` disponível. Modo offline funciona com fallback graceful (filesystem only — itens MCP-dependentes ficam `EVIDENCE_PENDING_MCP`).
|
|
63
|
+
</context>
|
|
64
|
+
|
|
65
|
+
<process>
|
|
66
|
+
|
|
67
|
+
## 1. Parsear argumentos (2 modos)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
SERVICE=$(echo "$ARGUMENTS" | grep -oE -- '--service [^ ]+' | awk '{print $2}')
|
|
71
|
+
FEATURE=$(echo "$ARGUMENTS" | grep -oE -- '--feature "[^"]+"' | sed 's/--feature //; s/^"//; s/"$//')
|
|
72
|
+
ENGAGEMENT=$(echo "$ARGUMENTS" | grep -oE -- '--engagement [^ ]+' | awk '{print $2}')
|
|
73
|
+
REVIEWER=$(echo "$ARGUMENTS" | grep -oE -- '--reviewer [^ ]+' | awk '{print $2}')
|
|
74
|
+
OUTAGE_COST=$(echo "$ARGUMENTS" | grep -oE -- '--outage-cost [^ ]+' | awk '{print $2}')
|
|
75
|
+
OUTPUT_PATH=$(echo "$ARGUMENTS" | grep -oE -- '--output [^ ]+' | awk '{print $2}')
|
|
76
|
+
|
|
77
|
+
# PT-BR: validar mutuamente exclusivos
|
|
78
|
+
if [ -n "$SERVICE" ] && [ -n "$FEATURE" ]; then
|
|
79
|
+
echo "✗ Erro: --service e --feature são mutuamente exclusivos. Escolha um."
|
|
80
|
+
exit 1
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# PT-BR: nenhum dos 2 → erro com sugestão
|
|
84
|
+
if [ -z "$SERVICE" ] && [ -z "$FEATURE" ]; then
|
|
85
|
+
echo "✗ Forneça --service <name> OU --feature \"<descrição>\""
|
|
86
|
+
echo " Exemplos:"
|
|
87
|
+
echo " /prr --service orders-api"
|
|
88
|
+
echo " /prr --feature \"RAG sobre documentos privados\""
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 2. Resolver output_path + idempotência
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
if [ -n "$SERVICE" ]; then
|
|
97
|
+
[ -z "$OUTPUT_PATH" ] && OUTPUT_PATH=".planning/prr/${SERVICE}.md"
|
|
98
|
+
else
|
|
99
|
+
SLUG=$(echo "$FEATURE" | tr ' ' '-' | tr -cd 'a-zA-Z0-9-' | head -c 30 | sed 's/-$//')
|
|
100
|
+
[ -z "$OUTPUT_PATH" ] && OUTPUT_PATH=".planning/prr/feature-${SLUG}.md"
|
|
101
|
+
fi
|
|
102
|
+
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
|
103
|
+
|
|
104
|
+
# PT-BR: PRR pode ser re-PRR (após mudança grande) — informar mas permitir
|
|
105
|
+
if [ -f "$OUTPUT_PATH" ]; then
|
|
106
|
+
LAST_DATE=$(grep -m1 '**Date:**' "$OUTPUT_PATH" 2>/dev/null | sed 's/.*Date:\*\* //' || echo "?")
|
|
107
|
+
echo "ℹ PRR-REPORT.md anterior detectado ($LAST_DATE) em $OUTPUT_PATH."
|
|
108
|
+
echo " Re-PRR válido (após mudança grande, incident, ou anual). Continuando — vai sobrescrever."
|
|
109
|
+
fi
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 3. Detectar `supabase/config.toml` (Full mode)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
PROJECT_ID=""
|
|
116
|
+
if [ -f supabase/config.toml ]; then
|
|
117
|
+
PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
|
|
118
|
+
echo "✓ project_id detectado: $PROJECT_ID (Full mode com MCP Supabase)"
|
|
119
|
+
else
|
|
120
|
+
echo "ℹ Sem supabase/config.toml — agent pode rodar em modo offline (fallback graceful)"
|
|
121
|
+
fi
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 4. AskUserQuestion — engagement model + reviewer
|
|
125
|
+
|
|
126
|
+
Se `--engagement` não fornecido E `--outage-cost` ausente:
|
|
127
|
+
|
|
128
|
+
> **AskUserQuestion**
|
|
129
|
+
> header: "PRR Engagement Model"
|
|
130
|
+
> question: "Qual custo estimado de outage para este target?"
|
|
131
|
+
> options:
|
|
132
|
+
> - "< $1k/min OR internal tool → Simple PRR (4-8h, 1 sessão)"
|
|
133
|
+
> - "$1k-100k/min OR customer-facing → Early Engagement (semanas, SRE no design)"
|
|
134
|
+
> - "> $100k/min OR built on platform → Frameworks/Platform (PRR é confirmação)"
|
|
135
|
+
|
|
136
|
+
Se `--reviewer` não fornecido (anti-pattern auto-PRR):
|
|
137
|
+
|
|
138
|
+
> **AskUserQuestion**
|
|
139
|
+
> header: "PRR Reviewer (anti auto-PRR)"
|
|
140
|
+
> question: "Quem é o reviewer? Reviewer DEVE ser SRE OU par externo ao time dev (anti-pattern: time dev faz auto-PRR — confirmation bias)."
|
|
141
|
+
> options: (texto livre — handle/email)
|
|
142
|
+
|
|
143
|
+
## 5. Dispatch para `prr-conductor`
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
Task(
|
|
147
|
+
subagent_type="prr-conductor",
|
|
148
|
+
prompt="
|
|
149
|
+
${SERVICE:+service_name: ${SERVICE}}
|
|
150
|
+
${FEATURE:+feature_description: ${FEATURE}}
|
|
151
|
+
output_path: ${OUTPUT_PATH}
|
|
152
|
+
${ENGAGEMENT:+engagement_model: ${ENGAGEMENT}}
|
|
153
|
+
${REVIEWER:+reviewer: ${REVIEWER}}
|
|
154
|
+
${OUTAGE_COST:+outage_cost_per_min: ${OUTAGE_COST}}
|
|
155
|
+
${PROJECT_ID:+project_id: ${PROJECT_ID}}
|
|
156
|
+
|
|
157
|
+
Aplicar skill production-readiness-review. Audit em 6 axes (todos obrigatórios — pular = inválido):
|
|
158
|
+
1. System Architecture — design, dependencies, blast radius, isolation, single points of failure
|
|
159
|
+
2. Instrumentation/Metrics/Monitoring — 4 golden signals, SLOs definidos, alerting com burn rates
|
|
160
|
+
3. Emergency Response — runbooks atualizados, on-call rotation, rollback < 60s, communication plan
|
|
161
|
+
4. Capacity Planning — load testing recente, scaling docs, headroom % atual vs peak
|
|
162
|
+
5. Change Management — canary deployment, feature flags, rollback drills
|
|
163
|
+
6. Performance — latency p50/p95/p99 vs budget, throughput vs target, optimization headroom
|
|
164
|
+
|
|
165
|
+
Padrão obrigatório: cada item evidence-based (NÃO 'acreditamos que está pronto' — exigir query/log/runbook/test).
|
|
166
|
+
Modo offline: se MCP ausente, declarar [MODO OFFLINE] e marcar items MCP-dependentes EVIDENCE_PENDING_MCP.
|
|
167
|
+
Output: PRR-REPORT.md com scoring 0-5 por axe + status Pass/Pass with gaps/Fail + decisão Approved/Approved with conditions/Blocked + reviewer signature + Re-PRR triggers.
|
|
168
|
+
"
|
|
169
|
+
)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 6. Pós-output
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
═══════════════════════════════════════════════════════════
|
|
176
|
+
framework ► PRR ▸ ${SERVICE:-feature-${SLUG}}
|
|
177
|
+
═══════════════════════════════════════════════════════════
|
|
178
|
+
|
|
179
|
+
[output do prr-conductor — ver Step 3 do agent]
|
|
180
|
+
|
|
181
|
+
## Estado salvo
|
|
182
|
+
${OUTPUT_PATH}
|
|
183
|
+
|
|
184
|
+
## Próximos passos
|
|
185
|
+
1. Reviewer (`${REVIEWER}`) precisa assinar — anti-pattern: rubber stamp sem ler evidence
|
|
186
|
+
2. P0 items são bloqueadores; P1 items são conditions; P2 items são monitoramento
|
|
187
|
+
3. Re-PRR triggers (anual, mudança arquitetural grande, incident SEV1+) — agendar
|
|
188
|
+
4. Se status `Approved` → liberar para production; se `Blocked` → fechar P0s antes de re-submit
|
|
189
|
+
5. Cross-ref OMM: PRR alimenta Capacidade 4 (Production Readiness) — `/observabilidade omm`
|
|
190
|
+
6. Phase 40 INT-FW-V2-02: `/concluir-marco` pode exigir PRR `Approved` se `workflow.complete_milestone_prr_gate=true`
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
</process>
|
|
194
|
+
|
|
195
|
+
<success_criteria>
|
|
196
|
+
- [ ] `--service <name>` E `--feature "<desc>"` parseados (mutuamente exclusivos)
|
|
197
|
+
- [ ] Modo A: output canônico `.planning/prr/<service>.md` (override via `--output`)
|
|
198
|
+
- [ ] Modo B: output canônico `.planning/prr/feature-<slug>.md` (slug auto-gerado)
|
|
199
|
+
- [ ] Re-PRR não-bloqueante (informa mas permite — re-PRR é válido após mudança grande)
|
|
200
|
+
- [ ] `supabase/config.toml` detectado para passar `project_id` (Full mode)
|
|
201
|
+
- [ ] AskUserQuestion para engagement model (se ausente) E reviewer (se ausente — anti auto-PRR)
|
|
202
|
+
- [ ] `prr-conductor` invocado via `Task(subagent_type=...)` com prompt completo (6 axes literalmente + modo offline)
|
|
203
|
+
- [ ] Output forwarded transparentemente do agent
|
|
204
|
+
- [ ] Próximos passos sugerem cross-ref para `/observabilidade omm`, `/concluir-marco`, P0/P1/P2 priorização
|
|
205
|
+
</success_criteria>
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sre
|
|
3
|
+
description: Orquestrador da Suíte SRE (v1.10) — dispatch para agents (golden-signals-instrumenter, toil-auditor, postmortem-writer, prr-conductor) com sinônimos PT/EN.
|
|
4
|
+
argument-hint: "<subcomando> [args...]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- Task
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Orquestrador único da Suíte SRE (v1.10) — terceiro orquestrador da família após [`/supabase`](./supabase.md) (v1.8) e [`/observabilidade`](./observabilidade.md) (v1.9). Recebe subcomando + args, faz dispatch via `Task(subagent_type=...)` para o agent SRE correto. **Único ponto de chain de agents SRE** (anti-pitfall A10 mantido — agents permanecem função pura).
|
|
17
|
+
|
|
18
|
+
**Subcomandos cobrem cap 3, 5, 6, 15, 32 do livro Google SRE:**
|
|
19
|
+
- `golden-signals` — 4 signals universais (cap 6)
|
|
20
|
+
- `auditar-toil`/`audit-toil` — eliminating toil (cap 5)
|
|
21
|
+
- `postmortem` — blameless postmortem (cap 15)
|
|
22
|
+
- `prr` — Production Readiness Review (cap 32)
|
|
23
|
+
- `risk-budget`/`budget` — risk continuum (cap 3)
|
|
24
|
+
|
|
25
|
+
**Cria/Atualiza:** o que cada agent invocado cria (patches OTel, TOIL-AUDIT.md, postmortem, PRR-REPORT.md, snapshot risk-budget).
|
|
26
|
+
|
|
27
|
+
**Após:** o usuário tem o output do agent (instrumentação aplicada, audit, postmortem revisável, PRR scored, ou snapshot de budget).
|
|
28
|
+
</objective>
|
|
29
|
+
|
|
30
|
+
<execution_context>
|
|
31
|
+
Skills consultadas pelos agents (Phase 36): [`kit/skills/sre-risk-management/SKILL.md`](../skills/sre-risk-management/SKILL.md), [`kit/skills/four-golden-signals/SKILL.md`](../skills/four-golden-signals/SKILL.md), [`kit/skills/eliminating-toil/SKILL.md`](../skills/eliminating-toil/SKILL.md), [`kit/skills/blameless-postmortems/SKILL.md`](../skills/blameless-postmortems/SKILL.md), [`kit/skills/production-readiness-review/SKILL.md`](../skills/production-readiness-review/SKILL.md) + glossário em [`kit/skills/_shared-sre/glossary.md`](../skills/_shared-sre/glossary.md).
|
|
32
|
+
|
|
33
|
+
Agents disponíveis (Phase 37):
|
|
34
|
+
- [`golden-signals-instrumenter`](../agents/golden-signals-instrumenter.md) — AGCORE-SRE-01
|
|
35
|
+
- [`toil-auditor`](../agents/toil-auditor.md) — AGCORE-SRE-02
|
|
36
|
+
- [`postmortem-writer`](../agents/postmortem-writer.md) — AGCORE-SRE-03
|
|
37
|
+
- [`prr-conductor`](../agents/prr-conductor.md) — AGCORE-SRE-04
|
|
38
|
+
|
|
39
|
+
**Subcomando `risk-budget`** é caso especial — comando direto (Plan 05 não usa agent); orquestrador delega aplicando skill [`sre-risk-management`](../skills/sre-risk-management/SKILL.md) inline ou re-encaminhando para `/risk-budget`.
|
|
40
|
+
</execution_context>
|
|
41
|
+
|
|
42
|
+
<context>
|
|
43
|
+
**Argumentos:** `$ARGUMENTS` — primeiro token é o subcomando; restante é passado para o agent como prompt.
|
|
44
|
+
|
|
45
|
+
**Subcomandos suportados (sinônimos PT-BR/EN):**
|
|
46
|
+
|
|
47
|
+
| Subcomando | Sinônimos | Agent dispatched | Cap livro |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| `golden-signals` | `signals`, `4signals`, `golden` | `golden-signals-instrumenter` | 6 |
|
|
50
|
+
| `auditar-toil` | `audit-toil`, `toil`, `auditar` | `toil-auditor` | 5 |
|
|
51
|
+
| `postmortem` | `pm`, `post-mortem` | `postmortem-writer` | 15 |
|
|
52
|
+
| `prr` | `production-readiness`, `readiness-review` | `prr-conductor` | 32 |
|
|
53
|
+
| `risk-budget` | `budget`, `risk`, `continuum` | (comando direto — `/risk-budget`) | 3 |
|
|
54
|
+
| `help` | `ajuda`, `?` | exibe esta tabela inline | — |
|
|
55
|
+
|
|
56
|
+
**Roteamento de flags por subcomando:**
|
|
57
|
+
|
|
58
|
+
- `golden-signals <target>` — args passados como `<target>` + flags `--service` `--saturation` `--runtime`
|
|
59
|
+
- `auditar-toil` — flags `--time-window` `--team-size` `--output` `--runbooks-paths`
|
|
60
|
+
- `postmortem` — flags **mutuamente exclusivas** `--from-investigation <id>` OU `--incident "<desc>"` + `--severity`
|
|
61
|
+
- `prr` — flags **mutuamente exclusivas** `--service <name>` OU `--feature "<desc>"` + `--engagement` `--reviewer`
|
|
62
|
+
- `risk-budget` — `[<slo_name>]` opcional + `--format` `--explain`
|
|
63
|
+
|
|
64
|
+
**Exemplos:**
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
/sre golden-signals supabase/functions/process-emails # instrumentar Edge Function
|
|
68
|
+
/sre auditar-toil --time-window 6m # audit toil últimos 6 meses
|
|
69
|
+
/sre postmortem --from-investigation incident-2026-05-06-1432-checkout-burn # continuação de v1.9
|
|
70
|
+
/sre prr --service orders-api --reviewer @sre-lead # PRR de serviço existente
|
|
71
|
+
/sre risk-budget checkout_success --explain # budget + sabedoria 99.99% inline
|
|
72
|
+
/sre help # exibe tabela de subcomandos
|
|
73
|
+
```
|
|
74
|
+
</context>
|
|
75
|
+
|
|
76
|
+
<process>
|
|
77
|
+
|
|
78
|
+
## 1. Parsear subcomando
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
SUBCMD=$(echo "$ARGUMENTS" | awk '{print $1}')
|
|
82
|
+
ARGS=$(echo "$ARGUMENTS" | cut -d' ' -f2-)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Se `$ARGUMENTS` for vazio ou `SUBCMD` for `help`/`ajuda`/`?`:** exibir tabela de subcomandos inline + exemplo de uso. Sair.
|
|
86
|
+
|
|
87
|
+
## 2. Resolver sinônimos para agent canônico
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
golden-signals, signals, 4signals, golden → golden-signals-instrumenter
|
|
91
|
+
auditar-toil, audit-toil, toil, auditar → toil-auditor
|
|
92
|
+
postmortem, pm, post-mortem → postmortem-writer
|
|
93
|
+
prr, production-readiness, readiness-review → prr-conductor
|
|
94
|
+
risk-budget, budget, risk, continuum → (comando direto — /risk-budget)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Se subcomando não resolve:** exibir erro inline com lista de subcomandos válidos. Sair.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
✗ Subcomando desconhecido: '<SUBCMD>'
|
|
101
|
+
|
|
102
|
+
Subcomandos válidos:
|
|
103
|
+
golden-signals → instrumentar 4 signals OTel (Latency/Traffic/Errors/Saturation)
|
|
104
|
+
auditar-toil → audit toil priorizado P0/P1/P2 + esforço de automação
|
|
105
|
+
postmortem → postmortem blameless 9 seções (--from-investigation OU --incident)
|
|
106
|
+
prr → Production Readiness Review 6 axes (--service OU --feature)
|
|
107
|
+
risk-budget → error budget vs risk continuum + sabedoria 99.99%
|
|
108
|
+
|
|
109
|
+
Uso: /sre <subcomando> <args...>
|
|
110
|
+
Exemplo: /sre prr --service orders-api
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 3. Detectar `supabase/config.toml` (passar `project_id` para agents que usam MCP)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
PROJECT_ID=""
|
|
117
|
+
if [ -f supabase/config.toml ]; then
|
|
118
|
+
PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
|
|
119
|
+
fi
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Apenas `prr-conductor` usa `mcp__supabase__*` — outros 3 agents não precisam de `project_id` (instrumentação/audit/postmortem são filesystem only).
|
|
123
|
+
|
|
124
|
+
## 4. Dispatch — caminhos por subcomando
|
|
125
|
+
|
|
126
|
+
### 4a. `golden-signals` → `golden-signals-instrumenter`
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
Task(
|
|
130
|
+
subagent_type="golden-signals-instrumenter",
|
|
131
|
+
prompt="
|
|
132
|
+
${ARGS}
|
|
133
|
+
|
|
134
|
+
Aplicar skill four-golden-signals. Gerar patches OTel para os 4 signals (Latency: histogram bucketed; Traffic: counter; Errors: counter por error.type; Saturation: gauge resource-specific).
|
|
135
|
+
"
|
|
136
|
+
)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 4b. `auditar-toil` → `toil-auditor`
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
Task(
|
|
143
|
+
subagent_type="toil-auditor",
|
|
144
|
+
prompt="
|
|
145
|
+
project_root: .
|
|
146
|
+
output_path: .planning/TOIL-AUDIT.md
|
|
147
|
+
${ARGS}
|
|
148
|
+
|
|
149
|
+
Aplicar skill eliminating-toil. Scan git log + scripts + runbooks; aplicar 6 critérios canônicos; priorizar P0/P1/P2; estimar esforço de automação L0-L4.
|
|
150
|
+
"
|
|
151
|
+
)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 4c. `postmortem` → `postmortem-writer`
|
|
155
|
+
|
|
156
|
+
Validar mutuamente exclusivos (`--from-investigation` E `--incident` ambos = ERROR; nenhum = AskUserQuestion sugerido).
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
Task(
|
|
160
|
+
subagent_type="postmortem-writer",
|
|
161
|
+
prompt="
|
|
162
|
+
${ARGS}
|
|
163
|
+
|
|
164
|
+
Aplicar skill blameless-postmortems. Modo conforme flag (--from-investigation lê investigation v1.9; --incident standalone com 9 perguntas guiadas). 9 seções obrigatórias: Summary, Impact, Root Causes, Trigger, Resolution, Detection, Action Items, Lessons Learned, Timeline UTC. Foco em sistema/processo (NUNCA pessoas).
|
|
165
|
+
"
|
|
166
|
+
)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 4d. `prr` → `prr-conductor`
|
|
170
|
+
|
|
171
|
+
Validar mutuamente exclusivos (`--service` E `--feature` ambos = ERROR; nenhum = ERROR com sugestão). Se `--reviewer` ausente: AskUserQuestion (anti-pattern auto-PRR).
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
Task(
|
|
175
|
+
subagent_type="prr-conductor",
|
|
176
|
+
prompt="
|
|
177
|
+
${ARGS}
|
|
178
|
+
${PROJECT_ID:+project_id: ${PROJECT_ID}}
|
|
179
|
+
|
|
180
|
+
Aplicar skill production-readiness-review. Audit em 6 axes (System Architecture, Instrumentation, Emergency Response, Capacity Planning, Change Management, Performance) — todos obrigatórios. Engagement model conforme outage cost. Modo offline fallback graceful.
|
|
181
|
+
"
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 4e. `risk-budget` → comando direto `/risk-budget`
|
|
186
|
+
|
|
187
|
+
Caso especial — não há agent. Re-encaminhar via shell ou aplicar skill `sre-risk-management` direto.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# PT-BR: invocar comando /risk-budget passando args
|
|
191
|
+
# Em Claude Code, isso é equivalente a executar o comando file diretamente
|
|
192
|
+
# (orquestrador apenas valida sinônimo e delega)
|
|
193
|
+
/risk-budget ${ARGS}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Alternativa inline (se não há shell call): orquestrador lê `.planning/slos/*.md`, mapeia para tabela continuum (skill `sre-risk-management` Pattern 1), exibe tabela com status (OPTIMAL/OVER-SPEC/UNDER-SPEC/BUDGET-EXHAUSTED).
|
|
197
|
+
|
|
198
|
+
## 5. Output
|
|
199
|
+
|
|
200
|
+
Output do agent (ou do comando direto risk-budget) é o output do orquestrador. Sem post-processing — agent já formata estruturado.
|
|
201
|
+
|
|
202
|
+
## 6. Sugestões de chains comuns (pós-output)
|
|
203
|
+
|
|
204
|
+
Após dispatch, orquestrador pode sugerir chains comuns:
|
|
205
|
+
|
|
206
|
+
| Subcomando rodado | Chain natural |
|
|
207
|
+
|---|---|
|
|
208
|
+
| `golden-signals` | `/sre prr --service <same>` (validar production-readiness) |
|
|
209
|
+
| `auditar-toil` | `/observabilidade omm` (alimentar OMM Capacidade 3) |
|
|
210
|
+
| `postmortem` | `/sre prr --service <affected>` OR `/observabilidade omm` (Capacidade 5 Incident Response) |
|
|
211
|
+
| `prr` | (se Approved) deploy; (se Blocked) fechar P0s e re-PRR |
|
|
212
|
+
| `risk-budget` | `/burn-rate-status` (live forecast) OR `/sre postmortem --incident "..."` se BUDGET-EXHAUSTED |
|
|
213
|
+
|
|
214
|
+
</process>
|
|
215
|
+
|
|
216
|
+
<success_criteria>
|
|
217
|
+
- [ ] Subcomando resolvido para agent canônico (5 subcomandos × seus sinônimos)
|
|
218
|
+
- [ ] `project_id` extraído de `supabase/config.toml` se presente (apenas relevante para `prr`)
|
|
219
|
+
- [ ] Dispatch via `Task(subagent_type=...)` — único ponto de chain (anti-pitfall A10)
|
|
220
|
+
- [ ] Subcomando `risk-budget` delega para comando direto `/risk-budget` (não usa Task)
|
|
221
|
+
- [ ] Subcomando `postmortem` valida `--from-investigation` E `--incident` mutuamente exclusivos antes de dispatch
|
|
222
|
+
- [ ] Subcomando `prr` valida `--service` E `--feature` mutuamente exclusivos + AskUserQuestion para reviewer (anti auto-PRR)
|
|
223
|
+
- [ ] Subcomando inválido → mensagem clara com lista de 5 subcomandos válidos
|
|
224
|
+
- [ ] Subcomando `help`/`ajuda`/`?` → exibe tabela inline com 6 linhas (5 + help)
|
|
225
|
+
- [ ] Args após subcomando passam transparentemente para o agent
|
|
226
|
+
- [ ] Sugestões de chains comuns na tabela final (5 chains documentadas)
|
|
227
|
+
</success_criteria>
|