@luanpdd/kit-mcp 1.27.0 → 1.29.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 (324) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +168 -914
  3. package/gates/agent-no-recursive-dispatch.md +45 -11
  4. package/kit/COMANDOS.md +138 -138
  5. package/kit/README.md +76 -76
  6. package/kit/agents/advisor-researcher.md +106 -106
  7. package/kit/agents/assumptions-analyzer.md +107 -107
  8. package/kit/agents/audit-log-implementer.md +1 -1
  9. package/kit/agents/auditor-consistencia-isolamento.md +1 -1
  10. package/kit/agents/b2b-saas-architect.md +1 -1
  11. package/kit/agents/cascading-failures-auditor.md +1 -1
  12. package/kit/agents/codebase-mapper.md +768 -768
  13. package/kit/agents/crm-pipeline-implementer.md +1 -1
  14. package/kit/agents/debugger.md +813 -813
  15. package/kit/agents/detector-tenant-quente.md +1 -1
  16. package/kit/agents/evolution-go-integrator.md +1 -1
  17. package/kit/agents/example-reviewer.md +21 -21
  18. package/kit/agents/executor.md +564 -564
  19. package/kit/agents/integration-checker.md +200 -200
  20. package/kit/agents/invite-flow-implementer.md +1 -1
  21. package/kit/agents/legacy-characterizer.md +1 -1
  22. package/kit/agents/lgpd-compliance-auditor.md +1 -1
  23. package/kit/agents/multi-tenant-isolation-auditor.md +1 -1
  24. package/kit/agents/multi-tenant-rls-writer.md +1 -1
  25. package/kit/agents/nyquist-auditor.md +178 -178
  26. package/kit/agents/observability-coverage-auditor.md +1 -1
  27. package/kit/agents/org-onboarding-implementer.md +1 -1
  28. package/kit/agents/payload-capture-instrumenter.md +1 -1
  29. package/kit/agents/phase-researcher.md +696 -696
  30. package/kit/agents/plan-checker.md +272 -272
  31. package/kit/agents/planner.md +922 -922
  32. package/kit/agents/project-researcher.md +652 -652
  33. package/kit/agents/refactor-safety-auditor.md +1 -1
  34. package/kit/agents/research-synthesizer.md +245 -245
  35. package/kit/agents/roadmapper.md +677 -677
  36. package/kit/agents/seam-finder.md +1 -1
  37. package/kit/agents/shotgun-surgery-detector.md +1 -1
  38. package/kit/agents/supabase-branching-architect.md +1 -1
  39. package/kit/agents/supabase-cicd-pipeline-implementer.md +1 -1
  40. package/kit/agents/supabase-column-privileges-writer.md +1 -1
  41. package/kit/agents/supabase-migration-writer.md +1 -1
  42. package/kit/agents/supabase-rbac-implementer.md +1 -1
  43. package/kit/agents/supabase-rls-hardener.md +1 -1
  44. package/kit/agents/supabase-rls-writer.md +1 -1
  45. package/kit/agents/supabase-roles-implementer.md +1 -1
  46. package/kit/agents/super-admin-implementer.md +1 -1
  47. package/kit/agents/ui-auditor.md +437 -437
  48. package/kit/agents/ui-checker.md +302 -302
  49. package/kit/agents/ui-researcher.md +355 -355
  50. package/kit/agents/user-profiler.md +175 -175
  51. package/kit/agents/validador-evolucao-schema.md +1 -1
  52. package/kit/agents/verifier.md +728 -728
  53. package/kit/commands/adicionar-backlog.md +75 -75
  54. package/kit/commands/adicionar-fase.md +42 -42
  55. package/kit/commands/adicionar-tarefa.md +45 -45
  56. package/kit/commands/adicionar-testes.md +41 -41
  57. package/kit/commands/ajuda.md +21 -21
  58. package/kit/commands/atualizar.md +37 -37
  59. package/kit/commands/auditar-cascading.md +1 -1
  60. package/kit/commands/auditar-marco.md +179 -179
  61. package/kit/commands/auditar-observabilidade-cobertura.md +1 -1
  62. package/kit/commands/auditar-refactor.md +1 -1
  63. package/kit/commands/auditar-release.md +1 -1
  64. package/kit/commands/auditar-uat.md +23 -23
  65. package/kit/commands/autonomo.md +40 -40
  66. package/kit/commands/branch-pr.md +24 -24
  67. package/kit/commands/burn-rate-status.md +1 -1
  68. package/kit/commands/capturar-payloads.md +1 -1
  69. package/kit/commands/caracterizar.md +1 -1
  70. package/kit/commands/concluir-marco.md +247 -247
  71. package/kit/commands/configuracoes.md +36 -36
  72. package/kit/commands/dados-distribuidos.md +1 -1
  73. package/kit/commands/definir-perfil.md +10 -10
  74. package/kit/commands/depurar.md +190 -190
  75. package/kit/commands/detectar-duplicacao.md +1 -1
  76. package/kit/commands/discutir-fase.md +131 -131
  77. package/kit/commands/encontrar-seams.md +1 -1
  78. package/kit/commands/entrar-discord.md +17 -17
  79. package/kit/commands/estatisticas.md +18 -18
  80. package/kit/commands/example-greeting.md +33 -33
  81. package/kit/commands/executar-fase.md +58 -58
  82. package/kit/commands/expresso.md +56 -56
  83. package/kit/commands/fase-ui.md +34 -34
  84. package/kit/commands/fazer.md +57 -57
  85. package/kit/commands/fio.md +125 -125
  86. package/kit/commands/fluxos-trabalho.md +64 -64
  87. package/kit/commands/forense.md +176 -176
  88. package/kit/commands/gerenciador.md +38 -38
  89. package/kit/commands/inserir-fase.md +31 -31
  90. package/kit/commands/legacy.md +1 -1
  91. package/kit/commands/limpeza.md +17 -17
  92. package/kit/commands/listar-hipoteses-fase.md +45 -45
  93. package/kit/commands/listar-workspaces.md +18 -18
  94. package/kit/commands/load-shedding.md +1 -1
  95. package/kit/commands/mapear-codebase.md +70 -70
  96. package/kit/commands/multi-tenant.md +1 -1
  97. package/kit/commands/nota.md +33 -33
  98. package/kit/commands/novo-marco.md +43 -43
  99. package/kit/commands/novo-projeto.md +41 -41
  100. package/kit/commands/novo-workspace.md +43 -43
  101. package/kit/commands/pausar-trabalho.md +37 -37
  102. package/kit/commands/perfil-usuario.md +45 -45
  103. package/kit/commands/pesquisar-fase.md +195 -195
  104. package/kit/commands/planejar-fase.md +67 -67
  105. package/kit/commands/planejar-lacunas.md +33 -33
  106. package/kit/commands/plantar-ideia.md +25 -25
  107. package/kit/commands/progresso.md +24 -24
  108. package/kit/commands/proximo.md +30 -30
  109. package/kit/commands/publicar.md +490 -490
  110. package/kit/commands/rapido.md +35 -35
  111. package/kit/commands/reaplicar-patches.md +124 -124
  112. package/kit/commands/refactor-seguro.md +1 -1
  113. package/kit/commands/relatorio-sessao.md +19 -19
  114. package/kit/commands/remover-fase.md +31 -31
  115. package/kit/commands/remover-workspace.md +26 -26
  116. package/kit/commands/resumo-marco.md +50 -50
  117. package/kit/commands/retomar-trabalho.md +40 -40
  118. package/kit/commands/revisar-backlog.md +60 -60
  119. package/kit/commands/revisar-ui.md +32 -32
  120. package/kit/commands/revisar.md +37 -37
  121. package/kit/commands/saude.md +21 -21
  122. package/kit/commands/setup-notion.md +93 -93
  123. package/kit/commands/storytelling.md +1 -1
  124. package/kit/commands/supabase.md +1 -1
  125. package/kit/commands/sync-main.md +68 -68
  126. package/kit/commands/validar-fase.md +35 -35
  127. package/kit/commands/verificar-tarefas.md +44 -44
  128. package/kit/commands/verificar-trabalho.md +64 -64
  129. package/kit/file-manifest.json +90 -90
  130. package/kit/framework/bin/lib/commands.cjs +959 -959
  131. package/kit/framework/bin/lib/config.cjs +442 -442
  132. package/kit/framework/bin/lib/core.cjs +1230 -1230
  133. package/kit/framework/bin/lib/frontmatter.cjs +336 -336
  134. package/kit/framework/bin/lib/init.cjs +1442 -1442
  135. package/kit/framework/bin/lib/milestone.cjs +252 -252
  136. package/kit/framework/bin/lib/model-profiles.cjs +68 -68
  137. package/kit/framework/bin/lib/phase.cjs +888 -888
  138. package/kit/framework/bin/lib/profile-output.cjs +952 -952
  139. package/kit/framework/bin/lib/profile-pipeline.cjs +539 -539
  140. package/kit/framework/bin/lib/roadmap.cjs +329 -329
  141. package/kit/framework/bin/lib/security.cjs +382 -382
  142. package/kit/framework/bin/lib/state.cjs +1031 -1031
  143. package/kit/framework/bin/lib/template.cjs +222 -222
  144. package/kit/framework/bin/lib/uat.cjs +282 -282
  145. package/kit/framework/bin/lib/verify.cjs +888 -888
  146. package/kit/framework/bin/lib/workstream.cjs +491 -491
  147. package/kit/framework/bin/tools.cjs +918 -918
  148. package/kit/framework/commands/workstreams.md +63 -63
  149. package/kit/framework/references/checkpoints.md +778 -778
  150. package/kit/framework/references/continuation-format.md +249 -249
  151. package/kit/framework/references/decimal-phase-calculation.md +64 -64
  152. package/kit/framework/references/git-integration.md +295 -295
  153. package/kit/framework/references/git-planning-commit.md +38 -38
  154. package/kit/framework/references/model-profile-resolution.md +36 -36
  155. package/kit/framework/references/model-profiles.md +139 -139
  156. package/kit/framework/references/phase-argument-parsing.md +61 -61
  157. package/kit/framework/references/planning-config.md +202 -202
  158. package/kit/framework/references/questioning.md +162 -162
  159. package/kit/framework/references/tdd.md +263 -263
  160. package/kit/framework/references/ui-brand.md +160 -160
  161. package/kit/framework/references/user-profiling.md +657 -657
  162. package/kit/framework/references/verification-patterns.md +612 -612
  163. package/kit/framework/references/workstream-flag.md +58 -58
  164. package/kit/framework/templates/DEBUG.md +164 -164
  165. package/kit/framework/templates/UAT.md +265 -265
  166. package/kit/framework/templates/UI-SPEC.md +100 -100
  167. package/kit/framework/templates/VALIDATION.md +76 -76
  168. package/kit/framework/templates/claude-md.md +122 -122
  169. package/kit/framework/templates/codebase/architecture.md +185 -185
  170. package/kit/framework/templates/codebase/concerns.md +205 -205
  171. package/kit/framework/templates/codebase/conventions.md +204 -204
  172. package/kit/framework/templates/codebase/integrations.md +192 -192
  173. package/kit/framework/templates/codebase/stack.md +158 -158
  174. package/kit/framework/templates/codebase/structure.md +199 -199
  175. package/kit/framework/templates/codebase/testing.md +301 -301
  176. package/kit/framework/templates/config.json +44 -44
  177. package/kit/framework/templates/context.md +352 -352
  178. package/kit/framework/templates/continue-here.md +78 -78
  179. package/kit/framework/templates/copilot-instructions.md +7 -7
  180. package/kit/framework/templates/debug-subagent-prompt.md +91 -91
  181. package/kit/framework/templates/dev-preferences.md +20 -20
  182. package/kit/framework/templates/discovery.md +146 -146
  183. package/kit/framework/templates/discussion-log.md +63 -63
  184. package/kit/framework/templates/milestone-archive.md +123 -123
  185. package/kit/framework/templates/milestone.md +115 -115
  186. package/kit/framework/templates/phase-prompt.md +610 -610
  187. package/kit/framework/templates/planner-subagent-prompt.md +117 -117
  188. package/kit/framework/templates/project.md +186 -186
  189. package/kit/framework/templates/requirements.md +231 -231
  190. package/kit/framework/templates/research-project/ARCHITECTURE.md +204 -204
  191. package/kit/framework/templates/research-project/FEATURES.md +147 -147
  192. package/kit/framework/templates/research-project/PITFALLS.md +200 -200
  193. package/kit/framework/templates/research-project/STACK.md +120 -120
  194. package/kit/framework/templates/research-project/SUMMARY.md +170 -170
  195. package/kit/framework/templates/research.md +419 -419
  196. package/kit/framework/templates/retrospective.md +54 -54
  197. package/kit/framework/templates/roadmap.md +202 -202
  198. package/kit/framework/templates/state.md +176 -176
  199. package/kit/framework/templates/summary-complex.md +59 -59
  200. package/kit/framework/templates/summary-minimal.md +41 -41
  201. package/kit/framework/templates/summary-standard.md +48 -48
  202. package/kit/framework/templates/summary.md +209 -209
  203. package/kit/framework/templates/user-profile.md +146 -146
  204. package/kit/framework/templates/user-setup.md +256 -256
  205. package/kit/framework/templates/verification-report.md +258 -258
  206. package/kit/framework/workflows/add-phase.md +112 -112
  207. package/kit/framework/workflows/add-tests.md +351 -351
  208. package/kit/framework/workflows/add-todo.md +158 -158
  209. package/kit/framework/workflows/audit-milestone.md +340 -340
  210. package/kit/framework/workflows/audit-uat.md +109 -109
  211. package/kit/framework/workflows/autonomous.md +891 -891
  212. package/kit/framework/workflows/check-todos.md +177 -177
  213. package/kit/framework/workflows/cleanup.md +152 -152
  214. package/kit/framework/workflows/complete-milestone.md +696 -696
  215. package/kit/framework/workflows/diagnose-issues.md +231 -231
  216. package/kit/framework/workflows/discovery-phase.md +289 -289
  217. package/kit/framework/workflows/discuss-phase-assumptions.md +653 -653
  218. package/kit/framework/workflows/discuss-phase.md +784 -784
  219. package/kit/framework/workflows/do.md +104 -104
  220. package/kit/framework/workflows/execute-phase.md +838 -838
  221. package/kit/framework/workflows/execute-plan.md +510 -510
  222. package/kit/framework/workflows/fast.md +102 -102
  223. package/kit/framework/workflows/forensics.md +265 -265
  224. package/kit/framework/workflows/health.md +181 -181
  225. package/kit/framework/workflows/help.md +619 -619
  226. package/kit/framework/workflows/insert-phase.md +130 -130
  227. package/kit/framework/workflows/list-phase-assumptions.md +178 -178
  228. package/kit/framework/workflows/list-workspaces.md +56 -56
  229. package/kit/framework/workflows/manager.md +362 -362
  230. package/kit/framework/workflows/map-codebase.md +377 -377
  231. package/kit/framework/workflows/milestone-summary.md +223 -223
  232. package/kit/framework/workflows/new-milestone.md +486 -486
  233. package/kit/framework/workflows/new-project.md +1159 -1159
  234. package/kit/framework/workflows/new-workspace.md +237 -237
  235. package/kit/framework/workflows/next.md +97 -97
  236. package/kit/framework/workflows/node-repair.md +92 -92
  237. package/kit/framework/workflows/note.md +156 -156
  238. package/kit/framework/workflows/pause-work.md +176 -176
  239. package/kit/framework/workflows/plan-milestone-gaps.md +273 -273
  240. package/kit/framework/workflows/plan-phase.md +765 -765
  241. package/kit/framework/workflows/plant-seed.md +169 -169
  242. package/kit/framework/workflows/pr-branch.md +129 -129
  243. package/kit/framework/workflows/profile-user.md +450 -450
  244. package/kit/framework/workflows/progress.md +507 -507
  245. package/kit/framework/workflows/quick.md +757 -757
  246. package/kit/framework/workflows/remove-phase.md +155 -155
  247. package/kit/framework/workflows/remove-workspace.md +90 -90
  248. package/kit/framework/workflows/research-phase.md +82 -82
  249. package/kit/framework/workflows/resume-project.md +326 -326
  250. package/kit/framework/workflows/review.md +228 -228
  251. package/kit/framework/workflows/session-report.md +146 -146
  252. package/kit/framework/workflows/settings.md +283 -283
  253. package/kit/framework/workflows/ship.md +228 -228
  254. package/kit/framework/workflows/stats.md +60 -60
  255. package/kit/framework/workflows/transition.md +671 -671
  256. package/kit/framework/workflows/ui-phase.md +302 -302
  257. package/kit/framework/workflows/ui-review.md +165 -165
  258. package/kit/framework/workflows/update.md +323 -323
  259. package/kit/framework/workflows/validate-phase.md +174 -174
  260. package/kit/framework/workflows/verify-phase.md +252 -252
  261. package/kit/framework/workflows/verify-work.md +637 -637
  262. package/kit/hooks/check-update.js +118 -118
  263. package/kit/hooks/context-monitor.js +163 -163
  264. package/kit/hooks/prompt-guard.js +103 -103
  265. package/kit/hooks/statusline.js +125 -125
  266. package/kit/hooks/workflow-guard.js +101 -101
  267. package/kit/settings.json +45 -45
  268. package/kit/skills/ai-prompt-characterization/SKILL.md +1 -1
  269. package/kit/skills/armadilhas-sistemas-distribuidos/SKILL.md +1 -1
  270. package/kit/skills/audit-log-multi-tenant/SKILL.md +1 -1
  271. package/kit/skills/b2b-saas-architecture/SKILL.md +1 -1
  272. package/kit/skills/consistencia-leitura-replica/SKILL.md +1 -1
  273. package/kit/skills/crm-lead-pipeline-patterns/SKILL.md +1 -1
  274. package/kit/skills/escolha-modelo-consistencia/SKILL.md +1 -1
  275. package/kit/skills/evolucao-schema-compativel/SKILL.md +1 -1
  276. package/kit/skills/evolution-go-whatsapp-integration/SKILL.md +1 -1
  277. package/kit/skills/example-skill/SKILL.md +42 -42
  278. package/kit/skills/legacy-api-only-applications/SKILL.md +1 -1
  279. package/kit/skills/legacy-characterization-tests/SKILL.md +1 -1
  280. package/kit/skills/legacy-effect-analysis/SKILL.md +1 -1
  281. package/kit/skills/legacy-extract-class/SKILL.md +1 -1
  282. package/kit/skills/legacy-programming-by-difference/SKILL.md +1 -1
  283. package/kit/skills/legacy-seams-and-test-harness/SKILL.md +1 -1
  284. package/kit/skills/legacy-shotgun-surgery/SKILL.md +1 -1
  285. package/kit/skills/legacy-sprout-wrap-techniques/SKILL.md +1 -1
  286. package/kit/skills/legacy-storytelling-naked-crc/SKILL.md +1 -1
  287. package/kit/skills/lgpd-multi-tenant-compliance/SKILL.md +1 -1
  288. package/kit/skills/member-invite-flow/SKILL.md +1 -1
  289. package/kit/skills/member-management-react-shadcn/SKILL.md +1 -1
  290. package/kit/skills/multi-tenant-performance-scaling/SKILL.md +1 -1
  291. package/kit/skills/multi-tenant-rls-hierarchy/SKILL.md +1 -1
  292. package/kit/skills/org-onboarding-flow/SKILL.md +1 -1
  293. package/kit/skills/org-switcher-react-pattern/SKILL.md +1 -1
  294. package/kit/skills/permission-gate-react-pattern/SKILL.md +1 -1
  295. package/kit/skills/postgres-isolamento-concorrencia/SKILL.md +1 -1
  296. package/kit/skills/pre-refactor-characterization/SKILL.md +1 -1
  297. package/kit/skills/rbac-permissions-matrix-supabase/SKILL.md +1 -1
  298. package/kit/skills/streams-eventos-cdc/SKILL.md +1 -1
  299. package/kit/skills/supabase-branching-workflow/SKILL.md +1 -1
  300. package/kit/skills/supabase-ci-cd-github-actions/SKILL.md +1 -1
  301. package/kit/skills/supabase-column-level-security/SKILL.md +1 -1
  302. package/kit/skills/supabase-config-toml-remotes/SKILL.md +1 -1
  303. package/kit/skills/supabase-custom-claims-rbac/SKILL.md +1 -1
  304. package/kit/skills/supabase-migration-repair/SKILL.md +1 -1
  305. package/kit/skills/supabase-migrations/SKILL.md +1 -1
  306. package/kit/skills/supabase-pgtap-testing/SKILL.md +1 -1
  307. package/kit/skills/supabase-postgres-roles/SKILL.md +1 -1
  308. package/kit/skills/supabase-rls-defense-in-depth/SKILL.md +1 -1
  309. package/kit/skills/supabase-rls-policies/SKILL.md +1 -1
  310. package/kit/skills/super-admin-platform-pattern/SKILL.md +1 -1
  311. package/kit/skills/tenant-quente-mitigacao/SKILL.md +1 -1
  312. package/kit/skills/whatsapp-conversation-state-machine/SKILL.md +1 -1
  313. package/package.json +63 -63
  314. package/src/cli/index.js +378 -6
  315. package/src/cli/render.js +7 -0
  316. package/src/core/kit.js +216 -216
  317. package/src/core/logger.js +170 -0
  318. package/src/core/notify.js +60 -0
  319. package/src/core/reflect.js +247 -247
  320. package/src/core/reverse-sync.js +372 -372
  321. package/src/core/sync.js +418 -418
  322. package/src/core/watch.js +121 -121
  323. package/src/mcp-server/index.js +276 -10
  324. package/src/mcp-server/roots.js +124 -0
package/README.md CHANGED
@@ -1,914 +1,168 @@
1
- # kit-mcp
2
-
3
- [![npm version](https://img.shields.io/npm/v/@luanpdd/kit-mcp.svg)](https://www.npmjs.com/package/@luanpdd/kit-mcp)
4
- [![npm downloads](https://img.shields.io/npm/dm/@luanpdd/kit-mcp.svg)](https://www.npmjs.com/package/@luanpdd/kit-mcp)
5
- [![CI](https://github.com/luanpdd/kit-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/luanpdd/kit-mcp/actions/workflows/ci.yml)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
-
8
- An opinionated **brownfield planning workflow** (in PT-BR) — agents, slash-commands, framework shipped as an **MCP server**, with one-shot **sync** that projects the kit into every supported IDE's native layout Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Antigravity, Copilot, Trae.
9
-
10
- > **One canonical source. N IDEs. Edit once, everywhere updated.**
11
- >
12
- > Install and inherit the bundled workflow, or point `--kit-root` at your own folder to replace it entirely.
13
-
14
- ---
15
-
16
- ## Why this exists
17
-
18
- `.claude/agents/`, `.claude/commands/`, `.claude/skills/` are powerful but locked to Claude Code. The same definitions also need to live as `AGENTS.md` for Codex, `GEMINI.md` for Gemini, `.cursor/rules/` for Cursor, etc. Maintaining all of those by hand drifts immediately.
19
-
20
- **kit-mcp** keeps your canonical source in one place and projects it into every supported IDE through a single registry. It also exposes the kit through an MCP server so any agent that speaks MCP can browse, search, sync, run gates, and record replays.
21
-
22
- Inspired by [vinilana/dotcontext](https://github.com/vinilana/dotcontext) see the design notes at the bottom for what's adapted, what's not, and why.
23
-
24
- ---
25
-
26
- <!-- AUTOGEN-COUNTS-START -->
27
- **Bundled workflow:** 66 agents · 89 commands · 76 skills · 23 gates
28
- <!-- AUTOGEN-COUNTS-END -->
29
-
30
- ## What ships in the box
31
-
32
- ```
33
- kit-mcp/
34
- ├── kit/ ← bundled brownfield workflow (PT-BR)
35
- │ ├── agents/ 47 agents (planner, executor, verifier, debugger,
36
- │ │ ui-auditor, codebase-mapper, …)
37
- │ ├── commands/ 87 slash-commands (/novo-marco, /planejar-fase,
38
- │ │ /executar-fase, /publicar, …)
39
- │ ├── framework/ workflows + templates + bin libs the agents use
40
- │ ├── hooks/ workflow guards, prompt guards, statusline
41
- │ ├── skills/example-skill/ single example skill (replace with your own)
42
- │ └── README.md file-format guide
43
-
44
- ├── gates/ ← reusable workflow gates (regression, confidence, dep-check, …)
45
-
46
- ├── src/
47
- │ ├── core/ pure runtime — registry, kit, sync, reverse-sync, gates,
48
- │ │ gate-runner, watch, failures, replays, reflect
49
- │ ├── mcp-server/ MCP server entry + install command
50
- │ └── cli/ CLI mirror of the MCP tools
51
-
52
- ├── bin/
53
- │ ├── mcp.js shim starts the MCP stdio server
54
- │ └── cli.js shim → runs the CLI
55
-
56
- ├── LICENSE MIT
57
- ├── CHANGELOG.md
58
- ├── package.json
59
- └── README.md ← you are here
60
- ```
61
-
62
- **Lines of source code:** ~1300. **Runtime dependencies:** 5 (`@modelcontextprotocol/sdk`, `commander`, `chokidar`, `picocolors`, `@inquirer/prompts`). **Build step:** none plain ESM Node.js 20+.
63
-
64
- ### About the bundled workflow
65
-
66
- The bundled `kit/` is an opinionated **brownfield planning workflow** in Portuguese — milestones, phases, requirements, planning, execution with atomic commits and checkpoints, retrospective auditing. Installing `@luanpdd/kit-mcp` and syncing into your IDE gives you all 87+ slash-commands, 47+ agents, plus the framework templates that they delegate into.
67
-
68
- If that's not what you want, point `--kit-root` at your own folder and ignore everything under `kit/` — the infrastructure (registry, sync, gates, forensics, MCP server) works the same regardless of what kit you load.
69
-
70
- ### Observability suite (v1.9)
71
-
72
- A complete observability layer derived from *Observability Engineering* (Charity Majors, Liz Fong-Jones, George Miranda — O'Reilly, 2022) ships in the kit. It integrates deeply with the Supabase suite (v1.8) — every Supabase agent now consults observability skills, and the new `incident-investigator` agent uses `mcp__supabase__get_logs` / `execute_sql` / `get_advisors` to apply the **Core Analysis Loop** on real incidents.
73
-
74
- **11 skills** in `kit/skills/`:
75
- - `_shared-observability/glossary.md` — canonical bilingual vocabulary (PT-BR↔EN)
76
- - `structured-events`, `distributed-tracing`, `opentelemetry-standard`, `core-analysis-loop` — foundationals
77
- - `observability-driven-development` — the 4 pre-PR questions ("Does it do what I expected? Compare to previous version? Are users using? Anomalies emerge?")
78
- - `event-based-slos`, `burn-rate-alerting` SLO definition + predictive burn alerts
79
- - `telemetry-sampling`, `telemetry-pipelines`, `observability-maturity-model` — scale + culture
80
-
81
- **5 agents** in `kit/agents/`:
82
- - `observability-instrumenter` generates OTel + canonical attribute patches
83
- - `incident-investigator` Core Analysis Loop with persistent state in `.planning/investigations/`
84
- - `slo-engineer` generates `SLO.md` + SQL migrations to materialize SLI events
85
- - `burn-rate-forecaster` — calculates burn rate, ETA exhaustion, alert config
86
- - `omm-auditor` — scores 5 OMM capabilities (resilience, code quality, complexity, release cadence, user behavior)
87
-
88
- **6 commands**:
89
- - `/observabilidade <subcommand>` — single orchestrator (analog to `/supabase`) — dispatches to the 5 agents above with PT/EN synonyms
90
- - `/instrumentar-fase` generates `INSTRUMENTATION.md` per plan after `/planejar-fase`
91
- - `/investigar-producao` — guided Core Analysis Loop with persistent state
92
- - `/definir-slo` — creates SLO definition + SQL materialized view
93
- - `/burn-rate-status` — table `[SLO | budget burned | ETA | action]`, also runnable in `/loop`
94
- - `/auditar-observabilidade` generates OMM-REPORT.md scored
95
-
96
- **Quick start example:**
97
- ```bash
98
- # Define an SLO for a critical journey
99
- /observabilidade slo "checkout"
100
-
101
- # Investigate a production incident with Core Analysis Loop
102
- /observabilidade investigar "checkout SLO burn rate = 8 às 14:32"
103
-
104
- # Score project against Observability Maturity Model
105
- /observabilidade omm
106
- ```
107
-
108
- ### SRE Engagement suite (v1.10)
109
-
110
- A production engineering layer derived from *Site Reliability Engineering: How Google Runs Production Systems* (Beyer, Jones, Petoff, Murphy — Google/O'Reilly, 2016) ships in the kit. It composes with the Supabase suite (v1.8) and the Observability suite (v1.9) into a coherent production engineering stack — Supabase agents now suggest PRR before launch, every Edge Function template includes the **4 golden signals**, and `incident-investigator` outputs feed directly into blameless postmortems via `/postmortem --from-investigation <id>`.
111
-
112
- **6 skills** in `kit/skills/`:
113
- - `_shared-sre/glossary.md` — canonical bilingual vocabulary (PT-BR↔EN) — SLI/SLO/SLA, error budget, burn rate, toil, postmortem, blameless, PRR, golden signals, risk continuum, MTTR/MTBF
114
- - `sre-risk-management` risk continuum (cap 3), 99.99% wisdom ("as reliable as needs to be, no more"), error budget as explicit risk × innovation balance
115
- - `four-golden-signals` — Latency + Traffic + Errors + Saturation (cap 6), histograms with exponential bucketing, success vs error latency separated, percentiles vs mean (long tail)
116
- - `eliminating-toil` canonical toil definition (manual + repetitive + automatable + tactical + no enduring value + scales linearly), 50% rule (cap 5), automation patterns
117
- - `blameless-postmortems` — canonical 9-section template (cap 15), "no postmortem left unreviewed", blame culture as anti-pattern, Wheel of Misfortune
118
- - `production-readiness-review` PRR checklist (cap 32) — 6 axes (System architecture, Instrumentation, Emergency response, Capacity planning, Change management, Performance), 3 engagement models
119
-
120
- **4 agents** in `kit/agents/`:
121
- - `golden-signals-instrumenter` — specialization of `observability-instrumenter` (v1.9); generates OTel patches with the 4 golden signals (Latency=histogram, Traffic=counter, Errors=counter by `error.type`, Saturation=gauge)
122
- - `toil-auditor` — analyzes git log + shell scripts + manual commands in README/runbooks; produces `TOIL-AUDIT.md` with P0/P1/P2 priority + estimated effort
123
- - `postmortem-writer` — natural continuation of `incident-investigator` (v1.9); reads `.planning/investigations/<id>.md` and produces blameless postmortem (Summary, Impact, Root Causes, Trigger, Resolution, Detection, Action Items, Lessons Learned, Timeline UTC)
124
- - `prr-conductor` conducts Production Readiness Review for service/feature; reads schema (Supabase MCP), Edge Functions, `.planning/slos/`, audit logs; produces `PRR-REPORT.md` scored across the 6 axes
125
-
126
- **6 commands**:
127
- - `/sre <subcommand>` — single orchestrator (analog to `/supabase` v1.8 and `/observabilidade` v1.9) — dispatches to the 4 agents with PT/EN synonyms
128
- - `/golden-signals` invokes `golden-signals-instrumenter` for service/Edge Function/phase; generates `GOLDEN-SIGNALS.md` with OTel-ready instrumentation
129
- - `/auditar-toil` — invokes `toil-auditor`; generates `.planning/TOIL-AUDIT.md`
130
- - `/postmortem` — invokes `postmortem-writer`; supports `--from-investigation <id>` (continue from v1.9 investigation) or `--incident "<description>"` (standalone)
131
- - `/prr` invokes `prr-conductor`; supports `--service <name>` or `--feature <description>`; generates `PRR-REPORT.md`
132
- - `/risk-budget` displays current error budget vs risk continuum, citing SLOs from v1.9 (`.planning/slos/`); applies `sre-risk-management` skill
133
-
134
- **3 audit gates** in `gates/`:
135
- - `golden-signals-coverage` (blocking, pre-verify) — verifies code in `supabase/functions/**`, `src/**`, `lib/**` covers the 4 golden signals (skips gracefully on content-only phases)
136
- - `postmortem-template-required` (blocking, pre-conclude) — blocks `/concluir-marco` if any `.planning/investigations/<id>.md` lacks a corresponding `.planning/postmortems/<id>.md` (`Status: INCONCLUSIVE` is the only exception)
137
- - `prr-checklist-coverage` (blocking, pre-verify) — verifies every `PRR-REPORT.md` in `.planning/prr/**/*.md` covers the 6 canonical axes; "skipping an axe = invalid approval"
138
-
139
- **Lifecycle integration:**
140
- - `/forense` after Core Analysis Loop closes with VALIDATED root cause, suggests chain `/postmortem --from-investigation <id>` (Phase 40 / INT-FW-V2-01)
141
- - `/concluir-marco` — opt-in gate `workflow.complete_milestone_prr_gate=true` requires `PRR-REPORT.md` with status `passed` for production-bound features before archive (Phase 40 / INT-FW-V2-02)
142
- - `/auditar-marco` auto-invokes `/auditar-toil` when `workflow.audit_milestone_toil=true` (default); result feeds OMM Capacidade 3 scoring via `omm-auditor` (Phase 40 / INT-FW-V2-03)
143
-
144
- **Quick start example — end-to-end SRE workflow:**
145
- ```bash
146
- # Before launching a new feature in production — PRR
147
- /sre prr --feature "checkout v2"
148
-
149
- # While instrumenting service — apply 4 golden signals
150
- /sre golden-signals supabase/functions/orders/index.ts
151
-
152
- # Audit team toil quarterly
153
- /sre toil
154
-
155
- # When SLO burn alert fires investigate (v1.9 deep loop), then postmortem (v1.10)
156
- /investigar-producao "checkout SLO burn rate = 8 às 14:32"
157
- /sre postmortem --from-investigation checkout-2026-05-07
158
- # Or for framework-level failures:
159
- /forense "framework workflow X falhou em produção"
160
- /sre postmortem --incident "framework workflow X failed (see .planning/forensics/report-*)"
161
-
162
- # Risk dashboard against SLO budgets
163
- /sre risk-budget
164
- ```
165
-
166
- ---
167
-
168
- ## Slash Commands Reference (89 commands)
169
-
170
- Comandos do kit são organizados em **workflow lifecycle** (brownfield planning canônico) + **8 suítes especializadas** (Supabase, Observability, SRE, Legacy, Multi-Tenant, DDIA, etc.) + **quick actions** + **utilities**.
171
-
172
- ### Workflow Lifecycle (brownfield planning)
173
-
174
- O fluxo canônico de um projeto: bootstrap → milestone → phase → execute → audit → publish.
175
-
176
- | Comando | Objetivo |
177
- |---------|----------|
178
- | `/novo-projeto` | Inicializa novo projeto com coleta profunda de contexto e PROJECT.md |
179
- | `/novo-marco` | Inicia novo ciclo de milestone — atualiza PROJECT.md, encaminha para requisitos |
180
- | `/novo-workspace` | Cria workspace isolado com cópias de repos e .planning/ independente |
181
- | `/discutir-fase N` | Reúne contexto da fase por questionamento adaptativo antes do planejamento |
182
- | `/listar-hipoteses-fase N` | Mostra hipóteses do Claude sobre abordagem antes do planejamento |
183
- | `/planejar-fase N` | Cria plano detalhado da fase (PLAN.md) com loop de verificação |
184
- | `/pesquisar-fase N` | Pesquisa como implementar uma fase (standalone — geralmente use planejar) |
185
- | `/executar-fase N` | Executa todos os planos de uma fase com paralelização por ondas |
186
- | `/autonomo` | Executa todas as fases restantes autônomamente — discuss→plan→execute por fase |
187
- | `/auditar-marco` | Audita conclusão do milestone contra intenção original antes de arquivar |
188
- | `/concluir-marco` | Arquiva milestone concluído, cria tag git, prepara para próxima versão |
189
- | `/publicar` | Publica milestone — cria doc no Notion, abre PR no GitHub com link |
190
- | `/publicar-rapido` | Variante leve do publicar para hotfix/quick-task — sem ROADMAP dependency |
191
- | `/branch-pr` | Cria branch limpo para PR filtrando commits de .planning/ |
192
-
193
- ### Phase Lifecycle (gerenciar fases)
194
-
195
- | Comando | Objetivo |
196
- |---------|----------|
197
- | `/adicionar-fase` | Adiciona fase ao final do milestone atual no roadmap |
198
- | `/inserir-fase` | Insere trabalho urgente como fase decimal (ex: 72.1) entre fases existentes |
199
- | `/remover-fase N` | Remove fase futura do roadmap e renumera subsequentes |
200
- | `/planejar-lacunas` | Cria fases para fechar lacunas identificadas pela auditoria de milestone |
201
- | `/validar-fase N` | Audita retroativamente e preenche lacunas de validação para fase concluída |
202
- | `/adicionar-testes N` | Gera testes para fase concluída com base em UAT + implementação |
203
- | `/auditar-uat` | Auditoria multi-fase de todos itens de UAT e verificação pendentes |
204
- | `/verificar-trabalho` | Valida funcionalidades construídas através de UAT conversacional |
205
- | `/pausar-trabalho` | Cria handoff de contexto ao pausar trabalho no meio de uma fase |
206
- | `/retomar-trabalho` | Retoma trabalho da sessão anterior com restauração completa de contexto |
207
-
208
- ### Suite `/supabase` (v1.8 + v1.23-v1.26 — 4 camadas de segurança canônicas)
209
-
210
- Orquestrador `/supabase <subcomando>` com 14 subcomandos (sinônimos PT/EN). Toda a trilha de segurança Supabase canônica está implementada.
211
-
212
- | Subcomando | Objetivo | Cross-ref |
213
- |------------|----------|-----------|
214
- | `/supabase arquiteto` | Projeta schema + RLS + topologia realtime ANTES da implementação | v1.8 |
215
- | `/supabase migration` | Escreve migration SQL com 5 blocos obrigatórios + auto-chain hardener | v1.23 |
216
- | `/supabase rls` | Gera RLS policies granulares com GRANT + IS NOT NULL + views security_invoker | v1.23 |
217
- | `/supabase hardener` | Canonical materializer RLS — recebe draft via Task, verdicts GO/STRENGTHEN/REWRITE | v1.23 |
218
- | `/supabase column` | Column-Level privileges (REVOKE table-level + GRANT (col)) — PII/audit/billing | v1.24 |
219
- | `/supabase rbac` | Custom Claims via Auth Hook (enum + user_roles + auth hook + authorize() function) | v1.25 |
220
- | `/supabase role` | Postgres Roles (CREATE ROLE + INHERIT/NOINHERIT + GRANT/REVOKE) — system access | v1.26 |
221
- | `/supabase edge` | Escreve Deno Edge Functions com imports npm:/jsr: + env vars + EdgeRuntime | |
222
- | `/supabase realtime` | Configura canais Realtime — broadcast com private:true + RLS sobre realtime.messages | |
223
- | `/supabase auth` | Bootstrap Next.js v16 + Supabase Auth com @supabase/ssr + jwt-decode listener | |
224
- | `/supabase storage` | Configura buckets (públicos vs privados) + signed URLs + RLS sobre storage.objects | |
225
- | `/supabase rag` | Edge Function com embeddings + pgvector (HNSW/IVFFlat + RLS with permissions) | |
226
- | `/supabase cron` | Pattern `pg_cron + pgmq + pg_net` (cron → pgmq → Edge Function) | |
227
- | `/supabase check` | Valida SQL antes de apply (schema-checker — FKs/colunas/tabelas referenciadas) | |
228
-
229
- ### Suite `/observabilidade` (v1.9)
230
-
231
- | Comando | Objetivo |
232
- |---------|----------|
233
- | `/observabilidade <sub>` | Orquestrador — dispatcha para instrumenter, investigator, slo-engineer, burn-rate-forecaster, omm-auditor |
234
- | `/instrumentar-fase N` | Após `/planejar-fase`, gera INSTRUMENTATION.md por plano (spans + atributos canônicos) |
235
- | `/investigar-producao` | Core Analysis Loop guiado em incidente real — estado persistente em `.planning/investigations/` |
236
- | `/definir-slo` | Gera SLO.md + SQL para materializar SLI events em view/MV no Postgres |
237
- | `/burn-rate-status` | Tabela dual-window por SLO (fast 1h + slow 6h) — page/ticket/warn alerts |
238
- | `/auditar-observabilidade` | OMM-REPORT.md scored em 5 capacidades (resiliência/qualidade/complexidade/cadência/comportamento) |
239
- | `/auditar-observabilidade-cobertura` | X/N Edge Functions com 4 golden signals + Y/N com SLO + Z/N com burn alert |
240
-
241
- ### Suite `/sre` (v1.10 + v1.11)
242
-
243
- | Comando | Objetivo |
244
- |---------|----------|
245
- | `/sre <sub>` | Orquestrador — dispatcha para golden-signals-instrumenter, toil-auditor, postmortem-writer, prr-conductor, etc. |
246
- | `/golden-signals` | Instrumenta serviço/Edge Function com 4 golden signals OTel (Latency/Traffic/Errors/Saturation) |
247
- | `/auditar-toil` | Identifica toil no projeto (6 critérios canônicos) + sugere automação via pg_cron |
248
- | `/auditar-cascading` | Audita código para 5 triggers de cascading failure (sem timeout, retry sem jitter, etc.) |
249
- | `/auditar-release` | Audita CI/CD para hermeticidade + reprodutibilidade + policy enforcement |
250
- | `/load-shedding` | Aplica patches de load shedding em Edge Function/handler HTTP (drop policy, deadline-aware) |
251
- | `/postmortem` | Postmortem blameless 9 seções (modo `--from-investigation` ou `--incident`) |
252
- | `/prr` | Production Readiness Review scored em 6 axes (System/Instrumentation/Emergency/Capacity/Change/Performance) |
253
- | `/risk-budget` | Error budget atual vs risk continuum (cap 3 SRE) — posiciona no continuum 99% → 99.999% |
254
-
255
- ### Suite `/legacy` (v1.12 — Working Effectively with Legacy Code, Feathers 2004)
256
-
257
- | Comando | Objetivo |
258
- |---------|----------|
259
- | `/legacy <sub>` | Orquestrador — dispatcha para legacy-characterizer, seam-finder, refactor-safety-auditor |
260
- | `/caracterizar` | Gera characterization tests (cap 13 Feathers) — golden snapshots como oracle imutável |
261
- | `/caracterizar-prompt` | Characterization de prompts/tools LLM em produção — temperature=0 + seed fixo |
262
- | `/encontrar-seams` | Analisa código para identificar seams (object/link/preprocessing) — pré-requisito refactor |
263
- | `/auditar-refactor` | Gate canônico ANTES de refactor — veredito GO/BLOCK/WARN |
264
- | `/refactor-seguro` | Chain canônico — encontrar-seams → caracterizar → auditar-refactor → executar |
265
- | `/capturar-payloads` | Instrumenta Edge Function para captura via mcp__supabase__get_logs por N dias |
266
- | `/detectar-duplicacao` | Shotgun surgery — duplicação sintática (jscpd/regex) + semântica (embeddings) |
267
- | `/storytelling` | IA gera mental model de codebase desconhecido (story 5 frases + naked CRC) |
268
-
269
- ### Suite `/multi-tenant` (v1.21) e `/dados-distribuidos` (v1.22)
270
-
271
- | Comando | Objetivo |
272
- |---------|----------|
273
- | `/multi-tenant <sub>` | Orquestrador B2B SaaS — 10 agents implementers (architect, rls, onboarding, invite, super-admin, audit-log, whatsapp, crm, lgpd, isolation-audit) |
274
- | `/dados-distribuidos <sub>` | Orquestrador DDIA Foundations — auditor-consistencia-isolamento, detector-tenant-quente, validador-evolucao-schema |
275
-
276
- ### UI Phase (frontend design contract)
277
-
278
- | Comando | Objetivo |
279
- |---------|----------|
280
- | `/fase-ui N` | Gera contrato de design UI (UI-SPEC.md) para fases frontend |
281
- | `/revisar-ui N` | Auditoria visual retroativa de 6 pilares do código frontend implementado |
282
-
283
- ### Backlog & Ideas
284
-
285
- | Comando | Objetivo |
286
- |---------|----------|
287
- | `/adicionar-backlog` | Adiciona ideia ao estacionamento de backlog (numeração 999.x) |
288
- | `/revisar-backlog` | Revisa e promove itens do backlog para milestone ativo |
289
- | `/plantar-ideia` | Captura ideia prospectiva com condições de gatilho — surge automaticamente no milestone certo |
290
- | `/nota` | Captura de ideias sem fricção. Adicionar, listar ou promover notas para todos |
291
- | `/adicionar-tarefa` | Captura ideia ou tarefa como todo a partir do contexto da conversa |
292
- | `/verificar-tarefas` | Lista todos pendentes e seleciona um para trabalhar |
293
-
294
- ### Quick Actions & Routing
295
-
296
- | Comando | Objetivo |
297
- |---------|----------|
298
- | `/fazer "<task>"` | **Entrypoint canônico** — roteia texto livre para o comando correto. Use este na dúvida |
299
- | `/proximo` | Avança automaticamente para o próximo passo lógico no workflow |
300
- | `/progresso` | Verifica progresso do projeto, mostra contexto e roteia para próxima ação |
301
- | `/expresso` | Tarefa rápida com garantias framework (commits atômicos + state tracking) sem agents opcionais |
302
- | `/rapido` | Tarefa trivial inline — sem subagentes, sem overhead de planejamento |
303
- | `/autonomo` | Executa fases restantes autônomamente — discuss→plan→execute por fase |
304
- | `/depurar` | Depuração sistemática com estado persistente entre resets de contexto |
305
- | `/forense` | Investigação post-mortem de workflows com falha — analisa git + artefatos + estado |
306
-
307
- ### Workspace & Workflows (paralelos)
308
-
309
- | Comando | Objetivo |
310
- |---------|----------|
311
- | `/fluxos-trabalho` | Gerencia fluxos paralelos — listar, criar, alternar, status, progresso, concluir, retomar |
312
- | `/listar-workspaces` | Lista workspaces framework ativos e seu status |
313
- | `/remover-workspace` | Remove workspace framework e limpa worktrees |
314
- | `/fio` | Gerencia threads de contexto persistentes para trabalho entre sessões |
315
- | `/gerenciador` | Central de comando interativa para gerenciar múltiplas fases em um terminal |
316
-
317
- ### Utilities
318
-
319
- | Comando | Objetivo |
320
- |---------|----------|
321
- | `/ajuda` | Mostra comandos disponíveis e guia de uso |
322
- | `/atualizar` | Atualiza framework para versão mais recente com changelog |
323
- | `/configuracoes` | Configura toggles de workflow e perfil de modelo |
324
- | `/definir-perfil` | Altera perfil de modelo para agents framework (quality/balanced/budget/inherit) |
325
- | `/perfil-usuario` | Gera perfil comportamental do desenvolvedor (artefatos descobríveis pelo Claude) |
326
- | `/mapear-codebase` | Analisa base de código com agents paralelos para produzir docs em .planning/codebase/ |
327
- | `/relatorio-sessao` | Relatório da sessão com estimativas de tokens, resumo de trabalho e resultados |
328
- | `/estatisticas` | Estatísticas do projeto — fases, planos, requisitos, métricas git e timeline |
329
- | `/saude` | Diagnostica integridade do diretório de planejamento e opcionalmente repara |
330
- | `/sync-main` | Atualiza branch local com commits da main (pergunta qual priorizar em conflito) |
331
- | `/limpeza` | Arquiva diretórios de fase acumulados de milestones concluídos |
332
- | `/reaplicar-patches` | Reaplica modificações locais após atualização do framework |
333
- | `/revisar` | Solicita revisão entre IAs de planos de fase a partir de CLIs externas |
334
- | `/resumo-marco` | Resumo abrangente do projeto a partir dos artefatos do milestone |
335
- | `/setup-notion` | Cria estrutura de páginas Notion para novo projeto + gera `.claude/notion-config.json` |
336
- | `/entrar-discord` | Entrar na comunidade framework no Discord |
337
-
338
- ---
339
-
340
- ## Workflow exemplos
341
-
342
- ### Exemplo 1: Ciclo completo de um milestone (brownfield)
343
-
344
- ```bash
345
- # 1. iniciar milestone
346
- /novo-marco
347
- # → coleta objetivos, opcionalmente pesquisa (4 agents paralelos), define REQUIREMENTS.md,
348
- # invoca roadmapper para criar ROADMAP.md, commita
349
-
350
- # 2. executar fase (manual passo-a-passo)
351
- /discutir-fase 124 # gather context via questionamento adaptativo
352
- /planejar-fase 124 # plan-checker → planner → PLAN.md
353
- /executar-fase 124 # executor com atomic commits + verifier
354
-
355
- # OU: executar todas as fases autônomamente
356
- /autonomo # discuss → plan → execute por fase + commit atômico
357
-
358
- # 3. auditar
359
- /auditar-marco # verifica cobertura, integration entre phases, fluxos E2E
360
-
361
- # 4. concluir e publicar
362
- /concluir-marco # archive .planning/milestones/v{X.Y}-* + tag git
363
- /publicar # Notion + PR GitHub com link Notion no body
364
- ```
365
-
366
- ### Exemplo 2: Trilha de segurança Supabase (v1.23-v1.26 cumulativos)
367
-
368
- ```bash
369
- # 1. arquitetura inicial — projeta schema + RLS + Postgres roles upfront
370
- /supabase arquiteto "B2B SaaS com leads + audit log + invites + super-admin"
371
-
372
- # 2. migration com 5 blocos obrigatórios (CREATE TABLE + GRANTs + RLS + 4 policies + INDEX)
373
- /supabase migration "create_orgs_and_members"
374
- # → auto-chain cooperativo com supabase-rls-hardener (Detector 1-10)
375
-
376
- # 3. column-level para PII (v1.24)
377
- /supabase column "audit_log payload protected — só security_admin"
378
-
379
- # 4. RBAC via Custom Claims (v1.25)
380
- /supabase rbac "roles admin/moderator/user + 8 permissions"
381
- # → cria enum types + user_roles + auth hook + authorize() + RLS policies
382
-
383
- # 5. Custom Postgres role para service accounts (v1.26)
384
- /supabase role "platform_admin para super-admin operations"
385
- ```
386
-
387
- ### Exemplo 3: Investigação de incidente (Observability + SRE)
388
-
389
- ```bash
390
- # 1. diagnóstico
391
- /investigar-producao # Core Analysis Loop com estado persistente
392
- # → 4 fases: dados/hipótese/validação/root cause
393
- # → arquiva em .planning/investigations/<id>.md
394
-
395
- # 2. postmortem após fix
396
- /postmortem --from-investigation <id>
397
- # → blameless 9 seções (cap 15 livro Google SRE)
398
-
399
- # 3. ajustar SLO se necessário
400
- /definir-slo # SLI event-based + SQL materialization
401
- /burn-rate-status # tabela dual-window — page/ticket/warn
402
-
403
- # 4. PRR antes de scaled release
404
- /prr --service "checkout" # scored em 6 axes
405
- ```
406
-
407
- ### Exemplo 4: Refactor seguro de código legado (v1.12)
408
-
409
- ```bash
410
- # Chain canônico — bloqueia se gates falhares
411
- /refactor-seguro src/foo.ts
412
- # 1. encontrar-seams — identifica object/link/preprocessing seams (cap 25 Feathers)
413
- # 2. caracterizar — gera characterization tests (cap 13) cobrindo 5+ grupos de equivalência
414
- # 3. auditar-refactor — veredito GO/BLOCK/WARN baseado em coverage + mutation
415
- # 4. executor com safety net
416
- ```
417
-
418
- ### Exemplo 5: Quick action via roteamento canônico
419
-
420
- ```bash
421
- # Texto livre — kit roteia para o comando certo
422
- /fazer "preciso adicionar uma tabela leads com phone email e org_id"
423
- # → roteia para /supabase migration (que auto-chain para hardener + RLS)
424
-
425
- /fazer "quero entender por que esse codebase está confuso"
426
- # → roteia para /storytelling ou /mapear-codebase
427
-
428
- /fazer "meu teste de produção tá flaky — não sei por que"
429
- # → roteia para /depurar (cria sessão persistente)
430
- ```
431
-
432
- ---
433
-
434
- ## Prerequisites
435
-
436
- - **Node.js ≥ 20** (uses native ESM, no transpiler)
437
- - An IDE / agent that speaks MCP if you want to use it that way (Claude Code, Cursor, Codex, Gemini CLI, …)
438
- - Optional: a project where you'll sync the kit (any folder)
439
-
440
- ---
441
-
442
- ## Quick start
443
-
444
- ### 1. Use the bundled workflow as-is (recommended)
445
-
446
- ```bash
447
- # Browse what's bundled
448
- npx -y @luanpdd/kit-mcp kit list-agents # 47 agents
449
- npx -y @luanpdd/kit-mcp kit list-commands # 87 commands
450
- npx -y @luanpdd/kit-mcp sync targets # supported IDEs
451
-
452
- # Install into your project for Claude Code
453
- npx -y @luanpdd/kit-mcp sync install claude-code --project-root .
454
- ```
455
-
456
- After that, open the project in Claude Code and the slash-commands (`/novo-marco`, `/planejar-fase`, `/executar-fase`, `/publicar`, …) and agents are immediately available.
457
-
458
- ### 2. Replace the bundled workflow with your own kit
459
-
460
- Point kit-mcp at your own `kit/` folder via `--kit-root` or the `KIT_MCP_KIT_ROOT` env var:
461
-
462
- ```bash
463
- # Option A: per-command flag
464
- npx -y @luanpdd/kit-mcp --kit-root ~/my-kit kit list-agents
465
- npx -y @luanpdd/kit-mcp --kit-root ~/my-kit sync install claude-code --project-root .
466
-
467
- # Option B: env var (sticky for the session)
468
- export KIT_MCP_KIT_ROOT=~/my-kit
469
- npx -y @luanpdd/kit-mcp sync install claude-code --project-root .
470
- ```
471
-
472
- Your `~/my-kit/` follows the same layout as the bundled kit:
473
-
474
- ```
475
- my-kit/
476
- ├── agents/<name>.md YAML frontmatter + Markdown body
477
- ├── commands/<name>.md YAML frontmatter + Markdown body
478
- └── skills/<name>/SKILL.md YAML frontmatter + Markdown body
479
- references/ optional reference docs
480
- ```
481
-
482
- See [`kit/README.md`](kit/README.md) for the file format.
483
-
484
- ### 3. Register kit-mcp into an IDE (so agents inside the IDE can call the MCP tools)
485
-
486
- ```bash
487
- # Portable — works on any machine, no clone needed
488
- npx -y @luanpdd/kit-mcp install write claude-code --scope user --via npx
489
- ```
490
-
491
- For other IDEs, swap `claude-code` for `cursor`, `codex`, `gemini-cli`, `windsurf`, `antigravity`, `copilot`, or `trae`. Run `kit sync targets` for the live capability matrix.
492
-
493
- ---
494
-
495
- ## CLI reference
496
-
497
- The CLI mirrors the MCP tools 1:1. **By default the CLI prints colored, human-readable tables and summary panels.** Add `--json` to restore raw JSON-to-stdout (machine-readable, the default in v1.0). The global `--kit-root` flag overrides the kit source for any subcommand.
498
-
499
- ```bash
500
- kit list-agents # human: colored table, name + description
501
- kit list-agents --json # machine: JSON array
502
-
503
- kit sync install claude-code # human: progress bar + summary panel
504
- kit sync install claude-code --json # machine: full result object
505
- ```
506
-
507
- In non-TTY mode (pipes, CI), animations degrade to linear status lines automatically. `NO_COLOR=1` disables colors entirely; `FORCE_COLOR=1` forces them on even in pipes.
508
-
509
- ### `kit kit ...` — browse the kit
510
-
511
- ```bash
512
- kit kit list-agents # 47 agents (bundled workflow)
513
- kit kit list-commands # 87 commands (bundled workflow)
514
- kit kit list-skills # 49 skills (bundled workflow)
515
- kit kit get agent planner
516
- kit kit search "milestone" # fuzzy match across all kinds
517
- ```
518
-
519
- ### `kit sync ...` — project into an IDE
520
-
521
- ```bash
522
- kit sync targets # list supported IDEs + capabilities
523
- kit sync status claude-code # see which capability paths exist in cwd
524
- kit sync install claude-code # write the kit into the cwd as Claude Code expects
525
- kit sync install cursor --mode copy # copy mode (no link to canonical)
526
- kit sync install codex --dry-run # preview without writing
527
- kit sync remove claude-code # remove only files generated by kit-mcp (uses STUB_MARKER)
528
- kit sync watch claude-code cursor # watch kit/ → resync to listed IDEs on every change
529
- kit sync watch --all # watch + auto-detect every IDE already present in cwd
530
- ```
531
-
532
- **Modes:**
533
- - `reference` (default) — writes a stub that links back to `kit/`. Edit canonical → all IDEs see the change.
534
- - `copy` — duplicates content. Use when shipping a frozen snapshot of the kit.
535
-
536
- **Per-IDE projection** — what each target receives:
537
-
538
- | IDE | rules → | agents → | commands → | skills → | framework → | hooks → |
539
- |---|---|---|---|---|---|---|
540
- | Claude Code | `CLAUDE.md` | `.claude/agents/*.md` | `.claude/commands/*.md` | `.claude/skills/*/` | `.claude/framework/**` | `.claude/hooks/**` |
541
- | Cursor | `.cursor/rules/*.mdc` | `.cursor/agents/*.md` | — | — | — | — |
542
- | Codex | `AGENTS.md` | — | — | `.codex/skills/*/` | — | — |
543
- | Gemini CLI | `GEMINI.md` | — | — | `.gemini/skills/*/` | — | — |
544
- | Copilot | `.github/copilot-instructions.md` | `.github/agents/*.agent` | — | `.github/skills/*/` | — | — |
545
- | Windsurf | `.windsurf/rules/*.md` | `.windsurf/agents/*.md` | — | `.windsurf/skills/*/` | — | — |
546
- | Antigravity | `.agents/rules/*.md` | `.agents/agents/*.md` | — | `.agents/workflows/*/` | — | — |
547
- | Trae | `.trae/rules/*.md` | `.trae/agents/*.md` | — | — | — | — |
548
-
549
- A capability marked `—` is not supported by that IDE. Adding a new IDE = one entry in [`src/core/registry.js`](src/core/registry.js).
550
-
551
- **About `framework` and `hooks`:** these are *mirror-tree* capabilities — the entire `kit/framework/` and `kit/hooks/` subtrees are copied verbatim into `.claude/framework/` and `.claude/hooks/`. They're needed by the bundled workflow because slash-commands like `/novo-marco` reference framework files via paths like `@./.claude/framework/workflows/new-milestone.md`. A `.kit-mcp-managed` marker is written at the root of each managed tree so `kit sync remove` can clean up safely without touching directories you authored yourself.
552
-
553
- ### `kit install ...` — register kit-mcp into an IDE's MCP config
554
-
555
- ```bash
556
- kit install targets # list IDEs that support MCP config
557
- kit install dry-run claude-code --scope user --via npx # preview the JSON/TOML
558
- kit install write claude-code --scope user --via npx # portable: uses `npx @luanpdd/kit-mcp`
559
- kit install write claude-code --scope project --via local # local clone: uses ./bin/mcp.js absolute path
560
- kit install write claude-code --scope user --via global # assumes `npm install -g @luanpdd/kit-mcp`
561
- kit install write # no target: opens an interactive selector (TTY)
562
- kit install write claude-code --yes # CI: skip the confirm prompt
563
- ```
564
-
565
- Since v1.1, `install write` always **previews** the JSON/TOML it's about to write and asks you to confirm. Pass `--yes` (CI mode) or `--json` to bypass the prompt. Without a target argument in TTY mode, you get an arrow-key selector listing all 8 IDEs.
566
-
567
- `--via` decides how the IDE will invoke the server:
568
-
569
- | Mode | Command in IDE config | When to use |
570
- |---|---|---|
571
- | `npx` (recommended) | `npx -y @luanpdd/kit-mcp` | Portable — works on any machine |
572
- | `local` | `node /abs/path/to/clone/bin/mcp.js` | You're hacking on kit-mcp itself |
573
- | `global` | `kit-mcp` | After `npm install -g @luanpdd/kit-mcp` — fastest startup |
574
-
575
- ### `kit reverse-sync ...` — bring IDE edits back to the canonical kit
576
-
577
- If you edited an agent/command/skill/framework/hook **directly inside the IDE's folder** (`.claude/agents/foo.md`, `.claude/framework/workflows/bar.md`, `.claude/hooks/baz.js`, …) instead of in your kit, this brings those edits back so the canonical absorbs them.
578
-
579
- ```bash
580
- kit reverse-sync detect claude-code --project-root .
581
- kit reverse-sync apply claude-code --project-root . --strategy merge --dry-run
582
- kit reverse-sync apply claude-code --project-root . --strategy merge
583
- kit reverse-sync apply claude-code --project-root . --strategy overwrite --only agent/foo
584
- kit reverse-sync apply claude-code --project-root . --strategy overwrite --only framework/workflows/new-milestone.md
585
- ```
586
-
587
- **Strategies:** `skip` (list-only), `merge` (canonical frontmatter + edited body — for agents/commands/skills), `overwrite`, `rename` (preserve both as `-from-{ide}.md`).
588
-
589
- **Mirror-tree caps (`framework`, `hooks`):** files have no frontmatter, so `merge` degenerates to `overwrite` (with a note). The `.kit-mcp-managed` marker is automatically excluded from candidates. Filter individual files with `--only framework/<rel>` or `--only hooks/<file>`.
590
-
591
- ### `kit gates ...` — reusable workflow gates
592
-
593
- ```bash
594
- kit gates list # all gates with stage + blocking flag
595
- kit gates get regression # full markdown of one gate
596
- kit gates for-stage pre-verify # gates that run before the verify step
597
- kit gates run secrets-scan --project-root . # interactive: shows the script, asks y/N, runs
598
- kit gates run secrets-scan --project-root . --yes # non-interactive (CI)
599
- kit gates run confidence --no-interactive # manual gates → verdict=manual when not interactive
600
- ```
601
-
602
- **Verdicts:** `passed` (exit 0), `block` (exit≠0 + blocking), `warn` (exit≠0 + non-blocking), `manual` (no shell), `skipped` (declined).
603
-
604
- Author runnable gates with a `bash` code-fence under `## Check`:
605
-
606
- ````markdown
607
- ---
608
- id: my-gate
609
- stage: pre-verify
610
- blocking: true
611
- description: ...
612
- ---
613
- ## Check
614
- ```bash
615
- test -f package.json && npm test
616
- ```
617
- ````
618
-
619
- ### `kit forensics ...` — failure dataset, replays & LLM-driven prompt evolution
620
-
621
- ```bash
622
- # Aggregate failures across debug/, verifications, forensics
623
- kit forensics collect --project-root .
624
- kit forensics summarize --project-root .
625
- kit forensics write-learnings --project-root .
626
-
627
- # LLM pass: read learnings + current agent, propose minimal prompt edits
628
- kit forensics reflect --agent <name> --project-root . --dry-run
629
- kit forensics reflect --agent <name> --project-root .
630
- kit forensics reflect --agent <name> --project-root . --apply
631
-
632
- # Replays
633
- kit forensics list-replays --project-root .
634
- kit forensics load-replay <id> --project-root .
635
- ```
636
-
637
- `reflect` requires `ANTHROPIC_API_KEY` (override model with `KIT_REFLECT_MODEL`, max tokens with `KIT_REFLECT_MAX_TOKENS`). Without the key, `--dry-run` saves the assembled prompt for manual paste.
638
-
639
- The proposal is always saved to `.planning/learnings/{agent}.proposal.md` first; the canonical is only modified after explicit confirmation (or `--apply`). MCP `forensics.reflect` never auto-applies.
640
-
641
- ### `kit ui ...` — live process viewer (sidecar) — _new in 1.2_
642
-
643
- A tiny localhost web app that streams what kit-mcp is doing while your IDE drives it. Strictly opt-in: ignore it and v1.1 behavior is unchanged.
644
-
645
- ```bash
646
- # In one terminal — keeps running until Ctrl+C
647
- kit ui start
648
-
649
- # In another terminal (or via Claude Code / Cursor) — runs as before, but events
650
- # are now also broadcast to the sidecar window
651
- kit sync install claude-code
652
-
653
- # Tools too: pass autoSpawn:true on the MCP side, or just `kit ui start` first
654
- kit ui status
655
- kit ui stop
656
- ```
657
-
658
- What you get:
659
-
660
- - A single browser tab at `http://127.0.0.1:7100` (or the next free port up to 7199)
661
- - Live event stream over Server-Sent Events — `tool_invocation`, `progress`, `error`, `milestone`, `run.start`, `run.end`
662
- - Filters by event type and substring; pause/resume; auto-scroll; dark mode tracks the OS
663
- - The sidecar shuts itself down after 30 minutes of idle; `--idle-ms 0` disables that
664
-
665
- **Auto-spawn from MCP tools.** Pass `autoSpawn: true` in the inputSchema of `sync` (action=install), `reverse-sync` (action=apply), or `gates` (action=run). The MCP server will spawn `bin/ui.js` detached, wait for it to come online, open your default browser, and stream that tool's progress. Trivial tools (`kit list-*`, `forensics`, `install`) deliberately don't accept `autoSpawn` — the overhead isn't worth it.
666
-
667
- **Opt-out always available.** From the CLI: pass `--no-ui` or set `KIT_MCP_NO_UI=1`. The sidecar is never started behind your back; it's only used when a lockfile is already present (someone ran `kit ui start` or `autoSpawn: true`).
668
-
669
- **Security model.** Sidecar binds to `127.0.0.1` literally — never `0.0.0.0`, never `localhost` (which resolves to `::1` on Windows). Every route validates the `Host` header to mitigate DNS rebinding. CSP is strict (`default-src 'self'; …; frame-ancestors 'none'`). Paths in payloads are scrubbed (`$HOME → ~`, `<projectRoot> → <project>`) so screenshots don't leak directory structure. No persistence, no TLS, no auth — single-user dev workstation only. Full threat model in [`docs/sidecar-security.md`](docs/sidecar-security.md).
670
-
671
- **First-run quirks.** Windows Defender / macOS firewall may prompt the first time `kit ui start` binds. Approving "Private networks" is enough — the server doesn't accept anything from outside loopback regardless. On WSL, `kit ui start` opens the URL in the Windows host browser via `wslview`. In CI / SSH / `TERM=dumb`, browser launch is suppressed and the URL is printed to stderr instead.
672
-
673
- ---
674
-
675
- ## MCP usage
676
-
677
- Once registered (`kit install write <ide> --via npx`), the IDE's agent gets 6 MCP tools, all using **action-based dispatch** — one tool, many actions, low context cost.
678
-
679
- | Tool | Actions |
680
- |---|---|
681
- | `kit` | `list-agents`, `list-commands`, `list-skills`, `get`, `search` |
682
- | `sync` | `targets`, `status`, `install`, `remove` |
683
- | `reverse-sync` | `detect`, `apply` |
684
- | `gates` | `list`, `get`, `for-stage` |
685
- | `forensics` | `collect`, `summarize`, `write-learnings`, `reflect`, `list-replays`, `record-replay`, `load-replay`, `annotate-replay` |
686
- | `install` | `targets`, `install`, `dry-run` |
687
-
688
- ### Example calls (from inside an MCP client)
689
-
690
- ```jsonc
691
- { "tool": "kit", "arguments": { "action": "list-agents" } }
692
- { "tool": "sync", "arguments": { "action": "install", "target": "claude-code", "projectRoot": "/abs" } }
693
- { "tool": "gates", "arguments": { "action": "for-stage", "stage": "pre-verify" } }
694
- { "tool": "forensics", "arguments": { "action": "write-learnings", "projectRoot": "/abs" } }
695
- { "tool": "reverse-sync", "arguments": { "action": "detect", "target": "claude-code", "projectRoot": "/abs" } }
696
- ```
697
-
698
- ---
699
-
700
- ## Harness usage (programmatic)
701
-
702
- The `core/` modules are pure functions, no transport coupling:
703
-
704
- ```javascript
705
- import { listKit, searchKit } from '@luanpdd/kit-mcp/src/core/kit.js';
706
- import { syncTo, statusOf } from '@luanpdd/kit-mcp/src/core/sync.js';
707
- import { listGates, gatesForStage } from '@luanpdd/kit-mcp/src/core/gates.js';
708
- import { runGate } from '@luanpdd/kit-mcp/src/core/gate-runner.js';
709
- import { detectReverse, applyReverse } from '@luanpdd/kit-mcp/src/core/reverse-sync.js';
710
- import { watchKit } from '@luanpdd/kit-mcp/src/core/watch.js';
711
- import { collectFailures, writeLearnings } from '@luanpdd/kit-mcp/src/core/failures.js';
712
- import { reflect } from '@luanpdd/kit-mcp/src/core/reflect.js';
713
-
714
- // Browse the kit
715
- const kit = await listKit('/path/to/kit');
716
- console.log(kit.agents.length, 'agents');
717
-
718
- // Sync to multiple IDEs in parallel
719
- await Promise.all([
720
- syncTo('claude-code', { projectRoot: '/proj/foo', kitRoot: '/path/to/kit' }),
721
- syncTo('cursor', { projectRoot: '/proj/foo', kitRoot: '/path/to/kit' }),
722
- syncTo('codex', { projectRoot: '/proj/foo', kitRoot: '/path/to/kit' }),
723
- ]);
724
-
725
- // Watch and resync
726
- const w = await watchKit(['claude-code'], { projectRoot: '/proj/foo' });
727
- // ... later: await w.stop();
728
- ```
729
-
730
- This is what dotcontext calls "the harness" — a runtime layer used both by CLI and MCP.
731
-
732
- ---
733
-
734
- ## Adding things
735
-
736
- ### Add a new agent / command / skill
737
-
738
- Drop a file (or folder, for skills) into your `kit/`:
739
-
740
- ```bash
741
- # kit/agents/refactor-suggester.md
742
- cat > kit/agents/refactor-suggester.md <<'EOF'
743
- ---
744
- name: refactor-suggester
745
- description: Scans a directory and suggests safe refactors with diff previews.
746
- tools: Read, Glob, Grep
747
- ---
748
- You are a refactoring assistant ...
749
- EOF
750
-
751
- # Re-sync (or use `kit sync watch` for automatic)
752
- kit sync install claude-code --project-root /your/project
753
- ```
754
-
755
- ### Add a new gate
756
-
757
- ```bash
758
- cat > gates/bundle-size.md <<'EOF'
759
- ---
760
- id: bundle-size
761
- stage: post-verify
762
- blocking: false
763
- description: Warn if the production bundle grew more than 10% versus the previous phase.
764
- ---
765
- ## Check
766
- ```bash
767
- # your script here; cwd will be --project-root
768
- EOF
769
- ```
770
-
771
- The gate appears in `kit gates list` immediately and is runnable with `kit gates run bundle-size`.
772
-
773
- ### Add a new IDE target
774
-
775
- Open [`src/core/registry.js`](src/core/registry.js) and add an entry to `TARGETS`:
776
-
777
- ```javascript
778
- 'my-new-ide': {
779
- label: 'My New IDE',
780
- rules: { path: 'MY_RULES.md', mode: 'single' },
781
- agents: { path: '.myide/agents/', mode: 'multi', extension: '.md' },
782
- commands: null,
783
- skills: { path: '.myide/skills/', mode: 'multi-dir' },
784
- mcpConfig:{ path: '.myide/mcp.json', strategy: 'merge-mcpServers-json',
785
- userPath: '~/.myide/mcp.json', userKey: 'mcpServers' },
786
- },
787
- ```
788
-
789
- That's the entire change. `kit sync install my-new-ide` and `kit install write my-new-ide` work immediately.
790
-
791
- ---
792
-
793
- ## How the sync stays in sync
794
-
795
- When you run `sync install <ide> --mode reference`, kit-mcp writes stubs like:
796
-
797
- ```markdown
798
- ---
799
- name: example-reviewer
800
- description: ...
801
- ---
802
-
803
- <!-- kit-mcp:reference -->
804
- # example-reviewer
805
-
806
- > Canonical source: [`../../kit/agents/example-reviewer.md`](../../kit/agents/example-reviewer.md)
807
- > Edit the source file in the kit, not this stub.
808
- ```
809
-
810
- The IDE reads the **frontmatter** (preserved verbatim) for the metadata it needs, and the body points back at the canonical file. Edit `kit/agents/example-reviewer.md` once; running `sync install` again refreshes timestamps but the link is unchanged.
811
-
812
- The `STUB_MARKER` (`<!-- kit-mcp:reference -->`) lets `sync remove` clean up only files we wrote, never touching anything you authored manually. It also lets `reverse-sync detect` recognize stubs vs user-edited content.
813
-
814
- ---
815
-
816
- ## Releasing (maintainers)
817
-
818
- The repo auto-publishes to npm via GitHub Actions whenever a version tag (`v*`) is pushed.
819
-
820
- ### One-time setup
821
-
822
- 1. **Create the GitHub repo** (if not already):
823
- ```bash
824
- gh repo create luanpdd/kit-mcp --public --source . --push
825
- ```
826
-
827
- 2. **Generate an npm token** at https://www.npmjs.com/settings/luanpdd/tokens
828
- - Type: **Granular Access Token**
829
- - Permissions: **Read and write** for `@luanpdd/*` scope
830
- - **Allow this token to bypass 2FA**: ✅ enabled (required for CI)
831
-
832
- 3. **Add the token as a GitHub secret**:
833
- ```bash
834
- gh secret set NPM_TOKEN
835
- # paste the npm_xxxxx token when prompted
836
- ```
837
-
838
- ### Release flow
839
-
840
- ```bash
841
- npm version patch # or minor / major — bumps + commits + tags
842
- git push --follow-tags
843
- # GitHub Action runs CLI smoke tests, then `npm publish --provenance`
844
- ```
845
-
846
- The publish workflow refuses to ship if `package.json` version doesn't match the tag.
847
-
848
- The CI workflow runs CLI smoke tests on **Ubuntu / macOS / Windows × Node 20 / 22** on every PR and push to `main`.
849
-
850
- ---
851
-
852
- ## Design notes — what we adapted from dotcontext, what we didn't
853
-
854
- **Adapted (load-bearing simplifications):**
855
-
856
- 1. **Single registry table** — `src/core/registry.js`. Adding an IDE = one entry, not a new adapter file. Capability differences handled by `null`, not `if/else`.
857
- 2. **Markdown references over copies** — edit the canonical, all targets see it.
858
- 3. **Action-based MCP dispatching** — 6 tools instead of 30+. Small surface, easy to remember.
859
- 4. **CLI ↔ harness ↔ MCP** — `core/` is pure, CLI and MCP are thin transports.
860
-
861
- **Adapted but reshaped:**
862
-
863
- 5. **Failure dataset** — `forensics collect/summarize/write-learnings` aggregates `debug/resolved/`, failed `*-VERIFICATION.md`, `forensics/*` into per-agent learning docs.
864
- 6. **Reflect (LLM pass)** — `forensics reflect` feeds learnings + current agent into an LLM and proposes minimal prompt edits.
865
- 7. **Replays** — `forensics record-replay / load-replay` for tight prompt iteration.
866
- 8. **Gates as named files** — extracted into `gates/*.md` with explicit verdict format. Runnable with `gates run`.
867
-
868
- **Not adapted (over-engineered for a personal kit):**
869
-
870
- - PREVC state machine, role assignments, sensors/contracts/policies/datasets — too much for personal use.
871
- - Built-in agents/skills hardcoded — yours come from your `kit/`.
872
-
873
- ---
874
-
875
- ## Roadmap (open ideas)
876
-
877
- - HTTP transport for IDEs that don't speak stdio MCP.
878
- - `forensics reflect` with diff visual instead of full content.
879
- - `kit gates run --all` aggregating verdicts of every gate at a stage.
880
- - Dependabot config to keep `chokidar` and `@modelcontextprotocol/sdk` current.
881
- - `kit sync watch` exposed via MCP (long-running tool challenge).
882
-
883
- PRs welcome.
884
-
885
- ---
886
-
887
- ## Tests
888
-
889
- Built on `node:test` (zero dependencies). Two suites:
890
-
891
- ```bash
892
- npm test # unit — kit parser, sync (all modes), reverse-sync, gates, registry
893
- npm run test:integration # integration — spawns bin/cli.js end-to-end on a temp project
894
- npm run test:all # both
895
- ```
896
-
897
- Plus the original quick smokes:
898
-
899
- ```bash
900
- node bin/cli.js kit list-agents | head -5 # 47 bundled agents
901
- node bin/cli.js sync targets # 8 IDEs
902
- node bin/cli.js gates list # 20 gates
903
- node bin/cli.js install dry-run claude-code --via npx
904
- ```
905
-
906
- CI runs unit + integration + smoke + MCP boot on Ubuntu / macOS / Windows × Node 20 / 22 on every push and PR.
907
-
908
- ---
909
-
910
- ## License
911
-
912
- MIT — see [LICENSE](LICENSE).
913
-
914
- Copyright © 2026 luanpdd.
1
+ # kit-mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@luanpdd/kit-mcp.svg)](https://www.npmjs.com/package/@luanpdd/kit-mcp)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@luanpdd/kit-mcp.svg)](https://www.npmjs.com/package/@luanpdd/kit-mcp)
5
+ [![CI](https://github.com/luanpdd/kit-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/luanpdd/kit-mcp/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ > Um kit de **agentes, comandos e skills** prontos para Claude Code, Cursor, Codex, Gemini CLI, Windsurf e outros destilado da documentação oficial do Supabase, livros canônicos de engenharia, e técnicas comprovadas de orquestração agêntica.
9
+ >
10
+ > Entregue como **MCP server**. Você usa direto via `npx`, sem instalar nada.
11
+
12
+ <!-- AUTOGEN-COUNTS-START -->
13
+ **Bundled workflow:** 66 agents · 89 commands · 76 skills · 23 gates
14
+ <!-- AUTOGEN-COUNTS-END -->
15
+
16
+ ---
17
+
18
+ ## O que é
19
+
20
+ Quando você usa LLMs em projetos reais, o problema raramente é o modelo é o **contexto**. Skills, agents e slash-commands são o jeito moderno de injetar processo, padrões canônicos e guard-rails no Claude Code (e similares) sem reescrever cada prompt.
21
+
22
+ `kit-mcp` é um **kit curado** que materializa isso em três fontes de verdade:
23
+
24
+ - **Documentação oficial do Supabase** — RLS, branching, Edge Functions, migrations, pgTAP, Custom Claims, Postgres Roles, Storage, Realtime, Cron, pgvector e todas as outras camadas, com anti-pitfalls explícitos.
25
+ - **Livros canônicos** — *Working Effectively with Legacy Code* (Feathers), *Designing Data-Intensive Applications* (Kleppmann), *Observability Engineering* (Majors/Fong-Jones/Miranda) e *Google SRE Book* viraram skills aplicáveis (characterization tests, consistency models, golden signals, eliminating toil).
26
+ - **Técnicas de harness agêntico** — orquestração via slash-commands (`/discutir-fase`, `/planejar-fase`, `/executar-fase`), handoff cooperativo entre agents, gates de pre-verify, replay determinístico, observabilidade do próprio fluxo agêntico.
27
+
28
+ Tudo escrito em **PT-BR**, com tabelas, fluxogramas, exemplos rodáveis e referências cruzadas.
29
+
30
+ ---
31
+
32
+ ## Instalar (sem instalar)
33
+
34
+ Adicione ao `.mcp.json` do seu projeto (ou config global do IDE):
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "kit-mcp": {
40
+ "command": "npx",
41
+ "args": ["-y", "@luanpdd/kit-mcp"]
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ Pronto. Na próxima sessão, o IDE faz `npx` e expõe os 7 tools do kit-mcp. Nada instalado globalmente, sem `npm install`.
48
+
49
+ ### Registrar automaticamente
50
+
51
+ ```bash
52
+ npx -y @luanpdd/kit-mcp install claude-code
53
+ # ou: cursor, codex, gemini-cli, windsurf, antigravity, copilot, trae
54
+ ```
55
+
56
+ ### Projetar skills/agents/commands para o IDE ler
57
+
58
+ ```bash
59
+ npx -y @luanpdd/kit-mcp sync claude-code
60
+ ```
61
+
62
+ Isso escreve markdown em `.claude/agents/`, `.claude/skills/`, etc. O IDE do disco não precisa do server vivo.
63
+
64
+ ### Fluxo completo de primeiro uso
65
+
66
+ ```bash
67
+ npx -y @luanpdd/kit-mcp init
68
+ # 1. registra MCP server no IDE
69
+ # 2. projeta o kit
70
+ # 3. roda diagnóstico
71
+ # 4. confirma: "✓ Claude Code agora vê N skills, M agents, K commands"
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Comandos diários
77
+
78
+ | Comando | Para quê |
79
+ |---|---|
80
+ | `kit-mcp logs --tail --follow` | Ver tool calls do servidor em tempo real (JSONL em `~/.kit-mcp/logs/`) |
81
+ | `kit-mcp status` | p50/p95/p99 + error rate + sidecar status |
82
+ | `kit-mcp doctor` | Diagnóstico completo (versão, sidecar, hooks, IDE config, log dir) |
83
+ | `kit-mcp inspect` | TUI live mostrando request/response do MCP |
84
+ | `kit-mcp replay list \| show <id>` | Inspecionar payloads de agents gravados |
85
+
86
+ ---
87
+
88
+ ## O que a comunidade precisa saber
89
+
90
+ ### Dois fluxos diferentes, mesma origem
91
+
92
+ ```
93
+ ┌─────────────┐ kit sync ┌──────────────────┐
94
+ kit/ │ ──────────▶ │ .claude/agents/ │ IDE lê do disco
95
+ │ (npm pkg) │ (offline, │ .claude/skills/ │ na inicialização
96
+ │ │ one-shot) │ .claude/commands/│
97
+ └─────────────┘ └──────────────────┘
98
+
99
+ ┌──────────────┐ spawns ┌──────────────────┐
100
+ │ Claude Code │ ────────────▶ │ kit-mcp (stdio) │ tools live via
101
+ │ (IDE host) │ stdin/stdout │ 7 tools │ JSON-RPC
102
+ └──────────────┘ ◀──────────── └──────────────────┘
103
+ ```
104
+
105
+ - **`kit sync`** projeta o conteúdo no formato nativo do IDE — funciona offline e o IDE só precisa dos arquivos.
106
+ - **`kit-mcp` (MCP server)** roda como subprocess do IDE e expõe 7 tools (`kit`, `sync`, `gates`, `forensics`, `install`, `metrics-snapshot`, `reverse-sync`).
107
+
108
+ **Sem output no terminal ao rodar `kit-mcp`?** Não é bug. A spec MCP proíbe stdout fora do JSON-RPC. Use `kit-mcp logs --follow` ou o sidecar UI em `http://localhost:7878`.
109
+
110
+ ### Stable API v1.0+ desde v1.13
111
+
112
+ 16 releases sem breaking changes na superfície MCP. Sua config `.mcp.json` continua funcionando.
113
+
114
+ ### Princípio canônico do handoff cooperativo (v1.23+)
115
+
116
+ Agents não-Supabase **planejam**, agents Supabase **materializam/hardenam**, ninguém descarta upstream. `BLOCK` rígido é anti-pattern verdicts são `GO` / `STRENGTHEN` / `REWRITE com confirmação`.
117
+
118
+ ### Defense-in-depth em 10 camadas (Supabase)
119
+
120
+ RLS + Column-Level + Custom Claims + Postgres Roles + Audit Log + LGPD + Super-admin + Realtime auth + Branching + CI/CD. Cada camada documentada com pattern canônico e anti-patterns.
121
+
122
+ ### Convenção PT-BR
123
+
124
+ Skills, agents e commands são em PT-BR. Termos técnicos canônicos (RLS, SLO, characterization tests) ficam em EN para preservar busca e referências.
125
+
126
+ ### Configuração via env vars
127
+
128
+ | Var | Default | O que faz |
129
+ |---|---|---|
130
+ | `KIT_MCP_NO_UI` | unset | `=1` desabilita sidecar UI auto-spawn |
131
+ | `KIT_MCP_LOG_DIR` | `~/.kit-mcp/logs` | Override do log dir |
132
+ | `KIT_MCP_LOG_RETENTION_DAYS` | `7` | Retention (0 = forever) |
133
+ | `KIT_MCP_INSPECT` | unset | `=1` anexa args/result aos eventos log |
134
+ | `KIT_MCP_NOTIFY` | unset | `=1` OS notification em cada tool call |
135
+
136
+ ### Estrutura do kit
137
+
138
+ ```
139
+ kit/
140
+ ├── agents/ 66 agents executáveis (planner, executor, debugger, supabase-rls-hardener, )
141
+ ├── commands/ 89 slash-commands (/discutir-fase, /planejar-fase, /executar-fase, )
142
+ ├── skills/ 76 skills consultáveis (supabase-rls-policies, structured-events, legacy-characterization-tests, …)
143
+ ├── framework/ workflows e templates que os agents delegam
144
+ └── hooks/ PostToolUse hooks (sidecar-tool-publisher, etc)
145
+ ```
146
+
147
+ ### Contribuindo
148
+
149
+ - Issues e PRs: [github.com/luanpdd/kit-mcp](https://github.com/luanpdd/kit-mcp)
150
+ - Skills/agents são markdown puro com frontmatter YAML — editar e abrir PR
151
+ - Antes de mexer em código `src/`, leia o `.planning/` (workflow framework)
152
+
153
+ ### Quando NÃO usar
154
+
155
+ - Você não usa Supabase, Claude Code/Cursor, nem trabalha com agents provavelmente outro kit serve melhor
156
+ - Você quer um framework genérico tipo LangChain — kit-mcp é opinionated, em PT-BR, focado no fluxo Supabase + agêntico
157
+
158
+ ---
159
+
160
+ ## Licença
161
+
162
+ [MIT](LICENSE) use, modifique, fork à vontade.
163
+
164
+ ---
165
+
166
+ **Criado por [Luan PDD](https://github.com/luanpdd)** — engenharia, curadoria de conteúdo e direção do projeto.
167
+
168
+ Inspirado pelo [vinilana/dotcontext](https://github.com/vinilana/dotcontext).