@miller-tech/uap 1.0.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 (660) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +888 -0
  3. package/dist/analyzers/index.d.ts +3 -0
  4. package/dist/analyzers/index.d.ts.map +1 -0
  5. package/dist/analyzers/index.js +684 -0
  6. package/dist/analyzers/index.js.map +1 -0
  7. package/dist/benchmarks/agents/naive-agent.d.ts +60 -0
  8. package/dist/benchmarks/agents/naive-agent.d.ts.map +1 -0
  9. package/dist/benchmarks/agents/naive-agent.js +144 -0
  10. package/dist/benchmarks/agents/naive-agent.js.map +1 -0
  11. package/dist/benchmarks/agents/uap-agent.d.ts +167 -0
  12. package/dist/benchmarks/agents/uap-agent.d.ts.map +1 -0
  13. package/dist/benchmarks/agents/uap-agent.js +437 -0
  14. package/dist/benchmarks/agents/uap-agent.js.map +1 -0
  15. package/dist/benchmarks/benchmark.d.ts +328 -0
  16. package/dist/benchmarks/benchmark.d.ts.map +1 -0
  17. package/dist/benchmarks/benchmark.js +112 -0
  18. package/dist/benchmarks/benchmark.js.map +1 -0
  19. package/dist/benchmarks/execution-verifier.d.ts +41 -0
  20. package/dist/benchmarks/execution-verifier.d.ts.map +1 -0
  21. package/dist/benchmarks/execution-verifier.js +340 -0
  22. package/dist/benchmarks/execution-verifier.js.map +1 -0
  23. package/dist/benchmarks/hierarchical-prompting.d.ts +37 -0
  24. package/dist/benchmarks/hierarchical-prompting.d.ts.map +1 -0
  25. package/dist/benchmarks/hierarchical-prompting.js +246 -0
  26. package/dist/benchmarks/hierarchical-prompting.js.map +1 -0
  27. package/dist/benchmarks/improved-benchmark.d.ts +89 -0
  28. package/dist/benchmarks/improved-benchmark.d.ts.map +1 -0
  29. package/dist/benchmarks/improved-benchmark.js +585 -0
  30. package/dist/benchmarks/improved-benchmark.js.map +1 -0
  31. package/dist/benchmarks/index.d.ts +11 -0
  32. package/dist/benchmarks/index.d.ts.map +1 -0
  33. package/dist/benchmarks/index.js +11 -0
  34. package/dist/benchmarks/index.js.map +1 -0
  35. package/dist/benchmarks/model-integration.d.ts +111 -0
  36. package/dist/benchmarks/model-integration.d.ts.map +1 -0
  37. package/dist/benchmarks/model-integration.js +904 -0
  38. package/dist/benchmarks/model-integration.js.map +1 -0
  39. package/dist/benchmarks/multi-turn-agent.d.ts +44 -0
  40. package/dist/benchmarks/multi-turn-agent.d.ts.map +1 -0
  41. package/dist/benchmarks/multi-turn-agent.js +254 -0
  42. package/dist/benchmarks/multi-turn-agent.js.map +1 -0
  43. package/dist/benchmarks/multi-turn-loop.d.ts +57 -0
  44. package/dist/benchmarks/multi-turn-loop.d.ts.map +1 -0
  45. package/dist/benchmarks/multi-turn-loop.js +167 -0
  46. package/dist/benchmarks/multi-turn-loop.js.map +1 -0
  47. package/dist/benchmarks/tasks.d.ts +19 -0
  48. package/dist/benchmarks/tasks.d.ts.map +1 -0
  49. package/dist/benchmarks/tasks.js +435 -0
  50. package/dist/benchmarks/tasks.js.map +1 -0
  51. package/dist/bin/cli.d.ts +3 -0
  52. package/dist/bin/cli.d.ts.map +1 -0
  53. package/dist/bin/cli.js +546 -0
  54. package/dist/bin/cli.js.map +1 -0
  55. package/dist/bin/llama-server-optimize.d.ts +18 -0
  56. package/dist/bin/llama-server-optimize.d.ts.map +1 -0
  57. package/dist/bin/llama-server-optimize.js +708 -0
  58. package/dist/bin/llama-server-optimize.js.map +1 -0
  59. package/dist/bin/policy.d.ts +3 -0
  60. package/dist/bin/policy.d.ts.map +1 -0
  61. package/dist/bin/policy.js +143 -0
  62. package/dist/bin/policy.js.map +1 -0
  63. package/dist/bin/tool-calls.d.ts +3 -0
  64. package/dist/bin/tool-calls.d.ts.map +1 -0
  65. package/dist/bin/tool-calls.js +4 -0
  66. package/dist/bin/tool-calls.js.map +1 -0
  67. package/dist/browser/index.d.ts +2 -0
  68. package/dist/browser/index.d.ts.map +1 -0
  69. package/dist/browser/index.js +2 -0
  70. package/dist/browser/index.js.map +1 -0
  71. package/dist/browser/web-browser.d.ts +30 -0
  72. package/dist/browser/web-browser.d.ts.map +1 -0
  73. package/dist/browser/web-browser.js +93 -0
  74. package/dist/browser/web-browser.js.map +1 -0
  75. package/dist/cli/agent.d.ts +20 -0
  76. package/dist/cli/agent.d.ts.map +1 -0
  77. package/dist/cli/agent.js +474 -0
  78. package/dist/cli/agent.js.map +1 -0
  79. package/dist/cli/analyze.d.ts +7 -0
  80. package/dist/cli/analyze.d.ts.map +1 -0
  81. package/dist/cli/analyze.js +103 -0
  82. package/dist/cli/analyze.js.map +1 -0
  83. package/dist/cli/completion-gates.d.ts +51 -0
  84. package/dist/cli/completion-gates.d.ts.map +1 -0
  85. package/dist/cli/completion-gates.js +201 -0
  86. package/dist/cli/completion-gates.js.map +1 -0
  87. package/dist/cli/compliance.d.ts +8 -0
  88. package/dist/cli/compliance.d.ts.map +1 -0
  89. package/dist/cli/compliance.js +509 -0
  90. package/dist/cli/compliance.js.map +1 -0
  91. package/dist/cli/coord.d.ts +7 -0
  92. package/dist/cli/coord.d.ts.map +1 -0
  93. package/dist/cli/coord.js +138 -0
  94. package/dist/cli/coord.js.map +1 -0
  95. package/dist/cli/dashboard.d.ts +21 -0
  96. package/dist/cli/dashboard.d.ts.map +1 -0
  97. package/dist/cli/dashboard.js +1508 -0
  98. package/dist/cli/dashboard.js.map +1 -0
  99. package/dist/cli/deploy.d.ts +19 -0
  100. package/dist/cli/deploy.d.ts.map +1 -0
  101. package/dist/cli/deploy.js +387 -0
  102. package/dist/cli/deploy.js.map +1 -0
  103. package/dist/cli/droids.d.ts +9 -0
  104. package/dist/cli/droids.d.ts.map +1 -0
  105. package/dist/cli/droids.js +227 -0
  106. package/dist/cli/droids.js.map +1 -0
  107. package/dist/cli/generate.d.ts +17 -0
  108. package/dist/cli/generate.d.ts.map +1 -0
  109. package/dist/cli/generate.js +432 -0
  110. package/dist/cli/generate.js.map +1 -0
  111. package/dist/cli/hooks.d.ts +9 -0
  112. package/dist/cli/hooks.d.ts.map +1 -0
  113. package/dist/cli/hooks.js +464 -0
  114. package/dist/cli/hooks.js.map +1 -0
  115. package/dist/cli/init.d.ts +12 -0
  116. package/dist/cli/init.d.ts.map +1 -0
  117. package/dist/cli/init.js +364 -0
  118. package/dist/cli/init.js.map +1 -0
  119. package/dist/cli/mcp-router.d.ts +16 -0
  120. package/dist/cli/mcp-router.d.ts.map +1 -0
  121. package/dist/cli/mcp-router.js +143 -0
  122. package/dist/cli/mcp-router.js.map +1 -0
  123. package/dist/cli/memory.d.ts +24 -0
  124. package/dist/cli/memory.d.ts.map +1 -0
  125. package/dist/cli/memory.js +885 -0
  126. package/dist/cli/memory.js.map +1 -0
  127. package/dist/cli/model.d.ts +15 -0
  128. package/dist/cli/model.d.ts.map +1 -0
  129. package/dist/cli/model.js +290 -0
  130. package/dist/cli/model.js.map +1 -0
  131. package/dist/cli/patterns.d.ts +26 -0
  132. package/dist/cli/patterns.d.ts.map +1 -0
  133. package/dist/cli/patterns.js +862 -0
  134. package/dist/cli/patterns.js.map +1 -0
  135. package/dist/cli/rtk-validation.d.ts +9 -0
  136. package/dist/cli/rtk-validation.d.ts.map +1 -0
  137. package/dist/cli/rtk-validation.js +9 -0
  138. package/dist/cli/rtk-validation.js.map +1 -0
  139. package/dist/cli/rtk.d.ts +34 -0
  140. package/dist/cli/rtk.d.ts.map +1 -0
  141. package/dist/cli/rtk.js +401 -0
  142. package/dist/cli/rtk.js.map +1 -0
  143. package/dist/cli/schema-diff.d.ts +7 -0
  144. package/dist/cli/schema-diff.d.ts.map +1 -0
  145. package/dist/cli/schema-diff.js +11 -0
  146. package/dist/cli/schema-diff.js.map +1 -0
  147. package/dist/cli/setup-mcp-router.d.ts +8 -0
  148. package/dist/cli/setup-mcp-router.d.ts.map +1 -0
  149. package/dist/cli/setup-mcp-router.js +163 -0
  150. package/dist/cli/setup-mcp-router.js.map +1 -0
  151. package/dist/cli/setup-wizard.d.ts +2 -0
  152. package/dist/cli/setup-wizard.d.ts.map +1 -0
  153. package/dist/cli/setup-wizard.js +806 -0
  154. package/dist/cli/setup-wizard.js.map +1 -0
  155. package/dist/cli/setup.d.ts +15 -0
  156. package/dist/cli/setup.d.ts.map +1 -0
  157. package/dist/cli/setup.js +154 -0
  158. package/dist/cli/setup.js.map +1 -0
  159. package/dist/cli/sync.d.ts +8 -0
  160. package/dist/cli/sync.d.ts.map +1 -0
  161. package/dist/cli/sync.js +395 -0
  162. package/dist/cli/sync.js.map +1 -0
  163. package/dist/cli/task.d.ts +33 -0
  164. package/dist/cli/task.d.ts.map +1 -0
  165. package/dist/cli/task.js +672 -0
  166. package/dist/cli/task.js.map +1 -0
  167. package/dist/cli/tool-calls.d.ts +20 -0
  168. package/dist/cli/tool-calls.d.ts.map +1 -0
  169. package/dist/cli/tool-calls.js +605 -0
  170. package/dist/cli/tool-calls.js.map +1 -0
  171. package/dist/cli/uap.d.ts +10 -0
  172. package/dist/cli/uap.d.ts.map +1 -0
  173. package/dist/cli/uap.js +398 -0
  174. package/dist/cli/uap.js.map +1 -0
  175. package/dist/cli/update.d.ts +10 -0
  176. package/dist/cli/update.d.ts.map +1 -0
  177. package/dist/cli/update.js +300 -0
  178. package/dist/cli/update.js.map +1 -0
  179. package/dist/cli/visualize.d.ts +77 -0
  180. package/dist/cli/visualize.d.ts.map +1 -0
  181. package/dist/cli/visualize.js +287 -0
  182. package/dist/cli/visualize.js.map +1 -0
  183. package/dist/cli/worktree.d.ts +9 -0
  184. package/dist/cli/worktree.d.ts.map +1 -0
  185. package/dist/cli/worktree.js +213 -0
  186. package/dist/cli/worktree.js.map +1 -0
  187. package/dist/coordination/adaptive-patterns.d.ts +65 -0
  188. package/dist/coordination/adaptive-patterns.d.ts.map +1 -0
  189. package/dist/coordination/adaptive-patterns.js +108 -0
  190. package/dist/coordination/adaptive-patterns.js.map +1 -0
  191. package/dist/coordination/auto-agent.d.ts +82 -0
  192. package/dist/coordination/auto-agent.d.ts.map +1 -0
  193. package/dist/coordination/auto-agent.js +145 -0
  194. package/dist/coordination/auto-agent.js.map +1 -0
  195. package/dist/coordination/capability-router.d.ts +79 -0
  196. package/dist/coordination/capability-router.d.ts.map +1 -0
  197. package/dist/coordination/capability-router.js +334 -0
  198. package/dist/coordination/capability-router.js.map +1 -0
  199. package/dist/coordination/database.d.ts +13 -0
  200. package/dist/coordination/database.d.ts.map +1 -0
  201. package/dist/coordination/database.js +136 -0
  202. package/dist/coordination/database.js.map +1 -0
  203. package/dist/coordination/deploy-batcher.d.ts +122 -0
  204. package/dist/coordination/deploy-batcher.d.ts.map +1 -0
  205. package/dist/coordination/deploy-batcher.js +718 -0
  206. package/dist/coordination/deploy-batcher.js.map +1 -0
  207. package/dist/coordination/droid-validator.d.ts +59 -0
  208. package/dist/coordination/droid-validator.d.ts.map +1 -0
  209. package/dist/coordination/droid-validator.js +142 -0
  210. package/dist/coordination/droid-validator.js.map +1 -0
  211. package/dist/coordination/index.d.ts +10 -0
  212. package/dist/coordination/index.d.ts.map +1 -0
  213. package/dist/coordination/index.js +10 -0
  214. package/dist/coordination/index.js.map +1 -0
  215. package/dist/coordination/pattern-router.d.ts +50 -0
  216. package/dist/coordination/pattern-router.d.ts.map +1 -0
  217. package/dist/coordination/pattern-router.js +118 -0
  218. package/dist/coordination/pattern-router.js.map +1 -0
  219. package/dist/coordination/service.d.ts +81 -0
  220. package/dist/coordination/service.d.ts.map +1 -0
  221. package/dist/coordination/service.js +619 -0
  222. package/dist/coordination/service.js.map +1 -0
  223. package/dist/coordination/worktree-enforcer.d.ts +22 -0
  224. package/dist/coordination/worktree-enforcer.d.ts.map +1 -0
  225. package/dist/coordination/worktree-enforcer.js +71 -0
  226. package/dist/coordination/worktree-enforcer.js.map +1 -0
  227. package/dist/generators/claude-md.d.ts +3 -0
  228. package/dist/generators/claude-md.d.ts.map +1 -0
  229. package/dist/generators/claude-md.js +1020 -0
  230. package/dist/generators/claude-md.js.map +1 -0
  231. package/dist/generators/template-loader.d.ts +105 -0
  232. package/dist/generators/template-loader.d.ts.map +1 -0
  233. package/dist/generators/template-loader.js +291 -0
  234. package/dist/generators/template-loader.js.map +1 -0
  235. package/dist/index.d.ts +49 -0
  236. package/dist/index.d.ts.map +1 -0
  237. package/dist/index.js +63 -0
  238. package/dist/index.js.map +1 -0
  239. package/dist/mcp-router/config/parser.d.ts +9 -0
  240. package/dist/mcp-router/config/parser.d.ts.map +1 -0
  241. package/dist/mcp-router/config/parser.js +174 -0
  242. package/dist/mcp-router/config/parser.js.map +1 -0
  243. package/dist/mcp-router/executor/client.d.ts +31 -0
  244. package/dist/mcp-router/executor/client.d.ts.map +1 -0
  245. package/dist/mcp-router/executor/client.js +189 -0
  246. package/dist/mcp-router/executor/client.js.map +1 -0
  247. package/dist/mcp-router/index.d.ts +22 -0
  248. package/dist/mcp-router/index.d.ts.map +1 -0
  249. package/dist/mcp-router/index.js +18 -0
  250. package/dist/mcp-router/index.js.map +1 -0
  251. package/dist/mcp-router/output-compressor.d.ts +26 -0
  252. package/dist/mcp-router/output-compressor.d.ts.map +1 -0
  253. package/dist/mcp-router/output-compressor.js +236 -0
  254. package/dist/mcp-router/output-compressor.js.map +1 -0
  255. package/dist/mcp-router/search/fuzzy.d.ts +26 -0
  256. package/dist/mcp-router/search/fuzzy.d.ts.map +1 -0
  257. package/dist/mcp-router/search/fuzzy.js +94 -0
  258. package/dist/mcp-router/search/fuzzy.js.map +1 -0
  259. package/dist/mcp-router/server.d.ts +50 -0
  260. package/dist/mcp-router/server.d.ts.map +1 -0
  261. package/dist/mcp-router/server.js +229 -0
  262. package/dist/mcp-router/server.js.map +1 -0
  263. package/dist/mcp-router/session-stats.d.ts +37 -0
  264. package/dist/mcp-router/session-stats.d.ts.map +1 -0
  265. package/dist/mcp-router/session-stats.js +56 -0
  266. package/dist/mcp-router/session-stats.js.map +1 -0
  267. package/dist/mcp-router/tools/discover.d.ts +37 -0
  268. package/dist/mcp-router/tools/discover.d.ts.map +1 -0
  269. package/dist/mcp-router/tools/discover.js +65 -0
  270. package/dist/mcp-router/tools/discover.js.map +1 -0
  271. package/dist/mcp-router/tools/execute.d.ts +43 -0
  272. package/dist/mcp-router/tools/execute.d.ts.map +1 -0
  273. package/dist/mcp-router/tools/execute.js +144 -0
  274. package/dist/mcp-router/tools/execute.js.map +1 -0
  275. package/dist/mcp-router/types.d.ts +62 -0
  276. package/dist/mcp-router/types.d.ts.map +1 -0
  277. package/dist/mcp-router/types.js +6 -0
  278. package/dist/mcp-router/types.js.map +1 -0
  279. package/dist/memory/adaptive-context.d.ts +149 -0
  280. package/dist/memory/adaptive-context.d.ts.map +1 -0
  281. package/dist/memory/adaptive-context.js +1095 -0
  282. package/dist/memory/adaptive-context.js.map +1 -0
  283. package/dist/memory/agent-scoped-memory.d.ts +67 -0
  284. package/dist/memory/agent-scoped-memory.d.ts.map +1 -0
  285. package/dist/memory/agent-scoped-memory.js +126 -0
  286. package/dist/memory/agent-scoped-memory.js.map +1 -0
  287. package/dist/memory/ambiguity-detector.d.ts +54 -0
  288. package/dist/memory/ambiguity-detector.d.ts.map +1 -0
  289. package/dist/memory/ambiguity-detector.js +401 -0
  290. package/dist/memory/ambiguity-detector.js.map +1 -0
  291. package/dist/memory/backends/base.d.ts +18 -0
  292. package/dist/memory/backends/base.d.ts.map +1 -0
  293. package/dist/memory/backends/base.js +2 -0
  294. package/dist/memory/backends/base.js.map +1 -0
  295. package/dist/memory/backends/factory.d.ts +4 -0
  296. package/dist/memory/backends/factory.d.ts.map +1 -0
  297. package/dist/memory/backends/factory.js +53 -0
  298. package/dist/memory/backends/factory.js.map +1 -0
  299. package/dist/memory/backends/github.d.ts +27 -0
  300. package/dist/memory/backends/github.d.ts.map +1 -0
  301. package/dist/memory/backends/github.js +134 -0
  302. package/dist/memory/backends/github.js.map +1 -0
  303. package/dist/memory/backends/qdrant-cloud.d.ts +32 -0
  304. package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
  305. package/dist/memory/backends/qdrant-cloud.js +167 -0
  306. package/dist/memory/backends/qdrant-cloud.js.map +1 -0
  307. package/dist/memory/context-compressor.d.ts +116 -0
  308. package/dist/memory/context-compressor.d.ts.map +1 -0
  309. package/dist/memory/context-compressor.js +430 -0
  310. package/dist/memory/context-compressor.js.map +1 -0
  311. package/dist/memory/context-pruner.d.ts +55 -0
  312. package/dist/memory/context-pruner.d.ts.map +1 -0
  313. package/dist/memory/context-pruner.js +85 -0
  314. package/dist/memory/context-pruner.js.map +1 -0
  315. package/dist/memory/correction-propagator.d.ts +44 -0
  316. package/dist/memory/correction-propagator.d.ts.map +1 -0
  317. package/dist/memory/correction-propagator.js +156 -0
  318. package/dist/memory/correction-propagator.js.map +1 -0
  319. package/dist/memory/daily-log.d.ts +67 -0
  320. package/dist/memory/daily-log.d.ts.map +1 -0
  321. package/dist/memory/daily-log.js +143 -0
  322. package/dist/memory/daily-log.js.map +1 -0
  323. package/dist/memory/dynamic-retrieval.d.ts +112 -0
  324. package/dist/memory/dynamic-retrieval.d.ts.map +1 -0
  325. package/dist/memory/dynamic-retrieval.js +908 -0
  326. package/dist/memory/dynamic-retrieval.js.map +1 -0
  327. package/dist/memory/embeddings.d.ts +172 -0
  328. package/dist/memory/embeddings.d.ts.map +1 -0
  329. package/dist/memory/embeddings.js +780 -0
  330. package/dist/memory/embeddings.js.map +1 -0
  331. package/dist/memory/generic-uap-patterns.d.ts +7 -0
  332. package/dist/memory/generic-uap-patterns.d.ts.map +1 -0
  333. package/dist/memory/generic-uap-patterns.js +43 -0
  334. package/dist/memory/generic-uap-patterns.js.map +1 -0
  335. package/dist/memory/hierarchical-memory.d.ts +141 -0
  336. package/dist/memory/hierarchical-memory.d.ts.map +1 -0
  337. package/dist/memory/hierarchical-memory.js +485 -0
  338. package/dist/memory/hierarchical-memory.js.map +1 -0
  339. package/dist/memory/knowledge-graph.d.ts +98 -0
  340. package/dist/memory/knowledge-graph.d.ts.map +1 -0
  341. package/dist/memory/knowledge-graph.js +275 -0
  342. package/dist/memory/knowledge-graph.js.map +1 -0
  343. package/dist/memory/memory-consolidator.d.ts +124 -0
  344. package/dist/memory/memory-consolidator.d.ts.map +1 -0
  345. package/dist/memory/memory-consolidator.js +514 -0
  346. package/dist/memory/memory-consolidator.js.map +1 -0
  347. package/dist/memory/memory-maintenance.d.ts +39 -0
  348. package/dist/memory/memory-maintenance.d.ts.map +1 -0
  349. package/dist/memory/memory-maintenance.js +336 -0
  350. package/dist/memory/memory-maintenance.js.map +1 -0
  351. package/dist/memory/model-router.d.ts +105 -0
  352. package/dist/memory/model-router.d.ts.map +1 -0
  353. package/dist/memory/model-router.js +474 -0
  354. package/dist/memory/model-router.js.map +1 -0
  355. package/dist/memory/multi-view-memory.d.ts +134 -0
  356. package/dist/memory/multi-view-memory.d.ts.map +1 -0
  357. package/dist/memory/multi-view-memory.js +430 -0
  358. package/dist/memory/multi-view-memory.js.map +1 -0
  359. package/dist/memory/predictive-memory.d.ts +79 -0
  360. package/dist/memory/predictive-memory.d.ts.map +1 -0
  361. package/dist/memory/predictive-memory.js +294 -0
  362. package/dist/memory/predictive-memory.js.map +1 -0
  363. package/dist/memory/prepopulate.d.ts +76 -0
  364. package/dist/memory/prepopulate.d.ts.map +1 -0
  365. package/dist/memory/prepopulate.js +832 -0
  366. package/dist/memory/prepopulate.js.map +1 -0
  367. package/dist/memory/semantic-compression.d.ts +77 -0
  368. package/dist/memory/semantic-compression.d.ts.map +1 -0
  369. package/dist/memory/semantic-compression.js +359 -0
  370. package/dist/memory/semantic-compression.js.map +1 -0
  371. package/dist/memory/serverless-qdrant.d.ts +102 -0
  372. package/dist/memory/serverless-qdrant.d.ts.map +1 -0
  373. package/dist/memory/serverless-qdrant.js +369 -0
  374. package/dist/memory/serverless-qdrant.js.map +1 -0
  375. package/dist/memory/short-term/factory.d.ts +26 -0
  376. package/dist/memory/short-term/factory.d.ts.map +1 -0
  377. package/dist/memory/short-term/factory.js +28 -0
  378. package/dist/memory/short-term/factory.js.map +1 -0
  379. package/dist/memory/short-term/indexeddb.d.ts +25 -0
  380. package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
  381. package/dist/memory/short-term/indexeddb.js +64 -0
  382. package/dist/memory/short-term/indexeddb.js.map +1 -0
  383. package/dist/memory/short-term/schema.d.ts +6 -0
  384. package/dist/memory/short-term/schema.d.ts.map +1 -0
  385. package/dist/memory/short-term/schema.js +141 -0
  386. package/dist/memory/short-term/schema.js.map +1 -0
  387. package/dist/memory/short-term/sqlite.d.ts +64 -0
  388. package/dist/memory/short-term/sqlite.d.ts.map +1 -0
  389. package/dist/memory/short-term/sqlite.js +274 -0
  390. package/dist/memory/short-term/sqlite.js.map +1 -0
  391. package/dist/memory/speculative-cache.d.ts +111 -0
  392. package/dist/memory/speculative-cache.d.ts.map +1 -0
  393. package/dist/memory/speculative-cache.js +457 -0
  394. package/dist/memory/speculative-cache.js.map +1 -0
  395. package/dist/memory/task-classifier.d.ts +40 -0
  396. package/dist/memory/task-classifier.d.ts.map +1 -0
  397. package/dist/memory/task-classifier.js +342 -0
  398. package/dist/memory/task-classifier.js.map +1 -0
  399. package/dist/memory/terminal-bench-knowledge.d.ts +48 -0
  400. package/dist/memory/terminal-bench-knowledge.d.ts.map +1 -0
  401. package/dist/memory/terminal-bench-knowledge.js +622 -0
  402. package/dist/memory/terminal-bench-knowledge.js.map +1 -0
  403. package/dist/memory/write-gate.d.ts +39 -0
  404. package/dist/memory/write-gate.d.ts.map +1 -0
  405. package/dist/memory/write-gate.js +190 -0
  406. package/dist/memory/write-gate.js.map +1 -0
  407. package/dist/models/api-client.d.ts +46 -0
  408. package/dist/models/api-client.d.ts.map +1 -0
  409. package/dist/models/api-client.js +182 -0
  410. package/dist/models/api-client.js.map +1 -0
  411. package/dist/models/execution-profiles.d.ts +64 -0
  412. package/dist/models/execution-profiles.d.ts.map +1 -0
  413. package/dist/models/execution-profiles.js +403 -0
  414. package/dist/models/execution-profiles.js.map +1 -0
  415. package/dist/models/executor.d.ts +130 -0
  416. package/dist/models/executor.d.ts.map +1 -0
  417. package/dist/models/executor.js +382 -0
  418. package/dist/models/executor.js.map +1 -0
  419. package/dist/models/index.d.ts +19 -0
  420. package/dist/models/index.d.ts.map +1 -0
  421. package/dist/models/index.js +23 -0
  422. package/dist/models/index.js.map +1 -0
  423. package/dist/models/plan-validator.d.ts +37 -0
  424. package/dist/models/plan-validator.d.ts.map +1 -0
  425. package/dist/models/plan-validator.js +179 -0
  426. package/dist/models/plan-validator.js.map +1 -0
  427. package/dist/models/planner.d.ts +73 -0
  428. package/dist/models/planner.d.ts.map +1 -0
  429. package/dist/models/planner.js +375 -0
  430. package/dist/models/planner.js.map +1 -0
  431. package/dist/models/router.d.ts +96 -0
  432. package/dist/models/router.d.ts.map +1 -0
  433. package/dist/models/router.js +523 -0
  434. package/dist/models/router.js.map +1 -0
  435. package/dist/models/types.d.ts +370 -0
  436. package/dist/models/types.d.ts.map +1 -0
  437. package/dist/models/types.js +232 -0
  438. package/dist/models/types.js.map +1 -0
  439. package/dist/models/unified-router.d.ts +152 -0
  440. package/dist/models/unified-router.d.ts.map +1 -0
  441. package/dist/models/unified-router.js +313 -0
  442. package/dist/models/unified-router.js.map +1 -0
  443. package/dist/policies/convert-policy-to-claude.d.ts +3 -0
  444. package/dist/policies/convert-policy-to-claude.d.ts.map +1 -0
  445. package/dist/policies/convert-policy-to-claude.js +87 -0
  446. package/dist/policies/convert-policy-to-claude.js.map +1 -0
  447. package/dist/policies/database-manager.d.ts +27 -0
  448. package/dist/policies/database-manager.d.ts.map +1 -0
  449. package/dist/policies/database-manager.js +198 -0
  450. package/dist/policies/database-manager.js.map +1 -0
  451. package/dist/policies/enforced-tool-router.d.ts +53 -0
  452. package/dist/policies/enforced-tool-router.d.ts.map +1 -0
  453. package/dist/policies/enforced-tool-router.js +80 -0
  454. package/dist/policies/enforced-tool-router.js.map +1 -0
  455. package/dist/policies/index.d.ts +10 -0
  456. package/dist/policies/index.d.ts.map +1 -0
  457. package/dist/policies/index.js +8 -0
  458. package/dist/policies/index.js.map +1 -0
  459. package/dist/policies/policy-gate.d.ts +59 -0
  460. package/dist/policies/policy-gate.d.ts.map +1 -0
  461. package/dist/policies/policy-gate.js +171 -0
  462. package/dist/policies/policy-gate.js.map +1 -0
  463. package/dist/policies/policy-memory.d.ts +18 -0
  464. package/dist/policies/policy-memory.d.ts.map +1 -0
  465. package/dist/policies/policy-memory.js +126 -0
  466. package/dist/policies/policy-memory.js.map +1 -0
  467. package/dist/policies/policy-tools.d.ts +11 -0
  468. package/dist/policies/policy-tools.d.ts.map +1 -0
  469. package/dist/policies/policy-tools.js +66 -0
  470. package/dist/policies/policy-tools.js.map +1 -0
  471. package/dist/policies/schemas/policy.d.ts +69 -0
  472. package/dist/policies/schemas/policy.d.ts.map +1 -0
  473. package/dist/policies/schemas/policy.js +31 -0
  474. package/dist/policies/schemas/policy.js.map +1 -0
  475. package/dist/tasks/coordination.d.ts +83 -0
  476. package/dist/tasks/coordination.d.ts.map +1 -0
  477. package/dist/tasks/coordination.js +291 -0
  478. package/dist/tasks/coordination.js.map +1 -0
  479. package/dist/tasks/database.d.ts +19 -0
  480. package/dist/tasks/database.d.ts.map +1 -0
  481. package/dist/tasks/database.js +149 -0
  482. package/dist/tasks/database.js.map +1 -0
  483. package/dist/tasks/decoder-gate.d.ts +64 -0
  484. package/dist/tasks/decoder-gate.d.ts.map +1 -0
  485. package/dist/tasks/decoder-gate.js +268 -0
  486. package/dist/tasks/decoder-gate.js.map +1 -0
  487. package/dist/tasks/index.d.ts +6 -0
  488. package/dist/tasks/index.d.ts.map +1 -0
  489. package/dist/tasks/index.js +6 -0
  490. package/dist/tasks/index.js.map +1 -0
  491. package/dist/tasks/service.d.ts +40 -0
  492. package/dist/tasks/service.d.ts.map +1 -0
  493. package/dist/tasks/service.js +671 -0
  494. package/dist/tasks/service.js.map +1 -0
  495. package/dist/tasks/types.d.ts +238 -0
  496. package/dist/tasks/types.d.ts.map +1 -0
  497. package/dist/tasks/types.js +74 -0
  498. package/dist/tasks/types.js.map +1 -0
  499. package/dist/telemetry/index.d.ts +2 -0
  500. package/dist/telemetry/index.d.ts.map +1 -0
  501. package/dist/telemetry/index.js +2 -0
  502. package/dist/telemetry/index.js.map +1 -0
  503. package/dist/telemetry/session-telemetry.d.ts +56 -0
  504. package/dist/telemetry/session-telemetry.d.ts.map +1 -0
  505. package/dist/telemetry/session-telemetry.js +807 -0
  506. package/dist/telemetry/session-telemetry.js.map +1 -0
  507. package/dist/types/analysis.d.ts +82 -0
  508. package/dist/types/analysis.d.ts.map +1 -0
  509. package/dist/types/analysis.js +2 -0
  510. package/dist/types/analysis.js.map +1 -0
  511. package/dist/types/config.d.ts +3324 -0
  512. package/dist/types/config.d.ts.map +1 -0
  513. package/dist/types/config.js +418 -0
  514. package/dist/types/config.js.map +1 -0
  515. package/dist/types/coordination.d.ts +240 -0
  516. package/dist/types/coordination.d.ts.map +1 -0
  517. package/dist/types/coordination.js +43 -0
  518. package/dist/types/coordination.js.map +1 -0
  519. package/dist/types/index.d.ts +4 -0
  520. package/dist/types/index.d.ts.map +1 -0
  521. package/dist/types/index.js +4 -0
  522. package/dist/types/index.js.map +1 -0
  523. package/dist/uap-droids-strict.d.ts +59 -0
  524. package/dist/uap-droids-strict.d.ts.map +1 -0
  525. package/dist/uap-droids-strict.js +200 -0
  526. package/dist/uap-droids-strict.js.map +1 -0
  527. package/dist/utils/config-manager.d.ts +30 -0
  528. package/dist/utils/config-manager.d.ts.map +1 -0
  529. package/dist/utils/config-manager.js +41 -0
  530. package/dist/utils/config-manager.js.map +1 -0
  531. package/dist/utils/fetch-with-retry.d.ts +5 -0
  532. package/dist/utils/fetch-with-retry.d.ts.map +1 -0
  533. package/dist/utils/fetch-with-retry.js +61 -0
  534. package/dist/utils/fetch-with-retry.js.map +1 -0
  535. package/dist/utils/merge-claude-md.d.ts +28 -0
  536. package/dist/utils/merge-claude-md.d.ts.map +1 -0
  537. package/dist/utils/merge-claude-md.js +342 -0
  538. package/dist/utils/merge-claude-md.js.map +1 -0
  539. package/dist/utils/rate-limiter.d.ts +58 -0
  540. package/dist/utils/rate-limiter.d.ts.map +1 -0
  541. package/dist/utils/rate-limiter.js +100 -0
  542. package/dist/utils/rate-limiter.js.map +1 -0
  543. package/dist/utils/string-similarity.d.ts +37 -0
  544. package/dist/utils/string-similarity.d.ts.map +1 -0
  545. package/dist/utils/string-similarity.js +114 -0
  546. package/dist/utils/string-similarity.js.map +1 -0
  547. package/dist/utils/validate-json.d.ts +51 -0
  548. package/dist/utils/validate-json.d.ts.map +1 -0
  549. package/dist/utils/validate-json.js +94 -0
  550. package/dist/utils/validate-json.js.map +1 -0
  551. package/docs/INDEX.md +66 -0
  552. package/docs/architecture/MULTI_MODEL.md +224 -0
  553. package/docs/architecture/SYSTEM_ANALYSIS.md +1117 -0
  554. package/docs/architecture/UAP_COMPLIANCE.md +217 -0
  555. package/docs/architecture/UAP_PROTOCOL.md +339 -0
  556. package/docs/architecture/UAP_STRICT_DROIDS.md +172 -0
  557. package/docs/archive/BALLS_MODE_SELF_ANALYSIS.md +260 -0
  558. package/docs/archive/FAILING_TASKS_SOLUTION_PLAN.md +668 -0
  559. package/docs/archive/JINJA2-SYSTEM-MESSAGE-FIX.md +209 -0
  560. package/docs/archive/NPM-PUBLISH-V0.9.1.md +240 -0
  561. package/docs/archive/OPTIMIZATION_OPTIONS.md +334 -0
  562. package/docs/archive/SETUP_IMPROVEMENTS.md +213 -0
  563. package/docs/archive/UAP_GENERIC_OPTIMIZATION_PLAN.md +270 -0
  564. package/docs/archive/UAP_V103_PATTERN_DESIGN.md +315 -0
  565. package/docs/archive/UAP_V104_COMPLIANCE_DESIGN.md +223 -0
  566. package/docs/archive/changelog/2026-03-10_uap-100-compliance.md +77 -0
  567. package/docs/archive/changelog/2026-03-10_uap-full-system-verification.md +109 -0
  568. package/docs/benchmarks/ACCURACY_ANALYSIS.md +471 -0
  569. package/docs/benchmarks/TOKEN_OPTIMIZATION.md +572 -0
  570. package/docs/benchmarks/VALIDATION_PLAN.md +568 -0
  571. package/docs/benchmarks/VALIDATION_RESULTS.md +161 -0
  572. package/docs/deployment/DEPLOYMENT.md +895 -0
  573. package/docs/deployment/DEPLOYMENT_STRATEGIES.md +518 -0
  574. package/docs/deployment/DEPLOY_BATCHER_ANALYSIS.md +856 -0
  575. package/docs/deployment/DEPLOY_BATCHING.md +273 -0
  576. package/docs/deployment/DEPLOY_BUCKETING_ANALYSIS.md +420 -0
  577. package/docs/deployment/QWEN35_LLAMA_CPP.md +265 -0
  578. package/docs/getting-started/INTEGRATION.md +449 -0
  579. package/docs/getting-started/OVERVIEW.md +344 -0
  580. package/docs/getting-started/SETUP.md +203 -0
  581. package/docs/integrations/MCP_ROUTER_SETUP.md +445 -0
  582. package/docs/integrations/RTK_INTEGRATION.md +468 -0
  583. package/docs/operations/TROUBLESHOOTING.md +660 -0
  584. package/docs/reference/API_REFERENCE.md +903 -0
  585. package/docs/reference/FEATURES.md +472 -0
  586. package/docs/reference/HARNESS-MATRIX.md +318 -0
  587. package/docs/reference/UAP_CLI_REFERENCE.md +600 -0
  588. package/docs/research/BEHAVIORAL_PATTERNS.md +228 -0
  589. package/docs/research/DOMAIN_STRATEGIES.md +316 -0
  590. package/docs/research/MEMORY_SYSTEMS_COMPARISON.md +812 -0
  591. package/docs/research/PATTERN_ANALYSIS_2026-01-18.md +436 -0
  592. package/docs/research/PERFORMANCE_ANALYSIS_2026-01-18.md +209 -0
  593. package/docs/research/PERFORMANCE_TEST_PLAN.md +383 -0
  594. package/docs/research/TERMINAL_BENCH_LEARNINGS.md +217 -0
  595. package/package.json +113 -0
  596. package/scripts/README.md +161 -0
  597. package/templates/CLAUDE.template.md +10 -0
  598. package/templates/CLAUDE_ARCHITECTURE.template.md +103 -0
  599. package/templates/CLAUDE_CODING.template.md +127 -0
  600. package/templates/CLAUDE_DROIDS.template.md +109 -0
  601. package/templates/CLAUDE_MEMORY.template.md +131 -0
  602. package/templates/CLAUDE_WORKFLOWS.template.md +139 -0
  603. package/templates/PROJECT.template.md +209 -0
  604. package/templates/SCHEMA.md +57 -0
  605. package/templates/archive/CLAUDE.template.root-v6.md +534 -0
  606. package/templates/archive/CLAUDE.template.v6.md +534 -0
  607. package/templates/hooks/forgecode/pre-compact.sh +68 -0
  608. package/templates/hooks/forgecode/session-start.sh +169 -0
  609. package/templates/hooks/forgecode.plugin.sh +128 -0
  610. package/templates/hooks/pre-compact.sh +74 -0
  611. package/templates/hooks/session-start.sh +366 -0
  612. package/tools/agents/README.md +224 -0
  613. package/tools/agents/UAP/README.md +386 -0
  614. package/tools/agents/UAP/__init__.py +9 -0
  615. package/tools/agents/UAP/cli.py +901 -0
  616. package/tools/agents/UAP/compliance_verify.sh +108 -0
  617. package/tools/agents/UAP/full_verification.sh +126 -0
  618. package/tools/agents/UAP/version.py +32 -0
  619. package/tools/agents/benchmarks/benchmark_memory_systems.py +730 -0
  620. package/tools/agents/benchmarks/results/benchmark_20260106_064817.json +170 -0
  621. package/tools/agents/benchmarks/results/benchmark_20260106_064817.md +51 -0
  622. package/tools/agents/config/chat_template.jinja +77 -0
  623. package/tools/agents/config/tool-call-schema.json +19 -0
  624. package/tools/agents/config/tool-call.gbnf +58 -0
  625. package/tools/agents/docker/Dockerfile.python +52 -0
  626. package/tools/agents/docker/Dockerfile.ubuntu +55 -0
  627. package/tools/agents/docker-compose.qdrant.yml +24 -0
  628. package/tools/agents/install-opencode-local.sh.j2 +135 -0
  629. package/tools/agents/migrations/apply.py +256 -0
  630. package/tools/agents/opencode_uap_agent.py +1505 -0
  631. package/tools/agents/plugin/README.md +91 -0
  632. package/tools/agents/plugin/index.ts +46 -0
  633. package/tools/agents/plugin/pre-compact.sh +68 -0
  634. package/tools/agents/plugin/session-start.sh +175 -0
  635. package/tools/agents/plugin/uap-commands.ts +45 -0
  636. package/tools/agents/plugin/uap-droids.ts +54 -0
  637. package/tools/agents/plugin/uap-patterns.ts +54 -0
  638. package/tools/agents/plugin/uap-skills.ts +52 -0
  639. package/tools/agents/plugins/uap-enforce.ts +314 -0
  640. package/tools/agents/scripts/__pycache__/tool_call_wrapper.cpython-313.pyc +0 -0
  641. package/tools/agents/scripts/chat_template_verifier.py +343 -0
  642. package/tools/agents/scripts/fix-qwen-template.js +38 -0
  643. package/tools/agents/scripts/fix_qwen_chat_template.py +316 -0
  644. package/tools/agents/scripts/generate_lora_training_data.py +412 -0
  645. package/tools/agents/scripts/init_qdrant.py +151 -0
  646. package/tools/agents/scripts/memory_migration.py +560 -0
  647. package/tools/agents/scripts/migrate_memory_to_qdrant.py +110 -0
  648. package/tools/agents/scripts/prepare_lora.sh +512 -0
  649. package/tools/agents/scripts/query_memory.py +200 -0
  650. package/tools/agents/scripts/qwen-tool-call-test.js +38 -0
  651. package/tools/agents/scripts/qwen-tool-call-wrapper.js +38 -0
  652. package/tools/agents/scripts/qwen_tool_call_test.py +464 -0
  653. package/tools/agents/scripts/qwen_tool_call_wrapper.py +686 -0
  654. package/tools/agents/scripts/start-services.sh +96 -0
  655. package/tools/agents/scripts/tool-choice-proxy.cjs +296 -0
  656. package/tools/agents/scripts/tool_call_test.py +656 -0
  657. package/tools/agents/scripts/tool_call_wrapper.py +799 -0
  658. package/tools/agents/tests/test_uap_compliance.py +257 -0
  659. package/tools/agents/uap_agent.py +122 -0
  660. package/tools/agents/uap_agent_install.sh +12 -0
@@ -0,0 +1,1117 @@
1
+ # Universal Agent Memory (UAP) - Complete Feature Analysis
2
+
3
+ > Comprehensive analysis of UAP functionality, architecture, and implications on AI agent performance. UAP provides persistent memory, multi-agent coordination, intelligent worktree management, and automated context generation for AI coding assistants.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Executive Summary](#executive-summary)
8
+ 2. [System Architecture](#system-architecture)
9
+ 3. [CLI Command Reference](#cli-command-reference)
10
+ 4. [Memory System](#memory-system)
11
+ 5. [Multi-Agent Coordination](#multi-agent-coordination)
12
+ 6. [Task Management System](#task-management-system)
13
+ 7. [Worktree Workflow](#worktree-workflow)
14
+ 8. [CLAUDE.md Generation](#claudemd-generation)
15
+ 9. [Deploy Batching](#deploy-batching)
16
+ 10. [Agent Performance Implications](#agent-performance-implications)
17
+ 11. [Integration Patterns](#integration-patterns)
18
+
19
+ ---
20
+
21
+ ## Executive Summary
22
+
23
+ UAP (Universal Agent Memory) is a comprehensive system designed to enhance AI agent capabilities through:
24
+
25
+ | Capability | Impact on Agent Performance |
26
+ | ---------------------------- | ----------------------------------------------- |
27
+ | **4-Layer Memory** | 10x context retention, reduces repetition |
28
+ | **Multi-Agent Coordination** | Eliminates merge conflicts, enables parallelism |
29
+ | **Task Management** | Structured work tracking, dependency awareness |
30
+ | **Worktree Isolation** | Safe experimentation, atomic PRs |
31
+ | **Deploy Batching** | 50-80% CI/CD cost reduction |
32
+ | **CLAUDE.md Generation** | Project-aware context, reduced hallucination |
33
+
34
+ ---
35
+
36
+ ## System Architecture
37
+
38
+ ```mermaid
39
+ graph TB
40
+ subgraph "AI Agent Layer"
41
+ CLAUDE[Claude/GPT Agent]
42
+ FACTORY[Factory.AI Agent]
43
+ VSCODE[VSCode Copilot]
44
+ end
45
+
46
+ subgraph "UAP Core"
47
+ CLI[CLI Interface]
48
+ MEM[Memory System]
49
+ COORD[Coordination Service]
50
+ TASK[Task Service]
51
+ DEPLOY[Deploy Batcher]
52
+ GEN[CLAUDE.md Generator]
53
+ end
54
+
55
+ subgraph "Storage Layer"
56
+ SQLITE[(SQLite)]
57
+ QDRANT[(Qdrant Vector DB)]
58
+ GIT[(Git Repository)]
59
+ end
60
+
61
+ subgraph "External Services"
62
+ OLLAMA[Ollama Embeddings]
63
+ GITHUB[GitHub API]
64
+ DOCKER[Docker]
65
+ end
66
+
67
+ CLAUDE --> CLI
68
+ FACTORY --> CLI
69
+ VSCODE --> CLI
70
+
71
+ CLI --> MEM
72
+ CLI --> COORD
73
+ CLI --> TASK
74
+ CLI --> DEPLOY
75
+ CLI --> GEN
76
+
77
+ MEM --> SQLITE
78
+ MEM --> QDRANT
79
+ MEM --> OLLAMA
80
+
81
+ COORD --> SQLITE
82
+ TASK --> SQLITE
83
+ DEPLOY --> SQLITE
84
+ DEPLOY --> GIT
85
+ DEPLOY --> GITHUB
86
+
87
+ GEN --> GIT
88
+ GEN --> MEM
89
+
90
+ style MEM fill:#e3f2fd
91
+ style COORD fill:#fff3e0
92
+ style TASK fill:#f3e5f5
93
+ style DEPLOY fill:#e8f5e9
94
+ ```
95
+
96
+ ### Component Overview
97
+
98
+ ```mermaid
99
+ mindmap
100
+ root((UAP))
101
+ Memory
102
+ Short-term SQLite
103
+ Long-term Qdrant
104
+ Session Memory
105
+ Knowledge Graph
106
+ Coordination
107
+ Agent Registry
108
+ Work Announcements
109
+ Message Bus
110
+ Overlap Detection
111
+ Tasks
112
+ Create/Update/Close
113
+ Dependencies
114
+ Priorities
115
+ Sync to JSONL
116
+ Worktrees
117
+ Create Branches
118
+ PR Generation
119
+ Cleanup
120
+ Deploy
121
+ Queue Actions
122
+ Batch Creation
123
+ Squash Commits
124
+ Parallel Execute
125
+ Generation
126
+ CLAUDE.md
127
+ AGENT.md
128
+ Project Analysis
129
+ ```
130
+
131
+ ---
132
+
133
+ ## CLI Command Reference
134
+
135
+ ### Command Hierarchy
136
+
137
+ ```mermaid
138
+ flowchart TB
139
+ UAP[uap]
140
+
141
+ UAP --> INIT[init]
142
+ UAP --> ANALYZE[analyze]
143
+ UAP --> GENERATE[generate]
144
+ UAP --> UPDATE[update]
145
+
146
+ UAP --> MEMORY[memory]
147
+ MEMORY --> M_STATUS[status]
148
+ MEMORY --> M_START[start]
149
+ MEMORY --> M_STOP[stop]
150
+ MEMORY --> M_QUERY[query]
151
+ MEMORY --> M_STORE[store]
152
+ MEMORY --> M_PREPOP[prepopulate]
153
+
154
+ UAP --> WORKTREE[worktree]
155
+ WORKTREE --> W_CREATE[create]
156
+ WORKTREE --> W_LIST[list]
157
+ WORKTREE --> W_PR[pr]
158
+ WORKTREE --> W_CLEANUP[cleanup]
159
+
160
+ UAP --> AGENT[agent]
161
+ AGENT --> A_REG[register]
162
+ AGENT --> A_HB[heartbeat]
163
+ AGENT --> A_STATUS[status]
164
+ AGENT --> A_ANN[announce]
165
+ AGENT --> A_COMP[complete]
166
+ AGENT --> A_OVER[overlaps]
167
+ AGENT --> A_BROAD[broadcast]
168
+ AGENT --> A_SEND[send]
169
+ AGENT --> A_RECV[receive]
170
+ AGENT --> A_DEREG[deregister]
171
+
172
+ UAP --> COORD[coord]
173
+ COORD --> C_STATUS[status]
174
+ COORD --> C_FLUSH[flush]
175
+ COORD --> C_CLEAN[cleanup]
176
+
177
+ UAP --> DEPLOY[deploy]
178
+ DEPLOY --> D_QUEUE[queue]
179
+ DEPLOY --> D_BATCH[batch]
180
+ DEPLOY --> D_EXEC[execute]
181
+ DEPLOY --> D_STATUS[status]
182
+ DEPLOY --> D_FLUSH[flush]
183
+
184
+ UAP --> TASK[task]
185
+ TASK --> T_CREATE[create]
186
+ TASK --> T_LIST[list]
187
+ TASK --> T_SHOW[show]
188
+ TASK --> T_UPDATE[update]
189
+ TASK --> T_CLOSE[close]
190
+ TASK --> T_DEP[dep/undep]
191
+ TASK --> T_CLAIM[claim]
192
+ TASK --> T_RELEASE[release]
193
+ TASK --> T_STATS[stats]
194
+ TASK --> T_SYNC[sync]
195
+
196
+ style MEMORY fill:#e3f2fd
197
+ style AGENT fill:#fff3e0
198
+ style DEPLOY fill:#e8f5e9
199
+ style TASK fill:#f3e5f5
200
+ ```
201
+
202
+ ### Command Summary Table
203
+
204
+ | Command | Subcommand | Purpose |
205
+ | -------------- | ----------------- | ---------------------------------------------------- |
206
+ | `uap init` | - | Initialize project with CLAUDE.md, memory, worktrees |
207
+ | `uap analyze` | - | Analyze project structure, generate metadata |
208
+ | `uap generate` | - | Generate/regenerate CLAUDE.md |
209
+ | `uap update` | - | Update all UAP components |
210
+ | `uap memory` | `status` | Show memory system status |
211
+ | | `start/stop` | Control Qdrant container |
212
+ | | `query <term>` | Search memories |
213
+ | | `store <content>` | Store new memory |
214
+ | | `prepopulate` | Import from docs/git history |
215
+ | `uap worktree` | `create <slug>` | Create isolated worktree |
216
+ | | `list` | List all worktrees |
217
+ | | `pr <id>` | Create PR from worktree |
218
+ | | `cleanup <id>` | Remove worktree and branch |
219
+ | `uap agent` | `register` | Register new agent |
220
+ | | `announce` | Announce work intent |
221
+ | | `overlaps` | Check for conflicts |
222
+ | | `broadcast/send` | Inter-agent messaging |
223
+ | `uap coord` | `status` | Show coordination status |
224
+ | | `cleanup` | Remove stale data |
225
+ | `uap deploy` | `queue` | Queue deploy action |
226
+ | | `batch` | Create batch from pending |
227
+ | | `execute` | Execute batch |
228
+ | | `flush` | Execute all pending |
229
+ | `uap task` | `create` | Create task |
230
+ | | `list/show` | View tasks |
231
+ | | `claim/release` | Work lifecycle |
232
+ | | `dep/undep` | Manage dependencies |
233
+
234
+ ---
235
+
236
+ ## Memory System
237
+
238
+ ### Four-Layer Architecture
239
+
240
+ ```mermaid
241
+ graph TB
242
+ subgraph "L1: Working Memory"
243
+ direction LR
244
+ W1[Recent Actions]
245
+ W2[Current Context]
246
+ W3[Active Decisions]
247
+ end
248
+
249
+ subgraph "L2: Session Memory"
250
+ direction LR
251
+ S1[Session Decisions]
252
+ S2[Important Context]
253
+ S3[Cross-Request State]
254
+ end
255
+
256
+ subgraph "L3: Semantic Memory"
257
+ direction LR
258
+ SE1[Learned Lessons]
259
+ SE2[Patterns]
260
+ SE3[Solutions]
261
+ end
262
+
263
+ subgraph "L4: Knowledge Graph"
264
+ direction LR
265
+ K1[Entities]
266
+ K2[Relationships]
267
+ K3[File Dependencies]
268
+ end
269
+
270
+ W1 --> S1
271
+ W2 --> S2
272
+ S1 --> SE1
273
+ S2 --> SE2
274
+ SE1 --> K1
275
+ SE2 --> K2
276
+
277
+ style W1 fill:#ffcdd2
278
+ style W2 fill:#ffcdd2
279
+ style W3 fill:#ffcdd2
280
+ style S1 fill:#fff9c4
281
+ style S2 fill:#fff9c4
282
+ style S3 fill:#fff9c4
283
+ style SE1 fill:#c8e6c9
284
+ style SE2 fill:#c8e6c9
285
+ style SE3 fill:#c8e6c9
286
+ style K1 fill:#bbdefb
287
+ style K2 fill:#bbdefb
288
+ style K3 fill:#bbdefb
289
+ ```
290
+
291
+ ### Memory Layer Characteristics
292
+
293
+ | Layer | Storage | Capacity | Latency | Retention |
294
+ | ----------------- | ------------------------------- | ---------- | ------- | ----------------- |
295
+ | **L1: Working** | SQLite `memories` | 50 entries | <1ms | Session |
296
+ | **L2: Session** | SQLite `session_memories` | Unlimited | <5ms | Project lifecycle |
297
+ | **L3: Semantic** | Qdrant vectors | Unlimited | ~50ms | Permanent |
298
+ | **L4: Knowledge** | SQLite `entities/relationships` | Unlimited | <20ms | Permanent |
299
+
300
+ ### Hierarchical Memory Manager
301
+
302
+ ```mermaid
303
+ stateDiagram-v2
304
+ [*] --> Hot: add()
305
+
306
+ Hot --> Hot: access() high frequency
307
+ Hot --> Warm: rebalance() overflow
308
+
309
+ Warm --> Hot: access() promotion
310
+ Warm --> Cold: rebalance() overflow
311
+
312
+ Cold --> Warm: query() retrieval
313
+ Cold --> Summary: consolidate()
314
+
315
+ Summary --> Cold: store summary
316
+
317
+ note right of Hot
318
+ In-context memory
319
+ Max 10 entries
320
+ 2000 tokens limit
321
+ end note
322
+
323
+ note right of Warm
324
+ Cached memory
325
+ Max 50 entries
326
+ Frequent access
327
+ end note
328
+
329
+ note right of Cold
330
+ Archived memory
331
+ Max 500 entries
332
+ Semantic search only
333
+ end note
334
+ ```
335
+
336
+ ### Memory Decay Formula
337
+
338
+ ```
339
+ effective_importance = importance × (0.95 ^ days_since_access)
340
+ ```
341
+
342
+ Example decay over time:
343
+
344
+ - Day 0: importance = 10.0
345
+ - Day 7: importance = 6.98 (30% decay)
346
+ - Day 30: importance = 2.15 (78% decay)
347
+ - Day 90: importance = 0.10 (99% decay)
348
+
349
+ ### Memory Operations Flow
350
+
351
+ ```mermaid
352
+ sequenceDiagram
353
+ participant Agent
354
+ participant CLI as uap memory
355
+ participant SQLite
356
+ participant Qdrant
357
+ participant Ollama
358
+
359
+ Note over Agent: Store Memory
360
+ Agent->>CLI: uap memory store "lesson"
361
+ CLI->>SQLite: INSERT into memories
362
+ CLI->>SQLite: INSERT into session_memories
363
+
364
+ alt importance >= 7
365
+ CLI->>Ollama: Generate embedding
366
+ Ollama-->>CLI: 384-dim vector
367
+ CLI->>Qdrant: Upsert to collection
368
+ end
369
+
370
+ Note over Agent: Query Memory
371
+ Agent->>CLI: uap memory query "pattern"
372
+ CLI->>SQLite: SELECT from memories (text match)
373
+ CLI->>SQLite: SELECT from session_memories
374
+
375
+ alt Need semantic search
376
+ CLI->>Ollama: Embed query
377
+ CLI->>Qdrant: Vector similarity search
378
+ Qdrant-->>CLI: Relevant memories
379
+ end
380
+
381
+ CLI-->>Agent: Combined results
382
+ ```
383
+
384
+ ### Prepopulation Sources
385
+
386
+ ```mermaid
387
+ flowchart LR
388
+ subgraph "Sources"
389
+ DOCS[Documentation]
390
+ GIT[Git History]
391
+ SKILLS[Skills/Droids]
392
+ end
393
+
394
+ subgraph "Extraction"
395
+ PARSE[Parse Content]
396
+ EXTRACT[Extract Patterns]
397
+ CLASSIFY[Classify Type]
398
+ end
399
+
400
+ subgraph "Storage"
401
+ ST[Short-term]
402
+ LT[Long-term]
403
+ KG[Knowledge Graph]
404
+ end
405
+
406
+ DOCS --> PARSE
407
+ GIT --> PARSE
408
+ SKILLS --> PARSE
409
+
410
+ PARSE --> EXTRACT
411
+ EXTRACT --> CLASSIFY
412
+
413
+ CLASSIFY --> ST
414
+ CLASSIFY --> LT
415
+ CLASSIFY --> KG
416
+ ```
417
+
418
+ ---
419
+
420
+ ## Multi-Agent Coordination
421
+
422
+ ### Agent Lifecycle
423
+
424
+ ```mermaid
425
+ stateDiagram-v2
426
+ [*] --> Registered: register()
427
+
428
+ Registered --> Active: heartbeat()
429
+ Active --> Active: heartbeat()
430
+ Active --> Idle: no current task
431
+ Idle --> Active: claim work
432
+
433
+ Active --> Completed: deregister()
434
+ Idle --> Completed: deregister()
435
+
436
+ Active --> Failed: heartbeat timeout
437
+ Idle --> Failed: heartbeat timeout
438
+
439
+ Completed --> [*]
440
+ Failed --> [*]
441
+ ```
442
+
443
+ ### Work Coordination Model
444
+
445
+ UAP uses **announcements** (not locks) for coordination. Agents work in isolated worktrees, so hard locks are unnecessary.
446
+
447
+ ```mermaid
448
+ flowchart TB
449
+ subgraph "Agent A (Worktree A)"
450
+ A1[Announce: editing src/auth.ts]
451
+ A2[Work in isolation]
452
+ A3[Complete work]
453
+ end
454
+
455
+ subgraph "Agent B (Worktree B)"
456
+ B1[Check overlaps]
457
+ B2[See Agent A working on auth]
458
+ B3[Choose different file or coordinate]
459
+ end
460
+
461
+ subgraph "Coordination Service"
462
+ CS[Overlap Detection]
463
+ MSG[Message Bus]
464
+ SUGG[Collaboration Suggestions]
465
+ end
466
+
467
+ A1 --> CS
468
+ B1 --> CS
469
+ CS --> B2
470
+ CS --> SUGG
471
+ SUGG --> B3
472
+
473
+ A3 --> MSG
474
+ MSG --> B3
475
+ ```
476
+
477
+ ### Overlap Detection & Conflict Risk
478
+
479
+ ```mermaid
480
+ flowchart TB
481
+ subgraph "Risk Assessment"
482
+ R1{Same File?}
483
+ R2{Same Directory?}
484
+ R3{Overlapping Files?}
485
+ R4{Intent Types?}
486
+ end
487
+
488
+ subgraph "Risk Levels"
489
+ CRIT[CRITICAL: Multiple editing same file]
490
+ HIGH[HIGH: Refactoring + editing same area]
491
+ MED[MEDIUM: Same directory]
492
+ LOW[LOW: Review/test/document]
493
+ NONE[NONE: No overlap]
494
+ end
495
+
496
+ R1 -->|Yes + editing| CRIT
497
+ R1 -->|Yes + mixed| HIGH
498
+ R1 -->|No| R2
499
+ R2 -->|Yes| MED
500
+ R2 -->|No| R3
501
+ R3 -->|Yes| MED
502
+ R3 -->|No| R4
503
+ R4 -->|Low risk types| LOW
504
+ R4 -->|No overlap| NONE
505
+
506
+ style CRIT fill:#ffcdd2
507
+ style HIGH fill:#ffab91
508
+ style MED fill:#fff9c4
509
+ style LOW fill:#c8e6c9
510
+ style NONE fill:#bbdefb
511
+ ```
512
+
513
+ ### Collaboration Suggestions
514
+
515
+ | Risk Level | Suggestion |
516
+ | ------------ | ----------------------------------------------- |
517
+ | **Critical** | STOP - One agent should wait or request handoff |
518
+ | **High** | Sequential work - agree on who merges first |
519
+ | **Medium** | Announce changes, coordinate merge order |
520
+ | **Low** | Parallel work safe, watch shared imports |
521
+ | **None** | Full parallel execution |
522
+
523
+ ### Inter-Agent Messaging
524
+
525
+ ```mermaid
526
+ sequenceDiagram
527
+ participant A1 as Agent 1
528
+ participant CS as Coordination Service
529
+ participant A2 as Agent 2
530
+ participant A3 as Agent 3
531
+
532
+ Note over A1,A3: Broadcast Message
533
+ A1->>CS: broadcast(channel: coordination)
534
+ CS->>A2: Message queued
535
+ CS->>A3: Message queued
536
+ A2->>CS: receive()
537
+ CS-->>A2: Messages
538
+
539
+ Note over A1,A2: Direct Message
540
+ A1->>CS: send(to: Agent2)
541
+ A2->>CS: receive()
542
+ CS-->>A2: Direct message
543
+ ```
544
+
545
+ ---
546
+
547
+ ## Task Management System
548
+
549
+ ### Task State Machine
550
+
551
+ ```mermaid
552
+ stateDiagram-v2
553
+ [*] --> open: create()
554
+
555
+ open --> in_progress: update(status)
556
+ open --> blocked: dependency added
557
+
558
+ in_progress --> blocked: blocker discovered
559
+ in_progress --> done: close()
560
+ in_progress --> wont_do: close(reason)
561
+
562
+ blocked --> in_progress: blockers resolved
563
+ blocked --> wont_do: abandoned
564
+
565
+ done --> [*]
566
+ wont_do --> [*]
567
+ ```
568
+
569
+ ### Task Hierarchy
570
+
571
+ ```mermaid
572
+ graph TB
573
+ subgraph "Task Types"
574
+ EPIC[Epic]
575
+ FEATURE[Feature]
576
+ STORY[Story]
577
+ TASK[Task]
578
+ BUG[Bug]
579
+ CHORE[Chore]
580
+ end
581
+
582
+ EPIC --> FEATURE
583
+ EPIC --> STORY
584
+ FEATURE --> TASK
585
+ FEATURE --> BUG
586
+ STORY --> TASK
587
+ STORY --> CHORE
588
+
589
+ style EPIC fill:#e1bee7
590
+ style FEATURE fill:#b3e5fc
591
+ style STORY fill:#c8e6c9
592
+ ```
593
+
594
+ ### Priority Levels
595
+
596
+ | Priority | Label | Use Case |
597
+ | -------- | -------- | -------------------------------- |
598
+ | P0 | Critical | Production down, security breach |
599
+ | P1 | High | Major functionality broken |
600
+ | P2 | Medium | Important but not urgent |
601
+ | P3 | Low | Nice to have |
602
+ | P4 | Backlog | Future consideration |
603
+
604
+ ### Task-Agent Integration
605
+
606
+ ```mermaid
607
+ sequenceDiagram
608
+ participant Agent
609
+ participant TaskSvc as Task Service
610
+ participant CoordSvc as Coordination Service
611
+ participant Worktree as Worktree Manager
612
+
613
+ Note over Agent: Claim Task
614
+ Agent->>TaskSvc: task claim <id>
615
+ TaskSvc->>TaskSvc: Update assignee
616
+ TaskSvc->>TaskSvc: Set status = in_progress
617
+ TaskSvc->>CoordSvc: Announce work intent
618
+ TaskSvc->>Worktree: Create worktree
619
+ Worktree-->>Agent: Worktree path
620
+
621
+ Note over Agent: Release Task
622
+ Agent->>TaskSvc: task release <id>
623
+ TaskSvc->>TaskSvc: Set status = done
624
+ TaskSvc->>CoordSvc: Announce completion
625
+ CoordSvc->>CoordSvc: Notify blocked tasks
626
+ ```
627
+
628
+ ### Dependency Management
629
+
630
+ ```mermaid
631
+ graph LR
632
+ subgraph "Dependency Types"
633
+ BLOCKS[blocks: A must complete before B]
634
+ RELATED[related: A and B are connected]
635
+ DISC[discovered_from: B found while working A]
636
+ end
637
+
638
+ T1[Task 1: Setup DB]
639
+ T2[Task 2: Add API]
640
+ T3[Task 3: Add Tests]
641
+ T4[Task 4: Documentation]
642
+
643
+ T1 -->|blocks| T2
644
+ T2 -->|blocks| T3
645
+ T2 -.->|related| T4
646
+ T3 -.->|discovered_from| T4
647
+ ```
648
+
649
+ ---
650
+
651
+ ## Worktree Workflow
652
+
653
+ ### Worktree Lifecycle
654
+
655
+ ```mermaid
656
+ stateDiagram-v2
657
+ [*] --> Created: worktree create <slug>
658
+
659
+ Created --> Working: cd .worktrees/NNN-slug
660
+ Working --> Working: commits, changes
661
+ Working --> PRCreated: worktree pr <id>
662
+
663
+ PRCreated --> Merged: PR approved
664
+ PRCreated --> Working: changes requested
665
+
666
+ Merged --> Cleaned: worktree cleanup <id>
667
+ Cleaned --> [*]
668
+ ```
669
+
670
+ ### Worktree Directory Structure
671
+
672
+ ```
673
+ project/
674
+ ├── .worktrees/
675
+ │ ├── 001-add-auth/ # Worktree 1
676
+ │ │ ├── src/
677
+ │ │ └── ...
678
+ │ ├── 002-fix-bug/ # Worktree 2
679
+ │ │ ├── src/
680
+ │ │ └── ...
681
+ │ └── 003-refactor-api/ # Worktree 3
682
+ ├── src/ # Main working directory
683
+ └── ...
684
+ ```
685
+
686
+ ### Worktree + Agent Coordination
687
+
688
+ ```mermaid
689
+ sequenceDiagram
690
+ participant A1 as Agent 1
691
+ participant A2 as Agent 2
692
+ participant WT as Worktree Manager
693
+ participant GIT as Git
694
+ participant CS as Coordination
695
+
696
+ A1->>WT: create add-auth
697
+ WT->>GIT: git worktree add -b feature/001-add-auth
698
+ GIT-->>WT: Created
699
+ WT-->>A1: .worktrees/001-add-auth
700
+
701
+ A2->>WT: create fix-bug
702
+ WT->>GIT: git worktree add -b feature/002-fix-bug
703
+ GIT-->>WT: Created
704
+ WT-->>A2: .worktrees/002-fix-bug
705
+
706
+ Note over A1,A2: Parallel Work in Isolation
707
+
708
+ A1->>CS: announce(editing src/auth.ts)
709
+ A2->>CS: overlaps check
710
+ CS-->>A2: No overlap (different worktree)
711
+
712
+ A1->>WT: pr 1
713
+ WT->>GIT: push + gh pr create
714
+
715
+ A2->>WT: pr 2
716
+ WT->>GIT: push + gh pr create
717
+ ```
718
+
719
+ ---
720
+
721
+ ## CLAUDE.md Generation
722
+
723
+ ### Generation Pipeline
724
+
725
+ ```mermaid
726
+ flowchart TB
727
+ subgraph "Input Sources"
728
+ PKG[package.json]
729
+ GIT[Git History]
730
+ FS[File System]
731
+ SKILLS[Skills/Droids]
732
+ MEM[Memory DB]
733
+ end
734
+
735
+ subgraph "Analysis"
736
+ ANALYZE[Project Analyzer]
737
+ DETECT[Pattern Detection]
738
+ PREP[Prepopulate Memory]
739
+ end
740
+
741
+ subgraph "Generation"
742
+ TPL[Template Loader]
743
+ HBS[Handlebars Compile]
744
+ CTX[Context Builder]
745
+ end
746
+
747
+ subgraph "Output"
748
+ CLAUDE[CLAUDE.md]
749
+ AGENT[AGENT.md]
750
+ end
751
+
752
+ PKG --> ANALYZE
753
+ GIT --> ANALYZE
754
+ FS --> ANALYZE
755
+ SKILLS --> ANALYZE
756
+ MEM --> PREP
757
+
758
+ ANALYZE --> DETECT
759
+ DETECT --> CTX
760
+ PREP --> CTX
761
+
762
+ CTX --> HBS
763
+ TPL --> HBS
764
+
765
+ HBS --> CLAUDE
766
+ HBS --> AGENT
767
+ ```
768
+
769
+ ### Generated Context Categories
770
+
771
+ ```mermaid
772
+ mindmap
773
+ root((CLAUDE.md))
774
+ Project
775
+ Name
776
+ Description
777
+ Default Branch
778
+ Memory
779
+ DB Paths
780
+ Commands
781
+ Limits
782
+ Worktree
783
+ Directory
784
+ Commands
785
+ Branch Prefix
786
+ Skills
787
+ Mappings
788
+ Language Droids
789
+ File Routing
790
+ Structure
791
+ Repository Layout
792
+ Core Components
793
+ Config Files
794
+ Knowledge
795
+ Recent Activity
796
+ Lessons Learned
797
+ Gotchas
798
+ Hot Spots
799
+ ```
800
+
801
+ ### Template Variables
802
+
803
+ | Variable | Source | Purpose |
804
+ | ---------------------- | ----------------- | ------------------------- |
805
+ | `PROJECT_NAME` | package.json | Project identification |
806
+ | `MEMORY_DB_PATH` | config | Memory database location |
807
+ | `TEST_COMMAND` | package.json | How to run tests |
808
+ | `REPOSITORY_STRUCTURE` | File system scan | Directory layout |
809
+ | `LANGUAGE_DROIDS` | Discovered skills | Language specialists |
810
+ | `TROUBLESHOOTING` | Git history | Known issues/fixes |
811
+ | `HOT_SPOTS` | Git analysis | Frequently modified files |
812
+
813
+ ---
814
+
815
+ ## Deploy Batching
816
+
817
+ _(See [DEPLOY_BATCHER_ANALYSIS.md](./DEPLOY_BATCHER_ANALYSIS.md) for detailed analysis)_
818
+
819
+ ### Quick Reference
820
+
821
+ ```mermaid
822
+ flowchart LR
823
+ subgraph "Queue"
824
+ Q1[Commit 1]
825
+ Q2[Commit 2]
826
+ Q3[Push]
827
+ Q4[Workflow]
828
+ end
829
+
830
+ subgraph "Batch"
831
+ B[Squash + Group]
832
+ end
833
+
834
+ subgraph "Execute"
835
+ E1[Single Commit]
836
+ E2[Single Push]
837
+ E3[Workflow]
838
+ end
839
+
840
+ Q1 --> B
841
+ Q2 --> B
842
+ Q3 --> B
843
+ Q4 --> B
844
+
845
+ B --> E1
846
+ B --> E2
847
+ B --> E3
848
+ ```
849
+
850
+ ### Window Configuration
851
+
852
+ | Action | Window | Rationale |
853
+ | -------- | ------ | ---------------------- |
854
+ | Push | 5s | Fast PR feedback |
855
+ | Workflow | 5s | Responsive CI triggers |
856
+ | Merge | 10s | Moderate safety |
857
+ | Commit | 30s | Allow squashing |
858
+ | Deploy | 60s | Production safety |
859
+
860
+ ---
861
+
862
+ ## Agent Performance Implications
863
+
864
+ ### Performance Impact Matrix
865
+
866
+ ```mermaid
867
+ quadrantChart
868
+ title UAP Feature Impact on Agent Performance
869
+ x-axis Low Token Usage --> High Token Usage
870
+ y-axis Low Task Completion --> High Task Completion
871
+ quadrant-1 Optimize
872
+ quadrant-2 Essential
873
+ quadrant-3 Avoid
874
+ quadrant-4 Consider
875
+ Memory Query: [0.3, 0.8]
876
+ Memory Store: [0.2, 0.7]
877
+ Task Create: [0.2, 0.6]
878
+ Worktree Create: [0.3, 0.9]
879
+ Agent Announce: [0.2, 0.7]
880
+ Overlap Check: [0.1, 0.8]
881
+ Deploy Queue: [0.2, 0.6]
882
+ CLAUDE.md Gen: [0.6, 0.9]
883
+ Prepopulate: [0.7, 0.5]
884
+ ```
885
+
886
+ ### Token Efficiency Analysis
887
+
888
+ | Operation | Tokens Used | Value Delivered | ROI |
889
+ | --------------------- | ----------- | --------------------- | ----------------- |
890
+ | Memory query (cached) | ~50 | Avoids re-learning | High |
891
+ | Memory store (lesson) | ~100 | Future reuse | High |
892
+ | Task create | ~80 | Structured tracking | Medium |
893
+ | Worktree create | ~60 | Safe isolation | Very High |
894
+ | Agent announce | ~40 | Conflict prevention | High |
895
+ | Overlap check | ~30 | Merge avoidance | Very High |
896
+ | Deploy batch | ~50 | CI/CD savings | Very High |
897
+ | CLAUDE.md generate | ~2000 | Context bootstrapping | Medium (one-time) |
898
+
899
+ ### Memory Impact on Context Window
900
+
901
+ ```mermaid
902
+ pie title Context Window Usage (8K example)
903
+ "System Prompt" : 1500
904
+ "CLAUDE.md" : 2500
905
+ "Hot Memory" : 500
906
+ "User Messages" : 2000
907
+ "Available" : 1500
908
+ ```
909
+
910
+ ### Performance Recommendations
911
+
912
+ ```mermaid
913
+ flowchart TB
914
+ START[Agent Session Start]
915
+
916
+ START --> QUERY[Query recent memories]
917
+ QUERY --> CHECK[Check active work/overlaps]
918
+ CHECK --> TASK[Check/create task]
919
+ TASK --> WT[Use worktree if editing]
920
+
921
+ WT --> WORK[Perform work]
922
+ WORK --> STORE[Store important lessons]
923
+ STORE --> DEPLOY[Queue deploy actions]
924
+ DEPLOY --> END[Session end]
925
+
926
+ style QUERY fill:#c8e6c9
927
+ style CHECK fill:#c8e6c9
928
+ style WT fill:#c8e6c9
929
+ style STORE fill:#fff9c4
930
+ style DEPLOY fill:#bbdefb
931
+ ```
932
+
933
+ ### Anti-Patterns to Avoid
934
+
935
+ | Anti-Pattern | Impact | Solution |
936
+ | -------------------------- | ---------------- | --------------------------- |
937
+ | Querying memory every turn | Token waste | Query at session start |
938
+ | Storing trivial memories | DB bloat | Only store importance >= 5 |
939
+ | Skipping overlap check | Merge conflicts | Always check before editing |
940
+ | Direct commits to main | Risk of breakage | Always use worktrees |
941
+ | Individual CI triggers | Wasted minutes | Use deploy batching |
942
+
943
+ ---
944
+
945
+ ## Integration Patterns
946
+
947
+ ### Agent Session Workflow
948
+
949
+ ```mermaid
950
+ sequenceDiagram
951
+ participant User
952
+ participant Agent
953
+ participant UAP
954
+ participant Git
955
+
956
+ Note over Agent: Session Start
957
+ Agent->>UAP: uap memory query <recent>
958
+ Agent->>UAP: uap task ready
959
+ Agent->>UAP: uap agent overlaps
960
+
961
+ User->>Agent: "Fix the auth bug"
962
+ Agent->>UAP: uap task create --title "Fix auth bug" --type bug
963
+ Agent->>UAP: uap worktree create fix-auth-bug
964
+ Agent->>UAP: uap agent announce --resource src/auth.ts
965
+
966
+ Agent->>Agent: Implement fix
967
+ Agent->>UAP: uap deploy queue --action-type commit
968
+
969
+ Agent->>UAP: uap memory store "Fixed auth by..."
970
+ Agent->>UAP: uap agent complete
971
+ Agent->>UAP: uap task close <id>
972
+ Agent->>UAP: uap worktree pr <id>
973
+
974
+ Note over Agent: Session End
975
+ Agent->>UAP: uap deploy flush
976
+ ```
977
+
978
+ ### Multi-Agent Parallel Work
979
+
980
+ ```mermaid
981
+ sequenceDiagram
982
+ participant A1 as Agent 1
983
+ participant A2 as Agent 2
984
+ participant UAP
985
+ participant Main as Main Branch
986
+
987
+ par Agent 1 Path
988
+ A1->>UAP: worktree create feature-a
989
+ A1->>UAP: announce(src/moduleA)
990
+ A1->>A1: Implement Feature A
991
+ A1->>UAP: deploy queue commit
992
+ A1->>UAP: complete
993
+ and Agent 2 Path
994
+ A2->>UAP: worktree create feature-b
995
+ A2->>UAP: overlaps check (clear)
996
+ A2->>UAP: announce(src/moduleB)
997
+ A2->>A2: Implement Feature B
998
+ A2->>UAP: deploy queue commit
999
+ A2->>UAP: complete
1000
+ end
1001
+
1002
+ UAP->>UAP: createBatch()
1003
+ UAP->>Main: Squashed commits
1004
+ UAP->>Main: Single CI run
1005
+ ```
1006
+
1007
+ ### Database Schema Overview
1008
+
1009
+ ```mermaid
1010
+ erDiagram
1011
+ agent_registry ||--o{ work_announcements : announces
1012
+ agent_registry ||--o{ work_claims : claims
1013
+ agent_registry ||--o{ agent_messages : sends
1014
+ agent_registry ||--o{ deploy_queue : queues
1015
+
1016
+ memories {
1017
+ INTEGER id PK
1018
+ TEXT timestamp
1019
+ TEXT type
1020
+ TEXT content
1021
+ }
1022
+
1023
+ session_memories {
1024
+ INTEGER id PK
1025
+ TEXT session_id
1026
+ TEXT timestamp
1027
+ TEXT type
1028
+ TEXT content
1029
+ INTEGER importance
1030
+ }
1031
+
1032
+ entities {
1033
+ INTEGER id PK
1034
+ TEXT type
1035
+ TEXT name
1036
+ TEXT first_seen
1037
+ TEXT last_seen
1038
+ INTEGER mention_count
1039
+ }
1040
+
1041
+ relationships {
1042
+ INTEGER id PK
1043
+ INTEGER source_id FK
1044
+ INTEGER target_id FK
1045
+ TEXT relation
1046
+ TEXT timestamp
1047
+ }
1048
+
1049
+ agent_registry {
1050
+ TEXT id PK
1051
+ TEXT name
1052
+ TEXT session_id
1053
+ TEXT status
1054
+ TEXT worktree_branch
1055
+ }
1056
+
1057
+ work_announcements {
1058
+ INTEGER id PK
1059
+ TEXT agent_id FK
1060
+ TEXT intent_type
1061
+ TEXT resource
1062
+ TEXT announced_at
1063
+ }
1064
+
1065
+ deploy_queue {
1066
+ INTEGER id PK
1067
+ TEXT agent_id FK
1068
+ TEXT action_type
1069
+ TEXT target
1070
+ TEXT status
1071
+ TEXT batch_id
1072
+ }
1073
+
1074
+ deploy_batches {
1075
+ TEXT id PK
1076
+ TEXT created_at
1077
+ TEXT status
1078
+ }
1079
+
1080
+ tasks {
1081
+ TEXT id PK
1082
+ TEXT title
1083
+ TEXT status
1084
+ TEXT type
1085
+ INTEGER priority
1086
+ TEXT assignee
1087
+ }
1088
+
1089
+ task_dependencies {
1090
+ TEXT from_id FK
1091
+ TEXT to_id FK
1092
+ TEXT type
1093
+ }
1094
+ ```
1095
+
1096
+ ---
1097
+
1098
+ ## Summary
1099
+
1100
+ UAP provides a comprehensive system for enhancing AI agent performance through:
1101
+
1102
+ | System | Agent Benefit |
1103
+ | ---------------------------- | ------------------------------------------------------------------- |
1104
+ | **4-Layer Memory** | Persistent learning, reduced repetition, faster context building |
1105
+ | **Multi-Agent Coordination** | Safe parallel work, conflict prevention, efficient resource usage |
1106
+ | **Task Management** | Structured work tracking, dependency awareness, progress visibility |
1107
+ | **Worktree Isolation** | Safe experimentation, atomic changes, easy rollback |
1108
+ | **Deploy Batching** | Reduced CI/CD costs, faster deployments, commit squashing |
1109
+ | **CLAUDE.md Generation** | Project-aware context, reduced hallucination, consistent behavior |
1110
+
1111
+ **Overall Impact**: Agents using UAP show:
1112
+
1113
+ - **60-80%** reduction in context repetition
1114
+ - **50-80%** reduction in CI/CD minutes
1115
+ - **Near-zero** merge conflicts in multi-agent scenarios
1116
+ - **Improved** task completion rates through structured tracking
1117
+ - **Better** code quality through worktree isolation