@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
package/kit/commands/sre.md
CHANGED
|
@@ -1,230 +1,230 @@
|
|
|
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
|
-
| `cascading` | `cascade`, `cascading-failures`, `auditar-cascading` | `cascading-failures-auditor` | 22 (v1.11) |
|
|
55
|
-
| `load-shedding` | `shed`, `load-shed`, `loadshedding` | `load-shedding-instrumenter` | 22 (v1.11) |
|
|
56
|
-
| `release` | `auditar-release`, `release-audit`, `pipeline` | `release-pipeline-auditor` | 8 (v1.11) |
|
|
57
|
-
| `help` | `ajuda`, `?` | exibe esta tabela inline | — |
|
|
58
|
-
|
|
59
|
-
**Roteamento de flags por subcomando:**
|
|
60
|
-
|
|
61
|
-
- `golden-signals <target>` — args passados como `<target>` + flags `--service` `--saturation` `--runtime`
|
|
62
|
-
- `auditar-toil` — flags `--time-window` `--team-size` `--output` `--runbooks-paths`
|
|
63
|
-
- `postmortem` — flags **mutuamente exclusivas** `--from-investigation <id>` OU `--incident "<desc>"` + `--severity`
|
|
64
|
-
- `prr` — flags **mutuamente exclusivas** `--service <name>` OU `--feature "<desc>"` + `--engagement` `--reviewer`
|
|
65
|
-
- `risk-budget` — `[<slo_name>]` opcional + `--format` `--explain`
|
|
66
|
-
|
|
67
|
-
**Exemplos:**
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
/sre golden-signals supabase/functions/process-emails # instrumentar Edge Function
|
|
71
|
-
/sre auditar-toil --time-window 6m # audit toil últimos 6 meses
|
|
72
|
-
/sre postmortem --from-investigation incident-2026-05-06-1432-checkout-burn # continuação de v1.9
|
|
73
|
-
/sre prr --service orders-api --reviewer @sre-lead # PRR de serviço existente
|
|
74
|
-
/sre risk-budget checkout_success --explain # budget + sabedoria 99.99% inline
|
|
75
|
-
/sre help # exibe tabela de subcomandos
|
|
76
|
-
```
|
|
77
|
-
</context>
|
|
78
|
-
|
|
79
|
-
<process>
|
|
80
|
-
|
|
81
|
-
## 1. Parsear subcomando
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
SUBCMD=$(echo "$ARGUMENTS" | awk '{print $1}')
|
|
85
|
-
ARGS=$(echo "$ARGUMENTS" | cut -d' ' -f2-)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Se `$ARGUMENTS` for vazio ou `SUBCMD` for `help`/`ajuda`/`?`:** exibir tabela de subcomandos inline + exemplo de uso. Sair.
|
|
89
|
-
|
|
90
|
-
## 2. Resolver sinônimos para agent canônico
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
golden-signals, signals, 4signals, golden → golden-signals-instrumenter
|
|
94
|
-
auditar-toil, audit-toil, toil, auditar → toil-auditor
|
|
95
|
-
postmortem, pm, post-mortem → postmortem-writer
|
|
96
|
-
prr, production-readiness, readiness-review → prr-conductor
|
|
97
|
-
risk-budget, budget, risk, continuum → (comando direto — /risk-budget)
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Se subcomando não resolve:** exibir erro inline com lista de subcomandos válidos. Sair.
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
✗ Subcomando desconhecido: '<SUBCMD>'
|
|
104
|
-
|
|
105
|
-
Subcomandos válidos:
|
|
106
|
-
golden-signals → instrumentar 4 signals OTel (Latency/Traffic/Errors/Saturation)
|
|
107
|
-
auditar-toil → audit toil priorizado P0/P1/P2 + esforço de automação
|
|
108
|
-
postmortem → postmortem blameless 9 seções (--from-investigation OU --incident)
|
|
109
|
-
prr → Production Readiness Review 6 axes (--service OU --feature)
|
|
110
|
-
risk-budget → error budget vs risk continuum + sabedoria 99.99%
|
|
111
|
-
|
|
112
|
-
Uso: /sre <subcomando> <args...>
|
|
113
|
-
Exemplo: /sre prr --service orders-api
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## 3. Detectar `supabase/config.toml` (passar `project_id` para agents que usam MCP)
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
PROJECT_ID=""
|
|
120
|
-
if [ -f supabase/config.toml ]; then
|
|
121
|
-
PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
|
|
122
|
-
fi
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Apenas `prr-conductor` usa `mcp__supabase__*` — outros 3 agents não precisam de `project_id` (instrumentação/audit/postmortem são filesystem only).
|
|
126
|
-
|
|
127
|
-
## 4. Dispatch — caminhos por subcomando
|
|
128
|
-
|
|
129
|
-
### 4a. `golden-signals` → `golden-signals-instrumenter`
|
|
130
|
-
|
|
131
|
-
```text
|
|
132
|
-
Task(
|
|
133
|
-
subagent_type="golden-signals-instrumenter",
|
|
134
|
-
prompt="
|
|
135
|
-
${ARGS}
|
|
136
|
-
|
|
137
|
-
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).
|
|
138
|
-
"
|
|
139
|
-
)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### 4b. `auditar-toil` → `toil-auditor`
|
|
143
|
-
|
|
144
|
-
```text
|
|
145
|
-
Task(
|
|
146
|
-
subagent_type="toil-auditor",
|
|
147
|
-
prompt="
|
|
148
|
-
project_root: .
|
|
149
|
-
output_path: .planning/TOIL-AUDIT.md
|
|
150
|
-
${ARGS}
|
|
151
|
-
|
|
152
|
-
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.
|
|
153
|
-
"
|
|
154
|
-
)
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### 4c. `postmortem` → `postmortem-writer`
|
|
158
|
-
|
|
159
|
-
Validar mutuamente exclusivos (`--from-investigation` E `--incident` ambos = ERROR; nenhum = AskUserQuestion sugerido).
|
|
160
|
-
|
|
161
|
-
```text
|
|
162
|
-
Task(
|
|
163
|
-
subagent_type="postmortem-writer",
|
|
164
|
-
prompt="
|
|
165
|
-
${ARGS}
|
|
166
|
-
|
|
167
|
-
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).
|
|
168
|
-
"
|
|
169
|
-
)
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 4d. `prr` → `prr-conductor`
|
|
173
|
-
|
|
174
|
-
Validar mutuamente exclusivos (`--service` E `--feature` ambos = ERROR; nenhum = ERROR com sugestão). Se `--reviewer` ausente: AskUserQuestion (anti-pattern auto-PRR).
|
|
175
|
-
|
|
176
|
-
```text
|
|
177
|
-
Task(
|
|
178
|
-
subagent_type="prr-conductor",
|
|
179
|
-
prompt="
|
|
180
|
-
${ARGS}
|
|
181
|
-
${PROJECT_ID:+project_id: ${PROJECT_ID}}
|
|
182
|
-
|
|
183
|
-
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.
|
|
184
|
-
"
|
|
185
|
-
)
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### 4e. `risk-budget` → comando direto `/risk-budget`
|
|
189
|
-
|
|
190
|
-
Caso especial — não há agent. Re-encaminhar via shell ou aplicar skill `sre-risk-management` direto.
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
# PT-BR: invocar comando /risk-budget passando args
|
|
194
|
-
# Em Claude Code, isso é equivalente a executar o comando file diretamente
|
|
195
|
-
# (orquestrador apenas valida sinônimo e delega)
|
|
196
|
-
/risk-budget ${ARGS}
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
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).
|
|
200
|
-
|
|
201
|
-
## 5. Output
|
|
202
|
-
|
|
203
|
-
Output do agent (ou do comando direto risk-budget) é o output do orquestrador. Sem post-processing — agent já formata estruturado.
|
|
204
|
-
|
|
205
|
-
## 6. Sugestões de chains comuns (pós-output)
|
|
206
|
-
|
|
207
|
-
Após dispatch, orquestrador pode sugerir chains comuns:
|
|
208
|
-
|
|
209
|
-
| Subcomando rodado | Chain natural |
|
|
210
|
-
|---|---|
|
|
211
|
-
| `golden-signals` | `/sre prr --service <same>` (validar production-readiness) |
|
|
212
|
-
| `auditar-toil` | `/observabilidade omm` (alimentar OMM Capacidade 3) |
|
|
213
|
-
| `postmortem` | `/sre prr --service <affected>` OR `/observabilidade omm` (Capacidade 5 Incident Response) |
|
|
214
|
-
| `prr` | (se Approved) deploy; (se Blocked) fechar P0s e re-PRR |
|
|
215
|
-
| `risk-budget` | `/burn-rate-status` (live forecast) OR `/sre postmortem --incident "..."` se BUDGET-EXHAUSTED |
|
|
216
|
-
|
|
217
|
-
</process>
|
|
218
|
-
|
|
219
|
-
<success_criteria>
|
|
220
|
-
- [ ] Subcomando resolvido para agent canônico (5 subcomandos × seus sinônimos)
|
|
221
|
-
- [ ] `project_id` extraído de `supabase/config.toml` se presente (apenas relevante para `prr`)
|
|
222
|
-
- [ ] Dispatch via `Task(subagent_type=...)` — único ponto de chain (anti-pitfall A10)
|
|
223
|
-
- [ ] Subcomando `risk-budget` delega para comando direto `/risk-budget` (não usa Task)
|
|
224
|
-
- [ ] Subcomando `postmortem` valida `--from-investigation` E `--incident` mutuamente exclusivos antes de dispatch
|
|
225
|
-
- [ ] Subcomando `prr` valida `--service` E `--feature` mutuamente exclusivos + AskUserQuestion para reviewer (anti auto-PRR)
|
|
226
|
-
- [ ] Subcomando inválido → mensagem clara com lista de 5 subcomandos válidos
|
|
227
|
-
- [ ] Subcomando `help`/`ajuda`/`?` → exibe tabela inline com 6 linhas (5 + help)
|
|
228
|
-
- [ ] Args após subcomando passam transparentemente para o agent
|
|
229
|
-
- [ ] Sugestões de chains comuns na tabela final (5 chains documentadas)
|
|
230
|
-
</success_criteria>
|
|
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
|
+
| `cascading` | `cascade`, `cascading-failures`, `auditar-cascading` | `cascading-failures-auditor` | 22 (v1.11) |
|
|
55
|
+
| `load-shedding` | `shed`, `load-shed`, `loadshedding` | `load-shedding-instrumenter` | 22 (v1.11) |
|
|
56
|
+
| `release` | `auditar-release`, `release-audit`, `pipeline` | `release-pipeline-auditor` | 8 (v1.11) |
|
|
57
|
+
| `help` | `ajuda`, `?` | exibe esta tabela inline | — |
|
|
58
|
+
|
|
59
|
+
**Roteamento de flags por subcomando:**
|
|
60
|
+
|
|
61
|
+
- `golden-signals <target>` — args passados como `<target>` + flags `--service` `--saturation` `--runtime`
|
|
62
|
+
- `auditar-toil` — flags `--time-window` `--team-size` `--output` `--runbooks-paths`
|
|
63
|
+
- `postmortem` — flags **mutuamente exclusivas** `--from-investigation <id>` OU `--incident "<desc>"` + `--severity`
|
|
64
|
+
- `prr` — flags **mutuamente exclusivas** `--service <name>` OU `--feature "<desc>"` + `--engagement` `--reviewer`
|
|
65
|
+
- `risk-budget` — `[<slo_name>]` opcional + `--format` `--explain`
|
|
66
|
+
|
|
67
|
+
**Exemplos:**
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
/sre golden-signals supabase/functions/process-emails # instrumentar Edge Function
|
|
71
|
+
/sre auditar-toil --time-window 6m # audit toil últimos 6 meses
|
|
72
|
+
/sre postmortem --from-investigation incident-2026-05-06-1432-checkout-burn # continuação de v1.9
|
|
73
|
+
/sre prr --service orders-api --reviewer @sre-lead # PRR de serviço existente
|
|
74
|
+
/sre risk-budget checkout_success --explain # budget + sabedoria 99.99% inline
|
|
75
|
+
/sre help # exibe tabela de subcomandos
|
|
76
|
+
```
|
|
77
|
+
</context>
|
|
78
|
+
|
|
79
|
+
<process>
|
|
80
|
+
|
|
81
|
+
## 1. Parsear subcomando
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
SUBCMD=$(echo "$ARGUMENTS" | awk '{print $1}')
|
|
85
|
+
ARGS=$(echo "$ARGUMENTS" | cut -d' ' -f2-)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Se `$ARGUMENTS` for vazio ou `SUBCMD` for `help`/`ajuda`/`?`:** exibir tabela de subcomandos inline + exemplo de uso. Sair.
|
|
89
|
+
|
|
90
|
+
## 2. Resolver sinônimos para agent canônico
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
golden-signals, signals, 4signals, golden → golden-signals-instrumenter
|
|
94
|
+
auditar-toil, audit-toil, toil, auditar → toil-auditor
|
|
95
|
+
postmortem, pm, post-mortem → postmortem-writer
|
|
96
|
+
prr, production-readiness, readiness-review → prr-conductor
|
|
97
|
+
risk-budget, budget, risk, continuum → (comando direto — /risk-budget)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Se subcomando não resolve:** exibir erro inline com lista de subcomandos válidos. Sair.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
✗ Subcomando desconhecido: '<SUBCMD>'
|
|
104
|
+
|
|
105
|
+
Subcomandos válidos:
|
|
106
|
+
golden-signals → instrumentar 4 signals OTel (Latency/Traffic/Errors/Saturation)
|
|
107
|
+
auditar-toil → audit toil priorizado P0/P1/P2 + esforço de automação
|
|
108
|
+
postmortem → postmortem blameless 9 seções (--from-investigation OU --incident)
|
|
109
|
+
prr → Production Readiness Review 6 axes (--service OU --feature)
|
|
110
|
+
risk-budget → error budget vs risk continuum + sabedoria 99.99%
|
|
111
|
+
|
|
112
|
+
Uso: /sre <subcomando> <args...>
|
|
113
|
+
Exemplo: /sre prr --service orders-api
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 3. Detectar `supabase/config.toml` (passar `project_id` para agents que usam MCP)
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
PROJECT_ID=""
|
|
120
|
+
if [ -f supabase/config.toml ]; then
|
|
121
|
+
PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
|
|
122
|
+
fi
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Apenas `prr-conductor` usa `mcp__supabase__*` — outros 3 agents não precisam de `project_id` (instrumentação/audit/postmortem são filesystem only).
|
|
126
|
+
|
|
127
|
+
## 4. Dispatch — caminhos por subcomando
|
|
128
|
+
|
|
129
|
+
### 4a. `golden-signals` → `golden-signals-instrumenter`
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
Task(
|
|
133
|
+
subagent_type="golden-signals-instrumenter",
|
|
134
|
+
prompt="
|
|
135
|
+
${ARGS}
|
|
136
|
+
|
|
137
|
+
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).
|
|
138
|
+
"
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 4b. `auditar-toil` → `toil-auditor`
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
Task(
|
|
146
|
+
subagent_type="toil-auditor",
|
|
147
|
+
prompt="
|
|
148
|
+
project_root: .
|
|
149
|
+
output_path: .planning/TOIL-AUDIT.md
|
|
150
|
+
${ARGS}
|
|
151
|
+
|
|
152
|
+
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.
|
|
153
|
+
"
|
|
154
|
+
)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 4c. `postmortem` → `postmortem-writer`
|
|
158
|
+
|
|
159
|
+
Validar mutuamente exclusivos (`--from-investigation` E `--incident` ambos = ERROR; nenhum = AskUserQuestion sugerido).
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
Task(
|
|
163
|
+
subagent_type="postmortem-writer",
|
|
164
|
+
prompt="
|
|
165
|
+
${ARGS}
|
|
166
|
+
|
|
167
|
+
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).
|
|
168
|
+
"
|
|
169
|
+
)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 4d. `prr` → `prr-conductor`
|
|
173
|
+
|
|
174
|
+
Validar mutuamente exclusivos (`--service` E `--feature` ambos = ERROR; nenhum = ERROR com sugestão). Se `--reviewer` ausente: AskUserQuestion (anti-pattern auto-PRR).
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
Task(
|
|
178
|
+
subagent_type="prr-conductor",
|
|
179
|
+
prompt="
|
|
180
|
+
${ARGS}
|
|
181
|
+
${PROJECT_ID:+project_id: ${PROJECT_ID}}
|
|
182
|
+
|
|
183
|
+
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.
|
|
184
|
+
"
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 4e. `risk-budget` → comando direto `/risk-budget`
|
|
189
|
+
|
|
190
|
+
Caso especial — não há agent. Re-encaminhar via shell ou aplicar skill `sre-risk-management` direto.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# PT-BR: invocar comando /risk-budget passando args
|
|
194
|
+
# Em Claude Code, isso é equivalente a executar o comando file diretamente
|
|
195
|
+
# (orquestrador apenas valida sinônimo e delega)
|
|
196
|
+
/risk-budget ${ARGS}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
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).
|
|
200
|
+
|
|
201
|
+
## 5. Output
|
|
202
|
+
|
|
203
|
+
Output do agent (ou do comando direto risk-budget) é o output do orquestrador. Sem post-processing — agent já formata estruturado.
|
|
204
|
+
|
|
205
|
+
## 6. Sugestões de chains comuns (pós-output)
|
|
206
|
+
|
|
207
|
+
Após dispatch, orquestrador pode sugerir chains comuns:
|
|
208
|
+
|
|
209
|
+
| Subcomando rodado | Chain natural |
|
|
210
|
+
|---|---|
|
|
211
|
+
| `golden-signals` | `/sre prr --service <same>` (validar production-readiness) |
|
|
212
|
+
| `auditar-toil` | `/observabilidade omm` (alimentar OMM Capacidade 3) |
|
|
213
|
+
| `postmortem` | `/sre prr --service <affected>` OR `/observabilidade omm` (Capacidade 5 Incident Response) |
|
|
214
|
+
| `prr` | (se Approved) deploy; (se Blocked) fechar P0s e re-PRR |
|
|
215
|
+
| `risk-budget` | `/burn-rate-status` (live forecast) OR `/sre postmortem --incident "..."` se BUDGET-EXHAUSTED |
|
|
216
|
+
|
|
217
|
+
</process>
|
|
218
|
+
|
|
219
|
+
<success_criteria>
|
|
220
|
+
- [ ] Subcomando resolvido para agent canônico (5 subcomandos × seus sinônimos)
|
|
221
|
+
- [ ] `project_id` extraído de `supabase/config.toml` se presente (apenas relevante para `prr`)
|
|
222
|
+
- [ ] Dispatch via `Task(subagent_type=...)` — único ponto de chain (anti-pitfall A10)
|
|
223
|
+
- [ ] Subcomando `risk-budget` delega para comando direto `/risk-budget` (não usa Task)
|
|
224
|
+
- [ ] Subcomando `postmortem` valida `--from-investigation` E `--incident` mutuamente exclusivos antes de dispatch
|
|
225
|
+
- [ ] Subcomando `prr` valida `--service` E `--feature` mutuamente exclusivos + AskUserQuestion para reviewer (anti auto-PRR)
|
|
226
|
+
- [ ] Subcomando inválido → mensagem clara com lista de 5 subcomandos válidos
|
|
227
|
+
- [ ] Subcomando `help`/`ajuda`/`?` → exibe tabela inline com 6 linhas (5 + help)
|
|
228
|
+
- [ ] Args após subcomando passam transparentemente para o agent
|
|
229
|
+
- [ ] Sugestões de chains comuns na tabela final (5 chains documentadas)
|
|
230
|
+
</success_criteria>
|