@inkobytes/nexus 1.0.5 → 1.0.6

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.6 - 2026-06-03
4
+
5
+ - Extended Nexus protocol drift checks so `nexus doctor` now covers the bundled `skills/nexus/SKILL.md`.
6
+ - Kept Nexus repo docs aligned with the agent-native release model while scoping root `README.md` doctor repair to the actual `@inkobytes/nexus` product repo.
7
+ - Added regression coverage for Nexus-product README repair and for avoiding root README mutation in ordinary consumer repos.
8
+
3
9
  ## 1.0.5 - 2026-06-03
4
10
 
5
11
  - Reframed doctor-managed agent guides around agent-native, file-native release flow instead of human-oriented feature commit bundling.
package/README.md CHANGED
@@ -389,11 +389,13 @@ Nexus reads tasks from `_NEXUS_QUEUE.md`:
389
389
  - Affinity: cli, diagnostics
390
390
  - Cost: small
391
391
  - Auto-flow: yes
392
+ - Review: approved
393
+ - Approved by: human
392
394
  - Notes: Add a doctor section for stale locks with tests and clear fix guidance.
393
395
  ```
394
396
 
395
397
  The queue is the executable priority surface. Standup is for comms and human context.
396
- Keep items dashboard-friendly: include `Id`, `Epic`, `Status`, `Depends on`, `Files`, `Affinity`, `Cost`, `Auto-flow`, and `Notes`. Use `Files` to expose conflict surfaces, `Depends on` for hard blockers, and `Auto-flow: no` when a task needs planning or human approval before an agent grabs it.
398
+ Keep items dashboard-friendly: include `Id`, `Epic`, `Status`, `Depends on`, `Files`, `Affinity`, `Cost`, `Auto-flow`, and `Notes`. Use `Files` to expose conflict surfaces, `Depends on` for hard blockers, and `Auto-flow: no` when a task needs planning or human approval before an agent grabs it. Auto-flow work in `Ready Queue` should also include `Review: approved` and `Approved by: human`, or `doctor` will flag it and `nexus next` may skip it.
397
399
 
398
400
  Add `Drills` when a task has known failure-mode guidance:
399
401
 
@@ -408,12 +410,13 @@ When `Drills` is absent, `nexus next` may surface obvious related drills from ta
408
410
  The agent rule of thumb:
409
411
 
410
412
  1. Run `nexus start` when entering an existing repo; it does not replace claim/release.
411
- 2. Read `USER.md` when present.
412
- 3. Read continuity and latest memory when present.
413
- 4. Read `_NEXUS_QUEUE.md` before taking follow-on work.
414
- 5. Claim before touching shared project files.
415
- 6. Release when finished.
416
- 7. Use `nexus next @Agent` instead of free-roaming.
413
+ 2. Read `_NEXUS_CONSTITUTION.md`.
414
+ 3. Read `USER.md` when present.
415
+ 4. Read continuity and latest memory when present.
416
+ 5. Read `_NEXUS_QUEUE.md` before taking follow-on work.
417
+ 6. Claim before touching shared project files.
418
+ 7. Release each claimed tracked file as soon as it reaches a coherent checkpoint.
419
+ 8. Use `nexus next @Agent` instead of free-roaming.
417
420
 
418
421
  Use model names as lock handles so ownership stays clear:
419
422
 
@@ -424,6 +427,8 @@ Use model names as lock handles so ownership stays clear:
424
427
 
425
428
  Agent-local continuity and memory files are exempt from claim/release unless the human says otherwise.
426
429
 
430
+ Nexus is agent-native and file-native, not human-native: optimize for concurrency and rollback, not feature-commit aesthetics. Do not hold claims to bundle related work into prettier feature commits; that blocks other agents waiting on files.
431
+
427
432
  When a lead agent uses subagents, tools, or parallel workers, the lead still owns the repo effects. Claim the full path scope before delegating shared-file work, give subagents the claimed path and boundaries, re-read affected files before release, and mention delegated work when it changed files, tests, or risk.
428
433
 
429
434
  Supply-chain rule: agents should not install third-party packages that have existed for less than 14 days. If package age cannot be verified, stop and ask the human. `nexus doctor` also flags install hooks and package scripts that look like they could exfiltrate data.
@@ -445,7 +450,7 @@ Avoid introducing extra startup names in scripts or narration.
445
450
 
446
451
  Nexus ships an agent skill at `skills/nexus/SKILL.md`.
447
452
 
448
- The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> release`.
453
+ The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> work -> release -> next`.
449
454
 
450
455
  ## Legacy Helper Transition
451
456
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkobytes/nexus",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Multi-agent coordination CLI for coding agents sharing a local repository",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,24 +10,27 @@ Nexus CLI is the coordination engine. This skill is only the agent playbook.
10
10
  ## Loop
11
11
 
12
12
  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
- 2. Read `USER.md` if present for local user preferences.
14
- 3. Read continuity and latest memory when present.
15
- 4. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.
16
- 5. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.
17
- 6. Claim exact shared files before reading/editing:
13
+ 2. Read `_NEXUS_CONSTITUTION.md`.
14
+ 3. Read `USER.md` if present for local user preferences.
15
+ 4. Read continuity and latest memory when present.
16
+ 5. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.
17
+ 6. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.
18
+ 7. Claim exact shared files before reading/editing:
18
19
 
19
20
  ```bash
20
21
  nexus claim <path> @Agent "intent"
21
22
  ```
22
23
 
23
- 7. Treat claim output as current file state. Ignore cached file memory when contents matter.
24
- 8. Work only inside the claimed surface and run focused validation.
25
- 9. If the user wants a commit, release through Nexus:
24
+ 8. Treat claim output as current file state. Ignore cached file memory when contents matter.
25
+ 9. Work only inside the claimed surface and run focused validation.
26
+ 10. Release each claimed tracked file through Nexus as soon as it reaches a coherent checkpoint:
26
27
 
27
28
  ```bash
28
29
  nexus release <path> "short commit message"
29
30
  ```
30
31
 
32
+ 11. 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
+
31
34
  ## Queue Items
32
35
 
33
36
  When adding work to `_NEXUS_QUEUE.md`, keep tasks dashboard-parseable and immediately actionable. Use this shape:
@@ -42,12 +45,15 @@ When adding work to `_NEXUS_QUEUE.md`, keep tasks dashboard-parseable and immedi
42
45
  - Affinity: cli, docs, dashboard
43
46
  - Cost: small
44
47
  - Auto-flow: yes
48
+ - Review: approved
49
+ - Approved by: human
45
50
  - Notes: One practical paragraph with scope, constraints, and definition of done.
46
51
  ```
47
52
 
48
53
  - `Files` should name the likely edit surface so other agents can spot conflicts before claiming.
49
54
  - `Depends on` should list hard blockers by `Id`; use `none` when the task is independent.
50
55
  - `Auto-flow: yes` means an agent can grab it after `nexus next`; use `no` when planning or human approval is needed.
56
+ - Auto-flow work in `Ready Queue` should include `Review: approved` and `Approved by: human`, or `doctor` will flag it and `nexus next` may skip it.
51
57
  - `Notes` should carry dashboard-useful context, not a whole design doc.
52
58
 
53
59
  ## Guardrails
@@ -352,6 +352,7 @@ export default function doctor(args) {
352
352
  const sections = {
353
353
  'Nexus Files': [],
354
354
  'Agent Instructions': [],
355
+ 'Docs & Skills': [],
355
356
  Security: [],
356
357
  'Package Privacy': [],
357
358
  'Git Privacy': [],
@@ -513,6 +514,37 @@ export default function doctor(args) {
513
514
  }
514
515
  }
515
516
 
517
+ const protocolDocs = [];
518
+ if (isNexusProductRepo(root)) {
519
+ protocolDocs.push({
520
+ path: 'README.md',
521
+ label: 'README.md',
522
+ repair: repairReadmeProtocolDoc,
523
+ });
524
+ }
525
+ protocolDocs.push({
526
+ path: 'skills/nexus/SKILL.md',
527
+ label: 'skills/nexus/SKILL.md',
528
+ repair: repairNexusSkillDoc,
529
+ });
530
+
531
+ for (const doc of protocolDocs) {
532
+ const path = join(root, doc.path);
533
+ if (!existsSync(path)) continue;
534
+ const existing = readFileSync(path, 'utf-8');
535
+ const next = doc.repair(existing);
536
+ if (next === existing) continue;
537
+ if (fix) {
538
+ writeFileSync(path, next, 'utf-8');
539
+ changes.push(`updated ${doc.label}`);
540
+ } else {
541
+ sections['Docs & Skills'].push({
542
+ issue: `${doc.label} is out of sync with current Nexus protocol wording`,
543
+ fix: 'Run `nexus doctor --fix`.',
544
+ });
545
+ }
546
+ }
547
+
516
548
  const locks = listLocks();
517
549
  const staleLocks = locks.filter((lock) => lock.age !== null && lock.age >= config.staleThreshold);
518
550
  const freshLocks = locks.filter((lock) => lock.age === null || lock.age < config.staleThreshold);
@@ -947,6 +979,140 @@ function replaceLegacyHelperCommands(content) {
947
979
  .join('\n');
948
980
  }
949
981
 
982
+ function isNexusProductRepo(root) {
983
+ const packagePath = join(root, 'package.json');
984
+ if (!existsSync(packagePath)) return false;
985
+
986
+ try {
987
+ const pkg = JSON.parse(readFileSync(packagePath, 'utf-8'));
988
+ return pkg?.name === '@inkobytes/nexus';
989
+ } catch {
990
+ return false;
991
+ }
992
+ }
993
+
994
+ function repairReadmeProtocolDoc(content) {
995
+ return content
996
+ .replace(
997
+ [
998
+ '- [ ] TASK/Codex: Add doctor stale-lock category',
999
+ ' - Id: doctor-stale-locks',
1000
+ ' - Epic: Release hygiene',
1001
+ ' - Status: Ready',
1002
+ ' - Depends on: none',
1003
+ ' - Files: src/commands/doctor.js',
1004
+ ' - Affinity: cli, diagnostics',
1005
+ ' - Cost: small',
1006
+ ' - Auto-flow: yes',
1007
+ ' - Notes: Add a doctor section for stale locks with tests and clear fix guidance.',
1008
+ ].join('\n'),
1009
+ [
1010
+ '- [ ] TASK/Codex: Add doctor stale-lock category',
1011
+ ' - Id: doctor-stale-locks',
1012
+ ' - Epic: Release hygiene',
1013
+ ' - Status: Ready',
1014
+ ' - Depends on: none',
1015
+ ' - Files: src/commands/doctor.js',
1016
+ ' - Affinity: cli, diagnostics',
1017
+ ' - Cost: small',
1018
+ ' - Auto-flow: yes',
1019
+ ' - Review: approved',
1020
+ ' - Approved by: human',
1021
+ ' - Notes: Add a doctor section for stale locks with tests and clear fix guidance.',
1022
+ ].join('\n'),
1023
+ )
1024
+ .replace(
1025
+ 'Keep items dashboard-friendly: include `Id`, `Epic`, `Status`, `Depends on`, `Files`, `Affinity`, `Cost`, `Auto-flow`, and `Notes`. Use `Files` to expose conflict surfaces, `Depends on` for hard blockers, and `Auto-flow: no` when a task needs planning or human approval before an agent grabs it.',
1026
+ 'Keep items dashboard-friendly: include `Id`, `Epic`, `Status`, `Depends on`, `Files`, `Affinity`, `Cost`, `Auto-flow`, and `Notes`. Use `Files` to expose conflict surfaces, `Depends on` for hard blockers, and `Auto-flow: no` when a task needs planning or human approval before an agent grabs it. Auto-flow work in `Ready Queue` should also include `Review: approved` and `Approved by: human`, or `doctor` will flag it and `nexus next` may skip it.',
1027
+ )
1028
+ .replace(
1029
+ [
1030
+ '1. Run `nexus start` when entering an existing repo; it does not replace claim/release.',
1031
+ '2. Read `USER.md` when present.',
1032
+ '3. Read continuity and latest memory when present.',
1033
+ '4. Read `_NEXUS_QUEUE.md` before taking follow-on work.',
1034
+ '5. Claim before touching shared project files.',
1035
+ '6. Release when finished.',
1036
+ '7. Use `nexus next @Agent` instead of free-roaming.',
1037
+ ].join('\n'),
1038
+ [
1039
+ '1. Run `nexus start` when entering an existing repo; it does not replace claim/release.',
1040
+ '2. Read `_NEXUS_CONSTITUTION.md`.',
1041
+ '3. Read `USER.md` when present.',
1042
+ '4. Read continuity and latest memory when present.',
1043
+ '5. Read `_NEXUS_QUEUE.md` before taking follow-on work.',
1044
+ '6. Claim before touching shared project files.',
1045
+ '7. Release each claimed tracked file as soon as it reaches a coherent checkpoint.',
1046
+ '8. Use `nexus next @Agent` instead of free-roaming.',
1047
+ ].join('\n'),
1048
+ )
1049
+ .replace(
1050
+ 'Agent-local continuity and memory files are exempt from claim/release unless the human says otherwise.',
1051
+ 'Agent-local continuity and memory files are exempt from claim/release unless the human says otherwise.\n\nNexus is agent-native and file-native, not human-native: optimize for concurrency and rollback, not feature-commit aesthetics. Do not hold claims to bundle related work into prettier feature commits; that blocks other agents waiting on files.',
1052
+ )
1053
+ .replace(
1054
+ 'The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> release`.',
1055
+ 'The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> work -> release -> next`.',
1056
+ );
1057
+ }
1058
+
1059
+ function repairNexusSkillDoc(content) {
1060
+ return content
1061
+ .replace(
1062
+ [
1063
+ '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.',
1064
+ '2. Read `USER.md` if present for local user preferences.',
1065
+ '3. Read continuity and latest memory when present.',
1066
+ '4. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.',
1067
+ '5. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.',
1068
+ '6. Claim exact shared files before reading/editing:',
1069
+ ].join('\n'),
1070
+ [
1071
+ '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.',
1072
+ '2. Read `_NEXUS_CONSTITUTION.md`.',
1073
+ '3. Read `USER.md` if present for local user preferences.',
1074
+ '4. Read continuity and latest memory when present.',
1075
+ '5. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.',
1076
+ '6. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.',
1077
+ '7. Claim exact shared files before reading/editing:',
1078
+ ].join('\n'),
1079
+ )
1080
+ .replace(
1081
+ [
1082
+ '7. Treat claim output as current file state. Ignore cached file memory when contents matter.',
1083
+ '8. Work only inside the claimed surface and run focused validation.',
1084
+ '9. If the user wants a commit, release through Nexus:',
1085
+ ].join('\n'),
1086
+ [
1087
+ '8. Treat claim output as current file state. Ignore cached file memory when contents matter.',
1088
+ '9. Work only inside the claimed surface and run focused validation.',
1089
+ '10. Release each claimed tracked file through Nexus as soon as it reaches a coherent checkpoint:',
1090
+ ].join('\n'),
1091
+ )
1092
+ .replace(
1093
+ '```\\n\\n## Queue Items',
1094
+ '```\\n\\n11. 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.\\n\\n## Queue Items',
1095
+ )
1096
+ .replace(
1097
+ [
1098
+ ' - Cost: small',
1099
+ ' - Auto-flow: yes',
1100
+ ' - Notes: One practical paragraph with scope, constraints, and definition of done.',
1101
+ ].join('\n'),
1102
+ [
1103
+ ' - Cost: small',
1104
+ ' - Auto-flow: yes',
1105
+ ' - Review: approved',
1106
+ ' - Approved by: human',
1107
+ ' - Notes: One practical paragraph with scope, constraints, and definition of done.',
1108
+ ].join('\n'),
1109
+ )
1110
+ .replace(
1111
+ '- `Auto-flow: yes` means an agent can grab it after `nexus next`; use `no` when planning or human approval is needed.\n- `Notes` should carry dashboard-useful context, not a whole design doc.',
1112
+ '- `Auto-flow: yes` means an agent can grab it after `nexus next`; use `no` when planning or human approval is needed.\n- Auto-flow work in `Ready Queue` should include `Review: approved` and `Approved by: human`, or `doctor` will flag it and `nexus next` may skip it.\n- `Notes` should carry dashboard-useful context, not a whole design doc.',
1113
+ );
1114
+ }
1115
+
950
1116
  const SUSPICIOUS_SCRIPT_PATTERNS = [
951
1117
  { pattern: /\b(curl|wget)\b/i, label: 'network download command' },
952
1118
  { pattern: /\b(nc|netcat|ncat|socat)\b/i, label: 'raw network transfer command' },