@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,103 +1,103 @@
1
- ---
2
- name: auditar-observabilidade
3
- description: Invoca omm-auditor para gerar OMM-REPORT.md scored. 5 capacidades com trend vs marco anterior. Action items priorizados P0-P3.
4
- argument-hint: "[--previous <marco>] [--ci]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Task
10
- ---
11
-
12
- <objective>
13
- Gerar OMM-REPORT.md com snapshot scored das 5 capacidades de observabilidade. Aplica skill [`observability-maturity-model`](../skills/observability-maturity-model/SKILL.md) — sintomas qualitativos doing well/poorly por capacidade.
14
-
15
- **Cria/Atualiza:**
16
- - `.planning/OMM-REPORT.md` — snapshot atual
17
- - (Em `/concluir-marco`) `.planning/milestones/<v>/OMM-REPORT.md` — snapshot arquivado
18
-
19
- **Após:** time tem 5 scores + trend + action items priorizados.
20
- </objective>
21
-
22
- <context>
23
- **Argumentos:** `$ARGUMENTS`
24
-
25
- **Flags:**
26
- - `--previous <marco>` — comparar com marco específico (default: detecta automaticamente do MILESTONES.md)
27
- - `--ci` — modo CI: exit code 0 se OK, 1 se regression em qualquer capacidade
28
-
29
- **Quando rodar:**
30
- - Manualmente para snapshot informal
31
- - Em `/auditar-marco` (audit pre-conclusion) — Phase 35 INT-FW-04
32
- - Em `/concluir-marco` (gate de regression) — Phase 35 INT-FW-05
33
- </context>
34
-
35
- <process>
36
-
37
- ## 1. Parsear argumentos
38
-
39
- ```bash
40
- PREVIOUS=$(echo "$ARGUMENTS" | grep -oE -- '--previous [^ ]+' | awk '{print $2}')
41
- CI_MODE=$(echo "$ARGUMENTS" | grep -c -- '--ci' || true)
42
- ```
43
-
44
- ## 2. Detectar previous milestone
45
-
46
- ```bash
47
- if [ -z "$PREVIOUS" ]; then
48
- # PT-BR: extrair último concluído de MILESTONES.md
49
- PREVIOUS=$(grep -E '^### v[0-9.]+\b' .planning/MILESTONES.md | head -2 | tail -1 | grep -oE 'v[0-9.]+')
50
- fi
51
- ```
52
-
53
- ## 3. Dispatch para `omm-auditor`
54
-
55
- ```text
56
- Task(
57
- subagent_type="omm-auditor",
58
- prompt="
59
- ${PREVIOUS:+previous_milestone: ${PREVIOUS}}
60
- mode: ${CI_MODE:+ci}snapshot
61
-
62
- Gerar OMM-REPORT.md com:
63
- 1. Score 1-5 por capacidade (5 capacidades)
64
- 2. Trend vs ${PREVIOUS:-último marco}
65
- 3. Action items priorizados P0-P3
66
- 4. Regression alerts (se alguma capacidade regrediu)
67
- 5. Comparação por marco
68
- "
69
- )
70
- ```
71
-
72
- ## 4. Pós-output
73
-
74
- ```
75
- ═══════════════════════════════════════════════════════════
76
- framework ► AUDITAR-OBSERVABILIDADE
77
- ═══════════════════════════════════════════════════════════
78
-
79
- [output do omm-auditor — snapshot inline]
80
-
81
- OMM-REPORT.md: .planning/OMM-REPORT.md
82
-
83
- ${CI_MODE:+## CI Mode}
84
- ${CI_MODE:+Exit code: 0 (OK) / 1 (regression detectada)}
85
- ```
86
-
87
- ## 5. Modo `--ci`
88
-
89
- Se `--ci` setado:
90
- - Parse OMM-REPORT.md para detectar regression alerts
91
- - Se ≥ 1 regression → exit 1 (CI fails)
92
- - Senão → exit 0 (OK)
93
-
94
- </process>
95
-
96
- <success_criteria>
97
- - [ ] omm-auditor invocado via Task
98
- - [ ] OMM-REPORT.md gerado em `.planning/OMM-REPORT.md`
99
- - [ ] 5 capacidades scored
100
- - [ ] Trend calculado vs `--previous` ou auto-detectado
101
- - [ ] Action items P0-P3 listados
102
- - [ ] Modo `--ci` exit code apropriado se regression
103
- </success_criteria>
1
+ ---
2
+ name: auditar-observabilidade
3
+ description: Invoca omm-auditor para gerar OMM-REPORT.md scored. 5 capacidades com trend vs marco anterior. Action items priorizados P0-P3.
4
+ argument-hint: "[--previous <marco>] [--ci]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Task
10
+ ---
11
+
12
+ <objective>
13
+ Gerar OMM-REPORT.md com snapshot scored das 5 capacidades de observabilidade. Aplica skill [`observability-maturity-model`](../skills/observability-maturity-model/SKILL.md) — sintomas qualitativos doing well/poorly por capacidade.
14
+
15
+ **Cria/Atualiza:**
16
+ - `.planning/OMM-REPORT.md` — snapshot atual
17
+ - (Em `/concluir-marco`) `.planning/milestones/<v>/OMM-REPORT.md` — snapshot arquivado
18
+
19
+ **Após:** time tem 5 scores + trend + action items priorizados.
20
+ </objective>
21
+
22
+ <context>
23
+ **Argumentos:** `$ARGUMENTS`
24
+
25
+ **Flags:**
26
+ - `--previous <marco>` — comparar com marco específico (default: detecta automaticamente do MILESTONES.md)
27
+ - `--ci` — modo CI: exit code 0 se OK, 1 se regression em qualquer capacidade
28
+
29
+ **Quando rodar:**
30
+ - Manualmente para snapshot informal
31
+ - Em `/auditar-marco` (audit pre-conclusion) — Phase 35 INT-FW-04
32
+ - Em `/concluir-marco` (gate de regression) — Phase 35 INT-FW-05
33
+ </context>
34
+
35
+ <process>
36
+
37
+ ## 1. Parsear argumentos
38
+
39
+ ```bash
40
+ PREVIOUS=$(echo "$ARGUMENTS" | grep -oE -- '--previous [^ ]+' | awk '{print $2}')
41
+ CI_MODE=$(echo "$ARGUMENTS" | grep -c -- '--ci' || true)
42
+ ```
43
+
44
+ ## 2. Detectar previous milestone
45
+
46
+ ```bash
47
+ if [ -z "$PREVIOUS" ]; then
48
+ # PT-BR: extrair último concluído de MILESTONES.md
49
+ PREVIOUS=$(grep -E '^### v[0-9.]+\b' .planning/MILESTONES.md | head -2 | tail -1 | grep -oE 'v[0-9.]+')
50
+ fi
51
+ ```
52
+
53
+ ## 3. Dispatch para `omm-auditor`
54
+
55
+ ```text
56
+ Task(
57
+ subagent_type="omm-auditor",
58
+ prompt="
59
+ ${PREVIOUS:+previous_milestone: ${PREVIOUS}}
60
+ mode: ${CI_MODE:+ci}snapshot
61
+
62
+ Gerar OMM-REPORT.md com:
63
+ 1. Score 1-5 por capacidade (5 capacidades)
64
+ 2. Trend vs ${PREVIOUS:-último marco}
65
+ 3. Action items priorizados P0-P3
66
+ 4. Regression alerts (se alguma capacidade regrediu)
67
+ 5. Comparação por marco
68
+ "
69
+ )
70
+ ```
71
+
72
+ ## 4. Pós-output
73
+
74
+ ```
75
+ ═══════════════════════════════════════════════════════════
76
+ framework ► AUDITAR-OBSERVABILIDADE
77
+ ═══════════════════════════════════════════════════════════
78
+
79
+ [output do omm-auditor — snapshot inline]
80
+
81
+ OMM-REPORT.md: .planning/OMM-REPORT.md
82
+
83
+ ${CI_MODE:+## CI Mode}
84
+ ${CI_MODE:+Exit code: 0 (OK) / 1 (regression detectada)}
85
+ ```
86
+
87
+ ## 5. Modo `--ci`
88
+
89
+ Se `--ci` setado:
90
+ - Parse OMM-REPORT.md para detectar regression alerts
91
+ - Se ≥ 1 regression → exit 1 (CI fails)
92
+ - Senão → exit 0 (OK)
93
+
94
+ </process>
95
+
96
+ <success_criteria>
97
+ - [ ] omm-auditor invocado via Task
98
+ - [ ] OMM-REPORT.md gerado em `.planning/OMM-REPORT.md`
99
+ - [ ] 5 capacidades scored
100
+ - [ ] Trend calculado vs `--previous` ou auto-detectado
101
+ - [ ] Action items P0-P3 listados
102
+ - [ ] Modo `--ci` exit code apropriado se regression
103
+ </success_criteria>
@@ -1,129 +1,129 @@
1
- ---
2
- name: auditar-toil
3
- description: Invoca toil-auditor — analisa repo + git log + scripts + runbooks; gera .planning/TOIL-AUDIT.md priorizado P0/P1/P2 com esforço de automação.
4
- argument-hint: "[--time-window 3m] [--team-size N] [--output PATH]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Grep
10
- - Glob
11
- - Task
12
- ---
13
-
14
- <objective>
15
- Auditar o repositório atual em busca de **toil** (cap 5 do livro Google SRE) — trabalho manual, repetitivo, automatizável, tático, sem valor durável que escala linear com tráfego/usuários. Invoca o agente [`toil-auditor`](../agents/toil-auditor.md) que aplica a skill [`eliminating-toil`](../skills/eliminating-toil/SKILL.md) — 6 critérios canônicos, regra ≤ 50%, distinção toil vs overhead vs grungy work.
16
-
17
- **Cria/Atualiza:**
18
- - `.planning/TOIL-AUDIT.md` — lista priorizada P0/P1/P2 com 6 critérios scored + esforço de automação estimado
19
-
20
- **Após:** o user tem audit acionável para reduzir toil pelo time. Phase 39 INT-OBS-02 integra ao `omm-auditor` (v1.9) — Capacidade 3 do OMM scoring usa este audit.
21
- </objective>
22
-
23
- <context>
24
- **Argumentos:** `$ARGUMENTS` — todas as flags são opcionais; comando funciona com defaults.
25
-
26
- **Flags:**
27
- - `--time-window <Nm|Nd>` — janela de git history a analisar (default: `3m` = 3 meses)
28
- - `--team-size <N>` — número de pessoas no time (default: inferido via `git shortlog -sn`)
29
- - `--output <path>` — caminho do output (default: `.planning/TOIL-AUDIT.md`)
30
- - `--runbooks-paths <p1,p2,...>` — paths customizados de runbooks (default: `runbooks/, docs/runbooks/, ops/, scripts/, .github/workflows/`)
31
-
32
- **Exemplos:**
33
- ```
34
- /auditar-toil # defaults — 3m de git, team auto-detect
35
- /auditar-toil --time-window 6m --team-size 5 # janela maior + team explícito
36
- /auditar-toil --output .planning/audit/toil-2026-Q2.md # path customizado
37
- ```
38
-
39
- **Pré-requisito:** repositório git inicializado (sem isso, agent skip git log analysis e usa apenas scripts/runbooks).
40
- </context>
41
-
42
- <process>
43
-
44
- ## 1. Parsear argumentos
45
-
46
- ```bash
47
- TIME_WINDOW=$(echo "$ARGUMENTS" | grep -oE -- '--time-window [^ ]+' | awk '{print $2}')
48
- TEAM_SIZE=$(echo "$ARGUMENTS" | grep -oE -- '--team-size [^ ]+' | awk '{print $2}')
49
- OUTPUT_PATH=$(echo "$ARGUMENTS" | grep -oE -- '--output [^ ]+' | awk '{print $2}')
50
- RUNBOOKS=$(echo "$ARGUMENTS" | grep -oE -- '--runbooks-paths [^ ]+' | awk '{print $2}')
51
-
52
- [ -z "$TIME_WINDOW" ] && TIME_WINDOW="3m"
53
- [ -z "$OUTPUT_PATH" ] && OUTPUT_PATH=".planning/TOIL-AUDIT.md"
54
-
55
- # PT-BR: criar destination dir
56
- mkdir -p "$(dirname "$OUTPUT_PATH")"
57
- ```
58
-
59
- ## 2. Validar pré-requisitos
60
-
61
- ```bash
62
- # PT-BR: detectar git repo (não-bloqueante — agent funciona sem git, só com scripts/runbooks)
63
- GIT_OK=true
64
- git rev-parse --git-dir >/dev/null 2>&1 || GIT_OK=false
65
-
66
- if [ "$GIT_OK" = false ]; then
67
- echo "⚠ Nenhum repositório git detectado — agent vai pular git log analysis."
68
- echo " (toil-auditor continuará com scripts/runbooks apenas)"
69
- fi
70
-
71
- # PT-BR: verificar se TOIL-AUDIT.md anterior existe (idempotência)
72
- if [ -f "$OUTPUT_PATH" ]; then
73
- LAST_DATE=$(grep -m1 '**Audit date:**' "$OUTPUT_PATH" 2>/dev/null | sed 's/.*Audit date:\*\* //' || echo "?")
74
- echo "ℹ TOIL-AUDIT.md anterior detectado (Audit date: $LAST_DATE)."
75
- echo " Novo audit vai sobrescrever — agent compara com anterior se preservou histórico."
76
- fi
77
- ```
78
-
79
- ## 3. Dispatch para `toil-auditor`
80
-
81
- ```text
82
- Task(
83
- subagent_type="toil-auditor",
84
- prompt="
85
- project_root: .
86
- output_path: ${OUTPUT_PATH}
87
- time_window: ${TIME_WINDOW}
88
- ${TEAM_SIZE:+team_size: ${TEAM_SIZE}}
89
- ${RUNBOOKS:+runbooks_paths: ${RUNBOOKS}}
90
-
91
- Aplicar skill eliminating-toil. Etapas:
92
- 1. Scan: git log normalizado (commits repetitivos), scripts shell em paths canônicos, runbooks (manual ops descritas), README/CONTRIBUTING (manual setup).
93
- 2. Aplicar 6 critérios canônicos (manual, repetitivo, automatizável, tático, sem valor durável, escala linear) em cada candidato.
94
- 3. Distinguir toil vs overhead (reuniões/RH — não-elimináveis) vs grungy work (refactor — projeto engineering).
95
- 4. Priorizar P0/P1/P2 por (frequency × pain) / automation_effort.
96
- 5. Estimar esforço de automação por candidato (hours/days) + estágio L0-L4 do automation continuum.
97
- 6. Computar % do tempo do time gasto em toil (regra ≤ 50%).
98
-
99
- Output: ${OUTPUT_PATH} com tabela priorizada + sumário executivo + recomendações.
100
- "
101
- )
102
- ```
103
-
104
- ## 4. Pós-output + integração OMM
105
-
106
- ```
107
- ═══════════════════════════════════════════════════════════
108
- framework ► AUDITAR-TOIL ▸ ${OUTPUT_PATH}
109
- ═══════════════════════════════════════════════════════════
110
-
111
- [output do toil-auditor — ver Step 5 do agent]
112
-
113
- ## Próximos passos
114
- 1. Revisar P0 (alto impacto, baixo esforço) — alvos imediatos para automação
115
- 2. Se `workflow.audit_milestone_toil=true`, este audit alimenta `/auditar-marco` (Phase 40 INT-FW-V2-03)
116
- 3. Cross-ref OMM (v1.9 — Capacidade 3 Tech Debt): `/observabilidade omm` consome este audit
117
- 4. Re-audit recomendado a cada milestone (toil cresce silencioso)
118
- ```
119
-
120
- </process>
121
-
122
- <success_criteria>
123
- - [ ] $ARGUMENTS parseados (4 flags opcionais com defaults sensatos)
124
- - [ ] Pré-requisitos validados de forma não-bloqueante (git ausente OK; falta runbooks OK)
125
- - [ ] `toil-auditor` invocado via `Task(subagent_type=...)` com prompt completo (6 etapas)
126
- - [ ] `.planning/TOIL-AUDIT.md` (ou `--output` custom) criado pelo agent
127
- - [ ] Output forwarded transparentemente do agent (sem post-processing)
128
- - [ ] Próximos passos sugerem cross-ref para `/auditar-marco`, `/observabilidade omm`
129
- </success_criteria>
1
+ ---
2
+ name: auditar-toil
3
+ description: Invoca toil-auditor — analisa repo + git log + scripts + runbooks; gera .planning/TOIL-AUDIT.md priorizado P0/P1/P2 com esforço de automação.
4
+ argument-hint: "[--time-window 3m] [--team-size N] [--output PATH]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Grep
10
+ - Glob
11
+ - Task
12
+ ---
13
+
14
+ <objective>
15
+ Auditar o repositório atual em busca de **toil** (cap 5 do livro Google SRE) — trabalho manual, repetitivo, automatizável, tático, sem valor durável que escala linear com tráfego/usuários. Invoca o agente [`toil-auditor`](../agents/toil-auditor.md) que aplica a skill [`eliminating-toil`](../skills/eliminating-toil/SKILL.md) — 6 critérios canônicos, regra ≤ 50%, distinção toil vs overhead vs grungy work.
16
+
17
+ **Cria/Atualiza:**
18
+ - `.planning/TOIL-AUDIT.md` — lista priorizada P0/P1/P2 com 6 critérios scored + esforço de automação estimado
19
+
20
+ **Após:** o user tem audit acionável para reduzir toil pelo time. Phase 39 INT-OBS-02 integra ao `omm-auditor` (v1.9) — Capacidade 3 do OMM scoring usa este audit.
21
+ </objective>
22
+
23
+ <context>
24
+ **Argumentos:** `$ARGUMENTS` — todas as flags são opcionais; comando funciona com defaults.
25
+
26
+ **Flags:**
27
+ - `--time-window <Nm|Nd>` — janela de git history a analisar (default: `3m` = 3 meses)
28
+ - `--team-size <N>` — número de pessoas no time (default: inferido via `git shortlog -sn`)
29
+ - `--output <path>` — caminho do output (default: `.planning/TOIL-AUDIT.md`)
30
+ - `--runbooks-paths <p1,p2,...>` — paths customizados de runbooks (default: `runbooks/, docs/runbooks/, ops/, scripts/, .github/workflows/`)
31
+
32
+ **Exemplos:**
33
+ ```
34
+ /auditar-toil # defaults — 3m de git, team auto-detect
35
+ /auditar-toil --time-window 6m --team-size 5 # janela maior + team explícito
36
+ /auditar-toil --output .planning/audit/toil-2026-Q2.md # path customizado
37
+ ```
38
+
39
+ **Pré-requisito:** repositório git inicializado (sem isso, agent skip git log analysis e usa apenas scripts/runbooks).
40
+ </context>
41
+
42
+ <process>
43
+
44
+ ## 1. Parsear argumentos
45
+
46
+ ```bash
47
+ TIME_WINDOW=$(echo "$ARGUMENTS" | grep -oE -- '--time-window [^ ]+' | awk '{print $2}')
48
+ TEAM_SIZE=$(echo "$ARGUMENTS" | grep -oE -- '--team-size [^ ]+' | awk '{print $2}')
49
+ OUTPUT_PATH=$(echo "$ARGUMENTS" | grep -oE -- '--output [^ ]+' | awk '{print $2}')
50
+ RUNBOOKS=$(echo "$ARGUMENTS" | grep -oE -- '--runbooks-paths [^ ]+' | awk '{print $2}')
51
+
52
+ [ -z "$TIME_WINDOW" ] && TIME_WINDOW="3m"
53
+ [ -z "$OUTPUT_PATH" ] && OUTPUT_PATH=".planning/TOIL-AUDIT.md"
54
+
55
+ # PT-BR: criar destination dir
56
+ mkdir -p "$(dirname "$OUTPUT_PATH")"
57
+ ```
58
+
59
+ ## 2. Validar pré-requisitos
60
+
61
+ ```bash
62
+ # PT-BR: detectar git repo (não-bloqueante — agent funciona sem git, só com scripts/runbooks)
63
+ GIT_OK=true
64
+ git rev-parse --git-dir >/dev/null 2>&1 || GIT_OK=false
65
+
66
+ if [ "$GIT_OK" = false ]; then
67
+ echo "⚠ Nenhum repositório git detectado — agent vai pular git log analysis."
68
+ echo " (toil-auditor continuará com scripts/runbooks apenas)"
69
+ fi
70
+
71
+ # PT-BR: verificar se TOIL-AUDIT.md anterior existe (idempotência)
72
+ if [ -f "$OUTPUT_PATH" ]; then
73
+ LAST_DATE=$(grep -m1 '**Audit date:**' "$OUTPUT_PATH" 2>/dev/null | sed 's/.*Audit date:\*\* //' || echo "?")
74
+ echo "ℹ TOIL-AUDIT.md anterior detectado (Audit date: $LAST_DATE)."
75
+ echo " Novo audit vai sobrescrever — agent compara com anterior se preservou histórico."
76
+ fi
77
+ ```
78
+
79
+ ## 3. Dispatch para `toil-auditor`
80
+
81
+ ```text
82
+ Task(
83
+ subagent_type="toil-auditor",
84
+ prompt="
85
+ project_root: .
86
+ output_path: ${OUTPUT_PATH}
87
+ time_window: ${TIME_WINDOW}
88
+ ${TEAM_SIZE:+team_size: ${TEAM_SIZE}}
89
+ ${RUNBOOKS:+runbooks_paths: ${RUNBOOKS}}
90
+
91
+ Aplicar skill eliminating-toil. Etapas:
92
+ 1. Scan: git log normalizado (commits repetitivos), scripts shell em paths canônicos, runbooks (manual ops descritas), README/CONTRIBUTING (manual setup).
93
+ 2. Aplicar 6 critérios canônicos (manual, repetitivo, automatizável, tático, sem valor durável, escala linear) em cada candidato.
94
+ 3. Distinguir toil vs overhead (reuniões/RH — não-elimináveis) vs grungy work (refactor — projeto engineering).
95
+ 4. Priorizar P0/P1/P2 por (frequency × pain) / automation_effort.
96
+ 5. Estimar esforço de automação por candidato (hours/days) + estágio L0-L4 do automation continuum.
97
+ 6. Computar % do tempo do time gasto em toil (regra ≤ 50%).
98
+
99
+ Output: ${OUTPUT_PATH} com tabela priorizada + sumário executivo + recomendações.
100
+ "
101
+ )
102
+ ```
103
+
104
+ ## 4. Pós-output + integração OMM
105
+
106
+ ```
107
+ ═══════════════════════════════════════════════════════════
108
+ framework ► AUDITAR-TOIL ▸ ${OUTPUT_PATH}
109
+ ═══════════════════════════════════════════════════════════
110
+
111
+ [output do toil-auditor — ver Step 5 do agent]
112
+
113
+ ## Próximos passos
114
+ 1. Revisar P0 (alto impacto, baixo esforço) — alvos imediatos para automação
115
+ 2. Se `workflow.audit_milestone_toil=true`, este audit alimenta `/auditar-marco` (Phase 40 INT-FW-V2-03)
116
+ 3. Cross-ref OMM (v1.9 — Capacidade 3 Tech Debt): `/observabilidade omm` consome este audit
117
+ 4. Re-audit recomendado a cada milestone (toil cresce silencioso)
118
+ ```
119
+
120
+ </process>
121
+
122
+ <success_criteria>
123
+ - [ ] $ARGUMENTS parseados (4 flags opcionais com defaults sensatos)
124
+ - [ ] Pré-requisitos validados de forma não-bloqueante (git ausente OK; falta runbooks OK)
125
+ - [ ] `toil-auditor` invocado via `Task(subagent_type=...)` com prompt completo (6 etapas)
126
+ - [ ] `.planning/TOIL-AUDIT.md` (ou `--output` custom) criado pelo agent
127
+ - [ ] Output forwarded transparentemente do agent (sem post-processing)
128
+ - [ ] Próximos passos sugerem cross-ref para `/auditar-marco`, `/observabilidade omm`
129
+ </success_criteria>