@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
@@ -0,0 +1,150 @@
1
+ ---
2
+ id: nx-auto-plan
3
+ name: nx-auto-plan
4
+ description: Autonomous planning skill — Lead decomposes, analyzes, and decides issues without user confirmation, producing an execution plan. Keeps nx-plan's research and analysis depth while skipping user dialogue.
5
+ triggers:
6
+ - "[auto-plan]"
7
+ ---
8
+
9
+ ## Role
10
+
11
+ Performs the same research and analysis process as nx-plan, but Lead makes decisions autonomously without presenting options or waiting for user responses. HOW subagent usage, researcher/explore investigations, prior-knowledge lookup, and issue decomposition are identical to nx-plan. The only difference is at decision time — instead of emitting a comparison table and awaiting user response, Lead deliberates internally and records the decision immediately.
12
+
13
+ This skill does not execute. Execution is handled separately by the `[run]` flow. It is also the path `[run]` invokes internally when tasks.json is absent.
14
+
15
+ ## Constraints
16
+
17
+ - **NEVER request user confirmation.** All decisions MUST be made by Lead autonomously and recorded directly.
18
+ - **MUST maintain the same research and analysis depth as nx-plan.** HOW subagent spawning, researcher/explore investigations, and the existing-knowledge-first principle all apply.
19
+ - **MUST record both the selected approach with rationale AND rejected alternatives with dismissal reasons in every decision.** Comparison tables are not output, but internal deliberation is mandatory.
20
+ - **MUST brief all decisions at once after completion.** NEVER notify the user per-decision.
21
+
22
+ ## Procedure
23
+
24
+ ### Step 1: Intent Discovery
25
+
26
+ Determine issue scope and complexity from the request itself. Do not conduct additional user interviews.
27
+
28
+ | Level | Signal | Exploration Scope |
29
+ |---|---|---|
30
+ | Specific | File path, function name, error message, or concrete target named | Focus on the relevant file or module |
31
+ | Direction-setting | Open-ended question, "it would be nice if ~", choice needed among approaches | Related area + external case research |
32
+ | Abstract | Goal itself unclear, fundamental direction needed | Full codebase + external research + comparable project comparison |
33
+
34
+ - Specific request → derive issues immediately.
35
+ - Direction-setting → Lead selects the most reasonable direction based on research findings.
36
+ - Abstract → broaden research scope and have Lead infer the root goal.
37
+
38
+ #### HOW Subagent Selection
39
+
40
+ - Lead autonomously selects HOW subagents matching the issue scope.
41
+ - If the user explicitly named HOW agents, use them as-is and add missing axes when visible.
42
+ - Additional HOW subagents can be spawned at any point during analysis.
43
+
44
+ ### Step 2: Research
45
+
46
+ Understand code, core knowledge, and prior decisions before forming the planning agenda.
47
+
48
+ #### Existing Knowledge First
49
+
50
+ - Read `.nexus/memory/` and `.nexus/context/` first.
51
+ - Use `nx_history_search` to check whether prior decisions exist on similar topics.
52
+ - If the needed information is already available, use it directly and skip or narrow subagent spawning.
53
+
54
+ #### Approach Selection
55
+
56
+ | Situation | Approach |
57
+ |---|---|
58
+ | Codebase orientation needed | `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` for codebase exploration |
59
+ | External research needed | `{{subagent_spawn target_role=researcher prompt="<research question>"}}` for web search |
60
+ | Both needed | Spawn `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` and `{{subagent_spawn target_role=researcher prompt="<research question>"}}` in parallel |
61
+
62
+ - Researcher subagents return findings to Lead and do not participate in the auto-plan session itself.
63
+
64
+ ### Step 3: Session Start
65
+
66
+ Once research is complete, open the planning session with `nx_plan_start`. Any existing `plan.json` is automatically archived. Unlike nx-plan, the issue list is NOT presented to the user beforehand — proceed directly to Step 4.
67
+
68
+ ### Step 4: Issue-by-Issue Analysis
69
+
70
+ Issues must be processed one at a time. For each issue:
71
+
72
+ 1. Lead summarizes the current state and the problem.
73
+ 2. If needed, spawn HOW subagents for independent analysis.
74
+ - If reusing context from a prior HOW session for the same role is advantageous, check resume routing information with `nx_plan_resume` first.
75
+ - If resumable, continue with the existing session; otherwise, spawn fresh.
76
+ 3. When HOW results return, record them on the issue with `nx_plan_analysis_add(issue_id, role, agent_id=<id from spawn>, summary)`. The `agent_id` is the value `nx_plan_resume` will return on a future resume request for the same role, so always pass it.
77
+ 4. **Lead internal deliberation**: enumerate candidate options, compare pros/cons and trade-offs, and select the most reasonable one. Do not output comparison tables or option presentations.
78
+ 5. Proceed immediately to Step 5 to record the decision.
79
+
80
+ #### HOW Domain Mapping
81
+
82
+ | Domain Keywords | Recommended HOW |
83
+ |---|---|
84
+ | UI, UX, design, interface, user experience, layout | Designer |
85
+ | Architecture, system design, performance, structural change, API, schema | Architect |
86
+ | Business, market, strategy, positioning, competition, revenue | Strategist |
87
+ | Research methodology, evidence evaluation, literature, experiment design | Postdoc |
88
+
89
+ - If an issue matches a domain above, spawning the corresponding HOW is the default.
90
+ - If the issue crosses multiple domains, spawn multiple HOWs together.
91
+ - To skip spawning, state the reason explicitly in the analysis text.
92
+
93
+ ### Step 5: Record Decision
94
+
95
+ Use `nx_plan_decide` to mark the issue as decided. The decision text MUST include:
96
+
97
+ - The selected approach and its rationale
98
+ - The rejected alternatives and their dismissal reasons
99
+
100
+ If HOW subagents participated in the issue, bundle their contribution information so it can be referenced in future resumes and Step 7 task decomposition.
101
+
102
+ If the decision creates follow-up questions or derived issues, add them with `nx_plan_update` and move to Step 6. Do not ask the user for confirmation.
103
+
104
+ ### Step 6: Dynamic Agenda Management
105
+
106
+ - If derived issues emerge, add them via `nx_plan_update` and return to Step 4.
107
+ - If unresolved issues remain, move on to the next issue.
108
+ - Once all issues are decided, Lead checks for gaps against the original request.
109
+ - If gaps exist, register new issues with `nx_plan_update` and return to Step 4.
110
+
111
+ ### Step 7: Briefing and Plan Document Generation
112
+
113
+ Once all issues are decided, brief the user in a single pass:
114
+
115
+ ```
116
+ [auto-plan complete] N issues, N decisions
117
+ - #1: {selected} ({rejected alternative} — reason)
118
+ - #2: ...
119
+ ```
120
+
121
+ Immediately after briefing, decompose the decisions from `plan.json` into actionable tasks and populate `tasks.json` via `nx_task_add`. From this point, task tools — not plan tools — take over.
122
+
123
+ Fill in the following fields for each task:
124
+
125
+ - `approach` — implementation strategy derived from the decision rationale
126
+ - `acceptance` — definition of done, verifiable criteria
127
+ - `risk` — risks surfaced during analysis
128
+ - `deps` — execution-order dependencies
129
+ - `owner` — assigned according to the criteria below
130
+
131
+ For issues where HOW subagents participated, reference the analysis recorded in Step 4, or re-spawn the same HOW to request domain-appropriate decomposition.
132
+
133
+ #### Owner Assignment Criteria
134
+
135
+ | Work Type | owner | Criteria |
136
+ |---|---|---|
137
+ | Single file, small change | `lead` | Subagent overhead exceeds task effort |
138
+ | Code implementation | `engineer` | Source code creation or modification |
139
+ | Documentation/content | `writer` | `.md`, README, docs, non-code content |
140
+ | External research | `researcher` | External information gathering required |
141
+ | Design analysis / review | HOW role | Technical judgment is the core work |
142
+ | Sequential edits to the same file | `lead` | High risk of parallel edit conflicts |
143
+
144
+ #### Verification Auto-Pairing
145
+
146
+ - If an `engineer` task has a runtime-behavior criterion in its acceptance, pair a `tester` task.
147
+ - If a `writer` task has a verifiable deliverable criterion in its acceptance, pair a `reviewer` task.
148
+ - Researcher tasks are not auto-paired by default.
149
+
150
+ Once tasks are generated, instruct the user to execute with `[run]`. If this skill was invoked internally by `[run]`, hand off to the run flow directly without the instruction.
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: nx-plan
3
+ name: nx-plan
4
+ description: 실행 전에 안건을 분해하고 결정을 정렬하며 보강된 실행 계획을 만드는 구조적 다각도 분석. 계획 전용이며 실행하지 않는다.
5
+ triggers:
6
+ - "[plan]"
7
+ ---
8
+
9
+ ## 역할
10
+
11
+ 실행에 들어가기 전에 안건을 분해하고, 선택지를 비교하고, 결정을 정리해 계획을 만드는 스킬이다. Lead는 서브에이전트의 조사와 분석을 조율하면서도 스스로 입장을 형성하고 권고안을 제시한다.
12
+
13
+ 이 스킬은 실행하지 않는다. 실행은 별도의 `[run]` 흐름이 담당한다.
14
+
15
+ ## 핵심 규칙
16
+
17
+ - 실행하지 않는다. 이 스킬의 목적은 계획 수립과 결정 정렬이다.
18
+ - 한 번에 하나의 안건만 다룬다. 여러 안건을 동시에 제시하지 않는다.
19
+ - 근거 없이 묻지 않는다. 코드, 기존 지식, 과거 결정을 먼저 조사한다.
20
+ - 결정을 요청할 때는 반드시 비교 표를 제시한다. 선택지를 산문만으로 설명하지 않는다.
21
+ - Lead는 종합자이자 참여자다. 서브에이전트 결과를 단순 중계하지 않고, 스스로 권고안을 만들고 필요하면 반박한다.
22
+
23
+ ## 절차
24
+
25
+ ### 1단계: 의도 파악
26
+
27
+ 요청의 복잡도를 판단하고, 계획을 어느 깊이까지 진행할지 정한다.
28
+
29
+ | 수준 | 신호 | 탐색 범위 |
30
+ |---|---|---|
31
+ | 구체적 | 파일 경로, 함수명, 에러 메시지, 구체 대상이 명시됨 | 해당 파일이나 모듈에 집중 |
32
+ | 방향 설정형 | 열린 질문, "~하면 좋겠다", 접근 방식 사이의 선택 필요 | 관련 영역 + 외부 사례 조사 |
33
+ | 추상적 | "어떻게 접근해야 할지 모르겠다", 목표 자체가 불명확, 근본 방향 설정 필요 | 전체 코드베이스 + 외부 조사 + 유사 프로젝트 비교 |
34
+
35
+ - 구체적 요청이면 즉시 안건을 도출한다.
36
+ - 방향 설정형 요청이면 가설 기반 질문으로 의도를 파악한다.
37
+ - 추상적 요청이면 인터뷰를 통해 사용자가 아직 명확히 말하지 않은 근본 목표를 드러낸다.
38
+
39
+ #### HOW 서브에이전트 선택
40
+
41
+ - 사용자가 HOW 에이전트를 명시하면 그대로 사용하되, 빠진 축이 보이면 추가를 제안한다.
42
+ - 사용자가 지정하지 않으면 Lead가 안건 범위를 기준으로 제안한다.
43
+ - 추가 HOW 서브에이전트는 분석 도중 언제든지 띄울 수 있다.
44
+
45
+ ### 2단계: 조사
46
+
47
+ 계획 안건을 세우기 전에 코드, 핵심 지식, 기존 결정을 파악한다.
48
+
49
+ #### 기존 지식 우선
50
+
51
+ - `.nexus/memory/`와 `.nexus/context/`를 먼저 읽는다.
52
+ - `nx_history_search`로 유사 주제의 과거 결정이 있는지 확인한다.
53
+ - 필요한 정보가 이미 있으면 그대로 활용하고, 서브에이전트 스폰은 생략하거나 범위를 줄인다.
54
+
55
+ #### 접근법 선택
56
+
57
+ | 상황 | 접근법 |
58
+ |---|---|
59
+ | 코드베이스 파악이 필요 | `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` 코드베이스 탐색 |
60
+ | 외부 조사가 필요 | `{{subagent_spawn target_role=researcher prompt="<research question>"}}` 웹 검색 |
61
+ | 둘 다 필요 | `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` 와 `{{subagent_spawn target_role=researcher prompt="<research question>"}}` 를 병렬로 스폰 |
62
+
63
+ - researcher 서브에이전트는 결과를 Lead에게 반환하며, plan 세션 자체에 참여하지 않는다.
64
+
65
+ ### 3단계: 세션 시작
66
+
67
+ 조사가 끝나면 `nx_plan_start`로 계획 세션을 연다. 기존 `plan.json`이 있으면 자동으로 아카이브된다. 안건 목록을 사용자에게 보여주고 진행 방향을 맞춘다.
68
+
69
+ ### 4단계: 안건별 분석
70
+
71
+ 안건은 반드시 하나씩 처리한다. 각 안건마다 다음을 수행한다.
72
+
73
+ 1. Lead가 현재 상태와 문제를 요약한다.
74
+ 2. 필요하면 HOW 서브에이전트를 스폰해 독립 분석을 받는다.
75
+ - 같은 HOW 역할의 맥락을 이어 쓰는 편이 유리하면 `nx_plan_resume`으로 재개 라우팅 정보를 먼저 확인한다.
76
+ - 재개할 수 있으면 이어서 사용하고, 없으면 새로 스폰한다.
77
+ 3. HOW 결과가 돌아오면 `nx_plan_analysis_add(issue_id, role, agent_id=<스폰에서 얻은 id>, summary)`로 해당 안건에 기록한다. `agent_id`는 `nx_plan_resume`가 같은 role 재개 요청 시 되돌려주는 값이므로, 스폰 툴 응답(또는 Lead가 지정한 name)에서 얻은 id를 반드시 넘긴다. 이 기록은 이후 재개 경로와 7단계 태스크 분해의 입력이 된다.
78
+ 4. 종합 후 비교 표와 권고안을 제시한다.
79
+ 5. 사용자 응답을 받아 결정을 정리한다.
80
+
81
+ #### HOW 도메인 매핑
82
+
83
+ | 도메인 키워드 | 권장 HOW |
84
+ |---|---|
85
+ | UI, UX, 디자인, 인터페이스, 사용자 경험, 레이아웃 | Designer |
86
+ | 아키텍처, 시스템 설계, 성능, 구조 변경, API, 스키마 | Architect |
87
+ | 비즈니스, 시장, 전략, 포지셔닝, 경쟁, 수익 | Strategist |
88
+ | 연구 방법론, 근거 평가, 문헌, 실험 설계 | Postdoc |
89
+
90
+ - 안건이 위 도메인과 맞으면 기본적으로 해당 HOW를 스폰한다.
91
+ - 여러 도메인에 걸치면 여러 HOW를 함께 스폰할 수 있다.
92
+ - 스폰하지 않으려면 그 이유를 분석 텍스트 안에 명시한다.
93
+
94
+ #### 비교 표 형식
95
+
96
+ <example>
97
+
98
+ | 항목 | A: {title} | B: {title} | C: {title} |
99
+ |---|---|---|---|
100
+ | 장점 | ... | ... | ... |
101
+ | 단점 | ... | ... | ... |
102
+ | 트레이드오프 | ... | ... | ... |
103
+ | 적합한 경우 | ... | ... | ... |
104
+
105
+ **권장안: {X} ({title})**
106
+
107
+ - 선택지 A는 {reason} 때문에 부족하다
108
+ - 선택지 B는 {reason} 때문에 부족하다
109
+ - 선택지 X는 {limitations}를 극복하며 {core benefit}을 제공한다
110
+
111
+ </example>
112
+
113
+ ### 5단계: 결정 기록
114
+
115
+ 결정이 내려지면 `nx_plan_decide`로 해당 안건을 결정 상태로 전환한다. HOW 서브에이전트가 참여한 안건이면 그 기여 정보도 함께 묶어, 이후 재개와 태스크 분해에서 참조되도록 한다.
116
+
117
+ - 결정 직후 `nx_plan_status`로 전체 진행을 확인하고 다음 안건을 한 줄로 안내한다.
118
+ - 새로운 후속 질문이 생겼는지 점검하고, 필요하면 `nx_plan_update`로 후속 안건을 추가한다.
119
+ - 결정을 번복해야 하면 `nx_plan_update`로 해당 안건을 다시 연 뒤 4단계로 돌아간다.
120
+
121
+ ### 6단계: 동적 안건 관리
122
+
123
+ - 결정이 새로운 질문을 만들면 `nx_plan_update`로 후속 안건을 추가한다.
124
+ - 미결 안건이 남아 있으면 다음 안건으로 넘어간다.
125
+ - 모든 안건이 결정되면 원래 질문을 충분히 커버했는지 누락을 점검한다.
126
+ - 누락이 있으면 `nx_plan_update`로 새 안건을 등록하고 4단계로 돌아간다.
127
+
128
+ ### 7단계: 계획 문서 생성
129
+
130
+ 모든 안건이 결정되면 `plan.json`의 결정을 실행 가능한 태스크로 분해해 `nx_task_add`로 `tasks.json`을 구성한다. 여기서부터는 plan 도구가 아닌 task 도구의 영역이다.
131
+
132
+ 각 태스크에는 다음을 채운다.
133
+
134
+ - `approach` — 결정 근거에서 도출한 구현 전략
135
+ - `acceptance` — 완료 정의, 검증 가능한 기준
136
+ - `risk` — 분석에서 드러난 위험
137
+ - `deps` — 실행 순서 의존성
138
+ - `owner` — 아래 기준으로 배정
139
+
140
+ HOW 서브에이전트가 참여한 안건은 4단계에서 기록한 분석 결과를 참고하거나, 같은 HOW를 재스폰해 도메인에 맞는 분해를 제안받는다.
141
+
142
+ #### owner 배정 기준
143
+
144
+ | 작업 유형 | owner | 기준 |
145
+ |---|---|---|
146
+ | 단일 파일, 소규모 변경 | `lead` | 서브에이전트 오버헤드가 더 큰 경우 |
147
+ | 코드 구현 | `engineer` | 소스 코드 생성 또는 수정 |
148
+ | 문서/콘텐츠 | `writer` | `.md`, README, docs, 비코드 콘텐츠 |
149
+ | 외부 조사 | `researcher` | 외부 정보 수집이 필요한 경우 |
150
+ | 설계 분석 / 리뷰 | HOW 역할 | 기술적 판단이 중심인 경우 |
151
+ | 동일 파일의 순차 편집 | `lead` | 병렬 편집 충돌 위험이 큰 경우 |
152
+
153
+ #### 검증 자동 페어링
154
+
155
+ - `engineer` 태스크에 런타임 동작 기준이 있으면 `tester` 태스크를 붙인다.
156
+ - `writer` 태스크에 검증 가능한 산출물 기준이 있으면 `reviewer` 태스크를 붙인다.
157
+ - researcher 태스크는 기본적으로 자동 페어링하지 않는다.
158
+
159
+ 태스크 생성이 끝나면 요약을 사용자에게 보여주고 `[run]`으로 실행하라고 안내한다.
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: nx-plan
3
+ name: nx-plan
4
+ description: Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched execution plan before acting. Planning only — does not execute.
5
+ triggers:
6
+ - "[plan]"
7
+ ---
8
+
9
+ ## Role
10
+
11
+ A skill for decomposing issues, comparing options, and producing a plan before execution begins. Lead orchestrates subagent research and analysis while forming its own position and presenting recommendations.
12
+
13
+ This skill does not execute. Execution is handled separately by the `[run]` flow.
14
+
15
+ ## Constraints
16
+
17
+ - NEVER execute — this skill's purpose is planning and decision alignment, not execution.
18
+ - MUST handle one issue at a time. NEVER present multiple issues simultaneously.
19
+ - NEVER ask groundless questions. MUST investigate code, existing knowledge, and prior decisions first.
20
+ - MUST present a comparison table before requesting a decision. NEVER describe options in prose alone.
21
+ - Lead is both synthesizer and participant — MUST form an independent recommendation and push back when warranted, not merely relay subagent results.
22
+
23
+ ## Procedure
24
+
25
+ ### Step 1: Intent Discovery
26
+
27
+ Assess the complexity of the request and determine how deeply to pursue the plan.
28
+
29
+ | Level | Signal | Exploration Scope |
30
+ |---|---|---|
31
+ | Specific | File path, function name, error message, or concrete target named | Focus on the relevant file or module |
32
+ | Direction-setting | Open-ended question, "it would be nice if ~", choice needed among approaches | Related area + external case research |
33
+ | Abstract | "I'm not sure how to approach this", goal itself unclear, fundamental direction needed | Full codebase + external research + comparable project comparison |
34
+
35
+ - Specific request → derive issues immediately.
36
+ - Direction-setting request → use hypothesis-based questions to understand intent.
37
+ - Abstract request → actively interview to uncover the root goal the user hasn't yet articulated.
38
+
39
+ #### HOW Subagent Selection
40
+
41
+ - If the user names HOW agents explicitly, use them as-is; propose additions if gaps are visible.
42
+ - If the user does not specify, Lead proposes agents based on the issue scope.
43
+ - Additional HOW subagents can be spawned at any point during analysis.
44
+
45
+ ### Step 2: Research
46
+
47
+ Understand code, core knowledge, and prior decisions before forming the planning agenda.
48
+
49
+ #### Existing Knowledge First
50
+
51
+ - Read `.nexus/memory/` and `.nexus/context/` first.
52
+ - Use `nx_history_search` to check whether prior decisions exist on similar topics.
53
+ - If the needed information is already available, use it directly and skip or narrow subagent spawning.
54
+
55
+ #### Approach Selection
56
+
57
+ | Situation | Approach |
58
+ |---|---|
59
+ | Codebase orientation needed | `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` for codebase exploration |
60
+ | External research needed | `{{subagent_spawn target_role=researcher prompt="<research question>"}}` for web search |
61
+ | Both needed | Spawn `{{subagent_spawn target_role=explore prompt="<file/code search task>"}}` and `{{subagent_spawn target_role=researcher prompt="<research question>"}}` in parallel |
62
+
63
+ - Researcher subagents return findings to Lead and do not participate in the plan session itself.
64
+
65
+ ### Step 3: Session Start
66
+
67
+ Once research is complete, open the planning session with `nx_plan_start`. Any existing `plan.json` is automatically archived. Show the issue list to the user and confirm the direction before proceeding.
68
+
69
+ ### Step 4: Issue-by-Issue Analysis
70
+
71
+ Issues must be processed one at a time. For each issue:
72
+
73
+ 1. Lead summarizes the current state and the problem.
74
+ 2. If needed, spawn HOW subagents for independent analysis.
75
+ - If reusing context from a prior HOW session for the same role is advantageous, check resume routing information with `nx_plan_resume` first.
76
+ - If resumable, continue with the existing session; otherwise, spawn fresh.
77
+ 3. When HOW results return, record them on the issue with `nx_plan_analysis_add(issue_id, role, agent_id=<id from spawn>, summary)`. The `agent_id` is the value `nx_plan_resume` will return on a future resume request for the same role, so always pass the id obtained from the spawn tool response (or the name the Lead assigned). This record feeds both future resume paths and Step 7 task decomposition.
78
+ 4. After synthesis, present a comparison table and recommendation.
79
+ 5. Receive the user's response and record the decision.
80
+
81
+ #### HOW Domain Mapping
82
+
83
+ | Domain Keywords | Recommended HOW |
84
+ |---|---|
85
+ | UI, UX, design, interface, user experience, layout | Designer |
86
+ | Architecture, system design, performance, structural change, API, schema | Architect |
87
+ | Business, market, strategy, positioning, competition, revenue | Strategist |
88
+ | Research methodology, evidence evaluation, literature, experiment design | Postdoc |
89
+
90
+ - If an issue matches a domain above, spawning the corresponding HOW is the default.
91
+ - If the issue crosses multiple domains, spawn multiple HOWs together.
92
+ - To skip spawning, state the reason explicitly in the analysis text.
93
+
94
+ #### Comparison Table Format
95
+
96
+ <example>
97
+
98
+ | Item | A: {title} | B: {title} | C: {title} |
99
+ |---|---|---|---|
100
+ | Pros | ... | ... | ... |
101
+ | Cons | ... | ... | ... |
102
+ | Trade-offs | ... | ... | ... |
103
+ | Best for | ... | ... | ... |
104
+
105
+ **Recommendation: {X} ({title})**
106
+
107
+ - Option A falls short because {reason}
108
+ - Option B falls short because {reason}
109
+ - Option X overcomes {limitations} and delivers {core benefit}
110
+
111
+ </example>
112
+
113
+ ### Step 5: Record Decision
114
+
115
+ When a decision is reached, use `nx_plan_decide` to mark the issue as decided. If HOW subagents participated in the issue, bundle their contribution information so it can be referenced in future resumes and Step 7 task decomposition.
116
+
117
+ - Immediately after recording, check overall progress with `nx_plan_status` and announce the next issue in one line.
118
+ - Check whether new follow-up questions have emerged, and if so, add follow-up issues with `nx_plan_update`.
119
+ - To reverse a decision, reopen the issue with `nx_plan_update` and return to Step 4.
120
+
121
+ ### Step 6: Dynamic Agenda Management
122
+
123
+ - If a decision creates new questions, add follow-up issues with `nx_plan_update`.
124
+ - If unresolved issues remain, move on to the next issue.
125
+ - Once all issues are decided, check for gaps against the original question.
126
+ - If gaps exist, register new issues with `nx_plan_update` and return to Step 4.
127
+
128
+ ### Step 7: Plan Document Generation
129
+
130
+ Once all issues are decided, decompose the decisions from `plan.json` into actionable tasks and populate `tasks.json` via `nx_task_add`. From this point, task tools — not plan tools — take over.
131
+
132
+ Fill in the following fields for each task:
133
+
134
+ - `approach` — implementation strategy derived from the decision rationale
135
+ - `acceptance` — definition of done, verifiable criteria
136
+ - `risk` — risks surfaced during analysis
137
+ - `deps` — execution-order dependencies
138
+ - `owner` — assigned according to the criteria below
139
+
140
+ For issues where HOW subagents participated, reference the analysis recorded in Step 4, or re-spawn the same HOW to request domain-appropriate decomposition.
141
+
142
+ #### Owner Assignment Criteria
143
+
144
+ | Work Type | owner | Criteria |
145
+ |---|---|---|
146
+ | Single file, small change | `lead` | Subagent overhead exceeds task effort |
147
+ | Code implementation | `engineer` | Source code creation or modification |
148
+ | Documentation/content | `writer` | `.md`, README, docs, non-code content |
149
+ | External research | `researcher` | External information gathering required |
150
+ | Design analysis / review | HOW role | Technical judgment is the core work |
151
+ | Sequential edits to the same file | `lead` | High risk of parallel edit conflicts |
152
+
153
+ #### Verification Auto-Pairing
154
+
155
+ - If an `engineer` task has a runtime-behavior criterion in its acceptance, pair a `tester` task.
156
+ - If a `writer` task has a verifiable deliverable criterion in its acceptance, pair a `reviewer` task.
157
+ - Researcher tasks are not auto-paired by default.
158
+
159
+ Once tasks are generated, show the user a summary and instruct them to execute with `[run]`.
@@ -0,0 +1,132 @@
1
+ ---
2
+ id: nx-run
3
+ name: nx-run
4
+ description: Execution — user-directed agent composition.
5
+ triggers:
6
+ - "[run]"
7
+ ---
8
+
9
+ ## 역할
10
+
11
+ 사용자가 `[run]` 태그를 호출할 때 Lead가 따르는 실행 규범이다. tasks.json을 읽어 `owner` 필드에 따라 서브에이전트를 동적으로 조합하고, 실행-검증-완료 사이클을 구동한다.
12
+
13
+ ## 핵심 규칙
14
+
15
+ - **계획 없이 실행하지 않는다.** tasks.json이 없으면 먼저 nx-auto-plan을 호출해 계획을 세운 뒤 돌아온다.
16
+ - **태스크는 `owner`가 실행 주체다.** Lead 단독 처리보다 owner에 맞는 서브에이전트 위임을 기본으로 한다.
17
+ - **미완료 태스크가 남아 있으면 중단하지 않는다.** `nx_task_list`로 모든 태스크가 `completed`인지 확인할 때까지 사이클을 이어간다.
18
+ - **main/master에서는 작업하지 않는다.** 실행 시작 전에 태스크 유형에 맞는 브랜치로 이동한다.
19
+
20
+ ## 절차
21
+
22
+ ### 1단계: 준비
23
+
24
+ - **Branch Guard**: main/master에 있으면 태스크 유형에 맞는 브랜치를 생성하고 이동한다 (prefix: `feat/`, `fix/`, `chore/`, `research/` 등 — Lead의 판단).
25
+ - **tasks.json 로드**:
26
+ - **존재** → `nx_task_list`로 목록을 읽고 `nx_plan_status`로 기존 결정을 확인한다.
27
+ - **없음** → `{{skill_activation skill=nx-auto-plan}}`을 자동 호출해 tasks.json을 생성한다. `[run]`은 실행 의도를 내포하므로 사용자에게 묻지 않는다.
28
+
29
+ ### 2단계: 실행
30
+
31
+ #### 태스크 등록
32
+
33
+ 각 태스크에 대해 `{{task_register label="<label>" state=pending}}`을 호출해 진행 추적을 등록한다. 등록 항목은 최대 10개로 유지한다. 태스크가 10개를 넘으면 `plan_issue`나 대상 파일 등 자연스러운 묶음 기준으로 연관 태스크를 엮어 등록 항목이 10개 이내가 되도록 조정한다.
34
+
35
+ #### 태스크 디스패치
36
+
37
+ - `owner` 필드에 따라 태스크를 실행한다.
38
+ - `owner: "lead"` → Lead가 직접 처리한다.
39
+ - 그 외 → owner 역할에 맞는 서브에이전트를 스폰한다.
40
+ - 각 서브에이전트에게 태스크의 `context`, `approach`, `acceptance`를 프롬프트로 전달한다.
41
+ - **재개 판단**: 각 태스크마다 `nx_task_resume`로 재개 라우팅 정보를 조회하고, 아래 재개 라우팅 규칙에 따라 새로 스폰할지 재개할지 결정한다.
42
+ - **병렬 실행**: deps가 없는 태스크는 병렬로 스폰할 수 있다. 대상 파일이 겹치는 태스크는 직렬화한다.
43
+
44
+ #### 상태 전환
45
+
46
+ - 태스크 시작 시 `nx_task_update`로 `in_progress`, 완료 시 `completed`로 전환한다.
47
+ - 서브에이전트를 새로 스폰한 경우 같은 `nx_task_update` 호출에 `owner={role, agent_id: <스폰에서 얻은 id>, resume_tier: <ephemeral|bounded|persistent>}`를 함께 넘겨 이후 `nx_task_resume`가 이 id를 돌려줄 수 있게 한다.
48
+ - 같은 타이밍에 `{{task_register label="<label>" state=in_progress}}` / `{{task_register label="<label>" state=completed}}`로 진행 추적도 갱신한다. 초기 등록 때 정한 label을 그대로 재사용한다.
49
+
50
+ ### 재개 라우팅 규칙
51
+
52
+ `nx_task_resume`가 반환하는 `resume_tier`와 `agent_id` 값에 따라 Lead가 행동한다.
53
+
54
+ - `ephemeral` → 새로 스폰한다.
55
+ - `bounded` → 동일 owner가 겹치는 대상 파일에 이전 작업이 있고 중간에 다른 에이전트 편집이 없으면 재개한다. 재개 프롬프트에 "수정 전 대상 파일을 다시 읽을 것" 지시를 반드시 포함한다.
56
+ - `persistent` → 이번 실행에서 동일 에이전트가 이전 태스크에 참여했으면 재개한다. 크로스 태스크 재사용 허용.
57
+
58
+ 재개가 결정되면 `nx_task_resume`가 반환한 `agent_id`로 `{{subagent_resume agent_id="<id>" prompt="<재개 프롬프트>"}}` 도구를 호출한다. 재개 프롬프트는 매번 새로 제공한다 — 일부 하네스(OpenCode)는 실행 중 session에 추가 입력을 push하는 경로가 없고, idle session에 새 prompt를 주입하는 방식으로만 재개를 지원한다.
59
+
60
+ `nx_task_resume`가 `agent_id: null`을 반환하거나 하네스가 해당 id를 더 이상 찾지 못하면 오류 없이 새로 스폰으로 폴백한다.
61
+
62
+ ### 에스컬레이션 체인
63
+
64
+ Do와 Check의 핑퐁을 기본 경로로 삼는다. Check가 연속 2회 실패하면 HOW로, HOW 검토 후에도 실패하면 Lead가 사용자에게 에스컬레이션한다.
65
+
66
+ 최대 경로:
67
+
68
+ ```
69
+ Do → Check(실패) → Do → Check(실패) → HOW(검토) → Do → Check(실패) → Lead → 사용자
70
+ ```
71
+
72
+ - **Check 1회 실패** → 같은 Do에게 재위임(재개 가능)해 실패 피드백을 전달하고 수정 후 다시 Check를 돌린다.
73
+ - **Check 2회 연속 실패** → 태스크 도메인에 맞는 HOW 에이전트를 Lead가 선정·스폰해 접근법을 검토·조정받고 Do로 재위임한다.
74
+ - **HOW 검토 후에도 Check 실패** → Lead가 진단 내용과 함께 사용자에게 보고하고 방향을 요청한다.
75
+
76
+ ### 3단계: 검증
77
+
78
+ 각 태스크의 `acceptance` 필드를 기준으로 Check 서브에이전트가 자율적으로 검증한다. 세부 판정 방식은 서브에이전트에게 맡긴다.
79
+
80
+ - **Tester** — 코드 검증 (engineer 산출물).
81
+ - **Reviewer** — 문서 검증 (writer 산출물).
82
+
83
+ 검증 실패는 위의 에스컬레이션 체인을 따른다.
84
+
85
+ ### 4단계: 완료
86
+
87
+ 순서대로 실행한다.
88
+
89
+ 1. **`nx_task_close`**: plan+tasks를 `.nexus/history.json`에 아카이브한다. `plan.json`과 `tasks.json`이 제거된다.
90
+ 2. **git commit**: 소스 변경, 빌드 아티팩트(`bridge/`, `scripts/`), `.nexus/history.json`, 수정된 `.nexus/memory/` 또는 `.nexus/context/`를 한 커밋으로 묶어 사이클-커밋 1:1 매핑을 유지한다. `git add -A` 대신 명시적 경로를 쓴다.
91
+ 3. **보고**: 변경된 파일, 적용된 핵심 결정, 권장 다음 단계를 사용자에게 요약한다. Merge/push는 사용자의 결정이며 이 스킬의 scope 밖이다.
92
+
93
+ ---
94
+
95
+ ## 전체 흐름표
96
+
97
+ | 단계 | 담당 | 내용 |
98
+ |---|---|---|
99
+ | 1. 준비 | Lead | Branch Guard, `nx_task_list`로 tasks.json 확인 / 없으면 nx-auto-plan 호출 |
100
+ | 2. 실행 | Do 서브에이전트 | owner별 스폰, `nx_task_resume`로 재개 판단, `nx_task_update`로 상태 전환 |
101
+ | 3. 검증 | Check 서브에이전트 | `acceptance` 기준으로 Tester(코드)/Reviewer(문서) 검증 |
102
+ | 4. 완료 | Lead | `nx_task_close`, git commit, 보고 |
103
+
104
+ ---
105
+
106
+ ## 구조화된 위임
107
+
108
+ Lead가 서브에이전트에게 태스크를 위임할 때 다음 형식으로 프롬프트를 구성한다.
109
+
110
+ ```
111
+ TASK: {specific deliverable}
112
+
113
+ CONTEXT:
114
+ - Current state: {relevant code/doc locations}
115
+ - Dependencies: {results from prior tasks}
116
+ - Prior decisions: {relevant decisions}
117
+ - Target files: {file path list}
118
+
119
+ CONSTRAINTS:
120
+ - {constraint 1}
121
+ - {constraint 2}
122
+
123
+ ACCEPTANCE:
124
+ - {completion criterion 1}
125
+ - {completion criterion 2}
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 상태 관리
131
+
132
+ `.nexus/state/tasks.json`은 nx-plan 계열(plan/auto-plan)이 `nx_task_add`로 생성하고, nx-run 사이클 동안 `nx_task_update`로 상태 전환을 반영한다. 조회는 `nx_task_list`, 재개 판단은 `nx_task_resume`가 담당한다. 사이클 종료 시 `nx_task_close`를 호출해 plan+tasks를 `.nexus/history.json`에 아카이브한다.