@moreih29/nexus-core 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +48 -63
  2. package/assets/agents/architect/body.ko.md +177 -0
  3. package/{agents → assets/agents}/architect/body.md +16 -0
  4. package/assets/agents/designer/body.ko.md +125 -0
  5. package/{agents → assets/agents}/designer/body.md +16 -0
  6. package/assets/agents/engineer/body.ko.md +106 -0
  7. package/{agents → assets/agents}/engineer/body.md +14 -0
  8. package/assets/agents/lead/body.ko.md +70 -0
  9. package/assets/agents/lead/body.md +70 -0
  10. package/assets/agents/postdoc/body.ko.md +122 -0
  11. package/{agents → assets/agents}/postdoc/body.md +16 -0
  12. package/assets/agents/researcher/body.ko.md +137 -0
  13. package/{agents → assets/agents}/researcher/body.md +15 -0
  14. package/assets/agents/reviewer/body.ko.md +138 -0
  15. package/{agents → assets/agents}/reviewer/body.md +15 -0
  16. package/assets/agents/strategist/body.ko.md +116 -0
  17. package/{agents → assets/agents}/strategist/body.md +16 -0
  18. package/assets/agents/tester/body.ko.md +195 -0
  19. package/{agents → assets/agents}/tester/body.md +15 -0
  20. package/assets/agents/writer/body.ko.md +122 -0
  21. package/{agents → assets/agents}/writer/body.md +14 -0
  22. package/assets/capability-matrix.yml +198 -0
  23. package/assets/hooks/agent-bootstrap/handler.test.ts +368 -0
  24. package/assets/hooks/agent-bootstrap/handler.ts +119 -0
  25. package/assets/hooks/agent-bootstrap/meta.yml +10 -0
  26. package/assets/hooks/agent-finalize/handler.test.ts +368 -0
  27. package/assets/hooks/agent-finalize/handler.ts +76 -0
  28. package/assets/hooks/agent-finalize/meta.yml +10 -0
  29. package/assets/hooks/capability-matrix.yml +313 -0
  30. package/assets/hooks/post-tool-telemetry/handler.test.ts +302 -0
  31. package/assets/hooks/post-tool-telemetry/handler.ts +49 -0
  32. package/assets/hooks/post-tool-telemetry/meta.yml +11 -0
  33. package/assets/hooks/prompt-router/handler.test.ts +801 -0
  34. package/assets/hooks/prompt-router/handler.ts +261 -0
  35. package/assets/hooks/prompt-router/meta.yml +11 -0
  36. package/assets/hooks/session-init/handler.test.ts +274 -0
  37. package/assets/hooks/session-init/handler.ts +30 -0
  38. package/assets/hooks/session-init/meta.yml +9 -0
  39. package/assets/lsp-servers.json +55 -0
  40. package/assets/schema/lsp-servers.schema.json +67 -0
  41. package/assets/skills/nx-init/body.ko.md +197 -0
  42. package/{skills → assets/skills}/nx-init/body.md +11 -0
  43. package/assets/skills/nx-plan/body.ko.md +361 -0
  44. package/{skills → assets/skills}/nx-plan/body.md +13 -0
  45. package/assets/skills/nx-run/body.ko.md +161 -0
  46. package/{skills → assets/skills}/nx-run/body.md +11 -0
  47. package/assets/skills/nx-sync/body.ko.md +92 -0
  48. package/{skills → assets/skills}/nx-sync/body.md +10 -0
  49. package/assets/tools/tool-name-map.yml +353 -0
  50. package/dist/hooks/opencode-mount.d.ts +35 -0
  51. package/dist/hooks/opencode-mount.d.ts.map +1 -0
  52. package/dist/hooks/opencode-mount.js +332 -0
  53. package/dist/hooks/opencode-mount.js.map +1 -0
  54. package/dist/hooks/runtime.d.ts +37 -0
  55. package/dist/hooks/runtime.d.ts.map +1 -0
  56. package/dist/hooks/runtime.js +274 -0
  57. package/dist/hooks/runtime.js.map +1 -0
  58. package/dist/hooks/types.d.ts +196 -0
  59. package/dist/hooks/types.d.ts.map +1 -0
  60. package/dist/hooks/types.js +85 -0
  61. package/dist/hooks/types.js.map +1 -0
  62. package/dist/lsp/cache.d.ts +9 -0
  63. package/dist/lsp/cache.d.ts.map +1 -0
  64. package/dist/lsp/cache.js +216 -0
  65. package/dist/lsp/cache.js.map +1 -0
  66. package/dist/lsp/client.d.ts +24 -0
  67. package/dist/lsp/client.d.ts.map +1 -0
  68. package/dist/lsp/client.js +166 -0
  69. package/dist/lsp/client.js.map +1 -0
  70. package/dist/lsp/detect.d.ts +77 -0
  71. package/dist/lsp/detect.d.ts.map +1 -0
  72. package/dist/lsp/detect.js +116 -0
  73. package/dist/lsp/detect.js.map +1 -0
  74. package/dist/mcp/server.d.ts +5 -0
  75. package/dist/mcp/server.d.ts.map +1 -0
  76. package/dist/mcp/server.js +34 -0
  77. package/dist/mcp/server.js.map +1 -0
  78. package/dist/mcp/tools/artifact.d.ts +4 -0
  79. package/dist/mcp/tools/artifact.d.ts.map +1 -0
  80. package/dist/mcp/tools/artifact.js +36 -0
  81. package/dist/mcp/tools/artifact.js.map +1 -0
  82. package/dist/mcp/tools/history.d.ts +3 -0
  83. package/dist/mcp/tools/history.d.ts.map +1 -0
  84. package/dist/mcp/tools/history.js +29 -0
  85. package/dist/mcp/tools/history.js.map +1 -0
  86. package/dist/mcp/tools/lsp.d.ts +13 -0
  87. package/dist/mcp/tools/lsp.d.ts.map +1 -0
  88. package/dist/mcp/tools/lsp.js +225 -0
  89. package/dist/mcp/tools/lsp.js.map +1 -0
  90. package/dist/mcp/tools/plan.d.ts +3 -0
  91. package/dist/mcp/tools/plan.d.ts.map +1 -0
  92. package/dist/mcp/tools/plan.js +317 -0
  93. package/dist/mcp/tools/plan.js.map +1 -0
  94. package/dist/mcp/tools/task.d.ts +3 -0
  95. package/dist/mcp/tools/task.d.ts.map +1 -0
  96. package/dist/mcp/tools/task.js +252 -0
  97. package/dist/mcp/tools/task.js.map +1 -0
  98. package/dist/shared/invocations.d.ts +74 -0
  99. package/dist/shared/invocations.d.ts.map +1 -0
  100. package/dist/shared/invocations.js +247 -0
  101. package/dist/shared/invocations.js.map +1 -0
  102. package/dist/shared/json-store.d.ts +37 -0
  103. package/dist/shared/json-store.d.ts.map +1 -0
  104. package/dist/shared/json-store.js +163 -0
  105. package/dist/shared/json-store.js.map +1 -0
  106. package/dist/shared/mcp-utils.d.ts +3 -0
  107. package/dist/shared/mcp-utils.d.ts.map +1 -0
  108. package/dist/shared/mcp-utils.js +6 -0
  109. package/dist/shared/mcp-utils.js.map +1 -0
  110. package/dist/shared/paths.d.ts +21 -0
  111. package/dist/shared/paths.d.ts.map +1 -0
  112. package/dist/shared/paths.js +81 -0
  113. package/dist/shared/paths.js.map +1 -0
  114. package/dist/shared/tool-log.d.ts +8 -0
  115. package/dist/shared/tool-log.d.ts.map +1 -0
  116. package/dist/shared/tool-log.js +22 -0
  117. package/dist/shared/tool-log.js.map +1 -0
  118. package/dist/types/state.d.ts +862 -0
  119. package/dist/types/state.d.ts.map +1 -0
  120. package/dist/types/state.js +66 -0
  121. package/dist/types/state.js.map +1 -0
  122. package/docs/consuming/codex-lead-merge.md +106 -0
  123. package/docs/plugin-guide.md +360 -0
  124. package/docs/plugin-template/claude/.github/workflows/build.yml +60 -0
  125. package/docs/plugin-template/claude/README.md +110 -0
  126. package/docs/plugin-template/claude/package.json +16 -0
  127. package/docs/plugin-template/codex/.github/workflows/build.yml +51 -0
  128. package/docs/plugin-template/codex/README.md +147 -0
  129. package/docs/plugin-template/codex/package.json +17 -0
  130. package/docs/plugin-template/opencode/.github/workflows/build.yml +61 -0
  131. package/docs/plugin-template/opencode/README.md +121 -0
  132. package/docs/plugin-template/opencode/package.json +25 -0
  133. package/package.json +21 -21
  134. package/scripts/build-agents.test.ts +1279 -0
  135. package/scripts/build-agents.ts +978 -0
  136. package/scripts/build-hooks.test.ts +1385 -0
  137. package/scripts/build-hooks.ts +584 -0
  138. package/scripts/cli.test.ts +367 -0
  139. package/scripts/cli.ts +547 -0
  140. package/agents/architect/meta.yml +0 -13
  141. package/agents/designer/meta.yml +0 -13
  142. package/agents/engineer/meta.yml +0 -11
  143. package/agents/postdoc/meta.yml +0 -13
  144. package/agents/researcher/meta.yml +0 -12
  145. package/agents/reviewer/meta.yml +0 -12
  146. package/agents/strategist/meta.yml +0 -13
  147. package/agents/tester/meta.yml +0 -12
  148. package/agents/writer/meta.yml +0 -11
  149. package/conformance/README.md +0 -311
  150. package/conformance/examples/plan.extension.schema.example.json +0 -25
  151. package/conformance/lifecycle/README.md +0 -48
  152. package/conformance/lifecycle/agent-complete.json +0 -44
  153. package/conformance/lifecycle/agent-resume.json +0 -43
  154. package/conformance/lifecycle/agent-spawn.json +0 -36
  155. package/conformance/lifecycle/memory-access-record.json +0 -27
  156. package/conformance/lifecycle/session-end.json +0 -48
  157. package/conformance/scenarios/full-plan-cycle.json +0 -147
  158. package/conformance/scenarios/task-deps-ordering.json +0 -95
  159. package/conformance/schema/fixture.schema.json +0 -354
  160. package/conformance/state-schemas/agent-tracker.schema.json +0 -63
  161. package/conformance/state-schemas/history.schema.json +0 -134
  162. package/conformance/state-schemas/memory-access.schema.json +0 -36
  163. package/conformance/state-schemas/plan.schema.json +0 -77
  164. package/conformance/state-schemas/tasks.schema.json +0 -98
  165. package/conformance/tools/artifact-write.json +0 -97
  166. package/conformance/tools/context.json +0 -172
  167. package/conformance/tools/history-search.json +0 -219
  168. package/conformance/tools/plan-decide.json +0 -139
  169. package/conformance/tools/plan-start.json +0 -81
  170. package/conformance/tools/plan-status.json +0 -127
  171. package/conformance/tools/plan-update.json +0 -341
  172. package/conformance/tools/task-add.json +0 -156
  173. package/conformance/tools/task-close.json +0 -161
  174. package/conformance/tools/task-list.json +0 -177
  175. package/conformance/tools/task-update.json +0 -167
  176. package/docs/behavioral-contracts.md +0 -145
  177. package/docs/consumer-implementation-guide.md +0 -840
  178. package/docs/memory-lifecycle-contract.md +0 -119
  179. package/docs/nexus-layout.md +0 -224
  180. package/docs/nexus-outputs-contract.md +0 -344
  181. package/docs/nexus-state-overview.md +0 -170
  182. package/docs/nexus-tools-contract.md +0 -438
  183. package/manifest.json +0 -448
  184. package/schema/README.md +0 -69
  185. package/schema/agent.schema.json +0 -23
  186. package/schema/common.schema.json +0 -17
  187. package/schema/manifest.schema.json +0 -78
  188. package/schema/memory-policy.schema.json +0 -98
  189. package/schema/skill.schema.json +0 -54
  190. package/schema/task-exceptions.schema.json +0 -40
  191. package/schema/vocabulary.schema.json +0 -167
  192. package/scripts/.gitkeep +0 -0
  193. package/scripts/conformance-coverage.ts +0 -466
  194. package/scripts/import-from-claude-nexus.ts +0 -403
  195. package/scripts/lib/frontmatter.ts +0 -71
  196. package/scripts/lib/lint.ts +0 -348
  197. package/scripts/lib/structure.ts +0 -159
  198. package/scripts/lib/validate.ts +0 -796
  199. package/scripts/validate.ts +0 -90
  200. package/skills/nx-init/meta.yml +0 -8
  201. package/skills/nx-plan/meta.yml +0 -10
  202. package/skills/nx-run/meta.yml +0 -8
  203. package/skills/nx-sync/meta.yml +0 -7
  204. package/vocabulary/capabilities.yml +0 -65
  205. package/vocabulary/categories.yml +0 -11
  206. package/vocabulary/invocations.yml +0 -147
  207. package/vocabulary/memory_policy.yml +0 -88
  208. package/vocabulary/resume-tiers.yml +0 -11
  209. package/vocabulary/tags.yml +0 -60
  210. package/vocabulary/task-exceptions.yml +0 -29
package/manifest.json DELETED
@@ -1,448 +0,0 @@
1
- {
2
- "nexus_core_version": "0.12.0",
3
- "nexus_core_commit": "f2aae4883f354d1d0e5ee06f163c96c2b0f9bea3",
4
- "schema_contract_version": "2.0",
5
- "agents": [
6
- {
7
- "name": "architect",
8
- "description": "Technical design — evaluates How, reviews architecture, advises on implementation approach",
9
- "task": "Architecture, technical design, code review",
10
- "alias_ko": "아키텍트",
11
- "category": "how",
12
- "resume_tier": "persistent",
13
- "model_tier": "high",
14
- "capabilities": [
15
- "no_file_edit",
16
- "no_task_create",
17
- "no_task_update"
18
- ],
19
- "id": "architect",
20
- "body_hash": "sha256:85f9a3de419f32cdae284436eb1d902bff19a2230c50fe3068ffc642949a63b7"
21
- },
22
- {
23
- "name": "designer",
24
- "description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
25
- "task": "UI/UX design, interaction patterns, user experience",
26
- "alias_ko": "디자이너",
27
- "category": "how",
28
- "resume_tier": "persistent",
29
- "model_tier": "high",
30
- "capabilities": [
31
- "no_file_edit",
32
- "no_task_create",
33
- "no_task_update"
34
- ],
35
- "id": "designer",
36
- "body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
37
- },
38
- {
39
- "name": "engineer",
40
- "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
41
- "task": "Code implementation, edits, debugging",
42
- "alias_ko": "엔지니어",
43
- "category": "do",
44
- "resume_tier": "bounded",
45
- "model_tier": "standard",
46
- "capabilities": [
47
- "no_task_create"
48
- ],
49
- "id": "engineer",
50
- "body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
51
- },
52
- {
53
- "name": "postdoc",
54
- "description": "Research methodology and synthesis — designs investigation approach, evaluates evidence quality, writes synthesis documents",
55
- "task": "Research methodology, evidence synthesis",
56
- "alias_ko": "포닥",
57
- "category": "how",
58
- "resume_tier": "persistent",
59
- "model_tier": "high",
60
- "capabilities": [
61
- "no_file_edit",
62
- "no_task_create",
63
- "no_task_update"
64
- ],
65
- "id": "postdoc",
66
- "body_hash": "sha256:da9b8c2568b8b5812abed6d6324139f814379d48dc63cdc5d0b5b263f5407814"
67
- },
68
- {
69
- "name": "researcher",
70
- "description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
71
- "task": "Web search, independent investigation",
72
- "alias_ko": "리서처",
73
- "category": "do",
74
- "resume_tier": "persistent",
75
- "model_tier": "standard",
76
- "capabilities": [
77
- "no_file_edit",
78
- "no_task_create"
79
- ],
80
- "id": "researcher",
81
- "body_hash": "sha256:fc79bafec05503327bd51a0b84b6e642d304bd79c45b78db6448b112793c143e"
82
- },
83
- {
84
- "name": "reviewer",
85
- "description": "Content verification — validates accuracy, checks facts, confirms grammar and format of non-code deliverables",
86
- "task": "Content verification, fact-checking, grammar review",
87
- "alias_ko": "리뷰어",
88
- "category": "check",
89
- "resume_tier": "ephemeral",
90
- "model_tier": "standard",
91
- "capabilities": [
92
- "no_file_edit",
93
- "no_task_create"
94
- ],
95
- "id": "reviewer",
96
- "body_hash": "sha256:f04d15249601b14046e7e40a4475defb289436c4474afbd89986964f8c3e7c2f"
97
- },
98
- {
99
- "name": "strategist",
100
- "description": "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions",
101
- "task": "Business strategy, market analysis, competitive positioning",
102
- "alias_ko": "전략가",
103
- "category": "how",
104
- "resume_tier": "persistent",
105
- "model_tier": "high",
106
- "capabilities": [
107
- "no_file_edit",
108
- "no_task_create",
109
- "no_task_update"
110
- ],
111
- "id": "strategist",
112
- "body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
113
- },
114
- {
115
- "name": "tester",
116
- "description": "Testing and verification — tests, verifies, validates stability and security of implementations",
117
- "task": "Testing, verification, security review",
118
- "alias_ko": "테스터",
119
- "category": "check",
120
- "resume_tier": "ephemeral",
121
- "model_tier": "standard",
122
- "capabilities": [
123
- "no_file_edit",
124
- "no_task_create"
125
- ],
126
- "id": "tester",
127
- "body_hash": "sha256:4dd04e1c93ff9c0c9fa6aebb60ece3f9719e82f9714b13feea01b6163633caec"
128
- },
129
- {
130
- "name": "writer",
131
- "description": "Technical writing — transforms research findings, code, and analysis into clear documents and presentations for the intended audience",
132
- "task": "Technical writing, documentation, presentations",
133
- "alias_ko": "라이터",
134
- "category": "do",
135
- "resume_tier": "bounded",
136
- "model_tier": "standard",
137
- "capabilities": [
138
- "no_task_create"
139
- ],
140
- "id": "writer",
141
- "body_hash": "sha256:2edd9bf52e537c446b5ebfaafab214ebaaad2491f019aa8534453bff3f1cd37b"
142
- }
143
- ],
144
- "skills": [
145
- {
146
- "name": "nx-init",
147
- "description": "Project onboarding — scan, mission, essentials, context generation",
148
- "summary": "Project onboarding — scan, mission, essentials, context generation",
149
- "manual_only": true,
150
- "harness_docs_refs": [
151
- "instruction_file",
152
- "slash_command_display"
153
- ],
154
- "id": "nx-init",
155
- "body_hash": "sha256:b828a974ab4722dd7f1d15a4338d1380fdae47cd42c1bd4a5539277075efb6fc"
156
- },
157
- {
158
- "name": "nx-plan",
159
- "description": "Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched plan before execution. Plan only — does not execute.",
160
- "summary": "Structured planning — subagent-based analysis, deliberate decisions, produce execution plan",
161
- "triggers": [
162
- "plan"
163
- ],
164
- "harness_docs_refs": [
165
- "resume_invocation"
166
- ],
167
- "id": "nx-plan",
168
- "body_hash": "sha256:083ce49c06f8d3e4a0299aa8eb8e33460b68d6a277fe356b4db9635c21016aff"
169
- },
170
- {
171
- "name": "nx-run",
172
- "description": "Execution — user-directed agent composition.",
173
- "summary": "Execution — user-directed agent composition",
174
- "triggers": [
175
- "run"
176
- ],
177
- "harness_docs_refs": [
178
- "resume_invocation"
179
- ],
180
- "id": "nx-run",
181
- "body_hash": "sha256:0e2c443efceeab4621709a85cd4e2ba50471d2e850680c655d776cbb62814549"
182
- },
183
- {
184
- "name": "nx-sync",
185
- "description": "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents",
186
- "summary": "Context knowledge synchronization",
187
- "triggers": [
188
- "sync"
189
- ],
190
- "id": "nx-sync",
191
- "body_hash": "sha256:3ee8dd780d53f2e04472de6c701e16bc1fbde7f2ce9ed4e680b7cd2010530a22"
192
- }
193
- ],
194
- "vocabulary": {
195
- "capabilities": [
196
- {
197
- "id": "no_file_edit",
198
- "description": "Agent cannot create, modify, or delete files in the user's workspace.",
199
- "intent": "workspace_write_denial",
200
- "blocks_semantic_classes": [
201
- "file_creation",
202
- "file_modification",
203
- "file_deletion",
204
- "partial_file_edit",
205
- "structured_document_edit"
206
- ],
207
- "prose_guidance": "Block any tool whose primary effect is to alter content at a workspace\nfile path. This includes: creating new files at arbitrary paths, rewriting\nwhole file contents, applying partial edits (diffs, patches, find-replace,\nmulti-edit batches), deleting or truncating files, and cell-level edits in\nstructured documents such as notebooks.\nRead-only operations are NOT blocked: reading file contents, querying\nmetadata, listing directories, and running code-intelligence queries that\ndo not mutate files.\n"
208
- },
209
- {
210
- "id": "no_task_create",
211
- "description": "Agent cannot create new tasks in the Nexus task pipeline.",
212
- "intent": "task_pipeline_append_denial",
213
- "blocks_semantic_classes": [
214
- "nexus_task_creation"
215
- ],
216
- "prose_guidance": "Block any tool that appends a new task to the Nexus task pipeline (the\nmechanism by which Lead-owned work is enqueued for execution). Tools that\nread, list, or query existing tasks are NOT blocked. Tools that modify\nexisting task state belong to a separate capability (no_task_update) and\nare not governed here.\n"
217
- },
218
- {
219
- "id": "no_task_update",
220
- "description": "Agent cannot update the state of existing Nexus tasks.",
221
- "intent": "task_pipeline_mutate_denial",
222
- "blocks_semantic_classes": [
223
- "nexus_task_state_transition",
224
- "nexus_task_metadata_modification"
225
- ],
226
- "prose_guidance": "Block any tool that mutates an existing Nexus task: changing its status,\nediting its description, reassigning ownership, closing it, or modifying\nany field on its record. Tools that read, list, or query tasks are NOT\nblocked. Creation of new tasks is governed by no_task_create, not here.\n"
227
- },
228
- {
229
- "id": "no_shell_exec",
230
- "description": "Agent cannot execute arbitrary shell commands or spawn subprocesses.",
231
- "intent": "shell_execution_denial",
232
- "blocks_semantic_classes": [
233
- "shell_command_exec",
234
- "subprocess_spawn",
235
- "interactive_shell_session"
236
- ],
237
- "prose_guidance": "Block any tool whose primary effect is to run a command-line invocation,\nshell script, or spawn a subprocess on the user's machine. This includes\ngeneral-purpose shell runners, background process managers, shell output\nreaders, and shell-session kill operations. Tools that read files, query\nmetadata, or call specialized non-shell APIs (HTTP, language-server\nqueries, sandboxed code evaluators that do not spawn user-machine\nprocesses) are NOT blocked.\n"
238
- }
239
- ],
240
- "categories": [
241
- {
242
- "id": "how",
243
- "description": "분석·자문. 깊은 맥락 유지가 핵심 자산. architect, designer, postdoc, strategist."
244
- },
245
- {
246
- "id": "do",
247
- "description": "실행. 산출물(artifact) 단위로 작업하고 종료. engineer, writer, researcher."
248
- },
249
- {
250
- "id": "check",
251
- "description": "검증. 항상 fresh한 관점에서 독립적으로 검사. tester, reviewer."
252
- }
253
- ],
254
- "resume_tiers": [
255
- {
256
- "id": "persistent",
257
- "description": "세션 전체를 지속한다. HOW 카테고리 에이전트와 researcher. 맥락 누적이 핵심 자산."
258
- },
259
- {
260
- "id": "bounded",
261
- "description": "artifact 단위로 지속한다. engineer, writer. 특정 산출물 완성 후 종료."
262
- },
263
- {
264
- "id": "ephemeral",
265
- "description": "항상 새로 시작한다. tester, reviewer. 이전 맥락 없이 독립 검증해야 하기 때문."
266
- }
267
- ],
268
- "tags": [
269
- {
270
- "id": "plan",
271
- "trigger": "[plan]",
272
- "type": "skill",
273
- "skill": "nx-plan",
274
- "description": "Activates nx-plan skill for structured multi-perspective analysis and decision recording",
275
- "variants": [
276
- "auto"
277
- ]
278
- },
279
- {
280
- "id": "run",
281
- "trigger": "[run]",
282
- "type": "skill",
283
- "skill": "nx-run",
284
- "description": "Activates nx-run skill for task execution with subagent composition"
285
- },
286
- {
287
- "id": "sync",
288
- "trigger": "[sync]",
289
- "type": "skill",
290
- "skill": "nx-sync",
291
- "description": "Activates nx-sync skill for .nexus/context/ knowledge synchronization"
292
- },
293
- {
294
- "id": "d",
295
- "trigger": "[d]",
296
- "type": "inline_action",
297
- "handler": "nx_plan_decide",
298
- "description": "Records a decision during an active plan session"
299
- },
300
- {
301
- "id": "m",
302
- "trigger": "[m]",
303
- "type": "inline_action",
304
- "handler": "memory_store",
305
- "description": "Stores a lesson or reference to .nexus/memory/",
306
- "prose_guidance": "저장 admission 기준 — 코드/웹에서 다시 얻을 수 없는 정보만 저장한다. memory 파일의 naming, category, lifecycle 운영 정책은 vocabulary/memory_policy.yml과 docs/memory-lifecycle-contract.md를 canonical source로 참조한다.\n"
307
- },
308
- {
309
- "id": "m-gc",
310
- "trigger": "[m:gc]",
311
- "type": "inline_action",
312
- "handler": "memory_gc",
313
- "description": "Garbage-collects .nexus/memory/ by merging or removing stale entries",
314
- "prose_guidance": "gc 트리거 조건 평가, merge 판단, forgetting policy 집행은 vocabulary/memory_policy.yml에 정의된 원칙을 따르고 구체 임계값은 consumer-local 설정으로 결정한다.\n"
315
- },
316
- {
317
- "id": "rule",
318
- "trigger": "[rule]",
319
- "type": "inline_action",
320
- "handler": "rule_store",
321
- "description": "Stores a project rule to .nexus/rules/. [rule:*] supports tag parameter.",
322
- "variants": [
323
- "*"
324
- ]
325
- }
326
- ],
327
- "invocations": [
328
- {
329
- "id": "skill_activation",
330
- "description": "Activate another skill within the current conversation.",
331
- "intent": "skill_entry_dispatch",
332
- "fallback_behavior": "If the harness lacks a live skill activation primitive, re-emit the\nskill's trigger tag (e.g., '[plan:auto]') as a self-dispatch signal,\nrelying on tag detection to re-enter the skill. The skill id must be\nmapped to its canonical trigger tag by the harness's own docs.\n"
333
- },
334
- {
335
- "id": "subagent_spawn",
336
- "description": "Spawn a new subagent session with a specific role and prompt.",
337
- "intent": "subagent_session_create",
338
- "fallback_behavior": "If the harness lacks an explicit subagent spawn primitive (e.g.,\nhooks-based implicit routing), inject the target_role as a routing\nhint and structure the prompt so the harness's own delegation rules\ncatch it. A harness that cannot spawn agents must document this\nlimitation and treat the invocation as a no-op with a warning.\n"
339
- },
340
- {
341
- "id": "task_register",
342
- "description": "Register a task for user-visible progress tracking.",
343
- "intent": "execution_visibility_register",
344
- "fallback_behavior": "If the harness has no TUI task tracker, omit the call entirely. This\nprimitive is best-effort — failure or absence must not block\nexecution. Logging the label and state to the conversation transcript\nis acceptable as a degraded fallback for auditability.\n"
345
- },
346
- {
347
- "id": "user_question",
348
- "description": "Ask the user a structured question with selectable options.",
349
- "intent": "structured_user_prompt",
350
- "fallback_behavior": "If the harness lacks a structured question tool (e.g., opencode-nexus),\npresent the question as prose followed by the options enumerated as a\nnumbered list, then await the user's free-form reply. The LLM is\nexpected to map the reply to the most appropriate option or treat it\nas a free-form answer if no options were given.\n"
351
- },
352
- {
353
- "id": "memory_read_observation",
354
- "description": "Harness-local observation of an agent reading a file under .nexus/memory/. This invocation captures the moment a memory file's content is loaded into an agent's context. It is not the read action itself — the read is performed by the harness's file-read primitive — but the observation event emitted by the harness after the read completes.\n",
355
- "intent": "memory_read_observation",
356
- "fallback_behavior": "If the harness cannot observe file-read events (no equivalent hook), memory access tracking is unavailable and forgetting decisions must rely on manual inspection via the [m:gc] tag. Automatic deletion policies requiring access metadata are consequently not enabled in such harnesses.\n"
357
- }
358
- ],
359
- "task_exceptions": [
360
- {
361
- "id": "docs_only.coherent",
362
- "description": "A batch of documentation files that all address the same scheme, decision, or structural change and should be treated as a single coherent unit.",
363
- "applies_when": "all changed files are .md or frontmatter-only, and share one common scheme, decision, or structural change",
364
- "treatment": "bundle into 1 writer task + 1 reviewer pair; file count / line count thresholds waived; state coherence claim in task approach field",
365
- "rationale": "e.g., updating agent frontmatter files after a new field is introduced; files share the same change intent"
366
- },
367
- {
368
- "id": "docs_only.independent",
369
- "description": "A set of documentation files where each file addresses a distinct topic with no cross-reference dependency.",
370
- "applies_when": "each .md file addresses a distinct topic with no cross-reference dependency",
371
- "treatment": "N parallel writer tasks (one per file), each paired with 1 reviewer task; file count threshold waived per-task",
372
- "rationale": "e.g., separate proposal drafts; each file is independently consumed"
373
- },
374
- {
375
- "id": "same_file_bundle",
376
- "description": "Two or more decomposed sub-tasks that would each modify the same target file, requiring merger to avoid conflicts.",
377
- "applies_when": "two or more sub-tasks in the decomposition would each modify the same target file",
378
- "treatment": "merge sub-tasks into a single task under one owner with a structured prompt listing each sub-task's requirements; the merged task counts as 1 task and 1 artifact cluster; does not apply when sub-tasks are sequenced (A's output feeds B) — those remain separate with a deps relationship",
379
- "rationale": "parallel subagents targeting the same file cause merge conflicts"
380
- },
381
- {
382
- "id": "generated_artifacts",
383
- "description": "Files that are build output and do not represent independent authoring decisions.",
384
- "applies_when": "files are build output (e.g., paths declared as build outputs in the harness's build configuration)",
385
- "treatment": "excluded from task count, artifact cluster file count, and line count calculations; committed as part of the task that triggers their generation",
386
- "rationale": "generated files do not represent independent authoring decisions"
387
- }
388
- ],
389
- "memory_policy": {
390
- "categories": [
391
- {
392
- "id": "empirical",
393
- "prefix": "empirical-",
394
- "description": "Empirically verified findings — observations and measurements that the project has confirmed through its own experimentation. Examples include runtime behavior observations, testing-derived structural facts, and operational measurements that cannot be inferred from documentation alone.\n"
395
- },
396
- {
397
- "id": "external",
398
- "prefix": "external-",
399
- "description": "External constraints and references — requirements imposed by upstream dependencies, third-party API limits, vendor documentation quotations, and any knowledge that originates outside the project. May become stale if the upstream source changes.\n"
400
- },
401
- {
402
- "id": "pattern",
403
- "prefix": "pattern-",
404
- "description": "Tactical operational patterns — recurring cycle-level recipes, routing heuristics, and procedural knowledge developed through work on the project. Architectural or design-level patterns belong in .nexus/context/, not here.\n"
405
- }
406
- ],
407
- "naming": {
408
- "pattern": "^[a-z0-9][a-z0-9-]*\\.md$",
409
- "description": "Memory filenames are lowercase kebab-case .md files. The name should be a descriptive topic of 2–4 words. An optional category prefix from the categories section above may precede the topic. Version numbers and dates must not appear in filenames — temporal information belongs inside the file.\n",
410
- "optional_prefix": true
411
- },
412
- "access_tracking": {
413
- "observation_primitive": "file_read",
414
- "scope": ".nexus/memory/",
415
- "description": "Harnesses observe the moment an agent reads a memory file. Save events, directory scans (glob, grep), and mentions of the path in prose are not observation events. The set of events observed determines the accumulated access record.\n",
416
- "information_accumulated": [
417
- {
418
- "name": "last_access_timestamp",
419
- "meaning": "Wall-clock time of the most recent read event. Field name is harness-local; the canonical schema for storage is conformance/state-schemas/memory-access.schema.json.\n"
420
- },
421
- {
422
- "name": "access_count",
423
- "meaning": "Cumulative count of read events observed for this file since tracking began.\n"
424
- },
425
- {
426
- "name": "last_reader_identity",
427
- "meaning": "Identifier of the most recent reader (agent id or equivalent). Harness-local value domain.\n"
428
- }
429
- ],
430
- "storage_contract_reference": "conformance/state-schemas/memory-access.schema.json"
431
- },
432
- "forgetting": {
433
- "manual_gate_default": true,
434
- "description": "Manual gc (triggered by the [m:gc] tag) is the default forgetting path. Automatic deletion is opt-in per consumer and never runs without explicit enablement.\n",
435
- "automatic_deletion_structure": {
436
- "principle": "minimum_three_signal_intersection",
437
- "description": "If a consumer enables automatic deletion, the policy must require the simultaneous satisfaction of at least three independent signals — for example, elapsed time since last access, cycles since last read, and cumulative access count. Single-signal automatic deletion is prohibited. The specific signal thresholds are consumer-local and must be set to match the project's cycle cadence.\n"
438
- },
439
- "recoverable_deletion_requirement": "git_commit",
440
- "recoverable_deletion_description": "Every memory file deletion must be recorded as a git commit. The commit message should include a recovery path that allows the file to be reconstructed via git history. Specific commit message format is consumer-local.\n"
441
- },
442
- "merge": {
443
- "principle": "merge_before_create",
444
- "description": "When a new memory save candidate substantively overlaps an existing file in topic and category, merging the new content into the existing file is preferred over creating a new file. Specific overlap-detection criteria (for example, keyword match thresholds) are consumer-local.\n"
445
- }
446
- }
447
- }
448
- }
package/schema/README.md DELETED
@@ -1,69 +0,0 @@
1
- # nexus-core schemas
2
-
3
- JSON Schema (draft 2020-12) files used by the `scripts/validate.ts` pipeline.
4
-
5
- > **Note**: Consumers may use these schemas for optional runtime validation, but are not required to. The primary purpose is CI-side validation during bootstrap and subsequent edits.
6
-
7
- ## Files
8
-
9
- | File | Purpose |
10
- |---|---|
11
- | `common.schema.json` | Shared `$defs` (`id` pattern, `description`, `harnessId` enum) reused across other schemas |
12
- | `agent.schema.json` | Validates `agents/{id}/meta.yml` — 9 fields, 7 required |
13
- | `skill.schema.json` | Validates `skills/{id}/meta.yml` — 6 fields, 4 required |
14
- | `vocabulary.schema.json` | Validates `vocabulary/*.yml` — 4 file types via internal `$defs` (`capabilityFile`, `categoryFile`, `resumeTierFile`, `tagFile`) |
15
- | `manifest.schema.json` | Validates the generated `manifest.json` — structural snapshot of all agents, skills, and vocabulary |
16
-
17
- ## $ref Structure
18
-
19
- ```
20
- ┌──────────────────────────┐
21
- │ common.schema.json │
22
- │ $defs: │
23
- │ id │
24
- │ description │
25
- │ harnessId │
26
- └──────────┬───────────────┘
27
- │ (referenced by)
28
- ┌─────────┼─────────┬────────────────┐
29
- ▼ ▼ ▼ ▼
30
- ┌──────────┐ ┌────────┐ ┌──────────────┐ ┌───────────────┐
31
- │ agent. │ │ skill. │ │ vocabulary. │ │ manifest. │
32
- │ schema │ │ schema │ │ schema │ │ schema │
33
- │ │ │ │ │ │ │ │
34
- │ meta.yml │ │meta.yml│ │ 4 file types │ │ generated │
35
- │ 9 fields │ │6 fields│ │ via $defs │ │ snapshot │
36
- └──────────┘ └────────┘ └──────────────┘ └───────────────┘
37
- ```
38
-
39
- ## Validator Entry
40
-
41
- `scripts/lib/validate.ts` loads all 5 schemas via `ajv.addSchema()` and performs:
42
-
43
- 1. **G1 — Schema validation**: each `agents/{id}/meta.yml`, `skills/{id}/meta.yml`, and `vocabulary/*.yml` file is validated against the corresponding schema. Vocabulary files are routed by filename to a `$ref` map (e.g., `capabilities.yml` → `vocabulary.schema.json#/$defs/capabilityFile`).
44
-
45
- 2. **G2–G5 — Referential integrity**: cross-file reference checks (e.g., `agent.capabilities` entries must exist in `capabilities.yml`). These checks are outside JSON Schema's scope and are implemented as custom validation in `scripts/lib/validate.ts`.
46
-
47
- 3. **Manifest generation**: on successful G1–G5, the validator reads validated assets and writes `manifest.json` at the repository root, then validates the manifest against `manifest.schema.json`. Each agent and skill entry in the manifest includes a `body_hash` field (`sha256:<hex>`) computed from the corresponding `body.md` file.
48
-
49
- ## Polymorphic Tag Schema
50
-
51
- `vocabulary.schema.json#/$defs/tagEntry` uses `if-then-else` (draft 2020-12) to model the polymorphic `tags.yml` entries:
52
-
53
- - `type: skill` — the `then` branch requires the `skill` field
54
- - `type: inline_action` — the `else` branch requires the `handler` field
55
- - `variants` is declared in `properties` alongside the `if-then-else`, making it available on both types without restriction
56
-
57
- This avoids OpenAPI-style `discriminator` (non-standard for JSON Schema core) and keeps the schema portable across validators.
58
-
59
- ## Principles
60
-
61
- - **Strict by default**: every object uses `additionalProperties: false`. Typos like `alais_ko` produce an immediate error.
62
- - **Kebab-case ids**: `^[a-z][a-z0-9-]*$` enforced via `common.schema.json#/$defs/id`.
63
- - **snake_case YAML keys**: consistent with existing fields `alias_ko`, `resume_tier`, `harness_mapping`.
64
- - **draft 2020-12**: `$schema` declared in every file; AJV 8 requires `ajv.addMetaSchema(draft2020)` before loading these schemas.
65
-
66
- ## Reference
67
-
68
- - `.nexus/context/boundaries.md` §schema/*.json — canonical file list and field definitions
69
- - Plan session #2 Issue #4 (2026-04-11) — design decisions for polymorphic tag schema and strict mode
@@ -1,23 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "agent.schema.json",
4
- "title": "Nexus Agent meta.yml",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": ["id", "name", "description", "category", "capabilities", "resume_tier", "model_tier"],
8
- "properties": {
9
- "id": { "$ref": "common.schema.json#/$defs/id" },
10
- "name": { "type": "string", "minLength": 1 },
11
- "alias_ko": { "type": "string" },
12
- "description": { "$ref": "common.schema.json#/$defs/description" },
13
- "task": { "type": "string" },
14
- "category": { "type": "string", "enum": ["how", "do", "check"] },
15
- "capabilities": {
16
- "type": "array",
17
- "minItems": 0,
18
- "items": { "$ref": "common.schema.json#/$defs/id" }
19
- },
20
- "resume_tier": { "type": "string", "enum": ["persistent", "bounded", "ephemeral"] },
21
- "model_tier": { "type": "string", "enum": ["high", "standard"] }
22
- }
23
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "common.schema.json",
4
- "title": "nexus-core common definitions",
5
- "description": "Shared $defs used by agent/skill/vocabulary/manifest schemas",
6
- "$defs": {
7
- "id": {
8
- "type": "string",
9
- "pattern": "^[a-z][a-z0-9_-]*$",
10
- "description": "Kebab-case or snake_case identifier. Lowercase letters, digits, hyphens, underscores."
11
- },
12
- "description": {
13
- "type": "string",
14
- "minLength": 1
15
- }
16
- }
17
- }
@@ -1,78 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "manifest.schema.json",
4
- "title": "nexus-core manifest.json",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": ["nexus_core_version", "nexus_core_commit", "schema_contract_version", "agents", "skills", "vocabulary"],
8
- "properties": {
9
- "nexus_core_version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[a-z0-9.-]+)?$" },
10
- "nexus_core_commit": { "type": "string", "pattern": "^[a-f0-9]{7,40}$" },
11
- "schema_contract_version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+$" },
12
- "agents": {
13
- "type": "array",
14
- "items": {
15
- "type": "object",
16
- "additionalProperties": false,
17
- "required": ["id", "name", "description", "category", "capabilities", "resume_tier", "model_tier", "body_hash"],
18
- "properties": {
19
- "id": { "$ref": "common.schema.json#/$defs/id" },
20
- "name": { "type": "string" },
21
- "alias_ko": { "type": "string" },
22
- "description": { "type": "string" },
23
- "task": { "type": "string" },
24
- "category": { "type": "string" },
25
- "capabilities": { "type": "array", "items": { "type": "string" } },
26
- "resume_tier": { "type": "string" },
27
- "model_tier": { "type": "string" },
28
- "body_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
29
- }
30
- }
31
- },
32
- "skills": {
33
- "type": "array",
34
- "items": {
35
- "type": "object",
36
- "additionalProperties": false,
37
- "required": ["id", "name", "description", "body_hash"],
38
- "properties": {
39
- "id": { "$ref": "common.schema.json#/$defs/id" },
40
- "name": { "type": "string" },
41
- "description": { "type": "string" },
42
- "summary": { "type": "string", "minLength": 10, "maxLength": 120 },
43
- "triggers": { "type": "array", "items": { "type": "string" } },
44
- "harness_docs_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } },
45
- "alias_ko": { "type": "string" },
46
- "manual_only": { "type": "boolean" },
47
- "body_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
48
- },
49
- "allOf": [
50
- {
51
- "if": {
52
- "properties": { "manual_only": { "const": true } },
53
- "required": ["manual_only"]
54
- },
55
- "then": {},
56
- "else": {
57
- "required": ["triggers"]
58
- }
59
- }
60
- ]
61
- }
62
- },
63
- "vocabulary": {
64
- "type": "object",
65
- "additionalProperties": false,
66
- "required": ["capabilities", "categories", "resume_tiers", "tags", "invocations", "task_exceptions", "memory_policy"],
67
- "properties": {
68
- "capabilities": { "type": "array" },
69
- "categories": { "type": "array" },
70
- "resume_tiers": { "type": "array" },
71
- "tags": { "type": "array" },
72
- "invocations": { "type": "array" },
73
- "task_exceptions": { "type": "array" },
74
- "memory_policy": { "type": "object" }
75
- }
76
- }
77
- }
78
- }