@moreih29/nexus-core 0.17.0 → 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 (415) 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 -6
  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 -200
  165. package/assets/hooks/agent-bootstrap/handler.test.ts +0 -369
  166. package/assets/hooks/agent-bootstrap/handler.ts +0 -132
  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 -10
  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 -31
  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 -114
  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 -22
  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 -238
  225. package/dist/claude/dist/hooks/agent-finalize.js +0 -180
  226. package/dist/claude/dist/hooks/post-tool-telemetry.js +0 -71
  227. package/dist/claude/dist/hooks/prompt-router.js +0 -7336
  228. package/dist/claude/dist/hooks/session-init.js +0 -50
  229. package/dist/claude/hooks/hooks.json +0 -64
  230. package/dist/claude/settings.json +0 -3
  231. package/dist/claude/skills/nx-init/SKILL.md +0 -189
  232. package/dist/claude/skills/nx-plan/SKILL.md +0 -353
  233. package/dist/claude/skills/nx-run/SKILL.md +0 -154
  234. package/dist/claude/skills/nx-sync/SKILL.md +0 -87
  235. package/dist/codex/agents/architect.toml +0 -175
  236. package/dist/codex/agents/designer.toml +0 -123
  237. package/dist/codex/agents/engineer.toml +0 -105
  238. package/dist/codex/agents/lead.toml +0 -64
  239. package/dist/codex/agents/postdoc.toml +0 -120
  240. package/dist/codex/agents/researcher.toml +0 -136
  241. package/dist/codex/agents/reviewer.toml +0 -137
  242. package/dist/codex/agents/strategist.toml +0 -114
  243. package/dist/codex/agents/tester.toml +0 -194
  244. package/dist/codex/agents/writer.toml +0 -121
  245. package/dist/codex/dist/hooks/agent-bootstrap.js +0 -238
  246. package/dist/codex/dist/hooks/agent-finalize.js +0 -180
  247. package/dist/codex/dist/hooks/prompt-router.js +0 -7336
  248. package/dist/codex/dist/hooks/session-init.js +0 -50
  249. package/dist/codex/hooks/hooks.json +0 -28
  250. package/dist/codex/install/AGENTS.fragment.md +0 -60
  251. package/dist/codex/install/config.fragment.toml +0 -5
  252. package/dist/codex/install/install.sh +0 -60
  253. package/dist/codex/package.json +0 -20
  254. package/dist/codex/plugin/.codex-plugin/plugin.json +0 -57
  255. package/dist/codex/plugin/skills/nx-init/SKILL.md +0 -189
  256. package/dist/codex/plugin/skills/nx-plan/SKILL.md +0 -353
  257. package/dist/codex/plugin/skills/nx-run/SKILL.md +0 -154
  258. package/dist/codex/plugin/skills/nx-sync/SKILL.md +0 -87
  259. package/dist/codex/prompts/architect.md +0 -166
  260. package/dist/codex/prompts/designer.md +0 -114
  261. package/dist/codex/prompts/engineer.md +0 -97
  262. package/dist/codex/prompts/lead.md +0 -60
  263. package/dist/codex/prompts/postdoc.md +0 -111
  264. package/dist/codex/prompts/researcher.md +0 -127
  265. package/dist/codex/prompts/reviewer.md +0 -128
  266. package/dist/codex/prompts/strategist.md +0 -105
  267. package/dist/codex/prompts/tester.md +0 -185
  268. package/dist/codex/prompts/writer.md +0 -113
  269. package/dist/hooks/agent-bootstrap.js +0 -238
  270. package/dist/hooks/agent-finalize.js +0 -180
  271. package/dist/hooks/post-tool-telemetry.js +0 -71
  272. package/dist/hooks/prompt-router.js +0 -7336
  273. package/dist/hooks/session-init.js +0 -50
  274. package/dist/manifests/claude-hooks.json +0 -64
  275. package/dist/manifests/codex-hooks.json +0 -28
  276. package/dist/manifests/opencode-manifest.json +0 -54
  277. package/dist/manifests/portability-report.json +0 -75
  278. package/dist/opencode/.opencode/skills/nx-init/SKILL.md +0 -189
  279. package/dist/opencode/.opencode/skills/nx-plan/SKILL.md +0 -353
  280. package/dist/opencode/.opencode/skills/nx-run/SKILL.md +0 -154
  281. package/dist/opencode/.opencode/skills/nx-sync/SKILL.md +0 -87
  282. package/dist/opencode/package.json +0 -23
  283. package/dist/opencode/src/agents/architect.ts +0 -176
  284. package/dist/opencode/src/agents/designer.ts +0 -124
  285. package/dist/opencode/src/agents/engineer.ts +0 -105
  286. package/dist/opencode/src/agents/lead.ts +0 -66
  287. package/dist/opencode/src/agents/postdoc.ts +0 -121
  288. package/dist/opencode/src/agents/researcher.ts +0 -136
  289. package/dist/opencode/src/agents/reviewer.ts +0 -137
  290. package/dist/opencode/src/agents/strategist.ts +0 -115
  291. package/dist/opencode/src/agents/tester.ts +0 -194
  292. package/dist/opencode/src/agents/writer.ts +0 -121
  293. package/dist/opencode/src/index.ts +0 -25
  294. package/dist/opencode/src/plugin.ts +0 -6
  295. package/dist/scripts/build-agents.d.ts +0 -170
  296. package/dist/scripts/build-agents.d.ts.map +0 -1
  297. package/dist/scripts/build-agents.js +0 -907
  298. package/dist/scripts/build-agents.js.map +0 -1
  299. package/dist/scripts/build-hooks.d.ts +0 -57
  300. package/dist/scripts/build-hooks.d.ts.map +0 -1
  301. package/dist/scripts/build-hooks.js +0 -562
  302. package/dist/scripts/build-hooks.js.map +0 -1
  303. package/dist/scripts/cli.d.ts +0 -54
  304. package/dist/scripts/cli.d.ts.map +0 -1
  305. package/dist/scripts/cli.js +0 -504
  306. package/dist/scripts/cli.js.map +0 -1
  307. package/dist/scripts/smoke/smoke-claude.d.ts +0 -2
  308. package/dist/scripts/smoke/smoke-claude.d.ts.map +0 -1
  309. package/dist/scripts/smoke/smoke-claude.js +0 -58
  310. package/dist/scripts/smoke/smoke-claude.js.map +0 -1
  311. package/dist/scripts/smoke/smoke-codex.d.ts +0 -2
  312. package/dist/scripts/smoke/smoke-codex.d.ts.map +0 -1
  313. package/dist/scripts/smoke/smoke-codex.js +0 -50
  314. package/dist/scripts/smoke/smoke-codex.js.map +0 -1
  315. package/dist/scripts/smoke/smoke-consumer.d.ts +0 -2
  316. package/dist/scripts/smoke/smoke-consumer.d.ts.map +0 -1
  317. package/dist/scripts/smoke/smoke-consumer.js +0 -230
  318. package/dist/scripts/smoke/smoke-consumer.js.map +0 -1
  319. package/dist/scripts/smoke/smoke-opencode.d.ts +0 -2
  320. package/dist/scripts/smoke/smoke-opencode.d.ts.map +0 -1
  321. package/dist/scripts/smoke/smoke-opencode.js +0 -99
  322. package/dist/scripts/smoke/smoke-opencode.js.map +0 -1
  323. package/dist/src/hooks/opencode-mount.d.ts +0 -35
  324. package/dist/src/hooks/opencode-mount.d.ts.map +0 -1
  325. package/dist/src/hooks/opencode-mount.js +0 -352
  326. package/dist/src/hooks/opencode-mount.js.map +0 -1
  327. package/dist/src/hooks/runtime.d.ts +0 -37
  328. package/dist/src/hooks/runtime.d.ts.map +0 -1
  329. package/dist/src/hooks/runtime.js +0 -274
  330. package/dist/src/hooks/runtime.js.map +0 -1
  331. package/dist/src/hooks/types.d.ts +0 -196
  332. package/dist/src/hooks/types.d.ts.map +0 -1
  333. package/dist/src/hooks/types.js +0 -85
  334. package/dist/src/hooks/types.js.map +0 -1
  335. package/dist/src/lsp/cache.d.ts +0 -9
  336. package/dist/src/lsp/cache.d.ts.map +0 -1
  337. package/dist/src/lsp/cache.js +0 -216
  338. package/dist/src/lsp/cache.js.map +0 -1
  339. package/dist/src/lsp/client.d.ts +0 -24
  340. package/dist/src/lsp/client.d.ts.map +0 -1
  341. package/dist/src/lsp/client.js +0 -166
  342. package/dist/src/lsp/client.js.map +0 -1
  343. package/dist/src/lsp/detect.d.ts +0 -77
  344. package/dist/src/lsp/detect.d.ts.map +0 -1
  345. package/dist/src/lsp/detect.js +0 -116
  346. package/dist/src/lsp/detect.js.map +0 -1
  347. package/dist/src/mcp/server.d.ts.map +0 -1
  348. package/dist/src/mcp/server.js +0 -34
  349. package/dist/src/mcp/server.js.map +0 -1
  350. package/dist/src/mcp/tools/artifact.d.ts.map +0 -1
  351. package/dist/src/mcp/tools/artifact.js +0 -36
  352. package/dist/src/mcp/tools/artifact.js.map +0 -1
  353. package/dist/src/mcp/tools/history.d.ts.map +0 -1
  354. package/dist/src/mcp/tools/history.js +0 -29
  355. package/dist/src/mcp/tools/history.js.map +0 -1
  356. package/dist/src/mcp/tools/lsp.d.ts +0 -13
  357. package/dist/src/mcp/tools/lsp.d.ts.map +0 -1
  358. package/dist/src/mcp/tools/lsp.js +0 -225
  359. package/dist/src/mcp/tools/lsp.js.map +0 -1
  360. package/dist/src/mcp/tools/plan.d.ts.map +0 -1
  361. package/dist/src/mcp/tools/plan.js +0 -317
  362. package/dist/src/mcp/tools/plan.js.map +0 -1
  363. package/dist/src/mcp/tools/task.d.ts.map +0 -1
  364. package/dist/src/mcp/tools/task.js +0 -252
  365. package/dist/src/mcp/tools/task.js.map +0 -1
  366. package/dist/src/shared/invocations.d.ts +0 -74
  367. package/dist/src/shared/invocations.d.ts.map +0 -1
  368. package/dist/src/shared/invocations.js +0 -247
  369. package/dist/src/shared/invocations.js.map +0 -1
  370. package/dist/src/shared/json-store.d.ts.map +0 -1
  371. package/dist/src/shared/json-store.js.map +0 -1
  372. package/dist/src/shared/mcp-utils.d.ts.map +0 -1
  373. package/dist/src/shared/mcp-utils.js.map +0 -1
  374. package/dist/src/shared/package-root.d.ts +0 -6
  375. package/dist/src/shared/package-root.d.ts.map +0 -1
  376. package/dist/src/shared/package-root.js +0 -19
  377. package/dist/src/shared/package-root.js.map +0 -1
  378. package/dist/src/shared/paths.d.ts.map +0 -1
  379. package/dist/src/shared/paths.js +0 -117
  380. package/dist/src/shared/paths.js.map +0 -1
  381. package/dist/src/shared/tool-log.d.ts +0 -8
  382. package/dist/src/shared/tool-log.d.ts.map +0 -1
  383. package/dist/src/shared/tool-log.js +0 -22
  384. package/dist/src/shared/tool-log.js.map +0 -1
  385. package/dist/src/types/agent-config.d.ts +0 -22
  386. package/dist/src/types/agent-config.d.ts.map +0 -1
  387. package/dist/src/types/agent-config.js +0 -2
  388. package/dist/src/types/agent-config.js.map +0 -1
  389. package/dist/src/types/index.d.ts +0 -2
  390. package/dist/src/types/index.d.ts.map +0 -1
  391. package/dist/src/types/index.js +0 -2
  392. package/dist/src/types/index.js.map +0 -1
  393. package/dist/src/types/state.d.ts.map +0 -1
  394. package/dist/src/types/state.js.map +0 -1
  395. package/docs/consuming/codex-lead-merge.md +0 -106
  396. package/docs/contract/harness-io.md +0 -333
  397. package/docs/plugin-guide.md +0 -355
  398. package/docs/plugin-template/claude/.github/workflows/build.yml +0 -60
  399. package/docs/plugin-template/claude/README.md +0 -110
  400. package/docs/plugin-template/claude/package.json +0 -16
  401. package/docs/plugin-template/codex/.github/workflows/build.yml +0 -51
  402. package/docs/plugin-template/codex/README.md +0 -147
  403. package/docs/plugin-template/codex/install/install.sh +0 -60
  404. package/docs/plugin-template/codex/package.json +0 -17
  405. package/docs/plugin-template/opencode/.github/workflows/build.yml +0 -61
  406. package/docs/plugin-template/opencode/README.md +0 -121
  407. package/docs/plugin-template/opencode/package.json +0 -25
  408. package/docs/plugin-template/opencode/src/plugin.ts +0 -6
  409. /package/dist/{src/mcp/tools → mcp/handlers}/artifact.d.ts +0 -0
  410. /package/dist/{src/mcp/tools → mcp/handlers}/history.d.ts +0 -0
  411. /package/dist/{src/mcp/tools → mcp/handlers}/plan.d.ts +0 -0
  412. /package/dist/{src/mcp/tools → mcp/handlers}/task.d.ts +0 -0
  413. /package/dist/{src/shared → shared}/json-store.d.ts +0 -0
  414. /package/dist/{src/shared → shared}/mcp-utils.d.ts +0 -0
  415. /package/dist/{src/shared → shared}/mcp-utils.js +0 -0
@@ -1,353 +0,0 @@
1
- ---
2
- description: "Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched plan before execution. Plan only — does not execute."
3
- triggers:
4
- - plan
5
- ---
6
- ## Role
7
-
8
- Facilitate structured multi-perspective analysis using subagents to decompose issues, deliberate on options, and align on decisions. Lead acts as synthesizer AND active participant — orchestrates subagent research/analysis AND contributes its own position. Does not execute — planning only. Transition to execution is the user's decision.
9
-
10
- ## Constraints
11
-
12
- - NEVER execute — this skill is planning only; transition to execution is the user's decision
13
- - NEVER call `nx_plan_start` before research is complete (research_summary is required)
14
- - NEVER present multiple issues at once — one issue at a time only
15
- - NEVER ask groundless questions — always research code/knowledge/decisions first
16
- - NEVER use the harness's team creation primitive. Inter-agent messaging for resume is permitted ONLY for resuming completed subagents whose `resume_tier` is `persistent` or `bounded`, and ONLY within the constraints of the Resume Policy section below. Direct inter-agent communication to running teammates remains forbidden in plan sessions.
17
- - MUST record all decisions with `[d]` tag so they are not scattered across turns
18
- - MUST call `nx_plan_decide` when recording `[d]`
19
- - MUST check for existing plan.json before starting a new session
20
- - `[d]` without an active plan.json is BLOCKED — "[d]는 plan 세션 안에서만 유효합니다."
21
- - MUST present a comparison table before asking for a decision — never present options as prose only. Format:
22
-
23
- ```
24
- | | A: {title} | B: {title} |
25
- |---|---|---|
26
- | Pros | ... | ... |
27
- | Cons | ... | ... |
28
- | Pick | | **(Recommended)** |
29
- ```
30
-
31
- ## Guidelines
32
-
33
- ## Trigger
34
-
35
- - Explicit tag: `[plan]` — continue existing session if plan.json exists, otherwise start new
36
- - Additional analysis needed mid-session: spawn HOW subagents independently via the harness's subagent spawn primitive
37
- - Continuing conversation without a tag → continue existing session
38
-
39
- ---
40
-
41
- ## Auto Mode (`[plan:auto]`)
42
-
43
- When triggered with `[plan:auto]` or invoked via `$nx-plan`, run the full planning process **without user interaction**:
44
-
45
- 1. **Research** — spawn researcher+Explore subagents (same as interactive)
46
- 2. **Issue derivation** — Lead identifies issues from research
47
- 3. **Auto-decide** — for each issue, Lead selects the recommended option without presenting choices. Each `nx_plan_decide(summary)` MUST include: selected approach + reason, AND rejected alternatives + why they were dismissed. No comparison table needed, but internal deliberation is mandatory.
48
- 4. **Decision briefing** — output a concise summary of all decisions before generating tasks:
49
- ```
50
- [auto-plan complete] N issues, N decisions:
51
- - #1: {selected} ({rejected alternative} — reason)
52
- - #2: ...
53
- ```
54
- Do not wait for user response — proceed immediately to task generation.
55
- 5. **Plan document** — generate tasks.json following Step 7 rules (including HOW-assisted decomposition if `how_agents` present in plan.json issues). Apply owner table and verification auto-pairing.
56
-
57
- Key differences from interactive mode:
58
- - No user prompts or comparison tables — Lead decides autonomously
59
- - No dynamic agenda proposals — Lead handles all derived issues internally
60
- - Output: tasks.json ready for `[run]` execution
61
-
62
- **Scope by invocation context:**
63
- - `[plan:auto]` standalone → auto-plan + briefing + tasks.json generation. Stops here.
64
- - Invoked by `[run]` (tasks.json absent) → auto-plan + briefing + tasks.json generation + seamless execution transition. No pause between plan and run.
65
-
66
- This mode is invoked internally by `[run]` when no tasks.json exists, or explicitly by the user with `[plan:auto]`.
67
-
68
- ---
69
-
70
- ## Procedure (Interactive Mode)
71
-
72
- ### Step 1: Intent Discovery
73
-
74
- Determine planning depth and identify which HOW subagents to delegate analysis to, based on Progressive Depth.
75
-
76
- | Level | Signal | Exploration Scope |
77
- |-------|--------|-------------------|
78
- | **Specific** | File path, function name, error message, or concrete target named | Focused on the relevant file/module |
79
- | **Direction-setting** | Open-ended question, "it would be nice if ~", choice needed among approaches | Related area + external case research |
80
- | **Abstract** | "I don't know how to approach this", goal itself unclear, fundamental direction | Full codebase + external research + comparable project comparison |
81
-
82
- - Specific request → confirm intent with 1–2 questions, derive issues immediately
83
- - Direction-setting → use hypothesis-based questions to understand intent
84
- - Abstract/fundamental → actively interview to uncover root goals the user hasn't clarified
85
-
86
- **HOW subagent selection rule:**
87
- - User explicitly names agents → use as-is, propose additions if gaps detected
88
- - User does not name agents → Lead proposes based on issue scope, confirm with user
89
- - Additional HOW subagents can be spawned at any time during analysis (Lead's or user's discretion)
90
-
91
- ### Step 2: Research
92
-
93
- Understand code, core knowledge, and prior decisions before forming a planning agenda.
94
-
95
- **Start by checking existing knowledge**: before spawning any subagent, use file pattern search and file reading to scan `.nexus/memory/` and `.nexus/context/` for relevant memos and context files, and use `nx_history_search` to check for prior decisions on this topic. If the needed information is already there, use it directly and skip or narrow the subagent spawn. Only spawn subagents to fill gaps not covered by existing knowledge.
96
-
97
- **Approach selection:**
98
-
99
- | Scenario | Approach |
100
- |----------|----------|
101
- | Codebase orientation | `spawn_agent("explore", "<file/code search task>")` for codebase exploration |
102
- | External research needed | `spawn_agent("researcher", "<research question>")` for web search |
103
- | Both codebase and external | Spawn Explore + Researcher in parallel |
104
-
105
- - NEVER call `nx_plan_start` before research is complete.
106
- - `research_summary` parameter in `nx_plan_start` is required — forces research completion before session creation.
107
- - Researcher subagents are spawned via the harness's subagent spawn primitive and return findings to Lead. They do not join the plan session.
108
-
109
- **Existing session (plan.json present):**
110
- - Check current state with `nx_plan_status`.
111
- - If new topic or additional research needed → spawn researcher subagent accordingly.
112
- - Do not proceed to next issue before research is complete.
113
-
114
- ### Step 3: Session Setup
115
-
116
- Register the planning session.
117
-
118
- 1. **`nx_plan_start(topic, issues, research_summary)`** — register plan in plan.json; auto-archives any existing plan.json.
119
- 2. Show the issue list to the user and confirm before proceeding.
120
-
121
- ### Step 4: Analysis
122
-
123
- **Always proceed one issue at a time.** Never present multiple issues simultaneously.
124
-
125
- For each issue:
126
-
127
- 1. **Current State Analysis** — Lead summarizes the current state and problems, drawing on research.
128
- 2. **Subagent Analysis** — for complex issues, spawn HOW subagents (architect, strategist, etc.) in parallel via the harness's subagent spawn primitive. Each subagent independently analyzes the issue and returns findings.
129
- - **Domain-Agent mapping** — match issue keywords to recommended HOW subagents:
130
-
131
- | Domain keywords | Recommended HOW |
132
- |----------------|-----------------|
133
- | UI, UX, 디자인, 인터페이스, 사용자 경험, 레이아웃 | Designer |
134
- | 아키텍처, 시스템 설계, 성능, 구조 변경, API, 스키마 | Architect |
135
- | 비즈니스, 시장, 전략, 포지셔닝, 경쟁, 수익 | Strategist |
136
- | 연구 방법론, 근거 평가, 문헌, 실험 설계 | Postdoc |
137
-
138
- - **Opt-out default**: if the issue matches a domain in the mapping, spawning is the default. Multiple matches → multiple spawns. To skip, state "{Agent} not needed — reason: ..." in the analysis text.
139
- - **No mapping match**: if no domain matches, Lead analyzes directly. When uncertain, spawn — the cost of an unnecessary spawn is lower than the cost of a shallow analysis.
140
- - **Record HOW findings**: after HOW subagents return, include their agent names and key findings when recording the decision via `nx_plan_decide(how_agents=[...], how_summary={...})`. This data is stored in plan.json for Step 7 task generation.
141
- 3. **Present Options** — after synthesis, Lead presents a comparison:
142
-
143
- ```
144
- | Item | A: {title} | B: {title} | C: {title} |
145
- |------|-----------|-----------|-----------|
146
- | Pros | ... | ... | ... |
147
- | Cons | ... | ... | ... |
148
- | Trade-offs | ... | ... | ... |
149
- | Best for | ... | ... | ... |
150
-
151
- **Recommendation: {X} ({title})**
152
-
153
- - Option A falls short because {reason}
154
- - Option B falls short because {reason}
155
- - Option X overcomes {A/B limitations} → {core benefit}
156
- ```
157
-
158
- 4. **Await user response** — receive free-form responses. Users may combine options, push back, or ask follow-up questions.
159
-
160
- ## Resume Policy
161
-
162
- When the harness's resume mechanism is unavailable, ALL resume paths are disabled — force fresh spawn. Otherwise:
163
-
164
- | resume_tier | Same-issue default | Cross-issue | Disqualifiers |
165
- |---|---|---|---|
166
- | persistent | resume by default | Lead opt-in only | counter-evidence / reversal / re-review issue → fresh |
167
- | bounded | conditional (same artifact only) | forbidden | loop 3x / feedback cycle (REVISION_REQUIRED) → fresh |
168
- | ephemeral | forbidden | forbidden | N/A (always fresh) |
169
-
170
- Before resuming a `bounded` agent: include a "re-read target files before any modification" instruction in the prompt. Bounded resume without re-read is BLOCKED.
171
-
172
- `resume_tier` is read from each agent's frontmatter (`agents/*.md`). If absent, treat as `ephemeral` (most conservative).
173
-
174
- ### Step 5: Record Decision
175
-
176
- When the user decides, record with the `[d]` tag.
177
-
178
- - gate.ts detects `[d]` and routes to `nx_plan_decide`.
179
- - `nx_plan_decide(issue_id, summary)` — marks issue as `decided`, writes `decision` inline in plan.json.
180
- - Decisions are NOT written to decisions.json — plan.json is the single source of truth.
181
- - `[d]` without plan.json is blocked.
182
- - **Progress anchoring**: immediately after recording, output one line: "Issue #N decided (M of K complete). Next: #X — {title}." This keeps the user oriented in multi-issue sessions.
183
-
184
- **Immediately after each decision**, Lead checks: "Does this decision create follow-up questions or new issues?" If yes, propose adding via `nx_plan_update(action='add')` before moving to the next issue.
185
-
186
- **Decision reversal**: if the user wants to reconsider a prior decision ("아까 결정 다시 생각해보자", "issue #N 번복"), Lead calls `nx_plan_update(action='reopen', issue_id=N)` to reopen the issue and returns to Step 4 analysis for that issue.
187
-
188
- ### Step 6: Dynamic Agenda + Wrap-up
189
-
190
- After each decision, Lead automatically checks for derived issues.
191
-
192
- - **Dynamic agenda proposal**: after a decision is recorded, Lead examines whether the decision implies follow-on questions or unresolved sub-issues. If found, propose adding them with `nx_plan_update(action='add', ...)` and confirm with the user before adding.
193
- - Pending issues remain → naturally transition to the next issue.
194
- - All issues decided → **Gap check**: compare original question/topic against the issue list.
195
- - Gap found → register additional issues with `nx_plan_update(action='add', ...)`, return to Step 4.
196
- - No gap → signal planning complete.
197
- - Wrap-up: confirm all analysis threads have reported conclusions to Lead.
198
- - Proceed to Step 7 automatically — do not ask whether to generate the plan document.
199
-
200
- ### Step 7: Plan Document Generation
201
-
202
- All issues decided → generate the plan document (tasks.json) immediately:
203
-
204
- 1. **Collect decisions** — gather all `decided` issues from plan.json
205
- 2. **Derive tasks** — decompose decisions into concrete, actionable tasks
206
-
207
- **HOW-assisted task decomposition**: check plan.json issues for `how_agents` field.
208
- - If HOW agents participated in analysis → re-spawn those HOWs with the decided approach + their prior `how_summary` as context. Ask them to propose task decomposition and owner assignment for their domain.
209
- - If no HOW agents participated → Lead decomposes alone using the owner table and auto-pairing rules above.
210
- - This ensures task generation depth is proportional to plan analysis depth.
211
-
212
- 3. **Enrich each task** with:
213
- - `approach` — implementation strategy derived from the decision rationale
214
- - `acceptance` — definition of done, verifiable criteria
215
- - `risk` — known risks or caveats from the analysis
216
- - `deps` — task dependencies based on execution order
217
- - `owner` — assign based on delegation analysis:
218
-
219
- | Work type | owner | Criteria |
220
- |-----------|-------|----------|
221
- | Single file, small change | **lead** | Subagent overhead > task effort |
222
- | Code implementation (.ts, .js, .py, etc.) | **engineer** | Source code creation/modification |
223
- | Documentation/content (.md, non-code) | **writer** | .md files, README, docs, non-code content |
224
- | Web research / external investigation | **researcher** | External information gathering needed |
225
- | Design analysis / review | **architect** etc. HOW | Technical trade-off judgment |
226
- | Sequential edits to same file | **lead** | Parallel subagents risk conflict |
227
-
228
- **Primary metric — artifact-coherence**: a well-scoped task targets a single artifact or a tightly coupled artifact cluster and makes a single coherent change. A change is coherent when (a) it can be described in one sentence, (b) reverting it leaves all other artifacts consistent, and (c) its acceptance can be verified by inspecting its outputs alone.
229
-
230
- **Verification auto-pairing (conditional)** — create a CHECK task only when the DO task's acceptance includes the appropriate verification trigger:
231
- - `owner: "engineer"` + acceptance contains a runtime-behavior criterion → pair a **tester** task.
232
- - `owner: "writer"` + acceptance contains a verifiable deliverable criterion → pair a **reviewer** task.
233
- - Exclusions: pure refactor (behavior-preserving), type-only changes, docs-adjacent tasks (.md or frontmatter-only, classified under `docs_only` entries in `vocabulary/task-exceptions.yml`), and researcher tasks. Researcher tasks never receive an auto-paired CHECK — research outputs feed Lead or HOW agents directly, not tester or reviewer.
234
- - Paired verification tasks are linked via `deps` to the original task.
235
-
236
- **Exception catalog**: task decomposition exceptions are defined in `vocabulary/task-exceptions.yml` (`docs_only.coherent`, `docs_only.independent`, `same_file_bundle`, `generated_artifacts`). When an exception applies to a task, record its id in the task's `context` field so downstream tooling can trace the classification.
237
-
238
- **Dedup Layer 1 (plan-time static merge)**: before finalizing the task list, scan draft tasks for overlapping target_files. Overlapping tasks are merged into a single owner task via the `same_file_bundle` exception from `vocabulary/task-exceptions.yml` to prevent parallel write conflicts during execution.
239
-
240
- **DO/CHECK decomposition principle**: DO agents (engineer, writer, researcher) and CHECK agents (tester, reviewer) accumulate less per-task context than HOW agents. When a task involves multiple independent artifacts, decompose across multiple parallel DO/CHECK subagents rather than bundling. HOW agents benefit from consolidated context and should generally remain as single sessions. Parallel decomposition is worthwhile when there are at least three independent artifacts; below that, bundling under one owner is preferable to avoid parallelization overhead.
241
-
242
- **HOW decomposition rule**: split HOW analysis across multiple subagents only when the issue crosses different rows of the domain-agent mapping table (architect vs designer vs strategist vs postdoc). Sub-concerns within a single domain row belong in one HOW session.
243
-
244
- 4. **Populate tasks.json** via `nx_task_add`:
245
- - Set `goal` from the plan topic
246
- - Set `decisions` from plan.json decided summaries
247
- - Call `nx_task_add(plan_issue=N, approach, acceptance, risk, owner)` for each task
248
- - If any decisions involve design or architecture changes, include a task (owner: `writer` or `lead`) to update the relevant files in `.nexus/context/` to reflect those decisions
249
- 5. **Present plan document** — show the user the generated tasks.json summary for review
250
- 6. **Present transition**: "Proceed with `[run]` to execute."
251
-
252
- **Incremental mode**: if tasks.json already exists (e.g., after adding follow-up issues), only add tasks for new decisions. Check `plan_issue` field to avoid duplicating tasks for already-covered issues.
253
-
254
- ---
255
-
256
- ## plan → run Transition
257
-
258
- tasks.json is already generated in Step 7. Plan's role ends here.
259
- Proceed with `[run]` to execute.
260
-
261
- ---
262
-
263
- ## Principles
264
-
265
- 1. **Active intent discovery** — actively uncover what the user hasn't clarified. Use interviewing to surface the root goal behind the words.
266
- 2. **Lead as synthesizer AND participant** — Lead does not merely relay subagent findings. Lead forms its own position, makes recommendations, and pushes back with evidence. Not a yes-man.
267
- 3. **Exploration first + proactive expansion** — research code/knowledge/external sources before planning starts. Never ask groundless questions.
268
- 4. **Hypothesis-based questions** — instead of empty questions, form hypotheses grounded in research and confirm with the user.
269
- 5. **Progressive Depth** — automatically adjust planning depth and HOW subagent composition based on request complexity.
270
- 6. **One at a time** — never present multiple issues at once. Reduce the user's cognitive load.
271
- 7. **Options must include pros/cons/trade-offs/recommendation** — when recommending, explain why other options fall short.
272
- 8. **Objective pushback** — even when the user arrives with strong conviction, Lead MUST independently analyze all viable options and present trade-offs the user may not have considered. The comparison table exists to surface what the user doesn't know, not to confirm what they already believe. Counter with evidence when better alternatives exist.
273
- 9. **Prose conversation by default** — free-form user responses (combinations, pushback, follow-up questions) are the core of planning quality.
274
- 10. **Dynamic agenda** — decisions create new questions. Lead proactively surfaces derived issues rather than waiting for the user to notice gaps.
275
-
276
- ---
277
-
278
- ## State Management
279
-
280
- ### plan.json
281
-
282
- `.nexus/state/plan.json` — managed via MCP tools.
283
-
284
- ```json
285
- {
286
- "id": 1,
287
- "topic": "topic name",
288
- "issues": [
289
- {
290
- "id": 1,
291
- "title": "issue title",
292
- "status": "pending"
293
- },
294
- {
295
- "id": 2,
296
- "title": "issue title",
297
- "status": "decided",
298
- "decision": "decision summary",
299
- "how_agents": ["architect", "designer"],
300
- "how_summary": {
301
- "architect": "key findings...",
302
- "designer": "key findings..."
303
- }
304
- }
305
- ],
306
- "research_summary": "...",
307
- "created_at": "2026-01-01T00:00:00Z"
308
- }
309
- ```
310
-
311
- - **Create**: `nx_plan_start(topic, issues, research_summary)` — called in Step 3; auto-archives any existing plan.json
312
- - **Status**: `nx_plan_status()` — check current issue state + decisions
313
- - **Update**: `nx_plan_update(action, ...)` — add/remove/modify/reopen issues
314
- - **Decide**: `nx_plan_decide(issue_id, summary)` — marks issue as `decided`, writes decision inline
315
- - **File presence = session in progress**
316
-
317
- ### Topic Switching
318
-
319
- - `[plan]` → continue existing plan.json if present; start new session if not
320
- - Continue conversation without tag → continue existing session
321
- - New `nx_plan_start` call → auto-archives current plan.json before creating new one
322
-
323
- ### Session Abort
324
-
325
- To abort a session, archive current state via `nx_task_close`. Incomplete issues/tasks are recorded in history.json for future reference.
326
-
327
- ---
328
-
329
- ## Self-Reinforcing Loop
330
-
331
- ```
332
- [plan] start → check/continue existing plan.json (start new if none)
333
-
334
- Intent discovery → research (parallel subagents) → nx_plan_start (register issues)
335
-
336
- Per-issue: HOW subagent analysis (parallel, independent) → Lead synthesis
337
- → options comparison → [d] → nx_plan_decide
338
- → dynamic agenda check → propose derived issues if found
339
-
340
- Next issue → ... → gap check → planning complete
341
-
342
- Proceed with `[run]` to execute.
343
-
344
- [run]: execution skill handles the full pipeline
345
-
346
- All done → nx_task_close (handled by run skill)
347
- ```
348
-
349
- gate.ts detects `[d]` and routes to `nx_plan_decide` if plan.json exists; blocks otherwise.
350
-
351
- ## Deactivation
352
-
353
- When transitioning to `[run]`, Plan's role ends. Execution is handled by the run skill.
@@ -1,154 +0,0 @@
1
- ---
2
- description: "Execution — user-directed agent composition."
3
- triggers:
4
- - run
5
- ---
6
- ## Role
7
-
8
- Execution norm that Lead follows when the user invokes the [run] tag. Composes subagents dynamically based on user direction and drives the full execution pipeline from intake to completion.
9
-
10
- ## Constraints
11
-
12
- - NEVER modify files via shell commands (sed, echo redirection, heredoc, tee, etc.) — always use the harness's dedicated file-editing primitives (gate enforced)
13
- - NEVER terminate while pending tasks remain (Gate Stop nonstop)
14
- - NEVER spawn a new branch without checking for main/master first
15
- - MUST check tasks.json before executing — if absent, generate the plan first
16
- - MUST spawn subagents per-task based on owner field — Do not handle multi-task work as Lead solo when task count ≥ 2 or target files ≥ 2
17
- - MUST NOT spawn parallel Engineers if their target files overlap — serialize instead
18
- - MUST call nx_task_close before completing the cycle — archive plan+tasks to history.json
19
-
20
- ## Guidelines
21
-
22
- ## Flow
23
-
24
- ### Step 1: Intake (Lead)
25
-
26
- - **User specifies agents/direction** → follow the instruction as given.
27
- - **[run] only (no direction)** → confirm direction with user before proceeding.
28
- - User decides scope and composition. Lead fills in what is not specified.
29
- - **Branch Guard**: if on main/master, create a branch appropriate to the task type before proceeding (prefix: `feat/`, `fix/`, `chore/`, `research/`, etc. — Lead's judgment). Auto-create without user confirmation.
30
- - Check for `tasks.json`:
31
- - **Exists** → read it and proceed to Step 2.
32
- - **Absent** → auto-invoke `$nx-plan` to generate tasks.json. Do NOT ask — `[run]` implies execution intent. After plan generation, proceed to Step 2.
33
- - If tasks.json exists, check prior decisions with `nx_plan_status`.
34
-
35
- ### Step 1.5: TUI Progress
36
-
37
- Register tasks for visual progress tracking (Ctrl+T):
38
-
39
- - **≤ 10 tasks**: `update_plan([{ name: "<per-task label>", state: "pending" }])` per task
40
- - **> 10 tasks**: group by `plan_issue`, `update_plan([{ name: "<group label>", state: "pending" }])` per group
41
- - Update the registered entry via `update_plan([{ name: "<label>", state: "in_progress" }])` / `update_plan([{ name: "<label>", state: "completed" }])` as execution proceeds
42
- - **Skip only if**: non-TTY environment (VSCode, headless)
43
- - **Known issue**: TUI may freeze during auto-compact (#27919) — task data on disk remains correct
44
-
45
- ### Step 2: Execute
46
-
47
- - **Present tasks.json** to the user — show task list with owner, deps, approach summary. Proceed immediately without asking for confirmation.
48
- - Execute tasks based on `owner` field:
49
- - `owner: "lead"` → Lead handles directly
50
- - `owner: "engineer"`, `"researcher"`, `"writer"`, etc. → spawn subagent matching the owner role
51
- - `owner: "architect"`, `"tester"`, `"reviewer"`, etc. → spawn corresponding HOW/CHECK subagent
52
- - For each subagent, pass the task's `context`, `approach`, and `acceptance` as the prompt.
53
- - **Parallel execution**: independent tasks (no overlapping target files, no deps) can be spawned in parallel. Tasks sharing target files must be serialized.
54
- - **SubagentStop escalation chain**: when a subagent stops with incomplete work:
55
- 1. **Do/Check failed** → spawn the relevant HOW agent (e.g., Engineer failed → Architect) to diagnose the failure, review the approach, and suggest adjustments.
56
- 2. **Re-delegate** → apply HOW's adjusted approach and re-delegate to a new Do/Check agent.
57
- 3. **HOW also failed** → Lead reports the failure to the user with diagnosis details and asks for direction.
58
- - Maximum: 1 HOW diagnosis + 1 re-delegation per task. After that, escalate to user.
59
- - Relevant HOW mapping: Engineer→Architect, Writer→Strategist, Researcher→Postdoc, Tester→Architect.
60
-
61
- ### Resume Dispatch Rule
62
-
63
- For each task, Lead chooses between fresh spawn and resume based on the `owner`'s `resume_tier`:
64
-
65
- 1. Lookup `resume_tier` from `agents/{owner}.md` frontmatter (if absent → treat as `ephemeral`).
66
- 2. If `ephemeral` → fresh spawn. Stop.
67
- 3. If `bounded` → check tasks.json history: did the same `owner` previously work on overlapping target files? If yes AND no intervening edits by other agents → resume candidate. Otherwise fresh. Always include "re-read target files before any modification" instruction in the resume prompt.
68
- 4. If `persistent` → resume by default if the same agent worked earlier in this run. Cross-task reuse allowed.
69
- 5. Before attempting any resume, verify the harness's resume mechanism is available. If unavailable, fall back to fresh spawn silently — do NOT throw an error.
70
-
71
- ### Step 3: Verify (Lead + Check subagents)
72
-
73
- **Lead**: confirm build + E2E pass/fail.
74
-
75
- **Tester — acceptance criteria verification**:
76
- - Tester reads each completed task's `acceptance` field from tasks.json
77
- - Verifies each criterion with PASS/FAIL judgment
78
- - All criteria must pass for the task to be considered done
79
- - If any criterion fails → Step 2 rework (reopen task)
80
- - Tester spawn conditions (any one triggers):
81
- - tasks.json contains at least 1 task with an `acceptance` field
82
- - 3 or more files changed
83
- - Existing test files modified
84
- - External API/DB access code changed
85
- - Failure history for this area exists in memory
86
-
87
- **Reviewer — writer deliverable verification**:
88
- - Whenever Writer produced a deliverable in Step 2, Reviewer MUST verify it
89
- - Writer → Reviewer is a mandatory pairing, not optional
90
- - Reviewer checks: factual accuracy, source consistency, grammar/format
91
-
92
- - If issues found: code problems → Step 2 rework; design problems → re-run nx-plan before re-executing.
93
-
94
- ### Step 4: Complete
95
-
96
- Execute in order:
97
-
98
- 1. **nx-sync**: invoke `$nx-sync` if code changes were made in this cycle. Best effort — failure does not block cycle completion.
99
- 2. **nx_task_close**: call to archive plan+tasks to history.json. This updates `.nexus/history.json`.
100
- 3. **git commit**: stage and commit source changes, build artifacts (`bridge/`, `scripts/`), `.nexus/history.json`, and any modified `.nexus/memory/` or `.nexus/context/`. Use explicit `git add` with paths (not `git add -A`) and a HEREDOC commit message with `Co-Authored-By`. This ensures the cycle's history archive lands in the same commit as the code changes, giving a 1:1 cycle-commit mapping.
101
- 4. **Report**: summarize to user — changed files, key decisions applied, and suggested next steps. Merge/push is the user's decision and outside this skill's scope.
102
-
103
- ---
104
-
105
- ## Reference Framework
106
-
107
- | Phase | Owner | Content |
108
- |-------|-------|---------|
109
- | 1. Intake | Lead | Clarify intent, confirm direction, Branch Guard, check tasks.json / invoke nx-plan if absent |
110
- | 2. Execute | Do subagents | Spawn per-task by owner, delegation criteria, parallel where safe |
111
- | 3. Verify | Lead + Check subagent | Build check, quality verification |
112
- | 4. Complete | Lead | nx-sync, nx_task_close, git commit, report |
113
-
114
- ---
115
-
116
- ## Structured Delegation
117
-
118
- When Lead delegates tasks to subagents, structure the prompt in this format:
119
-
120
- ```
121
- TASK: {specific deliverable}
122
-
123
- CONTEXT:
124
- - Current state: {relevant code/doc locations}
125
- - Dependencies: {results from prior tasks}
126
- - Prior decisions: {relevant decisions}
127
- - Target files: {file path list}
128
-
129
- CONSTRAINTS:
130
- - {constraint 1}
131
- - {constraint 2}
132
-
133
- ACCEPTANCE:
134
- - {completion criterion 1}
135
- - {completion criterion 2}
136
- ```
137
-
138
- ---
139
-
140
- ## Key Principles
141
-
142
- 1. **Lead = interpret user direction + coordinate + own tasks**
143
- 2. **User decides scope and composition**
144
- 3. **tasks.json is the single source of state** — produced by nx-plan, read at Step 1, updated as tasks complete
145
- 4. **Do subagents = execute per owner** — Lead spawns one subagent per task based on the `owner` field. Engineers focus on code changes. Doc updates are done in bulk by Writer in Step 4. Researcher records to reference/ immediately.
146
- 5. **Check subagents = verify** — Lead's discretion + 4 conditions
147
- 6. **SubagentStop escalation** — when a subagent stops with incomplete work, escalate through HOW diagnosis → re-delegation → user report. Max 1 cycle per task.
148
- 7. **Gate Stop nonstop** — cannot terminate while pending tasks exist
149
- 8. **Plan first** — if tasks.json is absent, nx-plan must run before Step 2
150
- 9. **No file modification via shell commands** — sed, echo redirection, heredoc, tee, and similar shell-based file edits are prohibited. Always use the harness's dedicated file-editing primitives (gate enforced)
151
- ## State Management
152
-
153
- `.nexus/state/tasks.json` — produced by nx-plan, managed via `nx_task_add`/`nx_task_update`. Gate Stop enforcement.
154
- On cycle end, archive plan+tasks to `.nexus/history.json` via `nx_task_close`.
@@ -1,87 +0,0 @@
1
- ---
2
- description: "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents"
3
- triggers:
4
- - sync
5
- ---
6
- ## Role
7
-
8
- Scans the current project state and synchronizes .nexus/context/ design documents. Uses git diff to identify code changes, then updates abstract design documents (principles, philosophy, development stack, architectural decisions) that cannot be inferred from code alone.
9
-
10
- ## Constraints
11
-
12
- - NEVER delete existing context files — only update or add
13
- - NEVER modify source code — this skill updates documentation only
14
- - NEVER guess information that cannot be confirmed from sources — mark as "needs verification" instead
15
- - MUST preserve existing content structure — update sections, don't rewrite entire files unnecessarily
16
- - NEVER use deprecated MCP knowledge tools — use the harness's file-reading and file-creation primitives only
17
-
18
- ## Guidelines
19
-
20
- ## Trigger
21
-
22
- - `[sync]` — synchronize .nexus/context/ with current project state
23
-
24
- ## Process
25
-
26
- ### Step 1: Gather Sources
27
-
28
- Collect information from all available sources:
29
-
30
- 1. **git diff** — run `git diff --name-only HEAD~10..HEAD` (or use recent commits to identify changed files)
31
- - Identifies which source files changed
32
- - Primary signal for determining which context documents may be stale
33
- 2. **Conversation context** — if available in current session
34
- - Design decisions discussed but not yet reflected in context documents
35
- - Supplementary source for all updates
36
-
37
- ### Step 2: Read Current Context
38
-
39
- Read all files in `.nexus/context/` using the harness's file-reading primitive:
40
-
41
- - List files: `ls .nexus/context/`
42
- - Read each file to understand current documented state
43
- - Compare against detected changes to identify gaps or stale content
44
-
45
- Only update files where a concrete change is detected. If no staleness is found, report "already current" and skip.
46
-
47
- ### Step 3: Execute Updates
48
-
49
- Spawn Writer agent to update affected context documents:
50
-
51
- ```
52
- spawn_agent("writer", ">>WRITER_SYNC_PROMPT")
53
- Update .nexus/context/ documents based on the following changes. Read current files with the harness's file-reading primitive, then write updates with the harness's file-creation primitive. Changes: {change_manifest}
54
- <<WRITER_SYNC_PROMPT
55
- ```
56
-
57
- The Writer agent:
58
- - Reads each relevant context file with the harness's file-reading primitive
59
- - Applies targeted updates — changes only the sections that are stale
60
- - Writes the updated file back with the harness's file-creation primitive
61
- - Does not rewrite files that are already accurate
62
-
63
- ### Step 4: Report
64
-
65
- Report to user:
66
- - Which context files were scanned
67
- - Which files were updated and what changed
68
- - Which files were already up to date
69
- - Any items marked "needs verification"
70
-
71
- ## Key Principles
72
-
73
- 1. **Targeted updates over full rewrites** — only change sections that are actually stale
74
- 2. **Evidence-based** — every update must trace to a source (git diff or conversation)
75
- 3. **Preserve structure** — maintain existing document organization, headings, and format
76
- 4. **No speculation** — if a change's impact on context docs is unclear, flag it rather than guess
77
-
78
- ## What .nexus/context/ Contains
79
-
80
- Context documents capture abstract knowledge that cannot be read directly from source code:
81
-
82
- - Design principles and philosophy
83
- - Architectural decisions and their rationale
84
- - Development stack choices and constraints
85
- - Project conventions and standards
86
-
87
- These documents are updated when code changes reflect a shift in principles, a new architectural decision is made, or the development stack evolves. They are not updated for routine code additions that do not change the underlying design.