@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.
- package/README.md +48 -63
- package/assets/agents/architect/body.ko.md +177 -0
- package/{agents → assets/agents}/architect/body.md +16 -0
- package/assets/agents/designer/body.ko.md +125 -0
- package/{agents → assets/agents}/designer/body.md +16 -0
- package/assets/agents/engineer/body.ko.md +106 -0
- package/{agents → assets/agents}/engineer/body.md +14 -0
- package/assets/agents/lead/body.ko.md +70 -0
- package/assets/agents/lead/body.md +70 -0
- package/assets/agents/postdoc/body.ko.md +122 -0
- package/{agents → assets/agents}/postdoc/body.md +16 -0
- package/assets/agents/researcher/body.ko.md +137 -0
- package/{agents → assets/agents}/researcher/body.md +15 -0
- package/assets/agents/reviewer/body.ko.md +138 -0
- package/{agents → assets/agents}/reviewer/body.md +15 -0
- package/assets/agents/strategist/body.ko.md +116 -0
- package/{agents → assets/agents}/strategist/body.md +16 -0
- package/assets/agents/tester/body.ko.md +195 -0
- package/{agents → assets/agents}/tester/body.md +15 -0
- package/assets/agents/writer/body.ko.md +122 -0
- package/{agents → assets/agents}/writer/body.md +14 -0
- package/assets/capability-matrix.yml +198 -0
- package/assets/hooks/agent-bootstrap/handler.test.ts +368 -0
- package/assets/hooks/agent-bootstrap/handler.ts +119 -0
- package/assets/hooks/agent-bootstrap/meta.yml +10 -0
- package/assets/hooks/agent-finalize/handler.test.ts +368 -0
- package/assets/hooks/agent-finalize/handler.ts +76 -0
- package/assets/hooks/agent-finalize/meta.yml +10 -0
- package/assets/hooks/capability-matrix.yml +313 -0
- package/assets/hooks/post-tool-telemetry/handler.test.ts +302 -0
- package/assets/hooks/post-tool-telemetry/handler.ts +49 -0
- package/assets/hooks/post-tool-telemetry/meta.yml +11 -0
- package/assets/hooks/prompt-router/handler.test.ts +801 -0
- package/assets/hooks/prompt-router/handler.ts +261 -0
- package/assets/hooks/prompt-router/meta.yml +11 -0
- package/assets/hooks/session-init/handler.test.ts +274 -0
- package/assets/hooks/session-init/handler.ts +30 -0
- package/assets/hooks/session-init/meta.yml +9 -0
- package/assets/lsp-servers.json +55 -0
- package/assets/schema/lsp-servers.schema.json +67 -0
- package/assets/skills/nx-init/body.ko.md +197 -0
- package/{skills → assets/skills}/nx-init/body.md +11 -0
- package/assets/skills/nx-plan/body.ko.md +361 -0
- package/{skills → assets/skills}/nx-plan/body.md +13 -0
- package/assets/skills/nx-run/body.ko.md +161 -0
- package/{skills → assets/skills}/nx-run/body.md +11 -0
- package/assets/skills/nx-sync/body.ko.md +92 -0
- package/{skills → assets/skills}/nx-sync/body.md +10 -0
- package/assets/tools/tool-name-map.yml +353 -0
- package/dist/hooks/opencode-mount.d.ts +35 -0
- package/dist/hooks/opencode-mount.d.ts.map +1 -0
- package/dist/hooks/opencode-mount.js +332 -0
- package/dist/hooks/opencode-mount.js.map +1 -0
- package/dist/hooks/runtime.d.ts +37 -0
- package/dist/hooks/runtime.d.ts.map +1 -0
- package/dist/hooks/runtime.js +274 -0
- package/dist/hooks/runtime.js.map +1 -0
- package/dist/hooks/types.d.ts +196 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +85 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/lsp/cache.d.ts +9 -0
- package/dist/lsp/cache.d.ts.map +1 -0
- package/dist/lsp/cache.js +216 -0
- package/dist/lsp/cache.js.map +1 -0
- package/dist/lsp/client.d.ts +24 -0
- package/dist/lsp/client.d.ts.map +1 -0
- package/dist/lsp/client.js +166 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/detect.d.ts +77 -0
- package/dist/lsp/detect.d.ts.map +1 -0
- package/dist/lsp/detect.js +116 -0
- package/dist/lsp/detect.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +34 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/artifact.d.ts +4 -0
- package/dist/mcp/tools/artifact.d.ts.map +1 -0
- package/dist/mcp/tools/artifact.js +36 -0
- package/dist/mcp/tools/artifact.js.map +1 -0
- package/dist/mcp/tools/history.d.ts +3 -0
- package/dist/mcp/tools/history.d.ts.map +1 -0
- package/dist/mcp/tools/history.js +29 -0
- package/dist/mcp/tools/history.js.map +1 -0
- package/dist/mcp/tools/lsp.d.ts +13 -0
- package/dist/mcp/tools/lsp.d.ts.map +1 -0
- package/dist/mcp/tools/lsp.js +225 -0
- package/dist/mcp/tools/lsp.js.map +1 -0
- package/dist/mcp/tools/plan.d.ts +3 -0
- package/dist/mcp/tools/plan.d.ts.map +1 -0
- package/dist/mcp/tools/plan.js +317 -0
- package/dist/mcp/tools/plan.js.map +1 -0
- package/dist/mcp/tools/task.d.ts +3 -0
- package/dist/mcp/tools/task.d.ts.map +1 -0
- package/dist/mcp/tools/task.js +252 -0
- package/dist/mcp/tools/task.js.map +1 -0
- package/dist/shared/invocations.d.ts +74 -0
- package/dist/shared/invocations.d.ts.map +1 -0
- package/dist/shared/invocations.js +247 -0
- package/dist/shared/invocations.js.map +1 -0
- package/dist/shared/json-store.d.ts +37 -0
- package/dist/shared/json-store.d.ts.map +1 -0
- package/dist/shared/json-store.js +163 -0
- package/dist/shared/json-store.js.map +1 -0
- package/dist/shared/mcp-utils.d.ts +3 -0
- package/dist/shared/mcp-utils.d.ts.map +1 -0
- package/dist/shared/mcp-utils.js +6 -0
- package/dist/shared/mcp-utils.js.map +1 -0
- package/dist/shared/paths.d.ts +21 -0
- package/dist/shared/paths.d.ts.map +1 -0
- package/dist/shared/paths.js +81 -0
- package/dist/shared/paths.js.map +1 -0
- package/dist/shared/tool-log.d.ts +8 -0
- package/dist/shared/tool-log.d.ts.map +1 -0
- package/dist/shared/tool-log.js +22 -0
- package/dist/shared/tool-log.js.map +1 -0
- package/dist/types/state.d.ts +862 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/state.js +66 -0
- package/dist/types/state.js.map +1 -0
- package/docs/consuming/codex-lead-merge.md +106 -0
- package/docs/plugin-guide.md +360 -0
- package/docs/plugin-template/claude/.github/workflows/build.yml +60 -0
- package/docs/plugin-template/claude/README.md +110 -0
- package/docs/plugin-template/claude/package.json +16 -0
- package/docs/plugin-template/codex/.github/workflows/build.yml +51 -0
- package/docs/plugin-template/codex/README.md +147 -0
- package/docs/plugin-template/codex/package.json +17 -0
- package/docs/plugin-template/opencode/.github/workflows/build.yml +61 -0
- package/docs/plugin-template/opencode/README.md +121 -0
- package/docs/plugin-template/opencode/package.json +25 -0
- package/package.json +21 -21
- package/scripts/build-agents.test.ts +1279 -0
- package/scripts/build-agents.ts +978 -0
- package/scripts/build-hooks.test.ts +1385 -0
- package/scripts/build-hooks.ts +584 -0
- package/scripts/cli.test.ts +367 -0
- package/scripts/cli.ts +547 -0
- package/agents/architect/meta.yml +0 -13
- package/agents/designer/meta.yml +0 -13
- package/agents/engineer/meta.yml +0 -11
- package/agents/postdoc/meta.yml +0 -13
- package/agents/researcher/meta.yml +0 -12
- package/agents/reviewer/meta.yml +0 -12
- package/agents/strategist/meta.yml +0 -13
- package/agents/tester/meta.yml +0 -12
- package/agents/writer/meta.yml +0 -11
- package/conformance/README.md +0 -311
- package/conformance/examples/plan.extension.schema.example.json +0 -25
- package/conformance/lifecycle/README.md +0 -48
- package/conformance/lifecycle/agent-complete.json +0 -44
- package/conformance/lifecycle/agent-resume.json +0 -43
- package/conformance/lifecycle/agent-spawn.json +0 -36
- package/conformance/lifecycle/memory-access-record.json +0 -27
- package/conformance/lifecycle/session-end.json +0 -48
- package/conformance/scenarios/full-plan-cycle.json +0 -147
- package/conformance/scenarios/task-deps-ordering.json +0 -95
- package/conformance/schema/fixture.schema.json +0 -354
- package/conformance/state-schemas/agent-tracker.schema.json +0 -63
- package/conformance/state-schemas/history.schema.json +0 -134
- package/conformance/state-schemas/memory-access.schema.json +0 -36
- package/conformance/state-schemas/plan.schema.json +0 -77
- package/conformance/state-schemas/tasks.schema.json +0 -98
- package/conformance/tools/artifact-write.json +0 -97
- package/conformance/tools/context.json +0 -172
- package/conformance/tools/history-search.json +0 -219
- package/conformance/tools/plan-decide.json +0 -139
- package/conformance/tools/plan-start.json +0 -81
- package/conformance/tools/plan-status.json +0 -127
- package/conformance/tools/plan-update.json +0 -341
- package/conformance/tools/task-add.json +0 -156
- package/conformance/tools/task-close.json +0 -161
- package/conformance/tools/task-list.json +0 -177
- package/conformance/tools/task-update.json +0 -167
- package/docs/behavioral-contracts.md +0 -145
- package/docs/consumer-implementation-guide.md +0 -840
- package/docs/memory-lifecycle-contract.md +0 -119
- package/docs/nexus-layout.md +0 -224
- package/docs/nexus-outputs-contract.md +0 -344
- package/docs/nexus-state-overview.md +0 -170
- package/docs/nexus-tools-contract.md +0 -438
- package/manifest.json +0 -448
- package/schema/README.md +0 -69
- package/schema/agent.schema.json +0 -23
- package/schema/common.schema.json +0 -17
- package/schema/manifest.schema.json +0 -78
- package/schema/memory-policy.schema.json +0 -98
- package/schema/skill.schema.json +0 -54
- package/schema/task-exceptions.schema.json +0 -40
- package/schema/vocabulary.schema.json +0 -167
- package/scripts/.gitkeep +0 -0
- package/scripts/conformance-coverage.ts +0 -466
- package/scripts/import-from-claude-nexus.ts +0 -403
- package/scripts/lib/frontmatter.ts +0 -71
- package/scripts/lib/lint.ts +0 -348
- package/scripts/lib/structure.ts +0 -159
- package/scripts/lib/validate.ts +0 -796
- package/scripts/validate.ts +0 -90
- package/skills/nx-init/meta.yml +0 -8
- package/skills/nx-plan/meta.yml +0 -10
- package/skills/nx-run/meta.yml +0 -8
- package/skills/nx-sync/meta.yml +0 -7
- package/vocabulary/capabilities.yml +0 -65
- package/vocabulary/categories.yml +0 -11
- package/vocabulary/invocations.yml +0 -147
- package/vocabulary/memory_policy.yml +0 -88
- package/vocabulary/resume-tiers.yml +0 -11
- package/vocabulary/tags.yml +0 -60
- package/vocabulary/task-exceptions.yml +0 -29
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nx-run
|
|
3
|
+
description: Execution — user-directed agent composition.
|
|
4
|
+
summary: "Execution — user-directed agent composition"
|
|
5
|
+
triggers:
|
|
6
|
+
- run
|
|
7
|
+
harness_docs_refs:
|
|
8
|
+
- resume_invocation
|
|
9
|
+
id: nx-run
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
사용자가 [run] 태그를 호출할 때 Lead가 따르는 실행 규범이다. 사용자 지시에 따라 서브에이전트를 동적으로 조합하고, intake부터 완료까지 전체 실행 파이프라인을 구동한다.
|
|
15
|
+
|
|
16
|
+
## Constraints
|
|
17
|
+
|
|
18
|
+
- NEVER modify files via shell commands (sed, echo redirection, heredoc, tee, etc.) — harness의 전용 파일 편집 primitive를 항상 사용한다 (gate 강제)
|
|
19
|
+
- NEVER terminate while pending tasks remain (Gate Stop nonstop)
|
|
20
|
+
- NEVER spawn a new branch without checking for main/master first
|
|
21
|
+
- MUST check tasks.json before executing — 없으면 먼저 plan을 생성한다
|
|
22
|
+
- MUST spawn subagents per-task based on owner field — 태스크 수 ≥ 2 또는 대상 파일 ≥ 2인 경우 Lead 단독으로 처리하지 않는다
|
|
23
|
+
- MUST NOT spawn parallel Engineers if their target files overlap — 겹치면 직렬화한다
|
|
24
|
+
- MUST call nx_task_close before completing the cycle — plan+tasks를 history.json에 아카이브한다
|
|
25
|
+
|
|
26
|
+
## Guidelines
|
|
27
|
+
|
|
28
|
+
## Flow
|
|
29
|
+
|
|
30
|
+
### Step 1: Intake (Lead)
|
|
31
|
+
|
|
32
|
+
- **사용자가 에이전트/방향을 지정** → 지시를 그대로 따른다.
|
|
33
|
+
- **[run] only (방향 없음)** → 진행 전 사용자에게 방향을 확인한다.
|
|
34
|
+
- 사용자가 SCOPE와 구성을 결정한다. 명시되지 않은 부분은 Lead가 채운다.
|
|
35
|
+
- **Branch Guard**: main/master에 있으면 진행 전에 태스크 유형에 맞는 브랜치를 생성한다 (prefix: `feat/`, `fix/`, `chore/`, `research/` 등 — Lead의 판단). 사용자 확인 없이 자동 생성한다.
|
|
36
|
+
- `tasks.json` 확인:
|
|
37
|
+
- **존재** → 읽고 Step 2로 진행한다.
|
|
38
|
+
- **없음** → `{{skill_activation skill=nx-plan mode=auto}}`를 자동 호출하여 tasks.json을 생성한다. 묻지 않는다 — `[run]`은 실행 의도를 내포한다. plan 생성 후 Step 2로 진행한다.
|
|
39
|
+
- tasks.json이 존재하면 `nx_plan_status`로 기존 결정을 확인한다.
|
|
40
|
+
|
|
41
|
+
### Step 1.5: TUI Progress
|
|
42
|
+
|
|
43
|
+
시각적 진행 추적(Ctrl+T)을 위해 태스크를 등록한다:
|
|
44
|
+
|
|
45
|
+
- **태스크 ≤ 10개**: 태스크당 `{{task_register label="<per-task label>" state=pending}}`
|
|
46
|
+
- **태스크 > 10개**: `plan_issue`로 그룹화하여 그룹당 `{{task_register label="<group label>" state=pending}}`
|
|
47
|
+
- 실행이 진행됨에 따라 `{{task_register label="<label>" state=in_progress}}` / `{{task_register label="<label>" state=completed}}`로 등록 항목을 업데이트한다
|
|
48
|
+
- **건너뛰는 경우**: non-TTY 환경 (VSCode, headless)
|
|
49
|
+
- **Known issue**: auto-compact 중 TUI가 멈출 수 있다 (#27919) — 디스크의 태스크 데이터는 정확하게 유지된다
|
|
50
|
+
|
|
51
|
+
### Step 2: Execute
|
|
52
|
+
|
|
53
|
+
- **tasks.json을 사용자에게 제시한다** — owner, deps, approach 요약과 함께 태스크 목록을 보여준다. 확인을 묻지 않고 즉시 진행한다.
|
|
54
|
+
- `owner` 필드에 따라 태스크를 실행한다:
|
|
55
|
+
- `owner: "lead"` → Lead가 직접 처리한다
|
|
56
|
+
- `owner: "engineer"`, `"researcher"`, `"writer"` 등 → owner 역할에 맞는 서브에이전트를 스폰한다
|
|
57
|
+
- `owner: "architect"`, `"tester"`, `"reviewer"` 등 → 해당 HOW/CHECK 서브에이전트를 스폰한다
|
|
58
|
+
- 각 서브에이전트에게 태스크의 `context`, `approach`, `acceptance`를 프롬프트로 전달한다.
|
|
59
|
+
- **병렬 실행**: 독립적인 태스크(대상 파일이 겹치지 않고, deps 없음)는 병렬로 스폰할 수 있다. 대상 파일이 공유되는 태스크는 직렬화해야 한다.
|
|
60
|
+
- **SubagentStop 에스컬레이션 체인**: 서브에이전트가 미완성 상태로 종료되면:
|
|
61
|
+
1. **Do/Check 실패** → 해당 HOW 에이전트를 스폰하여 (예: Engineer 실패 → Architect) 실패를 진단하고, 접근법을 검토하며, 조정안을 제안하게 한다.
|
|
62
|
+
2. **재위임** → HOW의 조정된 접근법을 적용하여 새 Do/Check 에이전트에게 재위임한다.
|
|
63
|
+
3. **HOW도 실패** → Lead가 진단 내용과 함께 사용자에게 실패를 보고하고 방향을 요청한다.
|
|
64
|
+
- 최대: 태스크당 HOW 진단 1회 + 재위임 1회. 이후에는 사용자에게 에스컬레이션한다.
|
|
65
|
+
- 관련 HOW 매핑: Engineer→Architect, Writer→Strategist, Researcher→Postdoc, Tester→Architect.
|
|
66
|
+
|
|
67
|
+
### Resume Dispatch Rule
|
|
68
|
+
|
|
69
|
+
각 태스크에 대해 Lead는 `owner`의 `resume_tier`에 따라 새로 스폰할지 resume할지 결정한다:
|
|
70
|
+
|
|
71
|
+
1. `agents/{owner}.md` frontmatter에서 `resume_tier`를 조회한다 (없으면 → `ephemeral`로 처리).
|
|
72
|
+
2. `ephemeral`이면 → 새로 스폰한다. 종료.
|
|
73
|
+
3. `bounded`이면 → tasks.json 이력을 확인한다: 동일 `owner`가 겹치는 대상 파일에 이전에 작업했는가? 그렇고 다른 에이전트의 개입 편집이 없으면 → resume 후보. 아니면 새로 스폰. resume 프롬프트에는 항상 "수정 전 대상 파일을 다시 읽을 것" 지시를 포함한다.
|
|
74
|
+
4. `persistent`이면 → 이번 실행에서 동일 에이전트가 이전에 작업했으면 기본적으로 resume한다. 크로스 태스크 재사용 허용.
|
|
75
|
+
5. resume 시도 전 harness의 resume 메커니즘이 사용 가능한지 확인한다. 사용 불가이면 오류를 발생시키지 않고 조용히 새로 스폰으로 폴백한다.
|
|
76
|
+
|
|
77
|
+
### Step 3: Verify (Lead + Check subagents)
|
|
78
|
+
|
|
79
|
+
**Lead**: 빌드 + E2E 통과/실패 여부를 확인한다.
|
|
80
|
+
|
|
81
|
+
**Tester — acceptance criteria 검증**:
|
|
82
|
+
- Tester는 tasks.json에서 완료된 각 태스크의 `acceptance` 필드를 읽는다
|
|
83
|
+
- 각 기준을 PASS/FAIL로 판정한다
|
|
84
|
+
- 태스크를 완료로 간주하려면 모든 기준을 통과해야 한다
|
|
85
|
+
- 기준 하나라도 실패 → Step 2 재작업 (태스크 재개)
|
|
86
|
+
- Tester 스폰 조건 (하나라도 해당되면):
|
|
87
|
+
- tasks.json에 `acceptance` 필드가 있는 태스크가 1개 이상
|
|
88
|
+
- 변경된 파일이 3개 이상
|
|
89
|
+
- 기존 테스트 파일이 수정됨
|
|
90
|
+
- 외부 API/DB 접근 코드가 변경됨
|
|
91
|
+
- 해당 영역의 실패 이력이 memory에 존재
|
|
92
|
+
|
|
93
|
+
**Reviewer — writer 산출물 검증**:
|
|
94
|
+
- Step 2에서 Writer가 산출물을 생성한 경우, Reviewer가 반드시 검증해야 한다
|
|
95
|
+
- Writer → Reviewer는 선택이 아닌 필수 페어링이다
|
|
96
|
+
- Reviewer 확인 항목: 사실 정확성, 소스 일관성, 문법/형식
|
|
97
|
+
|
|
98
|
+
- 문제 발견 시: 코드 문제 → Step 2 재작업; 설계 문제 → 재실행 전 nx-plan을 다시 수행한다.
|
|
99
|
+
|
|
100
|
+
### Step 4: Complete
|
|
101
|
+
|
|
102
|
+
순서대로 실행한다:
|
|
103
|
+
|
|
104
|
+
1. **nx-sync**: 이번 사이클에 코드 변경이 있었으면 `{{skill_activation skill=nx-sync}}`를 호출한다. Best effort — 실패해도 사이클 완료를 막지 않는다.
|
|
105
|
+
2. **nx_task_close**: 호출하여 plan+tasks를 history.json에 아카이브한다. `.nexus/history.json`이 업데이트된다.
|
|
106
|
+
3. **git commit**: 소스 변경, 빌드 artifact (`bridge/`, `scripts/`), `.nexus/history.json`, 수정된 `.nexus/memory/` 또는 `.nexus/context/`를 스테이징하고 커밋한다. 명시적인 `git add`에 경로를 지정한다 (`git add -A` 사용 금지). `Co-Authored-By`가 포함된 HEREDOC 커밋 메시지를 사용한다. 이렇게 하면 사이클의 history 아카이브가 코드 변경과 같은 커밋에 포함되어 1:1 사이클-커밋 매핑이 보장된다.
|
|
107
|
+
4. **Report**: 사용자에게 요약 보고 — 변경된 파일, 적용된 핵심 결정, 권장 다음 단계. Merge/push는 사용자의 결정이며 이 스킬의 SCOPE 밖이다.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Reference Framework
|
|
112
|
+
|
|
113
|
+
| Phase | Owner | Content |
|
|
114
|
+
|-------|-------|---------|
|
|
115
|
+
| 1. Intake | Lead | 의도 파악, 방향 확인, Branch Guard, tasks.json 확인 / 없으면 nx-plan 호출 |
|
|
116
|
+
| 2. Execute | Do subagents | owner별 태스크당 스폰, 위임 기준, 안전한 경우 병렬 실행 |
|
|
117
|
+
| 3. Verify | Lead + Check subagent | 빌드 확인, 품질 검증 |
|
|
118
|
+
| 4. Complete | Lead | nx-sync, nx_task_close, git commit, 보고 |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Structured Delegation
|
|
123
|
+
|
|
124
|
+
Lead가 서브에이전트에게 태스크를 위임할 때, 다음 형식으로 프롬프트를 구성한다:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
TASK: {specific deliverable}
|
|
128
|
+
|
|
129
|
+
CONTEXT:
|
|
130
|
+
- Current state: {relevant code/doc locations}
|
|
131
|
+
- Dependencies: {results from prior tasks}
|
|
132
|
+
- Prior decisions: {relevant decisions}
|
|
133
|
+
- Target files: {file path list}
|
|
134
|
+
|
|
135
|
+
CONSTRAINTS:
|
|
136
|
+
- {constraint 1}
|
|
137
|
+
- {constraint 2}
|
|
138
|
+
|
|
139
|
+
ACCEPTANCE:
|
|
140
|
+
- {completion criterion 1}
|
|
141
|
+
- {completion criterion 2}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Key Principles
|
|
147
|
+
|
|
148
|
+
1. **Lead = 사용자 지시 해석 + 조율 + 태스크 직접 처리**
|
|
149
|
+
2. **사용자가 SCOPE와 구성을 결정한다**
|
|
150
|
+
3. **tasks.json이 상태의 단일 진실 소스** — nx-plan이 생성하고, Step 1에서 읽으며, 태스크가 완료됨에 따라 업데이트된다
|
|
151
|
+
4. **Do subagents = owner별 실행** — Lead는 `owner` 필드에 따라 태스크당 하나의 서브에이전트를 스폰한다. Engineer는 코드 변경에 집중한다. 문서 업데이트는 Step 4에서 Writer가 일괄 처리한다. Researcher는 즉시 reference/에 기록한다.
|
|
152
|
+
5. **Check subagents = 검증** — Lead의 판단 + 4가지 조건
|
|
153
|
+
6. **SubagentStop 에스컬레이션** — 서브에이전트가 미완성 상태로 종료되면 HOW 진단 → 재위임 → 사용자 보고 순으로 에스컬레이션한다. 태스크당 최대 1사이클.
|
|
154
|
+
7. **Gate Stop nonstop** — 미결 태스크가 존재하는 동안 종료할 수 없다
|
|
155
|
+
8. **Plan first** — tasks.json이 없으면 Step 2 전에 반드시 nx-plan을 실행한다
|
|
156
|
+
9. **shell 명령으로 파일 수정 금지** — sed, echo redirection, heredoc, tee 및 유사한 shell 기반 파일 편집은 금지된다. harness의 전용 파일 편집 primitive를 항상 사용한다 (gate 강제)
|
|
157
|
+
|
|
158
|
+
## State Management
|
|
159
|
+
|
|
160
|
+
`.nexus/state/tasks.json` — nx-plan이 생성하고 `nx_task_add`/`nx_task_update`로 관리한다. Gate Stop 강제.
|
|
161
|
+
사이클 종료 시 `nx_task_close`를 통해 plan+tasks를 `.nexus/history.json`에 아카이브한다.
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nx-run
|
|
3
|
+
description: Execution — user-directed agent composition.
|
|
4
|
+
summary: "Execution — user-directed agent composition"
|
|
5
|
+
triggers:
|
|
6
|
+
- run
|
|
7
|
+
harness_docs_refs:
|
|
8
|
+
- resume_invocation
|
|
9
|
+
id: nx-run
|
|
10
|
+
---
|
|
11
|
+
|
|
1
12
|
## Role
|
|
2
13
|
|
|
3
14
|
Execution norm that Lead follows when the user invokes the [run] tag. Composes subagents dynamically based on user direction and drives the full execution pipeline from intake to completion.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nx-sync
|
|
3
|
+
description: Context knowledge synchronization — scans project state and updates
|
|
4
|
+
.nexus/context/ design documents
|
|
5
|
+
summary: "Context knowledge synchronization"
|
|
6
|
+
triggers:
|
|
7
|
+
- sync
|
|
8
|
+
id: nx-sync
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Role
|
|
12
|
+
|
|
13
|
+
현재 프로젝트 상태를 스캔하고 `.nexus/context/` 설계 문서를 동기화한다. git diff를 사용하여 코드 변경 사항을 식별한 뒤, 코드만으로는 추론할 수 없는 추상 설계 문서(원칙, 철학, 개발 스택, 아키텍처 결정)를 업데이트한다.
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
|
|
17
|
+
- 기존 context 파일을 절대 삭제하지 않는다 — 업데이트하거나 추가만 한다
|
|
18
|
+
- 소스 코드를 절대 수정하지 않는다 — 이 skill은 문서만 업데이트한다
|
|
19
|
+
- 소스에서 확인할 수 없는 정보는 추측하지 않는다 — 대신 "needs verification"으로 표시한다
|
|
20
|
+
- 기존 내용 구조를 반드시 보존한다 — 전체 파일을 불필요하게 재작성하지 않고 섹션만 업데이트한다
|
|
21
|
+
- 사용 중단된 MCP 지식 도구는 절대 사용하지 않는다 — harness의 파일 읽기 및 파일 생성 프리미티브만 사용한다
|
|
22
|
+
|
|
23
|
+
## Guidelines
|
|
24
|
+
|
|
25
|
+
## Trigger
|
|
26
|
+
|
|
27
|
+
- `[sync]` — 현재 프로젝트 상태와 `.nexus/context/`를 동기화한다
|
|
28
|
+
|
|
29
|
+
## Process
|
|
30
|
+
|
|
31
|
+
### Step 1: Gather Sources
|
|
32
|
+
|
|
33
|
+
모든 사용 가능한 소스에서 정보를 수집한다:
|
|
34
|
+
|
|
35
|
+
1. **git diff** — `git diff --name-only HEAD~10..HEAD` 실행 (또는 최근 커밋을 사용하여 변경된 파일 식별)
|
|
36
|
+
- 어떤 소스 파일이 변경되었는지 식별한다
|
|
37
|
+
- 어떤 context 문서가 오래되었는지 판단하는 1차 신호
|
|
38
|
+
2. **대화 context** — 현재 세션에서 사용 가능한 경우
|
|
39
|
+
- 논의되었으나 아직 context 문서에 반영되지 않은 설계 결정
|
|
40
|
+
- 모든 업데이트의 보조 소스
|
|
41
|
+
|
|
42
|
+
### Step 2: Read Current Context
|
|
43
|
+
|
|
44
|
+
harness의 파일 읽기 프리미티브를 사용하여 `.nexus/context/`의 모든 파일을 읽는다:
|
|
45
|
+
|
|
46
|
+
- 파일 목록 확인: `ls .nexus/context/`
|
|
47
|
+
- 각 파일을 읽어 현재 문서화된 상태를 파악한다
|
|
48
|
+
- 감지된 변경 사항과 비교하여 누락되거나 오래된 내용을 식별한다
|
|
49
|
+
|
|
50
|
+
구체적인 변경이 감지된 파일만 업데이트한다. 오래된 내용이 없으면 "already current"를 보고하고 건너뛴다.
|
|
51
|
+
|
|
52
|
+
### Step 3: Execute Updates
|
|
53
|
+
|
|
54
|
+
Writer agent를 스폰하여 영향받은 context 문서를 업데이트한다:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
{{subagent_spawn target_role=writer name=writer-sync-context prompt=>>WRITER_SYNC_PROMPT}}
|
|
58
|
+
Update .nexus/context/ documents based on the following changes. Read current files with the harness's file-reading primitive, then write updates with the harness's file-creation primitive. Changes: {change_manifest}
|
|
59
|
+
<<WRITER_SYNC_PROMPT
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Writer agent:
|
|
63
|
+
- harness의 파일 읽기 프리미티브로 각 관련 context 파일을 읽는다
|
|
64
|
+
- 오래된 섹션만 수정하는 표적 업데이트를 적용한다
|
|
65
|
+
- harness의 파일 생성 프리미티브로 업데이트된 파일을 다시 작성한다
|
|
66
|
+
- 이미 정확한 파일은 재작성하지 않는다
|
|
67
|
+
|
|
68
|
+
### Step 4: Report
|
|
69
|
+
|
|
70
|
+
다음을 사용자에게 보고한다:
|
|
71
|
+
- 스캔한 context 파일
|
|
72
|
+
- 업데이트된 파일과 변경된 내용
|
|
73
|
+
- 이미 최신 상태인 파일
|
|
74
|
+
- "needs verification"으로 표시된 항목
|
|
75
|
+
|
|
76
|
+
## Key Principles
|
|
77
|
+
|
|
78
|
+
1. **전체 재작성보다 표적 업데이트** — 실제로 오래된 섹션만 변경한다
|
|
79
|
+
2. **증거 기반** — 모든 업데이트는 소스(git diff 또는 대화)를 추적할 수 있어야 한다
|
|
80
|
+
3. **구조 보존** — 기존 문서 구성, 헤딩, 형식을 유지한다
|
|
81
|
+
4. **추측 금지** — 변경 사항이 context 문서에 미치는 영향이 불명확하면 추측하지 않고 표시한다
|
|
82
|
+
|
|
83
|
+
## What .nexus/context/ Contains
|
|
84
|
+
|
|
85
|
+
Context 문서는 소스 코드에서 직접 읽을 수 없는 추상 지식을 담는다:
|
|
86
|
+
|
|
87
|
+
- 설계 원칙 및 철학
|
|
88
|
+
- 아키텍처 결정과 그 근거
|
|
89
|
+
- 개발 스택 선택과 제약
|
|
90
|
+
- 프로젝트 컨벤션과 표준
|
|
91
|
+
|
|
92
|
+
이 문서들은 코드 변경이 원칙의 전환을 반영하거나, 새로운 아키텍처 결정이 내려지거나, 개발 스택이 변화할 때 업데이트된다. 기저 설계를 변경하지 않는 일상적인 코드 추가에는 업데이트하지 않는다.
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nx-sync
|
|
3
|
+
description: Context knowledge synchronization — scans project state and updates
|
|
4
|
+
.nexus/context/ design documents
|
|
5
|
+
summary: "Context knowledge synchronization"
|
|
6
|
+
triggers:
|
|
7
|
+
- sync
|
|
8
|
+
id: nx-sync
|
|
9
|
+
---
|
|
10
|
+
|
|
1
11
|
## Role
|
|
2
12
|
|
|
3
13
|
Scans the current project state and synchronizes .nexus/context/ design documents. Uses git diff to identify code changes, then updates abstract design documents (principles, philosophy, development stack, architectural decisions) that cannot be inferred from code alone.
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# tool-name-map.yml
|
|
2
|
+
# nexus standard tool names (PascalCase) -> 3 harness native mapping
|
|
3
|
+
# Used by wrapper (runtime.ts) for alias transformation and Bash command parsing
|
|
4
|
+
#
|
|
5
|
+
# Sources:
|
|
6
|
+
# - plan.json Issue #3 decision (tool name standard + Bash parsing)
|
|
7
|
+
# - plan.json Issue #4 decision (Codex limit workarounds, extended Bash parse patterns)
|
|
8
|
+
# - plan.json Issue #5 decision §6 (PascalCase standard for matcher)
|
|
9
|
+
# - .nexus/memory/external-codex-hooks-tools.md §8 (3-harness tool mapping table)
|
|
10
|
+
#
|
|
11
|
+
# null = tool not natively supported by that harness
|
|
12
|
+
# Codex shell tools: primary is "shell" (most general); aliases listed for alias transformation
|
|
13
|
+
|
|
14
|
+
tools:
|
|
15
|
+
|
|
16
|
+
# ── General tools ────────────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
Bash:
|
|
19
|
+
claude: Bash
|
|
20
|
+
codex:
|
|
21
|
+
primary: shell
|
|
22
|
+
aliases: [shell_command, exec_command, exec]
|
|
23
|
+
opencode: bash
|
|
24
|
+
|
|
25
|
+
Read:
|
|
26
|
+
claude: Read
|
|
27
|
+
codex: null # No standalone Read; uses shell cat/head/tail (see bash_parse_patterns)
|
|
28
|
+
opencode: read
|
|
29
|
+
|
|
30
|
+
Edit:
|
|
31
|
+
claude: Edit
|
|
32
|
+
codex: apply_patch # Codex uses apply_patch for all file edits
|
|
33
|
+
opencode: edit
|
|
34
|
+
|
|
35
|
+
Write:
|
|
36
|
+
claude: Write
|
|
37
|
+
codex: apply_patch
|
|
38
|
+
opencode: write
|
|
39
|
+
|
|
40
|
+
MultiEdit:
|
|
41
|
+
claude: MultiEdit
|
|
42
|
+
codex: apply_patch
|
|
43
|
+
opencode: edit
|
|
44
|
+
|
|
45
|
+
# ApplyPatch: Codex-native concept; Claude decomposes into Edit/MultiEdit
|
|
46
|
+
ApplyPatch:
|
|
47
|
+
claude: [Edit, MultiEdit] # Claude has no single ApplyPatch; uses per-file tools
|
|
48
|
+
codex: apply_patch
|
|
49
|
+
opencode: [apply_patch, edit] # OpenCode supports both forms
|
|
50
|
+
|
|
51
|
+
Grep:
|
|
52
|
+
claude: Grep
|
|
53
|
+
codex: null # Uses shell + rg (see bash_parse_patterns)
|
|
54
|
+
opencode: grep
|
|
55
|
+
|
|
56
|
+
Glob:
|
|
57
|
+
claude: Glob
|
|
58
|
+
codex: null # Uses shell + find (see bash_parse_patterns)
|
|
59
|
+
opencode: glob
|
|
60
|
+
|
|
61
|
+
LS:
|
|
62
|
+
claude: LS
|
|
63
|
+
codex: list_dir
|
|
64
|
+
opencode: list
|
|
65
|
+
|
|
66
|
+
WebFetch:
|
|
67
|
+
claude: WebFetch
|
|
68
|
+
codex: null # No equivalent; web_search only
|
|
69
|
+
opencode: webfetch
|
|
70
|
+
|
|
71
|
+
WebSearch:
|
|
72
|
+
claude: WebSearch
|
|
73
|
+
codex: web_search
|
|
74
|
+
opencode: websearch
|
|
75
|
+
|
|
76
|
+
ViewImage:
|
|
77
|
+
claude: Read # Claude handles images via Read (branch on mime type)
|
|
78
|
+
codex: view_image
|
|
79
|
+
opencode: null # Confirmed unavailable per memory §8
|
|
80
|
+
|
|
81
|
+
REPL:
|
|
82
|
+
claude: REPL
|
|
83
|
+
codex: [js_repl, js_repl_reset]
|
|
84
|
+
opencode: null # Confirmed unavailable per memory §8
|
|
85
|
+
|
|
86
|
+
ToolSearch:
|
|
87
|
+
claude: ToolSearch
|
|
88
|
+
codex: [tool_search, tool_suggest]
|
|
89
|
+
opencode: null # Confirmed unavailable per memory §8
|
|
90
|
+
|
|
91
|
+
# ── Meta tools — invocation guidance only; wrapper mapping not required (#3 decision) ──
|
|
92
|
+
|
|
93
|
+
Task: # Subagent spawn
|
|
94
|
+
claude: Agent # Claude exposes this as the Agent tool (also called Task in docs)
|
|
95
|
+
codex: spawn_agent
|
|
96
|
+
opencode: task
|
|
97
|
+
|
|
98
|
+
Skill:
|
|
99
|
+
claude: Skill
|
|
100
|
+
codex: null # Codex uses $skill-name syntax directly in composer (no tool call)
|
|
101
|
+
opencode: skill
|
|
102
|
+
|
|
103
|
+
TodoWrite:
|
|
104
|
+
claude: TodoWrite
|
|
105
|
+
codex: update_plan
|
|
106
|
+
opencode: todowrite
|
|
107
|
+
|
|
108
|
+
TodoRead:
|
|
109
|
+
claude: TodoRead
|
|
110
|
+
codex: update_plan # update_plan subsumes read via plan/step/status fields
|
|
111
|
+
opencode: todoread
|
|
112
|
+
|
|
113
|
+
AskUserQuestion:
|
|
114
|
+
claude: AskUserQuestion
|
|
115
|
+
codex: request_user_input
|
|
116
|
+
opencode: question
|
|
117
|
+
|
|
118
|
+
RequestPermissions:
|
|
119
|
+
claude: null # Claude uses PermissionRequest hook event, not a tool
|
|
120
|
+
codex: request_permissions
|
|
121
|
+
opencode: null # permission.ask (#7006) confirmed non-firing; out of portable scope
|
|
122
|
+
|
|
123
|
+
# ── MCP tool prefix convention ────────────────────────────────────────────────
|
|
124
|
+
# MCP tools are exposed under a namespaced prefix in all three harnesses.
|
|
125
|
+
# wrapper normalizes any mcp__<server>__<tool> name to this canonical form.
|
|
126
|
+
mcp_tool_prefix: "mcp__<server>__<tool>"
|
|
127
|
+
|
|
128
|
+
# ── Bash parse patterns ───────────────────────────────────────────────────────
|
|
129
|
+
# Used by wrapper to normalize Codex Bash (shell) commands into nexus standard tool_name.
|
|
130
|
+
# Applies to: PreToolUse / PostToolUse tool_input.command (Codex), post-tool-telemetry matcher.
|
|
131
|
+
# Strategy: best-effort single-entrypoint match on command string prefix.
|
|
132
|
+
# Compound commands, pipes, and sudo are NOT matched and remain tool_name=Bash.
|
|
133
|
+
#
|
|
134
|
+
# Source: plan.json Issue #3 section "Bash parsing" + Issue #4 section 2 "Bash parsing extension"
|
|
135
|
+
|
|
136
|
+
bash_parse_patterns:
|
|
137
|
+
|
|
138
|
+
Read:
|
|
139
|
+
- "^(cat|head|tail|less|more) "
|
|
140
|
+
|
|
141
|
+
LS:
|
|
142
|
+
- "^ls( |$)"
|
|
143
|
+
|
|
144
|
+
Glob:
|
|
145
|
+
- "^find "
|
|
146
|
+
|
|
147
|
+
Grep:
|
|
148
|
+
- "^(rg|grep) "
|
|
149
|
+
|
|
150
|
+
Write:
|
|
151
|
+
- "^echo .+ > " # stdout redirect (overwrite)
|
|
152
|
+
- "^touch "
|
|
153
|
+
- "^tee "
|
|
154
|
+
- "^cp "
|
|
155
|
+
- "^cat > .+ <<" # heredoc write
|
|
156
|
+
|
|
157
|
+
Edit:
|
|
158
|
+
- "^echo .+ >> " # stdout redirect (append)
|
|
159
|
+
- "^sed -i "
|
|
160
|
+
- "^mv "
|
|
161
|
+
|
|
162
|
+
# ── Capability notes (non-normative) ─────────────────────────────────────────
|
|
163
|
+
# Authoritative capability data lives in assets/hooks/capability-matrix.yml.
|
|
164
|
+
# These notes summarize key harness gaps relevant to alias mapping.
|
|
165
|
+
#
|
|
166
|
+
# Codex:
|
|
167
|
+
# - No standalone Read/Edit/Write tools; file operations go through apply_patch or shell
|
|
168
|
+
# - apply_patch does not emit PreToolUse/PostToolUse as of 2026-04-18
|
|
169
|
+
# (PR #18391 pending merge; capability matrix entry: event.pre_tool_use.edit.codex=false)
|
|
170
|
+
# - MCP tools do not emit PreToolUse/PostToolUse (Codex #16732, Claude-only)
|
|
171
|
+
# - Skill invocation is $skill-name syntax, not a tool call
|
|
172
|
+
#
|
|
173
|
+
# OpenCode:
|
|
174
|
+
# - permission.ask (#7006) confirmed non-firing; RequestPermissions out of portable scope
|
|
175
|
+
# - PostToolUse additional_context injection not adopted as standard (YAGNI, plan.json #6)
|
|
176
|
+
|
|
177
|
+
# ── invocations ───────────────────────────────────────────────────────────────
|
|
178
|
+
# Canonical invocation patterns for cross-harness agent/skill coordination.
|
|
179
|
+
# These are NOT wrapper-normalized tool names — they are prose/template references
|
|
180
|
+
# for skill authors and build scripts that emit harness-specific call syntax.
|
|
181
|
+
#
|
|
182
|
+
# Each template uses {placeholder} for substituted values.
|
|
183
|
+
# Optional arguments are shown as {arg?} — omit the surrounding delimiters when absent.
|
|
184
|
+
# Build scripts must strip optional segments when the corresponding arg is absent.
|
|
185
|
+
#
|
|
186
|
+
# Sources (per template):
|
|
187
|
+
# Claude Agent tool: https://code.claude.com/docs/en/sub-agents
|
|
188
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md §6 (Agent/Task tool)
|
|
189
|
+
# Claude Skill tool: https://code.claude.com/docs/en/skills
|
|
190
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md — Skill §
|
|
191
|
+
# OpenCode task tool: https://opencode.ai/docs/tools/ (task tool Zod schema)
|
|
192
|
+
# Verified: .nexus/memory/external-opencode-hooks-tools.md §15 (official params)
|
|
193
|
+
# OpenCode skill tool: https://opencode.ai/docs/skills/
|
|
194
|
+
# Verified: .nexus/memory/external-opencode-hooks-tools.md — Skill § (name param only)
|
|
195
|
+
# Codex spawn_agent: https://developers.openai.com/codex/config-reference
|
|
196
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md §7-5
|
|
197
|
+
# Codex skill ($prefix): https://developers.openai.com/codex/skills
|
|
198
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md — Skill §
|
|
199
|
+
# Codex update_plan: .nexus/memory/external-codex-hooks-tools.md §7-4
|
|
200
|
+
# Codex request_user_input: .nexus/memory/external-codex-hooks-tools.md §7-4
|
|
201
|
+
|
|
202
|
+
invocations:
|
|
203
|
+
|
|
204
|
+
# subagent_spawn — spawn a new subagent from within a skill or agent body.
|
|
205
|
+
#
|
|
206
|
+
# args:
|
|
207
|
+
# target_role : string — role/type ID of the agent to spawn (e.g. "engineer")
|
|
208
|
+
# prompt : string — instruction text delivered to the subagent
|
|
209
|
+
# name : string? — optional human-readable label / description
|
|
210
|
+
#
|
|
211
|
+
# Claude — Agent tool (also referred to as "Task" in docs).
|
|
212
|
+
# subagent_type selects the agent role. description is the optional display label.
|
|
213
|
+
# Source: https://code.claude.com/docs/en/sub-agents (Agent tool: subagent_type, prompt, description)
|
|
214
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md §6
|
|
215
|
+
#
|
|
216
|
+
# OpenCode — task tool. Official Zod schema: { subagent_type, prompt, description, task_id? }
|
|
217
|
+
# description is required in OpenCode (unlike Claude where it is optional).
|
|
218
|
+
# task_id is used to resume a prior session; omitted on initial spawn.
|
|
219
|
+
# Source: https://opencode.ai/docs/tools/
|
|
220
|
+
# Verified: .nexus/memory/external-opencode-hooks-tools.md §15 (source-confirmed schema)
|
|
221
|
+
#
|
|
222
|
+
# Codex — spawn_agent tool. Second arg is the instruction prompt.
|
|
223
|
+
# Codex agent roles are resolved from native agent config (config.toml [agents.*]).
|
|
224
|
+
# Source: https://developers.openai.com/codex/config-reference
|
|
225
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md §7-5
|
|
226
|
+
subagent_spawn:
|
|
227
|
+
args: [target_role, prompt, name] # name is optional
|
|
228
|
+
templates:
|
|
229
|
+
claude: 'Agent({ subagent_type: "{target_role}", prompt: "{prompt}", description: "{name}" })'
|
|
230
|
+
opencode: 'task({ subagent_type: "{target_role}", prompt: "{prompt}", description: "{name}" })'
|
|
231
|
+
codex: 'spawn_agent("{target_role}", "{prompt}")'
|
|
232
|
+
notes:
|
|
233
|
+
claude: >
|
|
234
|
+
description field is optional; omit when name arg is absent.
|
|
235
|
+
model field may be added to override the spawned agent's model.
|
|
236
|
+
opencode: >
|
|
237
|
+
description is required by OpenCode's Zod schema — use target_role as
|
|
238
|
+
fallback when name is absent. task_id param enables session resume (§15).
|
|
239
|
+
codex: >
|
|
240
|
+
Agent role must be pre-registered in config.toml [agents.<target_role>].
|
|
241
|
+
No description equivalent in spawn_agent call signature.
|
|
242
|
+
|
|
243
|
+
# skill_activation — invoke a skill from within an agent or skill body.
|
|
244
|
+
#
|
|
245
|
+
# args:
|
|
246
|
+
# skill : string — canonical skill name (e.g. "nx-plan")
|
|
247
|
+
# mode : string? — optional argument / mode string passed to the skill
|
|
248
|
+
#
|
|
249
|
+
# Claude — Skill tool. Single `command` string parameter only; no `args` field.
|
|
250
|
+
# Plugin-namespaced skills use "plugin:skill" form (e.g. "claude-nexus:nx-plan").
|
|
251
|
+
# Source: https://code.claude.com/docs/en/skills
|
|
252
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md — Skill § (command param schema)
|
|
253
|
+
#
|
|
254
|
+
# OpenCode — skill tool. Single `name` string parameter; no `args` parameter.
|
|
255
|
+
# $ARGUMENTS placeholder substitution in SKILL.md body is unconfirmed.
|
|
256
|
+
# Source: https://opencode.ai/docs/skills/
|
|
257
|
+
# Verified: .nexus/memory/external-opencode-hooks-tools.md — Skill § (name param only)
|
|
258
|
+
#
|
|
259
|
+
# Codex — $skill-name composer prefix, not a tool call. Positional and KEY=value
|
|
260
|
+
# args are theoretically supported but confirmed only for Custom Prompts, not Skills.
|
|
261
|
+
# Source: https://developers.openai.com/codex/skills
|
|
262
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md — Skill § ($ prefix syntax)
|
|
263
|
+
skill_activation:
|
|
264
|
+
args: [skill, mode] # mode is optional
|
|
265
|
+
templates:
|
|
266
|
+
claude: 'Skill({ command: "{skill}" })'
|
|
267
|
+
opencode: 'skill({ name: "{skill}" })'
|
|
268
|
+
codex: '${skill}'
|
|
269
|
+
notes:
|
|
270
|
+
claude: >
|
|
271
|
+
The Skill tool accepts only the `command` string; mode/args cannot be
|
|
272
|
+
passed as a separate parameter. Mode must be embedded in the SKILL.md body
|
|
273
|
+
via $ARGUMENTS placeholder substitution.
|
|
274
|
+
opencode: >
|
|
275
|
+
The skill tool accepts only `name`; args passing is unconfirmed per source
|
|
276
|
+
review. Design skills to be args-free or embed defaults in SKILL.md body.
|
|
277
|
+
codex: >
|
|
278
|
+
Positional args: "$skill-name {mode}". Named args: "$skill-name MODE={mode}".
|
|
279
|
+
Confirmed only for Custom Prompts; treat as best-effort for Skills.
|
|
280
|
+
$ prefix is literal in composer input, not a tool call.
|
|
281
|
+
|
|
282
|
+
# task_register — register or update a task in the plan tracker.
|
|
283
|
+
#
|
|
284
|
+
# args:
|
|
285
|
+
# label : string — task subject / display label
|
|
286
|
+
# state : string — task status (e.g. "in_progress", "completed", "blocked")
|
|
287
|
+
#
|
|
288
|
+
# Claude — TaskCreate tool for new tasks; TaskUpdate (nx_task_update MCP tool) for state.
|
|
289
|
+
# TaskCreate is a Claude Code native meta tool.
|
|
290
|
+
# Source: https://code.claude.com/docs/en/sub-agents
|
|
291
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md §6 (TaskCreate tool entry)
|
|
292
|
+
# Note: nx_task_update refers to the MCP tool exposed by nexus-core server.
|
|
293
|
+
#
|
|
294
|
+
# OpenCode — nx_task_add MCP tool to create; nx_task_update MCP tool to update state.
|
|
295
|
+
# MCP tool names are identical across harnesses (server exposes same tool names).
|
|
296
|
+
# Source: nexus-core MCP server implementation (src/mcp/tools/)
|
|
297
|
+
#
|
|
298
|
+
# Codex — update_plan native tool manages plan steps including state.
|
|
299
|
+
# plan/step/status sub-fields subsume both create and update operations.
|
|
300
|
+
# Source: https://developers.openai.com/codex/config-reference
|
|
301
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md §7-4
|
|
302
|
+
task_register:
|
|
303
|
+
args: [label, state]
|
|
304
|
+
templates:
|
|
305
|
+
claude: 'TaskCreate({ subject: "{label}" }) then nx_task_update({ taskId, status: "{state}" })'
|
|
306
|
+
opencode: 'nx_task_add({ subject: "{label}" }) then nx_task_update({ taskId, status: "{state}" })'
|
|
307
|
+
codex: 'update_plan([{ name: "{label}", state: "{state}" }])'
|
|
308
|
+
notes:
|
|
309
|
+
claude: >
|
|
310
|
+
TaskCreate is a Claude Code native tool (not MCP). nx_task_update is the
|
|
311
|
+
nexus-core MCP tool — full name mcp__plugin_claude-nexus_nx__nx_task_update.
|
|
312
|
+
taskId is returned by TaskCreate and must be threaded to the update call.
|
|
313
|
+
opencode: >
|
|
314
|
+
Both nx_task_add and nx_task_update are nexus-core MCP tools exposed via
|
|
315
|
+
the nexus MCP server. task_id returned by nx_task_add must be threaded to update.
|
|
316
|
+
codex: >
|
|
317
|
+
update_plan subsumes creation and update in a single call via plan/step/status
|
|
318
|
+
fields. No separate create/update step is needed.
|
|
319
|
+
|
|
320
|
+
# user_question — request structured input from the user.
|
|
321
|
+
#
|
|
322
|
+
# args:
|
|
323
|
+
# question : string — the question text to present
|
|
324
|
+
# options : string[] — list of choices (may be empty for free-text responses)
|
|
325
|
+
#
|
|
326
|
+
# Claude — AskUserQuestion tool. questions[] array supports multiple simultaneous
|
|
327
|
+
# questions; single-question usage is the standard nexus pattern.
|
|
328
|
+
# Source: https://code.claude.com/docs/en/sub-agents (AskUserQuestion tool)
|
|
329
|
+
# Verified: .nexus/memory/external-claude-code-hooks-tools.md §6
|
|
330
|
+
#
|
|
331
|
+
# OpenCode — question tool. Single question with choices array.
|
|
332
|
+
# Source: https://opencode.ai/docs/tools/
|
|
333
|
+
# Verified: .nexus/memory/external-opencode-hooks-tools.md §7 (question tool entry)
|
|
334
|
+
#
|
|
335
|
+
# Codex — request_user_input native tool.
|
|
336
|
+
# Source: https://developers.openai.com/codex/config-reference
|
|
337
|
+
# Verified: .nexus/memory/external-codex-hooks-tools.md §7-4
|
|
338
|
+
user_question:
|
|
339
|
+
args: [question, options]
|
|
340
|
+
templates:
|
|
341
|
+
claude: 'AskUserQuestion({ questions: [{ question: "{question}", options: {options} }] })'
|
|
342
|
+
opencode: 'question({ question: "{question}", choices: {options} })'
|
|
343
|
+
codex: 'request_user_input({ prompt: "{question}", options: {options} })'
|
|
344
|
+
notes:
|
|
345
|
+
claude: >
|
|
346
|
+
options is a JSON array of strings. Omit the options field (not an empty array)
|
|
347
|
+
for free-text responses. Multiple questions can be batched in the questions[] array.
|
|
348
|
+
opencode: >
|
|
349
|
+
choices field name (not options). Omit choices for free-text input.
|
|
350
|
+
codex: >
|
|
351
|
+
Exact request_user_input schema (options field name, types) is not fully
|
|
352
|
+
documented — treat as best-effort. Verified as a native Codex tool in
|
|
353
|
+
external-codex-hooks-tools.md §7-4.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode plugin adapter — mounts nexus hooks into OpenCode's plugin API.
|
|
3
|
+
*
|
|
4
|
+
* 결정 참조: plan.json Issue #1 (3-레이어 책임 분담),
|
|
5
|
+
* Issue #3 (OpenCode 2단 처리 — SubagentStart/Stop, agent-tracker),
|
|
6
|
+
* Issue #6 (additional_context 주입 우회 — SubagentStop output.output append)
|
|
7
|
+
*/
|
|
8
|
+
export interface OpenCodeHookManifestEntry {
|
|
9
|
+
name: string;
|
|
10
|
+
/** Nexus standard event names (PascalCase). */
|
|
11
|
+
events: string[];
|
|
12
|
+
/** Glob/regex pattern matched against tool_name or source. */
|
|
13
|
+
matcher: string;
|
|
14
|
+
/** Absolute path to the compiled handler .js shell wrapper. */
|
|
15
|
+
handlerPath: string;
|
|
16
|
+
priority: number;
|
|
17
|
+
/** Timeout in seconds; defaults to 30. */
|
|
18
|
+
timeout?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface OpenCodeHookManifest {
|
|
21
|
+
hooks: OpenCodeHookManifestEntry[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Mount nexus hooks into OpenCode's plugin API.
|
|
25
|
+
*
|
|
26
|
+
* Returns an object whose keys are OpenCode plugin hook names. Each value is
|
|
27
|
+
* the async handler function OpenCode calls when the corresponding event fires.
|
|
28
|
+
*
|
|
29
|
+
* @param pluginCtx OpenCode plugin context (must expose `.directory: string`)
|
|
30
|
+
* @param manifest Hook manifest produced by build-hooks.ts
|
|
31
|
+
*/
|
|
32
|
+
export declare function mountHooks(pluginCtx: {
|
|
33
|
+
directory: string;
|
|
34
|
+
}, manifest: OpenCodeHookManifest): Record<string, (...args: unknown[]) => Promise<void>>;
|
|
35
|
+
//# sourceMappingURL=opencode-mount.d.ts.map
|