repo-nexus 0.7.23 → 0.7.26

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 (45) hide show
  1. package/docs/CLI.md +1 -1
  2. package/docs/cli/workspace.md +1 -1
  3. package/docs/examples/ai-workflows.md +1 -1
  4. package/docs/examples/monorepo-coexistence.md +0 -1
  5. package/docs/examples/multi-repo-workspace.md +0 -2
  6. package/docs/guide/configuration.md +2 -3
  7. package/docs/plugins/claude.md +5 -5
  8. package/docs/plugins/copilot.md +1 -2
  9. package/docs/plugins/cursor.md +2 -4
  10. package/docs/plugins/gemini.md +21 -17
  11. package/docs/plugins/index.md +4 -4
  12. package/docs/plugins/karpathy-llm.md +1 -1
  13. package/docs/plugins/windsurf.md +2 -4
  14. package/docs/rnex.example.yaml +8 -10
  15. package/lib/ai.sh +91 -1
  16. package/lib/commands/init.sh +11 -7
  17. package/lib/commands/plugin.sh +1 -1
  18. package/lib/commands/status.sh +18 -6
  19. package/lib/commands/sync.sh +5 -1
  20. package/lib/yaml.sh +43 -5
  21. package/package.json +1 -1
  22. package/templates/rnex-env.sh +176 -3
  23. package/templates/rnex.example.yaml +8 -10
  24. package/toolkit/plugins/claude/README.md +2 -2
  25. package/toolkit/plugins/claude/hooks/after_sync.sh +32 -32
  26. package/toolkit/plugins/claude/hooks/before_plugin_disable.sh +1 -0
  27. package/toolkit/plugins/claude/instructions/rnex-claude-integration.md +1 -1
  28. package/toolkit/plugins/claude/plugin.yaml +2 -2
  29. package/toolkit/plugins/copilot/README.md +0 -2
  30. package/toolkit/plugins/copilot/hooks/after_sync.sh +3 -10
  31. package/toolkit/plugins/copilot/instructions/rnex-copilot-integration.md +0 -1
  32. package/toolkit/plugins/copilot/plugin.yaml +0 -2
  33. package/toolkit/plugins/cursor/README.md +0 -2
  34. package/toolkit/plugins/cursor/hooks/after_sync.sh +12 -17
  35. package/toolkit/plugins/cursor/instructions/rnex-cursor-integration.md +0 -1
  36. package/toolkit/plugins/cursor/plugin.yaml +0 -2
  37. package/toolkit/plugins/gemini/README.md +4 -4
  38. package/toolkit/plugins/gemini/hooks/after_sync.sh +50 -6
  39. package/toolkit/plugins/gemini/hooks/before_plugin_disable.sh +3 -0
  40. package/toolkit/plugins/gemini/instructions/rnex-gemini-integration.md +3 -3
  41. package/toolkit/plugins/gemini/plugin.yaml +4 -4
  42. package/toolkit/plugins/windsurf/README.md +0 -2
  43. package/toolkit/plugins/windsurf/hooks/after_sync.sh +2 -6
  44. package/toolkit/plugins/windsurf/instructions/rnex-windsurf-integration.md +0 -1
  45. package/toolkit/plugins/windsurf/plugin.yaml +0 -2
package/docs/CLI.md CHANGED
@@ -37,7 +37,7 @@ rnex sync [-y|--yes] [-q|--quiet]
37
37
  2. **Git Ignore & Search Indexing**: Reconciles `.gitignore` (ignoring `repos/*` and `.local.rnex.yaml`) and `.ignore` (un-ignoring `repos/*` for search tools).
38
38
  3. **Plugin Sync**: Prunes disabled plugins and deterministically copies enabled plugin assets, rules, skills, templates, and executable lifecycle hooks into `.rnex/plugins/<plugin-name>/`.
39
39
  4. **Compiled AI Instructions**: Compiles `.rnex/ai-instructions.md` by combining the base template with active configuration and all enabled plugin `instructions.md` fragments. Top-level provider files (`AGENTS.md`, `CLAUDE.md`, etc.) receive only a single strict directive pointing to `.rnex/ai-instructions.md`.
40
- 5. **Skill Reconciliation & User Skill Generation**: Copies core agentic skills from `toolkit/skills/` to `.rnex/skills/`, and generates lightweight, zero-logic User Skills (prefixed with `rnex-`) in configured AI assistant directories (`.cursor/rules/`, `.claude/skills/`, `.gemini/skills/`, `.windsurf/rules/`) pointing directly to `.rnex/skills/` or plugin skill directories.
40
+ 5. **Skill Reconciliation & User Skill Generation**: Copies core agentic skills from `toolkit/skills/` to `.rnex/skills/`, and generates lightweight, zero-logic User Skills (prefixed with `rnex-`) in configured AI assistant directories (`.cursor/rules/`, `.claude/skills/`, `.agents/skills/`, `.windsurf/rules/`) pointing directly to `.rnex/skills/` or plugin skill directories.
41
41
  6. **Harness Sync**: Reconciles root `.rnex/` and member repository harnesses (`repos/<name>/.rnex/`) for all enabled member repositories where `rnex_dir: true`.
42
42
  7. **Git Hooks**: Installs or reconciles workspace Git hooks in `.rnex/hooks` when `git_hooks: true`.
43
43
  8. **Multi-Root Workspace**: Synchronizes `.code-workspace` folder mappings when `code_workspace: true`.
@@ -28,7 +28,7 @@ rnex init [options] [directory]
28
28
  | `--no-hooks` | | boolean | `false` | Skip Git hooks configuration during initialization. |
29
29
  | `--claude` | | boolean | `false` | Enable Claude Code plugin (maintains `CLAUDE.md`, generates skills in `.claude/skills/`). |
30
30
  | `--cursor` | | boolean | `false` | Enable Cursor plugin (maintains `.cursorrules`, generates skills in `.cursor/rules/`). |
31
- | `--gemini` | | boolean | `false` | Enable Google Gemini plugin (maintains `GEMINI.md`, generates skills in `.gemini/skills/`). |
31
+ | `--gemini` | | boolean | `false` | Enable Google Gemini plugin (maintains `GEMINI.md`, generates skills in `.agents/skills/`). |
32
32
  | `--windsurf` | | boolean | `false` | Enable Windsurf plugin (maintains `.windsurfrules`, generates skills in `.windsurf/rules/`). |
33
33
 
34
34
  ### Examples
@@ -23,7 +23,7 @@ When a workspace is initialized, Repo Nexus maintains core agentic skills in `.r
23
23
  | `wiki-ingest` | Plugin (`karpathy-llm`) | Ingest raw intake documents into atomic Karpathy LLM Wiki pages. | `.rnex/plugins/karpathy-llm/skills/wiki-ingest.md` |
24
24
  | `wiki-lint` | Plugin (`karpathy-llm`) | Validate markdown links, compute backlinks, and update the master index. | `.rnex/plugins/karpathy-llm/skills/wiki-lint.md` |
25
25
 
26
- When provider plugins (such as `claude`, `gemini`, `cursor`, or `windsurf`) are enabled with `skills: true`, zero-logic User Skill pointers (`rnex-<skill-name>.md`) are generated directly into the respective native provider directories (`.cursor/rules/`, `.claude/skills/`, `.gemini/skills/`, `.windsurf/rules/`).
26
+ When provider plugins (such as `claude`, `gemini`, `cursor`, or `windsurf`) are enabled with `skills: true`, zero-logic User Skill pointers (`rnex-<skill-name>.md`) are generated directly into the respective native provider directories (`.cursor/rules/`, `.claude/skills/`, `.agents/skills/`, `.windsurf/rules/`).
27
27
 
28
28
  ---
29
29
 
@@ -52,7 +52,6 @@ repos:
52
52
 
53
53
  plugins:
54
54
  claude:
55
- instructions: true
56
55
  skills: true
57
56
  ```
58
57
 
@@ -50,10 +50,8 @@ repos:
50
50
 
51
51
  plugins:
52
52
  claude:
53
- instructions: true
54
53
  skills: true
55
54
  cursor:
56
- instructions: true
57
55
  skills: true
58
56
  ```
59
57
 
@@ -64,11 +64,10 @@ repos:
64
64
  plugins:
65
65
  # AI Provider Plugins
66
66
  claude:
67
- instructions: true
68
67
  skills: true
68
+ auto_sync_on: SessionStart
69
69
 
70
70
  cursor:
71
- instructions: true
72
71
  skills: true
73
72
 
74
73
  # Knowledge & Agent Protocol Plugins
@@ -116,7 +115,7 @@ repos:
116
115
 
117
116
  plugins:
118
117
  gemini:
119
- instructions: true
118
+ skills: true
120
119
  ```
121
120
 
122
121
  After modifying configuration files directly, reconcile the workspace state:
@@ -21,8 +21,8 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
21
21
 
22
22
  2. **Native Instruction Support via `CLAUDE.md` & `AGENTS.md`**:
23
23
  - Claude Code natively reads `CLAUDE.md` as its primary instructions file; it only falls back to `AGENTS.md` when no `CLAUDE.md` exists in the project.
24
- - When enabled (`instructions: true`), the Claude plugin synchronizes Repo Nexus routing instructions to `CLAUDE.md` (or merges them cleanly if you already have custom instructions).
25
- - If `CLAUDE.md` is absent and `instructions: false`, Claude Code falls back to reading `AGENTS.md` directly.
24
+ - When enabled, the Claude plugin automatically synchronizes Repo Nexus routing instructions to `CLAUDE.md` (or merges them cleanly if you already have custom instructions).
25
+ - If the plugin is disabled, the routing block is removed, allowing Claude Code to read `AGENTS.md` directly.
26
26
 
27
27
  3. **Subagent & Skill Execution**:
28
28
  - Core skills reside under `.rnex/skills/`.
@@ -58,15 +58,15 @@ Configure options under `plugins.claude` in `rnex.yaml` or `.local.rnex.yaml`:
58
58
  ```yaml
59
59
  plugins:
60
60
  claude:
61
- instructions: true # Sync routing instructions to CLAUDE.md (default: true)
62
61
  skills: true # Generate user skills in .claude/skills/ (default: true)
62
+ auto_sync_on: SessionStart # Trigger auto-sync on lifecycle event (default: SessionStart, or false)
63
63
  enabled: true # Set to false to disable
64
64
  ```
65
65
 
66
66
  | Option | Type | Default | Description |
67
67
  |:---|:---|:---|:---|
68
- | `instructions` | boolean | `true` | Merge routing instructions into `CLAUDE.md`. |
69
68
  | `skills` | boolean | `true` | Generate user skill pointers in `.claude/skills/rnex-*.md`. |
69
+ | `auto_sync_on` | string/boolean | `SessionStart` | Lifecycle event triggering auto-sync in `.claude/settings.json` (or `false` to disable). |
70
70
  | `enabled` | boolean | `true` | Enable or disable the plugin. Overridable in `.local.rnex.yaml`. |
71
71
 
72
72
  ---
@@ -78,7 +78,7 @@ When `claude` is enabled with functional plugins like `karpathy-llm`, it generat
78
78
  ```text
79
79
  my-workspace/
80
80
  ├── AGENTS.md # Universal workspace instructions & routing
81
- ├── CLAUDE.md # Claude-specific instructions (if instructions: true)
81
+ ├── CLAUDE.md # Claude-specific instructions
82
82
  ├── .claude/
83
83
  │ └── skills/ # Zero-logic User Skill pointers
84
84
  │ ├── rnex-clone-sync.md
@@ -11,7 +11,7 @@ The `copilot` plugin integrates GitHub Copilot with Repo Nexus by projecting wor
11
11
 
12
12
  GitHub Copilot operates natively within VS Code, Visual Studio, JetBrains, and GitHub.com:
13
13
  - **Universal Routing (`AGENTS.md`)**: GitHub Copilot natively reads `AGENTS.md` at the workspace root.
14
- - **Custom Instructions (`.github/copilot-instructions.md`)**: When `instructions: true`, Repo Nexus injects its non-destructive routing block inside `<!-- REPO-NEXUS:START -->` and `<!-- REPO-NEXUS:END -->`. Custom developer rules outside these markers are strictly preserved.
14
+ - **Custom Instructions (`.github/copilot-instructions.md`)**: When enabled, Repo Nexus injects its non-destructive routing block inside `<!-- REPO-NEXUS:START -->` and `<!-- REPO-NEXUS:END -->`. Custom developer rules outside these markers are strictly preserved.
15
15
  - **User Skills (`.github/skills/`)**: When `skills: true`, Repo Nexus generates native `SKILL.md` directory bundles (`.github/skills/rnex-<name>/SKILL.md`) with YAML frontmatter, making them automatically discoverable in VS Code and Copilot Chat skill-pickers while redirecting to the underlying agentic skills under `.rnex/skills/` and active plugins.
16
16
 
17
17
  ## Configuration
@@ -21,7 +21,6 @@ Enable in `rnex.yaml`:
21
21
  ```yaml
22
22
  plugins:
23
23
  copilot:
24
- instructions: true # Maintain routing in .github/copilot-instructions.md
25
24
  skills: true # Generate user skills in .github/skills/
26
25
  ```
27
26
 
@@ -20,7 +20,7 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
20
20
  - Contains zero inline heuristics—redirects Cursor directly to the underlying agentic skill protocols inside `.rnex/`.
21
21
 
22
22
  2. **Native Instructions & Rules Support**:
23
- - Synchronizes Repo Nexus routing instructions to `.cursorrules` when `instructions: true` (default).
23
+ - Automatically synchronizes Repo Nexus routing instructions to `.cursorrules` and `.cursor/rules/rnex-context.mdc`.
24
24
  - Preserves user custom rules and custom sections in `.cursorrules`.
25
25
 
26
26
  3. **Subagent & Skill Execution**:
@@ -57,14 +57,12 @@ Configure options under `plugins.cursor` in `rnex.yaml` or `.local.rnex.yaml`:
57
57
  ```yaml
58
58
  plugins:
59
59
  cursor:
60
- instructions: true # Sync routing instructions to .cursorrules (default: true)
61
60
  skills: true # Generate user skills in .cursor/rules/ (default: true)
62
61
  enabled: true # Set to false to disable
63
62
  ```
64
63
 
65
64
  | Option | Type | Default | Description |
66
65
  |:---|:---|:---|:---|
67
- | `instructions` | boolean | `true` | Merge routing instructions into `.cursorrules`. |
68
66
  | `skills` | boolean | `true` | Generate user skill pointers in `.cursor/rules/rnex-*.md`. |
69
67
  | `enabled` | boolean | `true` | Enable or disable the plugin. Overridable in `.local.rnex.yaml`. |
70
68
 
@@ -77,7 +75,7 @@ When `cursor` is enabled with functional plugins like `karpathy-llm`, it generat
77
75
  ```text
78
76
  my-workspace/
79
77
  ├── AGENTS.md # Universal workspace instructions & routing
80
- ├── .cursorrules # Cursor root instructions (if instructions: true)
78
+ ├── .cursorrules # Cursor root instructions
81
79
  ├── .cursor/
82
80
  │ └── rules/ # Zero-logic User Skill pointers
83
81
  │ ├── rnex-clone-sync.md
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  title: Google Gemini & Antigravity Plugin
3
- description: Integrate Google Gemini and Antigravity IDE with Repo Nexus, generating zero-logic user skill pointers in .gemini/skills/.
3
+ description: Integrate Google Gemini and Antigravity IDE with Repo Nexus, generating zero-logic user skill pointers in .agents/skills/.
4
4
  ---
5
5
 
6
6
  # Google Gemini & Antigravity Plugin
7
7
 
8
8
  The **`gemini`** plugin integrates Google Gemini CLI and Google Antigravity IDE into a Repo Nexus Virtual Meta-Repo.
9
9
 
10
- All AI assistants in Repo Nexus share [`AGENTS.md`](file:///Users/admin/Projects/ai/repo-nexus/AGENTS.md) at the workspace root as the single universal source of truth for routing. When enabled, the `gemini` plugin generates zero-logic User Skill pointers into `.gemini/skills/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-karpathy-llm-wiki-ingest`).
10
+ All AI assistants in Repo Nexus share [`AGENTS.md`](file:///Users/admin/Projects/ai/repo-nexus/AGENTS.md) at the workspace root as the single universal source of truth for routing. When enabled, the `gemini` plugin generates zero-logic User Skill pointers into `.agents/skills/` (e.g. `rnex-clone-sync/SKILL.md`, `rnex-batch-exec/SKILL.md`, `rnex-karpathy-llm-wiki-ingest/SKILL.md`).
11
11
 
12
12
  Operational skills, rules, and subagents remain cleanly encapsulated within `.rnex/skills/` and active plugin directories (`.rnex/plugins/<plugin-name>/`).
13
13
 
@@ -15,12 +15,12 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
15
15
 
16
16
  ## Capabilities
17
17
 
18
- 1. **Zero-Logic User Skills (`.gemini/skills/rnex-*/SKILL.md`)**:
19
- - Generates native `SKILL.md` bundles prefixed with `rnex-` in `.gemini/skills/` with YAML frontmatter for Gemini and Antigravity skill discovery.
18
+ 1. **Zero-Logic User Skills (`.agents/skills/rnex-*/SKILL.md`)**:
19
+ - Generates native `SKILL.md` bundles prefixed with `rnex-` in `.agents/skills/` with YAML frontmatter for Gemini and Antigravity skill discovery.
20
20
  - Contains zero inline heuristics—redirects Gemini/Antigravity directly to the underlying agentic skill protocols inside `.rnex/`.
21
21
 
22
22
  2. **Native Instructions Support via `GEMINI.md`**:
23
- - Synchronizes Repo Nexus routing instructions to `GEMINI.md` (when `instructions: true`, default) for native support by the Google Gemini CLI.
23
+ - Automatically synchronizes Repo Nexus routing instructions to `GEMINI.md` for native support by the Google Gemini CLI and Antigravity.
24
24
  - Preserves user-defined custom sections in `GEMINI.md` across updates.
25
25
 
26
26
  3. **Subagent & Skill Execution**:
@@ -57,15 +57,15 @@ Configure options under `plugins.gemini` in `rnex.yaml` or `.local.rnex.yaml`:
57
57
  ```yaml
58
58
  plugins:
59
59
  gemini:
60
- instructions: true # Sync routing instructions to GEMINI.md (default: true)
61
- skills: true # Generate user skills in .gemini/skills/ (default: true)
60
+ skills: true # Generate user skills in .agents/skills/ (default: true)
61
+ auto_sync_on: SessionStart # Trigger auto-sync on lifecycle event (default: SessionStart, or false)
62
62
  enabled: true # Set to false to disable
63
63
  ```
64
64
 
65
65
  | Option | Type | Default | Description |
66
66
  |:---|:---|:---|:---|
67
- | `instructions` | boolean | `true` | Merge routing instructions into `GEMINI.md`. |
68
- | `skills` | boolean | `true` | Generate user skill pointers in `.gemini/skills/rnex-*.md`. |
67
+ | `skills` | boolean | `true` | Generate user skill pointers in `.agents/skills/rnex-*/SKILL.md`. |
68
+ | `auto_sync_on` | string/boolean | `SessionStart` | Lifecycle event triggering auto-sync in `.agents/hooks.json` (or `false` to disable). |
69
69
  | `enabled` | boolean | `true` | Enable or disable the plugin. Overridable in `.local.rnex.yaml`. |
70
70
 
71
71
  ---
@@ -76,15 +76,19 @@ When `gemini` is enabled with functional plugins like `karpathy-llm`, it generat
76
76
 
77
77
  ```text
78
78
  my-workspace/
79
- ├── AGENTS.md # Universal workspace instructions & routing
80
- ├── GEMINI.md # Gemini-specific instructions (if instructions: true)
81
- ├── .gemini/
79
+ ├── GEMINI.md # Gemini-specific instructions
80
+ ├── .agents/
82
81
  │ └── skills/ # Zero-logic User Skill pointers
83
- │ ├── rnex-clone-sync.md
84
- │ ├── rnex-batch-exec.md
85
- │ ├── rnex-workspace-status.md
82
+ │ ├── rnex-clone-sync/
83
+ │ │ └── SKILL.md
84
+ │ ├── rnex-batch-exec/
85
+ │ │ └── SKILL.md
86
+ │ ├── rnex-workspace-status/
87
+ │ │ └── SKILL.md
86
88
  │ ├── rnex-karpathy-llm-wiki-ingest/
89
+ │ │ └── SKILL.md
87
90
  │ └── rnex-karpathy-llm-wiki-lint/
91
+ │ └── SKILL.md
88
92
  ├── .rnex/
89
93
  │ ├── skills/ # Core workspace agentic skills
90
94
  │ └── plugins/
@@ -103,6 +107,6 @@ rnex plugin disable gemini
103
107
  ```
104
108
 
105
109
  Repo Nexus automatically performs surgical cleanup:
106
- - Removes auto-generated user skills under `.gemini/skills/rnex-*.md`.
110
+ - Removes auto-generated user skills under `.agents/skills/rnex-*`.
107
111
  - Cleans up managed routing instructions in `GEMINI.md`.
108
- - Developer-created files under `.gemini/` that do not originate from Repo Nexus are preserved.
112
+ - Developer-created files under `.agents/` or `.gemini/` that do not originate from Repo Nexus are preserved.
@@ -23,7 +23,7 @@ Active plugins are mirrored into each active member repository under `repos/<nam
23
23
  Repo Nexus decouples functional plugins from AI provider plugins:
24
24
  - **Core Skills (`toolkit/skills/` $\rightarrow$ `.rnex/skills/`)**: Workspace-level capabilities owned by Repo Nexus core.
25
25
  - **Plugin Skills (`toolkit/plugins/<plugin>/skills/` $\rightarrow$ `.rnex/plugins/<plugin>/skills/`)**: Scoped domain skills owned exclusively by individual plugins.
26
- - **User Skills**: Provider plugins (`copilot`, `claude`, `gemini`, `cursor`, and `windsurf`) project zero-logic user skill pointers into active provider directories using native `SKILL.md` bundles with YAML frontmatter in skill directories (`.github/skills/`, `.claude/skills/`, `.gemini/skills/`) and flat files in rule directories (`.cursor/rules/`, `.windsurf/rules/`), redirecting AI assistants directly to the underlying agentic skills in `.rnex/`.
26
+ - **User Skills**: Provider plugins (`copilot`, `claude`, `gemini`, `cursor`, and `windsurf`) project zero-logic user skill pointers into active provider directories using native `SKILL.md` bundles with YAML frontmatter in skill directories (`.github/skills/`, `.claude/skills/`, `.agents/skills/`) and flat files in rule directories (`.cursor/rules/`, `.windsurf/rules/`), redirecting AI assistants directly to the underlying agentic skills in `.rnex/`.
27
27
 
28
28
  ### 4. Non-Destructive Delimited Merging
29
29
  When plugins update root instruction files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, `.windsurfrules`), Repo Nexus isolates auto-managed routing between explicit delimiters:
@@ -48,7 +48,7 @@ Developer-authored instructions outside of these delimiters are strictly preserv
48
48
  |:---|:---|:---|:---|
49
49
  | [`claude`](claude.md) | AI Provider | Anthropic Claude Code & Desktop integration: maintains `CLAUDE.md` and generates user skills in `.claude/skills/`. | [Read Guide](claude.md) |
50
50
  | [`cursor`](cursor.md) | AI Provider | Cursor IDE integration: maintains `.cursorrules`, `.cursorignore`, and generates user skills in `.cursor/rules/`. | [Read Guide](cursor.md) |
51
- | [`gemini`](gemini.md) | AI Provider | Google Gemini CLI & Antigravity IDE integration: maintains `GEMINI.md`, `.geminiignore`, and generates user skills in `.gemini/skills/`. | [Read Guide](gemini.md) |
51
+ | [`gemini`](gemini.md) | AI Provider | Google Gemini CLI & Antigravity IDE integration: maintains `GEMINI.md`, `.geminiignore`, and generates user skills in `.agents/skills/`. | [Read Guide](gemini.md) |
52
52
  | [`windsurf`](windsurf.md) | AI Provider | Windsurf IDE integration: maintains `.windsurfrules` and generates user skills in `.windsurf/rules/`. | [Read Guide](windsurf.md) |
53
53
  | [`karpathy-llm`](karpathy-llm.md) | Knowledge & Rules | Andrej Karpathy's 4 cardinal principles for coding agents, multi-repo context engineering standards, and autonomous zero-dependency LLM Wiki architecture (`./docs`, `.rnex/wiki`). | [Read Guide](karpathy-llm.md) |
54
54
 
@@ -97,12 +97,12 @@ repos_dir: ./repos
97
97
  plugins:
98
98
  # AI Provider Plugins
99
99
  claude:
100
- instructions: true
101
100
  skills: true
101
+ auto_sync_on: SessionStart
102
102
 
103
103
  gemini:
104
- instructions: true
105
104
  skills: true
105
+ auto_sync_on: SessionStart
106
106
 
107
107
  # Functional / Knowledge Plugins
108
108
  karpathy-llm:
@@ -169,7 +169,7 @@ The `karpathy-llm` plugin encapsulates its agentic skills in `.rnex/plugins/karp
169
169
  - `wiki-ingest.md`
170
170
  - `wiki-lint.md`
171
171
 
172
- During `rnex sync`, its `after_sync.sh` lifecycle hook automatically registers zero-logic User Skill pointers (`rnex-karpathy-llm-wiki-ingest` and `rnex-karpathy-llm-wiki-lint`) across all enabled AI provider directories (`.cursor/rules/`, `.claude/skills/`, `.gemini/skills/`, `.windsurf/rules/`).
172
+ During `rnex sync`, its `after_sync.sh` lifecycle hook automatically registers zero-logic User Skill pointers (`rnex-karpathy-llm-wiki-ingest` and `rnex-karpathy-llm-wiki-lint`) across all enabled AI provider directories (`.cursor/rules/`, `.claude/skills/`, `.agents/skills/`, `.windsurf/rules/`).
173
173
 
174
174
  When running `rnex plugin disable karpathy-llm`, its `before_plugin_disable.sh` lifecycle hook automatically unregisters the User Skills from all provider directories, while keeping core workspace skills intact.
175
175
 
@@ -20,7 +20,7 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
20
20
  - Contains zero inline heuristics—redirects Cascade directly to the underlying agentic skill protocols inside `.rnex/`.
21
21
 
22
22
  2. **Native Instructions Support via `.windsurfrules`**:
23
- - Synchronizes Repo Nexus routing instructions to `.windsurfrules` when `instructions: true` (default).
23
+ - Automatically synchronizes Repo Nexus routing instructions to `.windsurfrules`.
24
24
  - Preserves user custom rules and custom sections in `.windsurfrules`.
25
25
 
26
26
  3. **Subagent & Skill Execution**:
@@ -57,14 +57,12 @@ Configure options under `plugins.windsurf` in `rnex.yaml` or `.local.rnex.yaml`:
57
57
  ```yaml
58
58
  plugins:
59
59
  windsurf:
60
- instructions: true # Sync routing instructions to .windsurfrules (default: true)
61
60
  skills: true # Generate user skills in .windsurf/rules/ (default: true)
62
61
  enabled: true # Set to false to disable
63
62
  ```
64
63
 
65
64
  | Option | Type | Default | Description |
66
65
  |:---|:---|:---|:---|
67
- | `instructions` | boolean | `true` | Merge routing instructions into `.windsurfrules`. |
68
66
  | `skills` | boolean | `true` | Generate user skill pointers in `.windsurf/rules/rnex-*.md`. |
69
67
  | `enabled` | boolean | `true` | Enable or disable the plugin. Overridable in `.local.rnex.yaml`. |
70
68
 
@@ -77,7 +75,7 @@ When `windsurf` is enabled with functional plugins like `karpathy-llm`, it gener
77
75
  ```text
78
76
  my-workspace/
79
77
  ├── AGENTS.md # Universal workspace instructions & routing
80
- ├── .windsurfrules # Windsurf instructions (if instructions: true)
78
+ ├── .windsurfrules # Windsurf instructions
81
79
  ├── .windsurf/
82
80
  │ └── rules/ # Zero-logic User Skill pointers
83
81
  │ ├── rnex-clone-sync.md
@@ -74,7 +74,7 @@ git_hooks: true
74
74
  #
75
75
  # Built-in plugins:
76
76
  # claude — Anthropic Claude Code integration: manages CLAUDE.md; generates user skills in .claude/skills/
77
- # gemini — Google Gemini / Antigravity integration: manages GEMINI.md; generates user skills in .gemini/skills/
77
+ # gemini — Google Gemini / Antigravity integration: manages GEMINI.md; generates user skills in .agents/skills/
78
78
  # cursor — Cursor IDE integration: manages .cursorrules & .cursor/rules/; generates user skills in .cursor/rules/
79
79
  # windsurf — Windsurf IDE integration: manages .windsurfrules; generates user skills in .windsurf/rules/
80
80
  # karpathy-llm — Andrej Karpathy's agent behavioral principles,
@@ -84,24 +84,22 @@ git_hooks: true
84
84
  # AGENTS.md at workspace root is the universal cross-tool standard. Assistants that read AGENTS.md
85
85
  # all the time need no separate top-level instructions file. Assistants with native
86
86
  # formats (Claude with CLAUDE.md, Gemini with GEMINI.md, Cursor with .cursorrules, Windsurf with .windsurfrules)
87
- # have their instruction files maintained when their plugin is enabled (instructions: true).
87
+ # have their instruction files maintained automatically when their plugin is enabled.
88
88
  # Agentic skills live self-contained inside .rnex/skills/ (core) and .rnex/plugins/<plugin>/skills/ (plugins).
89
89
  # Provider plugins generate zero-logic User Skills (prefixed with rnex-) into IDE-specific skill directories
90
90
  # linking directly to the agentic skill protocols inside .rnex/.
91
91
 
92
92
  plugins:
93
93
  # claude:
94
- # instructions: true # sync routing instructions to CLAUDE.md (default: true)
95
- # skills: true # generate user skills in .claude/skills/ (default: true)
94
+ # skills: true # generate user skills in .claude/skills/ (default: true)
95
+ # auto_sync_on: SessionStart # trigger auto-sync on lifecycle event (default: SessionStart, or false)
96
96
  # gemini:
97
- # instructions: true # sync routing instructions to GEMINI.md (default: true)
98
- # skills: true # generate user skills in .gemini/skills/ (default: true)
97
+ # skills: true # generate user skills in .agents/skills/ (default: true)
98
+ # auto_sync_on: SessionStart # trigger auto-sync on lifecycle event (default: SessionStart, or false)
99
99
  # cursor:
100
- # instructions: true # sync routing instructions to .cursorrules (default: true)
101
- # skills: true # generate user skills in .cursor/rules/ (default: true)
100
+ # skills: true # generate user skills in .cursor/rules/ (default: true)
102
101
  # windsurf:
103
- # instructions: true # sync routing instructions to .windsurfrules (default: true)
104
- # skills: true # generate user skills in .windsurf/rules/ (default: true)
102
+ # skills: true # generate user skills in .windsurf/rules/ (default: true)
105
103
  # karpathy-llm:
106
104
  # raw_dir: "./docs" # Append-only directory for unmodified intake documents (default: ./docs)
107
105
  # wiki_dir: ".rnex/wiki" # Directory for curated atomic markdown pages (default: .rnex/wiki)
package/lib/ai.sh CHANGED
@@ -405,7 +405,7 @@ get_active_provider_skill_dirs() {
405
405
  cursor) _sdir=".cursor/rules" ;;
406
406
  claude) _sdir=".claude/skills" ;;
407
407
  windsurf) _sdir=".windsurf/rules" ;;
408
- gemini) _sdir=".gemini/skills" ;;
408
+ gemini) _sdir=".agents/skills" ;;
409
409
  esac
410
410
  fi
411
411
  if [ -n "$_sdir" ]; then
@@ -495,6 +495,96 @@ clean_provider_agents() {
495
495
  rmdir "$_ag_dir" 2>/dev/null || true
496
496
  }
497
497
 
498
+ clean_claude_auto_sync_hook() {
499
+ _settings="$1"
500
+ [ -f "$_settings" ] || return 0
501
+ if grep -q "auto-sync.sh" "$_settings" 2>/dev/null; then
502
+ _tmp="$(mktemp)"
503
+ awk '
504
+ /\{[ \t]*"command"[ \t]*:[ \t]*"\.rnex\/bin\/auto-sync\.sh"[ \t]*\}/ { next }
505
+ /"command"[ \t]*:[ \t]*"\.rnex\/bin\/auto-sync\.sh"/ { next }
506
+ { print }
507
+ ' "$_settings" > "$_tmp"
508
+ _clean="$(sed -e 's/"hooks"//g' -e 's/"SessionStart"//g' < "$_tmp" | tr -d ' \t\r\n[]{}:,"')"
509
+ if [ -z "$_clean" ]; then
510
+ rm -f "$_tmp" "$_settings"
511
+ else
512
+ awk '
513
+ { lines[NR] = $0 }
514
+ END {
515
+ for (i = 1; i <= NR; i++) {
516
+ if (i < NR && lines[i] ~ /,[ \t]*$/) {
517
+ next_is_bracket = 0
518
+ for (j = i + 1; j <= NR; j++) {
519
+ if (lines[j] ~ /^[ \t]*$/) continue
520
+ if (lines[j] ~ /^[ \t]*[\]\}]/) next_is_bracket = 1
521
+ break
522
+ }
523
+ if (next_is_bracket) {
524
+ sub(/,[ \t]*$/, "", lines[i])
525
+ }
526
+ }
527
+ print lines[i]
528
+ }
529
+ }
530
+ ' "$_tmp" > "$_settings"
531
+ rm -f "$_tmp"
532
+ fi
533
+ fi
534
+ }
535
+
536
+ clean_agents_auto_sync_hook() {
537
+ _hooks="$1"
538
+ [ -f "$_hooks" ] || return 0
539
+ if grep -q '"rnex-auto-sync"' "$_hooks" 2>/dev/null; then
540
+ _tmp="$(mktemp)"
541
+ awk '
542
+ BEGIN { skip=0; depth=0 }
543
+ /"rnex-auto-sync"[ \t]*:[ \t]*\{/ { skip=1; depth=1; next }
544
+ skip {
545
+ for (i=1; i<=length($0); i++) {
546
+ c = substr($0, i, 1)
547
+ if (c == "{") depth++
548
+ if (c == "}") {
549
+ depth--
550
+ if (depth == 0) {
551
+ skip = 0
552
+ next
553
+ }
554
+ }
555
+ }
556
+ next
557
+ }
558
+ { print }
559
+ ' "$_hooks" > "$_tmp"
560
+ _clean="$(tr -d " \t\r\n{}" < "$_tmp")"
561
+ if [ -z "$_clean" ]; then
562
+ rm -f "$_tmp" "$_hooks"
563
+ else
564
+ awk '
565
+ { lines[NR] = $0 }
566
+ END {
567
+ for (i = 1; i <= NR; i++) {
568
+ if (i < NR && lines[i] ~ /,[ \t]*$/) {
569
+ next_is_brace = 0
570
+ for (j = i + 1; j <= NR; j++) {
571
+ if (lines[j] ~ /^[ \t]*$/) continue
572
+ if (lines[j] ~ /^[ \t]*\}/) next_is_brace = 1
573
+ break
574
+ }
575
+ if (next_is_brace) {
576
+ sub(/,[ \t]*$/, "", lines[i])
577
+ }
578
+ }
579
+ print lines[i]
580
+ }
581
+ }
582
+ ' "$_tmp" > "$_hooks"
583
+ rm -f "$_tmp"
584
+ fi
585
+ fi
586
+ }
587
+
498
588
  sync_rnex_base_assets() {
499
589
  _src_toolkit=""
500
590
  if [ -d "$SCRIPT_LOCATION/toolkit" ]; then
@@ -162,8 +162,18 @@ YAML_EOF
162
162
  log_ok "Created $RNEX_CONFIG_FILE"
163
163
  fi
164
164
 
165
+ # Set active workspace context for initialization
166
+ _orig_nexus="$NEXUS_DIR"
167
+ _orig_yaml="$WORKSPACE_YAML"
168
+ _orig_local_yaml="$WORKSPACE_LOCAL_YAML"
169
+ NEXUS_DIR="$_init_dir"
170
+ WORKSPACE_YAML="$_target_yaml"
171
+ WORKSPACE_LOCAL_YAML="$_init_dir/$RNEX_LOCAL_CONFIG_FILE"
172
+
165
173
  # ---- 2. Merge routing instructions into AI instructions files ------------
166
- merge_rnex_instructions "$_init_dir/AGENTS.md"
174
+ if ! has_active_provider_instructions "$_init_dir"; then
175
+ merge_rnex_instructions "$_init_dir/AGENTS.md"
176
+ fi
167
177
  [ -f "$_init_dir/CLAUDE.md" ] && merge_rnex_instructions "$_init_dir/CLAUDE.md"
168
178
  [ -f "$_init_dir/GEMINI.md" ] && merge_rnex_instructions "$_init_dir/GEMINI.md"
169
179
  [ -f "$_init_dir/.cursorrules" ] && merge_rnex_instructions "$_init_dir/.cursorrules"
@@ -178,12 +188,6 @@ YAML_EOF
178
188
  # ---- 4. Create internal .rnex directory and sync base assets -------------
179
189
  mkdir -p "$_init_dir/.rnex"
180
190
  mkdir -p "$_init_dir/.rnex/plugins"
181
- _orig_nexus="$NEXUS_DIR"
182
- _orig_yaml="$WORKSPACE_YAML"
183
- _orig_local_yaml="$WORKSPACE_LOCAL_YAML"
184
- NEXUS_DIR="$_init_dir"
185
- WORKSPACE_YAML="$_target_yaml"
186
- WORKSPACE_LOCAL_YAML="$_init_dir/$RNEX_LOCAL_CONFIG_FILE"
187
191
  sync_plugins
188
192
  build_ai_instructions "$_init_dir"
189
193
  sync_skills
@@ -70,7 +70,7 @@ cmd_plugin_info() {
70
70
  [ -z "$_skill_target" ] && case "$_name" in
71
71
  copilot) _skill_target=".github/skills/" ;;
72
72
  claude) _skill_target=".claude/skills/" ;;
73
- gemini) _skill_target=".gemini/skills/" ;;
73
+ gemini) _skill_target=".agents/skills/" ;;
74
74
  cursor) _skill_target=".cursor/rules/" ;;
75
75
  windsurf) _skill_target=".windsurf/rules/" ;;
76
76
  esac
@@ -142,7 +142,7 @@ cmd_status() {
142
142
  fi
143
143
  if [ -f "$NEXUS_DIR/AGENTS.md" ]; then
144
144
  printf ' %b✓%b %s %b(standard instructions directive)%b\n' "$_G" "$_NC" "AGENTS.md" "$_DIM" "$_NC"
145
- else
145
+ elif ! has_active_provider_instructions "$NEXUS_DIR"; then
146
146
  printf ' %b✗%b %s %b(standard instructions directive — MISSING; run "rnex sync" to create)%b\n' "$_R" "$_NC" "AGENTS.md" "$_R" "$_NC"
147
147
  fi
148
148
  if [ -f "$NEXUS_DIR/CLAUDE.md" ]; then
@@ -187,7 +187,9 @@ cmd_status() {
187
187
  if [ -d "$NEXUS_DIR/.windsurf/rules" ] && ls "$NEXUS_DIR/.windsurf/rules"/rnex-*.md >/dev/null 2>&1; then
188
188
  printf ' %b✓%b %s %b(Windsurf user skills)%b\n' "$_G" "$_NC" ".windsurf/rules/" "$_DIM" "$_NC"
189
189
  fi
190
- if [ -d "$NEXUS_DIR/.gemini/skills" ] && { ls "$NEXUS_DIR/.gemini/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.gemini/skills"/rnex-* >/dev/null 2>&1; }; then
190
+ if [ -d "$NEXUS_DIR/.agents/skills" ] && { ls "$NEXUS_DIR/.agents/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.agents/skills"/rnex-* >/dev/null 2>&1; }; then
191
+ printf ' %b✓%b %s %b(Gemini user skills)%b\n' "$_G" "$_NC" ".agents/skills/" "$_DIM" "$_NC"
192
+ elif [ -d "$NEXUS_DIR/.gemini/skills" ] && { ls "$NEXUS_DIR/.gemini/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.gemini/skills"/rnex-* >/dev/null 2>&1; }; then
191
193
  printf ' %b✓%b %s %b(Gemini user skills)%b\n' "$_G" "$_NC" ".gemini/skills/" "$_DIM" "$_NC"
192
194
  fi
193
195
  if [ -d "$NEXUS_DIR/.github/skills" ] && { ls "$NEXUS_DIR/.github/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.github/skills"/rnex-* >/dev/null 2>&1; }; then
@@ -211,10 +213,20 @@ cmd_status() {
211
213
  else
212
214
  printf ' %b●%b %-18s %b(v%s)%b %s\n' "$_G" "$_NC" "$_pname" "$_DIM" "${_ver:-0.1.0}" "$_NC" "${_desc:+- $_desc}"
213
215
  printf ' %bScoped directory: .rnex/plugins/%s%b\n' "$_DIM" "$_pname" "$_NC"
214
- if [ -n "$_pdir" ] && { grep -q "instructions:" "$_pdir/plugin.yaml" 2>/dev/null || [ -n "$(yaml_plugin_get "$_pname" "instructions" 2>/dev/null)" ]; }; then
215
- printf ' %b↳ Options: instructions=%s, skills=%s%b\n' "$_DIM" \
216
- "$(provider_option_enabled "$_pname" "instructions" && echo "true" || echo "false")" \
217
- "$(provider_option_enabled "$_pname" "skills" && echo "true" || echo "false")" "$_NC"
216
+ if [ -n "$_pdir" ] && [ -f "$_pdir/plugin.yaml" ]; then
217
+ _opts=""
218
+ if grep -q "skills:" "$_pdir/plugin.yaml" 2>/dev/null || [ -n "$(yaml_plugin_get "$_pname" "skills" 2>/dev/null)" ]; then
219
+ _opts="${_opts:+$_opts, }skills=$(provider_option_enabled "$_pname" "skills" && echo "true" || echo "false")"
220
+ fi
221
+ if grep -q "auto_sync_on:" "$_pdir/plugin.yaml" 2>/dev/null || grep -q "autoSyncOn:" "$_pdir/plugin.yaml" 2>/dev/null || [ -n "$(yaml_plugin_get "$_pname" "auto_sync_on" 2>/dev/null)" ] || [ -n "$(yaml_plugin_get "$_pname" "autoSyncOn" 2>/dev/null)" ]; then
222
+ _aso="$(yaml_plugin_get "$_pname" "auto_sync_on" 2>/dev/null || true)"
223
+ [ -z "$_aso" ] && _aso="$(yaml_plugin_get "$_pname" "autoSyncOn" 2>/dev/null || true)"
224
+ [ -z "$_aso" ] && _aso="SessionStart"
225
+ _opts="${_opts:+$_opts, }auto_sync_on=$_aso"
226
+ fi
227
+ if [ -n "$_opts" ]; then
228
+ printf ' %b↳ Options: %s%b\n' "$_DIM" "$_opts" "$_NC"
229
+ fi
218
230
  fi
219
231
  fi
220
232
  else
@@ -78,7 +78,11 @@ cmd_sync() {
78
78
  reconcile_gitignore "$NEXUS_DIR"
79
79
 
80
80
  # 1.2. Reconcile universal workspace instructions in AGENTS.md
81
- merge_rnex_instructions "$NEXUS_DIR/AGENTS.md"
81
+ if has_active_provider_instructions; then
82
+ clean_rnex_instructions "$NEXUS_DIR/AGENTS.md"
83
+ else
84
+ merge_rnex_instructions "$NEXUS_DIR/AGENTS.md"
85
+ fi
82
86
 
83
87
  # 1.3. Generate auto-sync script and AI session-start hooks (hardcoded harness)
84
88
  _write_auto_sync_script "$NEXUS_DIR"