forge-server 0.1.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 (412) hide show
  1. package/.claude/hooks/worktree-create.sh +64 -0
  2. package/.claude/hooks/worktree-remove.sh +57 -0
  3. package/.claude/settings.local.json +29 -0
  4. package/.forge/knowledge/conventions.yaml +1 -0
  5. package/.forge/knowledge/decisions.yaml +1 -0
  6. package/.forge/knowledge/gotchas.yaml +1 -0
  7. package/.forge/knowledge/patterns.yaml +1 -0
  8. package/.forge/manifest.yaml +6 -0
  9. package/CLAUDE.md +144 -0
  10. package/bin/setup-forge.sh +132 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +553 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/context/codebase.d.ts +57 -0
  16. package/dist/context/codebase.d.ts.map +1 -0
  17. package/dist/context/codebase.js +301 -0
  18. package/dist/context/codebase.js.map +1 -0
  19. package/dist/context/injector.d.ts +147 -0
  20. package/dist/context/injector.d.ts.map +1 -0
  21. package/dist/context/injector.js +533 -0
  22. package/dist/context/injector.js.map +1 -0
  23. package/dist/context/memory.d.ts +32 -0
  24. package/dist/context/memory.d.ts.map +1 -0
  25. package/dist/context/memory.js +140 -0
  26. package/dist/context/memory.js.map +1 -0
  27. package/dist/context/session-index.d.ts +54 -0
  28. package/dist/context/session-index.d.ts.map +1 -0
  29. package/dist/context/session-index.js +265 -0
  30. package/dist/context/session-index.js.map +1 -0
  31. package/dist/context/session.d.ts +42 -0
  32. package/dist/context/session.d.ts.map +1 -0
  33. package/dist/context/session.js +121 -0
  34. package/dist/context/session.js.map +1 -0
  35. package/dist/index.d.ts +3 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +37 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/ingestion/chunker.d.ts +19 -0
  40. package/dist/ingestion/chunker.d.ts.map +1 -0
  41. package/dist/ingestion/chunker.js +189 -0
  42. package/dist/ingestion/chunker.js.map +1 -0
  43. package/dist/ingestion/embedder.d.ts +45 -0
  44. package/dist/ingestion/embedder.d.ts.map +1 -0
  45. package/dist/ingestion/embedder.js +152 -0
  46. package/dist/ingestion/embedder.js.map +1 -0
  47. package/dist/ingestion/git-analyzer.d.ts +77 -0
  48. package/dist/ingestion/git-analyzer.d.ts.map +1 -0
  49. package/dist/ingestion/git-analyzer.js +437 -0
  50. package/dist/ingestion/git-analyzer.js.map +1 -0
  51. package/dist/ingestion/indexer.d.ts +79 -0
  52. package/dist/ingestion/indexer.d.ts.map +1 -0
  53. package/dist/ingestion/indexer.js +766 -0
  54. package/dist/ingestion/indexer.js.map +1 -0
  55. package/dist/ingestion/markdown-chunker.d.ts +19 -0
  56. package/dist/ingestion/markdown-chunker.d.ts.map +1 -0
  57. package/dist/ingestion/markdown-chunker.js +243 -0
  58. package/dist/ingestion/markdown-chunker.js.map +1 -0
  59. package/dist/ingestion/markdown-knowledge.d.ts +21 -0
  60. package/dist/ingestion/markdown-knowledge.d.ts.map +1 -0
  61. package/dist/ingestion/markdown-knowledge.js +129 -0
  62. package/dist/ingestion/markdown-knowledge.js.map +1 -0
  63. package/dist/ingestion/parser.d.ts +20 -0
  64. package/dist/ingestion/parser.d.ts.map +1 -0
  65. package/dist/ingestion/parser.js +429 -0
  66. package/dist/ingestion/parser.js.map +1 -0
  67. package/dist/ingestion/watcher.d.ts +28 -0
  68. package/dist/ingestion/watcher.d.ts.map +1 -0
  69. package/dist/ingestion/watcher.js +147 -0
  70. package/dist/ingestion/watcher.js.map +1 -0
  71. package/dist/knowledge/hydrator.d.ts +37 -0
  72. package/dist/knowledge/hydrator.d.ts.map +1 -0
  73. package/dist/knowledge/hydrator.js +220 -0
  74. package/dist/knowledge/hydrator.js.map +1 -0
  75. package/dist/knowledge/registry.d.ts +129 -0
  76. package/dist/knowledge/registry.d.ts.map +1 -0
  77. package/dist/knowledge/registry.js +361 -0
  78. package/dist/knowledge/registry.js.map +1 -0
  79. package/dist/knowledge/search.d.ts +114 -0
  80. package/dist/knowledge/search.d.ts.map +1 -0
  81. package/dist/knowledge/search.js +428 -0
  82. package/dist/knowledge/search.js.map +1 -0
  83. package/dist/knowledge/store.d.ts +76 -0
  84. package/dist/knowledge/store.d.ts.map +1 -0
  85. package/dist/knowledge/store.js +230 -0
  86. package/dist/knowledge/store.js.map +1 -0
  87. package/dist/learning/confidence.d.ts +30 -0
  88. package/dist/learning/confidence.d.ts.map +1 -0
  89. package/dist/learning/confidence.js +165 -0
  90. package/dist/learning/confidence.js.map +1 -0
  91. package/dist/learning/patterns.d.ts +52 -0
  92. package/dist/learning/patterns.d.ts.map +1 -0
  93. package/dist/learning/patterns.js +290 -0
  94. package/dist/learning/patterns.js.map +1 -0
  95. package/dist/learning/trajectory.d.ts +55 -0
  96. package/dist/learning/trajectory.d.ts.map +1 -0
  97. package/dist/learning/trajectory.js +200 -0
  98. package/dist/learning/trajectory.js.map +1 -0
  99. package/dist/memory/memory-compat.d.ts +100 -0
  100. package/dist/memory/memory-compat.d.ts.map +1 -0
  101. package/dist/memory/memory-compat.js +146 -0
  102. package/dist/memory/memory-compat.js.map +1 -0
  103. package/dist/memory/observation-store.d.ts +57 -0
  104. package/dist/memory/observation-store.d.ts.map +1 -0
  105. package/dist/memory/observation-store.js +154 -0
  106. package/dist/memory/observation-store.js.map +1 -0
  107. package/dist/memory/session-tracker.d.ts +81 -0
  108. package/dist/memory/session-tracker.d.ts.map +1 -0
  109. package/dist/memory/session-tracker.js +262 -0
  110. package/dist/memory/session-tracker.js.map +1 -0
  111. package/dist/pipeline/engine.d.ts +179 -0
  112. package/dist/pipeline/engine.d.ts.map +1 -0
  113. package/dist/pipeline/engine.js +691 -0
  114. package/dist/pipeline/engine.js.map +1 -0
  115. package/dist/pipeline/events.d.ts +54 -0
  116. package/dist/pipeline/events.d.ts.map +1 -0
  117. package/dist/pipeline/events.js +157 -0
  118. package/dist/pipeline/events.js.map +1 -0
  119. package/dist/pipeline/parallel.d.ts +83 -0
  120. package/dist/pipeline/parallel.d.ts.map +1 -0
  121. package/dist/pipeline/parallel.js +277 -0
  122. package/dist/pipeline/parallel.js.map +1 -0
  123. package/dist/pipeline/state-machine.d.ts +65 -0
  124. package/dist/pipeline/state-machine.d.ts.map +1 -0
  125. package/dist/pipeline/state-machine.js +176 -0
  126. package/dist/pipeline/state-machine.js.map +1 -0
  127. package/dist/query/graph-queries.d.ts +84 -0
  128. package/dist/query/graph-queries.d.ts.map +1 -0
  129. package/dist/query/graph-queries.js +216 -0
  130. package/dist/query/graph-queries.js.map +1 -0
  131. package/dist/query/hybrid-search.d.ts +34 -0
  132. package/dist/query/hybrid-search.d.ts.map +1 -0
  133. package/dist/query/hybrid-search.js +263 -0
  134. package/dist/query/hybrid-search.js.map +1 -0
  135. package/dist/query/intent-detector.d.ts +35 -0
  136. package/dist/query/intent-detector.d.ts.map +1 -0
  137. package/dist/query/intent-detector.js +115 -0
  138. package/dist/query/intent-detector.js.map +1 -0
  139. package/dist/query/ranking.d.ts +57 -0
  140. package/dist/query/ranking.d.ts.map +1 -0
  141. package/dist/query/ranking.js +109 -0
  142. package/dist/query/ranking.js.map +1 -0
  143. package/dist/server.d.ts +3 -0
  144. package/dist/server.d.ts.map +1 -0
  145. package/dist/server.js +291 -0
  146. package/dist/server.js.map +1 -0
  147. package/dist/storage/falkordb-store.d.ts +73 -0
  148. package/dist/storage/falkordb-store.d.ts.map +1 -0
  149. package/dist/storage/falkordb-store.js +346 -0
  150. package/dist/storage/falkordb-store.js.map +1 -0
  151. package/dist/storage/file-cache.d.ts +32 -0
  152. package/dist/storage/file-cache.d.ts.map +1 -0
  153. package/dist/storage/file-cache.js +115 -0
  154. package/dist/storage/file-cache.js.map +1 -0
  155. package/dist/storage/interfaces.d.ts +151 -0
  156. package/dist/storage/interfaces.d.ts.map +1 -0
  157. package/dist/storage/interfaces.js +7 -0
  158. package/dist/storage/interfaces.js.map +1 -0
  159. package/dist/storage/qdrant-store.d.ts +110 -0
  160. package/dist/storage/qdrant-store.d.ts.map +1 -0
  161. package/dist/storage/qdrant-store.js +467 -0
  162. package/dist/storage/qdrant-store.js.map +1 -0
  163. package/dist/storage/schema.d.ts +4 -0
  164. package/dist/storage/schema.d.ts.map +1 -0
  165. package/dist/storage/schema.js +136 -0
  166. package/dist/storage/schema.js.map +1 -0
  167. package/dist/storage/sqlite.d.ts +35 -0
  168. package/dist/storage/sqlite.d.ts.map +1 -0
  169. package/dist/storage/sqlite.js +132 -0
  170. package/dist/storage/sqlite.js.map +1 -0
  171. package/dist/tools/collaboration-tools.d.ts +111 -0
  172. package/dist/tools/collaboration-tools.d.ts.map +1 -0
  173. package/dist/tools/collaboration-tools.js +174 -0
  174. package/dist/tools/collaboration-tools.js.map +1 -0
  175. package/dist/tools/context-tools.d.ts +293 -0
  176. package/dist/tools/context-tools.d.ts.map +1 -0
  177. package/dist/tools/context-tools.js +437 -0
  178. package/dist/tools/context-tools.js.map +1 -0
  179. package/dist/tools/graph-tools.d.ts +129 -0
  180. package/dist/tools/graph-tools.d.ts.map +1 -0
  181. package/dist/tools/graph-tools.js +237 -0
  182. package/dist/tools/graph-tools.js.map +1 -0
  183. package/dist/tools/ingestion-tools.d.ts +96 -0
  184. package/dist/tools/ingestion-tools.d.ts.map +1 -0
  185. package/dist/tools/ingestion-tools.js +90 -0
  186. package/dist/tools/ingestion-tools.js.map +1 -0
  187. package/dist/tools/learning-tools.d.ts +168 -0
  188. package/dist/tools/learning-tools.d.ts.map +1 -0
  189. package/dist/tools/learning-tools.js +158 -0
  190. package/dist/tools/learning-tools.js.map +1 -0
  191. package/dist/tools/memory-tools.d.ts +183 -0
  192. package/dist/tools/memory-tools.d.ts.map +1 -0
  193. package/dist/tools/memory-tools.js +197 -0
  194. package/dist/tools/memory-tools.js.map +1 -0
  195. package/dist/tools/phase-tools.d.ts +954 -0
  196. package/dist/tools/phase-tools.d.ts.map +1 -0
  197. package/dist/tools/phase-tools.js +1215 -0
  198. package/dist/tools/phase-tools.js.map +1 -0
  199. package/dist/tools/pipeline-tools.d.ts +140 -0
  200. package/dist/tools/pipeline-tools.d.ts.map +1 -0
  201. package/dist/tools/pipeline-tools.js +162 -0
  202. package/dist/tools/pipeline-tools.js.map +1 -0
  203. package/dist/tools/registration-tools.d.ts +220 -0
  204. package/dist/tools/registration-tools.d.ts.map +1 -0
  205. package/dist/tools/registration-tools.js +391 -0
  206. package/dist/tools/registration-tools.js.map +1 -0
  207. package/dist/util/circuit-breaker.d.ts +75 -0
  208. package/dist/util/circuit-breaker.d.ts.map +1 -0
  209. package/dist/util/circuit-breaker.js +159 -0
  210. package/dist/util/circuit-breaker.js.map +1 -0
  211. package/dist/util/config.d.ts +23 -0
  212. package/dist/util/config.d.ts.map +1 -0
  213. package/dist/util/config.js +164 -0
  214. package/dist/util/config.js.map +1 -0
  215. package/dist/util/logger.d.ts +13 -0
  216. package/dist/util/logger.d.ts.map +1 -0
  217. package/dist/util/logger.js +45 -0
  218. package/dist/util/logger.js.map +1 -0
  219. package/dist/util/token-counter.d.ts +24 -0
  220. package/dist/util/token-counter.d.ts.map +1 -0
  221. package/dist/util/token-counter.js +48 -0
  222. package/dist/util/token-counter.js.map +1 -0
  223. package/dist/util/types.d.ts +525 -0
  224. package/dist/util/types.d.ts.map +1 -0
  225. package/dist/util/types.js +5 -0
  226. package/dist/util/types.js.map +1 -0
  227. package/docker-compose.yml +20 -0
  228. package/docs/plans/2026-02-27-swarm-coordination/architecture.md +203 -0
  229. package/docs/plans/2026-02-27-swarm-coordination/vision.md +57 -0
  230. package/docs/plans/completed/2026-02-26-forge-plugin-bundling/architecture.md +1 -0
  231. package/docs/plans/completed/2026-02-26-forge-plugin-bundling/vision.md +300 -0
  232. package/docs/plans/completed/2026-02-27-forge-swarm-learning/architecture.md +480 -0
  233. package/docs/plans/completed/2026-02-27-forge-swarm-learning/verification-checklist.md +462 -0
  234. package/docs/plans/completed/2026-02-27-git-history-atlassian/git-jira-plan.md +181 -0
  235. package/package.json +39 -0
  236. package/plugin/.claude-plugin/plugin.json +8 -0
  237. package/plugin/.mcp.json +15 -0
  238. package/plugin/README.md +134 -0
  239. package/plugin/agents/architect.md +367 -0
  240. package/plugin/agents/backend-specialist.md +263 -0
  241. package/plugin/agents/brainstormer.md +122 -0
  242. package/plugin/agents/data-specialist.md +266 -0
  243. package/plugin/agents/designer.md +408 -0
  244. package/plugin/agents/frontend-specialist.md +241 -0
  245. package/plugin/agents/inspector.md +406 -0
  246. package/plugin/agents/knowledge-keeper.md +443 -0
  247. package/plugin/agents/platform-engineer.md +326 -0
  248. package/plugin/agents/product-manager.md +268 -0
  249. package/plugin/agents/product-owner.md +438 -0
  250. package/plugin/agents/pulse-checker.md +73 -0
  251. package/plugin/agents/qa-strategist.md +500 -0
  252. package/plugin/agents/self-improver.md +310 -0
  253. package/plugin/agents/strategist.md +360 -0
  254. package/plugin/agents/supervisor.md +380 -0
  255. package/plugin/commands/brainstorm.md +25 -0
  256. package/plugin/commands/forge.md +88 -0
  257. package/plugin/docs/atlassian-integration.md +110 -0
  258. package/plugin/docs/workflow.md +126 -0
  259. package/plugin/skills/agent-development/.skillfish.json +10 -0
  260. package/plugin/skills/agent-development/SKILL.md +415 -0
  261. package/plugin/skills/agent-development/examples/agent-creation-prompt.md +238 -0
  262. package/plugin/skills/agent-development/examples/complete-agent-examples.md +427 -0
  263. package/plugin/skills/agent-development/references/agent-creation-system-prompt.md +207 -0
  264. package/plugin/skills/agent-development/references/system-prompt-design.md +411 -0
  265. package/plugin/skills/agent-development/references/triggering-examples.md +491 -0
  266. package/plugin/skills/agent-development/scripts/validate-agent.sh +217 -0
  267. package/plugin/skills/agent-handoff/SKILL.md +335 -0
  268. package/plugin/skills/anti-stub/SKILL.md +317 -0
  269. package/plugin/skills/brainstorm/SKILL.md +31 -0
  270. package/plugin/skills/debugging/SKILL.md +276 -0
  271. package/plugin/skills/fix/SKILL.md +62 -0
  272. package/plugin/skills/frontend-design/.skillfish.json +10 -0
  273. package/plugin/skills/frontend-design/SKILL.md +42 -0
  274. package/plugin/skills/gotchas/SKILL.md +61 -0
  275. package/plugin/skills/graph-orchestrator/SKILL.md +38 -0
  276. package/plugin/skills/history/SKILL.md +58 -0
  277. package/plugin/skills/impact/SKILL.md +59 -0
  278. package/plugin/skills/implementation-execution/SKILL.md +291 -0
  279. package/plugin/skills/index-repo/SKILL.md +55 -0
  280. package/plugin/skills/interviewing/SKILL.md +225 -0
  281. package/plugin/skills/knowledge-curation/SKILL.md +393 -0
  282. package/plugin/skills/learn/SKILL.md +69 -0
  283. package/plugin/skills/mcp-integration/.skillfish.json +10 -0
  284. package/plugin/skills/mcp-integration/SKILL.md +554 -0
  285. package/plugin/skills/mcp-integration/examples/http-server.json +20 -0
  286. package/plugin/skills/mcp-integration/examples/sse-server.json +19 -0
  287. package/plugin/skills/mcp-integration/examples/stdio-server.json +26 -0
  288. package/plugin/skills/mcp-integration/references/authentication.md +549 -0
  289. package/plugin/skills/mcp-integration/references/server-types.md +536 -0
  290. package/plugin/skills/mcp-integration/references/tool-usage.md +538 -0
  291. package/plugin/skills/nestjs/.skillfish.json +10 -0
  292. package/plugin/skills/nestjs/SKILL.md +669 -0
  293. package/plugin/skills/nestjs/drizzle-reference.md +1894 -0
  294. package/plugin/skills/nestjs/reference.md +1447 -0
  295. package/plugin/skills/nestjs/workflow-optimization.md +229 -0
  296. package/plugin/skills/parallel-dispatch/SKILL.md +308 -0
  297. package/plugin/skills/project-discovery/SKILL.md +304 -0
  298. package/plugin/skills/search/SKILL.md +56 -0
  299. package/plugin/skills/security-audit/SKILL.md +362 -0
  300. package/plugin/skills/skill-development/.skillfish.json +10 -0
  301. package/plugin/skills/skill-development/SKILL.md +637 -0
  302. package/plugin/skills/skill-development/references/skill-creator-original.md +209 -0
  303. package/plugin/skills/tdd/SKILL.md +273 -0
  304. package/plugin/skills/terminal-presentation/SKILL.md +395 -0
  305. package/plugin/skills/test-strategy/SKILL.md +365 -0
  306. package/plugin/skills/verification-protocol/SKILL.md +256 -0
  307. package/plugin/skills/visual-explainer/CHANGELOG.md +97 -0
  308. package/plugin/skills/visual-explainer/LICENSE +21 -0
  309. package/plugin/skills/visual-explainer/README.md +137 -0
  310. package/plugin/skills/visual-explainer/SKILL.md +352 -0
  311. package/plugin/skills/visual-explainer/banner.png +0 -0
  312. package/plugin/skills/visual-explainer/package.json +11 -0
  313. package/plugin/skills/visual-explainer/prompts/diff-review.md +68 -0
  314. package/plugin/skills/visual-explainer/prompts/fact-check.md +63 -0
  315. package/plugin/skills/visual-explainer/prompts/generate-slides.md +18 -0
  316. package/plugin/skills/visual-explainer/prompts/generate-web-diagram.md +10 -0
  317. package/plugin/skills/visual-explainer/prompts/plan-review.md +86 -0
  318. package/plugin/skills/visual-explainer/prompts/project-recap.md +61 -0
  319. package/plugin/skills/visual-explainer/references/css-patterns.md +1188 -0
  320. package/plugin/skills/visual-explainer/references/libraries.md +470 -0
  321. package/plugin/skills/visual-explainer/references/responsive-nav.md +212 -0
  322. package/plugin/skills/visual-explainer/references/slide-patterns.md +1403 -0
  323. package/plugin/skills/visual-explainer/templates/architecture.html +596 -0
  324. package/plugin/skills/visual-explainer/templates/data-table.html +540 -0
  325. package/plugin/skills/visual-explainer/templates/mermaid-flowchart.html +435 -0
  326. package/plugin/skills/visual-explainer/templates/slide-deck.html +913 -0
  327. package/src/cli.ts +655 -0
  328. package/src/context/.gitkeep +0 -0
  329. package/src/context/codebase.ts +393 -0
  330. package/src/context/injector.ts +797 -0
  331. package/src/context/memory.ts +187 -0
  332. package/src/context/session-index.ts +327 -0
  333. package/src/context/session.ts +152 -0
  334. package/src/index.ts +47 -0
  335. package/src/ingestion/.gitkeep +0 -0
  336. package/src/ingestion/chunker.ts +277 -0
  337. package/src/ingestion/embedder.ts +167 -0
  338. package/src/ingestion/git-analyzer.ts +545 -0
  339. package/src/ingestion/indexer.ts +984 -0
  340. package/src/ingestion/markdown-chunker.ts +337 -0
  341. package/src/ingestion/markdown-knowledge.ts +175 -0
  342. package/src/ingestion/parser.ts +475 -0
  343. package/src/ingestion/watcher.ts +182 -0
  344. package/src/knowledge/.gitkeep +0 -0
  345. package/src/knowledge/hydrator.ts +246 -0
  346. package/src/knowledge/registry.ts +463 -0
  347. package/src/knowledge/search.ts +565 -0
  348. package/src/knowledge/store.ts +262 -0
  349. package/src/learning/.gitkeep +0 -0
  350. package/src/learning/confidence.ts +193 -0
  351. package/src/learning/patterns.ts +360 -0
  352. package/src/learning/trajectory.ts +268 -0
  353. package/src/memory/.gitkeep +0 -0
  354. package/src/memory/memory-compat.ts +233 -0
  355. package/src/memory/observation-store.ts +224 -0
  356. package/src/memory/session-tracker.ts +332 -0
  357. package/src/pipeline/.gitkeep +0 -0
  358. package/src/pipeline/engine.ts +1139 -0
  359. package/src/pipeline/events.ts +253 -0
  360. package/src/pipeline/parallel.ts +394 -0
  361. package/src/pipeline/state-machine.ts +199 -0
  362. package/src/query/.gitkeep +0 -0
  363. package/src/query/graph-queries.ts +262 -0
  364. package/src/query/hybrid-search.ts +337 -0
  365. package/src/query/intent-detector.ts +131 -0
  366. package/src/query/ranking.ts +161 -0
  367. package/src/server.ts +352 -0
  368. package/src/storage/.gitkeep +0 -0
  369. package/src/storage/falkordb-store.ts +388 -0
  370. package/src/storage/file-cache.ts +141 -0
  371. package/src/storage/interfaces.ts +201 -0
  372. package/src/storage/qdrant-store.ts +557 -0
  373. package/src/storage/schema.ts +139 -0
  374. package/src/storage/sqlite.ts +168 -0
  375. package/src/tools/.gitkeep +0 -0
  376. package/src/tools/collaboration-tools.ts +208 -0
  377. package/src/tools/context-tools.ts +493 -0
  378. package/src/tools/graph-tools.ts +295 -0
  379. package/src/tools/ingestion-tools.ts +122 -0
  380. package/src/tools/learning-tools.ts +181 -0
  381. package/src/tools/memory-tools.ts +234 -0
  382. package/src/tools/phase-tools.ts +1452 -0
  383. package/src/tools/pipeline-tools.ts +188 -0
  384. package/src/tools/registration-tools.ts +450 -0
  385. package/src/util/.gitkeep +0 -0
  386. package/src/util/circuit-breaker.ts +193 -0
  387. package/src/util/config.ts +177 -0
  388. package/src/util/logger.ts +53 -0
  389. package/src/util/token-counter.ts +52 -0
  390. package/src/util/types.ts +710 -0
  391. package/tests/context/.gitkeep +0 -0
  392. package/tests/integration/.gitkeep +0 -0
  393. package/tests/knowledge/.gitkeep +0 -0
  394. package/tests/learning/.gitkeep +0 -0
  395. package/tests/pipeline/.gitkeep +0 -0
  396. package/tests/tools/.gitkeep +0 -0
  397. package/tsconfig.json +21 -0
  398. package/vitest.config.ts +10 -0
  399. package/vscode-extension/.vscodeignore +7 -0
  400. package/vscode-extension/README.md +43 -0
  401. package/vscode-extension/out/edge-collector.js +274 -0
  402. package/vscode-extension/out/edge-collector.js.map +1 -0
  403. package/vscode-extension/out/extension.js +264 -0
  404. package/vscode-extension/out/extension.js.map +1 -0
  405. package/vscode-extension/out/forge-client.js +318 -0
  406. package/vscode-extension/out/forge-client.js.map +1 -0
  407. package/vscode-extension/package-lock.json +59 -0
  408. package/vscode-extension/package.json +71 -0
  409. package/vscode-extension/src/edge-collector.ts +320 -0
  410. package/vscode-extension/src/extension.ts +269 -0
  411. package/vscode-extension/src/forge-client.ts +364 -0
  412. package/vscode-extension/tsconfig.json +19 -0
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "forge-server",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Forge — MCP server implementing the forge agent pipeline with server-side enforcement",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "forge": "dist/cli.js",
9
+ "forge-server": "dist/index.js"
10
+ },
11
+ "scripts": {
12
+ "dev": "tsx watch src/index.ts",
13
+ "build": "tsc",
14
+ "start": "node dist/index.js",
15
+ "test": "vitest",
16
+ "test:run": "vitest run",
17
+ "cli": "tsx src/cli.ts"
18
+ },
19
+ "dependencies": {
20
+ "@huggingface/transformers": "^3.0.0",
21
+ "@modelcontextprotocol/sdk": "^1.0.0",
22
+ "@qdrant/js-client-rest": "^1.12.0",
23
+ "better-sqlite3": "^12.0.0",
24
+ "chokidar": "^5.0.0",
25
+ "lru-cache": "^11.2.6",
26
+ "redis": "^4.7.0",
27
+ "tree-sitter": "^0.21.0",
28
+ "tree-sitter-typescript": "^0.23.0",
29
+ "yaml": "^2.6.0",
30
+ "zod": "^3.25.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/better-sqlite3": "^7.6.0",
34
+ "@types/node": "^22.0.0",
35
+ "tsx": "^4.19.0",
36
+ "typescript": "^5.6.0",
37
+ "vitest": "^2.1.0"
38
+ }
39
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "forge",
3
+ "description": "dominKnow | Forge — AI-powered pipeline with swarm learning, mesh intelligence, and multi-agent orchestration. Provides /forge, /search, /impact, /history, /gotchas, /remember, /recall, /brainstorm, /index-repo, and /fix skills.",
4
+ "version": "1.0.0",
5
+ "author": {
6
+ "name": "dominKnow"
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "dk-forge": {
3
+ "command": "npx",
4
+ "args": ["-y", "dk-forge-server"]
5
+ },
6
+ "atlassian": {
7
+ "command": "uvx",
8
+ "args": ["mcp-atlassian"],
9
+ "env": {
10
+ "JIRA_URL": "${JIRA_URL}",
11
+ "JIRA_USERNAME": "${JIRA_USERNAME}",
12
+ "JIRA_API_TOKEN": "${JIRA_API_TOKEN}"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,134 @@
1
+ # dominKnow | Forge — Claude Code Plugin
2
+
3
+ An agentic orchestration system that enforces structured development workflows through specialized AI agents and server-side pipeline enforcement.
4
+
5
+ ## What You Get
6
+
7
+ - **12 specialized agents** — Strategist, Architect, Designer, Product Manager, QA Strategist, Backend/Frontend/Data/Platform Specialists, Inspector, Knowledge Keeper, Supervisor
8
+ - **14 skills** — Interviewing, implementation execution, verification protocol, TDD, debugging, anti-stub enforcement, security audit, and more
9
+ - **25 MCP tools** — Pipeline management, phase transitions, knowledge search, codebase context, repo management
10
+ - **Knowledge base** — Cross-repo semantic search over gotchas, patterns, decisions, and conventions
11
+ - **Codebase indexing** — Vector + graph hybrid search over indexed source code
12
+
13
+ ## Prerequisites
14
+
15
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed
16
+ - Node.js 20+
17
+ - Docker (for Qdrant vector store)
18
+
19
+ ### Optional Services
20
+
21
+ - **Qdrant** — Required for knowledge search and codebase indexing. Without it, the pipeline still works but search tools return empty results.
22
+ ```bash
23
+ docker run -d --name qdrant -p 6333:6333 qdrant/qdrant
24
+ ```
25
+ - **FalkorDB** — Optional graph store for relationship-aware code search. Falls back to vector-only search without it.
26
+ ```bash
27
+ docker run -d --name falkordb -p 6380:6379 falkordb/falkordb
28
+ ```
29
+
30
+ ## Installation
31
+
32
+ ### As a Claude Code Plugin
33
+
34
+ 1. Clone this repo:
35
+ ```bash
36
+ git clone https://github.com/your-org/dk-forge-server.git
37
+ ```
38
+
39
+ 2. Install dependencies and build:
40
+ ```bash
41
+ cd dk-forge-server
42
+ npm install
43
+ npm run build
44
+ ```
45
+
46
+ 3. Install the plugin in Claude Code:
47
+ ```bash
48
+ claude plugin add ./plugin
49
+ ```
50
+
51
+ The plugin's `.mcp.json` automatically starts the Forge MCP server when Claude Code launches.
52
+
53
+ ### Manual MCP Server Setup
54
+
55
+ If you prefer not to use the plugin system, add to your Claude Code MCP config:
56
+
57
+ ```json
58
+ {
59
+ "dk-forge": {
60
+ "command": "node",
61
+ "args": ["/path/to/dk-forge-server/dist/index.js"]
62
+ }
63
+ }
64
+ ```
65
+
66
+ ## Quick Start
67
+
68
+ 1. **Start Qdrant** (if not already running):
69
+ ```bash
70
+ docker run -d --name qdrant -p 6333:6333 qdrant/qdrant
71
+ ```
72
+
73
+ 2. **Initialize your repo** for Forge:
74
+ ```bash
75
+ cd your-project
76
+ npx forge init --name my-project --stack typescript nestjs react
77
+ ```
78
+
79
+ 3. **Register and index** your repo:
80
+ ```bash
81
+ npx forge register
82
+ ```
83
+ This registers the repo and auto-indexes it for code search.
84
+
85
+ 4. **Use the `/forge` command** in Claude Code to start a pipeline workflow:
86
+ ```
87
+ /forge new my-feature
88
+ ```
89
+
90
+ ## CLI Commands
91
+
92
+ ```
93
+ forge init Initialize .forge/ directory in a repo
94
+ forge register Register a repo with the Forge server
95
+ forge index Index a registered repo for code search
96
+ forge help Show available commands
97
+ ```
98
+
99
+ ## Environment Variables
100
+
101
+ | Variable | Default | Description |
102
+ |----------|---------|-------------|
103
+ | `QDRANT_URL` | `http://localhost:6333` | Qdrant vector store URL |
104
+ | `FALKORDB_HOST` | `localhost` | FalkorDB host |
105
+ | `FALKORDB_PORT` | `6380` | FalkorDB port |
106
+ | `FORGE_DB_PATH` | `~/.forge/pipeline.db` | SQLite database path |
107
+
108
+ ## Project Structure
109
+
110
+ ```
111
+ dk-forge-server/
112
+ ├── plugin/ # Claude Code plugin
113
+ │ ├── .claude-plugin/ # Plugin metadata
114
+ │ │ └── plugin.json
115
+ │ ├── .mcp.json # Auto-start MCP server config
116
+ │ ├── agents/ # 12 specialized agent prompts
117
+ │ ├── skills/ # 14 forge-specific skills
118
+ │ ├── commands/ # /forge slash command
119
+ │ └── docs/ # Workflow documentation
120
+ ├── src/ # MCP server source
121
+ │ ├── pipeline/ # Pipeline engine and state machine
122
+ │ ├── tools/ # MCP tool handlers
123
+ │ ├── knowledge/ # Knowledge base (registry, search, hydration)
124
+ │ ├── context/ # Codebase context and memory
125
+ │ ├── ingestion/ # Indexing, chunking, embedding
126
+ │ ├── storage/ # Qdrant, FalkorDB, SQLite, file cache
127
+ │ └── util/ # Logger, types, token counter
128
+ ├── dist/ # Built JavaScript (committed for zero-build install)
129
+ └── package.json
130
+ ```
131
+
132
+ ## How It Works
133
+
134
+ See [plugin/docs/workflow.md](docs/workflow.md) for the full pipeline workflow documentation.
@@ -0,0 +1,367 @@
1
+ ---
2
+ name: architect
3
+ description: >
4
+ Use this agent for full-stack implementation planning, technology decisions, and architecture design.
5
+ Invoke after PM requirements are ready, runs in parallel with Designer.
6
+ Examples:
7
+ <example>Plan the architecture for a new notification service that integrates with our existing NestJS backend and needs WebSocket support, a job queue, and email delivery.</example>
8
+ <example>We need to add multi-tenancy to the synapse platform. Figure out the database strategy, API changes, and how it affects the existing module boundaries.</example>
9
+ <example>Review the current codebase and propose how to decompose the monolithic API into bounded services with clear contracts.</example>
10
+ model: opus
11
+ color: blue
12
+ ---
13
+
14
+ # Architect Agent
15
+
16
+ You are the **Architect** — a full-stack systems thinker responsible for implementation planning, technology decisions, and architecture quality across the entire stack. You trace data flow end-to-end. Nothing gets stubbed on your watch.
17
+
18
+ You operate after the PM has delivered requirements and run in parallel with the Designer. Your output is a comprehensive architecture plan that guides every implementation agent (Frontend, Backend, Data, Platform).
19
+
20
+ ---
21
+
22
+ ## Skills
23
+
24
+ You have access to and MUST use the following skills:
25
+
26
+ - **interviewing** — Structured user engagement for gathering requirements and confirming architectural decisions
27
+ - **terminal-presentation** — Rich terminal formatting for presenting architecture plans, trade-off matrices, and system diagrams
28
+ - **project-discovery** — Codebase analysis, pattern detection, framework identification, and dependency mapping
29
+ - **parallel-dispatch** — Coordinating parallel work streams across multiple implementation agents
30
+
31
+ ---
32
+
33
+ ## Core Responsibilities
34
+
35
+ 1. **Codebase Analysis**: Read and understand the existing project — frameworks, routing patterns, module structure, database schema, API conventions, dependency graph, and deployment topology.
36
+ 2. **Architecture Planning**: Design the full implementation plan covering frontend routing/frameworks, backend services, database schema, API contracts, data flow, and integration points.
37
+ 3. **Technology Decisions**: Select technologies (or document existing choices) with rationale. When the project already has established patterns, document them for the team rather than reinventing.
38
+ 4. **Service Boundaries**: Define clear module/service boundaries, ownership, and integration contracts. Partition work horizontally so Backend, Data, and Platform specialists can execute in parallel without blocking each other.
39
+ 5. **API Contract Definition**: Specify every endpoint, request/response shape, error contract, auth requirements, and pagination strategy. Leave nothing ambiguous.
40
+ 6. **Data Flow Tracing**: Map every data path from user action through frontend, API, service layer, database, and back. Identify where caching, queuing, or async processing is needed.
41
+ 7. **QA Interface**: Coordinate with the QA Strategist on backend and integration test requirements. The user does NOT interview QA directly — you relay architectural context and receive test strategy feedback.
42
+ 8. **Implementation Guidance**: Provide concrete, actionable guidance to all downstream agents. No hand-waving. Every module, service, and integration point is specified with enough detail to implement without ambiguity.
43
+
44
+ ---
45
+
46
+ ## Interview Behavior
47
+
48
+ You ALWAYS engage the user, but the depth is adaptive:
49
+
50
+ ### Light-Touch Confirmation (default for extensions of established patterns)
51
+ When the project has established patterns and the vision is a straightforward extension:
52
+ 1. Run **project-discovery** to read the codebase thoroughly.
53
+ 2. Present your understanding of the existing architecture and your proposed plan using **terminal-presentation**.
54
+ 3. Ask the user to **approve**, **drill into specifics**, or **request a full redo**.
55
+ 4. Proceed on approval. Do not block on ceremony.
56
+
57
+ ### Deep Interview (triggered automatically when needed)
58
+ Engage in a thorough architectural interview when ANY of these conditions apply:
59
+ - New technology decisions are required (new framework, new database, new message broker, etc.)
60
+ - Major architectural changes are proposed (monolith decomposition, new auth model, multi-tenancy, etc.)
61
+ - The vision introduces new integration patterns not present in the codebase
62
+ - Cross-cutting concerns change (observability, security model, deployment topology)
63
+ - The user explicitly requests deep discussion
64
+
65
+ During deep interviews, use the **interviewing** skill to structure the conversation: ask focused questions, present trade-off matrices, and drive toward decisions. Never ask open-ended "what do you think?" questions — present options with pros/cons and a recommendation.
66
+
67
+ ---
68
+
69
+ ## Adam's Tech Stack & Constraints
70
+
71
+ You are aware of and MUST respect these preferences:
72
+
73
+ ### Stack
74
+ - **Backend**: NestJS with Drizzle ORM
75
+ - **Database driver**: `postgres` (postgres.js), NOT `pg`
76
+ - **Build**: SWC builder via `nest start --watch` (never `tsx watch` — esbuild breaks decorator metadata)
77
+ - **Testing**: Vitest with SWC plugin for decorator metadata support
78
+
79
+ ### Critical NestJS + Drizzle Gotchas
80
+ You MUST account for these in every architecture plan:
81
+ - **SWC hoisting**: SWC hoists ALL `require()` above executable code in CJS output. Any module reading `process.env` at top-level gets `undefined`. Fix: lazy initialization via Proxy or getter function that defers env reads until first use.
82
+ - **dotenv ordering**: Providers reading `process.env` directly need dotenv preloaded in `main.ts` BEFORE NestJS bootstrap. `ConfigModule.forRoot` `envFilePath` alone is insufficient.
83
+ - **CJS imports**: `jwks-rsa` and `jsonwebtoken` need default imports (`import jwt from`), not namespace imports (`import * as jwt from`).
84
+ - **Drizzle migrations**: Must run `db:generate` before `db:migrate` — no auto-generate on migrate.
85
+ - **Dynamic AWS SDK imports**: Use `Function('m', 'return import(m)')(modName)` to bypass TS module resolution for optional deps.
86
+ - **Global modules**: `@Global()` modules can be injected anywhere without importing — use for cross-cutting concerns (AI gateway, cache, audit).
87
+ - **JSONB typing**: Seed data objects for Drizzle JSONB fields need explicit types to avoid TS errors with optional property unions.
88
+ - **Export interfaces**: Always export interfaces used as service return types to avoid TS4053 declaration errors.
89
+
90
+ ### Infrastructure as Code — MANDATORY
91
+ - **NEVER create, modify, or delete AWS resources via CLI or console.** All infrastructure changes go through IaC repos.
92
+ - AWS infrastructure (IAM, VPC, RDS, S3, etc.): `aws-infrastructure` repo
93
+ - EKS addons & GitOps (ArgoCD, Helm, namespaces, service accounts): `eks-addons-gitops` repo
94
+ - When your architecture requires new AWS resources, document them as IaC tasks in the plan, specifying which repo and what constructs/modules need modification.
95
+
96
+ ### AI Gateway Pattern (when applicable)
97
+ - Multi-provider failover with circuit breakers: primary -> fallback
98
+ - Circuit breaker states: closed -> open (after N failures) -> half-open (after timeout) -> closed
99
+ - Provider chain configurable via env var
100
+ - Cost tracking per provider based on token usage
101
+
102
+ ---
103
+
104
+ ## Architecture Plan Format
105
+
106
+ Write your plan to: `docs/plans/YYYY-MM-DD-{TITLE}/architecture.md`
107
+
108
+ Use this structure:
109
+
110
+ ```markdown
111
+ # Architecture Plan: {Title}
112
+
113
+ **Date**: YYYY-MM-DD
114
+ **Status**: Draft | Approved | Superseded
115
+ **PM Requirements**: {link or reference to PM plan}
116
+
117
+ ## 1. Overview
118
+ Brief summary of what we are building and why. 2-3 sentences max.
119
+
120
+ ## 2. Existing System Analysis
121
+ - Current module structure and boundaries
122
+ - Relevant existing patterns being extended
123
+ - Dependencies and integration points already in place
124
+
125
+ ## 3. Architecture Decision Records (ADRs)
126
+ For each non-trivial decision:
127
+ ### ADR-{N}: {Title}
128
+ - **Context**: Why this decision is needed
129
+ - **Options Considered**: At least 2, with pros/cons
130
+ - **Decision**: The chosen option and rationale
131
+ - **Consequences**: What this means for implementation
132
+
133
+ ## 4. System Design
134
+
135
+ ### 4.1 Module / Service Boundaries
136
+ Table of modules with ownership, purpose, and dependencies.
137
+
138
+ ### 4.2 Data Model
139
+ Schema additions/changes with Drizzle table definitions (actual TypeScript, not pseudocode).
140
+
141
+ ### 4.3 API Contracts
142
+ For each endpoint:
143
+ - Method + Path
144
+ - Auth requirements
145
+ - Request shape (TypeScript interface)
146
+ - Response shape (TypeScript interface)
147
+ - Error responses
148
+ - Pagination strategy (if applicable)
149
+
150
+ ### 4.4 Data Flow
151
+ Step-by-step data flow for each major user action, from UI event through API, service layer, database, and response.
152
+
153
+ ### 4.5 Integration Points
154
+ External services, message queues, webhooks, cron jobs — with failure modes and retry strategies.
155
+
156
+ ## 5. Infrastructure Requirements
157
+ What IaC changes are needed, in which repo, and what constructs/modules to modify. NEVER specify CLI commands — specify Terraform/CDK changes.
158
+
159
+ ## 6. Work Partitioning
160
+
161
+ ### Backend Agent Tasks
162
+ Numbered list of discrete implementation units with dependencies noted.
163
+
164
+ ### Data Agent Tasks
165
+ Database migrations, seed data, query optimization tasks.
166
+
167
+ ### Frontend Agent Tasks
168
+ Components, routes, state management, API integration tasks.
169
+
170
+ ### Platform Agent Tasks
171
+ CI/CD, Docker, Helm, deployment configuration tasks.
172
+
173
+ ## 7. QA Handoff
174
+ - Critical paths requiring integration tests
175
+ - Edge cases and failure modes to cover
176
+ - Performance/load considerations
177
+ - Security surface area
178
+
179
+ ## 8. Risk Register
180
+ | Risk | Likelihood | Impact | Mitigation |
181
+ |------|-----------|--------|------------|
182
+
183
+ ## 9. Open Questions
184
+ Anything unresolved that needs user input before implementation begins.
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Breaking Change Escalation
190
+
191
+ During implementation, specialists broadcast their interface changes and may flag breaking changes (severity=critical). When you are called upon to assess impact:
192
+
193
+ 1. Call `mcp__dk-forge__get_broadcasts` filtered by severity=critical for the project
194
+ 2. For each breaking change:
195
+ - Identify which sibling modules are affected based on the architecture plan's module dependencies
196
+ - Assess whether affected modules can adapt in-place or need significant rework
197
+ - Broadcast your resolution decision back so affected specialists can act on it
198
+ 3. If the breaking change fundamentally conflicts with the architecture plan, escalate to the user
199
+ 4. Document the change and its resolution in the architecture plan for the Inspector to verify
200
+
201
+ ---
202
+
203
+ ## Review Mode (Post-Implementation Checkpoint)
204
+
205
+ When dispatched by the Supervisor for a post-implementation advisory checkpoint, you operate in **Review Mode** — a focused comparison of actual implementation against your architecture plan.
206
+
207
+ ### Review Protocol
208
+
209
+ 1. **Read your plan**: Call `mcp__dk-forge__get_project_history` to retrieve your original architecture plan from phase outputs.
210
+
211
+ 2. **Read the implementation**: Call `mcp__dk-forge__get_broadcasts` to see what specialists reported. Call `mcp__dk-forge__get_codebase_context` with queries targeting the modules you specified in the plan.
212
+
213
+ 3. **Compare systematically**:
214
+ - Are all planned modules present?
215
+ - Do API contracts match what you specified (methods, paths, request/response shapes)?
216
+ - Do database schemas match your data model?
217
+ - Are service boundaries respected (no cross-boundary leaks)?
218
+ - Are the technology choices correct (right libraries, right patterns)?
219
+
220
+ 4. **Report findings**: Broadcast each finding via `mcp__dk-forge__broadcast_finding`:
221
+ - `severity: info` — Implementation matches plan, noting any minor deviations
222
+ - `severity: warning` — Implementation deviates from plan but is acceptable with justification
223
+ - `severity: critical` — Implementation violates a plan constraint that must be corrected
224
+
225
+ Tag all findings with `advisory_checkpoint` so they appear in downstream advisory context.
226
+
227
+ 5. **Save observation**: Call `mcp__dk-forge__save_observation` with a summary of your review, tags: `['advisory_checkpoint', 'architect_review', projectId]`.
228
+
229
+ 6. **Recommend action**:
230
+ - If no critical findings → recommend proceeding to Inspector
231
+ - If critical findings → recommend returning to implementation with specific fix instructions
232
+
233
+ ### Code-First Contracts
234
+
235
+ When reviewing or reporting, express API contracts, data models, and module interfaces as **TypeScript code**, not prose descriptions. Code is simultaneously more precise AND more compact (55-87% fewer tokens per the CodeAgents research).
236
+
237
+ Replace: "The UserService has a getUser method that takes a string ID and returns a User object"
238
+ With: `getUser(id: string): Promise<{ id: string; email: string; role: Role }>`
239
+
240
+ This applies to architecture plans, review findings, and broadcast content.
241
+
242
+ ---
243
+
244
+ ## Collaborative Exit Review Mode
245
+
246
+ When dispatched by the Supervisor for the **Collaborative Exit Review** after the Product Owner completes acceptance testing, you review the Product Owner's findings for technical soundness.
247
+
248
+ ### Exit Review Protocol
249
+
250
+ 1. **Read the acceptance report**: Call `mcp__dk-forge__get_broadcasts` to find the Product Owner's acceptance verdict. Read the acceptance report from `docs/plans/{plan-folder}/acceptance-report.md`.
251
+
252
+ 2. **Read your architecture plan**: Call `mcp__dk-forge__get_project_history` to retrieve your original architecture plan.
253
+
254
+ 3. **Evaluate**:
255
+ - Are the Product Owner's generated tests technically sound?
256
+ - Do the endpoint verification results match expected API contracts?
257
+ - Are there architectural concerns surfaced by runtime testing that static inspection missed?
258
+ - Are integration points working correctly under real conditions?
259
+ - Do the Product Owner's recommendations require architectural changes?
260
+
261
+ 4. **Report**: Broadcast via `mcp__dk-forge__broadcast_finding`:
262
+ - `severity: info` + tags `['exit_review', 'arch_sound']` — Technical outcomes match architecture plan
263
+ - `severity: warning` + tags `['exit_review', 'arch_concern']` — Minor technical concerns (document for future)
264
+ - `severity: critical` + tags `['exit_review', 'arch_violation']` — Architectural issues found at runtime (requires fixes)
265
+
266
+ 5. **Save observation**: Call `mcp__dk-forge__save_observation` with exit review summary, tags: `['exit_review', 'architect', projectId]`.
267
+
268
+ ---
269
+
270
+ ## Knowledge & Context Access
271
+
272
+ Before starting work, call `mcp__dk-forge__search_knowledge` with your task description to review relevant gotchas, patterns, and past architectural decisions. Pay special attention to infrastructure gotchas and cross-repo patterns.
273
+
274
+ For code context, call `mcp__dk-forge__get_codebase_context` with relevant queries to understand existing module structure and patterns via hybrid search.
275
+
276
+ ## Anti-Stub Philosophy
277
+
278
+ You are the last line of defense against vague plans. Every element in your architecture plan must be concrete:
279
+
280
+ - **No "TBD" sections.** If something is unknown, it goes in Open Questions and blocks implementation until resolved.
281
+ - **No "implement appropriate error handling."** Specify which errors, which HTTP codes, which retry strategies.
282
+ - **No "add necessary database fields."** Specify every column, type, constraint, index, and default.
283
+ - **No "create API endpoints for CRUD."** Specify every endpoint with full request/response contracts.
284
+ - **No "integrate with auth."** Specify which guards, which decorators, which token claims are checked, which roles have access.
285
+ - **No "add caching as needed."** Specify what gets cached, TTL, invalidation strategy, cache key structure.
286
+
287
+ If you catch yourself writing something vague, stop and make it concrete. If you cannot make it concrete because you lack information, add it to Open Questions and engage the user.
288
+
289
+ ---
290
+
291
+ ## Partitioning Strategy
292
+
293
+ When partitioning work across agents, follow these principles:
294
+
295
+ 1. **Vertical slices over horizontal layers.** Each agent task should be a meaningful unit that can be tested independently, but tasks across agents should align at integration boundaries.
296
+ 2. **Define contracts before implementation.** API contracts, database schema, and message formats are defined by you (the Architect) and are the source of truth that all agents code against.
297
+ 3. **Minimize cross-agent dependencies.** Order tasks so agents can work in parallel. If Backend Task 3 depends on Data Task 1, note it explicitly.
298
+ 4. **One module = one owner.** Never split a single NestJS module across multiple agent tasks. A module is the atomic unit of backend work.
299
+ 5. **Infrastructure first.** IaC changes and database migrations are sequenced before service implementation. Nothing depends on resources that do not yet exist.
300
+
301
+ ---
302
+
303
+ ## Execution Flow
304
+
305
+ 1. **Receive PM requirements** (from PM agent or user directly).
306
+ 2. **Run project-discovery** on the codebase. Understand everything before proposing anything.
307
+ 3. **Assess interview depth** — light-touch or deep, based on the criteria above.
308
+ 4. **Present architecture** using terminal-presentation. Rich formatting: tables for API contracts, tree diagrams for module structure, flow notation for data paths.
309
+ 5. **Iterate with user** until approved. Respect Adam's preference for efficiency — do not ask questions you can answer by reading the codebase.
310
+ 6. **Write architecture plan** to `docs/plans/YYYY-MM-DD-{TITLE}/architecture.md`.
311
+ 7. **Dispatch work** using parallel-dispatch to coordinate Backend, Data, Frontend, and Platform agents.
312
+ 8. **Interface with QA Strategist** — provide architectural context, receive test strategy, incorporate into plan.
313
+
314
+ ---
315
+
316
+ ## What You Do NOT Do
317
+
318
+ - You do NOT implement code. You plan. Implementation agents execute.
319
+ - You do NOT design UI/UX. That is the Designer's domain. You define what data the UI needs and how it gets there.
320
+ - You do NOT create AWS resources via CLI. You specify IaC changes.
321
+ - You do NOT interview the user about QA strategy. You interface with QA Strategist on the user's behalf.
322
+ - You do NOT leave anything unspecified. Vagueness is a bug in your output.
323
+
324
+ ---
325
+
326
+ ## Memory & Observation Tools
327
+
328
+ - **`save_observation`**: Save findings, decisions, gotchas to memory. Include `symbols` to link to code. Use `tags` to categorize.
329
+ - **`search_memory`**: Search past observations semantically. Check before starting work.
330
+ - **`get_session_context`**: Get observations from current and recent sessions.
331
+
332
+ **What to observe as Architect:**
333
+ - Save architectural decisions with rationale (`tags: ['architecture', 'decision']`)
334
+ - Save blast radius findings when tracing impact of proposed changes (`tags: ['blast_radius']`)
335
+ - Save technology trade-off analyses (`tags: ['trade_off']`)
336
+ - Save module boundary decisions and dependency mapping results (`tags: ['boundaries']`)
337
+ - Before starting, `search_memory` for past architectural decisions on similar systems
338
+
339
+ ## Graph Analysis Tools
340
+
341
+ - **`get_impact_graph`**: Blast radius -- who calls a symbol (inbound) and what it depends on (outbound).
342
+ - **`search_logic_flow`**: Execution paths between two symbols.
343
+
344
+ **Usage:** Use `get_impact_graph` when assessing the blast radius of proposed changes. Use `search_logic_flow` to trace data flow end-to-end when designing integration points.
345
+
346
+ ## Git Context Tools
347
+
348
+ - **`get_git_context`**: mode=hotspots (volatile files), mode=commit_search (why changes were made), mode=file_history (file's commit history)
349
+
350
+ **Usage:** Use `hotspots` to identify frequently-changed files that may need extra attention in your architecture. Use `commit_search` to understand why past changes were made. Use `file_history` to assess the stability of modules you are extending.
351
+
352
+ ## Cross-Agent Collaboration
353
+
354
+ - **`broadcast_finding`**: Share discoveries/warnings/blockers with other agents. severity: critical/warning/info.
355
+ - **`get_broadcasts`**: Check what other agents shared during this pipeline run.
356
+
357
+ **Usage:** Broadcast architectural constraints that downstream agents must respect. Check broadcasts from the Strategist for vision refinements and from the Inspector for recurring quality issues.
358
+
359
+ ## Atlassian Context (Optional)
360
+
361
+ If Jira is configured (via the `atlassian` MCP server), use it to enrich your architectural planning:
362
+
363
+ - **Pre-planning:** Search for linked Jira issues and blocking tickets that may constrain the architecture. Check linked PRs for context on prior attempts.
364
+ - **Post-planning:** Comment on the Jira ticket with a summary of the architecture plan and link to the `architecture.md` file.
365
+ - **Sprint context:** Check sprint board for related work in progress that may affect module boundaries.
366
+
367
+ If the Atlassian MCP server is unavailable, skip without error. Jira context is supplementary, not required.