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
@@ -0,0 +1,480 @@
1
+ > **Status**: COMPLETE (2026-02-27). All 5 phases implemented. 12 new MCP tools added (22 -> 34), 5-signal scoring, auto-observations on all submit_* handlers, confidence tracking with decay, git history enrichment, Atlassian integration, VS Code extension, all 12 agent prompts updated. Executed via 10 parallel agents using `general-purpose` type (worktree isolation bypassed due to Windows detection bug). Archived to `docs/plans/completed/` on 2026-02-27.
2
+
3
+ # Plan: Forge 2-Way Query Engine — Swarm Learning Architecture
4
+
5
+ ## Context
6
+
7
+ The forge pipeline server was built from the Graph RAG vision to replace vexp. The vector search, graph layer, AST parsing, hybrid scoring, and knowledge system are all implemented. But **most of the internal machinery is not exposed as MCP tools**:
8
+
9
+ - `QUERY_INBOUND_IMPACT` / `QUERY_OUTBOUND_IMPACT` Cypher queries exist in `graph-queries.ts` — **no MCP tool**
10
+ - `QUERY_SHORTEST_PATH` Cypher query exists — **no MCP tool**
11
+ - `observation-store.ts` has full `saveObservation()` with symbol linking — **no MCP tool**
12
+ - `session-tracker.ts` has `getRecentSessionObservations()`, `getSessionInfo()` — **no MCP tool**
13
+ - `confidence.ts` has `ConfidenceManager.boost()` and `decayAll()` — **never called**
14
+ - `intent-detector.ts` has `detectIntent()` + `getIntentStrategy()` — **bypassed** (hardcoded `'read'` at `context-tools.ts:131`)
15
+ - `MemoryBridge` has `saveMemory()` + `searchMemories()` — **only used in interview context injection**
16
+
17
+ The result is that forge has 22 MCP tools but agents can't access impact graphs, logic flows, session memory, or observation persistence. The knowledge confidence system exists but is inert. The intent detector exists but is bypassed.
18
+
19
+ **Goal**: Wire up all internal capabilities as MCP tools, add auto-observation during pipeline execution, activate confidence tracking, implement git history enrichment, and update all 12 agent prompts. Transform forge into a bidirectional query engine where agents pull context (Way 1) and push learnings back (Way 2).
20
+
21
+ ---
22
+
23
+ ## Phase 1: vexp Feature Parity — Expose Internal Code as MCP Tools
24
+
25
+ **Value**: Agents gain impact graphs, logic flows, session memory, and intent-aware search. Zero new algorithms needed — this is pure wiring.
26
+
27
+ ### 1.1 Create `src/tools/memory-tools.ts` (NEW)
28
+
29
+ Three tools following the pattern in `context-tools.ts`:
30
+
31
+ **`save_observation`** — wraps `saveObservation()` from `src/memory/observation-store.ts:56`
32
+ - Schema: `{ content, symbols?[], repo_id?, importance?, tags?[], category?, type? }`
33
+ - Handler: calls `saveObservation()` with `getCurrentSessionId()` from `session-tracker.ts:32`
34
+ - Returns: `{ id, stored, linkedSymbols, unresolvedSymbols }`
35
+
36
+ **`search_memory`** — wraps `MemoryBridge.searchMemories()` from `src/context/memory.ts:46`
37
+ - Schema: `{ query, repo_id?, session_id?, limit?, score_threshold? }`
38
+ - Returns: `{ results: [{ content, created_at, relevance_score, session_id }] }`
39
+
40
+ **`get_session_context`** — wraps `getRecentSessionObservations()` from `src/memory/session-tracker.ts:177`
41
+ - Schema: `{ query?, session_count?, limit? }`
42
+ - Returns: `{ current_session: {...}, recent_sessions: [...groups] }`
43
+ - Also calls `persistSessionMarker()` (line 83) to ensure current session is discoverable
44
+
45
+ ### 1.2 Create `src/tools/graph-tools.ts` (NEW)
46
+
47
+ Two tools:
48
+
49
+ **`get_impact_graph`** — wraps `QUERY_INBOUND_IMPACT` / `QUERY_OUTBOUND_IMPACT` from `src/query/graph-queries.ts:66-81`
50
+ - Schema: `{ symbol, repo_id, direction: 'inbound'|'outbound'|'both', depth? }`
51
+ - Handler: executes appropriate Cypher via `graphStore.query()`, parses raw FalkorDB response
52
+ - Returns: `{ symbol, direction, nodes: [...], edges: [...], total_nodes, total_edges }`
53
+ - Graceful degradation: returns `{ error: 'GRAPH_UNAVAILABLE' }` when FalkorDB is down
54
+
55
+ **`search_logic_flow`** — wraps `QUERY_SHORTEST_PATH` from `src/query/graph-queries.ts:90-96`
56
+ - Schema: `{ from_symbol, to_symbol, repo_id, max_depth? }`
57
+ - Returns: `{ from_symbol, to_symbol, paths: [...], connected: boolean }`
58
+
59
+ ### 1.3 Wire intent detection into `get_codebase_context`
60
+
61
+ **Modify**: `src/tools/context-tools.ts`
62
+ - Import `detectIntent`, `getIntentStrategy` from `src/query/intent-detector.ts`
63
+ - Call `detectIntent(input.query)` to classify query
64
+ - Call `getIntentStrategy(intent)` to get weight adjustments
65
+ - Pass weights through to `codebaseContext.getContext()` (requires adding fields to `CodebaseContextOptions`)
66
+ - Return actual detected `query_intent` instead of hardcoded `'read'`
67
+ - Also populate `related_memories` by calling `memoryBridge.searchMemories()` (currently returns `[]` at line 130)
68
+
69
+ **Modify**: `src/context/codebase.ts` — Add to `CodebaseContextOptions` (line 28):
70
+ ```typescript
71
+ vectorWeight?: number; // from intent strategy, default 0.6
72
+ graphWeight?: number; // from intent strategy, default 0.3
73
+ recencyWeight?: number; // from intent strategy, default 0.1
74
+ expandDepth?: number; // from intent strategy, default 2
75
+ ```
76
+ In `getContext()` at line 76, destructure these from options and pass to `hybridSearch()` call at line 127-135:
77
+ ```typescript
78
+ const searchResults = await hybridSearch(this.vectorStore, effectiveGraph, {
79
+ query,
80
+ repoId,
81
+ limit: maxResults * 2,
82
+ includeTests: options.includeTests ?? includeTests, // intent strategy can override
83
+ vectorWeight: options.vectorWeight,
84
+ graphWeight: options.graphWeight,
85
+ });
86
+ ```
87
+ Note: `hybridSearch` already accepts `vectorWeight` and `graphWeight` in `HybridSearchOptions` (hybrid-search.ts:24-25).
88
+
89
+ ### 1.4 Add `get_index_status` to `src/tools/registration-tools.ts`
90
+
91
+ - Schema: `{ repo_id? }`
92
+ - Consolidates: `vectorStore.getCounts()`, `graphStore.getCounts()`, `fileCache.getStats()`, `getUptimeSeconds()` from session-tracker, health status for each backend
93
+ - Returns: `{ repos, qdrant_health, falkordb_health, uptime_seconds, embedding_model, cache_stats }`
94
+
95
+ ### 1.5 Wire into `src/server.ts`
96
+
97
+ - Import `createMemoryTools` and `createGraphTools`
98
+ - Create factories: `createMemoryTools(memoryBridge, vectorStore, graphStore)`, `createGraphTools(graphStore)`
99
+ - Spread into `allTools`
100
+ - Pass `memoryBridge` to `createContextTools()` (for `related_memories` in `get_codebase_context`)
101
+
102
+ ### Phase 1 Files
103
+
104
+ | File | Action |
105
+ |------|--------|
106
+ | `src/tools/memory-tools.ts` | CREATE |
107
+ | `src/tools/graph-tools.ts` | CREATE |
108
+ | `src/tools/context-tools.ts` | MODIFY — intent detection + related_memories |
109
+ | `src/tools/registration-tools.ts` | MODIFY — add get_index_status |
110
+ | `src/context/codebase.ts` | MODIFY — accept weight overrides in options, pass to hybridSearch |
111
+ | `src/server.ts` | MODIFY — wire new tool factories |
112
+
113
+ **Tool count: 22 → 28** (+6: save_observation, search_memory, get_session_context, get_impact_graph, search_logic_flow, get_index_status)
114
+
115
+ ---
116
+
117
+ ## Phase 2: Swarm Learning — Auto-Observations + Confidence Tracking
118
+
119
+ **Value**: Agents automatically push learnings during pipeline execution. Knowledge items that prove useful gain confidence; unused ones decay. The system gets smarter over time.
120
+
121
+ ### 2.1 Auto-observations in phase handlers
122
+
123
+ **Modify**: `src/tools/phase-tools.ts`
124
+
125
+ In each `submit_*` handler, after successfully storing the phase output in SQLite, fire-and-forget call to `saveObservation()`:
126
+ - `submit_vision`: save summary of vision (first 500 chars), `type: 'procedural'`, `category: 'vision'`, `importance: 0.6`
127
+ - `submit_plan`: save architecture summary, `category: 'architecture'`, `importance: 0.6`
128
+ - `submit_design`: save design summary, `category: 'design'`, `importance: 0.5`
129
+ - `submit_test_plan`: save test plan summary, `category: 'test_plan'`, `importance: 0.5`
130
+ - `submit_implementation`: save module completion summary, `category: 'implementation'`, `importance: 0.5`
131
+ - `submit_verdict`: save verdict + findings summary, `category: 'inspection'`, `importance: 0.7`
132
+ - All tagged with `['auto_observation', phase_name, project_id]`
133
+ - All wrapped in try/catch, logged on failure, **never block** the phase transition
134
+
135
+ Needs: import `saveObservation` from `observation-store.ts`, `getCurrentSessionId` from `session-tracker.ts`, and access to `vectorStore` + `graphStore` (pass through `createPhaseTools` factory as `createPhaseTools(engine, contextInjector, vectorStore, graphStore)`).
136
+
137
+ **CRITICAL**: Guard against `vectorStore === null` and `graphStore === null`. When either backend is unavailable, skip auto-observation silently (log at debug level, never throw).
138
+
139
+ ### 2.2 Staleness detection on re-index
140
+
141
+ **Modify**: `src/ingestion/indexer.ts`
142
+
143
+ When a file is re-indexed and entities have changed (AST diff between old and new), call `MARK_SYMBOL_OBSERVATIONS_STALE` from `graph-queries.ts:170` for each changed symbol. This invalidates observations that reference modified code.
144
+
145
+ ### 2.3 Wire confidence tracking
146
+
147
+ **Modify**: `src/context/injector.ts`
148
+ - Accept `ConfidenceManager` (from `src/learning/confidence.ts`) + `QdrantVectorStore` in constructor
149
+ - After each `knowledgeSearch.search*()` call that returns results, fire-and-forget `confidenceManager.boost()` for each result ID
150
+ - This means knowledge items actually used by agents see confidence rise automatically
151
+
152
+ **Modify**: `src/server.ts`
153
+ - Instantiate `ConfidenceManager`
154
+ - Pass to `ContextInjector` constructor
155
+ - Add periodic decay: `setInterval(() => confidenceManager.decayAll(vectorStore), 24 * 60 * 60 * 1000)` (daily)
156
+
157
+ ### 2.4 Add `boost_knowledge` and `decay_knowledge` MCP tools
158
+
159
+ **Modify**: `src/tools/learning-tools.ts`
160
+
161
+ **`boost_knowledge`**: `{ knowledge_id, amount?, reason? }` — calls `confidenceManager.boost()`
162
+ **`decay_knowledge`**: `{ decay_rate? }` — calls `confidenceManager.decayAll()`
163
+
164
+ For Knowledge Keeper agent to use explicitly when it identifies valuable or outdated knowledge.
165
+
166
+ ### Phase 2 Files
167
+
168
+ | File | Action |
169
+ |------|--------|
170
+ | `src/tools/phase-tools.ts` | MODIFY — auto-observation on each submit |
171
+ | `src/ingestion/indexer.ts` | MODIFY — mark stale observations on re-index |
172
+ | `src/context/injector.ts` | MODIFY — auto-boost on knowledge injection |
173
+ | `src/tools/learning-tools.ts` | MODIFY — add boost_knowledge, decay_knowledge |
174
+ | `src/server.ts` | MODIFY — wire ConfidenceManager, periodic decay |
175
+
176
+ **Tool count: 28 → 30** (+2: boost_knowledge, decay_knowledge)
177
+
178
+ ---
179
+
180
+ ## Phase 3: Git History Enrichment
181
+
182
+ **Value**: 4th scoring signal (hotspot), commit message search, file stability metrics. Implements git-jira-plan.md Part 1.
183
+
184
+ ### 3.1 Types
185
+
186
+ **Modify**: `src/util/types.ts`
187
+ - Add `FileChangeStats`: `{ commitCount, stabilityScore, changeVelocity, lastCommitHash, lastCommitTs, recentMessages[] }`
188
+ - Add `CommitRecord`: `{ hash, message, author, timestamp, files[] }`
189
+ - Add `GitCommitPayload` for Qdrant: `{ repo_id, commit_hash, message, author, timestamp, file_paths[] }`
190
+
191
+ ### 3.2 Enrich git analyzer
192
+
193
+ **Modify**: `src/ingestion/git-analyzer.ts`
194
+ - Add a SECOND `git log` call (do NOT modify the existing one used for co-modification parsing). New format: `git log --format="%H|%s|%an|%aI" --name-only` for subject, author, date
195
+ - Add `analyzeFileStats()` — per-file commit count, stability score (0-1), change velocity (-1 to +1)
196
+ - Add `extractCommitRecords()` — parse into `CommitRecord[]`, filter merge commits + bulk reformats (>50 files)
197
+ - Return `EnrichedGitAnalysisResult` extending `GitAnalysisResult` with `fileStats: Map<string, FileChangeStats>` and `commits: CommitRecord[]`
198
+
199
+ ### 3.3 Qdrant git_commits collection
200
+
201
+ **Modify**: `src/storage/qdrant-store.ts`
202
+ - Add `ensureGitCommitsCollection()` in `ensureCollections()`
203
+ - Add `upsertGitCommits()`, `searchGitCommits()`, `deleteGitCommitsByRepo()` as **QdrantVectorStore-specific methods** (NOT on the `VectorStore` interface — follows existing pattern at indexer.ts:484 where concrete type is used via cast)
204
+
205
+ ### 3.3b Write `commit_count` to FalkorDB File nodes
206
+
207
+ **Modify**: `src/ingestion/indexer.ts`
208
+ - After `runGitAnalysis()` returns `EnrichedGitAnalysisResult`, iterate `fileStats` map
209
+ - For each file with stats, call `graphStore.upsertNode('File', { path, repo_id }, { commit_count, stability_score, change_velocity, last_commit_hash, last_commit_ts })` to write git properties onto existing File nodes
210
+ - This provides the data source for Phase 3.5's hotspot scoring
211
+
212
+ ### 3.4 4-signal ranking
213
+
214
+ **Modify**: `src/query/ranking.ts`
215
+ - Weights: `0.55 vector + 0.25 graph + 0.10 recency + 0.10 hotspot`
216
+ - Add `hotspotScore` and `hotspotWeight` to `computeScore()` (backward-compatible: defaults to 0/0.10)
217
+ - Add `hotspotScore` to `ScoredResult`
218
+
219
+ ### 3.5 Hybrid search hotspot integration
220
+
221
+ **Modify**: `src/query/hybrid-search.ts`
222
+ - After graph expansion, fetch file hotspot scores from FalkorDB File node `commit_count` property
223
+ - Normalize: `hotspot = file.commit_count / max_commit_count_in_results`
224
+ - For `modify`/`debug`/`refactor` intent: pass hotspot. For `read` intent: pass 0
225
+
226
+ ### 3.6 New graph queries
227
+
228
+ **Modify**: `src/query/graph-queries.ts`
229
+ - Add `QUERY_FILE_HOTSPOTS(repoId)` — top 100 files by commit_count
230
+ - Add `QUERY_FILE_STATS(filePath, repoId)` — single file stats
231
+
232
+ ### 3.7 `get_git_context` MCP tool
233
+
234
+ **Modify**: `src/tools/context-tools.ts`
235
+ - Modes: `hotspots` | `commit_search` | `file_history`
236
+ - `hotspots`: top N files by change frequency + stability + velocity from FalkorDB
237
+ - `commit_search`: semantic search over commit messages in Qdrant `git_commits`
238
+ - `file_history`: last N commits for a specific file
239
+
240
+ ### Phase 3 Files
241
+
242
+ | File | Action |
243
+ |------|--------|
244
+ | `src/util/types.ts` | MODIFY |
245
+ | `src/ingestion/git-analyzer.ts` | MODIFY |
246
+ | `src/ingestion/indexer.ts` | MODIFY — embed commit messages |
247
+ | `src/storage/qdrant-store.ts` | MODIFY — git_commits collection |
248
+ | `src/query/ranking.ts` | MODIFY — 4-signal scoring |
249
+ | `src/query/hybrid-search.ts` | MODIFY — hotspot integration |
250
+ | `src/query/graph-queries.ts` | MODIFY — hotspot queries |
251
+ | `src/tools/context-tools.ts` | MODIFY — get_git_context tool |
252
+ | `src/server.ts` | MODIFY — wire new tool |
253
+
254
+ **Tool count: 30 → 31** (+1: get_git_context)
255
+
256
+ ---
257
+
258
+ ## Phase 4: 5-Signal Scoring + LSP Edge Ingestion + VS Code Extension
259
+
260
+ **Value**: Observation relevance becomes the 5th scoring signal. LSP edges enrich the graph beyond static parsing. A VS Code extension automatically feeds type-resolved call edges into forge.
261
+
262
+ ### 4.1 5-signal scoring
263
+
264
+ **Modify**: `src/query/ranking.ts`
265
+ - Weights become intent-dependent:
266
+
267
+ | Intent | Vector | Graph | Recency | Hotspot | Observation |
268
+ |--------|--------|-------|---------|---------|-------------|
269
+ | read | 0.55 | 0.20 | 0.05 | 0.10 | 0.10 |
270
+ | modify | 0.50 | 0.20 | 0.08 | 0.12 | 0.10 |
271
+ | debug | 0.40 | 0.25 | 0.05 | 0.10 | 0.20 |
272
+ | refactor | 0.35 | 0.30 | 0.05 | 0.15 | 0.15 |
273
+
274
+ - Add `observationScore: number` to `ScoredResult` interface and `observationWeight: number` to `computeScore()` params
275
+ - Observation score = count of non-stale observations linked to file symbols, normalized by max in result set
276
+ - Query Qdrant observations collection per file in results (parallelized with graph expansion, ~1-5ms each on localhost)
277
+
278
+ ### 4.2 `submit_lsp_edges` MCP tool
279
+
280
+ **Create**: `src/tools/ingestion-tools.ts`
281
+ - Schema: `{ repo_id, edges: [{ from_file, from_symbol, to_file, to_symbol, edge_type }] }`
282
+ - Handler: iterates edges, calls `graphStore.upsertEdge()` for each
283
+ - Returns: `{ accepted, failed }`
284
+ - Designed for the VS Code extension and CI pipelines
285
+
286
+ ### 4.3 VS Code Extension — `forge-lsp-bridge`
287
+
288
+ **Create**: `vscode-extension/` directory at repo root (separate publishable extension)
289
+
290
+ Minimal VS Code extension that hooks into TypeScript Language Server and sends call/reference edges to forge:
291
+
292
+ - `vscode-extension/package.json` — extension manifest, activates on TS/JS files
293
+ - `vscode-extension/src/extension.ts` — entry point, registers document change listener
294
+ - `vscode-extension/src/edge-collector.ts` — on file save, queries TS language server for:
295
+ - Call hierarchy (`vscode.commands.executeCommand('vscode.prepareCallHierarchy')`)
296
+ - Type definitions and references
297
+ - Collects edges as `{ from_file, from_symbol, to_file, to_symbol, edge_type }`
298
+ - `vscode-extension/src/forge-client.ts` — sends batched edges to forge MCP via stdio or HTTP
299
+ - Debounced: collects edges for 5 seconds after each save, then sends batch
300
+ - Config: `forge.lspBridge.enabled` (default: true), `forge.lspBridge.repoId` (auto-detected from .forge/manifest.yaml)
301
+ - `vscode-extension/tsconfig.json`, `vscode-extension/.vscodeignore`
302
+
303
+ **Key design**: The extension does NOT replace forge's static AST parsing — it supplements it with runtime-accurate type-resolved edges that tree-sitter misses (indirect calls, generics, overloaded methods).
304
+
305
+ ### Phase 4 Files
306
+
307
+ | File | Action |
308
+ |------|--------|
309
+ | `src/query/ranking.ts` | MODIFY — 5-signal weights |
310
+ | `src/query/hybrid-search.ts` | MODIFY — observation query |
311
+ | `src/query/intent-detector.ts` | MODIFY — 5-weight strategy tables |
312
+ | `src/tools/ingestion-tools.ts` | CREATE — submit_lsp_edges |
313
+ | `src/server.ts` | MODIFY — wire ingestion tools |
314
+ | `vscode-extension/` (entire directory) | CREATE — VS Code extension |
315
+
316
+ **Tool count: 31 → 32** (+1: submit_lsp_edges)
317
+
318
+ ---
319
+
320
+ ## Phase 5: Agent Prompt Updates + Cross-Agent Collaboration
321
+
322
+ **Value**: All 12 agents know about and use the new tools. Agent-to-agent broadcasting enables real-time knowledge sharing during pipeline execution.
323
+
324
+ ### 5.1 Update all 12 agent prompts
325
+
326
+ Add "Memory & Observation Tools" + "Graph Analysis Tools" sections to each agent in `plugin/agents/`:
327
+
328
+ **Agents that actively push observations** (produce learnings):
329
+ - `architect.md` — save architectural decisions, blast radius findings
330
+ - `inspector.md` — save findings, anti-patterns, verification results
331
+ - `knowledge-keeper.md` — save curated knowledge, route to appropriate store
332
+ - `backend-specialist.md`, `frontend-specialist.md`, `data-specialist.md`, `platform-engineer.md` — save implementation gotchas
333
+
334
+ **Agents that actively pull observations** (consume context):
335
+ - `strategist.md` — `search_memory` for similar past projects
336
+ - `supervisor.md` — `get_session_context` for what's been learned so far
337
+ - `architect.md` — `get_impact_graph` for blast radius, `search_logic_flow` for execution paths
338
+ - `inspector.md` — `get_git_context` for hotspot-aware verification
339
+
340
+ ### 5.2 Agent broadcast primitive
341
+
342
+ **Create**: `src/tools/collaboration-tools.ts`
343
+
344
+ **`broadcast_finding`**: `{ project_id, content, severity: 'info'|'warning'|'critical', target_agents?[], symbols?[] }`
345
+ - Saves as observation with `type: 'working'`, `category: 'agent_broadcast'`, `tags: ['broadcast', project_id]`
346
+ - Also records in SQLite `pipeline_events` as `agent_broadcast` event type
347
+
348
+ **`get_broadcasts`**: `{ project_id, since?, severity? }`
349
+ - Queries recent broadcasts for the project
350
+
351
+ **Modify**: `src/context/injector.ts` — include recent broadcasts when assembling phase context
352
+
353
+ ### 5.3 Atlassian Integration (from git-jira-plan.md Part 2)
354
+
355
+ Plugin-level only — no server code changes.
356
+
357
+ **Modify**: `plugin/.mcp.json` — add `atlassian` server:
358
+ ```json
359
+ "atlassian": {
360
+ "command": "uvx",
361
+ "args": ["mcp-atlassian"],
362
+ "env": { "JIRA_URL": "${JIRA_URL}", "JIRA_USERNAME": "${JIRA_USERNAME}", "JIRA_API_TOKEN": "${JIRA_API_TOKEN}" }
363
+ }
364
+ ```
365
+
366
+ **Update 7 agent prompts** with optional Atlassian sections (graceful — skip if unavailable):
367
+ - `strategist.md` — pull linked Jira issue, sprint context pre-interview; comment post-vision
368
+ - `architect.md` — check blocking issues, linked PRs; comment post-plan
369
+ - `inspector.md` — check acceptance criteria; comment pass/fail + transition issue
370
+ - `knowledge-keeper.md` — pull ticket changelog for decision history
371
+ - `product-manager.md` — pull existing stories/epics to avoid duplicate requirements
372
+ - `supervisor.md` — check sprint capacity for routing priority
373
+ - `platform-engineer.md` — CI pipeline status (future Bitbucket)
374
+
375
+ **Create**: `plugin/docs/atlassian-integration.md` — setup guide
376
+
377
+ **Graceful degradation**: Every Atlassian section wrapped in "## Atlassian Context (Optional)" with "If unavailable, skip without error."
378
+
379
+ ### 5.4 Extend `create_project` for Jira context
380
+
381
+ **Modify**: `src/tools/pipeline-tools.ts`
382
+ - Add optional `jira_ticket` and `jira_epic` fields to `createProjectSchema`
383
+ - Store in project metadata JSON
384
+ - Returned by `get_state` — agents auto-discover ticket key
385
+
386
+ ### Phase 5 Files
387
+
388
+ | File | Action |
389
+ |------|--------|
390
+ | `plugin/agents/*.md` (12 files) | MODIFY — new tool sections + Atlassian |
391
+ | `plugin/.mcp.json` | MODIFY — add atlassian server |
392
+ | `plugin/docs/atlassian-integration.md` | CREATE — setup guide |
393
+ | `src/tools/collaboration-tools.ts` | CREATE — broadcast_finding, get_broadcasts |
394
+ | `src/tools/pipeline-tools.ts` | MODIFY — jira_ticket, jira_epic fields |
395
+ | `src/context/injector.ts` | MODIFY — broadcast injection |
396
+ | `src/util/types.ts` | MODIFY — add agent_broadcast event type |
397
+ | `src/server.ts` | MODIFY — wire collaboration tools |
398
+
399
+ **Tool count: 32 → 34** (+2: broadcast_finding, get_broadcasts)
400
+
401
+ ---
402
+
403
+ ## Phase Dependencies
404
+
405
+ ```
406
+ Phase 1 (vexp parity) — no dependencies, all items parallelizable
407
+ |
408
+ v
409
+ Phase 2 (swarm learning) — depends on Phase 1 (needs save_observation tool)
410
+ |
411
+ v
412
+ Phase 3 (git enrichment) — independent of Phase 2, can run in parallel
413
+ |
414
+ +-----+-----+
415
+ | |
416
+ v v
417
+ Phase 4 Phase 5
418
+ (5-signal) (agent prompts + collaboration)
419
+ depends on Phase 5 depends on Phase 1 (tools must exist before prompts reference them)
420
+ Phase 2+3 Phase 5 Atlassian section is independent of all other phases
421
+ ```
422
+
423
+ **Parallelism opportunities:**
424
+ - Phase 1: all 4 new files are independent of each other
425
+ - Phase 2 and Phase 3 can overlap (Phase 2 needs Phase 1 done; Phase 3 is independent)
426
+ - Phase 5 agent prompts can start after Phase 1 (for graph/memory tools) and expand after later phases
427
+
428
+ ---
429
+
430
+ ## Existing Code to Reuse (NOT rebuild)
431
+
432
+ | Capability | File:Line | Status |
433
+ |-----------|-----------|--------|
434
+ | `saveObservation()` | `src/memory/observation-store.ts:56` | Fully implemented, needs MCP wrapper |
435
+ | `getRecentSessionObservations()` | `src/memory/session-tracker.ts:177` | Fully implemented, needs MCP wrapper |
436
+ | `getCurrentSessionId()` | `src/memory/session-tracker.ts:32` | Working |
437
+ | `persistSessionMarker()` | `src/memory/session-tracker.ts:83` | Working |
438
+ | `getSessionInfo()` | `src/memory/session-tracker.ts:320` | Working |
439
+ | `MemoryBridge.searchMemories()` | `src/context/memory.ts:46` | Working, used only in interview injection |
440
+ | `MemoryBridge.saveMemory()` | `src/context/memory.ts:123` | Working, never called |
441
+ | `QUERY_INBOUND_IMPACT` | `src/query/graph-queries.ts:66` | Working Cypher, no MCP tool |
442
+ | `QUERY_OUTBOUND_IMPACT` | `src/query/graph-queries.ts:76` | Working Cypher, no MCP tool |
443
+ | `QUERY_SHORTEST_PATH` | `src/query/graph-queries.ts:90` | Working Cypher, no MCP tool |
444
+ | `UPSERT_OBSERVATION` | `src/query/graph-queries.ts:136` | Used by observation-store |
445
+ | `LINK_OBSERVATION_TO_SYMBOL` | `src/query/graph-queries.ts:153` | Used by observation-store |
446
+ | `MARK_SYMBOL_OBSERVATIONS_STALE` | `src/query/graph-queries.ts:170` | Exists, never called |
447
+ | `detectIntent()` | `src/query/intent-detector.ts:39` | Working, never called from tools |
448
+ | `getIntentStrategy()` | `src/query/intent-detector.ts:70` | Working, never called from tools |
449
+ | `ConfidenceManager.boost()` | `src/learning/confidence.ts:147` | Fully implemented, never called |
450
+ | `ConfidenceManager.decayAll()` | `src/learning/confidence.ts:66` | Fully implemented, never called |
451
+ | `buildSkeleton()` | `src/context/codebase.ts:308` | Working |
452
+
453
+ ---
454
+
455
+ ## Verification
456
+
457
+ ### After Phase 1
458
+ 1. `npm run build` succeeds
459
+ 2. `npm test` passes
460
+ 3. Call `mcp__dk-forge__save_observation` with `{ content: "test observation", symbols: ["createForgeServer"], repo_id: "..." }` — returns `{ stored: true, linkedSymbols: [...] }`
461
+ 4. Call `mcp__dk-forge__search_memory` with `{ query: "test observation" }` — returns the saved observation
462
+ 5. Call `mcp__dk-forge__get_session_context` — returns current session info + recent observations
463
+ 6. Call `mcp__dk-forge__get_impact_graph` with `{ symbol: "createForgeServer", repo_id: "...", direction: "inbound" }` — returns callers
464
+ 7. Call `mcp__dk-forge__search_logic_flow` with two known connected symbols — returns path
465
+ 8. Call `mcp__dk-forge__get_codebase_context` with a debug-style query — verify `query_intent` is `'debug'` (not `'read'`)
466
+
467
+ ### After Phase 2
468
+ 9. Run a `/forge new test-project` through to `submit_verdict` — verify observations were auto-created (search for `tags: ['auto_observation']`)
469
+ 10. Verify `boostConfidence` is being called by checking logs for "ConfidenceManager.boost: boosted"
470
+ 11. Re-index a repo with a modified file — verify stale observations appear in search with `is_stale: true`
471
+
472
+ ### After Phase 3
473
+ 12. Call `mcp__dk-forge__get_git_context` with `mode: 'hotspots'` — returns files sorted by commit frequency
474
+ 13. Call `mcp__dk-forge__get_git_context` with `mode: 'commit_search', query: 'rebrand'` — returns relevant commits
475
+ 14. Call `mcp__dk-forge__get_codebase_context` — verify `match_reason` includes hotspot info for frequently-changed files
476
+
477
+ ### After All Phases
478
+ 15. Rebuild dist: `npm run build`
479
+ 16. Full pipeline run with `/forge new integration-test` — verify all agents can access new tools
480
+ 17. Verify tool count matches expected (34 total)