@moreih29/nexus-core 0.2.0 → 0.4.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 (32) hide show
  1. package/agents/researcher/body.md +1 -1
  2. package/conformance/README.md +203 -15
  3. package/conformance/lifecycle/README.md +17 -0
  4. package/conformance/lifecycle/agent-complete.json +43 -0
  5. package/conformance/lifecycle/agent-resume.json +42 -0
  6. package/conformance/lifecycle/agent-spawn.json +39 -0
  7. package/conformance/lifecycle/session-end.json +31 -0
  8. package/conformance/lifecycle/session-start.json +36 -0
  9. package/conformance/scenarios/full-plan-cycle.json +15 -0
  10. package/conformance/scenarios/task-deps-ordering.json +12 -0
  11. package/conformance/schema/fixture.schema.json +139 -9
  12. package/conformance/tools/artifact-write.json +97 -0
  13. package/conformance/tools/context.json +172 -0
  14. package/conformance/tools/history-search.json +219 -0
  15. package/conformance/tools/plan-decide.json +69 -0
  16. package/conformance/tools/plan-start.json +14 -0
  17. package/conformance/tools/plan-status.json +127 -0
  18. package/conformance/tools/plan-update.json +341 -0
  19. package/conformance/tools/task-add.json +89 -6
  20. package/conformance/tools/task-close.json +65 -4
  21. package/conformance/tools/task-list.json +177 -0
  22. package/conformance/tools/task-update.json +167 -0
  23. package/docs/consumer-implementation-guide.md +3 -3
  24. package/docs/nexus-outputs-contract.md +277 -0
  25. package/manifest.json +79 -84
  26. package/package.json +2 -1
  27. package/skills/nx-init/body.md +8 -8
  28. package/skills/nx-init/meta.yml +2 -0
  29. package/skills/nx-plan/body.md +3 -3
  30. package/skills/nx-sync/body.md +5 -5
  31. package/skills/nx-setup/body.md +0 -196
  32. package/skills/nx-setup/meta.yml +0 -5
package/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "nexus_core_version": "0.2.0",
3
- "nexus_core_commit": "166a3b29f2b5795b9df037442ddc5d2ae7e36e5a",
2
+ "nexus_core_version": "0.4.0",
3
+ "nexus_core_commit": "2cc2402301c1f9b95ef0e9896c30e561357a7c35",
4
4
  "schema_contract_version": "2.0",
5
5
  "agents": [
6
6
  {
@@ -20,39 +20,55 @@
20
20
  "body_hash": "sha256:85f9a3de419f32cdae284436eb1d902bff19a2230c50fe3068ffc642949a63b7"
21
21
  },
22
22
  {
23
- "name": "writer",
24
- "description": "Technical writingtransforms research findings, code, and analysis into clear documents and presentations for the intended audience",
25
- "task": "Technical writing, documentation, presentations",
26
- "alias_ko": "라이터",
27
- "category": "do",
28
- "resume_tier": "bounded",
23
+ "name": "reviewer",
24
+ "description": "Content verificationvalidates accuracy, checks facts, confirms grammar and format of non-code deliverables",
25
+ "task": "Content verification, fact-checking, grammar review",
26
+ "alias_ko": "리뷰어",
27
+ "category": "check",
28
+ "resume_tier": "ephemeral",
29
29
  "model_tier": "standard",
30
30
  "capabilities": [
31
+ "no_file_edit",
31
32
  "no_task_create"
32
33
  ],
33
- "id": "writer",
34
- "body_hash": "sha256:2edd9bf52e537c446b5ebfaafab214ebaaad2491f019aa8534453bff3f1cd37b"
34
+ "id": "reviewer",
35
+ "body_hash": "sha256:f04d15249601b14046e7e40a4475defb289436c4474afbd89986964f8c3e7c2f"
35
36
  },
36
37
  {
37
- "name": "tester",
38
- "description": "Testing and verification tests, verifies, validates stability and security of implementations",
39
- "task": "Testing, verification, security review",
40
- "alias_ko": "테스터",
41
- "category": "check",
42
- "resume_tier": "ephemeral",
43
- "model_tier": "standard",
38
+ "name": "designer",
39
+ "description": "UX/UI designevaluates user experience, interaction patterns, and how users will experience the product",
40
+ "task": "UI/UX design, interaction patterns, user experience",
41
+ "alias_ko": "디자이너",
42
+ "category": "how",
43
+ "resume_tier": "persistent",
44
+ "model_tier": "high",
44
45
  "capabilities": [
45
46
  "no_file_edit",
47
+ "no_task_create",
48
+ "no_task_update"
49
+ ],
50
+ "id": "designer",
51
+ "body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
52
+ },
53
+ {
54
+ "name": "engineer",
55
+ "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
56
+ "task": "Code implementation, edits, debugging",
57
+ "alias_ko": "엔지니어",
58
+ "category": "do",
59
+ "resume_tier": "bounded",
60
+ "model_tier": "standard",
61
+ "capabilities": [
46
62
  "no_task_create"
47
63
  ],
48
- "id": "tester",
49
- "body_hash": "sha256:4dd04e1c93ff9c0c9fa6aebb60ece3f9719e82f9714b13feea01b6163633caec"
64
+ "id": "engineer",
65
+ "body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
50
66
  },
51
67
  {
52
- "name": "postdoc",
53
- "description": "Research methodology and synthesis designs investigation approach, evaluates evidence quality, writes synthesis documents",
54
- "task": "Research methodology, evidence synthesis",
55
- "alias_ko": "포닥",
68
+ "name": "strategist",
69
+ "description": "Business strategy evaluates market positioning, competitive landscape, and business viability of decisions",
70
+ "task": "Business strategy, market analysis, competitive positioning",
71
+ "alias_ko": "전략가",
56
72
  "category": "how",
57
73
  "resume_tier": "persistent",
58
74
  "model_tier": "high",
@@ -61,8 +77,8 @@
61
77
  "no_task_create",
62
78
  "no_task_update"
63
79
  ],
64
- "id": "postdoc",
65
- "body_hash": "sha256:da9b8c2568b8b5812abed6d6324139f814379d48dc63cdc5d0b5b263f5407814"
80
+ "id": "strategist",
81
+ "body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
66
82
  },
67
83
  {
68
84
  "name": "researcher",
@@ -77,13 +93,13 @@
77
93
  "no_task_create"
78
94
  ],
79
95
  "id": "researcher",
80
- "body_hash": "sha256:7f5db3b52ae76a3b3214cf73b076980e15ef85c80b9aa86a9704f737e4b13251"
96
+ "body_hash": "sha256:fc79bafec05503327bd51a0b84b6e642d304bd79c45b78db6448b112793c143e"
81
97
  },
82
98
  {
83
- "name": "strategist",
84
- "description": "Business strategyevaluates market positioning, competitive landscape, and business viability of decisions",
85
- "task": "Business strategy, market analysis, competitive positioning",
86
- "alias_ko": "전략가",
99
+ "name": "postdoc",
100
+ "description": "Research methodology and synthesis designs investigation approach, evaluates evidence quality, writes synthesis documents",
101
+ "task": "Research methodology, evidence synthesis",
102
+ "alias_ko": "포닥",
87
103
  "category": "how",
88
104
  "resume_tier": "persistent",
89
105
  "model_tier": "high",
@@ -92,14 +108,14 @@
92
108
  "no_task_create",
93
109
  "no_task_update"
94
110
  ],
95
- "id": "strategist",
96
- "body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
111
+ "id": "postdoc",
112
+ "body_hash": "sha256:da9b8c2568b8b5812abed6d6324139f814379d48dc63cdc5d0b5b263f5407814"
97
113
  },
98
114
  {
99
- "name": "reviewer",
100
- "description": "Content verification — validates accuracy, checks facts, confirms grammar and format of non-code deliverables",
101
- "task": "Content verification, fact-checking, grammar review",
102
- "alias_ko": "리뷰어",
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": "테스터",
103
119
  "category": "check",
104
120
  "resume_tier": "ephemeral",
105
121
  "model_tier": "standard",
@@ -107,38 +123,22 @@
107
123
  "no_file_edit",
108
124
  "no_task_create"
109
125
  ],
110
- "id": "reviewer",
111
- "body_hash": "sha256:f04d15249601b14046e7e40a4475defb289436c4474afbd89986964f8c3e7c2f"
126
+ "id": "tester",
127
+ "body_hash": "sha256:4dd04e1c93ff9c0c9fa6aebb60ece3f9719e82f9714b13feea01b6163633caec"
112
128
  },
113
129
  {
114
- "name": "engineer",
115
- "description": "Implementationwrites code, debugs issues, follows specifications from Lead and architect",
116
- "task": "Code implementation, edits, debugging",
117
- "alias_ko": "엔지니어",
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": "라이터",
118
134
  "category": "do",
119
135
  "resume_tier": "bounded",
120
136
  "model_tier": "standard",
121
137
  "capabilities": [
122
138
  "no_task_create"
123
139
  ],
124
- "id": "engineer",
125
- "body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
126
- },
127
- {
128
- "name": "designer",
129
- "description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
130
- "task": "UI/UX design, interaction patterns, user experience",
131
- "alias_ko": "디자이너",
132
- "category": "how",
133
- "resume_tier": "persistent",
134
- "model_tier": "high",
135
- "capabilities": [
136
- "no_file_edit",
137
- "no_task_create",
138
- "no_task_update"
139
- ],
140
- "id": "designer",
141
- "body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
140
+ "id": "writer",
141
+ "body_hash": "sha256:2edd9bf52e537c446b5ebfaafab214ebaaad2491f019aa8534453bff3f1cd37b"
142
142
  }
143
143
  ],
144
144
  "skills": [
@@ -156,17 +156,15 @@
156
156
  "body_hash": "sha256:6c8d1a36626d4034209ff83780dec6238297ec4710612441b2ef09daac714ca8"
157
157
  },
158
158
  {
159
- "name": "nx-plan",
160
- "description": "Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched plan before execution. Plan only — does not execute.",
161
- "summary": "Structured planningsubagent-based analysis, deliberate decisions, produce execution plan",
162
- "triggers": [
163
- "plan"
164
- ],
159
+ "name": "nx-init",
160
+ "description": "Project onboarding scan, mission, essentials, context generation",
161
+ "summary": "Project onboardingscan, mission, essentials, context generation",
162
+ "manual_only": true,
165
163
  "harness_docs_refs": [
166
- "resume_invocation"
164
+ "instruction_file"
167
165
  ],
168
- "id": "nx-plan",
169
- "body_hash": "sha256:2e3f4fabb2961c052c4449f19ec16ed940394be037a63d4af90a3d12df8e4895"
166
+ "id": "nx-init",
167
+ "body_hash": "sha256:3c8230ecc0f87c541ec0ff80492a28f28bf173d0b9781901adadfae69a54b8ed"
170
168
  },
171
169
  {
172
170
  "name": "nx-sync",
@@ -176,23 +174,20 @@
176
174
  "sync"
177
175
  ],
178
176
  "id": "nx-sync",
179
- "body_hash": "sha256:dbd3933c0474b2831a857308d9dd6ccd2c072f089327c22ce8d2842894fc3216"
177
+ "body_hash": "sha256:a7b0ae8f13ebcd10e52361d0ada1570ff0c47933f731deec07e95539c63e6946"
180
178
  },
181
179
  {
182
- "name": "nx-init",
183
- "description": "Project onboarding scan, mission, essentials, context generation",
184
- "summary": "Project onboardingscan, mission, essentials, context generation",
185
- "manual_only": true,
186
- "id": "nx-init",
187
- "body_hash": "sha256:11761d37bad2fb30ef1d562d22d9a395e27e0c3ce58ea42ad3b1799f47bf8950"
188
- },
189
- {
190
- "name": "nx-setup",
191
- "description": "Interactive project setup wizard for Nexus configuration.",
192
- "summary": "Interactive Nexus configuration wizard",
193
- "manual_only": true,
194
- "id": "nx-setup",
195
- "body_hash": "sha256:e66b0116d5da403c6480876a5b0a575110bcd26ecaa30079ce17de64fc112e65"
180
+ "name": "nx-plan",
181
+ "description": "Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched plan before execution. Plan only — does not execute.",
182
+ "summary": "Structured planningsubagent-based analysis, deliberate decisions, produce execution plan",
183
+ "triggers": [
184
+ "plan"
185
+ ],
186
+ "harness_docs_refs": [
187
+ "resume_invocation"
188
+ ],
189
+ "id": "nx-plan",
190
+ "body_hash": "sha256:85b858089bd3dc276be61baa3f5265bc107a85470f169983e710fecb404bb4b1"
196
191
  }
197
192
  ],
198
193
  "vocabulary": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moreih29/nexus-core",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Nexus ecosystem Authoring layer — canonical prompts, neutral metadata, and vocabulary shared by Nexus harnesses",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "packageManager": "bun@1.3.12",
40
40
  "scripts": {
41
41
  "validate": "bun run scripts/validate.ts",
42
+ "validate:conformance": "bun run scripts/conformance-coverage.ts",
42
43
  "typecheck": "tsc --noEmit",
43
44
  "prepublishOnly": "bun run validate"
44
45
  },
@@ -4,11 +4,11 @@ Scans the project and builds Nexus knowledge in the flat .nexus/ structure. On f
4
4
 
5
5
  ## Constraints
6
6
 
7
- - NEVER modify source code. Slimming down CLAUDE.md beyond the project section is not this skill's responsibility.
7
+ - NEVER modify source code. Slimming down the instruction file beyond the project section is not this skill's responsibility.
8
8
  - NEVER infer or guess information that cannot be confirmed from code — do not write it to context/.
9
9
  - NEVER store secrets (API keys, credentials, etc.) in knowledge files.
10
10
  - NEVER overwrite existing files without `--reset`. On resume, preserve existing files intact.
11
- - Project section in CLAUDE.md MUST go through user confirmation before writing.
11
+ - Project section in the instruction file MUST go through user confirmation before writing.
12
12
  - NEVER reference or create identity/, codebase/, reference/, or core/ paths.
13
13
  - Essentials section MUST NOT exceed 10 lines. If more items are needed, move lower-priority ones to .nexus/context/.
14
14
 
@@ -116,7 +116,7 @@ Do not include items that are standard defaults for the detected tech stack. Do
116
116
  Present the full draft to the user in this format:
117
117
 
118
118
  ```
119
- The following will be added to CLAUDE.md (existing content will not be changed):
119
+ The following will be added to the instruction file (see harness docs: instruction_file) (existing content will not be changed):
120
120
 
121
121
  <!-- PROJECT:START -->
122
122
  ## {project-name}
@@ -133,7 +133,7 @@ Any changes?
133
133
 
134
134
  Wait for the user to confirm or provide edits. Apply all changes in one pass — do not ask about Mission and Essentials separately.
135
135
 
136
- After confirmation, write the section into CLAUDE.md inside markers using the Edit tool. If CLAUDE.md already contains `<!-- PROJECT:START -->` markers, replace the content between them. If CLAUDE.md does not exist, create it with the markers.
136
+ After confirmation, write the section into the instruction file inside markers using the harness's file-editing primitive. If the instruction file already contains `<!-- PROJECT:START -->` markers, replace the content between them. If the instruction file does not exist, create it with the markers.
137
137
 
138
138
  ### Step 3: Context Knowledge Auto-Generation
139
139
 
@@ -149,9 +149,9 @@ Principles:
149
149
  Generation targets (select and name based on what the project actually needs):
150
150
  - Development stack (languages, frameworks, runtimes, key dependencies, build/test/deploy workflow)
151
151
  - Design and architecture (module relationships, data flow, core entry points, conventions)
152
- - Implementation specifics (pipeline details, configuration patterns, file structure conventions, tool restrictions — anything too specific for CLAUDE.md but not readable from code alone)
152
+ - Implementation specifics (pipeline details, configuration patterns, file structure conventions, tool restrictions — anything too specific for the instruction file but not readable from code alone)
153
153
 
154
- Use the Write tool to create files at `.nexus/context/{chosen-name}.md`.
154
+ Use the harness's file-creation primitive to create files at `.nexus/context/{chosen-name}.md`.
155
155
 
156
156
  For large projects, spawn Writer subagents per topic to generate context knowledge in parallel. Lead coordinates and reviews outputs.
157
157
 
@@ -173,7 +173,7 @@ prompt_user({
173
173
  })
174
174
  ```
175
175
 
176
- If "Set up": present a draft based on scan results → user confirms → save via Write tool to `.nexus/rules/{topic}.md`.
176
+ If "Set up": present a draft based on scan results → user confirms → save via the harness's file-creation primitive to `.nexus/rules/{topic}.md`.
177
177
 
178
178
  If "Skip": inform and proceed to Step 5.
179
179
 
@@ -185,7 +185,7 @@ Output a summary of the onboarding results.
185
185
  ## Nexus Initialization Complete
186
186
 
187
187
  ### Generated Files
188
- - CLAUDE.md: project section — mission and essentials (<!-- PROJECT:START/END -->)
188
+ - instruction file: project section — mission and essentials (<!-- PROJECT:START/END -->)
189
189
  - .nexus/context/: {list of generated files}
190
190
  - .nexus/rules/: {generated files or "none (skipped)"}
191
191
 
@@ -2,4 +2,6 @@ name: nx-init
2
2
  description: Project onboarding — scan, mission, essentials, context generation
3
3
  summary: "Project onboarding — scan, mission, essentials, context generation"
4
4
  manual_only: true
5
+ harness_docs_refs:
6
+ - instruction_file
5
7
  id: nx-init
@@ -28,7 +28,7 @@ Facilitate structured multi-perspective analysis using subagents to decompose is
28
28
  ## Trigger
29
29
 
30
30
  - Explicit tag: `[plan]` — continue existing session if plan.json exists, otherwise start new
31
- - Additional analysis needed mid-session: spawn HOW subagents independently via Agent tool
31
+ - Additional analysis needed mid-session: spawn HOW subagents independently via the harness's subagent spawn primitive
32
32
  - Continuing conversation without a tag → continue existing session
33
33
 
34
34
  ---
@@ -99,7 +99,7 @@ Understand code, core knowledge, and prior decisions before forming a planning a
99
99
 
100
100
  - NEVER call `nx_plan_start` before research is complete.
101
101
  - `research_summary` parameter in `nx_plan_start` is required — forces research completion before session creation.
102
- - Researcher subagents are spawned via the Agent tool and return findings to Lead. They do not join the plan session.
102
+ - Researcher subagents are spawned via the harness's subagent spawn primitive and return findings to Lead. They do not join the plan session.
103
103
 
104
104
  **Existing session (plan.json present):**
105
105
  - Check current state with `nx_plan_status`.
@@ -120,7 +120,7 @@ Register the planning session.
120
120
  For each issue:
121
121
 
122
122
  1. **Current State Analysis** — Lead summarizes the current state and problems, drawing on research.
123
- 2. **Subagent Analysis** — for complex issues, spawn HOW subagents (architect, strategist, etc.) in parallel via Agent tool. Each subagent independently analyzes the issue and returns findings.
123
+ 2. **Subagent Analysis** — for complex issues, spawn HOW subagents (architect, strategist, etc.) in parallel via the harness's subagent spawn primitive. Each subagent independently analyzes the issue and returns findings.
124
124
  - **Domain-Agent mapping** — match issue keywords to recommended HOW subagents:
125
125
 
126
126
  | Domain keywords | Recommended HOW |
@@ -8,7 +8,7 @@ Scans the current project state and synchronizes .nexus/context/ design document
8
8
  - NEVER modify source code — this skill updates documentation only
9
9
  - NEVER guess information that cannot be confirmed from sources — mark as "needs verification" instead
10
10
  - MUST preserve existing content structure — update sections, don't rewrite entire files unnecessarily
11
- - NEVER use deprecated MCP knowledge tools — use Read and Write native tools only
11
+ - NEVER use deprecated MCP knowledge tools — use the harness's file-reading and file-creation primitives only
12
12
 
13
13
  ## Guidelines
14
14
 
@@ -31,7 +31,7 @@ Collect information from all available sources:
31
31
 
32
32
  ### Step 2: Read Current Context
33
33
 
34
- Read all files in `.nexus/context/` using the Read tool:
34
+ Read all files in `.nexus/context/` using the harness's file-reading primitive:
35
35
 
36
36
  - List files: `ls .nexus/context/`
37
37
  - Read each file to understand current documented state
@@ -45,13 +45,13 @@ Spawn Writer agent to update affected context documents:
45
45
 
46
46
  ```
47
47
  Agent({ subagent_type: "claude-nexus:writer", name: "writer-sync-context",
48
- prompt: "Update .nexus/context/ documents based on the following changes. Read current files with the Read tool, then write updates with the Write tool. Changes: {change_manifest}" })
48
+ prompt: "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}" })
49
49
  ```
50
50
 
51
51
  The Writer agent:
52
- - Reads each relevant context file with the Read tool
52
+ - Reads each relevant context file with the harness's file-reading primitive
53
53
  - Applies targeted updates — changes only the sections that are stale
54
- - Writes the updated file back with the Write tool
54
+ - Writes the updated file back with the harness's file-creation primitive
55
55
  - Does not rewrite files that are already accurate
56
56
 
57
57
  ### Step 4: Report
@@ -1,196 +0,0 @@
1
- ## Role
2
-
3
- Interactive project setup wizard — configure Nexus for a new project with minimal token cost. Every step is a concrete choice via `prompt_user`, with no open-ended exploration.
4
-
5
- ## Constraints
6
-
7
- - NEVER accept free-text input — every step must use `prompt_user` with explicit options.
8
- - NEVER skip the "Skip" option — all steps are optional.
9
- - NEVER modify files outside the selected scope without explicit user confirmation.
10
- - NEVER overwrite an existing `statusLine` field in settings.json without explicit user confirmation.
11
-
12
- ## Guidelines
13
-
14
- ## Trigger
15
- - Direct invocation: `/claude-nexus:nx-setup`
16
-
17
- ---
18
-
19
- ## Steps
20
-
21
- ### Step 1: Scope Selection
22
-
23
- ```
24
- prompt_user({
25
- questions: [{
26
- question: "Where should the Nexus configuration be applied?",
27
- header: "Scope",
28
- multiSelect: false,
29
- options: [
30
- { label: "User (Global)", description: "Apply to all projects (~/.claude/CLAUDE.md, ~/.claude/settings.json statusline)" },
31
- { label: "Project", description: "Apply to this project only (CLAUDE.md, .claude/settings.local.json)" }
32
- ]
33
- }]
34
- })
35
- ```
36
-
37
- All file write paths for subsequent steps are determined by this selection:
38
- - User: `~/.claude/CLAUDE.md`, `~/.claude/settings.json` (statusline wrapper)
39
- - Project: `./CLAUDE.md`, `./.claude/settings.local.json`
40
-
41
- ### Step 2: Statusline
42
-
43
- ```
44
- prompt_user({
45
- questions: [{
46
- question: "Enable the Nexus statusline? (model, branch, context usage, rate limits)",
47
- header: "Statusline",
48
- multiSelect: false,
49
- options: [
50
- { label: "Enable (Recommended)", description: "2 lines: model+branch+git, context+usage meters" },
51
- { label: "Skip", description: "Skip statusline configuration" }
52
- ]
53
- }]
54
- })
55
- ```
56
-
57
- **Create wrapper script** (for Enable, run via Bash tool):
58
- ```bash
59
- mkdir -p ~/.claude/hooks
60
- cat > ~/.claude/hooks/nexus-statusline.sh << 'EOF'
61
- #!/bin/bash
62
- SCRIPT=$(ls -1d "$HOME/.claude/plugins/cache/nexus/claude-nexus"/*/scripts/statusline.cjs 2>/dev/null | sort -V | tail -1)
63
- [ -n "$SCRIPT" ] && exec node "$SCRIPT"
64
- EOF
65
- chmod +x ~/.claude/hooks/nexus-statusline.sh
66
- ```
67
-
68
- **On selection, depending on scope:**
69
-
70
- **(1) User scope:**
71
- - Create wrapper script (run step above)
72
- - If `statusLine` field is **absent** in `~/.claude/settings.json`: add statusLine setting directly:
73
- ```json
74
- { "statusLine": { "type": "command", "command": "bash $HOME/.claude/hooks/nexus-statusline.sh" } }
75
- ```
76
- - If `statusLine` field **already exists** in `~/.claude/settings.json`: create wrapper only, do not modify settings.json — ask user to confirm replacement (see "Statusline coexistence handling" below)
77
-
78
- **(2) Project scope:**
79
- - Create wrapper script (run step above)
80
- - If `statusLine` field is **absent** in `.claude/settings.local.json`: add statusLine setting directly:
81
- ```json
82
- { "statusLine": { "type": "command", "command": "bash $HOME/.claude/hooks/nexus-statusline.sh" } }
83
- ```
84
- - If `statusLine` field **already exists** in `.claude/settings.local.json`: create wrapper only, do not modify settings.local.json — ask user to confirm replacement (see "Statusline coexistence handling" below)
85
- **(3) Skip:**
86
- - Do not create wrapper or modify settings.json.
87
-
88
- **Statusline coexistence handling:**
89
-
90
- Run only if settings.json modification was deferred above (i.e., wrapper was created but existing statusLine was detected).
91
- If statusLine settings were already applied above, skip this sub-step.
92
-
93
- Specifically, treat an existing statusline setting as detected if any of the following are true:
94
- - `~/.claude/hooks/statusline.sh` file exists
95
- - Or the scope-appropriate settings.json (`~/.claude/settings.json` or `.claude/settings.local.json`) already has a `statusLine` field
96
-
97
- If detected:
98
-
99
- ```
100
- prompt_user({
101
- questions: [{
102
- question: "An existing statusline configuration was detected. Replace it with the Nexus statusline?",
103
- header: "Statusline",
104
- multiSelect: false,
105
- options: [
106
- { label: "Replace (Recommended)", description: "Replace with Nexus statusline (wrapper script configuration)" },
107
- { label: "Keep Existing", description: "Keep existing statusline. Nexus wrapper is created but settings.json is not modified." }
108
- ]
109
- }]
110
- })
111
- ```
112
-
113
- - "Replace (Recommended)": replace the `statusLine` in the scope-appropriate settings.json with the Nexus wrapper (wrapper script already created above)
114
- - "Keep Existing": keep the existing `statusLine` in settings.json (wrapper script already created above — user can switch manually later)
115
-
116
- If no existing statusline configuration is detected, skip this sub-step.
117
-
118
- ### Step 3: Recommended Plugin
119
-
120
- Check if `context7@claude-plugins-official` is in `enabledPlugins` (global or project settings.json).
121
-
122
- **Already installed:**
123
-
124
- Notify and skip:
125
- ```
126
- "Recommended plugin already installed: context7 ✓"
127
- ```
128
-
129
- **Not installed:**
130
-
131
- ```
132
- prompt_user({
133
- questions: [{
134
- question: "Install the context7 plugin? It enables agents to look up library docs in real time.",
135
- header: "Plugin",
136
- multiSelect: false,
137
- options: [
138
- { label: "Install (Recommended)", description: "context7 — real-time library documentation lookup (Upstash Context7)" },
139
- { label: "Skip", description: "Skip recommended plugin installation" }
140
- ]
141
- }]
142
- })
143
- ```
144
-
145
- **If "Install":**
146
- Add to `enabledPlugins` in the scope-appropriate settings.json (`~/.claude/settings.json` or `.claude/settings.local.json`):
147
- ```json
148
- {
149
- "context7@claude-plugins-official": true
150
- }
151
- ```
152
- Claude Code will automatically install the plugin at the start of the next session.
153
-
154
- **If "Skip":** proceed to the next step.
155
-
156
- Note: Once added to `enabledPlugins`, Claude Code automatically installs the plugin at the start of the next session.
157
-
158
- ### Step 4: Knowledge Init
159
-
160
- ```
161
- prompt_user({
162
- questions: [{
163
- question: "Auto-generate project core knowledge?",
164
- header: "Init",
165
- multiSelect: false,
166
- options: [
167
- { label: "Yes (Recommended)", description: "Analyze existing docs (README, CLAUDE.md, etc.) to generate knowledge files in .nexus/memory/ and .nexus/context/" },
168
- { label: "Skip", description: "Run manually later with /claude-nexus:nx-init" }
169
- ]
170
- }]
171
- })
172
- ```
173
-
174
- If "Yes": invoke `Skill({ skill: "claude-nexus:nx-init" })`.
175
- If "Skip": proceed to next step.
176
-
177
- ### Step 5: Complete
178
-
179
- Output a setup completion message:
180
- - Summary of applied settings
181
- - Brief introduction to available skills/agents
182
- - "To get started, describe a task, or use [plan] for planning, [run] for execution, [rule] for saving rules"
183
-
184
- ---
185
-
186
- ## Key Principles
187
-
188
- 1. **Every step uses prompt_user** — no free-text input
189
- 2. **Minimize tokens** — limit each step to concrete choices to prevent unnecessary exploration
190
- 3. **Always provide a Skip option** — nothing is forced
191
- 4. **Extensible structure** — includes recommended plugin step, expandable to additional categories in the future
192
-
193
- ## State Management
194
-
195
- Setup operates via sequential prompt_user calls with no state file.
196
- Configuration results are written to the scope-appropriate settings file at each step.
@@ -1,5 +0,0 @@
1
- name: nx-setup
2
- description: Interactive project setup wizard for Nexus configuration.
3
- summary: "Interactive Nexus configuration wizard"
4
- manual_only: true
5
- id: nx-setup