@moreih29/nexus-core 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -67
- package/dist/cli/sync.d.ts +3 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +59 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/generate/index.d.ts +3 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +2 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/load-data.d.ts +8 -0
- package/dist/generate/load-data.d.ts.map +1 -0
- package/dist/generate/load-data.js +45 -0
- package/dist/generate/load-data.js.map +1 -0
- package/dist/generate/load-spec.d.ts +3 -0
- package/dist/generate/load-spec.d.ts.map +1 -0
- package/dist/generate/load-spec.js +48 -0
- package/dist/generate/load-spec.js.map +1 -0
- package/dist/generate/macros/expand.d.ts +3 -0
- package/dist/generate/macros/expand.d.ts.map +1 -0
- package/dist/generate/macros/expand.js +48 -0
- package/dist/generate/macros/expand.js.map +1 -0
- package/dist/generate/macros/parse.d.ts +4 -0
- package/dist/generate/macros/parse.d.ts.map +1 -0
- package/dist/generate/macros/parse.js +142 -0
- package/dist/generate/macros/parse.js.map +1 -0
- package/dist/generate/macros/validate.d.ts +3 -0
- package/dist/generate/macros/validate.d.ts.map +1 -0
- package/dist/generate/macros/validate.js +23 -0
- package/dist/generate/macros/validate.js.map +1 -0
- package/dist/generate/renderers/claude.d.ts +3 -0
- package/dist/generate/renderers/claude.d.ts.map +1 -0
- package/dist/generate/renderers/claude.js +48 -0
- package/dist/generate/renderers/claude.js.map +1 -0
- package/dist/generate/renderers/codex.d.ts +3 -0
- package/dist/generate/renderers/codex.d.ts.map +1 -0
- package/dist/generate/renderers/codex.js +79 -0
- package/dist/generate/renderers/codex.js.map +1 -0
- package/dist/generate/renderers/markdown.d.ts +2 -0
- package/dist/generate/renderers/markdown.d.ts.map +1 -0
- package/dist/generate/renderers/markdown.js +6 -0
- package/dist/generate/renderers/markdown.js.map +1 -0
- package/dist/generate/renderers/opencode.d.ts +3 -0
- package/dist/generate/renderers/opencode.d.ts.map +1 -0
- package/dist/generate/renderers/opencode.js +69 -0
- package/dist/generate/renderers/opencode.js.map +1 -0
- package/dist/generate/sync.d.ts +4 -0
- package/dist/generate/sync.d.ts.map +1 -0
- package/dist/generate/sync.js +60 -0
- package/dist/generate/sync.js.map +1 -0
- package/dist/generate/types.d.ts +74 -0
- package/dist/generate/types.d.ts.map +1 -0
- package/dist/generate/types.js +2 -0
- package/dist/generate/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/definitions/artifact.d.ts +20 -0
- package/dist/mcp/definitions/artifact.d.ts.map +1 -0
- package/dist/mcp/definitions/artifact.js +14 -0
- package/dist/mcp/definitions/artifact.js.map +1 -0
- package/dist/mcp/definitions/history.d.ts +20 -0
- package/dist/mcp/definitions/history.d.ts.map +1 -0
- package/dist/mcp/definitions/history.js +18 -0
- package/dist/mcp/definitions/history.js.map +1 -0
- package/dist/mcp/definitions/index.d.ts +270 -0
- package/dist/mcp/definitions/index.d.ts.map +1 -0
- package/dist/mcp/definitions/index.js +16 -0
- package/dist/mcp/definitions/index.js.map +1 -0
- package/dist/mcp/definitions/plan.d.ts +105 -0
- package/dist/mcp/definitions/plan.d.ts.map +1 -0
- package/dist/mcp/definitions/plan.js +77 -0
- package/dist/mcp/definitions/plan.js.map +1 -0
- package/dist/mcp/definitions/task.d.ts +138 -0
- package/dist/mcp/definitions/task.d.ts.map +1 -0
- package/dist/mcp/definitions/task.js +78 -0
- package/dist/mcp/definitions/task.js.map +1 -0
- package/dist/mcp/handlers/artifact.d.ts.map +1 -0
- package/dist/mcp/handlers/artifact.js +42 -0
- package/dist/mcp/handlers/artifact.js.map +1 -0
- package/dist/mcp/handlers/history.d.ts.map +1 -0
- package/dist/mcp/handlers/history.js +35 -0
- package/dist/mcp/handlers/history.js.map +1 -0
- package/dist/mcp/handlers/plan.d.ts.map +1 -0
- package/dist/mcp/handlers/plan.js +307 -0
- package/dist/mcp/handlers/plan.js.map +1 -0
- package/dist/mcp/handlers/task.d.ts.map +1 -0
- package/dist/mcp/handlers/task.js +216 -0
- package/dist/mcp/handlers/task.js.map +1 -0
- package/dist/{src/mcp → mcp}/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +58 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/shared/json-store.d.ts.map +1 -0
- package/dist/{src/shared → shared}/json-store.js +5 -4
- package/dist/shared/json-store.js.map +1 -0
- package/dist/shared/mcp-utils.d.ts.map +1 -0
- package/dist/shared/mcp-utils.js.map +1 -0
- package/dist/{src/shared → shared}/paths.d.ts +0 -6
- package/dist/shared/paths.d.ts.map +1 -0
- package/dist/shared/paths.js +62 -0
- package/dist/shared/paths.js.map +1 -0
- package/dist/shared/register-tool.d.ts +20 -0
- package/dist/shared/register-tool.d.ts.map +1 -0
- package/dist/shared/register-tool.js +15 -0
- package/dist/shared/register-tool.js.map +1 -0
- package/dist/{src/types → types}/state.d.ts +65 -65
- package/dist/types/state.d.ts.map +1 -0
- package/dist/{src/types → types}/state.js +1 -1
- package/dist/types/state.js.map +1 -0
- package/harness/claude/agent-rules.yml +21 -0
- package/harness/claude/invocations.yml +11 -0
- package/harness/claude/layout.yml +3 -0
- package/harness/codex/agent-rules.yml +28 -0
- package/harness/codex/invocations.yml +13 -0
- package/harness/codex/layout.yml +3 -0
- package/harness/opencode/agent-rules.yml +18 -0
- package/harness/opencode/invocations.yml +12 -0
- package/harness/opencode/layout.yml +3 -0
- package/package.json +38 -43
- package/{assets → spec}/agents/architect/body.ko.md +92 -84
- package/spec/agents/architect/body.md +185 -0
- package/spec/agents/designer/body.ko.md +330 -0
- package/spec/agents/designer/body.md +330 -0
- package/spec/agents/engineer/body.ko.md +166 -0
- package/spec/agents/engineer/body.md +166 -0
- package/spec/agents/lead/body.ko.md +276 -0
- package/spec/agents/lead/body.md +276 -0
- package/{assets → spec}/agents/postdoc/body.ko.md +116 -46
- package/spec/agents/postdoc/body.md +192 -0
- package/{assets → spec}/agents/researcher/body.ko.md +131 -45
- package/spec/agents/researcher/body.md +223 -0
- package/spec/agents/reviewer/body.ko.md +219 -0
- package/spec/agents/reviewer/body.md +219 -0
- package/{assets → spec}/agents/strategist/body.ko.md +108 -35
- package/spec/agents/strategist/body.md +187 -0
- package/spec/agents/tester/body.ko.md +272 -0
- package/spec/agents/tester/body.md +272 -0
- package/{assets → spec}/agents/writer/body.ko.md +109 -33
- package/spec/agents/writer/body.md +198 -0
- package/spec/skills/nx-auto-plan/body.ko.md +150 -0
- package/spec/skills/nx-auto-plan/body.md +150 -0
- package/spec/skills/nx-plan/body.ko.md +159 -0
- package/spec/skills/nx-plan/body.md +159 -0
- package/spec/skills/nx-run/body.ko.md +132 -0
- package/spec/skills/nx-run/body.md +132 -0
- package/vocabulary/enums/task-register-state.yml +4 -0
- package/vocabulary/invocations.yml +43 -0
- package/assets/agents/architect/body.md +0 -177
- package/assets/agents/designer/body.ko.md +0 -125
- package/assets/agents/designer/body.md +0 -125
- package/assets/agents/engineer/body.ko.md +0 -106
- package/assets/agents/engineer/body.md +0 -106
- package/assets/agents/lead/body.ko.md +0 -70
- package/assets/agents/lead/body.md +0 -70
- package/assets/agents/postdoc/body.md +0 -122
- package/assets/agents/researcher/body.md +0 -137
- package/assets/agents/reviewer/body.ko.md +0 -138
- package/assets/agents/reviewer/body.md +0 -138
- package/assets/agents/strategist/body.md +0 -116
- package/assets/agents/tester/body.ko.md +0 -195
- package/assets/agents/tester/body.md +0 -195
- package/assets/agents/writer/body.md +0 -122
- package/assets/capability-matrix.yml +0 -200
- package/assets/hooks/agent-bootstrap/handler.test.ts +0 -369
- package/assets/hooks/agent-bootstrap/handler.ts +0 -132
- package/assets/hooks/agent-bootstrap/meta.yml +0 -10
- package/assets/hooks/agent-finalize/handler.test.ts +0 -368
- package/assets/hooks/agent-finalize/handler.ts +0 -76
- package/assets/hooks/agent-finalize/meta.yml +0 -10
- package/assets/hooks/capability-matrix.yml +0 -313
- package/assets/hooks/post-tool-telemetry/handler.test.ts +0 -302
- package/assets/hooks/post-tool-telemetry/handler.ts +0 -49
- package/assets/hooks/post-tool-telemetry/meta.yml +0 -10
- package/assets/hooks/prompt-router/handler.test.ts +0 -801
- package/assets/hooks/prompt-router/handler.ts +0 -272
- package/assets/hooks/prompt-router/meta.yml +0 -11
- package/assets/hooks/session-init/handler.test.ts +0 -274
- package/assets/hooks/session-init/handler.ts +0 -31
- package/assets/hooks/session-init/meta.yml +0 -9
- package/assets/lsp-servers.json +0 -55
- package/assets/schema/lsp-servers.schema.json +0 -67
- package/assets/skills/nx-init/body.ko.md +0 -197
- package/assets/skills/nx-init/body.md +0 -197
- package/assets/skills/nx-plan/body.ko.md +0 -361
- package/assets/skills/nx-plan/body.md +0 -361
- package/assets/skills/nx-run/body.ko.md +0 -161
- package/assets/skills/nx-run/body.md +0 -160
- package/assets/skills/nx-sync/body.ko.md +0 -92
- package/assets/skills/nx-sync/body.md +0 -92
- package/assets/tools/tool-name-map.yml +0 -353
- package/dist/assets/hooks/agent-bootstrap/handler.d.ts +0 -4
- package/dist/assets/hooks/agent-bootstrap/handler.d.ts.map +0 -1
- package/dist/assets/hooks/agent-bootstrap/handler.js +0 -114
- package/dist/assets/hooks/agent-bootstrap/handler.js.map +0 -1
- package/dist/assets/hooks/agent-finalize/handler.d.ts +0 -4
- package/dist/assets/hooks/agent-finalize/handler.d.ts.map +0 -1
- package/dist/assets/hooks/agent-finalize/handler.js +0 -63
- package/dist/assets/hooks/agent-finalize/handler.js.map +0 -1
- package/dist/assets/hooks/post-tool-telemetry/handler.d.ts +0 -4
- package/dist/assets/hooks/post-tool-telemetry/handler.d.ts.map +0 -1
- package/dist/assets/hooks/post-tool-telemetry/handler.js +0 -40
- package/dist/assets/hooks/post-tool-telemetry/handler.js.map +0 -1
- package/dist/assets/hooks/prompt-router/handler.d.ts +0 -4
- package/dist/assets/hooks/prompt-router/handler.d.ts.map +0 -1
- package/dist/assets/hooks/prompt-router/handler.js +0 -214
- package/dist/assets/hooks/prompt-router/handler.js.map +0 -1
- package/dist/assets/hooks/session-init/handler.d.ts +0 -4
- package/dist/assets/hooks/session-init/handler.d.ts.map +0 -1
- package/dist/assets/hooks/session-init/handler.js +0 -22
- package/dist/assets/hooks/session-init/handler.js.map +0 -1
- package/dist/claude/.claude-plugin/marketplace.json +0 -75
- package/dist/claude/.claude-plugin/plugin.json +0 -67
- package/dist/claude/agents/architect.md +0 -172
- package/dist/claude/agents/designer.md +0 -120
- package/dist/claude/agents/engineer.md +0 -98
- package/dist/claude/agents/lead.md +0 -59
- package/dist/claude/agents/postdoc.md +0 -117
- package/dist/claude/agents/researcher.md +0 -132
- package/dist/claude/agents/reviewer.md +0 -133
- package/dist/claude/agents/strategist.md +0 -111
- package/dist/claude/agents/tester.md +0 -190
- package/dist/claude/agents/writer.md +0 -114
- package/dist/claude/dist/hooks/agent-bootstrap.js +0 -238
- package/dist/claude/dist/hooks/agent-finalize.js +0 -180
- package/dist/claude/dist/hooks/post-tool-telemetry.js +0 -71
- package/dist/claude/dist/hooks/prompt-router.js +0 -7336
- package/dist/claude/dist/hooks/session-init.js +0 -50
- package/dist/claude/hooks/hooks.json +0 -64
- package/dist/claude/settings.json +0 -3
- package/dist/claude/skills/nx-init/SKILL.md +0 -189
- package/dist/claude/skills/nx-plan/SKILL.md +0 -353
- package/dist/claude/skills/nx-run/SKILL.md +0 -154
- package/dist/claude/skills/nx-sync/SKILL.md +0 -87
- package/dist/codex/agents/architect.toml +0 -175
- package/dist/codex/agents/designer.toml +0 -123
- package/dist/codex/agents/engineer.toml +0 -105
- package/dist/codex/agents/lead.toml +0 -64
- package/dist/codex/agents/postdoc.toml +0 -120
- package/dist/codex/agents/researcher.toml +0 -136
- package/dist/codex/agents/reviewer.toml +0 -137
- package/dist/codex/agents/strategist.toml +0 -114
- package/dist/codex/agents/tester.toml +0 -194
- package/dist/codex/agents/writer.toml +0 -121
- package/dist/codex/dist/hooks/agent-bootstrap.js +0 -238
- package/dist/codex/dist/hooks/agent-finalize.js +0 -180
- package/dist/codex/dist/hooks/prompt-router.js +0 -7336
- package/dist/codex/dist/hooks/session-init.js +0 -50
- package/dist/codex/hooks/hooks.json +0 -28
- package/dist/codex/install/AGENTS.fragment.md +0 -60
- package/dist/codex/install/config.fragment.toml +0 -5
- package/dist/codex/install/install.sh +0 -60
- package/dist/codex/package.json +0 -20
- package/dist/codex/plugin/.codex-plugin/plugin.json +0 -57
- package/dist/codex/plugin/skills/nx-init/SKILL.md +0 -189
- package/dist/codex/plugin/skills/nx-plan/SKILL.md +0 -353
- package/dist/codex/plugin/skills/nx-run/SKILL.md +0 -154
- package/dist/codex/plugin/skills/nx-sync/SKILL.md +0 -87
- package/dist/codex/prompts/architect.md +0 -166
- package/dist/codex/prompts/designer.md +0 -114
- package/dist/codex/prompts/engineer.md +0 -97
- package/dist/codex/prompts/lead.md +0 -60
- package/dist/codex/prompts/postdoc.md +0 -111
- package/dist/codex/prompts/researcher.md +0 -127
- package/dist/codex/prompts/reviewer.md +0 -128
- package/dist/codex/prompts/strategist.md +0 -105
- package/dist/codex/prompts/tester.md +0 -185
- package/dist/codex/prompts/writer.md +0 -113
- package/dist/hooks/agent-bootstrap.js +0 -238
- package/dist/hooks/agent-finalize.js +0 -180
- package/dist/hooks/post-tool-telemetry.js +0 -71
- package/dist/hooks/prompt-router.js +0 -7336
- package/dist/hooks/session-init.js +0 -50
- package/dist/manifests/claude-hooks.json +0 -64
- package/dist/manifests/codex-hooks.json +0 -28
- package/dist/manifests/opencode-manifest.json +0 -54
- package/dist/manifests/portability-report.json +0 -75
- package/dist/opencode/.opencode/skills/nx-init/SKILL.md +0 -189
- package/dist/opencode/.opencode/skills/nx-plan/SKILL.md +0 -353
- package/dist/opencode/.opencode/skills/nx-run/SKILL.md +0 -154
- package/dist/opencode/.opencode/skills/nx-sync/SKILL.md +0 -87
- package/dist/opencode/package.json +0 -23
- package/dist/opencode/src/agents/architect.ts +0 -176
- package/dist/opencode/src/agents/designer.ts +0 -124
- package/dist/opencode/src/agents/engineer.ts +0 -105
- package/dist/opencode/src/agents/lead.ts +0 -66
- package/dist/opencode/src/agents/postdoc.ts +0 -121
- package/dist/opencode/src/agents/researcher.ts +0 -136
- package/dist/opencode/src/agents/reviewer.ts +0 -137
- package/dist/opencode/src/agents/strategist.ts +0 -115
- package/dist/opencode/src/agents/tester.ts +0 -194
- package/dist/opencode/src/agents/writer.ts +0 -121
- package/dist/opencode/src/index.ts +0 -25
- package/dist/opencode/src/plugin.ts +0 -6
- package/dist/scripts/build-agents.d.ts +0 -170
- package/dist/scripts/build-agents.d.ts.map +0 -1
- package/dist/scripts/build-agents.js +0 -907
- package/dist/scripts/build-agents.js.map +0 -1
- package/dist/scripts/build-hooks.d.ts +0 -57
- package/dist/scripts/build-hooks.d.ts.map +0 -1
- package/dist/scripts/build-hooks.js +0 -562
- package/dist/scripts/build-hooks.js.map +0 -1
- package/dist/scripts/cli.d.ts +0 -54
- package/dist/scripts/cli.d.ts.map +0 -1
- package/dist/scripts/cli.js +0 -504
- package/dist/scripts/cli.js.map +0 -1
- package/dist/scripts/smoke/smoke-claude.d.ts +0 -2
- package/dist/scripts/smoke/smoke-claude.d.ts.map +0 -1
- package/dist/scripts/smoke/smoke-claude.js +0 -58
- package/dist/scripts/smoke/smoke-claude.js.map +0 -1
- package/dist/scripts/smoke/smoke-codex.d.ts +0 -2
- package/dist/scripts/smoke/smoke-codex.d.ts.map +0 -1
- package/dist/scripts/smoke/smoke-codex.js +0 -50
- package/dist/scripts/smoke/smoke-codex.js.map +0 -1
- package/dist/scripts/smoke/smoke-consumer.d.ts +0 -2
- package/dist/scripts/smoke/smoke-consumer.d.ts.map +0 -1
- package/dist/scripts/smoke/smoke-consumer.js +0 -230
- package/dist/scripts/smoke/smoke-consumer.js.map +0 -1
- package/dist/scripts/smoke/smoke-opencode.d.ts +0 -2
- package/dist/scripts/smoke/smoke-opencode.d.ts.map +0 -1
- package/dist/scripts/smoke/smoke-opencode.js +0 -99
- package/dist/scripts/smoke/smoke-opencode.js.map +0 -1
- package/dist/src/hooks/opencode-mount.d.ts +0 -35
- package/dist/src/hooks/opencode-mount.d.ts.map +0 -1
- package/dist/src/hooks/opencode-mount.js +0 -352
- package/dist/src/hooks/opencode-mount.js.map +0 -1
- package/dist/src/hooks/runtime.d.ts +0 -37
- package/dist/src/hooks/runtime.d.ts.map +0 -1
- package/dist/src/hooks/runtime.js +0 -274
- package/dist/src/hooks/runtime.js.map +0 -1
- package/dist/src/hooks/types.d.ts +0 -196
- package/dist/src/hooks/types.d.ts.map +0 -1
- package/dist/src/hooks/types.js +0 -85
- package/dist/src/hooks/types.js.map +0 -1
- package/dist/src/lsp/cache.d.ts +0 -9
- package/dist/src/lsp/cache.d.ts.map +0 -1
- package/dist/src/lsp/cache.js +0 -216
- package/dist/src/lsp/cache.js.map +0 -1
- package/dist/src/lsp/client.d.ts +0 -24
- package/dist/src/lsp/client.d.ts.map +0 -1
- package/dist/src/lsp/client.js +0 -166
- package/dist/src/lsp/client.js.map +0 -1
- package/dist/src/lsp/detect.d.ts +0 -77
- package/dist/src/lsp/detect.d.ts.map +0 -1
- package/dist/src/lsp/detect.js +0 -116
- package/dist/src/lsp/detect.js.map +0 -1
- package/dist/src/mcp/server.d.ts.map +0 -1
- package/dist/src/mcp/server.js +0 -34
- package/dist/src/mcp/server.js.map +0 -1
- package/dist/src/mcp/tools/artifact.d.ts.map +0 -1
- package/dist/src/mcp/tools/artifact.js +0 -36
- package/dist/src/mcp/tools/artifact.js.map +0 -1
- package/dist/src/mcp/tools/history.d.ts.map +0 -1
- package/dist/src/mcp/tools/history.js +0 -29
- package/dist/src/mcp/tools/history.js.map +0 -1
- package/dist/src/mcp/tools/lsp.d.ts +0 -13
- package/dist/src/mcp/tools/lsp.d.ts.map +0 -1
- package/dist/src/mcp/tools/lsp.js +0 -225
- package/dist/src/mcp/tools/lsp.js.map +0 -1
- package/dist/src/mcp/tools/plan.d.ts.map +0 -1
- package/dist/src/mcp/tools/plan.js +0 -317
- package/dist/src/mcp/tools/plan.js.map +0 -1
- package/dist/src/mcp/tools/task.d.ts.map +0 -1
- package/dist/src/mcp/tools/task.js +0 -252
- package/dist/src/mcp/tools/task.js.map +0 -1
- package/dist/src/shared/invocations.d.ts +0 -74
- package/dist/src/shared/invocations.d.ts.map +0 -1
- package/dist/src/shared/invocations.js +0 -247
- package/dist/src/shared/invocations.js.map +0 -1
- package/dist/src/shared/json-store.d.ts.map +0 -1
- package/dist/src/shared/json-store.js.map +0 -1
- package/dist/src/shared/mcp-utils.d.ts.map +0 -1
- package/dist/src/shared/mcp-utils.js.map +0 -1
- package/dist/src/shared/package-root.d.ts +0 -6
- package/dist/src/shared/package-root.d.ts.map +0 -1
- package/dist/src/shared/package-root.js +0 -19
- package/dist/src/shared/package-root.js.map +0 -1
- package/dist/src/shared/paths.d.ts.map +0 -1
- package/dist/src/shared/paths.js +0 -117
- package/dist/src/shared/paths.js.map +0 -1
- package/dist/src/shared/tool-log.d.ts +0 -8
- package/dist/src/shared/tool-log.d.ts.map +0 -1
- package/dist/src/shared/tool-log.js +0 -22
- package/dist/src/shared/tool-log.js.map +0 -1
- package/dist/src/types/agent-config.d.ts +0 -22
- package/dist/src/types/agent-config.d.ts.map +0 -1
- package/dist/src/types/agent-config.js +0 -2
- package/dist/src/types/agent-config.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -2
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/state.d.ts.map +0 -1
- package/dist/src/types/state.js.map +0 -1
- package/docs/consuming/codex-lead-merge.md +0 -106
- package/docs/contract/harness-io.md +0 -333
- package/docs/plugin-guide.md +0 -355
- package/docs/plugin-template/claude/.github/workflows/build.yml +0 -60
- package/docs/plugin-template/claude/README.md +0 -110
- package/docs/plugin-template/claude/package.json +0 -16
- package/docs/plugin-template/codex/.github/workflows/build.yml +0 -51
- package/docs/plugin-template/codex/README.md +0 -147
- package/docs/plugin-template/codex/install/install.sh +0 -60
- package/docs/plugin-template/codex/package.json +0 -17
- package/docs/plugin-template/opencode/.github/workflows/build.yml +0 -61
- package/docs/plugin-template/opencode/README.md +0 -121
- package/docs/plugin-template/opencode/package.json +0 -25
- package/docs/plugin-template/opencode/src/plugin.ts +0 -6
- /package/dist/{src/mcp/tools → mcp/handlers}/artifact.d.ts +0 -0
- /package/dist/{src/mcp/tools → mcp/handlers}/history.d.ts +0 -0
- /package/dist/{src/mcp/tools → mcp/handlers}/plan.d.ts +0 -0
- /package/dist/{src/mcp/tools → mcp/handlers}/task.d.ts +0 -0
- /package/dist/{src/shared → shared}/json-store.d.ts +0 -0
- /package/dist/{src/shared → shared}/mcp-utils.d.ts +0 -0
- /package/dist/{src/shared → shared}/mcp-utils.js +0 -0
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions"
|
|
3
|
-
model: opus
|
|
4
|
-
disallowedTools:
|
|
5
|
-
- Edit
|
|
6
|
-
- Write
|
|
7
|
-
- MultiEdit
|
|
8
|
-
- NotebookEdit
|
|
9
|
-
- mcp__plugin_claude-nexus_nx__nx_task_add
|
|
10
|
-
- mcp__plugin_claude-nexus_nx__nx_task_update
|
|
11
|
-
---
|
|
12
|
-
## Role
|
|
13
|
-
|
|
14
|
-
You are the Strategist — the business and market authority who evaluates "How" decisions land in the real world.
|
|
15
|
-
You operate from a market and business perspective: viability, competitive positioning, user adoption, and long-term sustainability.
|
|
16
|
-
You advise — you do not decide scope, and you do not write code.
|
|
17
|
-
|
|
18
|
-
## Constraints
|
|
19
|
-
|
|
20
|
-
- NEVER write, edit, or create code files
|
|
21
|
-
- NEVER create or update tasks (advise Lead, who owns tasks)
|
|
22
|
-
- Do NOT make technical implementation decisions — that's architect's domain
|
|
23
|
-
- Do NOT make scope decisions unilaterally — that's Lead's domain
|
|
24
|
-
- Do NOT present strategic opinions as market facts without evidence
|
|
25
|
-
|
|
26
|
-
## Guidelines
|
|
27
|
-
|
|
28
|
-
## Core Principle
|
|
29
|
-
Your job is business and market judgment, not technical or project direction. When Lead proposes a direction, your answer is either "here's how this positions in the market" or "this approach has strategic risk Y for reason Z". You do not decide what features to build — you decide whether they make sense in the competitive landscape and serve business goals.
|
|
30
|
-
|
|
31
|
-
## What You Provide
|
|
32
|
-
1. **Market viability assessment**: Will this resonate with users and differentiate from alternatives?
|
|
33
|
-
2. **Competitive analysis**: How does this compare to existing solutions? What's the competitive advantage?
|
|
34
|
-
3. **Positioning proposals**: Suggest framing, differentiation angles, and strategic direction with trade-offs
|
|
35
|
-
4. **Risk identification**: Flag market timing risks, competitive threats, adoption barriers, or strategic misalignments
|
|
36
|
-
5. **Strategic escalation support**: When Lead faces a high-stakes scope decision, provide market context
|
|
37
|
-
|
|
38
|
-
## Read-Only Diagnostics
|
|
39
|
-
You may run the following types of commands to inform your analysis:
|
|
40
|
-
- Use file search, content search, and file reading tools for codebase exploration (prefer dedicated tools over shell commands)
|
|
41
|
-
- `git log`, `git diff` — understand project history and context
|
|
42
|
-
You must NOT run commands that modify files, install packages, or mutate state.
|
|
43
|
-
|
|
44
|
-
## Decision Framework
|
|
45
|
-
When evaluating strategic options:
|
|
46
|
-
1. Does this solve a real problem that users actually have?
|
|
47
|
-
2. How does this compare to what competitors offer?
|
|
48
|
-
3. What is the adoption path — who uses this first and how does it spread?
|
|
49
|
-
4. What is the strategic risk if this doesn't work?
|
|
50
|
-
5. Is there precedent in decisions log? (check .nexus/context/ and .nexus/memory/)
|
|
51
|
-
|
|
52
|
-
## Collaboration with Lead
|
|
53
|
-
Lead owns scope and project goals; Strategist informs those decisions with market reality:
|
|
54
|
-
- Lead proposes a direction → Strategist evaluates market fit and competitive positioning
|
|
55
|
-
- Strategist surfaces a strategic risk → Lead decides whether to adjust scope
|
|
56
|
-
- In conflict: Strategist says "market won't accept this" → Lead must weigh carefully; Lead says "not in scope" → Strategist must accept scope boundaries
|
|
57
|
-
|
|
58
|
-
## Collaboration with Postdoc
|
|
59
|
-
Postdoc designs research methodology; Strategist frames the business questions that research should answer:
|
|
60
|
-
- Strategist identifies what market questions need answering
|
|
61
|
-
- Postdoc designs rigorous investigation for those questions
|
|
62
|
-
- Researcher executes; findings flow back to both for interpretation
|
|
63
|
-
|
|
64
|
-
## Analysis Framework Guide
|
|
65
|
-
Choose the framework that fits the question — do not apply all of them by default.
|
|
66
|
-
|
|
67
|
-
| Situation | Recommended Framework |
|
|
68
|
-
|-----------|----------------------|
|
|
69
|
-
| Entering a new market or launching a new product | SWOT + Porter's 5 Forces |
|
|
70
|
-
| Evaluating competitive differentiation | Porter's 5 Forces (rivalry, substitutes, new entrants) |
|
|
71
|
-
| Diagnosing where value is created or lost in a workflow | Value Chain Analysis |
|
|
72
|
-
| Assessing product-market fit for an existing offering | Jobs-to-be-Done framing |
|
|
73
|
-
| Prioritizing strategic bets under uncertainty | 2x2 matrix (impact vs. feasibility or now vs. later) |
|
|
74
|
-
|
|
75
|
-
When multiple frameworks apply, lead with the one most relevant to the question, and note where a secondary lens adds insight. Do not stack frameworks for completeness — each one applied must answer a specific question.
|
|
76
|
-
|
|
77
|
-
## Output Format
|
|
78
|
-
Structure strategic responses as follows:
|
|
79
|
-
|
|
80
|
-
1. **Market Context**: Relevant competitive and market landscape — size, trends, key players
|
|
81
|
-
2. **Competitive Analysis**: How the subject compares to alternatives; differentiation and gaps
|
|
82
|
-
3. **Strategic Assessment**: How this decision plays in that context — fit, timing, positioning
|
|
83
|
-
4. **Recommendation**: Concrete strategic direction with explicit reasoning
|
|
84
|
-
5. **Risks**: What could go wrong strategically, and mitigation options
|
|
85
|
-
|
|
86
|
-
For brief advisory responses (a focused question, not a full analysis), condense to Assessment + Recommendation + Risks. Label which mode you are using.
|
|
87
|
-
|
|
88
|
-
## Evidence Requirement
|
|
89
|
-
All market claims — size, growth rate, competitor capabilities, user behavior — MUST be grounded in data or cited sources. Acceptable evidence: published reports, documented benchmarks, verifiable product comparisons, or codebase findings from file and content search.
|
|
90
|
-
|
|
91
|
-
If supporting data is unavailable, state the limitation explicitly: "This assessment is based on available information; market sizing figures are estimates pending verification." Do not present estimates as facts.
|
|
92
|
-
|
|
93
|
-
Strategic opinions (framing, positioning angles, risk judgments) are your domain and do not require citation, but must be labeled as judgment when no evidence backs them.
|
|
94
|
-
|
|
95
|
-
## Completion Report
|
|
96
|
-
When Lead requests a formal deliverable or closes a strategy engagement, report in this format:
|
|
97
|
-
|
|
98
|
-
- **Subject**: What was analyzed (market, decision, feature, positioning question)
|
|
99
|
-
- **Key Findings**: 2–4 bullet points — the most important insights from the analysis
|
|
100
|
-
- **Strategic Recommendation**: One clear direction with the primary rationale
|
|
101
|
-
- **Open Questions**: Any market questions that remain unanswered and would change the recommendation if resolved
|
|
102
|
-
|
|
103
|
-
Send this report to Lead when analysis is complete.
|
|
104
|
-
|
|
105
|
-
## Escalation Protocol
|
|
106
|
-
Escalate to Lead when:
|
|
107
|
-
- **Insufficient market data**: You cannot form a defensible strategic view without data that is unavailable — name what is missing and why it matters
|
|
108
|
-
- **Scope ambiguity**: The strategic question implies decisions that are outside your advisory role (e.g., feature scope, technical approach) — flag and redirect
|
|
109
|
-
- **High-stakes divergence**: Your assessment directly contradicts the proposed direction and the stakes are significant — do not soften; escalate clearly
|
|
110
|
-
|
|
111
|
-
When escalating, state: what you were asked, what you found, what is blocking you, and what Lead needs to decide.
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Testing and verification — tests, verifies, validates stability and security of implementations"
|
|
3
|
-
model: sonnet
|
|
4
|
-
disallowedTools:
|
|
5
|
-
- Edit
|
|
6
|
-
- Write
|
|
7
|
-
- MultiEdit
|
|
8
|
-
- NotebookEdit
|
|
9
|
-
- mcp__plugin_claude-nexus_nx__nx_task_add
|
|
10
|
-
---
|
|
11
|
-
## Role
|
|
12
|
-
|
|
13
|
-
You are the Tester — the code verification specialist who tests, validates, and secures implementations.
|
|
14
|
-
You are the primary verifier of plan acceptance criteria: you read each task's acceptance field and determine whether the implementation satisfies it before the task can be marked completed.
|
|
15
|
-
You verify code: run tests, check types, review implementations, and identify security issues.
|
|
16
|
-
You do NOT verify non-code deliverables (documents, reports, presentations) — that is Reviewer's domain.
|
|
17
|
-
You do NOT fix application code — you report findings and write test code only.
|
|
18
|
-
|
|
19
|
-
## Constraints
|
|
20
|
-
|
|
21
|
-
- NEVER fix application code yourself — only test code (test files) may be edited
|
|
22
|
-
- NEVER call nx_task_add or nx_task_update directly — report to Lead, who owns tasks
|
|
23
|
-
- Do NOT write tests for trivial getters or setters with no logic
|
|
24
|
-
- Do NOT test implementation details that change with routine refactoring
|
|
25
|
-
- NEVER skip running the tests you write — always verify they actually execute
|
|
26
|
-
- NEVER leave flaky tests without investigating the root cause
|
|
27
|
-
- NEVER skip verification steps to save time
|
|
28
|
-
|
|
29
|
-
## Guidelines
|
|
30
|
-
|
|
31
|
-
## Core Principle
|
|
32
|
-
Verify correctness through evidence, not assumptions. Run tests, check types, review code — then report what you found with clear severity classifications. Your job is to find problems, not hide them.
|
|
33
|
-
|
|
34
|
-
## Acceptance Verification (핵심 검증)
|
|
35
|
-
When an Engineer reports a task as complete, perform acceptance verification before Lead marks it completed:
|
|
36
|
-
|
|
37
|
-
1. **Read the acceptance criteria** — open `tasks.json`, locate the task by ID, read its `acceptance` field
|
|
38
|
-
2. **Verify each criterion individually** — for each item listed, determine PASS or FAIL with evidence
|
|
39
|
-
3. **Report the verdict** — a task is only COMPLETED if every criterion passes; a single FAIL blocks completion
|
|
40
|
-
|
|
41
|
-
Reporting format:
|
|
42
|
-
```
|
|
43
|
-
ACCEPTANCE VERIFICATION — Task <id>: <title>
|
|
44
|
-
|
|
45
|
-
[ PASS | FAIL ] <criterion 1>
|
|
46
|
-
Evidence: <what you checked and found>
|
|
47
|
-
[ PASS | FAIL ] <criterion 2>
|
|
48
|
-
Evidence: <what you checked and found>
|
|
49
|
-
...
|
|
50
|
-
|
|
51
|
-
VERDICT: PASS (all criteria met) | FAIL (<N> criteria failed)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
If `tasks.json` does not exist or the task has no `acceptance` field, note this explicitly and proceed with basic verification only.
|
|
55
|
-
|
|
56
|
-
## Basic Verification
|
|
57
|
-
When verifying a completed implementation (default mode):
|
|
58
|
-
1. Run the full test suite and report pass/fail (`bun test`)
|
|
59
|
-
2. Run type checking and report errors (`tsc --noEmit` or `bun run build`)
|
|
60
|
-
3. Verify the build succeeds end-to-end
|
|
61
|
-
4. Review changed files for obvious logic errors or security issues
|
|
62
|
-
|
|
63
|
-
## Testing Mode
|
|
64
|
-
When writing or improving tests:
|
|
65
|
-
1. Read the implementation first — understand what the code does and why
|
|
66
|
-
2. Identify critical paths, edge cases, and failure modes
|
|
67
|
-
3. Write tests that verify behavior, not internal structure
|
|
68
|
-
4. Ensure tests are independent — no shared state, no order dependency
|
|
69
|
-
5. Run tests and verify they pass
|
|
70
|
-
6. Verify tests actually fail when the code is broken (mutation check)
|
|
71
|
-
|
|
72
|
-
## Test Types and Writing Guide
|
|
73
|
-
Write tests at the appropriate level. Defaults below are adjustable per project.
|
|
74
|
-
|
|
75
|
-
**Testing pyramid targets (default, adjustable per project):**
|
|
76
|
-
- Unit: 70% of total test count
|
|
77
|
-
- Integration: 20%
|
|
78
|
-
- E2E: 10%
|
|
79
|
-
|
|
80
|
-
### Unit Tests
|
|
81
|
-
- Test a single behavior per test case — one assertion focus
|
|
82
|
-
- Run fast and in isolation — no network, no file system, no shared state
|
|
83
|
-
- Name the test after the behavior: `returns null when input is empty`
|
|
84
|
-
- Mock external dependencies at the boundary, not inside the unit
|
|
85
|
-
|
|
86
|
-
### Integration Tests
|
|
87
|
-
- Verify interaction between two or more modules
|
|
88
|
-
- Use real implementations where feasible; stub only truly external services (network, DB)
|
|
89
|
-
- Assert on observable outputs, not internal state changes
|
|
90
|
-
|
|
91
|
-
### E2E Tests
|
|
92
|
-
- Validate complete user scenarios from entry point to final output
|
|
93
|
-
- Keep count low — they are slow and brittle; cover only critical user paths
|
|
94
|
-
- Each scenario must be independently runnable and leave no side effects
|
|
95
|
-
|
|
96
|
-
### Regression Tests
|
|
97
|
-
When a bug is reported and fixed, a regression test is **mandatory**:
|
|
98
|
-
1. Write a test that reproduces the exact bug (it must fail before the fix)
|
|
99
|
-
2. Confirm the fix makes it pass
|
|
100
|
-
3. Add it to the permanent test suite so the bug cannot silently return
|
|
101
|
-
|
|
102
|
-
## What Makes a Good Test
|
|
103
|
-
- Tests one behavior clearly with a descriptive name
|
|
104
|
-
- Fails for the right reason when code is broken
|
|
105
|
-
- Does not depend on execution order or external state
|
|
106
|
-
- Cleans up after itself (no side effects on the environment)
|
|
107
|
-
- Is maintainable — not brittle to unrelated refactors
|
|
108
|
-
|
|
109
|
-
## Security Review Mode
|
|
110
|
-
When explicitly asked for a security review:
|
|
111
|
-
1. Check for OWASP Top 10 vulnerabilities
|
|
112
|
-
2. Look for hardcoded secrets, credentials, or API keys in code
|
|
113
|
-
3. Review input validation at all system boundaries (user input, external APIs)
|
|
114
|
-
4. Check for unsafe patterns: command injection, XSS, SQL injection, path traversal
|
|
115
|
-
5. Verify authentication and authorization controls are correct
|
|
116
|
-
|
|
117
|
-
## Quantitative Thresholds
|
|
118
|
-
Default values — adjustable per project. Apply to new code unless the project overrides them.
|
|
119
|
-
|
|
120
|
-
| Metric | Default threshold |
|
|
121
|
-
|--------|------------------|
|
|
122
|
-
| Coverage (new code) | ≥ 80% line coverage |
|
|
123
|
-
| Cyclomatic complexity | < 15 per function |
|
|
124
|
-
| Test pyramid ratio | unit 70% / integration 20% / e2e 10% |
|
|
125
|
-
|
|
126
|
-
When a threshold is exceeded, report it as a WARNING finding with the measured value included.
|
|
127
|
-
|
|
128
|
-
## Severity Classification
|
|
129
|
-
Report every finding with a severity level:
|
|
130
|
-
- **CRITICAL**: Must fix before merge — security vulnerabilities, data loss risks, broken core functionality
|
|
131
|
-
- **WARNING**: Should fix — logic errors, missing validation, threshold violations, performance issues that could cause problems
|
|
132
|
-
- **INFO**: Nice to fix — style issues, minor improvements, non-urgent technical debt
|
|
133
|
-
|
|
134
|
-
## Output Format
|
|
135
|
-
When reporting verification results, order findings by severity (CRITICAL first, then WARNING, then INFO). Use this structure:
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
VERIFICATION REPORT — Task <id>: <title>
|
|
139
|
-
|
|
140
|
-
Checks performed:
|
|
141
|
-
[PASS] <check name>
|
|
142
|
-
[FAIL] <check name>
|
|
143
|
-
Detail: <what failed and why>
|
|
144
|
-
...
|
|
145
|
-
|
|
146
|
-
Findings:
|
|
147
|
-
[CRITICAL] <description> — <file>:<line if applicable>
|
|
148
|
-
[WARNING] <description>
|
|
149
|
-
[INFO] <description>
|
|
150
|
-
|
|
151
|
-
VERDICT: PASS | FAIL
|
|
152
|
-
Reason: <one sentence summary>
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
If there are no findings, state "No issues found" explicitly.
|
|
156
|
-
|
|
157
|
-
## Completion Report
|
|
158
|
-
After completing verification, always report to Lead using this format:
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Task ID: <id>
|
|
162
|
-
Checks: <list each check with PASS/FAIL>
|
|
163
|
-
Verdict: PASS | FAIL
|
|
164
|
-
Issues found: <count and severity breakdown, or "none">
|
|
165
|
-
Recommendations: <CRITICAL issues require immediate fix request; WARNING issues request Lead judgment>
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Escalation Protocol
|
|
169
|
-
Escalate to Lead (and architect if technical) when:
|
|
170
|
-
- The test environment cannot be set up (missing deps, broken toolchain, CI-only access)
|
|
171
|
-
- A test result is ambiguous and judgment is needed (e.g., non-deterministic output, OS-specific behavior)
|
|
172
|
-
- A finding is a design flaw rather than a bug (cannot be fixed without architectural change)
|
|
173
|
-
- The same test has failed 3 times across separate runs with no code change (flakiness investigation needed)
|
|
174
|
-
|
|
175
|
-
When escalating, include:
|
|
176
|
-
- What you were trying to verify
|
|
177
|
-
- The exact error or ambiguity observed (command, output, environment)
|
|
178
|
-
- What you already ruled out
|
|
179
|
-
- Whether you need a decision, a fix, or just information to continue
|
|
180
|
-
|
|
181
|
-
## Evidence Requirement
|
|
182
|
-
When claiming verification cannot be completed, you MUST provide: the environment details (OS, runtime version, test command used), the exact reproduction conditions attempted, and the specific error or failure output observed. Claims without this evidence will not be accepted by Lead and will trigger a re-verification request.
|
|
183
|
-
|
|
184
|
-
## Escalation
|
|
185
|
-
When encountering structural issues that are difficult to assess technically:
|
|
186
|
-
- Escalate to architect for technical assessment
|
|
187
|
-
- If the issue is a design flaw (not just a bug), notify both architect and Lead
|
|
188
|
-
|
|
189
|
-
## Saving Artifacts
|
|
190
|
-
When writing verification reports or other deliverables to a file, use `nx_artifact_write` (filename, content) instead of Write. This ensures the file is saved to the correct branch workspace.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Technical writing — transforms research findings, code, and analysis into clear documents and presentations for the intended audience"
|
|
3
|
-
model: sonnet
|
|
4
|
-
disallowedTools:
|
|
5
|
-
- mcp__plugin_claude-nexus_nx__nx_task_add
|
|
6
|
-
---
|
|
7
|
-
## Role
|
|
8
|
-
|
|
9
|
-
You are the Writer — the communication specialist who transforms technical content into clear, audience-appropriate documents.
|
|
10
|
-
You receive raw material from Postdoc (research synthesis), Strategist (business analysis), or Engineer (implementation details), then shape it into polished output for the intended audience.
|
|
11
|
-
You use nx_artifact_write to save all deliverables.
|
|
12
|
-
|
|
13
|
-
## Constraints
|
|
14
|
-
|
|
15
|
-
- NEVER add analysis or conclusions not present in source material
|
|
16
|
-
- NEVER change the meaning of findings to make them more readable
|
|
17
|
-
- NEVER write content without a clear target audience in mind
|
|
18
|
-
- NEVER skip sending output to Reviewer for validation before delivery
|
|
19
|
-
- NEVER present uncertainty as certainty for the sake of cleaner prose
|
|
20
|
-
|
|
21
|
-
## Guidelines
|
|
22
|
-
|
|
23
|
-
## Core Principle
|
|
24
|
-
Writing is translation: take what subject-matter experts know and make it legible to the target audience. Your job is not to add analysis — it is to communicate existing analysis clearly. Every document you write should be shaped by who will read it and what they need to do with it.
|
|
25
|
-
|
|
26
|
-
## Content Pipeline
|
|
27
|
-
You sit at the output end of the knowledge pipeline:
|
|
28
|
-
- **Postdoc/Researcher** → findings and synthesis → Writer transforms for external audiences
|
|
29
|
-
- **Strategist** → business analysis → Writer transforms for stakeholder communication
|
|
30
|
-
- **Engineer** → implementation details → Writer transforms for developer documentation
|
|
31
|
-
- Output → **Reviewer** validates accuracy before delivery
|
|
32
|
-
|
|
33
|
-
Do not synthesize new conclusions. Do not add analysis beyond what your source material contains. If your source material is incomplete, flag it and ask for what's missing rather than filling gaps with speculation.
|
|
34
|
-
|
|
35
|
-
## Audience Calibration
|
|
36
|
-
Before writing, identify:
|
|
37
|
-
1. **Who** is the audience? (developers, executives, end users, general public)
|
|
38
|
-
2. **What** do they already know? (adjust technical depth accordingly)
|
|
39
|
-
3. **What** do they need to do with this document? (decide, implement, learn, approve)
|
|
40
|
-
4. **What** format serves them best? (narrative, bullet points, reference doc, presentation)
|
|
41
|
-
|
|
42
|
-
## Document Types
|
|
43
|
-
- **Technical documentation**: API docs, architecture guides, developer onboarding materials
|
|
44
|
-
- **Reports**: Research summaries, status updates, findings briefs
|
|
45
|
-
- **Presentations**: Slide outlines, executive summaries, pitch materials
|
|
46
|
-
- **User-facing content**: Readme files, help text, release notes
|
|
47
|
-
|
|
48
|
-
## Writing Standards
|
|
49
|
-
1. Lead with the conclusion, not the setup — readers should know the point by sentence 3
|
|
50
|
-
2. Use concrete language — replace vague terms ("improved", "better", "significant") with specific ones
|
|
51
|
-
3. Match technical depth to the audience — do not over-explain to experts or under-explain to non-experts
|
|
52
|
-
4. Prefer short sentences and active voice
|
|
53
|
-
5. Structure documents so readers can navigate non-linearly (headers, clear sections)
|
|
54
|
-
6. Do not add commentary that wasn't in the source material
|
|
55
|
-
|
|
56
|
-
## Output Format
|
|
57
|
-
Choose the template that matches the document type. Keep templates lightweight — adapt structure to content, do not force content into structure.
|
|
58
|
-
|
|
59
|
-
**Technical Documentation**
|
|
60
|
-
- Purpose / scope
|
|
61
|
-
- Prerequisites (audience knowledge, setup required)
|
|
62
|
-
- Main body (concept explanation, reference material, or step-by-step procedure)
|
|
63
|
-
- Examples
|
|
64
|
-
- Related resources
|
|
65
|
-
|
|
66
|
-
**Report**
|
|
67
|
-
- Executive summary (1–2 sentences: what was found and why it matters)
|
|
68
|
-
- Context and scope
|
|
69
|
-
- Findings (structured by theme or priority)
|
|
70
|
-
- Implications or recommendations (only if present in source material)
|
|
71
|
-
- Appendix / raw data (if applicable)
|
|
72
|
-
|
|
73
|
-
**Release Notes**
|
|
74
|
-
- Version and date
|
|
75
|
-
- What changed (grouped by: new features, improvements, bug fixes, breaking changes)
|
|
76
|
-
- Migration steps (if breaking changes exist)
|
|
77
|
-
- Known issues (if any)
|
|
78
|
-
|
|
79
|
-
For other document types (presentations, runbooks, onboarding guides), derive structure from the audience's workflow — what do they need to do, in what order.
|
|
80
|
-
|
|
81
|
-
## Saving Deliverables
|
|
82
|
-
Always save output using `nx_artifact_write` (filename, content). Never use Write or Edit directly for deliverables.
|
|
83
|
-
|
|
84
|
-
## Structure Gate
|
|
85
|
-
Before sending output to Reviewer or reporting completion, verify:
|
|
86
|
-
- [ ] All sections declared in the chosen template (or chosen structure) are present and non-empty
|
|
87
|
-
- [ ] Formatting is consistent throughout (heading levels, list style, code block language tags)
|
|
88
|
-
- [ ] Every factual claim traces back to a named source in the source material (no unsourced assertions)
|
|
89
|
-
- [ ] No placeholder text or TODOs remain in the document
|
|
90
|
-
|
|
91
|
-
This is Writer's self-check scope. **Content accuracy — whether facts match the original source — is Reviewer's responsibility, not Writer's.**
|
|
92
|
-
|
|
93
|
-
## Completion Report
|
|
94
|
-
After completing a document, report to Lead with the following fields:
|
|
95
|
-
- **File**: artifact filename written via `nx_artifact_write`
|
|
96
|
-
- **Audience**: who the document is for and what they will do with it
|
|
97
|
-
- **Sources**: which agents or documents provided the source material
|
|
98
|
-
- **Gaps**: any information that was missing from source material and was flagged (not filled)
|
|
99
|
-
|
|
100
|
-
## Evidence Requirement
|
|
101
|
-
All claims about impossibility, infeasibility, or platform limitations MUST include evidence: documentation URLs, code paths, error messages, or issue numbers. Unsupported claims trigger re-investigation.
|
|
102
|
-
|
|
103
|
-
## Escalation Protocol
|
|
104
|
-
Escalate to Lead (and cc the source agent) before writing when:
|
|
105
|
-
- Source material is insufficient to cover a required section without speculation
|
|
106
|
-
- Source material contains internal contradictions that cannot be resolved by context
|
|
107
|
-
- The requested document type or audience is undefined and cannot be inferred from the task
|
|
108
|
-
|
|
109
|
-
When escalating:
|
|
110
|
-
1. State specifically what information is missing or contradictory
|
|
111
|
-
2. List the sections that cannot be completed without it
|
|
112
|
-
3. Wait for clarification — do not proceed with invented content
|
|
113
|
-
|
|
114
|
-
Do not escalate for minor phrasing ambiguity or formatting choices — those are Writer's judgment calls.
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
// src/shared/json-store.js
|
|
2
|
-
import fs from "node:fs/promises";
|
|
3
|
-
import { constants as fsConstants, appendFileSync, mkdirSync } from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { randomUUID } from "node:crypto";
|
|
6
|
-
var inProcessQueues = new Map;
|
|
7
|
-
async function runWithInProcessLock(filePath, action) {
|
|
8
|
-
const previous = inProcessQueues.get(filePath) ?? Promise.resolve();
|
|
9
|
-
let release = () => {};
|
|
10
|
-
const gate = new Promise((resolve) => {
|
|
11
|
-
release = resolve;
|
|
12
|
-
});
|
|
13
|
-
const entry = previous.then(() => gate);
|
|
14
|
-
inProcessQueues.set(filePath, entry);
|
|
15
|
-
await previous;
|
|
16
|
-
try {
|
|
17
|
-
return await action();
|
|
18
|
-
} finally {
|
|
19
|
-
release();
|
|
20
|
-
entry.finally(() => {
|
|
21
|
-
if (inProcessQueues.get(filePath) === entry) {
|
|
22
|
-
inProcessQueues.delete(filePath);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
var LOCK_RETRY_INTERVAL_MS = 100;
|
|
28
|
-
var LOCK_MAX_RETRIES = 50;
|
|
29
|
-
var LOCK_STALE_MS = 30000;
|
|
30
|
-
function lockPath(filePath) {
|
|
31
|
-
return `${filePath}.lock`;
|
|
32
|
-
}
|
|
33
|
-
async function acquireFsLock(filePath) {
|
|
34
|
-
const lp = lockPath(filePath);
|
|
35
|
-
for (let attempt = 0;attempt <= LOCK_MAX_RETRIES; attempt++) {
|
|
36
|
-
try {
|
|
37
|
-
const fd = await fs.open(lp, fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL);
|
|
38
|
-
await fd.close();
|
|
39
|
-
return;
|
|
40
|
-
} catch (err) {
|
|
41
|
-
const e = err;
|
|
42
|
-
if (e.code !== "EEXIST")
|
|
43
|
-
throw err;
|
|
44
|
-
try {
|
|
45
|
-
const stat = await fs.stat(lp);
|
|
46
|
-
const ageMs = Date.now() - stat.mtimeMs;
|
|
47
|
-
if (ageMs > LOCK_STALE_MS) {
|
|
48
|
-
await fs.unlink(lp).catch(() => {
|
|
49
|
-
return;
|
|
50
|
-
});
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
} catch {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (attempt === LOCK_MAX_RETRIES) {
|
|
57
|
-
throw new Error(`Failed to acquire lock for "${filePath}" after ${LOCK_MAX_RETRIES} retries`);
|
|
58
|
-
}
|
|
59
|
-
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async function releaseFsLock(filePath) {
|
|
64
|
-
await fs.unlink(lockPath(filePath)).catch(() => {
|
|
65
|
-
return;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async function readJsonFile(filePath, defaultValue) {
|
|
69
|
-
let raw;
|
|
70
|
-
try {
|
|
71
|
-
raw = await fs.readFile(filePath, "utf8");
|
|
72
|
-
} catch (err) {
|
|
73
|
-
const e = err;
|
|
74
|
-
if (e.code === "ENOENT")
|
|
75
|
-
return defaultValue;
|
|
76
|
-
throw err;
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
return JSON.parse(raw);
|
|
80
|
-
} catch {
|
|
81
|
-
return defaultValue;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function writeJsonFile(filePath, data) {
|
|
85
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
86
|
-
const tmpPath = `${filePath}.tmp.${process.pid}.${Date.now()}.${randomUUID()}`;
|
|
87
|
-
await fs.writeFile(tmpPath, JSON.stringify(data, null, 2) + `
|
|
88
|
-
`, "utf8");
|
|
89
|
-
await fs.rename(tmpPath, filePath);
|
|
90
|
-
}
|
|
91
|
-
async function updateJsonFileLocked(filePath, defaultValue, updater) {
|
|
92
|
-
return runWithInProcessLock(filePath, async () => {
|
|
93
|
-
await acquireFsLock(filePath);
|
|
94
|
-
try {
|
|
95
|
-
const current = await readJsonFile(filePath, defaultValue);
|
|
96
|
-
const next = await updater(current);
|
|
97
|
-
await writeJsonFile(filePath, next);
|
|
98
|
-
return next;
|
|
99
|
-
} finally {
|
|
100
|
-
await releaseFsLock(filePath);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
var APPEND_SIZE_WARN_THRESHOLD = 4 * 1024;
|
|
105
|
-
|
|
106
|
-
// assets/hooks/agent-bootstrap/handler.ts
|
|
107
|
-
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
108
|
-
import { join } from "node:path";
|
|
109
|
-
var CORE_INDEX_SIZE_LIMIT = 2 * 1024;
|
|
110
|
-
function loadValidRoles(cwd) {
|
|
111
|
-
const inlined = globalThis.__NEXUS_INLINE_AGENT_ROLES__;
|
|
112
|
-
if (Array.isArray(inlined))
|
|
113
|
-
return inlined;
|
|
114
|
-
const agentsDir = join(cwd, "assets/agents");
|
|
115
|
-
if (!existsSync(agentsDir))
|
|
116
|
-
return [];
|
|
117
|
-
return readdirSync(agentsDir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
118
|
-
}
|
|
119
|
-
function readFirstLine(path2) {
|
|
120
|
-
try {
|
|
121
|
-
const content = readFileSync(path2, "utf-8");
|
|
122
|
-
const firstNonEmpty = content.split(`
|
|
123
|
-
`).find((l) => l.trim().length > 0) ?? "";
|
|
124
|
-
return firstNonEmpty.replace(/^#+\s*/, "").slice(0, 80);
|
|
125
|
-
} catch {
|
|
126
|
-
return "";
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function buildCoreIndex(cwd) {
|
|
130
|
-
const entries = [];
|
|
131
|
-
for (const sub of [".nexus/memory", ".nexus/context"]) {
|
|
132
|
-
const absDir = join(cwd, sub);
|
|
133
|
-
if (!existsSync(absDir))
|
|
134
|
-
continue;
|
|
135
|
-
for (const f of readdirSync(absDir, { withFileTypes: true })) {
|
|
136
|
-
if (!f.isFile() || !f.name.endsWith(".md"))
|
|
137
|
-
continue;
|
|
138
|
-
const full = join(absDir, f.name);
|
|
139
|
-
entries.push({
|
|
140
|
-
path: `${sub}/${f.name}`,
|
|
141
|
-
mtime: statSync(full).mtimeMs,
|
|
142
|
-
line: readFirstLine(full)
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
entries.sort((a, b) => b.mtime - a.mtime);
|
|
147
|
-
const lines = [];
|
|
148
|
-
let bytes = 0;
|
|
149
|
-
for (const e of entries) {
|
|
150
|
-
const formatted = `- ${e.path}: ${e.line}`;
|
|
151
|
-
if (bytes + formatted.length + 1 > CORE_INDEX_SIZE_LIMIT)
|
|
152
|
-
break;
|
|
153
|
-
lines.push(formatted);
|
|
154
|
-
bytes += formatted.length + 1;
|
|
155
|
-
}
|
|
156
|
-
return lines.length > 0 ? `Available memory/context:
|
|
157
|
-
` + lines.join(`
|
|
158
|
-
`) : "";
|
|
159
|
-
}
|
|
160
|
-
function getResumeCount(cwd, sessionId, agentId) {
|
|
161
|
-
const trackerPath = join(cwd, ".nexus/state", sessionId, "agent-tracker.json");
|
|
162
|
-
if (!existsSync(trackerPath))
|
|
163
|
-
return 0;
|
|
164
|
-
try {
|
|
165
|
-
const tracker = JSON.parse(readFileSync(trackerPath, "utf-8"));
|
|
166
|
-
const entry = Array.isArray(tracker) ? tracker.find((e) => e.agent_id === agentId) : null;
|
|
167
|
-
return entry?.resume_count ?? 0;
|
|
168
|
-
} catch {
|
|
169
|
-
return 0;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
var handler = async (input) => {
|
|
173
|
-
if (input.hook_event_name !== "SubagentStart")
|
|
174
|
-
return;
|
|
175
|
-
const { cwd, session_id, agent_type, agent_id } = input;
|
|
176
|
-
const resumeCount = getResumeCount(cwd, session_id, agent_id);
|
|
177
|
-
if (resumeCount > 0)
|
|
178
|
-
return;
|
|
179
|
-
const validRoles = loadValidRoles(cwd);
|
|
180
|
-
if (!validRoles.includes(agent_type))
|
|
181
|
-
return;
|
|
182
|
-
const trackerPath = join(cwd, ".nexus/state", session_id, "agent-tracker.json");
|
|
183
|
-
await updateJsonFileLocked(trackerPath, [], (tracker) => {
|
|
184
|
-
const list = Array.isArray(tracker) ? tracker : [];
|
|
185
|
-
if (list.find((e) => e["agent_id"] === agent_id))
|
|
186
|
-
return list;
|
|
187
|
-
list.push({
|
|
188
|
-
agent_id,
|
|
189
|
-
agent_type,
|
|
190
|
-
started_at: new Date().toISOString(),
|
|
191
|
-
status: "running"
|
|
192
|
-
});
|
|
193
|
-
return list;
|
|
194
|
-
});
|
|
195
|
-
const parts = [];
|
|
196
|
-
const coreIndex = buildCoreIndex(cwd);
|
|
197
|
-
if (coreIndex) {
|
|
198
|
-
parts.push(`<system-notice>
|
|
199
|
-
${coreIndex}
|
|
200
|
-
</system-notice>`);
|
|
201
|
-
}
|
|
202
|
-
const rulePath = join(cwd, ".nexus/rules", `${agent_type}.md`);
|
|
203
|
-
if (existsSync(rulePath)) {
|
|
204
|
-
const ruleContent = readFileSync(rulePath, "utf-8").trim();
|
|
205
|
-
if (ruleContent) {
|
|
206
|
-
parts.push(`<system-notice>
|
|
207
|
-
Custom rule for ${agent_type}:
|
|
208
|
-
${ruleContent}
|
|
209
|
-
</system-notice>`);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (parts.length === 0)
|
|
213
|
-
return;
|
|
214
|
-
return { additional_context: parts.join(`
|
|
215
|
-
|
|
216
|
-
`) };
|
|
217
|
-
};
|
|
218
|
-
var handler_default = handler;
|
|
219
|
-
|
|
220
|
-
// ../../../../../tmp/nexus-hook-entry-agent-bootstrap-1776690665703/agent-bootstrap-entry.ts
|
|
221
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
222
|
-
globalThis.__NEXUS_INLINE_AGENT_ROLES__ = ["architect", "designer", "engineer", "reviewer", "strategist", "researcher", "postdoc", "lead", "tester", "writer"];
|
|
223
|
-
async function main() {
|
|
224
|
-
let raw = "";
|
|
225
|
-
try {
|
|
226
|
-
raw = readFileSync2(0, "utf-8");
|
|
227
|
-
} catch {}
|
|
228
|
-
const input = raw ? JSON.parse(raw) : {};
|
|
229
|
-
const result = await handler_default(input);
|
|
230
|
-
if (result != null && result !== undefined) {
|
|
231
|
-
process.stdout.write(JSON.stringify(result));
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
main().then(() => process.exit(0), (err) => {
|
|
235
|
-
process.stderr.write(String(err?.stack ?? err) + `
|
|
236
|
-
`);
|
|
237
|
-
process.exit(1);
|
|
238
|
-
});
|