@moreih29/nexus-core 0.11.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 -852
  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 -449
  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 -794
  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 -9
  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
@@ -0,0 +1,110 @@
1
+ # Claude Code Plugin Scaffold — nexus-core
2
+
3
+ 이 디렉터리는 `nexus-core init --harness=claude` 명령으로 복사되는 Claude Code 플러그인 스타터입니다.
4
+
5
+ ## 개요
6
+
7
+ nexus-core가 공통 에이전트·스킬·훅 자산을 이 플러그인 repo에 동기화(sync)합니다.
8
+ 플러그인 repo 저자는 동기화된 자산을 커스터마이즈하고 배포만 담당합니다.
9
+
10
+ ## 디렉터리 구조
11
+
12
+ ```
13
+ my-claude-plugin/
14
+ ├── .claude-plugin/
15
+ │ ├── plugin.json # 플러그인 매니페스트 (Template — 처음 한 번만 생성)
16
+ │ └── marketplace.json # 마켓플레이스 카탈로그 (Template — 처음 한 번만 생성)
17
+ ├── agents/ # Managed — nexus-core sync가 덮어씀
18
+ │ └── <agent-name>.md
19
+ ├── skills/ # Managed — nexus-core sync가 덮어씀
20
+ │ └── <skill-name>/
21
+ │ └── SKILL.md
22
+ ├── hooks/ # nexus-core build-hooks가 생성 (sync 포함)
23
+ │ └── hooks.json
24
+ ├── .mcp.json # MCP 서버 설정 (수동 관리)
25
+ ├── package.json
26
+ └── .github/
27
+ └── workflows/
28
+ └── build.yml
29
+ ```
30
+
31
+ **Managed** 경로(`agents/`, `skills/`)는 `nexus-core sync`가 항상 최신 상태로 유지합니다.
32
+ **Template** 경로(`.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json`)는 처음 한 번만 생성됩니다. 이후 편집 내용은 보존됩니다(`--force` 없이는 덮어쓰지 않음).
33
+
34
+ ## 빠른 시작
35
+
36
+ ### 1. 이 템플릿으로 새 플러그인 생성
37
+
38
+ ```bash
39
+ bunx @moreih29/nexus-core init --harness=claude --target=./my-claude-plugin
40
+ cd my-claude-plugin
41
+ bun install
42
+ ```
43
+
44
+ ### 2. 자산 동기화
45
+
46
+ ```bash
47
+ bunx @moreih29/nexus-core sync --harness=claude --target=./
48
+ ```
49
+
50
+ 동기화 후 생성되는 파일:
51
+
52
+ - `agents/<name>.md` × N
53
+ - `skills/<name>/SKILL.md` × N
54
+ - `.claude-plugin/plugin.json` (최초 생성 시)
55
+ - `.claude-plugin/marketplace.json` (최초 생성 시)
56
+
57
+ ### 3. 변경 내용 커밋
58
+
59
+ ```bash
60
+ git add agents/ skills/ .claude-plugin/ hooks/ .mcp.json
61
+ git commit -m "Sync nexus-core assets"
62
+ ```
63
+
64
+ ## 플러그인 매니페스트 커스터마이즈
65
+
66
+ `.claude-plugin/plugin.json`에서 플러그인 이름, 버전, 설명을 수정하세요.
67
+
68
+ ```json
69
+ {
70
+ "name": "my-claude-plugin",
71
+ "version": "1.0.0",
72
+ "description": "My Claude Code plugin powered by nexus-core"
73
+ }
74
+ ```
75
+
76
+ `name`은 kebab-case여야 합니다. `version`은 Claude Code의 업데이트 감지에 사용됩니다.
77
+
78
+ ## 배포
79
+
80
+ Claude Code 마켓플레이스에 배포하려면 마켓플레이스 카탈로그 저장소에 다음 형식으로 등록합니다.
81
+
82
+ ```json
83
+ {
84
+ "source": "github",
85
+ "repo": "your-org/my-claude-plugin",
86
+ "ref": "v1.0.0"
87
+ }
88
+ ```
89
+
90
+ 개발 중에는 `claude --plugin-dir ./`로 마켓플레이스 없이 로컬 로드할 수 있습니다.
91
+
92
+ ## CLI 참조
93
+
94
+ ```bash
95
+ bunx @moreih29/nexus-core sync --harness=claude --target=<dir> # 자산 동기화
96
+ bunx @moreih29/nexus-core sync --harness=claude --dry-run # 변경될 파일 목록만 출력 (쓰기 없음)
97
+ bunx @moreih29/nexus-core sync --harness=claude --force # Template 파일도 강제 덮어쓰기
98
+ bunx @moreih29/nexus-core sync --harness=claude --strict # Managed 파일의 미커밋 변경 시 오류
99
+ bunx @moreih29/nexus-core sync --harness=claude --only=<name> # 특정 에이전트/스킬만 동기화
100
+ bunx @moreih29/nexus-core list # 사용 가능한 에이전트·스킬·훅 목록
101
+ bunx @moreih29/nexus-core validate # 자산 frontmatter 및 YAML 검증
102
+ ```
103
+
104
+ 전역 설치(`bun add -g @moreih29/nexus-core`) 환경에서는 `nexus-core <cmd>` 형태로도 사용할 수 있습니다.
105
+
106
+ ## 주의사항
107
+
108
+ - `agents/`, `skills/` 내 파일을 직접 편집하지 마세요. 다음 sync 시 덮어씁니다.
109
+ - 플러그인 전용 커스텀 에이전트는 `agents/` 외 별도 경로에 두고 `plugin.json`에서 참조하세요.
110
+ - `.claude-plugin/plugin.json`의 `name` 필드 변경 시 마켓플레이스 등록과 일치해야 합니다.
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "<my-claude-plugin>",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code plugin powered by nexus-core",
5
+ "private": true,
6
+ "scripts": {
7
+ "sync": "bunx @moreih29/nexus-core sync --harness=claude --target=./",
8
+ "sync:dry": "bunx @moreih29/nexus-core sync --harness=claude --target=./ --dry-run",
9
+ "build": "bun run sync",
10
+ "validate": "bunx @moreih29/nexus-core validate",
11
+ "list": "bunx @moreih29/nexus-core list"
12
+ },
13
+ "devDependencies": {
14
+ "@moreih29/nexus-core": "^0.13.0"
15
+ }
16
+ }
@@ -0,0 +1,51 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ sync-verify:
11
+ name: Verify nexus-core sync
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: oven-sh/setup-bun@v2
17
+ with:
18
+ bun-version: latest
19
+
20
+ - name: Install dependencies
21
+ run: bun install
22
+
23
+ - name: Run sync
24
+ run: bunx @moreih29/nexus-core sync --harness=codex --target=./
25
+
26
+ - name: Check for uncommitted changes
27
+ run: |
28
+ git diff --exit-code || (
29
+ echo "Sync produced uncommitted changes. Run 'bun run sync' and commit the result."
30
+ exit 1
31
+ )
32
+
33
+ - name: Validate assets
34
+ run: bunx @moreih29/nexus-core validate
35
+
36
+ - name: Verify plugin manifest
37
+ run: |
38
+ test -f plugin/.codex-plugin/plugin.json || (
39
+ echo "plugin/.codex-plugin/plugin.json not found"
40
+ exit 1
41
+ )
42
+ echo "Plugin manifest present"
43
+ cat plugin/.codex-plugin/plugin.json
44
+
45
+ - name: Verify install config fragment
46
+ run: |
47
+ test -f install/config.fragment.toml || (
48
+ echo "install/config.fragment.toml not found — run 'bun run sync' to generate"
49
+ exit 1
50
+ )
51
+ echo "Install config fragment present"
@@ -0,0 +1,147 @@
1
+ # Codex Plugin Scaffold — nexus-core
2
+
3
+ 이 디렉터리는 `nexus-core init --harness=codex` 명령으로 복사되는 Codex CLI 플러그인 스타터입니다.
4
+
5
+ ## 개요
6
+
7
+ nexus-core가 공통 스킬·에이전트 자산을 이 플러그인 repo에 동기화(sync)합니다.
8
+ Codex 플러그인은 `.codex-plugin/plugin.json`을 진입점으로 하는 폴더 단위로 배포됩니다.
9
+
10
+ Codex의 멀티 에이전트 인프라는 **플러그인 시스템과 별개**입니다. 에이전트를 실제로 활성화하려면
11
+ install 시점에 `~/.codex/config.toml`의 `[agents.*]` 테이블과 TOML 파일을 user scope에 배치해야 합니다.
12
+
13
+ ## 디렉터리 구조
14
+
15
+ ```
16
+ my-codex-plugin/
17
+ ├── plugin/ # Plugin spec — 마켓플레이스 설치 단위
18
+ │ ├── .codex-plugin/
19
+ │ │ └── plugin.json # Managed — nexus-core sync가 덮어씀
20
+ │ └── skills/ # Managed — nexus-core sync가 덮어씀
21
+ │ └── <skill-name>/
22
+ │ └── SKILL.md
23
+ ├── agents/ # Managed — native agent 설치 재료 (plugin spec 일부가 아님)
24
+ │ └── <agent-name>.toml # install 명령이 ~/.codex/agents/로 복사
25
+ ├── prompts/ # Managed — 에이전트 프롬프트 Markdown
26
+ │ └── <agent-name>.md
27
+ ├── install/
28
+ │ ├── config.fragment.toml # Managed — ~/.codex/config.toml에 병합할 스니펫
29
+ │ └── AGENTS.fragment.md # Managed — AGENTS.md에 병합할 primary agent 프롬프트
30
+ ├── package.json
31
+ └── .github/
32
+ └── workflows/
33
+ └── build.yml
34
+ ```
35
+
36
+ **Managed** 경로는 `nexus-core sync`가 항상 최신 상태로 유지합니다.
37
+
38
+ > **Plugin spec vs. native agent 구분**
39
+ >
40
+ > Codex의 플러그인 시스템(`.codex-plugin/plugin.json` + `skills/`)과 native agent 시스템(`config.toml`의 `[agents.*]`)은 **별개**입니다.
41
+ >
42
+ > - `plugin/` 디렉터리: 마켓플레이스에 등록되는 plugin spec. `skills/<name>/SKILL.md`가 자산 컨테이너입니다.
43
+ > 플러그인 spec 상에 `agents/<name>.toml` 폴더는 존재하지 않습니다.
44
+ > - `agents/` 디렉터리: native agent 활성화용 TOML 파일. install 명령이 `~/.codex/agents/`로 복사하는 **설치 재료**입니다.
45
+ > 이 폴더의 파일은 plugin spec의 일부가 아닙니다.
46
+ >
47
+ > 에이전트를 실제로 활성화하려면 install 단계에서 `agents/*.toml`을 `~/.codex/agents/`에 배치하고,
48
+ > `config.fragment.toml`을 `~/.codex/config.toml`에 병합해야 합니다.
49
+
50
+ ## 빠른 시작
51
+
52
+ ### 1. 이 템플릿으로 새 플러그인 생성
53
+
54
+ ```bash
55
+ bunx @moreih29/nexus-core init --harness=codex --target=./my-codex-plugin
56
+ cd my-codex-plugin
57
+ bun install
58
+ ```
59
+
60
+ ### 2. 자산 동기화
61
+
62
+ ```bash
63
+ bunx @moreih29/nexus-core sync --harness=codex --target=./
64
+ ```
65
+
66
+ 동기화 후 생성되는 파일:
67
+
68
+ - `plugin/.codex-plugin/plugin.json` — 플러그인 매니페스트
69
+ - `plugin/skills/<name>/SKILL.md` × N
70
+ - `agents/<name>.toml` × N — `[agents.<id>]` 테이블 형식
71
+ - `prompts/<name>.md` × N — YAML frontmatter + 프롬프트 본문
72
+ - `install/config.fragment.toml` — `~/.codex/config.toml`에 병합할 스니펫
73
+ - `install/AGENTS.fragment.md` — `AGENTS.md`에 병합할 primary agent 프롬프트 (mode: primary agent 존재 시)
74
+
75
+ ### 3. 변경 내용 커밋
76
+
77
+ ```bash
78
+ git add plugin/ agents/ prompts/ install/
79
+ git commit -m "Sync nexus-core assets"
80
+ ```
81
+
82
+ ## 컨슈머 install 흐름
83
+
84
+ Codex 에이전트는 user scope(`~/.codex/`)에 직접 배치해야 활성화됩니다.
85
+ 플러그인 repo의 install 명령(또는 스크립트)이 이 작업을 수행합니다.
86
+
87
+ ```bash
88
+ # 예: install.sh
89
+ cat install/config.fragment.toml >> ~/.codex/config.toml
90
+ cp -r agents/ ~/.codex/agents/
91
+ ```
92
+
93
+ `install/config.fragment.toml`에는 MCP 서버 등록이 포함됩니다.
94
+
95
+ ```toml
96
+ [mcp_servers.nx]
97
+ command = "nexus-mcp"
98
+ ```
99
+
100
+ **block-marker 패턴** 사용 권장: 기존 `~/.codex/config.toml`을 덮어쓰지 않고
101
+ `# BEGIN my-plugin` / `# END my-plugin` 마커 사이만 교체합니다.
102
+ oh-my-codex의 `omx setup` 패턴을 참고하세요.
103
+
104
+ ## 플러그인 마켓플레이스 등록
105
+
106
+ `~/.agents/plugins/marketplace.json`에 GitHub 소스 또는 로컬 경로로 등록합니다.
107
+
108
+ ```json
109
+ {
110
+ "plugins": [
111
+ {
112
+ "source": {
113
+ "type": "github",
114
+ "repo": "your-org/my-codex-plugin",
115
+ "ref": "v1.0.0",
116
+ "path": "plugin"
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ ## CLI 참조
124
+
125
+ ```bash
126
+ bunx @moreih29/nexus-core sync --harness=codex --target=<dir> # 자산 동기화
127
+ bunx @moreih29/nexus-core sync --harness=codex --dry-run # 변경될 파일 목록만 출력 (쓰기 없음)
128
+ bunx @moreih29/nexus-core sync --harness=codex --force # Template 경로 강제 덮어쓰기 확인
129
+ bunx @moreih29/nexus-core sync --harness=codex --strict # Managed 파일의 미커밋 변경 시 오류
130
+ bunx @moreih29/nexus-core list # 사용 가능한 에이전트·스킬 목록
131
+ ```
132
+
133
+ 전역 설치(`bun add -g @moreih29/nexus-core`) 환경에서는 `nexus-core <cmd>` 형태로도 사용할 수 있습니다.
134
+
135
+ ## Lead Agent AGENTS.md 머지
136
+
137
+ sync 결과물 중 `install/AGENTS.fragment.md`는 Codex의 AGENTS.md 자동 로드 경로에 주입할 lead agent body를 포함합니다.
138
+
139
+ Codex는 main agent의 system prompt를 주입하는 공식 경로를 제공하지 않으므로, nexus-core는 이 fragment를 사용자의 `AGENTS.md`에 자동으로 병합하지 않습니다. consumer가 직접 fragment 내용을 `~/.codex/AGENTS.md`(글로벌) 또는 레포 루트 `AGENTS.md`(프로젝트)에 복사해야 합니다. 마커(`<!-- nexus-core:lead:start -->` / `<!-- nexus-core:lead:end -->`)를 포함해 복사해야 이후 업데이트 시 구역을 정확히 교체할 수 있습니다.
140
+
141
+ 자세한 절차는 [`docs/consuming/codex-lead-merge.md`](../../consuming/codex-lead-merge.md)를 참조하세요.
142
+
143
+ ## 주의사항
144
+
145
+ - `plugin/`, `agents/`, `prompts/`, `install/` 내 파일을 직접 편집하지 마세요. 다음 sync 시 덮어씁니다.
146
+ - Codex native agent의 외부 TOML 파일 필드 구조는 공식 문서에 일부 미기재 영역이 있습니다. 실제 동작은 Codex 공식 사례를 병행 확인하세요.
147
+ - npm 기반 Codex 플러그인 설치는 공식 지원 여부가 확인되지 않았습니다. 로컬 경로 또는 GitHub 소스 방식을 사용하세요.
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "<my-codex-plugin>",
3
+ "version": "1.0.0",
4
+ "description": "Codex plugin powered by nexus-core",
5
+ "private": true,
6
+ "scripts": {
7
+ "sync": "bunx @moreih29/nexus-core sync --harness=codex --target=./",
8
+ "sync:dry": "bunx @moreih29/nexus-core sync --harness=codex --target=./ --dry-run",
9
+ "build": "bun run sync",
10
+ "validate": "bunx @moreih29/nexus-core validate",
11
+ "list": "bunx @moreih29/nexus-core list",
12
+ "install-plugin": "bash install/install.sh"
13
+ },
14
+ "devDependencies": {
15
+ "@moreih29/nexus-core": "^0.13.0"
16
+ }
17
+ }
@@ -0,0 +1,61 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ sync-verify:
11
+ name: Verify nexus-core sync
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: oven-sh/setup-bun@v2
17
+ with:
18
+ bun-version: latest
19
+
20
+ - name: Install dependencies
21
+ run: bun install
22
+
23
+ - name: Run sync
24
+ run: bunx @moreih29/nexus-core sync --harness=opencode --target=./
25
+
26
+ - name: Check for uncommitted changes
27
+ run: |
28
+ git diff --exit-code || (
29
+ echo "Sync produced uncommitted changes. Run 'bun run sync' and commit the result."
30
+ exit 1
31
+ )
32
+
33
+ - name: Type check
34
+ run: bun x tsc --noEmit
35
+
36
+ - name: Validate assets
37
+ run: bunx @moreih29/nexus-core validate
38
+
39
+ publish:
40
+ name: Publish to npm
41
+ runs-on: ubuntu-latest
42
+ needs: sync-verify
43
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - uses: oven-sh/setup-bun@v2
48
+ with:
49
+ bun-version: latest
50
+
51
+ - name: Install dependencies
52
+ run: bun install
53
+
54
+ - name: Run sync
55
+ run: bunx @moreih29/nexus-core sync --harness=opencode --target=./
56
+
57
+ # npm publish는 프로젝트 요구에 맞게 조정하세요 (예: changesets, semantic-release 등).
58
+ # - name: Publish
59
+ # run: npm publish --access public
60
+ # env:
61
+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,121 @@
1
+ # OpenCode Plugin Scaffold — nexus-core
2
+
3
+ 이 디렉터리는 `nexus-core init --harness=opencode` 명령으로 복사되는 OpenCode 플러그인 스타터입니다.
4
+
5
+ ## 개요
6
+
7
+ nexus-core가 공통 에이전트·스킬 자산을 이 플러그인 repo에 동기화(sync)합니다.
8
+ OpenCode 플러그인은 npm 패키지로 배포되며, 컨슈머의 `opencode.json`에 패키지명을 등록하면
9
+ OpenCode가 시작 시 자동으로 설치·로드합니다.
10
+
11
+ ## 디렉터리 구조
12
+
13
+ ```
14
+ my-opencode-plugin/
15
+ ├── src/
16
+ │ ├── index.ts # Managed — nexus-core sync가 덮어씀 (에이전트 re-export)
17
+ │ └── agents/ # Managed — nexus-core sync가 덮어씀
18
+ │ └── <agent-name>.ts
19
+ ├── .opencode/
20
+ │ └── skills/ # Managed — nexus-core sync가 덮어씀
21
+ │ └── <skill-name>/
22
+ │ └── SKILL.md
23
+ ├── opencode.json.fragment # Managed — opencode.json 병합용 에이전트 목록 스니펫
24
+ ├── package.json # Template — 처음 한 번만 생성
25
+ ├── tsconfig.json # 직접 관리
26
+ └── .github/
27
+ └── workflows/
28
+ └── build.yml
29
+ ```
30
+
31
+ **Managed** 경로(`src/`, `.opencode/skills/`, `opencode.json.fragment`)는 `nexus-core sync`가 항상 최신 상태로 유지합니다.
32
+ **Template** 경로(`package.json`)는 처음 한 번만 생성됩니다.
33
+
34
+ ## 빠른 시작
35
+
36
+ ### 1. 이 템플릿으로 새 플러그인 생성
37
+
38
+ ```bash
39
+ bunx @moreih29/nexus-core init --harness=opencode --target=./my-opencode-plugin
40
+ cd my-opencode-plugin
41
+ bun install
42
+ ```
43
+
44
+ ### 2. 자산 동기화
45
+
46
+ ```bash
47
+ bunx @moreih29/nexus-core sync --harness=opencode --target=./
48
+ ```
49
+
50
+ 동기화 후 생성되는 파일:
51
+
52
+ - `src/index.ts` — 에이전트 전체 re-export
53
+ - `src/agents/<name>.ts` × N — 각 에이전트 `AgentConfig` 객체
54
+ - `.opencode/skills/<name>/SKILL.md` × N
55
+ - `opencode.json.fragment` — 컨슈머 `opencode.json`에 병합할 `agents` 배열 스니펫
56
+
57
+ ### 3. 변경 내용 커밋
58
+
59
+ ```bash
60
+ git add src/ .opencode/ opencode.json.fragment
61
+ git commit -m "Sync nexus-core assets"
62
+ ```
63
+
64
+ ## 컨슈머 설치 안내
65
+
66
+ 플러그인을 사용하는 프로젝트의 `.opencode/opencode.json`에 패키지명을 추가합니다.
67
+
68
+ ```json
69
+ {
70
+ "plugin": ["@your-org/my-opencode-plugin"]
71
+ }
72
+ ```
73
+
74
+ OpenCode가 시작 시 Bun으로 자동 설치합니다. 캐시 위치: `~/.cache/opencode/node_modules/`.
75
+
76
+ 에이전트를 활성화하려면 `opencode.json.fragment`의 내용을 컨슈머의 `opencode.json`에 병합하거나,
77
+ `postinstall` 스크립트로 자동화하세요.
78
+
79
+ ```json
80
+ {
81
+ "agents": [
82
+ {
83
+ "id": "architect",
84
+ "module": "./node_modules/@your-org/my-opencode-plugin/src/agents/architect.js"
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ## package.json 커스터마이즈
91
+
92
+ `package.json`의 `name`과 `version`을 실제 npm 패키지명으로 변경하세요.
93
+
94
+ ```json
95
+ {
96
+ "name": "@your-org/my-opencode-plugin",
97
+ "version": "1.0.0",
98
+ "type": "module",
99
+ "main": "./src/index.ts"
100
+ }
101
+ ```
102
+
103
+ `"type": "module"`과 `"main": "./src/index.ts"`는 OpenCode가 TypeScript를 직접 로드하므로 변경하지 마세요.
104
+
105
+ ## CLI 참조
106
+
107
+ ```bash
108
+ bunx @moreih29/nexus-core sync --harness=opencode --target=<dir> # 자산 동기화
109
+ bunx @moreih29/nexus-core sync --harness=opencode --dry-run # 변경될 파일 목록만 출력 (쓰기 없음)
110
+ bunx @moreih29/nexus-core sync --harness=opencode --force # Template 파일도 강제 덮어쓰기
111
+ bunx @moreih29/nexus-core sync --harness=opencode --strict # Managed 파일의 미커밋 변경 시 오류
112
+ bunx @moreih29/nexus-core list # 사용 가능한 에이전트·스킬 목록
113
+ ```
114
+
115
+ 전역 설치(`bun add -g @moreih29/nexus-core`) 환경에서는 `nexus-core <cmd>` 형태로도 사용할 수 있습니다.
116
+
117
+ ## 주의사항
118
+
119
+ - `src/agents/`, `src/index.ts`, `.opencode/skills/`는 직접 편집하지 마세요. 다음 sync 시 덮어씁니다.
120
+ - OpenCode는 `plugin` 배열의 항목을 npm 패키지로 인식합니다. git URL 기반 설치의 공식 지원 여부는 확인되지 않았습니다.
121
+ - 플러그인 코드 훅(`session.created` 등)이 필요하면 `src/plugin.ts`를 직접 추가하고 `package.json`의 `main`을 해당 파일로 변경하세요.
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@your-org/my-opencode-plugin",
3
+ "version": "1.0.0",
4
+ "description": "OpenCode plugin powered by nexus-core",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "exports": {
8
+ ".": "./src/index.ts"
9
+ },
10
+ "scripts": {
11
+ "sync": "bunx @moreih29/nexus-core sync --harness=opencode --target=./",
12
+ "sync:dry": "bunx @moreih29/nexus-core sync --harness=opencode --target=./ --dry-run",
13
+ "build": "bun run sync && tsc --noEmit",
14
+ "validate": "bunx @moreih29/nexus-core validate",
15
+ "list": "bunx @moreih29/nexus-core list"
16
+ },
17
+ "peerDependencies": {
18
+ "opencode": "*"
19
+ },
20
+ "devDependencies": {
21
+ "@moreih29/nexus-core": "^0.13.0",
22
+ "@opencode-ai/plugin": "*",
23
+ "typescript": "^5"
24
+ }
25
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@moreih29/nexus-core",
3
- "version": "0.11.0",
4
- "description": "Nexus ecosystem Authoring layer — canonical prompts, neutral metadata, and vocabulary shared by Nexus harnesses",
3
+ "version": "0.13.0",
4
+ "description": "Nexus ecosystem authoring layer — canonical agents/skills/hooks and 3-harness build pipeline (Claude Code, OpenCode, Codex)",
5
5
  "license": "MIT",
6
+ "type": "module",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/moreih29/nexus-core.git"
@@ -13,26 +14,22 @@
13
14
  },
14
15
  "exports": {
15
16
  ".": null,
16
- "./agents/*": "./agents/*",
17
- "./skills/*": "./skills/*",
18
- "./vocabulary/*": "./vocabulary/*",
19
- "./schema/*": "./schema/*",
20
- "./conformance/*": "./conformance/*",
17
+ "./agents/*": "./assets/agents/*",
18
+ "./skills/*": "./assets/skills/*",
21
19
  "./docs/*": "./docs/*",
22
- "./manifest.json": "./manifest.json"
20
+ "./mcp": "./dist/mcp/server.js",
21
+ "./assets/lsp-servers.json": "./assets/lsp-servers.json",
22
+ "./assets/schema/lsp-servers.schema.json": "./assets/schema/lsp-servers.schema.json"
23
23
  },
24
24
  "files": [
25
- "agents",
26
- "skills",
27
- "vocabulary",
28
- "schema",
29
- "conformance",
25
+ "assets",
30
26
  "docs",
31
27
  "scripts",
32
- "manifest.json"
28
+ "dist"
33
29
  ],
34
30
  "bin": {
35
- "nexus-validate-conformance": "./scripts/conformance-coverage.ts"
31
+ "nexus-mcp": "./dist/mcp/server.js",
32
+ "nexus-core": "./scripts/cli.ts"
36
33
  },
37
34
  "engines": {
38
35
  "node": ">=20"
@@ -42,18 +39,21 @@
42
39
  },
43
40
  "packageManager": "bun@1.3.12",
44
41
  "scripts": {
45
- "validate": "bun run scripts/validate.ts",
46
- "validate:conformance": "bun run scripts/conformance-coverage.ts",
42
+ "build": "tsc -p tsconfig.build.json",
43
+ "clean": "rm -rf dist",
44
+ "test": "bun test src/ scripts/",
47
45
  "typecheck": "tsc --noEmit",
48
- "prepublishOnly": "bun run validate"
46
+ "prepublishOnly": "bun run test"
49
47
  },
50
48
  "devDependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.0.0",
50
+ "@types/bun": "latest",
51
51
  "ajv": "^8",
52
- "ajv-formats": "^3",
53
52
  "ajv-errors": "^3",
54
- "yaml": "^2",
53
+ "ajv-formats": "^3",
55
54
  "tinyglobby": "^0.2",
56
55
  "typescript": "^5",
57
- "@types/bun": "latest"
56
+ "yaml": "^2",
57
+ "zod": "^3.23.0"
58
58
  }
59
59
  }