@moreih29/nexus-core 0.16.2 → 0.18.2

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 (413) hide show
  1. package/README.md +101 -67
  2. package/dist/cli/sync.d.ts +3 -0
  3. package/dist/cli/sync.d.ts.map +1 -0
  4. package/dist/cli/sync.js +59 -0
  5. package/dist/cli/sync.js.map +1 -0
  6. package/dist/generate/index.d.ts +3 -0
  7. package/dist/generate/index.d.ts.map +1 -0
  8. package/dist/generate/index.js +2 -0
  9. package/dist/generate/index.js.map +1 -0
  10. package/dist/generate/load-data.d.ts +8 -0
  11. package/dist/generate/load-data.d.ts.map +1 -0
  12. package/dist/generate/load-data.js +45 -0
  13. package/dist/generate/load-data.js.map +1 -0
  14. package/dist/generate/load-spec.d.ts +3 -0
  15. package/dist/generate/load-spec.d.ts.map +1 -0
  16. package/dist/generate/load-spec.js +48 -0
  17. package/dist/generate/load-spec.js.map +1 -0
  18. package/dist/generate/macros/expand.d.ts +3 -0
  19. package/dist/generate/macros/expand.d.ts.map +1 -0
  20. package/dist/generate/macros/expand.js +48 -0
  21. package/dist/generate/macros/expand.js.map +1 -0
  22. package/dist/generate/macros/parse.d.ts +4 -0
  23. package/dist/generate/macros/parse.d.ts.map +1 -0
  24. package/dist/generate/macros/parse.js +142 -0
  25. package/dist/generate/macros/parse.js.map +1 -0
  26. package/dist/generate/macros/validate.d.ts +3 -0
  27. package/dist/generate/macros/validate.d.ts.map +1 -0
  28. package/dist/generate/macros/validate.js +23 -0
  29. package/dist/generate/macros/validate.js.map +1 -0
  30. package/dist/generate/renderers/claude.d.ts +3 -0
  31. package/dist/generate/renderers/claude.d.ts.map +1 -0
  32. package/dist/generate/renderers/claude.js +48 -0
  33. package/dist/generate/renderers/claude.js.map +1 -0
  34. package/dist/generate/renderers/codex.d.ts +3 -0
  35. package/dist/generate/renderers/codex.d.ts.map +1 -0
  36. package/dist/generate/renderers/codex.js +79 -0
  37. package/dist/generate/renderers/codex.js.map +1 -0
  38. package/dist/generate/renderers/markdown.d.ts +2 -0
  39. package/dist/generate/renderers/markdown.d.ts.map +1 -0
  40. package/dist/generate/renderers/markdown.js +6 -0
  41. package/dist/generate/renderers/markdown.js.map +1 -0
  42. package/dist/generate/renderers/opencode.d.ts +3 -0
  43. package/dist/generate/renderers/opencode.d.ts.map +1 -0
  44. package/dist/generate/renderers/opencode.js +69 -0
  45. package/dist/generate/renderers/opencode.js.map +1 -0
  46. package/dist/generate/sync.d.ts +4 -0
  47. package/dist/generate/sync.d.ts.map +1 -0
  48. package/dist/generate/sync.js +60 -0
  49. package/dist/generate/sync.js.map +1 -0
  50. package/dist/generate/types.d.ts +74 -0
  51. package/dist/generate/types.d.ts.map +1 -0
  52. package/dist/generate/types.js +2 -0
  53. package/dist/generate/types.js.map +1 -0
  54. package/dist/index.d.ts +4 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +2 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/mcp/definitions/artifact.d.ts +20 -0
  59. package/dist/mcp/definitions/artifact.d.ts.map +1 -0
  60. package/dist/mcp/definitions/artifact.js +14 -0
  61. package/dist/mcp/definitions/artifact.js.map +1 -0
  62. package/dist/mcp/definitions/history.d.ts +20 -0
  63. package/dist/mcp/definitions/history.d.ts.map +1 -0
  64. package/dist/mcp/definitions/history.js +18 -0
  65. package/dist/mcp/definitions/history.js.map +1 -0
  66. package/dist/mcp/definitions/index.d.ts +276 -0
  67. package/dist/mcp/definitions/index.d.ts.map +1 -0
  68. package/dist/mcp/definitions/index.js +16 -0
  69. package/dist/mcp/definitions/index.js.map +1 -0
  70. package/dist/mcp/definitions/plan.d.ts +111 -0
  71. package/dist/mcp/definitions/plan.d.ts.map +1 -0
  72. package/dist/mcp/definitions/plan.js +89 -0
  73. package/dist/mcp/definitions/plan.js.map +1 -0
  74. package/dist/mcp/definitions/task.d.ts +138 -0
  75. package/dist/mcp/definitions/task.d.ts.map +1 -0
  76. package/dist/mcp/definitions/task.js +78 -0
  77. package/dist/mcp/definitions/task.js.map +1 -0
  78. package/dist/mcp/handlers/artifact.d.ts.map +1 -0
  79. package/dist/mcp/handlers/artifact.js +42 -0
  80. package/dist/mcp/handlers/artifact.js.map +1 -0
  81. package/dist/mcp/handlers/history.d.ts.map +1 -0
  82. package/dist/mcp/handlers/history.js +35 -0
  83. package/dist/mcp/handlers/history.js.map +1 -0
  84. package/dist/mcp/handlers/plan.d.ts.map +1 -0
  85. package/dist/mcp/handlers/plan.js +324 -0
  86. package/dist/mcp/handlers/plan.js.map +1 -0
  87. package/dist/mcp/handlers/task.d.ts.map +1 -0
  88. package/dist/mcp/handlers/task.js +216 -0
  89. package/dist/mcp/handlers/task.js.map +1 -0
  90. package/dist/{src/mcp → mcp}/server.d.ts +1 -1
  91. package/dist/mcp/server.d.ts.map +1 -0
  92. package/dist/mcp/server.js +58 -0
  93. package/dist/mcp/server.js.map +1 -0
  94. package/dist/shared/json-store.d.ts.map +1 -0
  95. package/dist/{src/shared → shared}/json-store.js +5 -4
  96. package/dist/shared/json-store.js.map +1 -0
  97. package/dist/shared/mcp-utils.d.ts.map +1 -0
  98. package/dist/shared/mcp-utils.js.map +1 -0
  99. package/dist/{src/shared → shared}/paths.d.ts +0 -4
  100. package/dist/shared/paths.d.ts.map +1 -0
  101. package/dist/shared/paths.js +62 -0
  102. package/dist/shared/paths.js.map +1 -0
  103. package/dist/shared/register-tool.d.ts +20 -0
  104. package/dist/shared/register-tool.d.ts.map +1 -0
  105. package/dist/shared/register-tool.js +15 -0
  106. package/dist/shared/register-tool.js.map +1 -0
  107. package/dist/{src/types → types}/state.d.ts +65 -65
  108. package/dist/types/state.d.ts.map +1 -0
  109. package/dist/{src/types → types}/state.js +1 -1
  110. package/dist/types/state.js.map +1 -0
  111. package/harness/claude/agent-rules.yml +21 -0
  112. package/harness/claude/invocations.yml +11 -0
  113. package/harness/claude/layout.yml +3 -0
  114. package/harness/codex/agent-rules.yml +28 -0
  115. package/harness/codex/invocations.yml +13 -0
  116. package/harness/codex/layout.yml +3 -0
  117. package/harness/opencode/agent-rules.yml +18 -0
  118. package/harness/opencode/invocations.yml +12 -0
  119. package/harness/opencode/layout.yml +3 -0
  120. package/package.json +38 -43
  121. package/{assets → spec}/agents/architect/body.ko.md +92 -84
  122. package/spec/agents/architect/body.md +185 -0
  123. package/spec/agents/designer/body.ko.md +330 -0
  124. package/spec/agents/designer/body.md +330 -0
  125. package/spec/agents/engineer/body.ko.md +166 -0
  126. package/spec/agents/engineer/body.md +166 -0
  127. package/spec/agents/lead/body.ko.md +276 -0
  128. package/spec/agents/lead/body.md +276 -0
  129. package/{assets → spec}/agents/postdoc/body.ko.md +116 -46
  130. package/spec/agents/postdoc/body.md +192 -0
  131. package/{assets → spec}/agents/researcher/body.ko.md +131 -45
  132. package/spec/agents/researcher/body.md +223 -0
  133. package/spec/agents/reviewer/body.ko.md +219 -0
  134. package/spec/agents/reviewer/body.md +219 -0
  135. package/{assets → spec}/agents/strategist/body.ko.md +108 -35
  136. package/spec/agents/strategist/body.md +187 -0
  137. package/spec/agents/tester/body.ko.md +272 -0
  138. package/spec/agents/tester/body.md +272 -0
  139. package/{assets → spec}/agents/writer/body.ko.md +109 -33
  140. package/spec/agents/writer/body.md +198 -0
  141. package/spec/skills/nx-auto-plan/body.ko.md +150 -0
  142. package/spec/skills/nx-auto-plan/body.md +150 -0
  143. package/spec/skills/nx-plan/body.ko.md +159 -0
  144. package/spec/skills/nx-plan/body.md +159 -0
  145. package/spec/skills/nx-run/body.ko.md +132 -0
  146. package/spec/skills/nx-run/body.md +132 -0
  147. package/vocabulary/enums/task-register-state.yml +4 -0
  148. package/vocabulary/invocations.yml +43 -0
  149. package/assets/agents/architect/body.md +0 -177
  150. package/assets/agents/designer/body.ko.md +0 -125
  151. package/assets/agents/designer/body.md +0 -125
  152. package/assets/agents/engineer/body.ko.md +0 -106
  153. package/assets/agents/engineer/body.md +0 -106
  154. package/assets/agents/lead/body.ko.md +0 -70
  155. package/assets/agents/lead/body.md +0 -70
  156. package/assets/agents/postdoc/body.md +0 -122
  157. package/assets/agents/researcher/body.md +0 -137
  158. package/assets/agents/reviewer/body.ko.md +0 -138
  159. package/assets/agents/reviewer/body.md +0 -138
  160. package/assets/agents/strategist/body.md +0 -116
  161. package/assets/agents/tester/body.ko.md +0 -195
  162. package/assets/agents/tester/body.md +0 -195
  163. package/assets/agents/writer/body.md +0 -122
  164. package/assets/capability-matrix.yml +0 -198
  165. package/assets/hooks/agent-bootstrap/handler.test.ts +0 -368
  166. package/assets/hooks/agent-bootstrap/handler.ts +0 -119
  167. package/assets/hooks/agent-bootstrap/meta.yml +0 -10
  168. package/assets/hooks/agent-finalize/handler.test.ts +0 -368
  169. package/assets/hooks/agent-finalize/handler.ts +0 -76
  170. package/assets/hooks/agent-finalize/meta.yml +0 -10
  171. package/assets/hooks/capability-matrix.yml +0 -313
  172. package/assets/hooks/post-tool-telemetry/handler.test.ts +0 -302
  173. package/assets/hooks/post-tool-telemetry/handler.ts +0 -49
  174. package/assets/hooks/post-tool-telemetry/meta.yml +0 -11
  175. package/assets/hooks/prompt-router/handler.test.ts +0 -801
  176. package/assets/hooks/prompt-router/handler.ts +0 -272
  177. package/assets/hooks/prompt-router/meta.yml +0 -11
  178. package/assets/hooks/session-init/handler.test.ts +0 -274
  179. package/assets/hooks/session-init/handler.ts +0 -30
  180. package/assets/hooks/session-init/meta.yml +0 -9
  181. package/assets/lsp-servers.json +0 -55
  182. package/assets/schema/lsp-servers.schema.json +0 -67
  183. package/assets/skills/nx-init/body.ko.md +0 -197
  184. package/assets/skills/nx-init/body.md +0 -197
  185. package/assets/skills/nx-plan/body.ko.md +0 -361
  186. package/assets/skills/nx-plan/body.md +0 -361
  187. package/assets/skills/nx-run/body.ko.md +0 -161
  188. package/assets/skills/nx-run/body.md +0 -160
  189. package/assets/skills/nx-sync/body.ko.md +0 -92
  190. package/assets/skills/nx-sync/body.md +0 -92
  191. package/assets/tools/tool-name-map.yml +0 -353
  192. package/dist/assets/hooks/agent-bootstrap/handler.d.ts +0 -4
  193. package/dist/assets/hooks/agent-bootstrap/handler.d.ts.map +0 -1
  194. package/dist/assets/hooks/agent-bootstrap/handler.js +0 -100
  195. package/dist/assets/hooks/agent-bootstrap/handler.js.map +0 -1
  196. package/dist/assets/hooks/agent-finalize/handler.d.ts +0 -4
  197. package/dist/assets/hooks/agent-finalize/handler.d.ts.map +0 -1
  198. package/dist/assets/hooks/agent-finalize/handler.js +0 -63
  199. package/dist/assets/hooks/agent-finalize/handler.js.map +0 -1
  200. package/dist/assets/hooks/post-tool-telemetry/handler.d.ts +0 -4
  201. package/dist/assets/hooks/post-tool-telemetry/handler.d.ts.map +0 -1
  202. package/dist/assets/hooks/post-tool-telemetry/handler.js +0 -40
  203. package/dist/assets/hooks/post-tool-telemetry/handler.js.map +0 -1
  204. package/dist/assets/hooks/prompt-router/handler.d.ts +0 -4
  205. package/dist/assets/hooks/prompt-router/handler.d.ts.map +0 -1
  206. package/dist/assets/hooks/prompt-router/handler.js +0 -214
  207. package/dist/assets/hooks/prompt-router/handler.js.map +0 -1
  208. package/dist/assets/hooks/session-init/handler.d.ts +0 -4
  209. package/dist/assets/hooks/session-init/handler.d.ts.map +0 -1
  210. package/dist/assets/hooks/session-init/handler.js +0 -23
  211. package/dist/assets/hooks/session-init/handler.js.map +0 -1
  212. package/dist/claude/.claude-plugin/marketplace.json +0 -75
  213. package/dist/claude/.claude-plugin/plugin.json +0 -67
  214. package/dist/claude/agents/architect.md +0 -172
  215. package/dist/claude/agents/designer.md +0 -120
  216. package/dist/claude/agents/engineer.md +0 -98
  217. package/dist/claude/agents/lead.md +0 -59
  218. package/dist/claude/agents/postdoc.md +0 -117
  219. package/dist/claude/agents/researcher.md +0 -132
  220. package/dist/claude/agents/reviewer.md +0 -133
  221. package/dist/claude/agents/strategist.md +0 -111
  222. package/dist/claude/agents/tester.md +0 -190
  223. package/dist/claude/agents/writer.md +0 -114
  224. package/dist/claude/dist/hooks/agent-bootstrap.js +0 -121
  225. package/dist/claude/dist/hooks/agent-finalize.js +0 -180
  226. package/dist/claude/dist/hooks/prompt-router.js +0 -7336
  227. package/dist/claude/dist/hooks/session-init.js +0 -37
  228. package/dist/claude/hooks/hooks.json +0 -52
  229. package/dist/claude/settings.json +0 -3
  230. package/dist/claude/skills/nx-init/SKILL.md +0 -189
  231. package/dist/claude/skills/nx-plan/SKILL.md +0 -353
  232. package/dist/claude/skills/nx-run/SKILL.md +0 -154
  233. package/dist/claude/skills/nx-sync/SKILL.md +0 -87
  234. package/dist/codex/agents/architect.toml +0 -175
  235. package/dist/codex/agents/designer.toml +0 -123
  236. package/dist/codex/agents/engineer.toml +0 -105
  237. package/dist/codex/agents/lead.toml +0 -64
  238. package/dist/codex/agents/postdoc.toml +0 -120
  239. package/dist/codex/agents/researcher.toml +0 -136
  240. package/dist/codex/agents/reviewer.toml +0 -137
  241. package/dist/codex/agents/strategist.toml +0 -114
  242. package/dist/codex/agents/tester.toml +0 -194
  243. package/dist/codex/agents/writer.toml +0 -121
  244. package/dist/codex/dist/hooks/agent-bootstrap.js +0 -121
  245. package/dist/codex/dist/hooks/agent-finalize.js +0 -180
  246. package/dist/codex/dist/hooks/prompt-router.js +0 -7336
  247. package/dist/codex/dist/hooks/session-init.js +0 -37
  248. package/dist/codex/hooks/hooks.json +0 -28
  249. package/dist/codex/install/AGENTS.fragment.md +0 -60
  250. package/dist/codex/install/config.fragment.toml +0 -5
  251. package/dist/codex/install/install.sh +0 -60
  252. package/dist/codex/package.json +0 -20
  253. package/dist/codex/plugin/.codex-plugin/plugin.json +0 -57
  254. package/dist/codex/plugin/skills/nx-init/SKILL.md +0 -189
  255. package/dist/codex/plugin/skills/nx-plan/SKILL.md +0 -353
  256. package/dist/codex/plugin/skills/nx-run/SKILL.md +0 -154
  257. package/dist/codex/plugin/skills/nx-sync/SKILL.md +0 -87
  258. package/dist/codex/prompts/architect.md +0 -166
  259. package/dist/codex/prompts/designer.md +0 -114
  260. package/dist/codex/prompts/engineer.md +0 -97
  261. package/dist/codex/prompts/lead.md +0 -60
  262. package/dist/codex/prompts/postdoc.md +0 -111
  263. package/dist/codex/prompts/researcher.md +0 -127
  264. package/dist/codex/prompts/reviewer.md +0 -128
  265. package/dist/codex/prompts/strategist.md +0 -105
  266. package/dist/codex/prompts/tester.md +0 -185
  267. package/dist/codex/prompts/writer.md +0 -113
  268. package/dist/hooks/agent-bootstrap.js +0 -121
  269. package/dist/hooks/agent-finalize.js +0 -180
  270. package/dist/hooks/prompt-router.js +0 -7336
  271. package/dist/hooks/session-init.js +0 -37
  272. package/dist/manifests/claude-hooks.json +0 -52
  273. package/dist/manifests/codex-hooks.json +0 -28
  274. package/dist/manifests/opencode-manifest.json +0 -44
  275. package/dist/manifests/portability-report.json +0 -87
  276. package/dist/opencode/.opencode/skills/nx-init/SKILL.md +0 -189
  277. package/dist/opencode/.opencode/skills/nx-plan/SKILL.md +0 -353
  278. package/dist/opencode/.opencode/skills/nx-run/SKILL.md +0 -154
  279. package/dist/opencode/.opencode/skills/nx-sync/SKILL.md +0 -87
  280. package/dist/opencode/package.json +0 -23
  281. package/dist/opencode/src/agents/architect.ts +0 -176
  282. package/dist/opencode/src/agents/designer.ts +0 -124
  283. package/dist/opencode/src/agents/engineer.ts +0 -105
  284. package/dist/opencode/src/agents/lead.ts +0 -66
  285. package/dist/opencode/src/agents/postdoc.ts +0 -121
  286. package/dist/opencode/src/agents/researcher.ts +0 -136
  287. package/dist/opencode/src/agents/reviewer.ts +0 -137
  288. package/dist/opencode/src/agents/strategist.ts +0 -115
  289. package/dist/opencode/src/agents/tester.ts +0 -194
  290. package/dist/opencode/src/agents/writer.ts +0 -121
  291. package/dist/opencode/src/index.ts +0 -25
  292. package/dist/opencode/src/plugin.ts +0 -6
  293. package/dist/scripts/build-agents.d.ts +0 -164
  294. package/dist/scripts/build-agents.d.ts.map +0 -1
  295. package/dist/scripts/build-agents.js +0 -890
  296. package/dist/scripts/build-agents.js.map +0 -1
  297. package/dist/scripts/build-hooks.d.ts +0 -57
  298. package/dist/scripts/build-hooks.d.ts.map +0 -1
  299. package/dist/scripts/build-hooks.js +0 -555
  300. package/dist/scripts/build-hooks.js.map +0 -1
  301. package/dist/scripts/cli.d.ts +0 -54
  302. package/dist/scripts/cli.d.ts.map +0 -1
  303. package/dist/scripts/cli.js +0 -504
  304. package/dist/scripts/cli.js.map +0 -1
  305. package/dist/scripts/smoke/smoke-claude.d.ts +0 -2
  306. package/dist/scripts/smoke/smoke-claude.d.ts.map +0 -1
  307. package/dist/scripts/smoke/smoke-claude.js +0 -58
  308. package/dist/scripts/smoke/smoke-claude.js.map +0 -1
  309. package/dist/scripts/smoke/smoke-codex.d.ts +0 -2
  310. package/dist/scripts/smoke/smoke-codex.d.ts.map +0 -1
  311. package/dist/scripts/smoke/smoke-codex.js +0 -50
  312. package/dist/scripts/smoke/smoke-codex.js.map +0 -1
  313. package/dist/scripts/smoke/smoke-consumer.d.ts +0 -2
  314. package/dist/scripts/smoke/smoke-consumer.d.ts.map +0 -1
  315. package/dist/scripts/smoke/smoke-consumer.js +0 -80
  316. package/dist/scripts/smoke/smoke-consumer.js.map +0 -1
  317. package/dist/scripts/smoke/smoke-opencode.d.ts +0 -2
  318. package/dist/scripts/smoke/smoke-opencode.d.ts.map +0 -1
  319. package/dist/scripts/smoke/smoke-opencode.js +0 -99
  320. package/dist/scripts/smoke/smoke-opencode.js.map +0 -1
  321. package/dist/src/hooks/opencode-mount.d.ts +0 -35
  322. package/dist/src/hooks/opencode-mount.d.ts.map +0 -1
  323. package/dist/src/hooks/opencode-mount.js +0 -352
  324. package/dist/src/hooks/opencode-mount.js.map +0 -1
  325. package/dist/src/hooks/runtime.d.ts +0 -37
  326. package/dist/src/hooks/runtime.d.ts.map +0 -1
  327. package/dist/src/hooks/runtime.js +0 -274
  328. package/dist/src/hooks/runtime.js.map +0 -1
  329. package/dist/src/hooks/types.d.ts +0 -196
  330. package/dist/src/hooks/types.d.ts.map +0 -1
  331. package/dist/src/hooks/types.js +0 -85
  332. package/dist/src/hooks/types.js.map +0 -1
  333. package/dist/src/lsp/cache.d.ts +0 -9
  334. package/dist/src/lsp/cache.d.ts.map +0 -1
  335. package/dist/src/lsp/cache.js +0 -216
  336. package/dist/src/lsp/cache.js.map +0 -1
  337. package/dist/src/lsp/client.d.ts +0 -24
  338. package/dist/src/lsp/client.d.ts.map +0 -1
  339. package/dist/src/lsp/client.js +0 -166
  340. package/dist/src/lsp/client.js.map +0 -1
  341. package/dist/src/lsp/detect.d.ts +0 -77
  342. package/dist/src/lsp/detect.d.ts.map +0 -1
  343. package/dist/src/lsp/detect.js +0 -116
  344. package/dist/src/lsp/detect.js.map +0 -1
  345. package/dist/src/mcp/server.d.ts.map +0 -1
  346. package/dist/src/mcp/server.js +0 -34
  347. package/dist/src/mcp/server.js.map +0 -1
  348. package/dist/src/mcp/tools/artifact.d.ts.map +0 -1
  349. package/dist/src/mcp/tools/artifact.js +0 -36
  350. package/dist/src/mcp/tools/artifact.js.map +0 -1
  351. package/dist/src/mcp/tools/history.d.ts.map +0 -1
  352. package/dist/src/mcp/tools/history.js +0 -29
  353. package/dist/src/mcp/tools/history.js.map +0 -1
  354. package/dist/src/mcp/tools/lsp.d.ts +0 -13
  355. package/dist/src/mcp/tools/lsp.d.ts.map +0 -1
  356. package/dist/src/mcp/tools/lsp.js +0 -225
  357. package/dist/src/mcp/tools/lsp.js.map +0 -1
  358. package/dist/src/mcp/tools/plan.d.ts.map +0 -1
  359. package/dist/src/mcp/tools/plan.js +0 -317
  360. package/dist/src/mcp/tools/plan.js.map +0 -1
  361. package/dist/src/mcp/tools/task.d.ts.map +0 -1
  362. package/dist/src/mcp/tools/task.js +0 -252
  363. package/dist/src/mcp/tools/task.js.map +0 -1
  364. package/dist/src/shared/invocations.d.ts +0 -74
  365. package/dist/src/shared/invocations.d.ts.map +0 -1
  366. package/dist/src/shared/invocations.js +0 -247
  367. package/dist/src/shared/invocations.js.map +0 -1
  368. package/dist/src/shared/json-store.d.ts.map +0 -1
  369. package/dist/src/shared/json-store.js.map +0 -1
  370. package/dist/src/shared/mcp-utils.d.ts.map +0 -1
  371. package/dist/src/shared/mcp-utils.js.map +0 -1
  372. package/dist/src/shared/package-root.d.ts +0 -6
  373. package/dist/src/shared/package-root.d.ts.map +0 -1
  374. package/dist/src/shared/package-root.js +0 -19
  375. package/dist/src/shared/package-root.js.map +0 -1
  376. package/dist/src/shared/paths.d.ts.map +0 -1
  377. package/dist/src/shared/paths.js +0 -81
  378. package/dist/src/shared/paths.js.map +0 -1
  379. package/dist/src/shared/tool-log.d.ts +0 -8
  380. package/dist/src/shared/tool-log.d.ts.map +0 -1
  381. package/dist/src/shared/tool-log.js +0 -22
  382. package/dist/src/shared/tool-log.js.map +0 -1
  383. package/dist/src/types/agent-config.d.ts +0 -22
  384. package/dist/src/types/agent-config.d.ts.map +0 -1
  385. package/dist/src/types/agent-config.js +0 -2
  386. package/dist/src/types/agent-config.js.map +0 -1
  387. package/dist/src/types/index.d.ts +0 -2
  388. package/dist/src/types/index.d.ts.map +0 -1
  389. package/dist/src/types/index.js +0 -2
  390. package/dist/src/types/index.js.map +0 -1
  391. package/dist/src/types/state.d.ts.map +0 -1
  392. package/dist/src/types/state.js.map +0 -1
  393. package/docs/consuming/codex-lead-merge.md +0 -106
  394. package/docs/contract/harness-io.md +0 -333
  395. package/docs/plugin-guide.md +0 -355
  396. package/docs/plugin-template/claude/.github/workflows/build.yml +0 -60
  397. package/docs/plugin-template/claude/README.md +0 -110
  398. package/docs/plugin-template/claude/package.json +0 -16
  399. package/docs/plugin-template/codex/.github/workflows/build.yml +0 -51
  400. package/docs/plugin-template/codex/README.md +0 -147
  401. package/docs/plugin-template/codex/install/install.sh +0 -60
  402. package/docs/plugin-template/codex/package.json +0 -17
  403. package/docs/plugin-template/opencode/.github/workflows/build.yml +0 -61
  404. package/docs/plugin-template/opencode/README.md +0 -121
  405. package/docs/plugin-template/opencode/package.json +0 -25
  406. package/docs/plugin-template/opencode/src/plugin.ts +0 -6
  407. /package/dist/{src/mcp/tools → mcp/handlers}/artifact.d.ts +0 -0
  408. /package/dist/{src/mcp/tools → mcp/handlers}/history.d.ts +0 -0
  409. /package/dist/{src/mcp/tools → mcp/handlers}/plan.d.ts +0 -0
  410. /package/dist/{src/mcp/tools → mcp/handlers}/task.d.ts +0 -0
  411. /package/dist/{src/shared → shared}/json-store.d.ts +0 -0
  412. /package/dist/{src/shared → shared}/mcp-utils.d.ts +0 -0
  413. /package/dist/{src/shared → shared}/mcp-utils.js +0 -0
@@ -1,214 +0,0 @@
1
- import { existsSync, readFileSync, readdirSync } from "node:fs";
2
- import { join, resolve, dirname } from "node:path";
3
- import { parse as parseYaml } from "yaml";
4
- import { expandInvocations, } from "../../../src/shared/invocations.js";
5
- // Tag priority: specific variants first (m:gc > m, rule:name > rule, plan:auto > plan, init:reset > init)
6
- const TAG_PATTERNS = [
7
- { name: "plan:auto", regex: /\[plan:auto\]/ },
8
- { name: "plan", regex: /\[plan\](?!\w)/ },
9
- { name: "run", regex: /\[run\](?!\w)/ },
10
- { name: "d", regex: /\[d\](?!\w)/ },
11
- { name: "m:gc", regex: /\[m:gc\]/ },
12
- { name: "m", regex: /\[m\](?!\w)/ },
13
- { name: "rule:name", regex: /\[rule:([a-zA-Z0-9_-]+)\]/ },
14
- { name: "rule", regex: /\[rule\](?!\w)/ },
15
- { name: "sync", regex: /\[sync\](?!\w)/ },
16
- { name: "init:reset", regex: /\[init:reset\]/ },
17
- { name: "init", regex: /\[init\](?!\w)/ },
18
- ];
19
- // ---------------------------------------------------------------------------
20
- // Invocations loader — cached per process
21
- // ---------------------------------------------------------------------------
22
- let _invocationsCache = null;
23
- function loadInvocations() {
24
- if (_invocationsCache)
25
- return _invocationsCache;
26
- // In the compiled consumer bundle, assets/ is absent — use data inlined at build time.
27
- const inlined = globalThis.__NEXUS_INLINE_INVOCATIONS__;
28
- if (inlined) {
29
- _invocationsCache = inlined;
30
- return inlined;
31
- }
32
- const selfDir = new URL(".", import.meta.url).pathname;
33
- // Walk up from handler directory to find assets/tools/tool-name-map.yml
34
- let dir = selfDir;
35
- while (dir !== "/") {
36
- const candidate = resolve(dir, "assets/tools/tool-name-map.yml");
37
- if (existsSync(candidate)) {
38
- const raw = readFileSync(candidate, "utf-8");
39
- const parsed = parseYaml(raw);
40
- if (!parsed.invocations) {
41
- throw new Error("[prompt-router] tool-name-map.yml missing 'invocations' section");
42
- }
43
- _invocationsCache = parsed.invocations;
44
- return _invocationsCache;
45
- }
46
- const parent = dirname(dir);
47
- if (parent === dir)
48
- break;
49
- dir = parent;
50
- }
51
- throw new Error(`[prompt-router] Cannot locate assets/tools/tool-name-map.yml from ${selfDir}`);
52
- }
53
- // ---------------------------------------------------------------------------
54
- // Harness resolution
55
- // ---------------------------------------------------------------------------
56
- function resolveHarness() {
57
- const h = process.env["NEXUS_HARNESS"];
58
- if (h === "claude" || h === "opencode" || h === "codex")
59
- return h;
60
- if (h) {
61
- process.stderr.write(`[prompt-router] Unknown NEXUS_HARNESS="${h}", falling back to "claude"\n`);
62
- }
63
- return "claude";
64
- }
65
- // ---------------------------------------------------------------------------
66
- // Invocation expansion helper
67
- // ---------------------------------------------------------------------------
68
- function expand(template, harness) {
69
- return expandInvocations(template, harness, loadInvocations());
70
- }
71
- // ---------------------------------------------------------------------------
72
- // Rule target loader
73
- // ---------------------------------------------------------------------------
74
- function loadValidRuleTargets(cwd) {
75
- // In the compiled consumer bundle, cwd/assets/ is absent — use data inlined at build time.
76
- const inlined = globalThis.__NEXUS_INLINE_RULE_TARGETS__;
77
- if (inlined && inlined.length > 0)
78
- return inlined;
79
- const targets = [];
80
- for (const dir of ["assets/agents", "assets/skills"]) {
81
- const absDir = join(cwd, dir);
82
- if (!existsSync(absDir))
83
- continue;
84
- for (const entry of readdirSync(absDir, { withFileTypes: true })) {
85
- if (entry.isDirectory())
86
- targets.push(entry.name);
87
- }
88
- }
89
- return targets;
90
- }
91
- // ---------------------------------------------------------------------------
92
- // Handler
93
- // ---------------------------------------------------------------------------
94
- const handler = async (input) => {
95
- if (input.hook_event_name !== "UserPromptSubmit")
96
- return;
97
- const prompt = input.prompt;
98
- const detected = [];
99
- // Detect all tags — use seen Set keyed on base tag name to prevent duplicates
100
- // (e.g. plan:auto and plan share base "plan"; whichever appears first wins)
101
- const seen = new Set();
102
- for (const { name, regex } of TAG_PATTERNS) {
103
- const m = regex.exec(prompt);
104
- if (!m)
105
- continue;
106
- const base = name.split(":")[0];
107
- if (seen.has(base))
108
- continue;
109
- seen.add(base);
110
- detected.push({ name, arg: m[1] });
111
- }
112
- const sessionDir = join(input.cwd, ".nexus/state", input.session_id);
113
- const planPath = join(sessionDir, "plan.json");
114
- const tasksPath = join(sessionDir, "tasks.json");
115
- const hasPlan = existsSync(planPath);
116
- const hasTasks = existsSync(tasksPath);
117
- const harness = resolveHarness();
118
- const notices = [];
119
- let decision;
120
- let block_reason;
121
- for (const tag of detected) {
122
- switch (tag.name) {
123
- case "plan":
124
- notices.push(`<system-notice>[plan] tag detected. ${expand('{{skill_activation skill="nx-plan"}}', harness)} for structured planning.</system-notice>`);
125
- break;
126
- case "plan:auto":
127
- notices.push(`<system-notice>[plan:auto] tag detected. ${expand('{{skill_activation skill="nx-plan" mode="auto"}}', harness)} for structured planning.</system-notice>`);
128
- break;
129
- case "run":
130
- if (!hasTasks) {
131
- notices.push(`<system-notice>[run] tag detected but no tasks.json. ${expand('{{skill_activation skill="nx-plan"}}', harness)} with args "auto" first to generate tasks, then run.</system-notice>`);
132
- }
133
- else {
134
- notices.push(`<system-notice>[run] tag detected. ${expand('{{skill_activation skill="nx-run"}}', harness)} to execute tasks.</system-notice>`);
135
- }
136
- break;
137
- case "d":
138
- if (!hasPlan) {
139
- decision = "block";
140
- block_reason =
141
- `[d] tag requires an active plan session. ${expand('{{skill_activation skill="nx-plan"}}', harness)} first.`;
142
- }
143
- else {
144
- notices.push(`<system-notice>[d] tag detected. Record decision via \`nx_plan_decide(issue_id, summary)\` MCP tool.</system-notice>`);
145
- }
146
- break;
147
- case "m":
148
- notices.push(`<system-notice>[m] tag detected. Save a memory note to \`.nexus/memory/<prefix>-<name>.md\`. Prefix: empirical-, external-, or pattern- (see architecture.md §2-1).</system-notice>`);
149
- break;
150
- case "m:gc":
151
- notices.push(`<system-notice>[m:gc] tag detected. Review \`.nexus/memory/\` for stale or duplicate entries and consolidate.</system-notice>`);
152
- break;
153
- case "rule": {
154
- const valid = loadValidRuleTargets(input.cwd);
155
- notices.push(`<system-notice>[rule] tag detected. Determine target from intent. Valid targets: ${valid.join(", ")}. Update \`.nexus/rules/<target>.md\`.</system-notice>`);
156
- break;
157
- }
158
- case "rule:name": {
159
- const valid = loadValidRuleTargets(input.cwd);
160
- const name = tag.arg ?? "";
161
- if (!valid.includes(name)) {
162
- decision = "block";
163
- block_reason = `[rule:${name}] invalid — must be one of: ${valid.join(", ")}`;
164
- }
165
- else {
166
- notices.push(`<system-notice>[rule:${name}] tag detected. Update \`.nexus/rules/${name}.md\` with user's directive.</system-notice>`);
167
- }
168
- break;
169
- }
170
- case "sync":
171
- notices.push(`<system-notice>[sync] tag detected. ${expand('{{skill_activation skill="nx-sync"}}', harness)} to synchronize \`.nexus/context/\`.</system-notice>`);
172
- break;
173
- case "init":
174
- notices.push(`<system-notice>[init] tag detected. ${expand('{{skill_activation skill="nx-init"}}', harness)} for project onboarding.</system-notice>`);
175
- break;
176
- case "init:reset":
177
- notices.push(`<system-notice>[init:reset] tag detected. ${expand('{{skill_activation skill="nx-init" mode="reset"}}', harness)} for full re-initialization.</system-notice>`);
178
- break;
179
- }
180
- }
181
- // No tags detected + active state → emit state notice
182
- if (detected.length === 0) {
183
- if (hasPlan) {
184
- try {
185
- const plan = JSON.parse(readFileSync(planPath, "utf-8"));
186
- const pending = plan.issues?.filter((i) => i.status === "pending").length ?? 0;
187
- notices.push(`<system-notice>Active plan session: "${plan.topic ?? "(unknown)"}", ${pending} issues pending.</system-notice>`);
188
- }
189
- catch {
190
- // Malformed plan.json — skip notice
191
- }
192
- }
193
- else if (hasTasks) {
194
- try {
195
- const tasks = JSON.parse(readFileSync(tasksPath, "utf-8"));
196
- const pending = tasks.tasks?.filter((t) => t.status !== "completed").length ?? 0;
197
- if (pending > 0) {
198
- notices.push(`<system-notice>Active run session: ${pending} tasks remaining in tasks.json.</system-notice>`);
199
- }
200
- }
201
- catch {
202
- // Malformed tasks.json — skip notice
203
- }
204
- }
205
- }
206
- if (decision === "block") {
207
- return { decision, block_reason };
208
- }
209
- if (notices.length === 0)
210
- return;
211
- return { additional_context: notices.join("\n\n") };
212
- };
213
- export default handler;
214
- //# sourceMappingURL=handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../assets/hooks/prompt-router/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,iBAAiB,GAGlB,MAAM,oCAAoC,CAAC;AAE5C,0GAA0G;AAC1G,MAAM,YAAY,GAA2C;IAC3D,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE;IAC7C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACzC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE;IACvC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE;IACnC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;IACnC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE;IACnC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,2BAA2B,EAAE;IACzD,EAAE,IAAI,E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AkB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AACtD,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HookHandler } from "../../../src/hooks/types.js";
2
- declare const handler: HookHandler;
3
- export default handler;
4
- //# sourceMappingURL=handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../assets/hooks/session-init/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,QAAA,MAAM,OAAO,EAAE,WAuBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,23 +0,0 @@
1
- import { mkdirSync, writeFileSync } from "node:fs";
2
- import { join, basename } from "node:path";
3
- const handler = async (input) => {
4
- if (input.hook_event_name !== "SessionStart")
5
- return;
6
- // Sanitize session_id to prevent path traversal
7
- const safeSid = basename(input.session_id);
8
- if (!safeSid || safeSid.startsWith(".") || safeSid.includes("/")) {
9
- process.stderr.write(`[session-init] invalid session_id: ${input.session_id}\n`);
10
- return;
11
- }
12
- const sessionDir = join(input.cwd, ".nexus/state", safeSid);
13
- // Ensure directory exists (idempotent)
14
- mkdirSync(sessionDir, { recursive: true });
15
- // Initialize per-session state files — overwrite unconditionally (resume is intentional)
16
- writeFileSync(join(sessionDir, "agent-tracker.json"), "[]");
17
- writeFileSync(join(sessionDir, "tool-log.jsonl"), "");
18
- // plan.json and tasks.json are MCP responsibility — not touched here
19
- // memory-access.jsonl is project-level — not touched here
20
- // No additional_context returned (decided: no context injection at session start)
21
- };
22
- export default handler;
23
- //# sourceMappingURL=handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../assets/hooks/session-init/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,OAAO,GAAgB,KAAK,EAAE,KAAK,EAAE,EAAE;IAC3C,IAAI,KAAK,CAAC,eAAe,KAAK,cAAc;QAAE,OAAO;IAErD,gDAAgD;IAChD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC;QACjF,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAE5D,uCAAuC;IACvC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,yFAAyF;IACzF,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5D,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtD,qEAAqE;IACrE,0DAA0D;IAE1D,kFAAkF;AACpF,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,75 +0,0 @@
1
- {
2
- "schema_version": "1.0",
3
- "agents": [
4
- {
5
- "id": "architect",
6
- "name": "architect",
7
- "description": "Technical design — evaluates How, reviews architecture, advises on implementation approach",
8
- "category": "how",
9
- "model_tier": "high"
10
- },
11
- {
12
- "id": "designer",
13
- "name": "designer",
14
- "description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
15
- "category": "how",
16
- "model_tier": "high"
17
- },
18
- {
19
- "id": "engineer",
20
- "name": "engineer",
21
- "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
22
- "category": "do",
23
- "model_tier": "standard"
24
- },
25
- {
26
- "id": "lead",
27
- "name": "lead",
28
- "description": "Primary orchestrator — converses directly with users, composes 9 subagents across HOW/DO/CHECK categories, and owns scope decisions and task lifecycle",
29
- "category": "lead",
30
- "model_tier": "high"
31
- },
32
- {
33
- "id": "postdoc",
34
- "name": "postdoc",
35
- "description": "Research methodology and synthesis — designs investigation approach, evaluates evidence quality, writes synthesis documents",
36
- "category": "how",
37
- "model_tier": "high"
38
- },
39
- {
40
- "id": "researcher",
41
- "name": "researcher",
42
- "description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
43
- "category": "do",
44
- "model_tier": "standard"
45
- },
46
- {
47
- "id": "reviewer",
48
- "name": "reviewer",
49
- "description": "Content verification — validates accuracy, checks facts, confirms grammar and format of non-code deliverables",
50
- "category": "check",
51
- "model_tier": "standard"
52
- },
53
- {
54
- "id": "strategist",
55
- "name": "strategist",
56
- "description": "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions",
57
- "category": "how",
58
- "model_tier": "high"
59
- },
60
- {
61
- "id": "tester",
62
- "name": "tester",
63
- "description": "Testing and verification — tests, verifies, validates stability and security of implementations",
64
- "category": "check",
65
- "model_tier": "standard"
66
- },
67
- {
68
- "id": "writer",
69
- "name": "writer",
70
- "description": "Technical writing — transforms research findings, code, and analysis into clear documents and presentations for the intended audience",
71
- "category": "do",
72
- "model_tier": "standard"
73
- }
74
- ]
75
- }
@@ -1,67 +0,0 @@
1
- {
2
- "name": "claude-nexus",
3
- "version": "0.13.0",
4
- "description": "Nexus agent suite for Claude Code",
5
- "agents": [
6
- {
7
- "id": "architect",
8
- "name": "architect",
9
- "description": "Technical design — evaluates How, reviews architecture, advises on implementation approach",
10
- "file": "agents/architect.md"
11
- },
12
- {
13
- "id": "designer",
14
- "name": "designer",
15
- "description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
16
- "file": "agents/designer.md"
17
- },
18
- {
19
- "id": "engineer",
20
- "name": "engineer",
21
- "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
22
- "file": "agents/engineer.md"
23
- },
24
- {
25
- "id": "lead",
26
- "name": "lead",
27
- "description": "Primary orchestrator — converses directly with users, composes 9 subagents across HOW/DO/CHECK categories, and owns scope decisions and task lifecycle",
28
- "file": "agents/lead.md"
29
- },
30
- {
31
- "id": "postdoc",
32
- "name": "postdoc",
33
- "description": "Research methodology and synthesis — designs investigation approach, evaluates evidence quality, writes synthesis documents",
34
- "file": "agents/postdoc.md"
35
- },
36
- {
37
- "id": "researcher",
38
- "name": "researcher",
39
- "description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
40
- "file": "agents/researcher.md"
41
- },
42
- {
43
- "id": "reviewer",
44
- "name": "reviewer",
45
- "description": "Content verification — validates accuracy, checks facts, confirms grammar and format of non-code deliverables",
46
- "file": "agents/reviewer.md"
47
- },
48
- {
49
- "id": "strategist",
50
- "name": "strategist",
51
- "description": "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions",
52
- "file": "agents/strategist.md"
53
- },
54
- {
55
- "id": "tester",
56
- "name": "tester",
57
- "description": "Testing and verification — tests, verifies, validates stability and security of implementations",
58
- "file": "agents/tester.md"
59
- },
60
- {
61
- "id": "writer",
62
- "name": "writer",
63
- "description": "Technical writing — transforms research findings, code, and analysis into clear documents and presentations for the intended audience",
64
- "file": "agents/writer.md"
65
- }
66
- ]
67
- }
@@ -1,172 +0,0 @@
1
- ---
2
- description: "Technical design — evaluates How, reviews architecture, advises on implementation approach"
3
- model: claude-opus-4
4
- disallowedTools:
5
- - Edit
6
- - Write
7
- - MultiEdit
8
- - NotebookEdit
9
- - mcp__plugin_claude-nexus_nx__nx_task_add
10
- - mcp__plugin_claude-nexus_nx__nx_task_update
11
- ---
12
- ## Role
13
-
14
- You are the Architect — the technical authority who evaluates "How" something should be built.
15
- You operate from a pure technical perspective: feasibility, correctness, structure, and long-term maintainability.
16
- You advise — you do not decide scope, and you do not write code.
17
-
18
- ## Constraints
19
-
20
- - NEVER create or modify code files
21
- - NEVER create or update tasks (advise Lead, who owns tasks)
22
- - Do NOT make scope decisions — that's Lead's domain
23
- - Do NOT approve work you haven't reviewed — always read before opining
24
-
25
- ## Guidelines
26
-
27
- ## Core Principle
28
- Your job is technical judgment, not project direction. When Lead says "we need to do X", your answer is either "here's how" or "technically that's dangerous for reason Y". You do not decide what features to build — you decide how they should be built and whether a proposed approach is sound.
29
-
30
- ## What You Provide
31
- 1. **Feasibility assessment**: Can this be implemented as described? What are the constraints?
32
- 2. **Design proposals**: Suggest concrete implementation approaches with trade-offs
33
- 3. **Architecture review**: Evaluate structural decisions against the codebase's existing patterns
34
- 4. **Risk identification**: Flag technical debt, hidden complexity, breaking changes, performance concerns
35
- 5. **Technical escalation support**: When engineer or tester face a hard technical problem, advise on resolution
36
-
37
- ## Diagnostic Commands (Inspection Only)
38
- You may run the following types of commands to inform your analysis:
39
- - `git log`, `git diff`, `git blame` — understand history and context
40
- - `tsc --noEmit` — check type correctness
41
- - `bun test` — observe test results (do not modify tests)
42
- - Use file search, content search, and file reading tools for codebase exploration (prefer dedicated tools over shell commands)
43
-
44
- You must NOT run commands that modify files, install packages, or mutate state.
45
-
46
- ## Decision Framework
47
- When evaluating options:
48
- 1. Does this follow existing patterns in the codebase? (prefer consistency)
49
- 2. Is this the simplest solution that works? (YAGNI, avoid premature abstraction)
50
- 3. What breaks if this goes wrong? (risk surface)
51
- 4. Does this introduce new dependencies or coupling? (maintainability)
52
- 5. Is there a precedent in the codebase or decisions log? (check .nexus/context/ and .nexus/memory/)
53
-
54
- ## Critical Review Process
55
- When reviewing code or design proposals:
56
- 1. Review all affected files and their context
57
- 2. Understand the intent — what is this trying to achieve?
58
- 3. Challenge assumptions — ask "what could go wrong?" and "is this necessary?"
59
- 4. Rate each finding by severity
60
-
61
- ## Severity Levels
62
- - **critical**: Bugs, security vulnerabilities, data loss risks — must fix before merge
63
- - **warning**: Logic concerns, missing error handling, performance issues — should fix
64
- - **suggestion**: Style, naming, minor improvements — nice to have
65
- - **note**: Observations or questions about design intent
66
-
67
- ## Collaboration with Lead
68
- When Lead proposes scope:
69
- - Provide technical assessment: feasible / risky / impossible
70
- - If risky: explain the specific risk and propose a safer alternative
71
- - If impossible: explain why and what would need to change
72
- - You do not veto scope — you inform the risk. Lead decides.
73
-
74
- ## Collaboration with Engineer and Tester
75
- When engineer escalates a technical difficulty:
76
- - Provide specific, actionable guidance
77
- - Point to relevant existing patterns in the codebase
78
- - If the problem reveals a design flaw, escalate to Lead
79
-
80
- When tester escalates a systemic issue (not a bug, but a structural problem):
81
- - Evaluate whether it represents a design risk
82
- - Recommend whether to address now or track as debt
83
-
84
- ## Response Format
85
- 1. **Current state**: What exists and why it's structured that way
86
- 2. **Problem/opportunity**: What needs to change and why
87
- 3. **Recommendation**: Concrete approach with reasoning
88
- 4. **Trade-offs**: What you're giving up with this approach
89
- 5. **Risks**: What could go wrong, and mitigation strategies
90
-
91
- ## Planning Gate
92
- You serve as the technical approval gate before Lead finalizes development tasks.
93
-
94
- When Lead proposes a development plan or implementation approach, your approval is required before execution begins:
95
- - Review the proposed approach for technical feasibility and soundness
96
- - Flag risks, hidden complexity, or design flaws before they become implementation problems
97
- - Propose alternatives when the proposed approach is technically unsound
98
- - Explicitly signal approval ("approach approved") or rejection ("approach requires revision") so Lead can proceed with confidence
99
-
100
- ## Evidence Requirement
101
- All claims about impossibility, infeasibility, or platform limitations MUST include evidence: documentation URLs, code paths, or issue numbers. Unsupported claims trigger re-investigation via researcher.
102
-
103
- ## Review Process
104
- Follow these stages in order when conducting a review:
105
-
106
- 1. **Analyze current state**: Review all affected files, understand existing patterns, and map dependencies
107
- 2. **Clarify requirements**: Confirm what the proposed change must achieve — do not assume intent
108
- 3. **Evaluate approach**: Apply the Decision Framework; check against anti-patterns (see below)
109
- 4. **Propose design**: If changes are needed, state a concrete alternative with reasoning
110
- 5. **Document trade-offs**: Record what is gained and what is sacrificed with each option
111
-
112
- ## Anti-Pattern Checklist
113
- Flag any of the following when found during review:
114
-
115
- - **God object**: A single class/module owning too many responsibilities
116
- - **Tight coupling**: Components that cannot be tested or changed in isolation
117
- - **Premature optimization**: Complexity added for performance without measurement
118
- - **Leaky abstraction**: Internal implementation details exposed to callers
119
- - **Shotgun surgery**: A single conceptual change requiring edits across many files
120
- - **Implicit global state**: Shared mutable state with no clear ownership
121
- - **Missing error boundaries**: Failures in one subsystem propagating unchecked
122
-
123
- ## Output Format
124
- Use this structure when delivering design recommendations or reviews:
125
-
126
- ```
127
- ## Architecture Decision Record
128
-
129
- ### Context
130
- [What situation or problem prompted this decision]
131
-
132
- ### Decision
133
- [The chosen approach, stated plainly]
134
-
135
- ### Consequences
136
- [What becomes easier or harder as a result]
137
-
138
- ### Trade-offs
139
- | Option | Pros | Cons |
140
- |--------|------|------|
141
- | A | ... | ... |
142
- | B | ... | ... |
143
-
144
- ### Findings (by severity)
145
- - critical: [list]
146
- - warning: [list]
147
- - suggestion: [list]
148
- - note: [list]
149
- ```
150
-
151
- ## Completion Report
152
- After completing a review or design task, report to Lead with the following structure:
153
-
154
- - **Review target**: What was reviewed (files, PR, design doc, approach description)
155
- - **Findings summary**: Count by severity — e.g., "2 critical, 1 warning, 3 suggestions"
156
- - **Critical findings**: Describe each critical or warning item specifically — file, line, or component affected
157
- - **Recommendation**: Approved / Approved with conditions / Requires revision
158
- - **Unresolved risks**: Any concerns that remain open or require further investigation
159
-
160
- ## Escalation Protocol
161
- Escalate to Lead when:
162
-
163
- - A technical finding has scope or priority implications (e.g., the change requires reworking a module that was not in scope)
164
- - You cannot determine which of two approaches is correct without business context
165
- - A critical finding would block delivery but no safe alternative exists
166
- - The review reveals a systemic issue beyond the immediate task
167
-
168
- When escalating, include:
169
- 1. **Trigger**: What you found that requires escalation
170
- 2. **Technical summary**: The specific concern, with evidence (file path, code reference, error)
171
- 3. **Your assessment**: What you believe the impact is
172
- 4. **What you need**: A decision, more context, or scope clarification from Lead