@luanpdd/kit-mcp 1.34.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +2 -2
  3. package/bin/mcp.js +6 -6
  4. package/bin/ui.js +74 -74
  5. package/gates/ai-prompt-stability.md +120 -120
  6. package/gates/budget-description.md +68 -68
  7. package/gates/confidence.md +29 -29
  8. package/gates/dependency-check.md +33 -33
  9. package/gates/dept-cycle-prevention.md +179 -179
  10. package/gates/golden-signals-coverage.md +133 -133
  11. package/gates/legacy-refactor-safety.md +178 -178
  12. package/gates/multi-tenant-rls-coverage.md +102 -102
  13. package/gates/no-personal-uuid.md +72 -72
  14. package/gates/obs-agents-mcp-supabase.md +86 -86
  15. package/gates/obs-skills-frontmatter.md +76 -76
  16. package/gates/observability-coverage.md +151 -151
  17. package/gates/omm-no-regression.md +83 -83
  18. package/gates/postmortem-template-required.md +127 -127
  19. package/gates/prr-checklist-coverage.md +128 -128
  20. package/gates/regression.md +32 -32
  21. package/gates/release-pipeline-policy.md +132 -132
  22. package/gates/secrets-scan.md +33 -33
  23. package/gates/service-role-not-in-user-facing.md +113 -113
  24. package/gates/skill-must-include.md +71 -71
  25. package/gates/sync-idempotent.md +62 -62
  26. package/gates/verify-phase-goal.md +34 -34
  27. package/kit/agents/designer-ui.md +216 -216
  28. package/kit/agents/workflow-generator.md +537 -0
  29. package/kit/commands/adicionar-backlog.md +1 -1
  30. package/kit/commands/adicionar-fase.md +1 -1
  31. package/kit/commands/adicionar-tarefa.md +1 -1
  32. package/kit/commands/auditar-observabilidade.md +103 -103
  33. package/kit/commands/auditar-toil.md +129 -129
  34. package/kit/commands/caracterizar-prompt.md +195 -195
  35. package/kit/commands/criar-workflow.md +158 -0
  36. package/kit/commands/definir-perfil.md +1 -1
  37. package/kit/commands/definir-slo.md +108 -108
  38. package/kit/commands/fio.md +1 -1
  39. package/kit/commands/golden-signals.md +142 -142
  40. package/kit/commands/instrumentar-fase.md +200 -200
  41. package/kit/commands/investigar-producao.md +162 -162
  42. package/kit/commands/observabilidade.md +118 -118
  43. package/kit/commands/postmortem.md +179 -179
  44. package/kit/commands/prr.md +205 -205
  45. package/kit/commands/publicar-rapido.md +207 -207
  46. package/kit/commands/risk-budget.md +220 -220
  47. package/kit/commands/sre.md +230 -230
  48. package/kit/file-manifest.json +5 -2
  49. package/kit/framework/references/output-style.md +22 -22
  50. package/kit/hooks/post-apply-migration.js +199 -199
  51. package/kit/hooks/sidecar-tool-publisher.js +210 -210
  52. package/kit/skills/_shared-dados-distribuidos/glossary.md +224 -224
  53. package/kit/skills/_shared-legacy/glossary.md +389 -389
  54. package/kit/skills/_shared-multi-tenant/glossary.md +186 -186
  55. package/kit/skills/_shared-observability/glossary.md +396 -396
  56. package/kit/skills/_shared-sre/glossary.md +712 -712
  57. package/kit/skills/_shared-supabase/glossary.md +234 -234
  58. package/kit/skills/blameless-postmortems/SKILL.md +340 -340
  59. package/kit/skills/burn-rate-alerting/SKILL.md +258 -258
  60. package/kit/skills/cascading-failures/SKILL.md +311 -311
  61. package/kit/skills/core-analysis-loop/SKILL.md +352 -352
  62. package/kit/skills/distributed-tracing/SKILL.md +362 -362
  63. package/kit/skills/dynamic-workflow-authoring/SKILL.md +327 -0
  64. package/kit/skills/eliminating-toil/SKILL.md +243 -243
  65. package/kit/skills/event-based-slos/SKILL.md +296 -296
  66. package/kit/skills/four-golden-signals/SKILL.md +314 -314
  67. package/kit/skills/hermetic-builds/SKILL.md +323 -323
  68. package/kit/skills/legacy-monster-methods/SKILL.md +444 -444
  69. package/kit/skills/llm-as-dependency/SKILL.md +436 -436
  70. package/kit/skills/load-shedding-graceful-degradation/SKILL.md +396 -396
  71. package/kit/skills/observability-driven-development/SKILL.md +315 -315
  72. package/kit/skills/observability-maturity-model/SKILL.md +222 -222
  73. package/kit/skills/opentelemetry-standard/SKILL.md +351 -351
  74. package/kit/skills/production-readiness-review/SKILL.md +305 -305
  75. package/kit/skills/release-engineering/SKILL.md +367 -367
  76. package/kit/skills/retry-strategies/SKILL.md +372 -372
  77. package/kit/skills/sre-risk-management/SKILL.md +221 -221
  78. package/kit/skills/structured-events/SKILL.md +265 -265
  79. package/kit/skills/supabase-cron-queues/SKILL.md +275 -275
  80. package/kit/skills/supabase-database-functions/SKILL.md +332 -332
  81. package/kit/skills/supabase-declarative-schema/SKILL.md +183 -183
  82. package/kit/skills/supabase-pgvector-rag/SKILL.md +253 -253
  83. package/kit/skills/supabase-postgres-style/SKILL.md +138 -138
  84. package/kit/skills/supabase-storage/SKILL.md +234 -234
  85. package/kit/skills/telemetry-pipelines/SKILL.md +259 -259
  86. package/kit/skills/telemetry-sampling/SKILL.md +256 -256
  87. package/kit/skills/ui-anti-padroes-ia/SKILL.md +261 -261
  88. package/kit/skills/ui-contexto-produto/SKILL.md +248 -248
  89. package/kit/skills/ui-cor-estrategia/SKILL.md +213 -213
  90. package/kit/skills/ui-critica-auditoria/SKILL.md +260 -260
  91. package/kit/skills/ui-motion-funcional/SKILL.md +264 -264
  92. package/kit/skills/ui-ritmo-espacial/SKILL.md +259 -259
  93. package/kit/skills/ui-tipografia/SKILL.md +211 -211
  94. package/package.json +1 -1
  95. package/src/cli/index.js +1114 -1114
  96. package/src/cli/render.js +194 -194
  97. package/src/cli/upgrade-check.js +135 -135
  98. package/src/core/error-redaction.js +76 -76
  99. package/src/core/failures.js +153 -153
  100. package/src/core/gate-runner.js +205 -205
  101. package/src/core/gates.js +82 -82
  102. package/src/core/logger.js +170 -170
  103. package/src/core/manifest-verify.js +174 -174
  104. package/src/core/metrics.js +268 -268
  105. package/src/core/notify.js +60 -60
  106. package/src/core/path-safety.js +141 -141
  107. package/src/core/replays.js +120 -120
  108. package/src/core/ui.js +185 -185
  109. package/src/mcp-server/install.js +149 -149
  110. package/src/mcp-server/roots.js +124 -124
  111. package/src/ui/auto-spawn.js +113 -113
  112. package/src/ui/browser.js +78 -78
  113. package/src/ui/client.js +130 -130
  114. package/src/ui/events.js +65 -65
  115. package/src/ui/lockfile.js +191 -191
  116. package/src/ui/port.js +67 -67
  117. package/src/ui/server.js +547 -547
  118. package/src/ui/wrapper.js +129 -129
@@ -1,162 +1,162 @@
1
- ---
2
- name: investigar-producao
3
- description: Lança Core Analysis Loop guiado em incidente real — agente incident-investigator usa MCP Supabase, mantém estado em .planning/investigations/, retoma entre resets de contexto.
4
- argument-hint: "<sintoma em texto livre> [--id <investigation_id>]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Grep
10
- - Glob
11
- - Task
12
- - AskUserQuestion
13
- ---
14
-
15
- <objective>
16
- Lança o agente [`incident-investigator`](../agents/incident-investigator.md) para aplicar o [Core Analysis Loop](../skills/core-analysis-loop/SKILL.md) sobre um incidente. Estado iterativo de hipóteses fica em `.planning/investigations/<id>.md` — permite retomar entre resets de contexto (precedente: `/depurar`).
17
-
18
- **Cria/Atualiza:**
19
- - `.planning/investigations/<investigation_id>.md` — trilha de hipóteses validadas/refutadas
20
-
21
- **Após:** root cause documentado + action items + estado salvo para próxima sessão.
22
- </objective>
23
-
24
- <context>
25
- **Argumentos:** `$ARGUMENTS` — texto livre do sintoma + flags opcionais.
26
-
27
- **Flags:**
28
- - `--id <investigation_id>` — retoma investigação existente (pula criação de novo arquivo)
29
- - `--time-window <Nh|Nd>` — janela de busca (default: 1h)
30
-
31
- **Exemplos:**
32
- ```
33
- /investigar-producao "checkout SLO burn rate = 8 às 14:32"
34
- /investigar-producao --id incident-2026-05-06-1432-checkout-burn # retomar
35
- /investigar-producao "tenant acme reportou erros 5xx" --time-window 6h
36
- ```
37
-
38
- **Pré-requisito (Full mode):** projeto Supabase configurado, `mcp__supabase__*` disponível.
39
- </context>
40
-
41
- <process>
42
-
43
- ## 1. Parsear argumentos
44
-
45
- ```bash
46
- INV_ID=$(echo "$ARGUMENTS" | grep -oE -- '--id [^ ]+' | awk '{print $2}')
47
- TIME_WINDOW=$(echo "$ARGUMENTS" | grep -oE -- '--time-window [^ ]+' | awk '{print $2}')
48
- SYMPTOM=$(echo "$ARGUMENTS" | sed -E 's/--(id|time-window) [^ ]+//g' | xargs)
49
-
50
- [ -z "$TIME_WINDOW" ] && TIME_WINDOW="1h"
51
- ```
52
-
53
- ## 2. Validar pré-requisitos
54
-
55
- ```bash
56
- mkdir -p .planning/investigations
57
-
58
- # PT-BR: se --id fornecido, validar arquivo existe
59
- if [ -n "$INV_ID" ]; then
60
- INV_FILE=".planning/investigations/${INV_ID}.md"
61
- if [ ! -f "$INV_FILE" ]; then
62
- echo "Investigation $INV_ID não existe. Liste com: ls .planning/investigations/"
63
- exit 1
64
- fi
65
- echo "Retomando investigação: $INV_ID"
66
- fi
67
-
68
- # PT-BR: se SYMPTOM vazio + sem --id → erro
69
- if [ -z "$SYMPTOM" ] && [ -z "$INV_ID" ]; then
70
- echo "Erro: forneça sintoma OU --id <investigation_id>"
71
- echo "Exemplos:"
72
- echo " /investigar-producao \"checkout SLO burn rate = 8\""
73
- echo " /investigar-producao --id incident-2026-05-06-1432-foo"
74
- exit 1
75
- fi
76
- ```
77
-
78
- ## 3. Detectar `supabase/config.toml`
79
-
80
- ```bash
81
- PROJECT_ID=""
82
- if [ -f supabase/config.toml ]; then
83
- PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
84
- fi
85
- ```
86
-
87
- ## 4. Listar investigações em aberto (UX)
88
-
89
- Antes de lançar agente, mostrar contexto de investigações ativas:
90
-
91
- ```bash
92
- ls -t .planning/investigations/*.md 2>/dev/null | head -5 | while read f; do
93
- ID=$(basename "$f" .md)
94
- STARTED=$(grep '**Started:**' "$f" | head -1 | sed 's/.*Started:\*\* //')
95
- STATUS=$(grep -E '^## (Root Cause|Status:)' "$f" | head -1)
96
- printf " %s — %s — %s\n" "$ID" "$STARTED" "$STATUS"
97
- done
98
- ```
99
-
100
- ## 5. Dispatch para `incident-investigator`
101
-
102
- ```text
103
- Task(
104
- subagent_type="incident-investigator",
105
- prompt="
106
- ${SYMPTOM:-(retomando $INV_ID)}
107
-
108
- ${INV_ID:+investigation_id: $INV_ID}
109
- ${PROJECT_ID:+project_id: $PROJECT_ID}
110
- time_window: ${TIME_WINDOW}
111
-
112
- Aplicar Core Analysis Loop até root cause OU lacuna intransponível.
113
- Salvar estado iterativo em .planning/investigations/{id}.md.
114
- Documentar todas as hipóteses (validated/refuted/inconclusive) com query + resultado citado.
115
- "
116
- )
117
- ```
118
-
119
- ## 6. Após retorno do agente
120
-
121
- Apresentar resumo curto + caminho do arquivo de estado:
122
-
123
- ```
124
- ═══════════════════════════════════════════════════════════
125
- framework ► INVESTIGAR-PRODUCAO ▸ ${INV_ID}
126
- ═══════════════════════════════════════════════════════════
127
-
128
- [output do agente — ver agente incident-investigator Step 7]
129
-
130
- ## Estado salvo
131
- .planning/investigations/${INV_ID}.md
132
-
133
- ## Próximos passos
134
- - Action items listados no Root Cause acima
135
- - Para abrir loop separado (ex.: "por que tenant acelerou?"):
136
- /investigar-producao "<novo sintoma>"
137
- - Para retomar mais tarde:
138
- /investigar-producao --id ${INV_ID}
139
- ```
140
-
141
- ## 7. Pause AskUserQuestion (opcional)
142
-
143
- Se agente reportou status `INCONCLUSIVE` ou `gaps_found`, perguntar via AskUserQuestion:
144
-
145
- - header: "Próximo?"
146
- - question: "Investigation incompleta. O que fazer?"
147
- - options:
148
- - "Continuar com hipótese específica" — pede texto livre da hipótese
149
- - "Pausar — retomar depois" — sai mantendo state
150
- - "Fechar como inconclusiva" — marca arquivo como `## Status: INCONCLUSIVE` e sai
151
-
152
- </process>
153
-
154
- <success_criteria>
155
- - [ ] Sintoma + investigation_id (novo ou existente) parseados corretamente
156
- - [ ] Arquivo `.planning/investigations/<id>.md` criado/atualizado
157
- - [ ] `mcp__supabase__*` invocados em ≥ 1 hipótese (Full mode); ou modo offline declarado
158
- - [ ] Cada hipótese documentada com Query + Resultado citado
159
- - [ ] Root cause tem 4 dimensões (WHO/WHERE/WHEN/WHAT) OU status INCONCLUSIVE explícito
160
- - [ ] Action items concretos listados
161
- - [ ] Estado retomável: `/investigar-producao --id <id>` recarrega trilha
162
- </success_criteria>
1
+ ---
2
+ name: investigar-producao
3
+ description: Lança Core Analysis Loop guiado em incidente real — agente incident-investigator usa MCP Supabase, mantém estado em .planning/investigations/, retoma entre resets de contexto.
4
+ argument-hint: "<sintoma em texto livre> [--id <investigation_id>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Grep
10
+ - Glob
11
+ - Task
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ <objective>
16
+ Lança o agente [`incident-investigator`](../agents/incident-investigator.md) para aplicar o [Core Analysis Loop](../skills/core-analysis-loop/SKILL.md) sobre um incidente. Estado iterativo de hipóteses fica em `.planning/investigations/<id>.md` — permite retomar entre resets de contexto (precedente: `/depurar`).
17
+
18
+ **Cria/Atualiza:**
19
+ - `.planning/investigations/<investigation_id>.md` — trilha de hipóteses validadas/refutadas
20
+
21
+ **Após:** root cause documentado + action items + estado salvo para próxima sessão.
22
+ </objective>
23
+
24
+ <context>
25
+ **Argumentos:** `$ARGUMENTS` — texto livre do sintoma + flags opcionais.
26
+
27
+ **Flags:**
28
+ - `--id <investigation_id>` — retoma investigação existente (pula criação de novo arquivo)
29
+ - `--time-window <Nh|Nd>` — janela de busca (default: 1h)
30
+
31
+ **Exemplos:**
32
+ ```
33
+ /investigar-producao "checkout SLO burn rate = 8 às 14:32"
34
+ /investigar-producao --id incident-2026-05-06-1432-checkout-burn # retomar
35
+ /investigar-producao "tenant acme reportou erros 5xx" --time-window 6h
36
+ ```
37
+
38
+ **Pré-requisito (Full mode):** projeto Supabase configurado, `mcp__supabase__*` disponível.
39
+ </context>
40
+
41
+ <process>
42
+
43
+ ## 1. Parsear argumentos
44
+
45
+ ```bash
46
+ INV_ID=$(echo "$ARGUMENTS" | grep -oE -- '--id [^ ]+' | awk '{print $2}')
47
+ TIME_WINDOW=$(echo "$ARGUMENTS" | grep -oE -- '--time-window [^ ]+' | awk '{print $2}')
48
+ SYMPTOM=$(echo "$ARGUMENTS" | sed -E 's/--(id|time-window) [^ ]+//g' | xargs)
49
+
50
+ [ -z "$TIME_WINDOW" ] && TIME_WINDOW="1h"
51
+ ```
52
+
53
+ ## 2. Validar pré-requisitos
54
+
55
+ ```bash
56
+ mkdir -p .planning/investigations
57
+
58
+ # PT-BR: se --id fornecido, validar arquivo existe
59
+ if [ -n "$INV_ID" ]; then
60
+ INV_FILE=".planning/investigations/${INV_ID}.md"
61
+ if [ ! -f "$INV_FILE" ]; then
62
+ echo "Investigation $INV_ID não existe. Liste com: ls .planning/investigations/"
63
+ exit 1
64
+ fi
65
+ echo "Retomando investigação: $INV_ID"
66
+ fi
67
+
68
+ # PT-BR: se SYMPTOM vazio + sem --id → erro
69
+ if [ -z "$SYMPTOM" ] && [ -z "$INV_ID" ]; then
70
+ echo "Erro: forneça sintoma OU --id <investigation_id>"
71
+ echo "Exemplos:"
72
+ echo " /investigar-producao \"checkout SLO burn rate = 8\""
73
+ echo " /investigar-producao --id incident-2026-05-06-1432-foo"
74
+ exit 1
75
+ fi
76
+ ```
77
+
78
+ ## 3. Detectar `supabase/config.toml`
79
+
80
+ ```bash
81
+ PROJECT_ID=""
82
+ if [ -f supabase/config.toml ]; then
83
+ PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
84
+ fi
85
+ ```
86
+
87
+ ## 4. Listar investigações em aberto (UX)
88
+
89
+ Antes de lançar agente, mostrar contexto de investigações ativas:
90
+
91
+ ```bash
92
+ ls -t .planning/investigations/*.md 2>/dev/null | head -5 | while read f; do
93
+ ID=$(basename "$f" .md)
94
+ STARTED=$(grep '**Started:**' "$f" | head -1 | sed 's/.*Started:\*\* //')
95
+ STATUS=$(grep -E '^## (Root Cause|Status:)' "$f" | head -1)
96
+ printf " %s — %s — %s\n" "$ID" "$STARTED" "$STATUS"
97
+ done
98
+ ```
99
+
100
+ ## 5. Dispatch para `incident-investigator`
101
+
102
+ ```text
103
+ Task(
104
+ subagent_type="incident-investigator",
105
+ prompt="
106
+ ${SYMPTOM:-(retomando $INV_ID)}
107
+
108
+ ${INV_ID:+investigation_id: $INV_ID}
109
+ ${PROJECT_ID:+project_id: $PROJECT_ID}
110
+ time_window: ${TIME_WINDOW}
111
+
112
+ Aplicar Core Analysis Loop até root cause OU lacuna intransponível.
113
+ Salvar estado iterativo em .planning/investigations/{id}.md.
114
+ Documentar todas as hipóteses (validated/refuted/inconclusive) com query + resultado citado.
115
+ "
116
+ )
117
+ ```
118
+
119
+ ## 6. Após retorno do agente
120
+
121
+ Apresentar resumo curto + caminho do arquivo de estado:
122
+
123
+ ```
124
+ ═══════════════════════════════════════════════════════════
125
+ framework ► INVESTIGAR-PRODUCAO ▸ ${INV_ID}
126
+ ═══════════════════════════════════════════════════════════
127
+
128
+ [output do agente — ver agente incident-investigator Step 7]
129
+
130
+ ## Estado salvo
131
+ .planning/investigations/${INV_ID}.md
132
+
133
+ ## Próximos passos
134
+ - Action items listados no Root Cause acima
135
+ - Para abrir loop separado (ex.: "por que tenant acelerou?"):
136
+ /investigar-producao "<novo sintoma>"
137
+ - Para retomar mais tarde:
138
+ /investigar-producao --id ${INV_ID}
139
+ ```
140
+
141
+ ## 7. Pause AskUserQuestion (opcional)
142
+
143
+ Se agente reportou status `INCONCLUSIVE` ou `gaps_found`, perguntar via AskUserQuestion:
144
+
145
+ - header: "Próximo?"
146
+ - question: "Investigation incompleta. O que fazer?"
147
+ - options:
148
+ - "Continuar com hipótese específica" — pede texto livre da hipótese
149
+ - "Pausar — retomar depois" — sai mantendo state
150
+ - "Fechar como inconclusiva" — marca arquivo como `## Status: INCONCLUSIVE` e sai
151
+
152
+ </process>
153
+
154
+ <success_criteria>
155
+ - [ ] Sintoma + investigation_id (novo ou existente) parseados corretamente
156
+ - [ ] Arquivo `.planning/investigations/<id>.md` criado/atualizado
157
+ - [ ] `mcp__supabase__*` invocados em ≥ 1 hipótese (Full mode); ou modo offline declarado
158
+ - [ ] Cada hipótese documentada com Query + Resultado citado
159
+ - [ ] Root cause tem 4 dimensões (WHO/WHERE/WHEN/WHAT) OU status INCONCLUSIVE explícito
160
+ - [ ] Action items concretos listados
161
+ - [ ] Estado retomável: `/investigar-producao --id <id>` recarrega trilha
162
+ </success_criteria>
@@ -1,118 +1,118 @@
1
- ---
2
- name: observabilidade
3
- description: Orquestrador da Suíte Observabilidade — dispatch para agents (instrumenter, investigator, slo-engineer, burn-rate-forecaster, omm-auditor) 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 Observabilidade (v1.9). Recebe subcomando e args, faz dispatch via `Task(subagent_type=...)` para o agent especializado correto. **Único ponto de chain de agents observability** (precedente: `/supabase` em v1.8 — anti-pitfall A10 mantido).
17
-
18
- **Cria/Atualiza:** o que cada agent invocado cria.
19
-
20
- **Após:** o usuário tem o output do agent (patches, SLO.md, snapshot OMM, investigation trail, etc.).
21
- </objective>
22
-
23
- <execution_context>
24
- Skills consultadas pelos agents: `kit/skills/_shared-observability/glossary.md` (Phase 29) + `kit/skills/observability-*/SKILL.md` + `kit/skills/structured-events/SKILL.md` + `kit/skills/distributed-tracing/SKILL.md` + `kit/skills/opentelemetry-standard/SKILL.md` + `kit/skills/core-analysis-loop/SKILL.md` + `kit/skills/event-based-slos/SKILL.md` + `kit/skills/burn-rate-alerting/SKILL.md` + `kit/skills/telemetry-sampling/SKILL.md` + `kit/skills/telemetry-pipelines/SKILL.md`.
25
-
26
- Agents disponíveis: `kit/agents/observability-instrumenter.md` (Phase 30), `kit/agents/incident-investigator.md` (Phase 30), `kit/agents/slo-engineer.md` (Phase 32), `kit/agents/burn-rate-forecaster.md` (Phase 32), `kit/agents/omm-auditor.md` (Phase 34).
27
- </execution_context>
28
-
29
- <context>
30
- **Argumentos:** `$ARGUMENTS` — primeiro token é o subcomando; restante é passado para o agent como prompt.
31
-
32
- **Subcomandos suportados (sinônimos PT-BR/EN):**
33
-
34
- | Subcomando | Sinônimos | Agent dispatched |
35
- |---|---|---|
36
- | `instrumentar` | `instrument`, `inst` | `observability-instrumenter` |
37
- | `investigar` | `investigate`, `incident` | `incident-investigator` |
38
- | `slo` | `definir-slo`, `slo-engineer` | `slo-engineer` |
39
- | `burn-rate` | `burn`, `burn-rate-forecaster`, `forecast` | `burn-rate-forecaster` |
40
- | `omm` | `auditar`, `audit`, `maturity` | `omm-auditor` |
41
- | `audit-coverage` | `cobertura`, `coverage` | `observability-coverage-auditor` (v1.12 cross-suite) |
42
- | `help` | `ajuda`, `?` | exibe esta tabela inline |
43
- </context>
44
-
45
- <process>
46
-
47
- ## 1. Parsear subcomando
48
-
49
- ```bash
50
- SUBCMD=$(echo "$ARGUMENTS" | awk '{print $1}')
51
- ARGS=$(echo "$ARGUMENTS" | cut -d' ' -f2-)
52
- ```
53
-
54
- **Se `$ARGUMENTS` for vazio ou `SUBCMD` for `help`/`ajuda`/`?`:** exibir tabela de subcomandos inline + exemplo. Sair.
55
-
56
- ## 2. Resolver sinônimos
57
-
58
- ```text
59
- instrumentar, instrument, inst → observability-instrumenter
60
- investigar, investigate, incident → incident-investigator
61
- slo, definir-slo, slo-engineer → slo-engineer
62
- burn-rate, burn, burn-rate-forecaster, forecast → burn-rate-forecaster
63
- omm, auditar, audit, maturity → omm-auditor
64
- audit-coverage, cobertura, coverage → observability-coverage-auditor (v1.12 — cross-suite com Legacy)
65
- ```
66
-
67
- **Se subcomando não resolve:** exibir erro inline com lista de subcomandos válidos. Sair.
68
-
69
- ```
70
- ✗ Subcomando desconhecido: '<SUBCMD>'
71
-
72
- Subcomandos válidos:
73
- instrumentar / instrument → instrumentar código com OTel + atributos canônicos
74
- investigar / investigate → Core Analysis Loop em incident
75
- slo / definir-slo → criar SLO.md + SQL materializar SLI
76
- burn-rate / forecast → calcular burn rate atual + ETA exhaustão
77
- omm / auditar → OMM scored 5 capacidades
78
-
79
- Uso: /observabilidade <subcomando> <args...>
80
- Exemplo: /observabilidade investigar "checkout SLO burn rate = 8 às 14:32"
81
- ```
82
-
83
- ## 3. Detectar `supabase/config.toml` (para agents que usam MCP Supabase)
84
-
85
- ```bash
86
- PROJECT_ID=""
87
- if [ -f supabase/config.toml ]; then
88
- PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
89
- fi
90
- ```
91
-
92
- ## 4. Dispatch
93
-
94
- Invocar `Task(subagent_type=<agent_name>, prompt=<built_prompt>)`.
95
-
96
- **Prompt construído:**
97
-
98
- ```
99
- {ARGS}
100
-
101
- {Se project_id detectado:}
102
- project_id: {PROJECT_ID}
103
- ```
104
-
105
- ## 5. Output
106
-
107
- Output do agent é o output do command. Sem post-processing — agent já formata estruturado.
108
-
109
- </process>
110
-
111
- <success_criteria>
112
- - [ ] Subcomando resolvido para agent canônico (5 subcomandos × seus sinônimos)
113
- - [ ] `project_id` extraído de `supabase/config.toml` se presente
114
- - [ ] Dispatch via `Task(subagent_type=...)` — único ponto de chain
115
- - [ ] Subcomando inválido → mensagem clara com lista
116
- - [ ] Subcomando `help`/`ajuda`/`?` → exibe tabela inline
117
- - [ ] Args após subcomando passam transparentemente para o agent
118
- </success_criteria>
1
+ ---
2
+ name: observabilidade
3
+ description: Orquestrador da Suíte Observabilidade — dispatch para agents (instrumenter, investigator, slo-engineer, burn-rate-forecaster, omm-auditor) 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 Observabilidade (v1.9). Recebe subcomando e args, faz dispatch via `Task(subagent_type=...)` para o agent especializado correto. **Único ponto de chain de agents observability** (precedente: `/supabase` em v1.8 — anti-pitfall A10 mantido).
17
+
18
+ **Cria/Atualiza:** o que cada agent invocado cria.
19
+
20
+ **Após:** o usuário tem o output do agent (patches, SLO.md, snapshot OMM, investigation trail, etc.).
21
+ </objective>
22
+
23
+ <execution_context>
24
+ Skills consultadas pelos agents: `kit/skills/_shared-observability/glossary.md` (Phase 29) + `kit/skills/observability-*/SKILL.md` + `kit/skills/structured-events/SKILL.md` + `kit/skills/distributed-tracing/SKILL.md` + `kit/skills/opentelemetry-standard/SKILL.md` + `kit/skills/core-analysis-loop/SKILL.md` + `kit/skills/event-based-slos/SKILL.md` + `kit/skills/burn-rate-alerting/SKILL.md` + `kit/skills/telemetry-sampling/SKILL.md` + `kit/skills/telemetry-pipelines/SKILL.md`.
25
+
26
+ Agents disponíveis: `kit/agents/observability-instrumenter.md` (Phase 30), `kit/agents/incident-investigator.md` (Phase 30), `kit/agents/slo-engineer.md` (Phase 32), `kit/agents/burn-rate-forecaster.md` (Phase 32), `kit/agents/omm-auditor.md` (Phase 34).
27
+ </execution_context>
28
+
29
+ <context>
30
+ **Argumentos:** `$ARGUMENTS` — primeiro token é o subcomando; restante é passado para o agent como prompt.
31
+
32
+ **Subcomandos suportados (sinônimos PT-BR/EN):**
33
+
34
+ | Subcomando | Sinônimos | Agent dispatched |
35
+ |---|---|---|
36
+ | `instrumentar` | `instrument`, `inst` | `observability-instrumenter` |
37
+ | `investigar` | `investigate`, `incident` | `incident-investigator` |
38
+ | `slo` | `definir-slo`, `slo-engineer` | `slo-engineer` |
39
+ | `burn-rate` | `burn`, `burn-rate-forecaster`, `forecast` | `burn-rate-forecaster` |
40
+ | `omm` | `auditar`, `audit`, `maturity` | `omm-auditor` |
41
+ | `audit-coverage` | `cobertura`, `coverage` | `observability-coverage-auditor` (v1.12 cross-suite) |
42
+ | `help` | `ajuda`, `?` | exibe esta tabela inline |
43
+ </context>
44
+
45
+ <process>
46
+
47
+ ## 1. Parsear subcomando
48
+
49
+ ```bash
50
+ SUBCMD=$(echo "$ARGUMENTS" | awk '{print $1}')
51
+ ARGS=$(echo "$ARGUMENTS" | cut -d' ' -f2-)
52
+ ```
53
+
54
+ **Se `$ARGUMENTS` for vazio ou `SUBCMD` for `help`/`ajuda`/`?`:** exibir tabela de subcomandos inline + exemplo. Sair.
55
+
56
+ ## 2. Resolver sinônimos
57
+
58
+ ```text
59
+ instrumentar, instrument, inst → observability-instrumenter
60
+ investigar, investigate, incident → incident-investigator
61
+ slo, definir-slo, slo-engineer → slo-engineer
62
+ burn-rate, burn, burn-rate-forecaster, forecast → burn-rate-forecaster
63
+ omm, auditar, audit, maturity → omm-auditor
64
+ audit-coverage, cobertura, coverage → observability-coverage-auditor (v1.12 — cross-suite com Legacy)
65
+ ```
66
+
67
+ **Se subcomando não resolve:** exibir erro inline com lista de subcomandos válidos. Sair.
68
+
69
+ ```
70
+ ✗ Subcomando desconhecido: '<SUBCMD>'
71
+
72
+ Subcomandos válidos:
73
+ instrumentar / instrument → instrumentar código com OTel + atributos canônicos
74
+ investigar / investigate → Core Analysis Loop em incident
75
+ slo / definir-slo → criar SLO.md + SQL materializar SLI
76
+ burn-rate / forecast → calcular burn rate atual + ETA exhaustão
77
+ omm / auditar → OMM scored 5 capacidades
78
+
79
+ Uso: /observabilidade <subcomando> <args...>
80
+ Exemplo: /observabilidade investigar "checkout SLO burn rate = 8 às 14:32"
81
+ ```
82
+
83
+ ## 3. Detectar `supabase/config.toml` (para agents que usam MCP Supabase)
84
+
85
+ ```bash
86
+ PROJECT_ID=""
87
+ if [ -f supabase/config.toml ]; then
88
+ PROJECT_ID=$(grep -E '^project_id\s*=' supabase/config.toml | sed 's/.*= *"\(.*\)".*/\1/' | head -1)
89
+ fi
90
+ ```
91
+
92
+ ## 4. Dispatch
93
+
94
+ Invocar `Task(subagent_type=<agent_name>, prompt=<built_prompt>)`.
95
+
96
+ **Prompt construído:**
97
+
98
+ ```
99
+ {ARGS}
100
+
101
+ {Se project_id detectado:}
102
+ project_id: {PROJECT_ID}
103
+ ```
104
+
105
+ ## 5. Output
106
+
107
+ Output do agent é o output do command. Sem post-processing — agent já formata estruturado.
108
+
109
+ </process>
110
+
111
+ <success_criteria>
112
+ - [ ] Subcomando resolvido para agent canônico (5 subcomandos × seus sinônimos)
113
+ - [ ] `project_id` extraído de `supabase/config.toml` se presente
114
+ - [ ] Dispatch via `Task(subagent_type=...)` — único ponto de chain
115
+ - [ ] Subcomando inválido → mensagem clara com lista
116
+ - [ ] Subcomando `help`/`ajuda`/`?` → exibe tabela inline
117
+ - [ ] Args após subcomando passam transparentemente para o agent
118
+ </success_criteria>