@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,102 +1,102 @@
1
- ---
2
- id: multi-tenant-rls-coverage
3
- stage: pre-verify
4
- blocking: true
5
- description: Detecta CREATE TABLE em supabase/migrations/ sem ENABLE ROW LEVEL SECURITY no mesmo arquivo. Cross-tenant data leak silencioso é a falha #1 de apps multi-tenant Supabase. Skip se projeto não tem supabase/migrations/.
6
- ---
7
-
8
- # Multi-Tenant RLS Coverage gate
9
-
10
- **When to run:** pre-verify (blocking — multi-tenant phase não verifica até cobertura completa).
11
-
12
- ## Check
13
-
14
- ```bash
15
- #!/usr/bin/env bash
16
- # PT-BR: detecta CREATE TABLE em supabase/migrations/ sem ENABLE ROW LEVEL SECURITY no mesmo arquivo.
17
- # Anti-pitfall #1 multi-tenant: tabela nova sem RLS = cross-tenant leak silencioso (Postgres não aplica policies automaticamente).
18
- # Bash 3.2-portable (macOS default).
19
- set -e
20
-
21
- MIGRATIONS_DIR="supabase/migrations"
22
-
23
- # PT-BR: skip gracioso se projeto não tem migrations Supabase
24
- if [ ! -d "$MIGRATIONS_DIR" ]; then
25
- echo "INFO: $MIGRATIONS_DIR não existe — projeto não usa Supabase migrations. Gate skipped."
26
- exit 0
27
- fi
28
-
29
- # PT-BR: tabelas em schemas system não exigem RLS (auth, storage, realtime, vault, supabase_*)
30
- SYSTEM_SCHEMA_PREFIXES="auth\\.|storage\\.|realtime\\.|vault\\.|supabase_|extensions\\."
31
-
32
- # PT-BR: allowlist de tabelas que conscientemente não têm RLS (ex: lookup tables públicas)
33
- ALLOWLIST_TABLES=(
34
- "public.permissions" # catálogo global de permissions, leitura pública por design
35
- )
36
-
37
- is_allowlisted() {
38
- local table="$1"
39
- for at in "${ALLOWLIST_TABLES[@]}"; do
40
- [ "$table" = "$at" ] && return 0
41
- done
42
- return 1
43
- }
44
-
45
- VIOLATIONS=0
46
- VIOLATIONS_DETAIL=""
47
-
48
- # PT-BR: iterar migrations em ordem cronológica
49
- MIGRATION_FILES=$(ls "$MIGRATIONS_DIR"/*.sql 2>/dev/null | sort)
50
-
51
- if [ -z "$MIGRATION_FILES" ]; then
52
- echo "INFO: nenhum arquivo .sql em $MIGRATIONS_DIR — gate skipped."
53
- exit 0
54
- fi
55
-
56
- for f in $MIGRATION_FILES; do
57
- # PT-BR: extrair tabelas criadas via CREATE TABLE (case-insensitive, ignora IF NOT EXISTS)
58
- CREATED_TABLES=$(grep -iE "^create\s+table\s+(if\s+not\s+exists\s+)?[a-z_]+\." "$f" 2>/dev/null \
59
- | sed -E 's/.*create\s+table\s+(if\s+not\s+exists\s+)?([a-z_]+\.[a-z_]+).*/\2/i' \
60
- | grep -viE "$SYSTEM_SCHEMA_PREFIXES" || true)
61
-
62
- # PT-BR: extrair tabelas com RLS habilitada no MESMO arquivo
63
- RLS_TABLES=$(grep -iE "alter\s+table\s+[a-z_]+\.[a-z_]+\s+enable\s+row\s+level\s+security" "$f" 2>/dev/null \
64
- | sed -E 's/.*alter\s+table\s+([a-z_]+\.[a-z_]+)\s+enable.*/\1/i' || true)
65
-
66
- # PT-BR: para cada tabela criada, checar se RLS foi habilitada
67
- for table in $CREATED_TABLES; do
68
- [ -z "$table" ] && continue
69
- is_allowlisted "$table" && continue
70
-
71
- if ! echo "$RLS_TABLES" | grep -qFx "$table"; then
72
- VIOLATIONS=$((VIOLATIONS + 1))
73
- VIOLATIONS_DETAIL="${VIOLATIONS_DETAIL}
74
- $(basename "$f"): tabela '$table' criada sem ENABLE ROW LEVEL SECURITY"
75
- fi
76
- done
77
- done
78
-
79
- if [ "$VIOLATIONS" -eq 0 ]; then
80
- echo "PASS: todas as tabelas em supabase/migrations/ têm RLS habilitada no mesmo arquivo de criação."
81
- exit 0
82
- else
83
- echo "FAIL: $VIOLATIONS tabela(s) criada(s) sem ENABLE ROW LEVEL SECURITY:$VIOLATIONS_DETAIL"
84
- echo ""
85
- echo "Fix: adicione 'alter table <schema>.<table> enable row level security;' no MESMO arquivo de migration que criou a tabela."
86
- echo "Ref: kit/skills/multi-tenant-rls-hierarchy/SKILL.md (REGRA #1)"
87
- exit 1
88
- fi
89
- ```
90
-
91
- ## Verdict
92
-
93
- - **passed** — todas tabelas multi-tenant têm RLS habilitada → continuar
94
- - **block** — apresentar tabela de violations + sugestão de fix; sem opção de skip (anti-pitfall P0 — cross-tenant leak)
95
-
96
- ## Notes
97
-
98
- Este gate só checa **habilitação** de RLS — não checa se as policies cobrem todos os casos. Ver `multi-tenant-isolation-auditor` agent para análise completa de policies (requer MCP Supabase ativo para query a `pg_policies`).
99
-
100
- Tabelas em schemas system (`auth.*`, `storage.*`, `realtime.*`, `vault.*`, `supabase_*`, `extensions.*`) são automaticamente skipped — Supabase já aplica RLS interno nelas.
101
-
102
- Allowlist mínima: `public.permissions` (catálogo global de permissions, leitura pública por design — tem `to authenticated` em SELECT mas sem isolamento por tenant).
1
+ ---
2
+ id: multi-tenant-rls-coverage
3
+ stage: pre-verify
4
+ blocking: true
5
+ description: Detecta CREATE TABLE em supabase/migrations/ sem ENABLE ROW LEVEL SECURITY no mesmo arquivo. Cross-tenant data leak silencioso é a falha #1 de apps multi-tenant Supabase. Skip se projeto não tem supabase/migrations/.
6
+ ---
7
+
8
+ # Multi-Tenant RLS Coverage gate
9
+
10
+ **When to run:** pre-verify (blocking — multi-tenant phase não verifica até cobertura completa).
11
+
12
+ ## Check
13
+
14
+ ```bash
15
+ #!/usr/bin/env bash
16
+ # PT-BR: detecta CREATE TABLE em supabase/migrations/ sem ENABLE ROW LEVEL SECURITY no mesmo arquivo.
17
+ # Anti-pitfall #1 multi-tenant: tabela nova sem RLS = cross-tenant leak silencioso (Postgres não aplica policies automaticamente).
18
+ # Bash 3.2-portable (macOS default).
19
+ set -e
20
+
21
+ MIGRATIONS_DIR="supabase/migrations"
22
+
23
+ # PT-BR: skip gracioso se projeto não tem migrations Supabase
24
+ if [ ! -d "$MIGRATIONS_DIR" ]; then
25
+ echo "INFO: $MIGRATIONS_DIR não existe — projeto não usa Supabase migrations. Gate skipped."
26
+ exit 0
27
+ fi
28
+
29
+ # PT-BR: tabelas em schemas system não exigem RLS (auth, storage, realtime, vault, supabase_*)
30
+ SYSTEM_SCHEMA_PREFIXES="auth\\.|storage\\.|realtime\\.|vault\\.|supabase_|extensions\\."
31
+
32
+ # PT-BR: allowlist de tabelas que conscientemente não têm RLS (ex: lookup tables públicas)
33
+ ALLOWLIST_TABLES=(
34
+ "public.permissions" # catálogo global de permissions, leitura pública por design
35
+ )
36
+
37
+ is_allowlisted() {
38
+ local table="$1"
39
+ for at in "${ALLOWLIST_TABLES[@]}"; do
40
+ [ "$table" = "$at" ] && return 0
41
+ done
42
+ return 1
43
+ }
44
+
45
+ VIOLATIONS=0
46
+ VIOLATIONS_DETAIL=""
47
+
48
+ # PT-BR: iterar migrations em ordem cronológica
49
+ MIGRATION_FILES=$(ls "$MIGRATIONS_DIR"/*.sql 2>/dev/null | sort)
50
+
51
+ if [ -z "$MIGRATION_FILES" ]; then
52
+ echo "INFO: nenhum arquivo .sql em $MIGRATIONS_DIR — gate skipped."
53
+ exit 0
54
+ fi
55
+
56
+ for f in $MIGRATION_FILES; do
57
+ # PT-BR: extrair tabelas criadas via CREATE TABLE (case-insensitive, ignora IF NOT EXISTS)
58
+ CREATED_TABLES=$(grep -iE "^create\s+table\s+(if\s+not\s+exists\s+)?[a-z_]+\." "$f" 2>/dev/null \
59
+ | sed -E 's/.*create\s+table\s+(if\s+not\s+exists\s+)?([a-z_]+\.[a-z_]+).*/\2/i' \
60
+ | grep -viE "$SYSTEM_SCHEMA_PREFIXES" || true)
61
+
62
+ # PT-BR: extrair tabelas com RLS habilitada no MESMO arquivo
63
+ RLS_TABLES=$(grep -iE "alter\s+table\s+[a-z_]+\.[a-z_]+\s+enable\s+row\s+level\s+security" "$f" 2>/dev/null \
64
+ | sed -E 's/.*alter\s+table\s+([a-z_]+\.[a-z_]+)\s+enable.*/\1/i' || true)
65
+
66
+ # PT-BR: para cada tabela criada, checar se RLS foi habilitada
67
+ for table in $CREATED_TABLES; do
68
+ [ -z "$table" ] && continue
69
+ is_allowlisted "$table" && continue
70
+
71
+ if ! echo "$RLS_TABLES" | grep -qFx "$table"; then
72
+ VIOLATIONS=$((VIOLATIONS + 1))
73
+ VIOLATIONS_DETAIL="${VIOLATIONS_DETAIL}
74
+ $(basename "$f"): tabela '$table' criada sem ENABLE ROW LEVEL SECURITY"
75
+ fi
76
+ done
77
+ done
78
+
79
+ if [ "$VIOLATIONS" -eq 0 ]; then
80
+ echo "PASS: todas as tabelas em supabase/migrations/ têm RLS habilitada no mesmo arquivo de criação."
81
+ exit 0
82
+ else
83
+ echo "FAIL: $VIOLATIONS tabela(s) criada(s) sem ENABLE ROW LEVEL SECURITY:$VIOLATIONS_DETAIL"
84
+ echo ""
85
+ echo "Fix: adicione 'alter table <schema>.<table> enable row level security;' no MESMO arquivo de migration que criou a tabela."
86
+ echo "Ref: kit/skills/multi-tenant-rls-hierarchy/SKILL.md (REGRA #1)"
87
+ exit 1
88
+ fi
89
+ ```
90
+
91
+ ## Verdict
92
+
93
+ - **passed** — todas tabelas multi-tenant têm RLS habilitada → continuar
94
+ - **block** — apresentar tabela de violations + sugestão de fix; sem opção de skip (anti-pitfall P0 — cross-tenant leak)
95
+
96
+ ## Notes
97
+
98
+ Este gate só checa **habilitação** de RLS — não checa se as policies cobrem todos os casos. Ver `multi-tenant-isolation-auditor` agent para análise completa de policies (requer MCP Supabase ativo para query a `pg_policies`).
99
+
100
+ Tabelas em schemas system (`auth.*`, `storage.*`, `realtime.*`, `vault.*`, `supabase_*`, `extensions.*`) são automaticamente skipped — Supabase já aplica RLS interno nelas.
101
+
102
+ Allowlist mínima: `public.permissions` (catálogo global de permissions, leitura pública por design — tem `to authenticated` em SELECT mas sem isolamento por tenant).
@@ -1,72 +1,72 @@
1
- ---
2
- id: no-personal-uuid
3
- stage: pre-verify
4
- blocking: true
5
- description: Detecta UUIDs no formato [0-9a-f]{8}-[0-9a-f]{4}-... em frontmatter `tools:` ou body de skills/agents/commands. UUID pessoal quebra para outros instaladores (anti-pitfall A12).
6
- ---
7
-
8
- # No personal UUID gate
9
-
10
- **When to run:** pre-verify.
11
-
12
- ## Check
13
-
14
- ```bash
15
- #!/usr/bin/env bash
16
- # PT-BR: detecta UUID em formato [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
17
- # em frontmatter tools: ou body de kit/{agents,commands,skills}/
18
- set -e
19
-
20
- # allowlist: glossário menciona patterns mas não usa UUID em tools
21
- ALLOWLIST_FILES=(
22
- "kit/skills/_shared-supabase/glossary.md"
23
- )
24
-
25
- VIOLATIONS=0
26
-
27
- is_allowlisted() {
28
- local file="$1"
29
- for af in "${ALLOWLIST_FILES[@]}"; do
30
- [ "$file" = "$af" ] && return 0
31
- done
32
- return 1
33
- }
34
-
35
- check_uuid() {
36
- local file="$1"
37
- is_allowlisted "$file" && return 0
38
-
39
- # PT-BR: extrair frontmatter (entre --- ... ---)
40
- local frontmatter
41
- frontmatter=$(awk '/^---$/{i++; next} i==1' "$file" 2>/dev/null || true)
42
-
43
- # PT-BR: buscar UUID em frontmatter (linhas com tools: ou abaixo)
44
- if echo "$frontmatter" | grep -qE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'; then
45
- echo "FAIL (frontmatter): $file"
46
- grep -nE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' "$file" | head -3
47
- VIOLATIONS=$((VIOLATIONS + 1))
48
- fi
49
- }
50
-
51
- for f in kit/agents/*.md; do [ -f "$f" ] && check_uuid "$f"; done
52
- for f in kit/commands/*.md; do [ -f "$f" ] && check_uuid "$f"; done
53
- for f in kit/skills/*/SKILL.md; do [ -f "$f" ] && check_uuid "$f"; done
54
-
55
- if [ "$VIOLATIONS" -gt 0 ]; then
56
- echo "Total violations: $VIOLATIONS"
57
- echo "UUIDs pessoais quebram para outros instaladores. Use mcp__supabase__* canônico."
58
- exit 1
59
- fi
60
-
61
- echo "✓ Zero UUIDs pessoais em kit/{agents,commands,skills}/"
62
- exit 0
63
- ```
64
-
65
- ## Verdict
66
-
67
- - **passed** — zero UUIDs em frontmatter ou body
68
- - **block** — pelo menos um UUID pessoal detectado (quebra para outros users)
69
-
70
- ## Notes
71
-
72
- Anti-pitfall A12 da v1.8: `schema-checker.md` originalmente usava `mcp__0a712001-6cbb-44ef-a5f4-a24ea40894fa__execute_sql` (UUID do projeto pessoal do user). Distribuído via `@luanpdd/kit-mcp`, isso quebra para qualquer outro instalador. Phase 28 migra para `mcp__supabase__*` canônico. Este gate previne regressão.
1
+ ---
2
+ id: no-personal-uuid
3
+ stage: pre-verify
4
+ blocking: true
5
+ description: Detecta UUIDs no formato [0-9a-f]{8}-[0-9a-f]{4}-... em frontmatter `tools:` ou body de skills/agents/commands. UUID pessoal quebra para outros instaladores (anti-pitfall A12).
6
+ ---
7
+
8
+ # No personal UUID gate
9
+
10
+ **When to run:** pre-verify.
11
+
12
+ ## Check
13
+
14
+ ```bash
15
+ #!/usr/bin/env bash
16
+ # PT-BR: detecta UUID em formato [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
17
+ # em frontmatter tools: ou body de kit/{agents,commands,skills}/
18
+ set -e
19
+
20
+ # allowlist: glossário menciona patterns mas não usa UUID em tools
21
+ ALLOWLIST_FILES=(
22
+ "kit/skills/_shared-supabase/glossary.md"
23
+ )
24
+
25
+ VIOLATIONS=0
26
+
27
+ is_allowlisted() {
28
+ local file="$1"
29
+ for af in "${ALLOWLIST_FILES[@]}"; do
30
+ [ "$file" = "$af" ] && return 0
31
+ done
32
+ return 1
33
+ }
34
+
35
+ check_uuid() {
36
+ local file="$1"
37
+ is_allowlisted "$file" && return 0
38
+
39
+ # PT-BR: extrair frontmatter (entre --- ... ---)
40
+ local frontmatter
41
+ frontmatter=$(awk '/^---$/{i++; next} i==1' "$file" 2>/dev/null || true)
42
+
43
+ # PT-BR: buscar UUID em frontmatter (linhas com tools: ou abaixo)
44
+ if echo "$frontmatter" | grep -qE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'; then
45
+ echo "FAIL (frontmatter): $file"
46
+ grep -nE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' "$file" | head -3
47
+ VIOLATIONS=$((VIOLATIONS + 1))
48
+ fi
49
+ }
50
+
51
+ for f in kit/agents/*.md; do [ -f "$f" ] && check_uuid "$f"; done
52
+ for f in kit/commands/*.md; do [ -f "$f" ] && check_uuid "$f"; done
53
+ for f in kit/skills/*/SKILL.md; do [ -f "$f" ] && check_uuid "$f"; done
54
+
55
+ if [ "$VIOLATIONS" -gt 0 ]; then
56
+ echo "Total violations: $VIOLATIONS"
57
+ echo "UUIDs pessoais quebram para outros instaladores. Use mcp__supabase__* canônico."
58
+ exit 1
59
+ fi
60
+
61
+ echo "✓ Zero UUIDs pessoais em kit/{agents,commands,skills}/"
62
+ exit 0
63
+ ```
64
+
65
+ ## Verdict
66
+
67
+ - **passed** — zero UUIDs em frontmatter ou body
68
+ - **block** — pelo menos um UUID pessoal detectado (quebra para outros users)
69
+
70
+ ## Notes
71
+
72
+ Anti-pitfall A12 da v1.8: `schema-checker.md` originalmente usava `mcp__0a712001-6cbb-44ef-a5f4-a24ea40894fa__execute_sql` (UUID do projeto pessoal do user). Distribuído via `@luanpdd/kit-mcp`, isso quebra para qualquer outro instalador. Phase 28 migra para `mcp__supabase__*` canônico. Este gate previne regressão.
@@ -1,86 +1,86 @@
1
- ---
2
- id: obs-agents-mcp-supabase
3
- stage: pre-verify
4
- blocking: true
5
- description: Valida que agents observability que precisam de MCP Supabase declaram tools mcp__supabase__* no frontmatter (incident-investigator, slo-engineer, burn-rate-forecaster, omm-auditor).
6
- ---
7
-
8
- # Observability agents MCP Supabase declaration gate
9
-
10
- **When to run:** pre-verify.
11
-
12
- ## Check
13
-
14
- ```bash
15
- #!/usr/bin/env bash
16
- # PT-BR: agents que usam MCP Supabase devem declarar tools mcp__supabase__* no frontmatter.
17
- # Anti-pitfall: declaração ausente faz Claude Code não autorizar tool, agent falha em runtime.
18
- set -e
19
-
20
- VIOLATIONS=0
21
-
22
- # PT-BR: agents que DEVEM declarar mcp__supabase__*
23
- declare_required() {
24
- local agent="$1"
25
- local required_tools="$2" # tools separados por |
26
- local file="kit/agents/$agent.md"
27
-
28
- if [ ! -f "$file" ]; then
29
- echo "FAIL: $file — agent ausente"
30
- VIOLATIONS=$((VIOLATIONS + 1))
31
- return
32
- fi
33
-
34
- # PT-BR: extrair frontmatter tools field (multi-line possível)
35
- local in_frontmatter=0
36
- local in_tools=0
37
- local tools_block=""
38
- while IFS= read -r line; do
39
- if [ "$line" = "---" ]; then
40
- if [ "$in_frontmatter" -eq 0 ]; then
41
- in_frontmatter=1
42
- else
43
- break
44
- fi
45
- elif [ "$in_frontmatter" -eq 1 ]; then
46
- tools_block="$tools_block $line"
47
- fi
48
- done < "$file"
49
-
50
- local IFS='|'
51
- for tool in $required_tools; do
52
- if ! echo "$tools_block" | grep -qF "$tool"; then
53
- echo "FAIL: $file — não declara '$tool' em frontmatter tools"
54
- VIOLATIONS=$((VIOLATIONS + 1))
55
- fi
56
- done
57
- }
58
-
59
- # PT-BR: incident-investigator usa get_logs/execute_sql/get_advisors
60
- declare_required "incident-investigator" "mcp__supabase__get_logs|mcp__supabase__execute_sql|mcp__supabase__get_advisors"
61
-
62
- # PT-BR: slo-engineer usa execute_sql + apply_migration
63
- declare_required "slo-engineer" "mcp__supabase__execute_sql|mcp__supabase__apply_migration"
64
-
65
- # PT-BR: burn-rate-forecaster usa execute_sql
66
- declare_required "burn-rate-forecaster" "mcp__supabase__execute_sql"
67
-
68
- # PT-BR: omm-auditor usa execute_sql (queries SLI)
69
- declare_required "omm-auditor" "mcp__supabase__execute_sql"
70
-
71
- if [ "$VIOLATIONS" -eq 0 ]; then
72
- echo "PASS: 4 agents observability declaram mcp__supabase__* corretamente"
73
- exit 0
74
- else
75
- echo "FAIL: $VIOLATIONS violação(ões)"
76
- exit 1
77
- fi
78
- ```
79
-
80
- ## Why
81
-
82
- Agents observability que aplicam Core Analysis Loop ou queries SLI dependem de `mcp__supabase__*`. Sem declaração no frontmatter `tools`, Claude Code não autoriza o tool em runtime e o agent falha (precedente: anti-pitfall identificado em v1.8 com supabase-* agents).
83
-
84
- ## REQ
85
-
86
- QA-02.
1
+ ---
2
+ id: obs-agents-mcp-supabase
3
+ stage: pre-verify
4
+ blocking: true
5
+ description: Valida que agents observability que precisam de MCP Supabase declaram tools mcp__supabase__* no frontmatter (incident-investigator, slo-engineer, burn-rate-forecaster, omm-auditor).
6
+ ---
7
+
8
+ # Observability agents MCP Supabase declaration gate
9
+
10
+ **When to run:** pre-verify.
11
+
12
+ ## Check
13
+
14
+ ```bash
15
+ #!/usr/bin/env bash
16
+ # PT-BR: agents que usam MCP Supabase devem declarar tools mcp__supabase__* no frontmatter.
17
+ # Anti-pitfall: declaração ausente faz Claude Code não autorizar tool, agent falha em runtime.
18
+ set -e
19
+
20
+ VIOLATIONS=0
21
+
22
+ # PT-BR: agents que DEVEM declarar mcp__supabase__*
23
+ declare_required() {
24
+ local agent="$1"
25
+ local required_tools="$2" # tools separados por |
26
+ local file="kit/agents/$agent.md"
27
+
28
+ if [ ! -f "$file" ]; then
29
+ echo "FAIL: $file — agent ausente"
30
+ VIOLATIONS=$((VIOLATIONS + 1))
31
+ return
32
+ fi
33
+
34
+ # PT-BR: extrair frontmatter tools field (multi-line possível)
35
+ local in_frontmatter=0
36
+ local in_tools=0
37
+ local tools_block=""
38
+ while IFS= read -r line; do
39
+ if [ "$line" = "---" ]; then
40
+ if [ "$in_frontmatter" -eq 0 ]; then
41
+ in_frontmatter=1
42
+ else
43
+ break
44
+ fi
45
+ elif [ "$in_frontmatter" -eq 1 ]; then
46
+ tools_block="$tools_block $line"
47
+ fi
48
+ done < "$file"
49
+
50
+ local IFS='|'
51
+ for tool in $required_tools; do
52
+ if ! echo "$tools_block" | grep -qF "$tool"; then
53
+ echo "FAIL: $file — não declara '$tool' em frontmatter tools"
54
+ VIOLATIONS=$((VIOLATIONS + 1))
55
+ fi
56
+ done
57
+ }
58
+
59
+ # PT-BR: incident-investigator usa get_logs/execute_sql/get_advisors
60
+ declare_required "incident-investigator" "mcp__supabase__get_logs|mcp__supabase__execute_sql|mcp__supabase__get_advisors"
61
+
62
+ # PT-BR: slo-engineer usa execute_sql + apply_migration
63
+ declare_required "slo-engineer" "mcp__supabase__execute_sql|mcp__supabase__apply_migration"
64
+
65
+ # PT-BR: burn-rate-forecaster usa execute_sql
66
+ declare_required "burn-rate-forecaster" "mcp__supabase__execute_sql"
67
+
68
+ # PT-BR: omm-auditor usa execute_sql (queries SLI)
69
+ declare_required "omm-auditor" "mcp__supabase__execute_sql"
70
+
71
+ if [ "$VIOLATIONS" -eq 0 ]; then
72
+ echo "PASS: 4 agents observability declaram mcp__supabase__* corretamente"
73
+ exit 0
74
+ else
75
+ echo "FAIL: $VIOLATIONS violação(ões)"
76
+ exit 1
77
+ fi
78
+ ```
79
+
80
+ ## Why
81
+
82
+ Agents observability que aplicam Core Analysis Loop ou queries SLI dependem de `mcp__supabase__*`. Sem declaração no frontmatter `tools`, Claude Code não autoriza o tool em runtime e o agent falha (precedente: anti-pitfall identificado em v1.8 com supabase-* agents).
83
+
84
+ ## REQ
85
+
86
+ QA-02.