@moreih29/nexus-core 0.1.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/LICENSE +21 -0
- package/README.md +86 -0
- package/agents/architect/body.md +160 -0
- package/agents/architect/meta.yml +13 -0
- package/agents/designer/body.md +109 -0
- package/agents/designer/meta.yml +13 -0
- package/agents/engineer/body.md +92 -0
- package/agents/engineer/meta.yml +11 -0
- package/agents/postdoc/body.md +106 -0
- package/agents/postdoc/meta.yml +13 -0
- package/agents/researcher/body.md +122 -0
- package/agents/researcher/meta.yml +12 -0
- package/agents/reviewer/body.md +123 -0
- package/agents/reviewer/meta.yml +12 -0
- package/agents/strategist/body.md +100 -0
- package/agents/strategist/meta.yml +13 -0
- package/agents/tester/body.md +180 -0
- package/agents/tester/meta.yml +12 -0
- package/agents/writer/body.md +108 -0
- package/agents/writer/meta.yml +11 -0
- package/manifest.json +317 -0
- package/package.json +50 -0
- package/schema/README.md +69 -0
- package/schema/agent.schema.json +23 -0
- package/schema/common.schema.json +21 -0
- package/schema/manifest.schema.json +61 -0
- package/schema/skill.schema.json +39 -0
- package/schema/vocabulary.schema.json +92 -0
- package/skills/nx-init/body.md +199 -0
- package/skills/nx-init/meta.yml +4 -0
- package/skills/nx-plan/body.md +336 -0
- package/skills/nx-plan/meta.yml +7 -0
- package/skills/nx-run/body.md +149 -0
- package/skills/nx-run/meta.yml +5 -0
- package/skills/nx-setup/body.md +196 -0
- package/skills/nx-setup/meta.yml +4 -0
- package/skills/nx-sync/body.md +81 -0
- package/skills/nx-sync/meta.yml +6 -0
- package/vocabulary/capabilities.yml +32 -0
- package/vocabulary/categories.yml +11 -0
- package/vocabulary/resume-tiers.yml +11 -0
- package/vocabulary/tags.yml +51 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
## Role
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Constraints
|
|
6
|
+
|
|
7
|
+
- NEVER modify files via Bash (sed, echo >, cat <<EOF, tee, etc.) — always use Edit/Write tools (Gate enforced)
|
|
8
|
+
- NEVER terminate while pending tasks remain (Gate Stop nonstop)
|
|
9
|
+
- NEVER spawn a new branch without checking for main/master first
|
|
10
|
+
- MUST check tasks.json before executing — if absent, write the plan first
|
|
11
|
+
- MUST spawn subagents per-task based on owner field — Do not handle multi-task work as Lead solo when task count ≥ 2 or target files ≥ 2
|
|
12
|
+
- MUST NOT spawn parallel Engineers if their target files overlap — serialize instead
|
|
13
|
+
- MUST call nx_task_close before completing the cycle — archive plan+tasks to history.json
|
|
14
|
+
|
|
15
|
+
## Guidelines
|
|
16
|
+
|
|
17
|
+
## Flow
|
|
18
|
+
|
|
19
|
+
### Step 1: Intake (Lead)
|
|
20
|
+
|
|
21
|
+
- **User specifies agents/direction** → follow the instruction as given.
|
|
22
|
+
- **[run] only (no direction)** → confirm direction with user before proceeding.
|
|
23
|
+
- User decides scope and composition. Lead fills in what is not specified.
|
|
24
|
+
- **Branch Guard**: if on main/master, create a branch appropriate to the task type before proceeding (prefix: `feat/`, `fix/`, `chore/`, `research/`, etc. — Lead's judgment). Auto-create without user confirmation.
|
|
25
|
+
- Check for `tasks.json`:
|
|
26
|
+
- **Exists** → read it and proceed to Step 2.
|
|
27
|
+
- **Absent** → auto-invoke `Skill({ skill: "claude-nexus:nx-plan", args: "auto" })` to generate tasks.json. Do NOT ask — `[run]` implies execution intent. After plan generation, proceed to Step 2.
|
|
28
|
+
- If tasks.json exists, check prior decisions with `nx_plan_status`.
|
|
29
|
+
|
|
30
|
+
### Step 1.5: TUI Progress
|
|
31
|
+
|
|
32
|
+
Register tasks for visual progress tracking (Ctrl+T):
|
|
33
|
+
|
|
34
|
+
- **≤ 10 tasks**: `TaskCreate` per task
|
|
35
|
+
- **> 10 tasks**: group by `plan_issue`, `TaskCreate` per group
|
|
36
|
+
- Use `TaskUpdate` to reflect progress (`in_progress` / `completed`) as execution proceeds
|
|
37
|
+
- **Skip only if**: non-TTY environment (VSCode, headless)
|
|
38
|
+
- **Known issue**: TUI may freeze during auto-compact (#27919) — task data on disk remains correct
|
|
39
|
+
|
|
40
|
+
### Step 2: Execute
|
|
41
|
+
|
|
42
|
+
- **Present tasks.json** to the user — show task list with owner, deps, approach summary. Proceed immediately without asking for confirmation.
|
|
43
|
+
- Execute tasks based on `owner` field:
|
|
44
|
+
- `owner: "lead"` → Lead handles directly
|
|
45
|
+
- `owner: "engineer"`, `"researcher"`, `"writer"`, etc. → spawn subagent matching the owner role
|
|
46
|
+
- `owner: "architect"`, `"tester"`, `"reviewer"`, etc. → spawn corresponding HOW/CHECK subagent
|
|
47
|
+
- For each subagent, pass the task's `context`, `approach`, and `acceptance` as the prompt.
|
|
48
|
+
- **Parallel execution**: independent tasks (no overlapping target files, no deps) can be spawned in parallel. Tasks sharing target files must be serialized.
|
|
49
|
+
- **SubagentStop escalation chain**: when a subagent stops with incomplete work:
|
|
50
|
+
1. **Do/Check failed** → spawn the relevant HOW agent (e.g., Engineer failed → Architect) to diagnose the failure, review the approach, and suggest adjustments.
|
|
51
|
+
2. **Re-delegate** → apply HOW's adjusted approach and re-delegate to a new Do/Check agent.
|
|
52
|
+
3. **HOW also failed** → Lead reports the failure to the user with diagnosis details and asks for direction.
|
|
53
|
+
- Maximum: 1 HOW diagnosis + 1 re-delegation per task. After that, escalate to user.
|
|
54
|
+
- Relevant HOW mapping: Engineer→Architect, Writer→Strategist, Researcher→Postdoc, Tester→Architect.
|
|
55
|
+
|
|
56
|
+
### Resume Dispatch Rule
|
|
57
|
+
|
|
58
|
+
For each task, Lead chooses between fresh spawn and resume based on the `owner`'s `resume_tier`:
|
|
59
|
+
|
|
60
|
+
1. Lookup `resume_tier` from `agents/{owner}.md` frontmatter (if absent → treat as `ephemeral`).
|
|
61
|
+
2. If `ephemeral` → fresh spawn. Stop.
|
|
62
|
+
3. If `bounded` → check tasks.json history: did the same `owner` previously work on overlapping target files? If yes AND no intervening edits by other agents → resume candidate. Otherwise fresh. Always include "re-read target files before any modification" instruction in the resume prompt.
|
|
63
|
+
4. If `persistent` → resume by default if the same agent worked earlier in this run. Cross-task reuse allowed.
|
|
64
|
+
5. Before issuing SendMessage for any resume, verify `.nexus/state/runtime.json` has `teams_enabled: true`. Otherwise fall back to fresh spawn silently — do NOT throw an error.
|
|
65
|
+
|
|
66
|
+
### Step 3: Verify (Lead + Check subagents)
|
|
67
|
+
|
|
68
|
+
**Lead**: confirm build + E2E pass/fail.
|
|
69
|
+
|
|
70
|
+
**Tester — acceptance criteria verification**:
|
|
71
|
+
- Tester reads each completed task's `acceptance` field from tasks.json
|
|
72
|
+
- Verifies each criterion with PASS/FAIL judgment
|
|
73
|
+
- All criteria must pass for the task to be considered done
|
|
74
|
+
- If any criterion fails → Step 2 rework (reopen task)
|
|
75
|
+
- Tester spawn conditions (any one triggers):
|
|
76
|
+
- tasks.json contains at least 1 task with an `acceptance` field
|
|
77
|
+
- 3 or more files changed
|
|
78
|
+
- Existing test files modified
|
|
79
|
+
- External API/DB access code changed
|
|
80
|
+
- Failure history for this area exists in memory
|
|
81
|
+
|
|
82
|
+
**Reviewer — writer deliverable verification**:
|
|
83
|
+
- Whenever Writer produced a deliverable in Step 2, Reviewer MUST verify it
|
|
84
|
+
- Writer → Reviewer is a mandatory pairing, not optional
|
|
85
|
+
- Reviewer checks: factual accuracy, source consistency, grammar/format
|
|
86
|
+
|
|
87
|
+
- If issues found: code problems → Step 2 rework; design problems → re-run nx-plan before re-executing.
|
|
88
|
+
|
|
89
|
+
### Step 4: Complete
|
|
90
|
+
|
|
91
|
+
Execute in order:
|
|
92
|
+
|
|
93
|
+
1. **nx-sync**: invoke `Skill({ skill: "claude-nexus:nx-sync" })` if code changes were made in this cycle. Best effort — failure does not block cycle completion.
|
|
94
|
+
2. **nx_task_close**: call to archive plan+tasks to history.json. This updates `.nexus/history.json`.
|
|
95
|
+
3. **git commit**: stage and commit source changes, build artifacts (`bridge/`, `scripts/`), `.nexus/history.json`, and any modified `.nexus/memory/` or `.nexus/context/`. Use explicit `git add` with paths (not `git add -A`) and a HEREDOC commit message with `Co-Authored-By`. This ensures the cycle's history archive lands in the same commit as the code changes, giving a 1:1 cycle-commit mapping.
|
|
96
|
+
4. **Report**: summarize to user — changed files, key decisions applied, and suggested next steps. Merge/push is the user's decision and outside this skill's scope.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Reference Framework
|
|
101
|
+
|
|
102
|
+
| Phase | Owner | Content |
|
|
103
|
+
|-------|-------|---------|
|
|
104
|
+
| 1. Intake | Lead | Clarify intent, confirm direction, Branch Guard, check tasks.json / invoke nx-plan if absent |
|
|
105
|
+
| 2. Execute | Do subagents | Spawn per-task by owner, delegation criteria, parallel where safe |
|
|
106
|
+
| 3. Verify | Lead + Check subagent | Build check, quality verification |
|
|
107
|
+
| 4. Complete | Lead | nx-sync, nx_task_close, git commit, report |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Structured Delegation
|
|
112
|
+
|
|
113
|
+
When Lead delegates tasks to subagents, structure the prompt in this format:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
TASK: {specific deliverable}
|
|
117
|
+
|
|
118
|
+
CONTEXT:
|
|
119
|
+
- Current state: {relevant code/doc locations}
|
|
120
|
+
- Dependencies: {results from prior tasks}
|
|
121
|
+
- Prior decisions: {relevant decisions}
|
|
122
|
+
- Target files: {file path list}
|
|
123
|
+
|
|
124
|
+
CONSTRAINTS:
|
|
125
|
+
- {constraint 1}
|
|
126
|
+
- {constraint 2}
|
|
127
|
+
|
|
128
|
+
ACCEPTANCE:
|
|
129
|
+
- {completion criterion 1}
|
|
130
|
+
- {completion criterion 2}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Key Principles
|
|
136
|
+
|
|
137
|
+
1. **Lead = interpret user direction + coordinate + own tasks**
|
|
138
|
+
2. **User decides scope and composition**
|
|
139
|
+
3. **tasks.json is the single source of state** — produced by nx-plan, read at Step 1, updated as tasks complete
|
|
140
|
+
4. **Do subagents = execute per owner** — Lead spawns one subagent per task based on the `owner` field. Engineers focus on code changes. Doc updates are done in bulk by Writer in Step 4. Researcher records to reference/ immediately.
|
|
141
|
+
5. **Check subagents = verify** — Lead's discretion + 4 conditions
|
|
142
|
+
6. **SubagentStop escalation** — when a subagent stops with incomplete work, escalate through HOW diagnosis → re-delegation → user report. Max 1 cycle per task.
|
|
143
|
+
7. **Gate Stop nonstop** — cannot terminate while pending tasks exist
|
|
144
|
+
8. **Plan first** — if tasks.json is absent, nx-plan must run before Step 2
|
|
145
|
+
9. **No file modification via Bash** — sed, echo >, cat <<EOF, tee, and similar Bash-based file edits are prohibited. Always use Edit/Write tools (Gate enforced)
|
|
146
|
+
## State Management
|
|
147
|
+
|
|
148
|
+
`.nexus/state/tasks.json` — produced by nx-plan, managed via `nx_task_add`/`nx_task_update`. Gate Stop enforcement.
|
|
149
|
+
On cycle end, archive plan+tasks to `.nexus/history.json` via `nx_task_close`.
|
|
@@ -0,0 +1,196 @@
|
|
|
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 `AskUserQuestion`, with no open-ended exploration.
|
|
4
|
+
|
|
5
|
+
## Constraints
|
|
6
|
+
|
|
7
|
+
- NEVER accept free-text input — every step must use `AskUserQuestion` 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
|
+
AskUserQuestion({
|
|
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
|
+
AskUserQuestion({
|
|
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
|
+
AskUserQuestion({
|
|
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
|
+
AskUserQuestion({
|
|
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
|
+
AskUserQuestion({
|
|
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 AskUserQuestion** — 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 AskUserQuestion calls with no state file.
|
|
196
|
+
Configuration results are written to the scope-appropriate settings file at each step.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
## Role
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Constraints
|
|
6
|
+
|
|
7
|
+
- NEVER delete existing context files — only update or add
|
|
8
|
+
- NEVER modify source code — this skill updates documentation only
|
|
9
|
+
- NEVER guess information that cannot be confirmed from sources — mark as "needs verification" instead
|
|
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
|
|
12
|
+
|
|
13
|
+
## Guidelines
|
|
14
|
+
|
|
15
|
+
## Trigger
|
|
16
|
+
|
|
17
|
+
- `[sync]` — synchronize .nexus/context/ with current project state
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
|
|
21
|
+
### Step 1: Gather Sources
|
|
22
|
+
|
|
23
|
+
Collect information from all available sources:
|
|
24
|
+
|
|
25
|
+
1. **git diff** — run `git diff --name-only HEAD~10..HEAD` (or use recent commits to identify changed files)
|
|
26
|
+
- Identifies which source files changed
|
|
27
|
+
- Primary signal for determining which context documents may be stale
|
|
28
|
+
2. **Conversation context** — if available in current session
|
|
29
|
+
- Design decisions discussed but not yet reflected in context documents
|
|
30
|
+
- Supplementary source for all updates
|
|
31
|
+
|
|
32
|
+
### Step 2: Read Current Context
|
|
33
|
+
|
|
34
|
+
Read all files in `.nexus/context/` using the Read tool:
|
|
35
|
+
|
|
36
|
+
- List files: `ls .nexus/context/`
|
|
37
|
+
- Read each file to understand current documented state
|
|
38
|
+
- Compare against detected changes to identify gaps or stale content
|
|
39
|
+
|
|
40
|
+
Only update files where a concrete change is detected. If no staleness is found, report "already current" and skip.
|
|
41
|
+
|
|
42
|
+
### Step 3: Execute Updates
|
|
43
|
+
|
|
44
|
+
Spawn Writer agent to update affected context documents:
|
|
45
|
+
|
|
46
|
+
```
|
|
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}" })
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The Writer agent:
|
|
52
|
+
- Reads each relevant context file with the Read tool
|
|
53
|
+
- Applies targeted updates — changes only the sections that are stale
|
|
54
|
+
- Writes the updated file back with the Write tool
|
|
55
|
+
- Does not rewrite files that are already accurate
|
|
56
|
+
|
|
57
|
+
### Step 4: Report
|
|
58
|
+
|
|
59
|
+
Report to user:
|
|
60
|
+
- Which context files were scanned
|
|
61
|
+
- Which files were updated and what changed
|
|
62
|
+
- Which files were already up to date
|
|
63
|
+
- Any items marked "needs verification"
|
|
64
|
+
|
|
65
|
+
## Key Principles
|
|
66
|
+
|
|
67
|
+
1. **Targeted updates over full rewrites** — only change sections that are actually stale
|
|
68
|
+
2. **Evidence-based** — every update must trace to a source (git diff or conversation)
|
|
69
|
+
3. **Preserve structure** — maintain existing document organization, headings, and format
|
|
70
|
+
4. **No speculation** — if a change's impact on context docs is unclear, flag it rather than guess
|
|
71
|
+
|
|
72
|
+
## What .nexus/context/ Contains
|
|
73
|
+
|
|
74
|
+
Context documents capture abstract knowledge that cannot be read directly from source code:
|
|
75
|
+
|
|
76
|
+
- Design principles and philosophy
|
|
77
|
+
- Architectural decisions and their rationale
|
|
78
|
+
- Development stack choices and constraints
|
|
79
|
+
- Project conventions and standards
|
|
80
|
+
|
|
81
|
+
These documents are updated when code changes reflect a shift in principles, a new architectural decision is made, or the development stack evolves. They are not updated for routine code additions that do not change the underlying design.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Capabilities restrict an agent's access to harness-provided tools.
|
|
2
|
+
# NOT constraints on nexus-core's own scripts/ or tooling.
|
|
3
|
+
|
|
4
|
+
capabilities:
|
|
5
|
+
- id: no_file_edit
|
|
6
|
+
description: "Agent cannot create or modify files in the user's workspace"
|
|
7
|
+
harness_mapping:
|
|
8
|
+
claude_code:
|
|
9
|
+
- Edit
|
|
10
|
+
- Write
|
|
11
|
+
- NotebookEdit
|
|
12
|
+
opencode:
|
|
13
|
+
- edit
|
|
14
|
+
- write
|
|
15
|
+
- patch
|
|
16
|
+
- multiedit
|
|
17
|
+
|
|
18
|
+
- id: no_task_create
|
|
19
|
+
description: "Agent cannot create new tasks in the Nexus task pipeline"
|
|
20
|
+
harness_mapping:
|
|
21
|
+
claude_code:
|
|
22
|
+
- mcp__plugin_claude-nexus_nx__nx_task_add
|
|
23
|
+
opencode:
|
|
24
|
+
- nx_task_add
|
|
25
|
+
|
|
26
|
+
- id: no_task_update
|
|
27
|
+
description: "Agent cannot update the state of existing Nexus tasks"
|
|
28
|
+
harness_mapping:
|
|
29
|
+
claude_code:
|
|
30
|
+
- mcp__plugin_claude-nexus_nx__nx_task_update
|
|
31
|
+
opencode:
|
|
32
|
+
- nx_task_update
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Agent role categories. Determined by reasoning surface vs artifact surface.
|
|
2
|
+
|
|
3
|
+
categories:
|
|
4
|
+
- id: how
|
|
5
|
+
description: "분석·자문. 깊은 맥락 유지가 핵심 자산. architect, designer, postdoc, strategist."
|
|
6
|
+
|
|
7
|
+
- id: do
|
|
8
|
+
description: "실행. 산출물(artifact) 단위로 작업하고 종료. engineer, writer, researcher."
|
|
9
|
+
|
|
10
|
+
- id: check
|
|
11
|
+
description: "검증. 항상 fresh한 관점에서 독립적으로 검사. tester, reviewer."
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Agent session resumability tiers. Reflects what kind of surface the agent produces.
|
|
2
|
+
|
|
3
|
+
resume_tiers:
|
|
4
|
+
- id: persistent
|
|
5
|
+
description: "세션 전체를 지속한다. HOW 카테고리 에이전트와 researcher. 맥락 누적이 핵심 자산."
|
|
6
|
+
|
|
7
|
+
- id: bounded
|
|
8
|
+
description: "artifact 단위로 지속한다. engineer, writer. 특정 산출물 완성 후 종료."
|
|
9
|
+
|
|
10
|
+
- id: ephemeral
|
|
11
|
+
description: "항상 새로 시작한다. tester, reviewer. 이전 맥락 없이 독립 검증해야 하기 때문."
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Canonical definition of all Nexus tag triggers.
|
|
2
|
+
# Slash command triggers are NOT stored here — each harness resolves them
|
|
3
|
+
# in its own command namespace.
|
|
4
|
+
# variants field is valid for both skill and inline_action types.
|
|
5
|
+
|
|
6
|
+
tags:
|
|
7
|
+
# skill tags (3 entries, 4 triggers)
|
|
8
|
+
- id: plan
|
|
9
|
+
trigger: "[plan]"
|
|
10
|
+
type: skill
|
|
11
|
+
skill: nx-plan
|
|
12
|
+
description: "Activates nx-plan skill for structured multi-perspective analysis and decision recording"
|
|
13
|
+
variants: ["auto"] # [plan:auto] for autonomous mode
|
|
14
|
+
|
|
15
|
+
- id: run
|
|
16
|
+
trigger: "[run]"
|
|
17
|
+
type: skill
|
|
18
|
+
skill: nx-run
|
|
19
|
+
description: "Activates nx-run skill for task execution with subagent composition"
|
|
20
|
+
|
|
21
|
+
- id: sync
|
|
22
|
+
trigger: "[sync]"
|
|
23
|
+
type: skill
|
|
24
|
+
skill: nx-sync
|
|
25
|
+
description: "Activates nx-sync skill for .nexus/context/ knowledge synchronization"
|
|
26
|
+
|
|
27
|
+
# inline action tags (4 entries, 5 triggers)
|
|
28
|
+
- id: d
|
|
29
|
+
trigger: "[d]"
|
|
30
|
+
type: inline_action
|
|
31
|
+
handler: nx_plan_decide
|
|
32
|
+
description: "Records a decision during an active plan session"
|
|
33
|
+
|
|
34
|
+
- id: m
|
|
35
|
+
trigger: "[m]"
|
|
36
|
+
type: inline_action
|
|
37
|
+
handler: memory_store
|
|
38
|
+
description: "Stores a lesson or reference to .nexus/memory/"
|
|
39
|
+
|
|
40
|
+
- id: m-gc
|
|
41
|
+
trigger: "[m:gc]"
|
|
42
|
+
type: inline_action
|
|
43
|
+
handler: memory_gc
|
|
44
|
+
description: "Garbage-collects .nexus/memory/ by merging or removing stale entries"
|
|
45
|
+
|
|
46
|
+
- id: rule
|
|
47
|
+
trigger: "[rule]"
|
|
48
|
+
type: inline_action
|
|
49
|
+
handler: rule_store
|
|
50
|
+
description: "Stores a project rule to .nexus/rules/. [rule:*] supports tag parameter."
|
|
51
|
+
variants: ["*"] # [rule:any-tag] for parameterized variants
|