@inkobytes/nexus 1.0.7 → 1.0.8
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/CHANGELOG.md +6 -0
- package/README.md +28 -1
- package/bin/nexus.js +5 -1
- package/docs/hooks.md +94 -0
- package/docs/nexus-dynamic-governed-loops.md +135 -0
- package/package.json +2 -1
- package/skills/nexus/SKILL.md +10 -4
- package/src/commands/doctor.js +79 -189
- package/src/commands/hooks.js +305 -0
- package/src/commands/init.js +7 -172
- package/src/lib/protocolText.js +196 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.8 - 2026-06-10
|
|
4
|
+
|
|
5
|
+
- Added a shared protocol wording source so `nexus init`, `nexus doctor`, README repair, and tests stay aligned.
|
|
6
|
+
- Tightened generated agent protocol around required continuity/latest-memory reads and claim-before-read/edit behavior.
|
|
7
|
+
- Added `nexus hooks install --agent all` for installing Codex, Claude, and Gemini guard hooks in one pass.
|
|
8
|
+
|
|
3
9
|
## 1.0.7 - 2026-06-06
|
|
4
10
|
|
|
5
11
|
- Added `nexus install-skill` to install the bundled Nexus skill into `~/.agents/skills/nexus`.
|
package/README.md
CHANGED
|
@@ -133,6 +133,12 @@ Memory folders are month-based from the start, for example:
|
|
|
133
133
|
.gemini/memories/2026-May/
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
Memory indexes stay newest-first and link to entries with one-line outcomes:
|
|
137
|
+
|
|
138
|
+
```md
|
|
139
|
+
- [2026-06-09-1430-hook-protocol-fix](2026-June/2026-06-09-1430-hook-protocol-fix.md) - tightened hook claim guidance
|
|
140
|
+
```
|
|
141
|
+
|
|
136
142
|
If you only want to inspect an existing repo before changing anything, run:
|
|
137
143
|
|
|
138
144
|
```bash
|
|
@@ -253,6 +259,25 @@ nexus install-skill --target ~/.agents/skills/nexus
|
|
|
253
259
|
|
|
254
260
|
By default, Nexus copies `skills/nexus` from the published package into `~/.agents/skills/nexus`. Restart or refresh your agent session after installing so its skill registry can discover the new `nexus` skill.
|
|
255
261
|
|
|
262
|
+
### `nexus hooks install --agent @codex|@claude|@gemini|all [--target <path>] [--force]`
|
|
263
|
+
|
|
264
|
+
Install an agent-specific local guard hook.
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
nexus hooks install --agent @codex
|
|
268
|
+
nexus hooks install --agent @claude
|
|
269
|
+
nexus hooks install --agent @gemini
|
|
270
|
+
nexus hooks install --agent all
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Hooks block writes in Nexus repos until the exact target path is claimed, then give the agent a compact recovery command. Each hook uses the matching claim handle, so Codex sees `@codex`, Claude sees `@claude`, and Gemini sees `@gemini`.
|
|
274
|
+
|
|
275
|
+
Use `--agent all` to install the default Codex, Claude, and Gemini hooks in one pass. `--target` is only for single-agent installs.
|
|
276
|
+
|
|
277
|
+
Hook installation writes outside the repo, so `nexus doctor --fix` does not install hooks. Use `nexus doctor --hooks` to report missing, foreign, wrong-agent, or current hooks.
|
|
278
|
+
|
|
279
|
+
See [docs/hooks.md](./docs/hooks.md) for install targets and behavior.
|
|
280
|
+
|
|
256
281
|
### `nexus ledger [--json]`
|
|
257
282
|
|
|
258
283
|
Show completed task entries from `_NEXUS_LEDGER.md`.
|
|
@@ -425,7 +450,7 @@ The agent rule of thumb:
|
|
|
425
450
|
1. Run `nexus start` when entering an existing repo; it does not replace claim/release.
|
|
426
451
|
2. Read `_NEXUS_CONSTITUTION.md`.
|
|
427
452
|
3. Read `USER.md` when present.
|
|
428
|
-
4. Read continuity and latest memory
|
|
453
|
+
4. Read continuity and latest memory at session start, `nexus start`, or resume.
|
|
429
454
|
5. Read `_NEXUS_QUEUE.md` before taking follow-on work.
|
|
430
455
|
6. Claim before touching shared project files.
|
|
431
456
|
7. Release each claimed tracked file as soon as it reaches a coherent checkpoint.
|
|
@@ -465,6 +490,8 @@ Nexus ships an agent skill at `skills/nexus/SKILL.md`.
|
|
|
465
490
|
|
|
466
491
|
The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> work -> release -> next`.
|
|
467
492
|
|
|
493
|
+
Generated agent protocol text lives in `src/lib/protocolText.js`. Update that module first when changing shared protocol wording, then run doctor/init tests so scaffolded guides, README repair, and the bundled skill stay aligned.
|
|
494
|
+
|
|
468
495
|
## Legacy Helper Transition
|
|
469
496
|
|
|
470
497
|
Older Nexus experiments used shell helpers:
|
package/bin/nexus.js
CHANGED
|
@@ -19,6 +19,7 @@ const COMMANDS = {
|
|
|
19
19
|
metrics: () => import('../src/commands/metrics.js'),
|
|
20
20
|
ledger: () => import('../src/commands/ledger.js'),
|
|
21
21
|
drill: () => import('../src/commands/drill.js'),
|
|
22
|
+
hooks: () => import('../src/commands/hooks.js'),
|
|
22
23
|
soul: () => import('../src/commands/soul.js'),
|
|
23
24
|
'install-skill': () => import('../src/commands/install-skill.js'),
|
|
24
25
|
chmod: () => import('../src/commands/chmod.js'),
|
|
@@ -26,7 +27,7 @@ const COMMANDS = {
|
|
|
26
27
|
help: () => import('../src/commands/help.js'),
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
const VERSION = '1.0.
|
|
30
|
+
const VERSION = '1.0.8';
|
|
30
31
|
const COLORS = createColors();
|
|
31
32
|
|
|
32
33
|
const args = argv.slice(2);
|
|
@@ -76,6 +77,7 @@ function printHelp() {
|
|
|
76
77
|
['chmod [--list] [--init]', 'Show or set promptCHMOD permissions'],
|
|
77
78
|
['db <backup|list|restore|schedule>', 'Database backup and recovery'],
|
|
78
79
|
['drill <list|show|run|report>', 'Inspect or run protocol drills'],
|
|
80
|
+
['hooks install --agent @handle|all', 'Install agent-specific local guard hooks'],
|
|
79
81
|
['soul [--file <path>] [--status | --remove]', 'Manage local soul overlay in agent files'],
|
|
80
82
|
['install-skill [--target <path>] [--force]', 'Install bundled Nexus skill into ~/.agents/skills'],
|
|
81
83
|
['help', 'Show this help'],
|
|
@@ -91,6 +93,8 @@ function printHelp() {
|
|
|
91
93
|
'nexus metrics --json',
|
|
92
94
|
'nexus ledger backfill',
|
|
93
95
|
'nexus drill show wrong-repo-push',
|
|
96
|
+
'nexus hooks install --agent @codex',
|
|
97
|
+
'nexus hooks install --agent all',
|
|
94
98
|
'nexus install-skill',
|
|
95
99
|
'nexus claim src/lib/components/login/ @claude "Building login UI"',
|
|
96
100
|
'nexus release src/lib/components/login/ "feat: login form component"',
|
package/docs/hooks.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Nexus Hooks
|
|
2
|
+
|
|
3
|
+
Nexus hooks are optional local guardrails for agent CLIs. They block file writes in Nexus repos until the target path has a matching Nexus claim.
|
|
4
|
+
|
|
5
|
+
Hooks are useful because agent instruction files can be forgotten after context compaction. The hook gives the agent a short recovery command instead of letting it edit around the protocol.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
nexus hooks install --agent @codex
|
|
11
|
+
nexus hooks install --agent @claude
|
|
12
|
+
nexus hooks install --agent @gemini
|
|
13
|
+
nexus hooks install --agent all
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Supported agents:
|
|
17
|
+
|
|
18
|
+
- `@codex`
|
|
19
|
+
- `@claude`
|
|
20
|
+
- `@gemini`
|
|
21
|
+
|
|
22
|
+
Each installed hook bakes in the matching claim handle, so a Codex hook says `@codex`, a Claude hook says `@claude`, and a Gemini hook says `@gemini`.
|
|
23
|
+
|
|
24
|
+
Use `--agent all` to install all default Codex, Claude, and Gemini hooks in one pass. `--target` is only available for a single agent because each agent has a different default file.
|
|
25
|
+
|
|
26
|
+
## Default Targets
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
@codex -> ~/.codex/hooks/pre_tool_use_guard.py
|
|
30
|
+
@claude -> ~/.claude/hooks/nexus_pre_tool_use_guard.py
|
|
31
|
+
@gemini -> ~/.gemini/hooks/nexus_pre_tool_use_guard.py
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Use `--target` when your agent CLI needs a different hook path:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
nexus hooks install --agent @codex --target ~/.codex/hooks/pre_tool_use_guard.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If a hook file already exists, Nexus does not overwrite it unless it is already a current Nexus hook. Use `--force` only after reviewing the existing file:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
nexus hooks install --agent @codex --force
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## What The Hook Blocks
|
|
47
|
+
|
|
48
|
+
The hook looks for writes to files in a Nexus repo. If the file is not claimed, it denies the tool call with a compact message:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
CLAIM FIRST: README.md
|
|
52
|
+
cd /path/to/repo && nexus claim README.md @codex "Describe the edit"
|
|
53
|
+
Retry edit. No workaround.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For multiple files, it adds:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
If multiple files are listed, claim each exact path.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The hook discovers the Nexus repo root from the target path or current working directory. It checks the real Nexus lock path encoding, including nested paths such as `docs~2Fguide.md.lock`.
|
|
63
|
+
|
|
64
|
+
## Claim Exemptions
|
|
65
|
+
|
|
66
|
+
The hook allows agent-local continuity and memory handoff files without a claim:
|
|
67
|
+
|
|
68
|
+
- `.codex/CONTINUITY.md`
|
|
69
|
+
- `.codex/memories/`
|
|
70
|
+
- `.claude/CONTINUITY.md`
|
|
71
|
+
- `.claude/memories/`
|
|
72
|
+
- `.gemini/CONTINUITY.md`
|
|
73
|
+
- `.gemini/memories/`
|
|
74
|
+
|
|
75
|
+
Agent instruction files such as `.codex/AGENTS.md`, `.claude/CLAUDE.md`, and `.gemini/GEMINI.md` still require claim/release when they are shared project files.
|
|
76
|
+
|
|
77
|
+
## Doctor Check
|
|
78
|
+
|
|
79
|
+
Hook installation writes outside the repo, so `nexus doctor --fix` does not install or replace hooks.
|
|
80
|
+
|
|
81
|
+
To audit hook status explicitly:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
nexus doctor --hooks
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Doctor reports whether each supported agent hook is:
|
|
88
|
+
|
|
89
|
+
- `current`
|
|
90
|
+
- `missing`
|
|
91
|
+
- `foreign`
|
|
92
|
+
- `wrong-agent`
|
|
93
|
+
|
|
94
|
+
Use `nexus hooks install --agent <handle>` to install or refresh a hook.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Nexus Dynamic and Governed Loops Graphic Brief
|
|
2
|
+
|
|
3
|
+
## Core Insight
|
|
4
|
+
|
|
5
|
+
Nexus is dynamic before approval and deterministic after approval.
|
|
6
|
+
|
|
7
|
+
The system already supports dynamism because agents can discover issues, propose work, shape tasks, and surface dependencies. That dynamism is easy to miss because the execution loop is intentionally governed and repeatable.
|
|
8
|
+
|
|
9
|
+
## Graphic Goal
|
|
10
|
+
|
|
11
|
+
Create a clear visual that explains how Nexus handles both:
|
|
12
|
+
|
|
13
|
+
- dynamic discovery, planning, and proposal
|
|
14
|
+
- governed execution through approved queue work
|
|
15
|
+
|
|
16
|
+
The graphic should help users understand that Nexus is not a free-roaming autonomous agent system. It is a coordination workflow where agents can think and propose freely, but can only execute approved scoped work.
|
|
17
|
+
|
|
18
|
+
## Suggested Diagram Structure
|
|
19
|
+
|
|
20
|
+
Show two connected loops with a visible approval boundary between them.
|
|
21
|
+
|
|
22
|
+
### Loop 1: Dynamic Discovery Loop
|
|
23
|
+
|
|
24
|
+
Labels:
|
|
25
|
+
|
|
26
|
+
1. Idea or observation
|
|
27
|
+
2. Inspect context
|
|
28
|
+
3. Find issue or opportunity
|
|
29
|
+
4. Propose task
|
|
30
|
+
5. Shape scope, files, dependencies, tradeoffs
|
|
31
|
+
6. Wait for approval
|
|
32
|
+
|
|
33
|
+
Tone:
|
|
34
|
+
|
|
35
|
+
- exploratory
|
|
36
|
+
- generative
|
|
37
|
+
- allowed to be dynamic
|
|
38
|
+
- no file-changing execution unless separately approved and claimed
|
|
39
|
+
|
|
40
|
+
### Boundary: Approval Gate
|
|
41
|
+
|
|
42
|
+
Main label:
|
|
43
|
+
|
|
44
|
+
> Dynamic before approval. Deterministic after approval.
|
|
45
|
+
|
|
46
|
+
Supporting labels:
|
|
47
|
+
|
|
48
|
+
- human review
|
|
49
|
+
- `Review: approved`
|
|
50
|
+
- `Approved by: human`
|
|
51
|
+
- `Auto-flow: yes`
|
|
52
|
+
- task contract is complete
|
|
53
|
+
|
|
54
|
+
This gate should visually separate proposal from execution.
|
|
55
|
+
|
|
56
|
+
### Loop 2: Governed Execution Loop
|
|
57
|
+
|
|
58
|
+
Labels:
|
|
59
|
+
|
|
60
|
+
1. Ready Queue
|
|
61
|
+
2. `nexus next @agent`
|
|
62
|
+
3. `nexus claim <path> @agent "intent"`
|
|
63
|
+
4. Work inside claimed surface
|
|
64
|
+
5. Validate
|
|
65
|
+
6. `nexus release <path> "message"`
|
|
66
|
+
7. Standup/report if useful
|
|
67
|
+
8. Next safe task or Standby
|
|
68
|
+
|
|
69
|
+
Tone:
|
|
70
|
+
|
|
71
|
+
- deterministic
|
|
72
|
+
- repeatable
|
|
73
|
+
- file-scoped
|
|
74
|
+
- approval-bound
|
|
75
|
+
- safe for multi-agent concurrency
|
|
76
|
+
|
|
77
|
+
## Key Message
|
|
78
|
+
|
|
79
|
+
Agents may discover and propose freely.
|
|
80
|
+
Agents may execute only approved scoped work.
|
|
81
|
+
|
|
82
|
+
## What The Graphic Should Prevent
|
|
83
|
+
|
|
84
|
+
- Thinking Nexus is only a rigid task runner.
|
|
85
|
+
- Thinking Nexus lets agents freely invent and execute work.
|
|
86
|
+
- Treating `nexus next` as an ideation engine.
|
|
87
|
+
- Treating proposed work as executable work.
|
|
88
|
+
- Forgetting the approval boundary.
|
|
89
|
+
|
|
90
|
+
## Possible Formats
|
|
91
|
+
|
|
92
|
+
- Mermaid draft for README
|
|
93
|
+
- FigJam/Figma system map
|
|
94
|
+
- Dashboard explainer panel
|
|
95
|
+
- README hero diagram
|
|
96
|
+
- Short docs page with the two-loop graphic and examples
|
|
97
|
+
|
|
98
|
+
## Draft Mermaid Shape
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
flowchart LR
|
|
102
|
+
subgraph Discovery["Dynamic Discovery Loop"]
|
|
103
|
+
A[Idea or observation] --> B[Inspect context]
|
|
104
|
+
B --> C[Find issue or opportunity]
|
|
105
|
+
C --> D[Propose task]
|
|
106
|
+
D --> E[Shape scope, files, dependencies, tradeoffs]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
E --> Gate{Approval Gate}
|
|
110
|
+
|
|
111
|
+
Gate -->|Review approved + Auto-flow yes| R[Ready Queue]
|
|
112
|
+
Gate -->|Needs planning or approval| D
|
|
113
|
+
|
|
114
|
+
subgraph Execution["Governed Execution Loop"]
|
|
115
|
+
R --> N[nexus next @agent]
|
|
116
|
+
N --> CL[nexus claim path @agent intent]
|
|
117
|
+
CL --> W[Work inside claimed surface]
|
|
118
|
+
W --> V[Validate]
|
|
119
|
+
V --> REL[nexus release path message]
|
|
120
|
+
REL --> S[Standup or report]
|
|
121
|
+
S --> N
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
N -->|No safe task| Standby[Standby]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Later Design Notes
|
|
128
|
+
|
|
129
|
+
- Make the discovery loop feel more fluid than the execution loop.
|
|
130
|
+
- Make the approval gate visually prominent.
|
|
131
|
+
- Use different colors for "propose" versus "execute", but keep the overall palette restrained.
|
|
132
|
+
- The primary caption should be short enough to remember:
|
|
133
|
+
|
|
134
|
+
> Dynamic before approval. Deterministic after approval.
|
|
135
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkobytes/nexus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Multi-agent coordination CLI for coding agents sharing a local repository",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"bin/",
|
|
35
35
|
"src/",
|
|
36
|
+
"docs/",
|
|
36
37
|
"drills/",
|
|
37
38
|
"skills/",
|
|
38
39
|
"nexus-dashboard/",
|
package/skills/nexus/SKILL.md
CHANGED
|
@@ -7,12 +7,14 @@ description: Use in repos coordinated by the Nexus CLI, especially when _NEXUS_C
|
|
|
7
7
|
|
|
8
8
|
Nexus CLI is the coordination engine. This skill is only the agent playbook.
|
|
9
9
|
|
|
10
|
+
If the user, repo, or hook says Nexus is active, treat this skill as mandatory workflow. It is not optional advice.
|
|
11
|
+
|
|
10
12
|
## Loop
|
|
11
13
|
|
|
12
14
|
1. Run `nexus start`; set `NEXUS_AGENT` for your CLI, or pass `--agent @agy|@claude|@codex|@gemini`. Start is orientation only, not permission to edit.
|
|
13
15
|
2. Read `_NEXUS_CONSTITUTION.md`.
|
|
14
16
|
3. Read `USER.md` if present for local user preferences.
|
|
15
|
-
4. Read continuity and latest memory
|
|
17
|
+
4. Read continuity and latest memory at session start, `nexus start`, or resume.
|
|
16
18
|
5. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.
|
|
17
19
|
6. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.
|
|
18
20
|
7. Claim exact shared files before reading/editing:
|
|
@@ -22,14 +24,15 @@ Nexus CLI is the coordination engine. This skill is only the agent playbook.
|
|
|
22
24
|
```
|
|
23
25
|
|
|
24
26
|
8. Treat claim output as current file state. Ignore cached file memory when contents matter.
|
|
25
|
-
9.
|
|
26
|
-
10.
|
|
27
|
+
9. If a hook blocks access because a path is unclaimed, stop and claim that exact path. Do not work around the hook with another command, cached content, or manual git operation.
|
|
28
|
+
10. Work only inside the claimed surface and run focused validation.
|
|
29
|
+
11. Release each claimed tracked file through Nexus as soon as it reaches a coherent checkpoint:
|
|
27
30
|
|
|
28
31
|
```bash
|
|
29
32
|
nexus release <path> "short commit message"
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
12. Do not hold claims to bundle related work into a prettier feature commit. Nexus is agent-native and file-native: optimize for file availability, rollback safety, and agent throughput.
|
|
33
36
|
|
|
34
37
|
## Queue Items
|
|
35
38
|
|
|
@@ -62,6 +65,9 @@ When adding work to `_NEXUS_QUEUE.md`, keep tasks dashboard-parseable and immedi
|
|
|
62
65
|
- Use `nexus doctor` for audit/repair, not as the normal startup command.
|
|
63
66
|
- Use CLI/model names as lock handles: `@agy`, `@claude`, `@codex`, `@gemini`.
|
|
64
67
|
- Agent-local continuity and memory files are claim-exempt unless the user says otherwise.
|
|
68
|
+
- Continuity is the compaction-safe session ledger; latest memory is required startup/resume context.
|
|
69
|
+
- Memory indexes use monthly folders and newest-first Markdown links with one-line outcomes.
|
|
70
|
+
- Shared generated protocol wording is sourced from `src/lib/protocolText.js`; update that first, then run doctor/init tests.
|
|
65
71
|
- When using subagents or parallel workers, the lead agent owns the repo effects: claim the full path scope, pass boundaries down, re-read affected files, and mention delegated work in release or standup notes.
|
|
66
72
|
- Avoid parallel `nexus release`.
|
|
67
73
|
- Do not install packages younger than 14 days; if age is unknown, ask.
|