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
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Model router for agent-forge (ADR-0012). Reads `decision-rules.json` + the
3
+ * `capability-matrix.json`, applies deterministic SHORTLIST rules to a parsed
4
+ * Agent Blueprint, filters candidates by capability + residency, and emits a
5
+ * { primary, fallback, cheap_path, premium_path, applied_rules, rationale }
6
+ * decision. Quality opinions live in the eval harness, NOT here (ADR-0012 §5).
7
+ *
8
+ * Pure zero-dep (rule 1) — no provider SDKs, no YAML, just `node:` + JSON.parse.
9
+ * The architect/orchestrator parses YAML upstream via `lib/yaml.mjs` and hands
10
+ * `routeAgent` a plain JS object.
11
+ */
12
+ import { readFile } from 'node:fs/promises';
13
+ import { dirname, resolve } from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const HERE = dirname(fileURLToPath(import.meta.url));
17
+ const DEFAULT_MATRIX = resolve(HERE, '..', 'router', 'capability-matrix.json');
18
+ const DEFAULT_RULES = resolve(HERE, '..', 'router', 'decision-rules.json');
19
+
20
+ async function loadJson(path) {
21
+ const raw = await readFile(path, 'utf-8');
22
+ return JSON.parse(raw.replace(/^/, ''));
23
+ }
24
+
25
+ export async function loadMatrix(path = DEFAULT_MATRIX) {
26
+ return loadJson(path);
27
+ }
28
+
29
+ export async function loadRules(path = DEFAULT_RULES) {
30
+ return loadJson(path);
31
+ }
32
+
33
+ function getPath(source, dotPath) {
34
+ return dotPath.split('.').reduce((node, key) => node?.[key], source);
35
+ }
36
+
37
+ function matchOne(actual, expected) {
38
+ if (expected && typeof expected === 'object' && !Array.isArray(expected)) {
39
+ for (const [op, ref] of Object.entries(expected)) {
40
+ if (op === '$eq' && actual !== ref) return false;
41
+ if (op === '$gt' && !(actual > ref)) return false;
42
+ if (op === '$gte' && !(actual >= ref)) return false;
43
+ if (op === '$lt' && !(actual < ref)) return false;
44
+ if (op === '$lte' && !(actual <= ref)) return false;
45
+ }
46
+ return true;
47
+ }
48
+ if (Array.isArray(expected)) return expected.includes(actual);
49
+ return actual === expected;
50
+ }
51
+
52
+ function matchesWhen(when, blueprint) {
53
+ if (!when || !Object.keys(when).length) return true;
54
+ return Object.entries(when).every(([dotPath, expected]) => matchOne(getPath(blueprint, dotPath), expected));
55
+ }
56
+
57
+ function isAvailable(model, blueprint) {
58
+ if (!model) return false;
59
+ const caps = blueprint.capabilities || {};
60
+ const priv = blueprint.privacy || {};
61
+ if (caps.tools && model.capabilities?.tools === false) return false;
62
+ if ((caps.multimodal || blueprint.intent?.multimodal) && model.capabilities?.vision === false) return false;
63
+ if (caps.structured_output && model.capabilities?.structured_output === false) return false;
64
+ if (priv.allow_cloud_providers === false && !model.id.startsWith('self-hosted/')) return false;
65
+ if (priv.data_residency === 'on-prem' && !model.id.startsWith('self-hosted/')) return false;
66
+ return true;
67
+ }
68
+
69
+ function firstAvailable(ids, modelById, blueprint) {
70
+ for (const id of ids) {
71
+ if (isAvailable(modelById[id], blueprint)) return id;
72
+ }
73
+ return undefined;
74
+ }
75
+
76
+ function buildRationale(ctx) {
77
+ const { primary, fallback, cheap_path, premium_path, applied_rules, blueprint } = ctx;
78
+ const intent = blueprint.intent || {};
79
+ const facts = [`intent: ${intent.category || '?'}${intent.complexity ? ' (' + intent.complexity + ')' : ''}`];
80
+ if (intent.multimodal || blueprint.capabilities?.multimodal) facts.push('multimodal required');
81
+ if (blueprint.capabilities?.tools) facts.push('tool use required');
82
+ if (blueprint.privacy?.data_residency) facts.push(`residency: ${blueprint.privacy.data_residency}`);
83
+ if (blueprint.privacy?.allow_cloud_providers === false) facts.push('no-cloud (self-hosted only)');
84
+
85
+ const sameProvider = fallback && primary.split('/')[0] === fallback.split('/')[0];
86
+ const ruleTrace = applied_rules.length ? applied_rules.map((rule) => '`' + rule + '`').join(', ') : '`default-balanced`';
87
+ const lines = [
88
+ '## Model Selection Rationale',
89
+ '',
90
+ `<!-- Generated by agent-forge model-router. Applied rules: ${applied_rules.join(' → ') || '(default)'}. -->`,
91
+ `> **Authority:** the eval harness (golden + red-team) measured on your dataset, not these rules ([ADR-0012](../../memory/decisions/0012-agent-forge-squad-for-portable-agent-packages.md) §5).`,
92
+ '',
93
+ `**Primary:** \`${primary}\``,
94
+ `- Constraints applied: ${facts.join('; ')}.`,
95
+ `- Selected from the shortlist of rule(s): ${ruleTrace}.`,
96
+ ];
97
+ if (fallback) {
98
+ lines.push('');
99
+ lines.push(`**Fallback:** \`${fallback}\``);
100
+ lines.push(`- ${sameProvider ? 'WARN: same provider as primary — outage defense weakened. Review.' : 'Different provider from primary — outage defense.'}`);
101
+ } else {
102
+ lines.push('');
103
+ lines.push('**Fallback:** _no cross-provider candidate was available_. The eval gate may flag this — extend `decision-rules.json` or relax residency.');
104
+ }
105
+ if (cheap_path) {
106
+ lines.push('');
107
+ lines.push(`**Cheap path:** \`${cheap_path}\` — for cheap sub-tasks.`);
108
+ }
109
+ if (premium_path) {
110
+ lines.push('');
111
+ lines.push(`**Premium path:** \`${premium_path}\` — for calls flagged critical.`);
112
+ }
113
+ return lines.join('\n');
114
+ }
115
+
116
+ export async function routeAgent(blueprint, opts = {}) {
117
+ const matrix = opts.matrix ?? (await loadMatrix(opts.matrixPath));
118
+ const rules = opts.rules ?? (await loadRules(opts.rulesPath));
119
+ const cap = rules.max_rules ?? 15;
120
+ if (rules.rules.length > cap) {
121
+ throw new Error(`agent-forge router: decision-rules has ${rules.rules.length} rules (cap ${cap}). Split by intent category — blueprint §12.`);
122
+ }
123
+ const modelById = Object.fromEntries(matrix.models.map((model) => [model.id, model]));
124
+
125
+ const matched = [];
126
+ const primaryCandidates = [];
127
+ const fallbackCandidates = [];
128
+ let cheapPath;
129
+ let premiumPath;
130
+ let abortIfEmpty = false;
131
+
132
+ for (const rule of rules.rules) {
133
+ if (!matchesWhen(rule.when, blueprint)) continue;
134
+ matched.push(rule.id);
135
+ if (rule.then?.primary_candidates) primaryCandidates.push(...rule.then.primary_candidates);
136
+ if (rule.then?.fallback_candidates) fallbackCandidates.push(...rule.then.fallback_candidates);
137
+ if (rule.then?.cheap_path && !cheapPath) cheapPath = rule.then.cheap_path;
138
+ if (rule.then?.premium_path && !premiumPath) premiumPath = rule.then.premium_path;
139
+ if (rule.abort_if_no_candidate) abortIfEmpty = true;
140
+ }
141
+
142
+ const primary = firstAvailable(primaryCandidates, modelById, blueprint);
143
+ if (!primary) {
144
+ if (abortIfEmpty) {
145
+ throw new Error('agent-forge router: no candidate satisfies the blueprint constraints (residency/capabilities). Review the blueprint or extend decision-rules.');
146
+ }
147
+ throw new Error('agent-forge router: no matching rule produced an available primary candidate — add a default-balanced rule or specify capabilities precisely.');
148
+ }
149
+
150
+ const primaryProvider = primary.split('/')[0];
151
+ const allFallbacks = [...fallbackCandidates, ...primaryCandidates.filter((id) => id !== primary)];
152
+ const fallback = allFallbacks.find((id) => id.split('/')[0] !== primaryProvider && isAvailable(modelById[id], blueprint));
153
+
154
+ const cheapAvail = cheapPath && isAvailable(modelById[cheapPath], blueprint) ? cheapPath : undefined;
155
+ const premiumAvail = premiumPath && isAvailable(modelById[premiumPath], blueprint) ? premiumPath : undefined;
156
+
157
+ return {
158
+ primary,
159
+ fallback,
160
+ cheap_path: cheapAvail,
161
+ premium_path: premiumAvail,
162
+ applied_rules: matched,
163
+ rationale: buildRationale({ primary, fallback, cheap_path: cheapAvail, premium_path: premiumAvail, applied_rules: matched, blueprint }),
164
+ };
165
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * tool-designer — render the canonical JSON tool schemas to per-provider adapter
3
+ * files. Fase 1 shipped Anthropic + OpenAI; Fase 2 adds Gemini (functionDeclarations
4
+ * SUBSET — `additionalProperties` and `$schema` are dropped because Gemini's
5
+ * function-calling parser rejects them), DeepSeek (OpenAI-compat drop-in), and
6
+ * Ollama (OpenAI-compat via /v1/chat/completions). Provider-specific quirks live
7
+ * INSIDE these render functions — the canonical file stays neutral. Pure + zero-dep.
8
+ *
9
+ * Canonical shape: `tools/schemas.canonical.json` uses tool names as top-level keys
10
+ * (reserving `_note` / `$schema` for metadata). Each tool is
11
+ * `{ description, idempotent?, input_schema, error_format? }`.
12
+ */
13
+
14
+ /** Walk the canonical object → `[{ name, description, input_schema, idempotent, error_format }]`. */
15
+ export function parseCanonical(canonical) {
16
+ if (!canonical || typeof canonical !== 'object') return [];
17
+ return Object.entries(canonical)
18
+ .filter(([k]) => !k.startsWith('_') && !k.startsWith('$'))
19
+ .map(([name, def]) => ({
20
+ name,
21
+ description: def?.description || '',
22
+ input_schema: def?.input_schema || { type: 'object', properties: {}, required: [] },
23
+ idempotent: def?.idempotent ?? null,
24
+ error_format: def?.error_format ?? null,
25
+ }));
26
+ }
27
+
28
+ /** Anthropic `tools` array — `{ name, description, input_schema }`. Force-call via tool_choice. */
29
+ export function renderAnthropic(tools) {
30
+ return {
31
+ _generated: 'agent-forge tool-designer (Fase 1) from ../schemas.canonical.json — do not hand-edit',
32
+ _format: "Anthropic `tools` array: { name, description, input_schema }. Force a tool with tool_choice: { type: 'tool', name }.",
33
+ tools: tools.map((t) => ({ name: t.name, description: t.description, input_schema: t.input_schema })),
34
+ };
35
+ }
36
+
37
+ /** OpenAI `tools` array — `{ type: 'function', function: { name, description, parameters } }`. */
38
+ export function renderOpenAI(tools) {
39
+ return {
40
+ _generated: 'agent-forge tool-designer (Fase 1) from ../schemas.canonical.json — do not hand-edit',
41
+ _format: "OpenAI `tools` array of type 'function'. Force a call with tool_choice: { type: 'function', function: { name } }.",
42
+ tools: tools.map((t) => ({
43
+ type: 'function',
44
+ function: { name: t.name, description: t.description, parameters: t.input_schema },
45
+ })),
46
+ };
47
+ }
48
+
49
+ /**
50
+ * Strip JSON-Schema fields Gemini's `functionDeclarations` parser rejects:
51
+ * `additionalProperties`, `$schema`, `$id`, `$ref` (subset enforcement).
52
+ * Recurses into nested object/array shapes.
53
+ */
54
+ function downConvertForGemini(node) {
55
+ if (Array.isArray(node)) return node.map(downConvertForGemini);
56
+ if (!node || typeof node !== 'object') return node;
57
+ const out = {};
58
+ for (const [key, value] of Object.entries(node)) {
59
+ if (key === 'additionalProperties' || key === '$schema' || key === '$id' || key === '$ref') continue;
60
+ out[key] = typeof value === 'object' ? downConvertForGemini(value) : value;
61
+ }
62
+ return out;
63
+ }
64
+
65
+ /** Google (Gemini) `tools[].functionDeclarations[]`. parameters is the JSON-Schema SUBSET. */
66
+ export function renderGoogle(tools) {
67
+ return {
68
+ _generated: 'agent-forge tool-designer (Fase 2) from ../schemas.canonical.json — do not hand-edit',
69
+ _format: "Gemini `tools[].functionDeclarations[]`: { name, description, parameters }. parameters is a JSON-Schema SUBSET — additionalProperties + $schema dropped.",
70
+ functionDeclarations: tools.map((t) => ({
71
+ name: t.name,
72
+ description: t.description,
73
+ parameters: downConvertForGemini(t.input_schema),
74
+ })),
75
+ };
76
+ }
77
+
78
+ /** DeepSeek: OpenAI-compatible drop-in. */
79
+ export function renderDeepSeek(tools) {
80
+ return {
81
+ _generated: 'agent-forge tool-designer (Fase 2) from ../schemas.canonical.json — do not hand-edit',
82
+ _format: "DeepSeek is OpenAI-compatible — same shape as openai.tools.json (type 'function').",
83
+ tools: tools.map((t) => ({
84
+ type: 'function',
85
+ function: { name: t.name, description: t.description, parameters: t.input_schema },
86
+ })),
87
+ };
88
+ }
89
+
90
+ /** Self-hosted (Ollama/vLLM) via OpenAI-compatible endpoint. Native function calling on Llama 3.x / Mistral. */
91
+ export function renderOllama(tools) {
92
+ return {
93
+ _generated: 'agent-forge tool-designer (Fase 2) from ../schemas.canonical.json — do not hand-edit',
94
+ _format: "Self-hosted via OpenAI-compatible endpoint. Native function calling on Llama 3.x / Mistral; reliability below cloud — robust eval is critical.",
95
+ tools: tools.map((t) => ({
96
+ type: 'function',
97
+ function: { name: t.name, description: t.description, parameters: t.input_schema },
98
+ })),
99
+ };
100
+ }
101
+
102
+ /** One-stop adapter generator: anthropic + openai + google + deepseek + ollama. */
103
+ export function generateAdapters(canonical) {
104
+ const tools = parseCanonical(canonical);
105
+ return {
106
+ tools,
107
+ anthropic: renderAnthropic(tools),
108
+ openai: renderOpenAI(tools),
109
+ google: renderGoogle(tools),
110
+ deepseek: renderDeepSeek(tools),
111
+ ollama: renderOllama(tools),
112
+ };
113
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Optional YAML loader for agent-forge (ADR-0013). The ONLY place the `yaml` dependency
3
+ * is imported — every forge consumer goes through `parseYaml` / `stringifyYaml`. Mirrors
4
+ * the sanctioned `zod` optional-dynamic-import pattern (ADR-0001).
5
+ *
6
+ * ⛔ The L1–3 hot path (runtime/hooks/**, runtime/config/load.mjs) must NEVER import this
7
+ * module — agent-forge is opt-in L4+ tooling. A selfcheck guard enforces that.
8
+ */
9
+
10
+ let cachedYaml;
11
+
12
+ /**
13
+ * Load the optional `yaml` lib, caching the module. Throws an actionable error (never a
14
+ * raw stack trace) when the dependency is not installed.
15
+ * @returns {Promise<object>} the `yaml` module
16
+ * @throws {Error} when `yaml` is not installed
17
+ */
18
+ export async function loadYaml() {
19
+ if (cachedYaml) return cachedYaml;
20
+ try {
21
+ const mod = await import('yaml');
22
+ cachedYaml = mod.default ?? mod;
23
+ return cachedYaml;
24
+ } catch {
25
+ throw new Error('agent-forge needs the `yaml` package to read/write Agent Package files — run `npm i yaml`.');
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Parse a YAML string into a JS value (BOM-safe, per immutable rule 4).
31
+ * @param {string} text raw YAML
32
+ * @returns {Promise<unknown>}
33
+ */
34
+ export async function parseYaml(text) {
35
+ const yaml = await loadYaml();
36
+ return yaml.parse(String(text).replace(/^/, ''));
37
+ }
38
+
39
+ /**
40
+ * Serialize a JS value to a YAML string.
41
+ * @param {unknown} value
42
+ * @returns {Promise<string>}
43
+ */
44
+ export async function stringifyYaml(value) {
45
+ const yaml = await loadYaml();
46
+ return yaml.stringify(value);
47
+ }
@@ -0,0 +1,65 @@
1
+ pipeline:
2
+ squad: agent-forge
3
+ version: "1.0.0"
4
+ description: >
5
+ Forge a portable APF package from an approved Agent Blueprint.
6
+ Linear with one conditional branch (tools), one conditional capability
7
+ (rag), and one bounded retry loop on the eval gate.
8
+
9
+ steps:
10
+ # 1 — sanity-check the blueprint before any work runs.
11
+ - id: validate-blueprint
12
+ agent: forge-orchestrator
13
+ execution: inline
14
+ model_tier: fast
15
+
16
+ # 2 — route to a tier+provider shortlist (capability matrix + decision rules).
17
+ - id: route
18
+ agent: model-router
19
+ execution: inline
20
+ model_tier: fast
21
+
22
+ # 3 — human picks one model from the shortlist; the choice lands on disk.
23
+ - id: checkpoint-shortlist
24
+ type: checkpoint
25
+ outputFile: pipeline/data/shortlist.md
26
+
27
+ # 4 — emit the per-provider system prompts (canonical + 5 adapters).
28
+ - id: generate-prompt
29
+ agent: prompt-engineer
30
+ execution: inline
31
+ model_tier: powerful
32
+
33
+ # 5 — emit the per-provider tool schemas (only when the blueprint declares tools).
34
+ - id: generate-tools
35
+ agent: tool-designer
36
+ execution: inline
37
+ model_tier: powerful
38
+ condition: blueprint.tools.length > 0
39
+
40
+ # 6 — emit the RAG config (only when the blueprint enables retrieval).
41
+ - id: generate-rag
42
+ agent: rag-designer
43
+ execution: inline
44
+ model_tier: powerful
45
+ condition: capabilities.rag == true
46
+
47
+ # 7 — populate the three governance pillars from the blueprint (throws on under-config).
48
+ - id: governance
49
+ agent: governance-officer
50
+ execution: inline
51
+ model_tier: powerful
52
+
53
+ # 8 — refuse to ship unless the eval gate passes; loop back to refine the prompt up to 3 times.
54
+ - id: eval-gate
55
+ agent: eval-designer
56
+ execution: subagent
57
+ model_tier: powerful
58
+ on_reject: generate-prompt
59
+ max_review_cycles: 3
60
+
61
+ # 9 — assemble the APF tree, stamp provenance, write to agent-packages/.
62
+ - id: package
63
+ agent: packager
64
+ execution: inline
65
+ model_tier: fast
@@ -0,0 +1,112 @@
1
+ {
2
+ "_note": "Seed capability matrix for the agent-forge model-router. Economics are ILLUSTRATIVE and date-stamped; refresh via /forge-refresh-matrix and gate changes through an ADR (ADR-0012, constraint 6). Authority for 'best model for this agent' is the eval harness measured on the user's golden set, NOT this file (constraint 5). Anthropic model IDs are current; other providers are plausible seeds to verify on first refresh.",
3
+ "updated": "2026-05-25",
4
+ "version": "0.1.0",
5
+ "allowed_providers": ["anthropic", "openai", "google", "deepseek", "self-hosted"],
6
+ "models": [
7
+ {
8
+ "id": "anthropic/claude-opus-4-7",
9
+ "tier": "premium",
10
+ "context_window": 200000,
11
+ "input_usd_per_mtok": 15.0,
12
+ "output_usd_per_mtok": 75.0,
13
+ "latency_p50_ms": 4500,
14
+ "strengths": ["reasoning", "coding", "agentic", "long-context"],
15
+ "weaknesses": ["cost"],
16
+ "capabilities": { "tools": true, "vision": true, "structured_output": true, "prompt_caching": true, "streaming": true },
17
+ "residency": ["us", "eu"],
18
+ "zero_retention_available": true
19
+ },
20
+ {
21
+ "id": "anthropic/claude-sonnet-4-6",
22
+ "tier": "balanced",
23
+ "context_window": 200000,
24
+ "input_usd_per_mtok": 3.0,
25
+ "output_usd_per_mtok": 15.0,
26
+ "latency_p50_ms": 1800,
27
+ "strengths": ["balanced", "tools", "coding", "pt-br"],
28
+ "capabilities": { "tools": true, "vision": true, "structured_output": true, "prompt_caching": true, "streaming": true },
29
+ "residency": ["us", "eu"],
30
+ "zero_retention_available": true
31
+ },
32
+ {
33
+ "id": "anthropic/claude-haiku-4-5",
34
+ "tier": "cheap",
35
+ "context_window": 200000,
36
+ "input_usd_per_mtok": 0.8,
37
+ "output_usd_per_mtok": 4.0,
38
+ "latency_p50_ms": 700,
39
+ "strengths": ["classification", "extraction-simple", "low-latency"],
40
+ "capabilities": { "tools": true, "vision": true, "prompt_caching": true, "streaming": true },
41
+ "residency": ["us", "eu"],
42
+ "zero_retention_available": true
43
+ },
44
+ {
45
+ "id": "openai/gpt-4o",
46
+ "tier": "balanced",
47
+ "context_window": 128000,
48
+ "strengths": ["multimodal", "tools", "structured_output"],
49
+ "capabilities": { "tools": true, "vision": true, "structured_output": true, "prompt_caching": true, "streaming": true },
50
+ "residency": ["us", "eu"]
51
+ },
52
+ {
53
+ "id": "openai/gpt-4o-mini",
54
+ "tier": "cheap",
55
+ "context_window": 128000,
56
+ "strengths": ["cost", "low-latency", "classification"],
57
+ "capabilities": { "tools": true, "vision": true, "structured_output": true, "prompt_caching": true, "streaming": true },
58
+ "residency": ["us", "eu"]
59
+ },
60
+ {
61
+ "id": "google/gemini-2.5-pro",
62
+ "tier": "balanced",
63
+ "context_window": 2000000,
64
+ "strengths": ["long-context", "multimodal", "cost"],
65
+ "capabilities": { "tools": true, "vision": true, "structured_output": true, "prompt_caching": true, "streaming": true },
66
+ "residency": ["us", "eu"],
67
+ "notes": "safetySettings must be set explicitly; function-calling uses a JSON-Schema subset"
68
+ },
69
+ {
70
+ "id": "google/gemini-2.5-flash",
71
+ "tier": "cheap",
72
+ "context_window": 1000000,
73
+ "strengths": ["latency", "cost", "long-context"],
74
+ "capabilities": { "tools": true, "vision": true, "streaming": true },
75
+ "residency": ["us", "eu"]
76
+ },
77
+ {
78
+ "id": "deepseek/deepseek-v3",
79
+ "tier": "balanced",
80
+ "strengths": ["coding", "reasoning", "cost"],
81
+ "weaknesses": ["pt-br-nuance", "vision"],
82
+ "capabilities": { "tools": true, "vision": false, "streaming": true },
83
+ "residency": ["cn"],
84
+ "notes": "OpenAI-compatible API; prefers explicit CoT; reasoner variants split reasoning_content"
85
+ },
86
+ {
87
+ "id": "deepseek/deepseek-coder",
88
+ "tier": "specialist-coding",
89
+ "strengths": ["code-generation", "cost"],
90
+ "capabilities": { "tools": true, "vision": false, "streaming": true },
91
+ "residency": ["cn"]
92
+ },
93
+ {
94
+ "id": "self-hosted/llama-3.x-70b",
95
+ "tier": "self-hosted",
96
+ "strengths": ["data-residency", "no-egress", "predictable-cost"],
97
+ "weaknesses": ["operational-complexity", "tool-use-reliability"],
98
+ "capabilities": { "tools": true, "vision": false, "streaming": true },
99
+ "residency": ["on-prem", "any"],
100
+ "cost_model": "infra-only",
101
+ "notes": "Ollama (own + OpenAI-compatible endpoint) or vLLM (OpenAI-compatible); per-model chat_template"
102
+ },
103
+ {
104
+ "id": "self-hosted/mistral-large",
105
+ "tier": "self-hosted",
106
+ "strengths": ["multilingual-eu", "data-residency"],
107
+ "capabilities": { "tools": true, "vision": false, "streaming": true },
108
+ "residency": ["on-prem", "any", "eu"],
109
+ "cost_model": "infra-only"
110
+ }
111
+ ]
112
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "_note": "Deterministic SHORTLISTS for the model-router. Rules return candidate id arrays; the EVAL HARNESS picks the actual best from the shortlist (ADR-0012 §5). NO hardcoded quality claims here. Capped at 15 rules per blueprint §12 — split by intent category if you outgrow it. Operators in `when`: literal (===), array (oneOf), or { '$gt'|'$gte'|'$lt'|'$lte'|'$eq': value }.",
3
+ "updated": "2026-05-26",
4
+ "version": "0.1.0",
5
+ "max_rules": 15,
6
+ "rules": [
7
+ {
8
+ "id": "residency-no-cloud",
9
+ "when": { "privacy.allow_cloud_providers": false },
10
+ "then": {
11
+ "primary_candidates": ["self-hosted/llama-3.x-70b", "self-hosted/mistral-large"]
12
+ },
13
+ "abort_if_no_candidate": true
14
+ },
15
+ {
16
+ "id": "residency-on-prem",
17
+ "when": { "privacy.data_residency": "on-prem" },
18
+ "then": {
19
+ "primary_candidates": ["self-hosted/llama-3.x-70b", "self-hosted/mistral-large"]
20
+ },
21
+ "abort_if_no_candidate": true
22
+ },
23
+ {
24
+ "id": "classification-low",
25
+ "when": { "intent.category": "classification", "intent.complexity": "low" },
26
+ "then": {
27
+ "primary_candidates": ["anthropic/claude-haiku-4-5", "google/gemini-2.5-flash", "openai/gpt-4o-mini"],
28
+ "fallback_candidates": ["deepseek/deepseek-v3"]
29
+ }
30
+ },
31
+ {
32
+ "id": "extraction-simple",
33
+ "when": { "intent.category": "extraction", "intent.complexity": ["low", "medium"] },
34
+ "then": {
35
+ "primary_candidates": ["anthropic/claude-sonnet-4-6", "anthropic/claude-haiku-4-5"],
36
+ "fallback_candidates": ["google/gemini-2.5-pro", "openai/gpt-4o"],
37
+ "cheap_path": "anthropic/claude-haiku-4-5"
38
+ }
39
+ },
40
+ {
41
+ "id": "extraction-high",
42
+ "when": { "intent.category": "extraction", "intent.complexity": "high" },
43
+ "then": {
44
+ "primary_candidates": ["anthropic/claude-sonnet-4-6"],
45
+ "fallback_candidates": ["openai/gpt-4o", "google/gemini-2.5-pro"],
46
+ "premium_path": "anthropic/claude-opus-4-7"
47
+ }
48
+ },
49
+ {
50
+ "id": "rag-answer-large-context",
51
+ "when": { "intent.category": "rag-answer", "context_window_needed_tokens": { "$gt": 200000 } },
52
+ "then": {
53
+ "primary_candidates": ["google/gemini-2.5-pro"],
54
+ "fallback_candidates": ["anthropic/claude-sonnet-4-6"]
55
+ }
56
+ },
57
+ {
58
+ "id": "rag-answer",
59
+ "when": { "intent.category": "rag-answer" },
60
+ "then": {
61
+ "primary_candidates": ["anthropic/claude-sonnet-4-6"],
62
+ "fallback_candidates": ["openai/gpt-4o", "deepseek/deepseek-v3"]
63
+ }
64
+ },
65
+ {
66
+ "id": "coding-high",
67
+ "when": { "intent.category": "coding", "intent.complexity": "high" },
68
+ "then": {
69
+ "primary_candidates": ["anthropic/claude-sonnet-4-6"],
70
+ "fallback_candidates": ["openai/gpt-4o"],
71
+ "cheap_path": "deepseek/deepseek-coder",
72
+ "premium_path": "anthropic/claude-opus-4-7"
73
+ }
74
+ },
75
+ {
76
+ "id": "coding",
77
+ "when": { "intent.category": "coding" },
78
+ "then": {
79
+ "primary_candidates": ["anthropic/claude-sonnet-4-6", "deepseek/deepseek-coder"],
80
+ "fallback_candidates": ["openai/gpt-4o"],
81
+ "cheap_path": "deepseek/deepseek-coder"
82
+ }
83
+ },
84
+ {
85
+ "id": "reasoning-high",
86
+ "when": { "intent.category": "reasoning", "intent.complexity": "high" },
87
+ "then": {
88
+ "primary_candidates": ["anthropic/claude-opus-4-7"],
89
+ "fallback_candidates": ["openai/gpt-4o", "google/gemini-2.5-pro"],
90
+ "cheap_path": "anthropic/claude-sonnet-4-6"
91
+ }
92
+ },
93
+ {
94
+ "id": "agentic-multi-step",
95
+ "when": { "intent.category": "agentic-multi-step" },
96
+ "then": {
97
+ "primary_candidates": ["anthropic/claude-sonnet-4-6", "anthropic/claude-opus-4-7"],
98
+ "fallback_candidates": ["openai/gpt-4o"]
99
+ }
100
+ },
101
+ {
102
+ "id": "summarization",
103
+ "when": { "intent.category": "summarization" },
104
+ "then": {
105
+ "primary_candidates": ["anthropic/claude-haiku-4-5", "google/gemini-2.5-flash"],
106
+ "fallback_candidates": ["anthropic/claude-sonnet-4-6"]
107
+ }
108
+ },
109
+ {
110
+ "id": "default-balanced",
111
+ "when": {},
112
+ "then": {
113
+ "primary_candidates": ["anthropic/claude-sonnet-4-6"],
114
+ "fallback_candidates": ["openai/gpt-4o", "google/gemini-2.5-pro"],
115
+ "cheap_path": "anthropic/claude-haiku-4-5",
116
+ "premium_path": "anthropic/claude-opus-4-7"
117
+ }
118
+ }
119
+ ]
120
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "apf_version": "1",
3
+ "package_version": "0.1.0",
4
+ "checksum": "{{SHA256_OF_PACKAGE_CONTENTS}}",
5
+ "provenance": {
6
+ "forged_by": "agent-forge@{{FORGE_VERSION}}",
7
+ "blueprint_hash": "{{SHA256}}",
8
+ "eval_run": "{{EVAL_RUN_ID}}",
9
+ "eval_passed_at": "{{ISO8601}}",
10
+ "authorizing_adr": "{{ADR-XXXX}}"
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ # Changelog — {{AGENT_NAME}}
2
+
3
+ Semver, strict. **Major** = contract break (tool removed, intent changes, input/output
4
+ schema changes). **Minor** = additive capability or tool, no break. **Patch** = prompt
5
+ fix, threshold tweak, or model swap within the same family + generation.
6
+
7
+ Each version carries a provenance hash in `.agentforgerc` (which forge version, which
8
+ blueprint, which eval run, which authorizing ADR).
9
+
10
+ ## [0.1.0] - {{YYYY-MM-DD}}
11
+
12
+ ### Added
13
+ - Initial forge by agent-forge.
@@ -0,0 +1,5 @@
1
+ {{CHOOSE_A_LICENSE}}
2
+
3
+ This Agent Package is licensed by its author. Replace this file with your chosen
4
+ license (e.g. MIT, Apache-2.0, or a proprietary notice). agent-forge does not impose
5
+ one — the package is yours.