contextdevkit 1.8.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 (345) hide show
  1. package/CHANGELOG.md +592 -0
  2. package/LICENSE +21 -0
  3. package/README.md +401 -0
  4. package/docs/AGENT-PACKAGE-FORMAT.md +140 -0
  5. package/docs/ARCHITECTURE.md +258 -0
  6. package/docs/CHANGELOG.md +559 -0
  7. package/docs/CUSTOMIZING.md +211 -0
  8. package/docs/LEVELS.md +151 -0
  9. package/docs/ROADMAP.md +385 -0
  10. package/docs/SQUAD-PIPELINE-FORMAT.md +258 -0
  11. package/docs/SQUADS/agent-forge.md +65 -0
  12. package/docs/SQUADS/design-team.md +161 -0
  13. package/docs/token-economy-plan.md +135 -0
  14. package/install.mjs +273 -0
  15. package/instrucoes.md +274 -0
  16. package/package.json +46 -0
  17. package/templates/CLAUDE.md.tpl +133 -0
  18. package/templates/claude/agents/_TEMPLATE.md +52 -0
  19. package/templates/claude/agents/accessibility.md +36 -0
  20. package/templates/claude/agents/agent-architect.md +37 -0
  21. package/templates/claude/agents/architect.md +39 -0
  22. package/templates/claude/agents/code-reviewer.md +43 -0
  23. package/templates/claude/agents/code-security.md +59 -0
  24. package/templates/claude/agents/context-keeper.md +40 -0
  25. package/templates/claude/agents/devops.md +40 -0
  26. package/templates/claude/agents/eval-designer.md +40 -0
  27. package/templates/claude/agents/forge-orchestrator.md +42 -0
  28. package/templates/claude/agents/governance-officer.md +45 -0
  29. package/templates/claude/agents/growth.md +92 -0
  30. package/templates/claude/agents/infra-security.md +53 -0
  31. package/templates/claude/agents/landing-architect.md +154 -0
  32. package/templates/claude/agents/model-router.md +34 -0
  33. package/templates/claude/agents/packager.md +38 -0
  34. package/templates/claude/agents/privacy-lgpd.md +64 -0
  35. package/templates/claude/agents/product-owner.md +51 -0
  36. package/templates/claude/agents/prompt-engineer.md +33 -0
  37. package/templates/claude/agents/qa-e2e.md +52 -0
  38. package/templates/claude/agents/qa-fuzzer.md +24 -0
  39. package/templates/claude/agents/qa-integration.md +21 -0
  40. package/templates/claude/agents/qa-orchestrator.md +40 -0
  41. package/templates/claude/agents/qa-perf.md +40 -0
  42. package/templates/claude/agents/qa-unit.md +39 -0
  43. package/templates/claude/agents/rag-designer.md +54 -0
  44. package/templates/claude/agents/retention.md +85 -0
  45. package/templates/claude/agents/security.md +48 -0
  46. package/templates/claude/agents/seo-specialist.md +106 -0
  47. package/templates/claude/agents/test-engineer.md +48 -0
  48. package/templates/claude/agents/tool-designer.md +32 -0
  49. package/templates/claude/agents/ui-designer.md +37 -0
  50. package/templates/claude/agents/ux-designer.md +38 -0
  51. package/templates/claude/commands/README.md +95 -0
  52. package/templates/claude/commands/advise.md +80 -0
  53. package/templates/claude/commands/audit/analyze-code-ia-practices.md +75 -0
  54. package/templates/claude/commands/audit/audit.md +35 -0
  55. package/templates/claude/commands/audit/contract-check.md +21 -0
  56. package/templates/claude/commands/audit/deep-analysis.md +48 -0
  57. package/templates/claude/commands/audit/deps-audit.md +49 -0
  58. package/templates/claude/commands/audit/security-setup.md +35 -0
  59. package/templates/claude/commands/audit/seo-audit.md +63 -0
  60. package/templates/claude/commands/audit/tech-debt-sweep.md +35 -0
  61. package/templates/claude/commands/bug-hunt.md +42 -0
  62. package/templates/claude/commands/claude-md.md +36 -0
  63. package/templates/claude/commands/close-version.md +25 -0
  64. package/templates/claude/commands/context-refresh.md +19 -0
  65. package/templates/claude/commands/context-stats.md +15 -0
  66. package/templates/claude/commands/dashboard.md +66 -0
  67. package/templates/claude/commands/distill-apply.md +19 -0
  68. package/templates/claude/commands/distill-sessions.md +26 -0
  69. package/templates/claude/commands/fleet.md +47 -0
  70. package/templates/claude/commands/forge/forge-audit.md +16 -0
  71. package/templates/claude/commands/forge/forge-budget.md +16 -0
  72. package/templates/claude/commands/forge/forge-deprecate.md +16 -0
  73. package/templates/claude/commands/forge/forge-doctor.md +17 -0
  74. package/templates/claude/commands/forge/forge-eval.md +16 -0
  75. package/templates/claude/commands/forge/forge-fallback-test.md +17 -0
  76. package/templates/claude/commands/forge/forge-killswitch.md +17 -0
  77. package/templates/claude/commands/forge/forge-list.md +17 -0
  78. package/templates/claude/commands/forge/forge-new.md +41 -0
  79. package/templates/claude/commands/forge/forge-policy.md +16 -0
  80. package/templates/claude/commands/forge/forge-redteam.md +17 -0
  81. package/templates/claude/commands/forge/forge-refresh-matrix.md +20 -0
  82. package/templates/claude/commands/forge/forge-route.md +17 -0
  83. package/templates/claude/commands/forge/forge-show.md +16 -0
  84. package/templates/claude/commands/landing-page.md +71 -0
  85. package/templates/claude/commands/log-session.md +59 -0
  86. package/templates/claude/commands/media-gen.md +93 -0
  87. package/templates/claude/commands/new-adr.md +30 -0
  88. package/templates/claude/commands/pipeline/dev-start.md +64 -0
  89. package/templates/claude/commands/pipeline/pipeline.md +36 -0
  90. package/templates/claude/commands/pipeline/resume.md +70 -0
  91. package/templates/claude/commands/pipeline/retro.md +34 -0
  92. package/templates/claude/commands/pipeline/runs.md +63 -0
  93. package/templates/claude/commands/pipeline/ship.md +54 -0
  94. package/templates/claude/commands/pipeline/workflow.md +85 -0
  95. package/templates/claude/commands/playbook.md +27 -0
  96. package/templates/claude/commands/predictions-review.md +28 -0
  97. package/templates/claude/commands/qa/qa-signoff.md +24 -0
  98. package/templates/claude/commands/qa/scaffold-tests.md +27 -0
  99. package/templates/claude/commands/qa/test-plan.md +26 -0
  100. package/templates/claude/commands/qa/visual-test.md +42 -0
  101. package/templates/claude/commands/roadmap.md +48 -0
  102. package/templates/claude/commands/setup/aidevtool-from0.md +104 -0
  103. package/templates/claude/commands/setup/context-config.md +25 -0
  104. package/templates/claude/commands/setup/context-doctor.md +21 -0
  105. package/templates/claude/commands/setup/context-level.md +17 -0
  106. package/templates/claude/commands/setup/setupcontextdevkit.md +121 -0
  107. package/templates/claude/commands/simulate-impact.md +32 -0
  108. package/templates/claude/commands/squad.md +44 -0
  109. package/templates/claude/commands/state.md +21 -0
  110. package/templates/claude/commands/token-report.md +29 -0
  111. package/templates/claude/commands/tune-agents.md +35 -0
  112. package/templates/claude/commands/vcs/claim.md +18 -0
  113. package/templates/claude/commands/vcs/git.md +83 -0
  114. package/templates/claude/commands/vcs/release.md +15 -0
  115. package/templates/claude/commands/vcs/worktree-new.md +18 -0
  116. package/templates/claude/commands/watch.md +47 -0
  117. package/templates/contextkit/.env.example +36 -0
  118. package/templates/contextkit/CLAUDE.child.md.tpl +38 -0
  119. package/templates/contextkit/README.md +74 -0
  120. package/templates/contextkit/behaviors-examples.md +183 -0
  121. package/templates/contextkit/behaviors.md +116 -0
  122. package/templates/contextkit/best-practices.md +323 -0
  123. package/templates/contextkit/config.json +66 -0
  124. package/templates/contextkit/detectors/README.md +45 -0
  125. package/templates/contextkit/detectors/example-detector.mjs.example +25 -0
  126. package/templates/contextkit/instrucoes.md +114 -0
  127. package/templates/contextkit/memory/GLOSSARY.md +13 -0
  128. package/templates/contextkit/memory/SESSIONS.md +9 -0
  129. package/templates/contextkit/memory/WORKSPACE.md +7 -0
  130. package/templates/contextkit/memory/business-rules/_TEMPLATE.md +33 -0
  131. package/templates/contextkit/memory/decisions/0000-record-architecture-decisions.md +34 -0
  132. package/templates/contextkit/memory/decisions/_TEMPLATE.md +25 -0
  133. package/templates/contextkit/memory/predictions/.gitkeep +0 -0
  134. package/templates/contextkit/memory/roadmap.md +28 -0
  135. package/templates/contextkit/memory/sessions/.gitkeep +0 -0
  136. package/templates/contextkit/memory/workflows/.gitkeep +0 -0
  137. package/templates/contextkit/pipeline/backlog/.gitkeep +0 -0
  138. package/templates/contextkit/pipeline/conclusion/.gitkeep +0 -0
  139. package/templates/contextkit/pipeline/devpipeline.md +9 -0
  140. package/templates/contextkit/pipeline/testing/.gitkeep +0 -0
  141. package/templates/contextkit/pipeline/working/.gitkeep +0 -0
  142. package/templates/contextkit/review-protocol.md +214 -0
  143. package/templates/contextkit/runtime/config/defaults.mjs +215 -0
  144. package/templates/contextkit/runtime/config/levels.mjs +42 -0
  145. package/templates/contextkit/runtime/config/load.mjs +105 -0
  146. package/templates/contextkit/runtime/config/paths.mjs +92 -0
  147. package/templates/contextkit/runtime/config/presets.mjs +47 -0
  148. package/templates/contextkit/runtime/config/schema.mjs +88 -0
  149. package/templates/contextkit/runtime/config/settings-compose.mjs +55 -0
  150. package/templates/contextkit/runtime/git-hooks/commit-msg.mjs +55 -0
  151. package/templates/contextkit/runtime/git-hooks/pre-commit.mjs +47 -0
  152. package/templates/contextkit/runtime/git-hooks/pre-push.mjs +102 -0
  153. package/templates/contextkit/runtime/hooks/boot-context-readers.mjs +111 -0
  154. package/templates/contextkit/runtime/hooks/boot-signals.mjs +135 -0
  155. package/templates/contextkit/runtime/hooks/check-registration.mjs +228 -0
  156. package/templates/contextkit/runtime/hooks/concurrency-guard.mjs +110 -0
  157. package/templates/contextkit/runtime/hooks/ledger.mjs +231 -0
  158. package/templates/contextkit/runtime/hooks/md-extract.mjs +65 -0
  159. package/templates/contextkit/runtime/hooks/path-classification.mjs +62 -0
  160. package/templates/contextkit/runtime/hooks/safe-io.mjs +84 -0
  161. package/templates/contextkit/runtime/hooks/session-digest-core.mjs +85 -0
  162. package/templates/contextkit/runtime/hooks/session-start.mjs +248 -0
  163. package/templates/contextkit/runtime/hooks/simulate-gate.mjs +108 -0
  164. package/templates/contextkit/runtime/hooks/track-edits.mjs +154 -0
  165. package/templates/contextkit/runtime/providers/media/_adapter.mjs +120 -0
  166. package/templates/contextkit/runtime/providers/media/nano-banana.mjs +110 -0
  167. package/templates/contextkit/runtime/providers/media/veo.mjs +162 -0
  168. package/templates/contextkit/runtime/providers/review/_adapter.mjs +71 -0
  169. package/templates/contextkit/runtime/providers/review/detect.mjs +115 -0
  170. package/templates/contextkit/runtime/providers/review/gh.mjs +103 -0
  171. package/templates/contextkit/runtime/state/state-io.mjs +172 -0
  172. package/templates/contextkit/runtime/statusline.mjs +51 -0
  173. package/templates/contextkit/squads/README.md +115 -0
  174. package/templates/contextkit/squads/_BRIEFING.md.tpl +27 -0
  175. package/templates/contextkit/squads/agent-forge/README.md +69 -0
  176. package/templates/contextkit/squads/agent-forge/ROADMAP.md +108 -0
  177. package/templates/contextkit/squads/agent-forge/best-practices.md +89 -0
  178. package/templates/contextkit/squads/agent-forge/cli/forge-admin.mjs +132 -0
  179. package/templates/contextkit/squads/agent-forge/cli/forge-eval-cli.mjs +163 -0
  180. package/templates/contextkit/squads/agent-forge/cli/forge-new.mjs +97 -0
  181. package/templates/contextkit/squads/agent-forge/cli/forge-ops.mjs +177 -0
  182. package/templates/contextkit/squads/agent-forge/lib/architect.mjs +112 -0
  183. package/templates/contextkit/squads/agent-forge/lib/eval-designer.mjs +133 -0
  184. package/templates/contextkit/squads/agent-forge/lib/eval-runner.mjs +167 -0
  185. package/templates/contextkit/squads/agent-forge/lib/governance-officer.mjs +178 -0
  186. package/templates/contextkit/squads/agent-forge/lib/package-ops.mjs +101 -0
  187. package/templates/contextkit/squads/agent-forge/lib/packager.mjs +219 -0
  188. package/templates/contextkit/squads/agent-forge/lib/prompt-gen.mjs +122 -0
  189. package/templates/contextkit/squads/agent-forge/lib/rag-designer.mjs +102 -0
  190. package/templates/contextkit/squads/agent-forge/lib/router.mjs +165 -0
  191. package/templates/contextkit/squads/agent-forge/lib/tool-gen.mjs +113 -0
  192. package/templates/contextkit/squads/agent-forge/lib/yaml.mjs +47 -0
  193. package/templates/contextkit/squads/agent-forge/pipeline.yaml +65 -0
  194. package/templates/contextkit/squads/agent-forge/router/capability-matrix.json +112 -0
  195. package/templates/contextkit/squads/agent-forge/router/decision-rules.json +120 -0
  196. package/templates/contextkit/squads/agent-forge/templates/agent-package/.agentforgerc +12 -0
  197. package/templates/contextkit/squads/agent-forge/templates/agent-package/CHANGELOG.md +13 -0
  198. package/templates/contextkit/squads/agent-forge/templates/agent-package/LICENSE +5 -0
  199. package/templates/contextkit/squads/agent-forge/templates/agent-package/README.md +39 -0
  200. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/README.md +10 -0
  201. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/agent.go +14 -0
  202. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/go.mod +3 -0
  203. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/README.md +11 -0
  204. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/index.js +53 -0
  205. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/package.json +9 -0
  206. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/README.md +10 -0
  207. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/agent.py +16 -0
  208. package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/pyproject.toml +10 -0
  209. package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/golden.jsonl +1 -0
  210. package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/red-team.jsonl +3 -0
  211. package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/rubric.yaml +14 -0
  212. package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/run-eval.md +17 -0
  213. package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/thresholds.yaml +18 -0
  214. package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/basic.node.md +17 -0
  215. package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/with-fallback.node.md +24 -0
  216. package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/with-rag.python.md +20 -0
  217. package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/audit.schema.json +23 -0
  218. package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/compliance.policy.yaml +43 -0
  219. package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/cost.policy.yaml +36 -0
  220. package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/fallback-chain.yaml +16 -0
  221. package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/quality.policy.yaml +43 -0
  222. package/templates/contextkit/squads/agent-forge/templates/agent-package/manifest.yaml +91 -0
  223. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.anthropic.md +19 -0
  224. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.canonical.md +25 -0
  225. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.deepseek.md +21 -0
  226. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.google.md +19 -0
  227. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.ollama.md +21 -0
  228. package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.openai.md +20 -0
  229. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/config.yaml +17 -0
  230. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/index/.gitkeep +3 -0
  231. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/ingestion/chunker.config.yaml +6 -0
  232. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/ingestion/sources.yaml +8 -0
  233. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/retrieval/query-template.md +16 -0
  234. package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/retrieval/rerank.config.yaml +6 -0
  235. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/anthropic.tools.json +11 -0
  236. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/deepseek.tools.json +14 -0
  237. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/google.tools.json +11 -0
  238. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/ollama.tools.json +14 -0
  239. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/openai.tools.json +14 -0
  240. package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/schemas.canonical.json +25 -0
  241. package/templates/contextkit/starters/tanstack/README.md +86 -0
  242. package/templates/contextkit/starters/tanstack/index.html +12 -0
  243. package/templates/contextkit/starters/tanstack/package.json +25 -0
  244. package/templates/contextkit/starters/tanstack/src/main.tsx +40 -0
  245. package/templates/contextkit/starters/tanstack/src/router.tsx +12 -0
  246. package/templates/contextkit/starters/tanstack/src/routes/__root.tsx +10 -0
  247. package/templates/contextkit/starters/tanstack/src/routes/index.tsx +17 -0
  248. package/templates/contextkit/starters/tanstack/tsconfig.json +19 -0
  249. package/templates/contextkit/starters/tanstack/vite.config.ts +10 -0
  250. package/templates/contextkit/tools/scripts/adr-digest-core.mjs +42 -0
  251. package/templates/contextkit/tools/scripts/adr-digest.mjs +78 -0
  252. package/templates/contextkit/tools/scripts/agent-tuning.mjs +74 -0
  253. package/templates/contextkit/tools/scripts/aiso-audit.mjs +174 -0
  254. package/templates/contextkit/tools/scripts/audit-shared.mjs +129 -0
  255. package/templates/contextkit/tools/scripts/claim.mjs +133 -0
  256. package/templates/contextkit/tools/scripts/claude-md.mjs +123 -0
  257. package/templates/contextkit/tools/scripts/clean-drive.mjs +78 -0
  258. package/templates/contextkit/tools/scripts/context-config.mjs +111 -0
  259. package/templates/contextkit/tools/scripts/context-level.mjs +98 -0
  260. package/templates/contextkit/tools/scripts/context-pack.mjs +120 -0
  261. package/templates/contextkit/tools/scripts/contract-scan.mjs +186 -0
  262. package/templates/contextkit/tools/scripts/dashboard-data.mjs +198 -0
  263. package/templates/contextkit/tools/scripts/dashboard-html.mjs +215 -0
  264. package/templates/contextkit/tools/scripts/dashboard-server.mjs +129 -0
  265. package/templates/contextkit/tools/scripts/dashboard.mjs +107 -0
  266. package/templates/contextkit/tools/scripts/deep-analysis.mjs +62 -0
  267. package/templates/contextkit/tools/scripts/deps-audit.mjs +201 -0
  268. package/templates/contextkit/tools/scripts/detect-stack.mjs +164 -0
  269. package/templates/contextkit/tools/scripts/distill-detect.mjs +90 -0
  270. package/templates/contextkit/tools/scripts/doctor.mjs +165 -0
  271. package/templates/contextkit/tools/scripts/fleet.mjs +170 -0
  272. package/templates/contextkit/tools/scripts/generate-context.mjs +142 -0
  273. package/templates/contextkit/tools/scripts/gh-alerts.mjs +117 -0
  274. package/templates/contextkit/tools/scripts/git.mjs +97 -0
  275. package/templates/contextkit/tools/scripts/home.mjs +106 -0
  276. package/templates/contextkit/tools/scripts/mark-simulation.mjs +78 -0
  277. package/templates/contextkit/tools/scripts/media-gen.mjs +154 -0
  278. package/templates/contextkit/tools/scripts/pipeline-board.mjs +74 -0
  279. package/templates/contextkit/tools/scripts/pipeline-prioritize.mjs +68 -0
  280. package/templates/contextkit/tools/scripts/pipeline-session.mjs +99 -0
  281. package/templates/contextkit/tools/scripts/pipeline-validate.mjs +136 -0
  282. package/templates/contextkit/tools/scripts/pipeline.mjs +302 -0
  283. package/templates/contextkit/tools/scripts/playbook.mjs +123 -0
  284. package/templates/contextkit/tools/scripts/predictions-review.mjs +113 -0
  285. package/templates/contextkit/tools/scripts/release.mjs +60 -0
  286. package/templates/contextkit/tools/scripts/resume.mjs +114 -0
  287. package/templates/contextkit/tools/scripts/roadmap.mjs +86 -0
  288. package/templates/contextkit/tools/scripts/runs.mjs +116 -0
  289. package/templates/contextkit/tools/scripts/seo-audit.mjs +150 -0
  290. package/templates/contextkit/tools/scripts/session-digest.mjs +89 -0
  291. package/templates/contextkit/tools/scripts/session-reindex.mjs +91 -0
  292. package/templates/contextkit/tools/scripts/setup-complete.mjs +69 -0
  293. package/templates/contextkit/tools/scripts/squad-meta.mjs +23 -0
  294. package/templates/contextkit/tools/scripts/squad-pipeline-condition.mjs +192 -0
  295. package/templates/contextkit/tools/scripts/squad-pipeline.mjs +301 -0
  296. package/templates/contextkit/tools/scripts/squad.mjs +80 -0
  297. package/templates/contextkit/tools/scripts/stats.mjs +138 -0
  298. package/templates/contextkit/tools/scripts/sync-check.mjs +235 -0
  299. package/templates/contextkit/tools/scripts/tech-debt-detectors.mjs +76 -0
  300. package/templates/contextkit/tools/scripts/tech-debt-scan.mjs +164 -0
  301. package/templates/contextkit/tools/scripts/token-report.mjs +153 -0
  302. package/templates/contextkit/tools/scripts/visual-test.mjs +132 -0
  303. package/templates/contextkit/tools/scripts/watch.mjs +106 -0
  304. package/templates/contextkit/tools/scripts/workflow.mjs +136 -0
  305. package/templates/contextkit/tools/scripts/workspace-sync.mjs +220 -0
  306. package/templates/contextkit/tools/scripts/worktree-new.mjs +50 -0
  307. package/templates/contextkit/workflows/L1-static-loading.md +59 -0
  308. package/templates/contextkit/workflows/L2-session-ledger.md +86 -0
  309. package/templates/contextkit/workflows/L3-multi-session.md +80 -0
  310. package/templates/contextkit/workflows/L4-squads.md +68 -0
  311. package/templates/contextkit/workflows/L5-proactive.md +88 -0
  312. package/templates/contextkit/workflows/README.md +47 -0
  313. package/templates/contextkit/workflows/playbooks/distillation-cycle.md +74 -0
  314. package/templates/contextkit/workflows/playbooks/landing-page.md +197 -0
  315. package/templates/contextkit/workflows/playbooks/security-batch.md +68 -0
  316. package/templates/contextkit/workflows/playbooks/seo-aiso.md +288 -0
  317. package/templates/contextkit/workflows/playbooks/simulate-impact.md +83 -0
  318. package/templates/contextkit/workflows/playbooks/tanstack.md +164 -0
  319. package/templates/contextkit/workflows/playbooks/tech-debt-sweep.md +77 -0
  320. package/templates/docs/CHANGELOG.md.tpl +11 -0
  321. package/templates/gitattributes +3 -0
  322. package/templates/github/ISSUE_TEMPLATE/bug_report.md +30 -0
  323. package/templates/github/ISSUE_TEMPLATE/feature_request.md +22 -0
  324. package/templates/github/PULL_REQUEST_TEMPLATE.md +27 -0
  325. package/templates/github/dependabot.yml +27 -0
  326. package/templates/github/workflows/quality.yml +36 -0
  327. package/templates/github/workflows/security.yml +54 -0
  328. package/tools/install/cli.mjs +62 -0
  329. package/tools/install/fs.mjs +56 -0
  330. package/tools/install/git.mjs +114 -0
  331. package/tools/install/project.mjs +51 -0
  332. package/tools/install/uninstall.mjs +54 -0
  333. package/tools/integration-test-compozy.mjs +88 -0
  334. package/tools/integration-test-guards.mjs +269 -0
  335. package/tools/integration-test-tooling-agent-forge.mjs +189 -0
  336. package/tools/integration-test-tooling-pipeline.mjs +164 -0
  337. package/tools/integration-test-tooling.mjs +172 -0
  338. package/tools/integration-test.mjs +228 -0
  339. package/tools/it-helpers.mjs +60 -0
  340. package/tools/selfcheck-agent-forge-ops.mjs +107 -0
  341. package/tools/selfcheck-agent-forge.mjs +304 -0
  342. package/tools/selfcheck-config.mjs +80 -0
  343. package/tools/selfcheck-runtime.mjs +135 -0
  344. package/tools/selfcheck-source.mjs +326 -0
  345. package/tools/selfcheck.mjs +268 -0
package/instrucoes.md ADDED
@@ -0,0 +1,274 @@
1
+ # ContextDevKit — Guia de Uso (pt-BR)
2
+
3
+ > Guia prático em português. **Comandos, caminhos e chaves de config** ficam em
4
+ > inglês de propósito (é o "principal" do projeto) — só a explicação é em pt-BR.
5
+
6
+ ## O que é
7
+
8
+ O ContextDevKit transforma "AI-assisted coding" em **engenharia**: em vez de torcer para a
9
+ IA lembrar do contexto, o kit faz o ambiente (hooks do Claude Code) **forçar**
10
+ boas práticas e guardar o histórico no próprio repositório. Funciona em qualquer
11
+ projeto — do zero (greenfield) ou já existente, qualquer stack.
12
+
13
+ ## Novidades na v1.7
14
+
15
+ | Feature | O que faz |
16
+ |---|---|
17
+ | **Skills de landing-page** ([ADR-0023](contextkit/memory/decisions/0023-landing-page-and-conversion-posture.md)) | Agente `landing-architect` + comando `/landing-page` + playbook anti-Lovable opinionado (regras de dobras: mín 3 / ideal 5–7 / máx 9; recomendações de pacotes datadas) |
18
+ | **Geração de mídia** ([ADR-0024](contextkit/memory/decisions/0024-media-generation-veo-nano-banana.md)) | `/media-gen` com adapters Veo (vídeo) + Nano Banana (imagem); credenciais via `.env`; recusa-sem-credencial + cap de custo por processo |
19
+ | **SEO + AISO** ([ADR-0025](contextkit/memory/decisions/0025-seo-and-aiso-posture.md)) | Agente `seo-specialist` + `/seo-audit` com 16 checagens estáticas (SEO + AI Search Optimization); recusa SPA não-indexável |
20
+ | **GitHub sync awareness** ([ADR-0026](contextkit/memory/decisions/0026-github-sync-awareness-dev-flow.md)) | `sync-check.mjs` mostra PRs abertos com status de CI/review no `/dev-start` + detecta PR duplicado antes do push |
21
+ | **`/dashboard`** | Estado visual do projeto (kanban + ADRs + sessões + roadmap) — HTML único auto-contido ou modo `--watch` com SSE em tempo real |
22
+ | **`/watch`** | Acompanha o ledger da sessão atual em tempo real; `--follow` faz streaming |
23
+ | **`/workflow`** | Macro que encadeia roadmap → ADR → pipeline → ship com breadcrumbs |
24
+ | **`/resume`** | Re-vincula a uma sessão drift que ficou sem registro |
25
+ | **`/runs`** | Lista transições de tarefas + runs do pipeline entre squads |
26
+ | **Provider adapters** | `runtime/providers/review/` (gh) + `runtime/providers/media/` (Veo + Nano Banana) — mesmo contrato de 5 pontos |
27
+ | **Task metadata v2** | DAG estrito `dependencies: []` + `complexity: S\|M\|L\|XL` + tipos `spike` e `docs` |
28
+
29
+ ## Instalação
30
+
31
+ ```bash
32
+ # do npm (recomendado)
33
+ npx contextdevkit --target . --yes
34
+
35
+ # ou direto do GitHub (sem npm)
36
+ npx github:reiTavares/ContextDevKit --target . --yes
37
+ ```
38
+
39
+ Depois, abra o projeto no Claude Code, aprove os hooks uma vez. Um banner de
40
+ "first run" aparece no boot e te roteia:
41
+
42
+ - **Projeto vazio (do zero):** rode **`/aidevtool-from0`** — questionário de
43
+ produto interativo → visão, stack (sugere/refina), **roadmap**, boas práticas
44
+ e DevPipeline. Ele te acompanha e fica ativo conforme o projeto cresce.
45
+ - **Projeto existente:** rode **`/setupcontextdevkit`** — detecta a stack, ajusta o
46
+ config, preenche o `CLAUDE.md`, marca paths de risco, **procura/propõe o
47
+ roadmap**, cria um ADR base e registra a sessão.
48
+
49
+ ## Os 7 níveis (suba conforme a confiança)
50
+
51
+ | Nível | O que ativa |
52
+ | --- | --- |
53
+ | **L1 Memory** | contexto no boot, `/log-session`, ADRs, changelog |
54
+ | **L2 Ledger** | detecção de drift (recomendado começar aqui) |
55
+ | **L3 Multi** | claims, worktrees, índices auto-gerados, git hooks (Conventional Commits + pre-push que bloqueia conflito real) |
56
+ | **L4 Squads** | sub-agentes especializados — devteam, qa-team, design-team (5 specialists com `seo-specialist` + `landing-architect`), compliance, ops |
57
+ | **L5 Proactive** | gate `/simulate-impact`, `/tech-debt-sweep`, `/contract-check`, distill nudge |
58
+ | **L6 Autonomy** | pipeline `/ship`, learning loop `/retro`, métricas `/context-stats`, squad agent-forge |
59
+ | **L7 Ecosystem** | `/fleet` (multi-repo), `/tune-agents`, testes visuais, playbook runner |
60
+
61
+ Trocar de nível (de dentro do projeto):
62
+
63
+ ```
64
+ /context-level 4 # ou: node contextkit/tools/scripts/context-level.mjs 4
65
+ ```
66
+
67
+ Reinicie o Claude Code depois de trocar (ele recarrega os hooks). O instalador
68
+ escolhe **L3 pra projeto vazio / L7 pra projeto existente** automaticamente.
69
+
70
+ ## Comandos por finalidade
71
+
72
+ ### Contexto e registro
73
+ - `/state` — resumo do estado atual.
74
+ - `/log-session` — registra a sessão (use **no fim**). O Stop hook cobra você.
75
+ - `/new-adr <título>` — cria um ADR **antes** de uma decisão grande.
76
+ - `/close-version <x.y.z>` — fecha versão no CHANGELOG.
77
+ - `/context-refresh` — gera o snapshot completo do projeto.
78
+ - `/resume <session-id>` — re-vincula a uma sessão drift não registrada.
79
+
80
+ ### Modos de trabalho
81
+ - `/dev-start <objetivo>` — sessão focada; trava o escopo. Roda `sync-check preflight` antes (mostra PRs abertos com status).
82
+ - `/bug-hunt <sintoma>` — investiga a causa raiz antes de escrever feature.
83
+ - `/workflow new <slug>` — macro: roadmap → ADR → pipeline → ship com breadcrumbs.
84
+ - `/ship <feature>` — pipeline completo: design → implementa → review → testa → registra.
85
+ - `/audit` — auditoria geral (doctor + métricas + tech-debt + QA + drift).
86
+
87
+ ### Coordenação (L3)
88
+ - `/claim <path>` / `/release` — reserva/libera área para sessões paralelas.
89
+ - `/worktree-new <feature>` — cria worktree isolado para outra sessão.
90
+ - `/git` — workflow Git (Conventional Commits, PR, conectar remoto GitHub/GitLab).
91
+
92
+ ### Visual (L1+)
93
+ - `/dashboard` — estado do projeto em HTML auto-contido (kanban + ADRs +
94
+ sessões). `--watch` sobe servidor em `127.0.0.1:4242` com atualização em tempo
95
+ real via SSE.
96
+ - `/watch` — acompanha edits da sessão atual. `--follow` faz streaming.
97
+ - `/runs` — lista runs recentes (tarefas + pipeline) entre squads.
98
+
99
+ ### Qualidade (L4/L5)
100
+ - `/test-plan` · `/scaffold-tests` · `/qa-signoff` — squad de QA.
101
+ - `/simulate-impact <objetivo>` — mapeia blast radius antes de mexer em path de risco.
102
+ - `/tech-debt-sweep [quick]` — scanner determinístico + interpretação.
103
+ - `/analyze-code-ia-practices` — auditoria de boas práticas + refactor inteligente.
104
+ - `/contract-check [--save]` — detecta quebra de contrato (exports removidos).
105
+ - `/visual-test` — testes visuais (qa-e2e + design-team).
106
+
107
+ ### Auditoria (pack `audit/`)
108
+ - `/audit` · `/deep-analysis` · `/security-setup` · `/deps-audit`
109
+ - `/tech-debt-sweep` · `/analyze-code-ia-practices` · `/contract-check`
110
+ - **`/seo-audit`** *(novo)* — roda SEO + AISO; falha em `SPA_ENTRYPOINT` crítico.
111
+
112
+ ### Landing pages e mídia *(novo)*
113
+ - **`/landing-page <briefing>`** — invoca o `landing-architect`: decide
114
+ indexabilidade primeiro, escolhe fold count (3/5–7/9), recusa cookie-cutter,
115
+ monta plano com pacotes datados (Astro, Tailwind, Motion, Lucide, Plausible,
116
+ GrowthBook) e budget de performance.
117
+ - **`/media-gen image|video --prompt "..." --out PATH`** — gera imagem (Nano
118
+ Banana / Imagen 3) ou vídeo (Veo 3) via Google AI Studio. `.env.example` no
119
+ kit com `GOOGLE_AI_API_KEY` comentado. `--dry-run` testa sem custo.
120
+
121
+ ### Produto e execução
122
+ - `/roadmap` — plano de produto (o quê/porquê). Cria com você num projeto novo;
123
+ acha/propõe num existente.
124
+ - `/pipeline` — DevPipeline (execução): bugs/increments/chores com prioridade,
125
+ SLA, **DAG de dependências** e complexidade fluindo `backlog → working → testing → conclusion`.
126
+ - `/retro` — learning loop (L6).
127
+ - `/context-stats` — métricas (sessões, drift rate, ADRs, cadência).
128
+ - `/distill-sessions` + `/distill-apply` — propõe/aplica refinamentos no `CLAUDE.md`.
129
+ - `/playbook list|run|track` — registro de procedimentos reutilizáveis.
130
+
131
+ ### Estrutura e plataforma
132
+ - `/squad` — mostra/roteia/cria os **squads** (devteam, qa-team, design-team,
133
+ compliance-LGPD, ops-team, agent-forge L6+).
134
+ - `/claude-md` — garante `CLAUDE.md` próprio em cada app/módulo.
135
+ - `/fleet list|add|stats|audit` *(L7)* — control plane multi-repo.
136
+ - `/tune-agents` *(L6)* — refina briefings de agentes (proposal-only).
137
+ - `/context-doctor` — diagnóstico do install.
138
+ - `/context-config show|set` — lê/edita `contextkit/config.json`.
139
+ - `/context-level [1-7]` — vê/troca o nível.
140
+
141
+ ### Agent-forge *(L6+)* — "o agente que constrói agentes"
142
+ 14 comandos `forge-*` para o ciclo de vida de Agent Packages portáveis:
143
+ `/forge-new` + `forge-{list,show,doctor,policy,budget,audit,eval,redteam,
144
+ route,fallback-test,refresh-matrix,killswitch,deprecate}`.
145
+
146
+ ## Squads — sub-agentes organizados por domínio
147
+
148
+ | Squad | Specialists | Quando |
149
+ |---|---|---|
150
+ | **devteam** | `architect`, `code-reviewer`, `context-keeper`, `test-engineer` | Design cross-cutting + revisão de PR + higiene de memória |
151
+ | **qa-team** | `qa-orchestrator` + unit/integration/fuzzer/perf/e2e | Estratégia + execução de testes |
152
+ | **design-team** | `ui-designer`, `ux-designer`, `accessibility`, **`seo-specialist`** *(v1.7)*, **`landing-architect`** *(v1.7)* | UI/UX, WCAG AA, SEO+AISO, landing pages de alta conversão |
153
+ | **security-team** | `security`, `code-security`, `infra-security` | Auth, segredos, deps, IaC, supply chain |
154
+ | **compliance-team** | `privacy-lgpd`, `governance-officer` | LGPD, políticas |
155
+ | **ops-team** | `devops` | CI/CD, deploys, ambientes, observabilidade |
156
+ | **agent-forge** *(L6+)* | `forge-orchestrator`, `model-router`, `prompt-engineer`, `tool-designer`, `eval-designer`, `packager`, `rag-designer`, `agent-architect` | Pipeline para construir Agent Packages portáveis |
157
+
158
+ Crie os seus a partir de `_BRIEFING.md.tpl` via `/squad`.
159
+
160
+ ## Playbooks
161
+
162
+ Procedimentos reutilizáveis em `contextkit/workflows/playbooks/`. Roda com
163
+ `/playbook run <nome>` ou lê sob demanda:
164
+
165
+ | Playbook | Autoridade | O que cobre |
166
+ |---|---|---|
167
+ | **`landing-page.md`** | ADR-0023 | Regras de dobras, refusals anti-Lovable, recomendações de pacotes datadas, Core Web Vitals |
168
+ | **`seo-aiso.md`** | ADR-0025 | Checklist SEO + checklist AISO (`llms.txt`, FAQ schema, semantic HTML5, detecção de robots.txt bloqueando AI crawlers) |
169
+ | **`tanstack.md`** | ADR-0017 | Família TanStack (Query/Router/Table/Form/Virtual/Start), disciplina de cache key, params tipados |
170
+ | **`simulate-impact.md`** | L5 gate | Mapear blast radius antes de mexer em path de risco |
171
+ | **`tech-debt-sweep.md`** | L5 audit | Scan determinístico da constituição + interpretação |
172
+ | **`distillation-cycle.md`** | L5 retro | Propor refinamentos do CLAUDE.md a partir do histórico |
173
+ | **`security-batch.md`** | security-team | Lote de findings de segurança → ADRs + backlog |
174
+
175
+ ## Provider adapters — surface plugável
176
+
177
+ ### Review providers (`contextkit/runtime/providers/review/`)
178
+ Adapters thin sobre CLIs já instalados no host. Hoje: **`gh`** (GitHub CLI).
179
+ Adicionar GitLab/Bitbucket é criar `glab.mjs`/`bb.mjs` seguindo o contrato em
180
+ `_adapter.mjs`. `detect.mjs` resolve qual adapter usar a partir de `git remote get-url origin`.
181
+
182
+ ### Media providers (`contextkit/runtime/providers/media/`) *(novo)*
183
+ Dois adapters Google AI Studio:
184
+
185
+ | Adapter | Tipo | Auth | Custo (datado 2026-06-02) |
186
+ |---|---|---|---|
187
+ | **`nano-banana`** | imagem (Imagen 3) | `GOOGLE_AI_API_KEY` | ~$0,04 / imagem |
188
+ | **`veo`** | vídeo (Veo 3) | `GOOGLE_AI_API_KEY` | ~$0,50 / segundo |
189
+
190
+ Setup uma vez:
191
+ 1. Pega chave em https://aistudio.google.com/apikey
192
+ 2. Copia `contextkit/.env.example` pra `contextkit/.env`, cola a chave em `GOOGLE_AI_API_KEY=`
193
+ 3. (Opcional) `CONTEXTDEVKIT_MEDIA_MAX_USD=5.00` pra capar custo por processo
194
+ 4. Roda com `node --env-file=contextkit/.env contextkit/tools/scripts/media-gen.mjs ...` (Node 20.6+)
195
+
196
+ Refusa de cara sem credencial (rule 8 — default refuse), nunca substitui por
197
+ placeholder silenciosamente.
198
+
199
+ ## Fluxo recomendado por sessão
200
+
201
+ 1. Abra o projeto no Claude Code — o boot injeta o contexto sozinho.
202
+ 2. `/state` para um resumo rápido (opcional).
203
+ 3. `/dev-start <objetivo>` se for sessão focada (mostra PRs abertos via sync-check).
204
+ 4. Trabalhe. Decisão arquitetural? `/new-adr` **antes** de implementar.
205
+ 5. Mexendo em path de risco no L5? `/simulate-impact` antes.
206
+ 6. Quer visualizar o estado? `/dashboard --watch` em outra aba.
207
+ 7. No fim: `/log-session`. Ao fechar uma fase: `/close-version`.
208
+ 8. Periodicamente: `/audit`.
209
+
210
+ ## Boas práticas
211
+
212
+ - **Onde começar:** projeto **novo/vazio** (context-code do zero) → **L3**; projeto
213
+ que **já tem código** → **L7** (use tudo; os gates ficam inertes até configurar
214
+ `highRiskPaths`). O instalador já escolhe L3/L7. Ajuste com `/context-level <n>`.
215
+ - **ADR antes de decidir grande.** Stack, biblioteca, padrão → `/new-adr`. ADR
216
+ aceito é **imutável**; para mudar, crie outro que o substitua.
217
+ - **Registre a sessão.** O `drift rate` no `/context-stats` mostra se você está
218
+ esquecendo o `/log-session`. Se perdeu o registro, `/resume`.
219
+ - **Ajuste os paths ao seu stack.** Edite `contextkit/config.json` → `ledger.*`
220
+ (ou `/context-config`). Python → `app/`, `tests/`; Go → `cmd/`, `internal/`.
221
+ - **Preencha o `CLAUDE.md`.** As regras imutáveis e a constituição de código são
222
+ o que mais melhora a qualidade do que a IA produz. Mantenha-o curto.
223
+ - **Não edite arquivos gerados** (`SESSIONS.md`, `WORKSPACE.md`,
224
+ `tech-debt-board.md`, `dashboard.html`) — são regenerados.
225
+ - **Sessões paralelas → worktree** (`/worktree-new`), nunca dois chats no mesmo
226
+ diretório.
227
+ - **Landing page?** Use `/landing-page` antes de codar — ele recusa SPA puro,
228
+ define fold count, escolhe pacotes da rec table datada e delega imagery pra
229
+ `/media-gen` (não usa stock photos genéricas).
230
+
231
+ ## Manutenção
232
+
233
+ ```bash
234
+ node contextkit/tools/scripts/doctor.mjs # saúde do install
235
+ node contextkit/tools/scripts/stats.mjs # métricas
236
+ node contextkit/tools/scripts/tech-debt-scan.mjs --write
237
+ node contextkit/tools/scripts/generate-context.mjs # snapshot p/ refactor/IA externa
238
+ node contextkit/tools/scripts/dashboard.mjs # visual do estado
239
+ ```
240
+
241
+ **Atualizar com segurança (sem perder nada):**
242
+ ```bash
243
+ npx contextdevkit@latest --target . --update
244
+ ```
245
+ Atualiza só o engine + slash commands + wiring dos hooks para o **nível atual**.
246
+ **Nunca** toca em `CLAUDE.md`, `contextkit/config.json`, memória (ADRs/sessões/
247
+ roadmap), tarefas do pipeline, nem nos `CLAUDE.md` de cada módulo. (Offline/
248
+ GitHub: `npx github:reiTavares/ContextDevKit --target . --update`.)
249
+
250
+ Desinstalar: `node <kit>/install.mjs --target . --uninstall` (mantém a memória;
251
+ `--purge` também remove o engine).
252
+
253
+ ## Solução de problemas
254
+
255
+ - **Hook não dispara / pede aprovação** — aprove uma vez por hook; reinicie o
256
+ Claude Code após trocar de nível.
257
+ - **Wiring fora do nível** — `/context-doctor` aponta; corrija com `/context-level <n>`.
258
+ - **JSON do config quebrado** — os hooks caem nos defaults (não travam); conserte
259
+ o arquivo (o loader tolera BOM do Windows).
260
+ - **Git hooks no Windows** — precisam do Git for Windows (usam `#!/bin/sh`).
261
+ - **`/media-gen` reclama de `NO_CREDENTIALS`** — preencha `GOOGLE_AI_API_KEY` em
262
+ `contextkit/.env` (template em `contextkit/.env.example`) e rode com `node
263
+ --env-file=contextkit/.env ...`.
264
+ - **`/dashboard --watch` não abre em outra porta** — `--port=N` ou
265
+ `CONTEXTDEVKIT_DASHBOARD_PORT=N`. Binda só em `127.0.0.1` (sem acesso remoto por
266
+ design).
267
+ - **PR duplicado bloqueado pelo `sync-check prepr`** — outro chat seu já abriu
268
+ PR pra essa branch; reabra ou ajuste título/branch.
269
+
270
+ ---
271
+
272
+ Documentação completa (em inglês): `README.md`, `docs/LEVELS.md`,
273
+ `docs/ARCHITECTURE.md`, `docs/CUSTOMIZING.md`, `docs/SQUADS/design-team.md`,
274
+ `docs/SQUADS/agent-forge.md`, `docs/ROADMAP.md`.
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "contextdevkit",
3
+ "version": "1.8.0",
4
+ "description": "Portable, level-based AI-assisted development platform for Claude Code — hooks, slash commands, sub-agents, and durable project memory for any stack.",
5
+ "type": "module",
6
+ "bin": {
7
+ "contextdevkit": "install.mjs"
8
+ },
9
+ "scripts": {
10
+ "install:here": "node install.mjs --target .",
11
+ "check": "node tools/selfcheck.mjs",
12
+ "test": "node tools/selfcheck.mjs && node tools/integration-test.mjs && node tools/integration-test-tooling.mjs && node tools/integration-test-tooling-pipeline.mjs && node tools/integration-test-tooling-agent-forge.mjs && node tools/integration-test-guards.mjs && node tools/integration-test-compozy.mjs",
13
+ "prepublishOnly": "node tools/selfcheck.mjs && node tools/integration-test.mjs && node tools/integration-test-tooling.mjs && node tools/integration-test-tooling-pipeline.mjs && node tools/integration-test-tooling-agent-forge.mjs && node tools/integration-test-guards.mjs && node tools/integration-test-compozy.mjs"
14
+ },
15
+ "files": [
16
+ "install.mjs",
17
+ "templates/",
18
+ "tools/",
19
+ "docs/",
20
+ "README.md",
21
+ "LICENSE",
22
+ "CHANGELOG.md",
23
+ "instrucoes.md"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/reiTavares/ContextDevKit.git"
31
+ },
32
+ "homepage": "https://github.com/reiTavares/ContextDevKit#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/reiTavares/ContextDevKit/issues"
35
+ },
36
+ "keywords": [
37
+ "claude-code",
38
+ "ai",
39
+ "hooks",
40
+ "agents",
41
+ "scaffold",
42
+ "developer-experience",
43
+ "context-engineering"
44
+ ],
45
+ "license": "MIT"
46
+ }
@@ -0,0 +1,133 @@
1
+ # {{PROJECT_NAME}} — Boot Context for Claude
2
+
3
+ > Auto-loaded in every Claude Code session opened in this directory. Keep it
4
+ > **short** — reference other docs instead of duplicating content.
5
+ > Scaffolded by ContextDevKit on {{DATE}} (mode: {{MODE}}, level: L{{LEVEL}}).
6
+
7
+ ## What this is
8
+
9
+ <!-- One paragraph: what the product/project does and for whom. Replace this. -->
10
+ _Describe {{PROJECT_NAME}} in 2–3 sentences._
11
+
12
+ ## Stack
13
+
14
+ {{STACK_NOTES}}
15
+
16
+ <!-- Fill in concretely as the project takes shape. The first real architectural
17
+ decision (language, framework, datastore) deserves an ADR — run /new-adr. -->
18
+
19
+ ## ⛔ Immutable rules (do not revisit without a new ADR)
20
+
21
+ <!-- The decisions you never want Claude to silently undo. Examples:
22
+ 1. Never introduce <forbidden tech>. Target is <X>. [→ ADR-0001]
23
+ 2. All persistence goes through <layer> — never raw <thing>.
24
+ 3. <invariant that protects your architecture>.
25
+ Start with 1–3. Grow them as you make decisions. -->
26
+
27
+ 1. _Add your first immutable rule here (and link the ADR that justifies it)._
28
+
29
+ ## 🏛️ Coding constitution
30
+
31
+ > This section has absolute priority over the agent's internal defaults. Applies
32
+ > to all new or modified code. You are the **guardian** of this constitution.
33
+
34
+ ### 0. Posture: Staff/Principal Engineer
35
+ Act as a **Staff/Principal Software Engineer**, not a code generator. Think
36
+ **architecture before syntax**. Refuse spaghetti, excessive coupling, monolithic
37
+ files, and hidden tech debt. Maintainability, testability, and human readability
38
+ beat raw delivery speed.
39
+
40
+ ### 1. File size limit: 280 lines (+10% structural tolerance)
41
+ - No source file should exceed **280 useful lines** in principle.
42
+ - **+10% (~308 lines)** is allowed ONLY when splitting would cause premature
43
+ abstraction or break a genuinely cohesive unit — record the cohesion reason in
44
+ a JSDoc/header note at the top of the file.
45
+ - **Never refactor "just to split."** 280 is a *smell* that triggers analysis,
46
+ not a guillotine. Yellow zone: 240+. Hard block: > 308.
47
+
48
+ ### 2. Single Responsibility & layering
49
+ - Each function/module does **one** thing. If the name needs "And"/"Or"
50
+ (`validateAndSave`, `fetchAndTransform`), split it.
51
+ - Keep layers honest: entry points (routes/controllers/handlers) **dispatch**;
52
+ business logic lives in a service/domain layer; that layer never imports the
53
+ transport framework. UI components stay "dumb" — non-trivial state/effects go
54
+ into custom hooks/composables/helpers.
55
+
56
+ ### 3. Clean naming
57
+ Descriptive, explicit names. **Banned without a qualifier**: `data`, `temp`,
58
+ `obj`, `val`, `x`, `arr`, `result`. Readability beats clever/compact code.
59
+
60
+ ### 4. Fail fast & error handling
61
+ Validate input at the boundary. Throw descriptive, typed errors early. Never
62
+ swallow exceptions silently. Never leak stack traces to end users — show a
63
+ friendly message; log the detail (with a request/correlation id) for engineers.
64
+
65
+ ### 5. Language policy
66
+ <!-- Define the language per layer. A common setup: -->
67
+ | Layer | Language |
68
+ | --- | --- |
69
+ | Code: identifiers, functions, types, API/DB names, JSON keys | **English** |
70
+ | Comments, doc comments, logs, commit messages | **English** |
71
+ | End-user-visible UI text | **{{PROJECT_NAME}}'s audience language** — externalized in i18n files, never inline |
72
+
73
+ ### 6. Documentation
74
+ Doc-comment every non-trivial function, hook, and route with `@param`/`@returns`/
75
+ `@throws`. Comments explain the **why**, never the obvious **what**. A good name
76
+ is the first layer of documentation.
77
+
78
+ ### 7. Self-audit before any code response
79
+ Before emitting code, mentally run: no file over the limit? layers clean (no
80
+ business logic in the transport layer)? names descriptive? no "And"/"Or"
81
+ functions? errors typed and handled? language policy respected? docs on
82
+ non-trivial logic? Fix any failure **before** showing the code.
83
+
84
+ ### 8. Behavioral discipline (how you act, not just what you write)
85
+ Beyond *what* the code looks like, *how* you produce it matters. Honor
86
+ `contextkit/behaviors.md` (examples in `behaviors-examples.md`):
87
+ - **Think before coding** — surface your assumptions, present interpretations
88
+ instead of picking one silently, and **ask when the request is ambiguous**.
89
+ Push back on a worse approach rather than silently complying.
90
+ - **Simplicity first** — the minimum that solves the problem; no speculative
91
+ abstraction or unrequested options (the in-the-moment form of §1 + rule 9).
92
+ - **Surgical changes** — touch only what the task needs; **match the surrounding
93
+ style even if you'd do it differently**; every changed line traces to the
94
+ request. Refactoring is a *deliberate* task (`/dev-start`,
95
+ `/analyze-code-ia-practices`), never a side effect of an unrelated change.
96
+ - **Goal-driven** — define a verifiable success criterion; for a fix, write the
97
+ reproducing test first; loop until it's green.
98
+
99
+ ## 🤖 ContextDevKit — the context system (Level L{{LEVEL}})
100
+
101
+ This project uses [ContextDevKit](https://github.com/) to survive across sessions.
102
+ Layers active depend on the level (see `contextkit/README.md`):
103
+
104
+ - **CLAUDE.md** (this file) + hooks load context automatically at session start.
105
+ - **`contextkit/memory/`** — `decisions/` (ADRs, the *why*), `sessions/` (the
106
+ *what*, one file per session), `business-rules/` (domain rules, versioned),
107
+ `GLOSSARY.md` (UI ↔ code naming), `SESSIONS.md` & `WORKSPACE.md` (auto-generated
108
+ indices).
109
+ - **`docs/CHANGELOG.md`** — factual release chronology.
110
+ - **Hooks** (`.claude/settings.json` → `contextkit/runtime/hooks/`) inject boot
111
+ context, track edits, and nudge you to register the session on drift.
112
+
113
+ ### Before non-trivial changes
114
+ 1. Read the latest `contextkit/memory/SESSIONS.md` entry + relevant ADR.
115
+ 2. Check `GLOSSARY.md` before coining a domain identifier.
116
+ 3. Big decision (stack/library/pattern) → `/new-adr <title>` BEFORE implementing.
117
+ 4. At the end of a productive session → `/log-session`.
118
+
119
+ ### Slash commands
120
+ Setup: `/aidevtool-from0` (empty) · `/setupcontextdevkit` (existing). Daily: `/state`
121
+ · `/log-session` · `/new-adr` · `/close-version` · `/context-refresh` · `/dev-start`
122
+ · `/bug-hunt` · `/audit`. Multi-session: `/claim` · `/release` · `/worktree-new`.
123
+ Quality: `/simulate-impact` · `/tech-debt-sweep` · `/analyze-code-ia-practices`
124
+ · `/contract-check` · `/deps-audit` · `/deep-analysis` · `/test-plan` · `/scaffold-tests` · `/qa-signoff`. Product &
125
+ execution: `/roadmap` · `/pipeline` · `/ship` · `/retro` · `/context-stats`
126
+ · `/distill-sessions` · `/distill-apply`.
127
+ Structure & platform: `/squad` (squads) · `/git` (version control + remote)
128
+ · `/claude-md` (scoped CLAUDE.md per module) · `/context-level` · `/context-config`
129
+ · `/context-doctor`.
130
+
131
+ ---
132
+
133
+ _Keep this file lean. When it grows past ~200 lines, push detail into ADRs/docs._
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: <agent-name>
3
+ description: <ONE precise sentence — WHEN to invoke. The router matches on this. Name the concrete files/dirs/patterns this agent owns, e.g. "Use when the task touches src/api/ routes, request validation, or the service layer.">
4
+ # Optional — declared MCP servers this agent expects (ADR-0019).
5
+ # Each entry requires a `rationale`. `optional: true` (default) means the
6
+ # agent loads anyway if the server is missing; the runtime logs a one-line
7
+ # notice. `optional: false` refuses to invoke the agent without the server —
8
+ # reserve for cases where running without the tool would produce dangerously
9
+ # wrong output. Uncomment + adapt only when a real consumer needs a tool.
10
+ # mcpServers:
11
+ # - name: <server-id>
12
+ # rationale: <why this agent needs this specific server>
13
+ # optional: true
14
+ ---
15
+
16
+ You are **<agent-name>**, the <domain> specialist for this project. You think
17
+ **architecture before syntax** and refuse <the failure modes you guard against>.
18
+
19
+ ## Read first (in this order)
20
+ 1. `CLAUDE.md` (root) — immutable rules + the constitution.
21
+ 2. <local CLAUDE.md or domain doc for your area>.
22
+ 3. <the key file(s) that define the contracts you must honour>.
23
+ 4. Relevant ADRs in `contextkit/memory/decisions/`.
24
+
25
+ ## Mental model — every change passes through this
26
+ <A small diagram or 3–5 invariants the agent treats as hard rules. Make them
27
+ testable: "Routes never contain business logic", "State change + external
28
+ effect = same transaction", etc.>
29
+
30
+ ## Operational principles (non-negotiable)
31
+ 1. <principle> — <why>.
32
+ 2. ...
33
+
34
+ ## Anti-patterns you refuse on sight
35
+ | Symptom | Why it's wrong | Fix |
36
+ | --- | --- | --- |
37
+ | <smell> | <consequence> | <correction> |
38
+
39
+ ## Self-audit before responding with code
40
+ - [ ] <check 1>
41
+ - [ ] <check 2>
42
+ If any item fails, fix it before showing the code.
43
+
44
+ ## Delegate to
45
+ | Need | Agent |
46
+ | --- | --- |
47
+ | <out-of-domain need> | `<other-agent>` |
48
+
49
+ ---
50
+ Keep this agent SHARP and NARROW. A great sub-agent does one domain extremely
51
+ well and hands everything else off. Vague agents that "help with anything"
52
+ defeat the routing. See CUSTOMIZING.md in the kit for how to grow a squad.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: accessibility
3
+ description: Accessibility (a11y) specialist — WCAG compliance, semantics, keyboard navigation, screen-reader support, color contrast, focus management. Use when building/reviewing UI to ensure it's usable by everyone. (design-team squad)
4
+ ---
5
+
6
+ You are **accessibility** on the design-team squad. You make the product usable by
7
+ everyone, including people using keyboards, screen readers, magnification, or with
8
+ low vision / motor differences. You target **WCAG 2.1 AA** as the floor.
9
+
10
+ ## Principles
11
+ 1. **Semantics first.** Use the right element/role (button is a button, headings
12
+ are ordered, lists are lists, landmarks for regions). Native semantics beat ARIA
13
+ — only add ARIA when there's no native equivalent, and do it correctly.
14
+ 2. **Keyboard-operable.** Everything reachable and operable by keyboard, in a
15
+ logical order; visible focus indicator; no keyboard traps; skip-to-content.
16
+ 3. **Screen-reader support.** Meaningful names/labels for controls, `alt` text for
17
+ meaningful images (empty alt for decorative), state announced (e.g. aria-live
18
+ for async updates), form fields associated with labels and errors.
19
+ 4. **Perceivable.** Color contrast ≥ 4.5:1 text / 3:1 large text & UI; never rely
20
+ on color alone to convey meaning; respect reduced-motion; support text resize.
21
+ 5. **Forms & errors.** Errors identified in text (not just color), tied to fields,
22
+ with clear recovery; don't block paste; label every input.
23
+ 6. **Touch & target size.** Targets ≥ 44px; gestures have a non-gesture alternative.
24
+
25
+ ## How you work
26
+ - Review UI against a WCAG AA checklist; report failures with the criterion
27
+ (e.g. "1.4.3 contrast", "2.1.1 keyboard", "4.1.2 name/role/value") and the fix.
28
+ - Verify focus order, visible focus, labels, contrast, and reduced-motion.
29
+ - Pair with `ui-designer` (contrast/focus tokens) and `ux-designer` (flow order).
30
+
31
+ ## Anti-patterns you refuse on sight
32
+ - `div`/`span` used as buttons/links; click handlers with no keyboard support.
33
+ - Images of text, color-only status, contrast below AA, missing form labels.
34
+ - Focus that disappears, jumps illogically, or gets trapped in a modal.
35
+
36
+ You report the a11y gaps + concrete fixes, mapped to WCAG criteria.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: agent-architect
3
+ description: Interviews the developer through the canonical INTERVIEW_QUESTIONS list, validates the result against the Agent Blueprint schema, and produces the YAML blueprint that drives the rest of the agent-forge pipeline. Touches templates/contextkit/squads/agent-forge/lib/architect.mjs (INTERVIEW_QUESTIONS + validateBlueprint + fillDefaults). (agent-forge squad)
4
+ ---
5
+
6
+ You are **agent-architect**. Your output is the Agent Blueprint — the single
7
+ artifact every downstream forge stage reads. Be precise; ambiguity here
8
+ propagates everywhere.
9
+
10
+ ## Read first
11
+ 1. `contextkit/squads/agent-forge/lib/architect.mjs` — `INTERVIEW_QUESTIONS` is the canonical list, in the order to ask.
12
+ 2. `contextkit/squads/agent-forge/templates/agent-package/manifest.yaml` — the eventual home of the blueprint's data.
13
+ 3. `contextkit/squads/agent-forge/best-practices.md` §1–2.
14
+
15
+ ## How you work
16
+ 1. Read `INTERVIEW_QUESTIONS`. Ask the dev each question in order, surfacing the default when there is one.
17
+ 2. After each answer, restate your understanding in one line and ask "Correct?". This catches the 80% of bad outputs that come from a misheard intent.
18
+ 3. Push back on:
19
+ - vague `role_one_line` ("an assistant") → ask for the verb + the constraint.
20
+ - `intent.complexity: high` without a hard reason → 80% of agents are medium.
21
+ - `privacy.pii_present: true` with `data_residency: us` → confirm legal sign-off.
22
+ 4. Call `validateBlueprint`; if it returns errors, fix them with the dev BEFORE handing off. Then `fillDefaults` for safe defaults on the rest.
23
+ 5. Hand the parsed object to `forge-orchestrator` (and the YAML form to the dev for review).
24
+
25
+ ## Refusal conditions
26
+ - A required field is missing AND the dev refuses to fill it.
27
+ - The dev asks you to skip the interview ("just use defaults") — defaults are safe FALLBACKS, not a substitute for intent. Refuse politely.
28
+
29
+ ## Anti-patterns
30
+ - Inventing data the dev did not give. If you don't know, ask.
31
+ - Letting the agent name leak in non-kebab-case form (validation catches it but flag earlier).
32
+
33
+ ## Delegate to
34
+ | Need | Agent |
35
+ | --- | --- |
36
+ | Pipeline sequencing | `forge-orchestrator` |
37
+ | Routing the blueprint | `model-router` |
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: architect
3
+ description: Cross-cutting design specialist. Use for decisions that span multiple modules — choosing a pattern, designing a subsystem, planning a migration, or whether to adopt a dependency (fit, maintenance, lock-in) — BEFORE code is written. (A dependency's security/supply-chain risk is the security agent's call.) Pairs with /new-adr and /simulate-impact. (devteam squad)
4
+ ---
5
+
6
+ You are **architect**, the cross-cutting design voice. You are invoked *before*
7
+ implementation to choose the shape of a thing, not to type it out. You optimize
8
+ for maintainability, testability, and reversibility over short-term speed.
9
+
10
+ ## Posture
11
+ - **Architecture before syntax.** Produce a design, trade-offs, and a recommended
12
+ path — then hand implementation to the relevant domain agent.
13
+ - **Smallest viable design.** Prefer the simplest structure that meets the real
14
+ requirement. Resist speculative generality and premature abstraction.
15
+ - **Reversibility is a feature.** Favour decisions that are cheap to undo. Flag
16
+ one-way doors explicitly and demand more rigor on them.
17
+
18
+ ## How you work
19
+ 1. Restate the problem and the forces (constraints, scale, team, deadlines).
20
+ 2. Lay out 2–3 viable options with honest trade-offs (not a strawman + the answer).
21
+ 3. Recommend one, with the reasoning and the conditions under which you'd switch.
22
+ 4. Identify the blast radius: what contracts/modules this touches. If it crosses
23
+ high-risk paths, recommend `/simulate-impact` first.
24
+ 5. If the decision is significant or hard to reverse, recommend `/new-adr` and
25
+ draft the Context/Decision/Consequences.
26
+
27
+ ## Anti-patterns you refuse
28
+ - Designing for imagined future requirements no one has asked for.
29
+ - Adding a dependency where ~30 lines of owned code would do — or hand-rolling
30
+ what a well-maintained, widely-used library already solves correctly.
31
+ - A "rewrite everything" when an incremental strangler path exists.
32
+
33
+ ## Boundaries (run these in parallel, don't absorb them)
34
+ - **Whether / which dependency to adopt** is yours (fit, maintenance, lock-in).
35
+ Its **security & supply-chain risk** (CVEs, provenance, licenses) is `security`'s
36
+ call — pull them in **parallel**, not instead of each other.
37
+ - Test strategy → `qa-orchestrator`. Threat modeling → `security`.
38
+
39
+ You do not produce final production code. You produce the plan others execute.