repo-nexus 0.9.22 → 0.9.23
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/README.md +2 -2
- package/lib/commands/completion.sh +2 -2
- package/lib/commands/init.sh +1 -3
- package/lib/commands/system.sh +1 -1
- package/lib/workspace.sh +1 -2
- package/lib/yaml.sh +3 -4
- package/package.json +1 -1
- package/plugins/claude/plugin.yaml +1 -1
- package/plugins/codex/plugin.yaml +1 -1
- package/plugins/copilot/plugin.yaml +1 -1
- package/plugins/cursor/plugin.yaml +1 -1
- package/plugins/gemini/plugin.yaml +1 -1
- package/plugins/{karpathy-llm → llm-wiki}/README.md +22 -22
- package/plugins/llm-wiki/agents/rnex-wiki-curator.agent.md +8 -0
- package/plugins/{karpathy-llm → llm-wiki}/ai-instructions.md +4 -4
- package/plugins/{karpathy-llm → llm-wiki}/bin/ingest.sh +10 -10
- package/plugins/{karpathy-llm → llm-wiki}/bin/lint.sh +12 -12
- package/plugins/{karpathy-llm → llm-wiki}/commands/ingest.sh +1 -1
- package/plugins/{karpathy-llm → llm-wiki}/commands/lint.sh +1 -1
- package/plugins/{karpathy-llm → llm-wiki}/hooks/after_sync.sh +3 -3
- package/plugins/{karpathy-llm → llm-wiki}/hooks/before_plugin_disable.sh +3 -5
- package/plugins/{karpathy-llm → llm-wiki}/instructions/rnex-scaffolding-meta-prompt.md +14 -14
- package/plugins/{karpathy-llm → llm-wiki}/instructions/rnex-wiki-architecture.md +3 -3
- package/plugins/{karpathy-llm → llm-wiki}/lib/btree_helpers.sh +3 -3
- package/plugins/{karpathy-llm → llm-wiki}/lib/config.sh +16 -27
- package/plugins/{karpathy-llm → llm-wiki}/lib/lint_helpers.sh +4 -4
- package/plugins/{karpathy-llm → llm-wiki}/lib/source_helpers.sh +12 -12
- package/plugins/{karpathy-llm → llm-wiki}/lib/utils.sh +3 -3
- package/plugins/{karpathy-llm → llm-wiki}/plugin.yaml +2 -2
- package/plugins/{karpathy-llm → llm-wiki}/rules/behavioral.md +2 -4
- package/plugins/{karpathy-llm/skills/wiki-ingest.md → llm-wiki/skills/ingest.md} +6 -6
- package/plugins/{karpathy-llm/skills/wiki-lint.md → llm-wiki/skills/lint.md} +2 -2
- package/plugins/{karpathy-llm → llm-wiki}/templates/rnex-llm-wiki.sample.md +1 -1
- package/plugins/{karpathy-llm → llm-wiki}/tests/test_plugin.sh +268 -268
- package/plugins/windsurf/plugin.yaml +1 -1
- package/templates/rnex.example.yaml +4 -4
- package/plugins/karpathy-llm/agents/rnex-wiki-curator.agent.md +0 -8
- /package/plugins/{karpathy-llm → llm-wiki}/templates/rnex-wiki-page.sample.md +0 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ A lightweight, zero-dependency and AI-First **Nexus Repository (Virtual Meta Rep
|
|
|
19
19
|
- **Two-Level Configuration as Source of Truth**: Shared team manifest in `rnex.yaml` with machine-specific overrides in `.local.rnex.yaml` (highest priority).
|
|
20
20
|
- **One Command Team Onboarding**: Teammates clone the **meta repository** (**meta repo** / **nexus repo**) and run `rnex clone` to clone and configure all member repositories in seconds.
|
|
21
21
|
- **Cross-Repo Batch Operations**: Run arbitrary commands across all active repositories with `rnex exec <command>`.
|
|
22
|
-
- **Scoped Plugins & Context Packs**: Modular plugin packages scoped under `.rnex/plugins/<plugin-name>/` with support for domain directories (e.g. `.rnex/wiki/` and `./docs` for `
|
|
22
|
+
- **Scoped Plugins & Context Packs**: Modular plugin packages scoped under `.rnex/plugins/<plugin-name>/` with support for domain directories (e.g. `.rnex/wiki/` and `./docs` for `llm-wiki`).
|
|
23
23
|
- **Zero Dependencies**: Pure POSIX shell CLI (`rnex`). Works out of the box across macOS, Linux, and Windows (WSL/Git Bash).
|
|
24
24
|
|
|
25
25
|
> 📖 **[Documentation & Guides](https://unoxen.github.io/repo-nexus/)**
|
|
@@ -27,7 +27,7 @@ A lightweight, zero-dependency and AI-First **Nexus Repository (Virtual Meta Rep
|
|
|
27
27
|
> - 🚀 **[Getting Started](https://unoxen.github.io/repo-nexus/introduction/quick-start)** — Step-by-step onboarding walkthrough and workspace setup
|
|
28
28
|
> - 📐 **[Architecture](https://unoxen.github.io/repo-nexus/documentation/architecture)** & **[Why Repo Nexus?](https://unoxen.github.io/repo-nexus/introduction/why-rnex)** — Virtual Meta-Repo model, directory layout, and design rationale
|
|
29
29
|
> - 💻 **[CLI Reference](https://unoxen.github.io/repo-nexus/reference/cli)** — Complete command syntax, global flags, batch execution (`rnex exec`), and Git hooks
|
|
30
|
-
> - 🧩 **[Plugins Guide](https://unoxen.github.io/repo-nexus/documentation/plugin-ecosystem)** — AI provider integrations (Claude, Codex, Copilot, Cursor, Gemini, Windsurf) and
|
|
30
|
+
> - 🧩 **[Plugins Guide](https://unoxen.github.io/repo-nexus/documentation/plugin-ecosystem)** — AI provider integrations (Claude, Codex, Copilot, Cursor, Gemini, Windsurf) and LLM Wiki
|
|
31
31
|
> - ⚙️ **[Configuration Schema](https://unoxen.github.io/repo-nexus/documentation/configuration)** — Two-level `rnex.yaml` and `.local.rnex.yaml` specification
|
|
32
32
|
> - ❓ **[Frequently Asked Questions (FAQ)](https://unoxen.github.io/repo-nexus/faq/general)** — Common questions, Git submodule differences, and context strategies
|
|
33
33
|
|
|
@@ -31,7 +31,7 @@ _rnex_completions() {
|
|
|
31
31
|
return 0
|
|
32
32
|
;;
|
|
33
33
|
init)
|
|
34
|
-
COMPREPLY=( $(compgen -W "-y --yes --repos-dir --code-workspace --hooks --no-hooks -H --ignore-hooks --copilot --claude --gemini --codex --cursor --windsurf --
|
|
34
|
+
COMPREPLY=( $(compgen -W "-y --yes --repos-dir --code-workspace --hooks --no-hooks -H --ignore-hooks --copilot --claude --gemini --codex --cursor --windsurf --llm-wiki" -- "$cur") )
|
|
35
35
|
return 0
|
|
36
36
|
;;
|
|
37
37
|
sync)
|
|
@@ -129,7 +129,7 @@ _rnex() {
|
|
|
129
129
|
;;
|
|
130
130
|
init)
|
|
131
131
|
local -a init_opts
|
|
132
|
-
init_opts=('(-y --yes)'{-y,--yes}'[Automatically answer yes to prompts]' '--repos-dir[Directory for member repository clones]:dir:_files -/' '--code-workspace[Configure multi-root workspace file]' '--hooks[Configure automated git hooks]' '--no-hooks[Disable automated git hooks]' '--copilot[Enable Copilot plugin]' '--claude[Enable Claude plugin]' '--gemini[Enable Gemini plugin]' '--codex[Enable Codex plugin]' '--cursor[Enable Cursor plugin]' '--windsurf[Enable Windsurf plugin]' '--
|
|
132
|
+
init_opts=('(-y --yes)'{-y,--yes}'[Automatically answer yes to prompts]' '--repos-dir[Directory for member repository clones]:dir:_files -/' '--code-workspace[Configure multi-root workspace file]' '--hooks[Configure automated git hooks]' '--no-hooks[Disable automated git hooks]' '--copilot[Enable Copilot plugin]' '--claude[Enable Claude plugin]' '--gemini[Enable Gemini plugin]' '--codex[Enable Codex plugin]' '--cursor[Enable Cursor plugin]' '--windsurf[Enable Windsurf plugin]' '--llm-wiki[Enable LLM Wiki plugin]')
|
|
133
133
|
_describe -t init_opts 'init option' init_opts
|
|
134
134
|
;;
|
|
135
135
|
sync)
|
package/lib/commands/init.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Initialize a new Repo Nexus workspace in the specified directory (or current directory):
|
|
8
8
|
# Sets up rnex.yaml, .rnex/ harness, gitignore rules, routing instructions in AGENTS.md,
|
|
9
|
-
# enabled plugins (e.g. --claude, --gemini, --
|
|
9
|
+
# enabled plugins (e.g. --claude, --gemini, --llm-wiki), and optional VS Code / Cursor workspace.
|
|
10
10
|
# Usage:
|
|
11
11
|
# rnex init [-y|--yes] [--hooks|--no-hooks] [--<plugin>] [<directory>]
|
|
12
12
|
cmd_init() {
|
|
@@ -31,8 +31,6 @@ cmd_init() {
|
|
|
31
31
|
--repos-dir=*|--repos_dir=*)
|
|
32
32
|
_cli_repos_dir="${1#*=}"
|
|
33
33
|
;;
|
|
34
|
-
--karpathy) _pk="karpathy"; _cli_plugins="${_cli_plugins:+$_cli_plugins }${_pk}-llm" ;;
|
|
35
|
-
--no-karpathy) _pk="karpathy"; _cli_plugins="$(printf '%s' " $_cli_plugins " | sed -e "s/ ${_pk}-llm / /g" -e 's/^ *//;s/ *$//')" ;;
|
|
36
34
|
--plugin|--enable-plugin)
|
|
37
35
|
shift
|
|
38
36
|
[ -n "$1" ] && _cli_plugins="${_cli_plugins:+$_cli_plugins }$1"
|
package/lib/commands/system.sh
CHANGED
|
@@ -80,7 +80,7 @@ cmd_help() {
|
|
|
80
80
|
-v, --version Show version
|
|
81
81
|
|
|
82
82
|
WORKSPACE & SYSTEM SETUP
|
|
83
|
-
init [-y] [--repos-dir <dir>] [--code-workspace [file]] [--hooks|--no-hooks] [--copilot] [--claude] [--gemini] [--codex] [--cursor] [--windsurf] [--
|
|
83
|
+
init [-y] [--repos-dir <dir>] [--code-workspace [file]] [--hooks|--no-hooks] [--copilot] [--claude] [--gemini] [--codex] [--cursor] [--windsurf] [--llm-wiki] [dir]
|
|
84
84
|
Initialize a new Repo Nexus workspace (default: AGENTS.md)
|
|
85
85
|
install [dir] Install rnex & repo-nexus globally into ~/.local/bin (or custom dir)
|
|
86
86
|
sync [-y] [--quiet] Reconcile workspace, plugins, skills, member .rnex directories, and compile AI instructions
|
package/lib/workspace.sh
CHANGED
|
@@ -189,8 +189,7 @@ migrate_legacy_plugin_config() {
|
|
|
189
189
|
_mkc_f="$1"
|
|
190
190
|
[ -f "$_mkc_f" ] || return 0
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
_mkc_target="${_mkc_prefix}-llm"
|
|
192
|
+
_mkc_target="llm-wiki"
|
|
194
193
|
_mkc_has_sources=0
|
|
195
194
|
if command -v _yaml_plugin_list_from_file >/dev/null 2>&1; then
|
|
196
195
|
[ -n "$(_yaml_plugin_list_from_file "$_mkc_f" "$_mkc_target" "sources")" ] && _mkc_has_sources=1
|
package/lib/yaml.sh
CHANGED
|
@@ -1090,7 +1090,7 @@ yaml_list_plugins() {
|
|
|
1090
1090
|
_yaml_list_plugins_from_file "$_wy"
|
|
1091
1091
|
_yaml_list_plugins_from_file "$_wly"
|
|
1092
1092
|
if [ -n "$(_yaml_top_level_from_file "$_wly" "wiki_dir")" ] || [ -n "$(_yaml_top_level_from_file "$_wy" "wiki_dir")" ]; then
|
|
1093
|
-
|
|
1093
|
+
printf "llm-wiki\n"
|
|
1094
1094
|
fi
|
|
1095
1095
|
} | awk '!seen[$0]++'
|
|
1096
1096
|
}
|
|
@@ -1147,8 +1147,7 @@ yaml_get_plugin_config() {
|
|
|
1147
1147
|
fi
|
|
1148
1148
|
|
|
1149
1149
|
# 3. Special case backwards compatibility for wiki plugin top-level wiki_dir
|
|
1150
|
-
|
|
1151
|
-
if [ "$_ygpc_plugin" = "${_p_k}-llm" ] && [ "$_ygpc_key" = "wiki_dir" ]; then
|
|
1150
|
+
if [ "$_ygpc_plugin" = "llm-wiki" ] && [ "$_ygpc_key" = "wiki_dir" ]; then
|
|
1152
1151
|
_top_wd="$(yaml_get_top_level "wiki_dir")"
|
|
1153
1152
|
if [ -n "$_top_wd" ]; then
|
|
1154
1153
|
printf '%s' "$_top_wd"
|
|
@@ -1902,7 +1901,7 @@ _yaml_resolve_plugin_manifest_path() {
|
|
|
1902
1901
|
#
|
|
1903
1902
|
# Arguments:
|
|
1904
1903
|
# $1 - Optional workspace root directory (defaults to NEXUS_DIR or .).
|
|
1905
|
-
# $2 - Plugin identifier name (e.g. "claude", "copilot", "
|
|
1904
|
+
# $2 - Plugin identifier name (e.g. "claude", "copilot", "llm-wiki").
|
|
1906
1905
|
#
|
|
1907
1906
|
# Returns:
|
|
1908
1907
|
# Outputs newline-delimited hook event names to stdout.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-nexus",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.23",
|
|
4
4
|
"description": "Lightweight, zero-dependency Virtual Meta Repository (meta repo) and Nexus Repository (nexus repo) manager for multi-repo workspaces and shared AI context (no git submodules)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"repo-nexus": "rnex",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LLM Wiki Plugin for Repo Nexus
|
|
2
2
|
|
|
3
|
-
The **`
|
|
3
|
+
The **`llm-wiki`** plugin packages the agent behavioral principles, multi-repo context engineering standards, and the autonomous **LLM Wiki** knowledge architecture for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf).
|
|
4
4
|
|
|
5
5
|
No external vector databases, embedding pipelines, or MCP servers required — just a zero-dependency flat B-Tree sharded index directly in `.rnex/wiki/*.md`, organized by a bounded root router (`.rnex/wiki/index.md`), and recorded in a chronological audit log (`.rnex/wiki/log.md`).
|
|
6
6
|
|
|
7
|
-
Reference specification: [
|
|
7
|
+
Reference specification: [`instructions/rnex-scaffolding-meta-prompt.md`](instructions/rnex-scaffolding-meta-prompt.md).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -28,8 +28,8 @@ Reference specification: [setup-karpathy-wiki.md](https://github.com/unoxen/ai-t
|
|
|
28
28
|
* **Chronological Audit Log (`<wiki_dir>/log.md`):** Shared append-only log recording granular document lifecycle events (`created`, `updated`, `deleted`) and operational summaries when sources are indexed or repaired. Bounded to a rolling 1000-record window pruning oldest records first. Inspected via `tail -n 20 .rnex/wiki/log.md`.
|
|
29
29
|
|
|
30
30
|
### 4. Standardized Agent Skills (`skills/`)
|
|
31
|
-
* **`
|
|
32
|
-
* **`
|
|
31
|
+
* **`ingest.md` (User Skill: `rnex-llm-wiki-ingest`):** Guides deterministic CLI missing-source ingestion, flat B-Tree leaf shard updates, root router compilation, and audit log updates.
|
|
32
|
+
* **`lint.md` (User Skill: `rnex-llm-wiki-lint`):** Standalone integrity audit protocol to validate existing wiki files, assert zero symlinks, verify shard links and workspace doc references, and check root router bounds ($\le 80$ lines).
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -51,15 +51,15 @@ my-workspace/
|
|
|
51
51
|
│ │ ├── repo-nexus.md # Nexus repo shard
|
|
52
52
|
│ │ └── repos-<member-repo>.md # Member repo shard
|
|
53
53
|
│ └── plugins/
|
|
54
|
-
│ └──
|
|
54
|
+
│ └── llm-wiki/
|
|
55
55
|
│ ├── instructions/
|
|
56
56
|
│ │ ├── rnex-wiki-architecture.md
|
|
57
57
|
│ │ └── rnex-scaffolding-meta-prompt.md
|
|
58
58
|
│ ├── rules/
|
|
59
59
|
│ │ └── behavioral.md
|
|
60
60
|
│ ├── skills/
|
|
61
|
-
│ │ ├──
|
|
62
|
-
│ │ └──
|
|
61
|
+
│ │ ├── ingest.md
|
|
62
|
+
│ │ └── lint.md
|
|
63
63
|
│ ├── bin/
|
|
64
64
|
│ │ ├── ingest.sh
|
|
65
65
|
│ │ └── lint.sh
|
|
@@ -79,23 +79,23 @@ my-workspace/
|
|
|
79
79
|
### Via CLI
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
rnex plugin enable
|
|
82
|
+
rnex plugin enable llm-wiki
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
This command:
|
|
86
|
-
1. Adds `
|
|
87
|
-
2. Scopes `rules/`, `instructions/`, `skills/`, `bin/`, `lib/`, and `hooks/` into `.rnex/plugins/
|
|
86
|
+
1. Adds `llm-wiki` to `plugins:` in `rnex.yaml`.
|
|
87
|
+
2. Scopes `rules/`, `instructions/`, `skills/`, `bin/`, `lib/`, and `hooks/` into `.rnex/plugins/llm-wiki/`.
|
|
88
88
|
3. Reconciles workspace state, member repositories, and plugin assets via `rnex sync`.
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
92
|
## Configuration Reference
|
|
93
93
|
|
|
94
|
-
Configure `
|
|
94
|
+
Configure `llm-wiki` under `plugins:` in `rnex.yaml` or `.local.rnex.yaml`:
|
|
95
95
|
|
|
96
96
|
```yaml
|
|
97
97
|
plugins:
|
|
98
|
-
|
|
98
|
+
llm-wiki:
|
|
99
99
|
# Intake sources (directories and/or glob patterns)
|
|
100
100
|
sources:
|
|
101
101
|
- docs
|
|
@@ -111,18 +111,18 @@ plugins:
|
|
|
111
111
|
|
|
112
112
|
### CLI Subcommands
|
|
113
113
|
|
|
114
|
-
The `
|
|
114
|
+
The `llm-wiki` plugin exposes a streamlined 2-command CLI:
|
|
115
115
|
|
|
116
116
|
```sh
|
|
117
117
|
# Ingest missing sources from configured intake sources
|
|
118
|
-
rnex plugin
|
|
118
|
+
rnex plugin llm-wiki ingest
|
|
119
119
|
|
|
120
120
|
# Ingest a specific markdown source file directly in place
|
|
121
|
-
rnex plugin
|
|
122
|
-
rnex plugin
|
|
121
|
+
rnex plugin llm-wiki ingest docs/architecture.md
|
|
122
|
+
rnex plugin llm-wiki ingest --file docs/architecture.md
|
|
123
123
|
|
|
124
124
|
# Lint existing wiki structure, link integrity, and zero-symlink invariants
|
|
125
|
-
rnex plugin
|
|
125
|
+
rnex plugin llm-wiki lint
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
### Automated Synchronization Hooks (Strictly Opt-In)
|
|
@@ -137,13 +137,13 @@ To execute wiki ingestion automatically at the end of each `rnex sync`, declare
|
|
|
137
137
|
# ==============================================================================
|
|
138
138
|
rnex-hooks:
|
|
139
139
|
after_sync:
|
|
140
|
-
- "rnex plugin
|
|
140
|
+
- "rnex plugin llm-wiki ingest"
|
|
141
141
|
|
|
142
142
|
# ==============================================================================
|
|
143
143
|
# Workspace Plugins
|
|
144
144
|
# ==============================================================================
|
|
145
145
|
plugins:
|
|
146
|
-
|
|
146
|
+
llm-wiki:
|
|
147
147
|
sources:
|
|
148
148
|
- docs
|
|
149
149
|
- "repos/**/README.md"
|
|
@@ -161,9 +161,9 @@ AI coding assistants navigate the wiki using a deterministic 3-step retrieval pr
|
|
|
161
161
|
## Disabling
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
|
-
rnex plugin disable
|
|
164
|
+
rnex plugin disable llm-wiki
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
When disabled:
|
|
168
|
-
- Scoped assets under `.rnex/plugins/
|
|
168
|
+
- Scoped assets under `.rnex/plugins/llm-wiki/` are cleanly removed.
|
|
169
169
|
- **Your data in `./docs/` and `.rnex/wiki/` is preserved 100% intact.** Repo Nexus never deletes user-generated knowledge bases upon plugin disablement.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rnex-wiki-curator
|
|
3
|
+
description: Autonomous knowledge librarian for the LLM Wiki architecture.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wiki Curator Agent
|
|
7
|
+
|
|
8
|
+
Autonomous knowledge librarian specialized in synthesizing unstructured source documents from the configured intake sources (`plugins.llm-wiki.sources`, default: `docs`, `"repos/**/README.md"`; legacy `raw_dir`) into the flat LLM Wiki B-Tree index under `plugins.llm-wiki.wiki_dir` (default: `.rnex/wiki`).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LLM Wiki AI Instructions
|
|
2
2
|
|
|
3
3
|
## 1. B-Tree Wiki Retrieval Protocol
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
## 2. Maintenance & Operations
|
|
9
9
|
|
|
10
10
|
- **Zero Ad-Hoc Edits**: Never edit `.rnex/wiki/` shards manually or create ad-hoc files inside the wiki directory.
|
|
11
|
-
- **Ingestion**: Run `rnex plugin
|
|
12
|
-
- **Linting & Auto-Healing**: Run `rnex plugin
|
|
13
|
-
- **Agent Skills**: Load skills from `.rnex/plugins/
|
|
11
|
+
- **Ingestion**: Run `rnex plugin llm-wiki ingest` (or shorthand `rnex plugin ingest`) to index missing sources or update documentation.
|
|
12
|
+
- **Linting & Auto-Healing**: Run `rnex plugin llm-wiki lint` (or shorthand `rnex plugin lint`) to validate shard bounds, cross-references, and alphabetical sorting.
|
|
13
|
+
- **Agent Skills**: Load skills from `.rnex/plugins/llm-wiki/skills/` (`ingest.md`, `lint.md`) only when performing corresponding wiki tasks.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# =============================================================================
|
|
4
|
-
# File: plugins/
|
|
4
|
+
# File: plugins/llm-wiki/bin/ingest.sh
|
|
5
5
|
# Architectural Layer: Plugin CLI Entrypoint (ingest)
|
|
6
6
|
# Single Responsibility: Ingest ONLY missing Markdown documentation sources into
|
|
7
7
|
# the encapsulated .rnex/wiki/ B-Tree store.
|
|
@@ -19,20 +19,20 @@ set -e
|
|
|
19
19
|
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
|
|
20
20
|
PLUGIN_ROOT="$(CDPATH='' cd -- "${SCRIPT_DIR}/.." && pwd)"
|
|
21
21
|
case "$PLUGIN_ROOT" in
|
|
22
|
-
*/.rnex/plugins/
|
|
23
|
-
if [ -n "${RNEX_PLUGINS_DIR:-}" ] && [ -d "${RNEX_PLUGINS_DIR}/
|
|
24
|
-
PLUGIN_ROOT="${RNEX_PLUGINS_DIR}/
|
|
22
|
+
*/.rnex/plugins/llm-wiki)
|
|
23
|
+
if [ -n "${RNEX_PLUGINS_DIR:-}" ] && [ -d "${RNEX_PLUGINS_DIR}/llm-wiki/lib" ]; then
|
|
24
|
+
PLUGIN_ROOT="${RNEX_PLUGINS_DIR}/llm-wiki"
|
|
25
25
|
fi
|
|
26
26
|
;;
|
|
27
27
|
esac
|
|
28
28
|
|
|
29
|
-
# shellcheck source=plugins/
|
|
29
|
+
# shellcheck source=plugins/llm-wiki/lib/utils.sh
|
|
30
30
|
. "${PLUGIN_ROOT}/lib/utils.sh"
|
|
31
|
-
# shellcheck source=plugins/
|
|
31
|
+
# shellcheck source=plugins/llm-wiki/lib/config.sh
|
|
32
32
|
. "${PLUGIN_ROOT}/lib/config.sh"
|
|
33
|
-
# shellcheck source=plugins/
|
|
33
|
+
# shellcheck source=plugins/llm-wiki/lib/source_helpers.sh
|
|
34
34
|
. "${PLUGIN_ROOT}/lib/source_helpers.sh"
|
|
35
|
-
# shellcheck source=plugins/
|
|
35
|
+
# shellcheck source=plugins/llm-wiki/lib/btree_helpers.sh
|
|
36
36
|
. "${PLUGIN_ROOT}/lib/btree_helpers.sh"
|
|
37
37
|
|
|
38
38
|
main_ingest() {
|
|
@@ -73,11 +73,11 @@ main_ingest() {
|
|
|
73
73
|
shift
|
|
74
74
|
;;
|
|
75
75
|
--help|-h)
|
|
76
|
-
printf 'Usage: rnex plugin
|
|
76
|
+
printf 'Usage: rnex plugin llm-wiki ingest [<source_path>] [--file <path>] [--rewrite-links] [--strip-links] [--quiet]\n'
|
|
77
77
|
exit 0
|
|
78
78
|
;;
|
|
79
79
|
-*)
|
|
80
|
-
printf 'Error [ingest]: Unknown option "%s". Usage: rnex plugin
|
|
80
|
+
printf 'Error [ingest]: Unknown option "%s". Usage: rnex plugin llm-wiki ingest [<source_path>]\n' "$1" >&2
|
|
81
81
|
exit 1
|
|
82
82
|
;;
|
|
83
83
|
*)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# =============================================================================
|
|
4
|
-
# File: plugins/
|
|
4
|
+
# File: plugins/llm-wiki/bin/lint.sh
|
|
5
5
|
# Architectural Layer: Plugin CLI Entrypoint (lint)
|
|
6
6
|
# Single Responsibility: Lint ONLY existing documentation and references inside
|
|
7
7
|
# .rnex/wiki/. Does NOT inspect rnex config `sources` and does NOT run ingestion.
|
|
@@ -19,27 +19,27 @@ set -e
|
|
|
19
19
|
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
|
|
20
20
|
PLUGIN_ROOT="$(CDPATH='' cd -- "${SCRIPT_DIR}/.." && pwd)"
|
|
21
21
|
case "$PLUGIN_ROOT" in
|
|
22
|
-
*/.rnex/plugins/
|
|
23
|
-
if [ -n "${RNEX_PLUGINS_DIR:-}" ] && [ -d "${RNEX_PLUGINS_DIR}/
|
|
24
|
-
PLUGIN_ROOT="${RNEX_PLUGINS_DIR}/
|
|
22
|
+
*/.rnex/plugins/llm-wiki)
|
|
23
|
+
if [ -n "${RNEX_PLUGINS_DIR:-}" ] && [ -d "${RNEX_PLUGINS_DIR}/llm-wiki/lib" ]; then
|
|
24
|
+
PLUGIN_ROOT="${RNEX_PLUGINS_DIR}/llm-wiki"
|
|
25
25
|
fi
|
|
26
26
|
;;
|
|
27
27
|
esac
|
|
28
28
|
|
|
29
|
-
# shellcheck source=plugins/
|
|
29
|
+
# shellcheck source=plugins/llm-wiki/lib/utils.sh
|
|
30
30
|
. "${PLUGIN_ROOT}/lib/utils.sh"
|
|
31
|
-
# shellcheck source=plugins/
|
|
31
|
+
# shellcheck source=plugins/llm-wiki/lib/config.sh
|
|
32
32
|
. "${PLUGIN_ROOT}/lib/config.sh"
|
|
33
|
-
# shellcheck source=plugins/
|
|
33
|
+
# shellcheck source=plugins/llm-wiki/lib/source_helpers.sh
|
|
34
34
|
. "${PLUGIN_ROOT}/lib/source_helpers.sh"
|
|
35
|
-
# shellcheck source=plugins/
|
|
35
|
+
# shellcheck source=plugins/llm-wiki/lib/btree_helpers.sh
|
|
36
36
|
. "${PLUGIN_ROOT}/lib/btree_helpers.sh"
|
|
37
|
-
# shellcheck source=plugins/
|
|
37
|
+
# shellcheck source=plugins/llm-wiki/lib/lint_helpers.sh
|
|
38
38
|
. "${PLUGIN_ROOT}/lib/lint_helpers.sh"
|
|
39
39
|
|
|
40
40
|
# -----------------------------------------------------------------------------
|
|
41
41
|
# main_lint
|
|
42
|
-
# Summary: Entrypoint for the `rnex plugin
|
|
42
|
+
# Summary: Entrypoint for the `rnex plugin llm-wiki lint` CLI command.
|
|
43
43
|
# Parses CLI arguments, loads configuration, and delegates to the
|
|
44
44
|
# pure lint helper.
|
|
45
45
|
# @param $@: CLI arguments (--strict, --quiet/-q, --help/-h).
|
|
@@ -63,7 +63,7 @@ main_lint() {
|
|
|
63
63
|
shift
|
|
64
64
|
;;
|
|
65
65
|
--help|-h)
|
|
66
|
-
printf 'Usage: rnex plugin
|
|
66
|
+
printf 'Usage: rnex plugin llm-wiki lint [--strict] [--quiet]\n'
|
|
67
67
|
printf '\n'
|
|
68
68
|
printf 'Validates existing wiki documentation, B-Tree shard links, and references.\n'
|
|
69
69
|
printf 'Does not inspect workspace sources or trigger ingestion.\n'
|
|
@@ -71,7 +71,7 @@ main_lint() {
|
|
|
71
71
|
;;
|
|
72
72
|
-*)
|
|
73
73
|
printf 'Error [lint]: Unknown option "%s".\n' "$1" >&2
|
|
74
|
-
printf 'Usage: rnex plugin
|
|
74
|
+
printf 'Usage: rnex plugin llm-wiki lint [--strict] [--quiet]\n' >&2
|
|
75
75
|
exit 1
|
|
76
76
|
;;
|
|
77
77
|
*)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# =============================================================================
|
|
4
|
-
# File: plugins/
|
|
4
|
+
# File: plugins/llm-wiki/hooks/after_sync.sh
|
|
5
5
|
# Architectural Layer: Plugin Lifecycle Hook (after_sync)
|
|
6
6
|
# Single Responsibility: Project plugin user skills into active AI providers.
|
|
7
7
|
# Purity: Zero automatic ingestion or wiki compilation (SRP).
|
|
@@ -19,9 +19,9 @@ if ! command -v rnex_generate_user_skill >/dev/null 2>&1; then
|
|
|
19
19
|
fi
|
|
20
20
|
|
|
21
21
|
if command -v rnex_generate_user_skill >/dev/null 2>&1; then
|
|
22
|
-
for skill_file in "$RNEX_ROOT/.rnex/plugins/
|
|
22
|
+
for skill_file in "$RNEX_ROOT/.rnex/plugins/llm-wiki/skills"/*.md; do
|
|
23
23
|
[ -f "$skill_file" ] || continue
|
|
24
24
|
skill_name=$(basename "$skill_file" .md)
|
|
25
|
-
rnex_generate_user_skill "$skill_name" ".rnex/plugins/
|
|
25
|
+
rnex_generate_user_skill "$skill_name" ".rnex/plugins/llm-wiki/skills/${skill_name}.md" "llm-wiki"
|
|
26
26
|
done
|
|
27
27
|
fi
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# ============================================================================
|
|
4
|
-
# plugins/
|
|
4
|
+
# plugins/llm-wiki/hooks/before_plugin_disable.sh — Wiki skill cleanup
|
|
5
5
|
# ============================================================================
|
|
6
6
|
set -e
|
|
7
7
|
[ -z "$RNEX_ROOT" ] && { echo "Error: RNEX_ROOT not set"; exit 1; }
|
|
@@ -14,8 +14,6 @@ if ! command -v rnex_unregister_user_skill >/dev/null 2>&1; then
|
|
|
14
14
|
fi
|
|
15
15
|
|
|
16
16
|
if command -v rnex_unregister_user_skill >/dev/null 2>&1; then
|
|
17
|
-
rnex_unregister_user_skill "
|
|
18
|
-
rnex_unregister_user_skill "
|
|
19
|
-
rnex_unregister_user_skill "wiki-ingest"
|
|
20
|
-
rnex_unregister_user_skill "wiki-lint"
|
|
17
|
+
rnex_unregister_user_skill "ingest" "llm-wiki"
|
|
18
|
+
rnex_unregister_user_skill "lint" "llm-wiki"
|
|
21
19
|
fi
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LLM Wiki Scaffolding Prompt
|
|
2
2
|
|
|
3
|
-
Universal meta-prompt for setting up a
|
|
3
|
+
Universal meta-prompt for setting up a LLM Wiki knowledge architecture. Works with any AI agent harness. No external MCP servers, vector databases, or embedding pipelines required — just markdown files with structured frontmatter.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
```markdown
|
|
8
|
-
Set up a
|
|
8
|
+
Set up a LLM Wiki in this repository: a self-maintaining knowledge base where raw source material is ingested into interlinked atomic markdown files that any AI agent can navigate by reading indexes and following typed frontmatter relations.
|
|
9
9
|
|
|
10
10
|
Do not use external MCP servers, vector databases, or embedding pipelines.
|
|
11
11
|
Do not hard-code any specific AI tool or harness into the wiki structure itself.
|
|
@@ -21,14 +21,14 @@ Initialize the fixed baseline directories and control files:
|
|
|
21
21
|
- **`.rnex/wiki/repo-nexus.md`** & **`.rnex/wiki/repos-<member>.md`** — Flat B-Tree leaf shards.
|
|
22
22
|
- **`.rnex/wiki/log.md`** — Append-only operation log recording all ingest and lint runs.
|
|
23
23
|
|
|
24
|
-
Do not create arbitrary or speculative subdirectories during initialization. Scaffolding is 100% deterministic. Flat leaf shards reside directly in `.rnex/wiki/` (or configured `wiki_dir`) with zero `_graph/` and zero `_index/` subdirectories. Domain sub-shards emerge organically during the source ingestion phase (`
|
|
24
|
+
Do not create arbitrary or speculative subdirectories during initialization. Scaffolding is 100% deterministic. Flat leaf shards reside directly in `.rnex/wiki/` (or configured `wiki_dir`) with zero `_graph/` and zero `_index/` subdirectories. Domain sub-shards emerge organically during the source ingestion phase (`ingest`).
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
28
|
### 2. Agent Rules & Routing
|
|
29
29
|
|
|
30
|
-
- **Repo Nexus Workspaces**: Paths (`sources`, default: `["docs", "repos/**/README.md"]`; legacy `raw_dir`; `wiki_dir`, default: `.rnex/wiki`) are configured in `rnex.yaml` under `plugins.
|
|
31
|
-
- **Standalone Repositories**: Append the `##
|
|
30
|
+
- **Repo Nexus Workspaces**: Paths (`sources`, default: `["docs", "repos/**/README.md"]`; legacy `raw_dir`; `wiki_dir`, default: `.rnex/wiki`) are configured in `rnex.yaml` under `plugins.llm-wiki`. Plugin assets are scoped under `.rnex/plugins/llm-wiki/` (`ai-instructions.md`, `rules/behavioral.md`, and `instructions/rnex-wiki-architecture.md`). Instructions are registered in `.rnex/ai-instructions.md`.
|
|
31
|
+
- **Standalone Repositories**: Append the `## LLM Wiki Rules` section (see Section 4) to the primary AI instructions file (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, etc.), preserving all existing content.
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
@@ -69,12 +69,12 @@ The relation graph lives in frontmatter, not in prose links. Agents traverse the
|
|
|
69
69
|
In standalone repositories (outside Repo Nexus), append:
|
|
70
70
|
|
|
71
71
|
```markdown
|
|
72
|
-
##
|
|
72
|
+
## LLM Wiki Rules
|
|
73
73
|
|
|
74
74
|
- **Intake**: All source material (articles, transcripts, docs, notes) is resolved from configured `sources` (or legacy `raw_dir`, default: `./docs`) unmodified. Never write directly to `wiki/` without ingesting.
|
|
75
|
-
- **Orientation**: Follow the 3-step B-Tree retrieval protocol: (1) Read `wiki/index.md` (bounded root router <= 80 lines) or run `rnex plugin
|
|
76
|
-
- **Ingestion**: When files appear in configured sources, run `rnex plugin
|
|
77
|
-
- **Maintenance**: Run `rnex plugin
|
|
75
|
+
- **Orientation**: Follow the 3-step B-Tree retrieval protocol: (1) Read `wiki/index.md` (bounded root router <= 80 lines) or run `rnex plugin llm-wiki search <keyword>`; (2) Read the target shard `wiki/_index/<shard>.md` or run `rnex plugin llm-wiki graph <node_id>`; (3) Open only the 1–3 target leaf pages in `wiki/`.
|
|
76
|
+
- **Ingestion**: When files appear in configured sources, run `rnex plugin llm-wiki ingest` to scaffold deterministic 1-to-1 wiki pages (`repo-<name>.md` for root member repo READMEs; `<normalized-relative-path>.md` for all other sources), then enrich each page in-place.
|
|
77
|
+
- **Maintenance**: Run `rnex plugin llm-wiki lint` to validate paths, update relations, verify B-Tree bounds, and preserve graph integrity.
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
---
|
|
@@ -83,17 +83,17 @@ In standalone repositories (outside Repo Nexus), append:
|
|
|
83
83
|
|
|
84
84
|
Create workflow instruction files at `.agent/workflows/` (or `.agent/skills/` depending on the harness):
|
|
85
85
|
|
|
86
|
-
**`
|
|
86
|
+
**`ingest.md`**:
|
|
87
87
|
1. Scan configured `sources` for files not yet recorded in `wiki/log.md`.
|
|
88
|
-
2. Ingest and index authoritative workspace documents directly in place via `rnex plugin
|
|
88
|
+
2. Ingest and index authoritative workspace documents directly in place via `rnex plugin llm-wiki ingest`.
|
|
89
89
|
3. Rebalance flat B-Tree leaf shards directly under `wiki/` (`wiki/repo-nexus*.md`, `wiki/repos-*.md`) and recompile the root router `wiki/index.md`.
|
|
90
90
|
4. Append an ingestion summary to `wiki/log.md`.
|
|
91
91
|
|
|
92
|
-
**`
|
|
92
|
+
**`lint.md`**:
|
|
93
93
|
1. Verify flat B-Tree shard invariants, auto-healing legacy artifacts and directories (`_graph/`, `_index/`, `overview/`, `entities/`, `sources/`, `concepts/`, `repos/`).
|
|
94
94
|
2. Assert zero symbolic links in `wiki/`.
|
|
95
95
|
3. Verify the root router `wiki/index.md` remains strictly within its line budget ($\le 80$ lines).
|
|
96
|
-
4. Run `rnex plugin
|
|
96
|
+
4. Run `rnex plugin llm-wiki lint` to rebalance shards and verify structural integrity.
|
|
97
97
|
5. Append a lint summary to `wiki/log.md`.
|
|
98
98
|
|
|
99
99
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LLM Wiki Directives
|
|
2
2
|
|
|
3
|
-
> Follow the execution gate and routing directives in `.rnex/ai-instructions.md` and `.rnex/plugins/
|
|
3
|
+
> Follow the execution gate and routing directives in `.rnex/ai-instructions.md` and `.rnex/plugins/llm-wiki/ai-instructions.md`.
|
|
4
4
|
|
|
5
5
|
- **Behavioral Rules**: (1) State assumptions and surface trade-offs before coding; (2) Prefer minimal, non-speculative code; (3) Make surgical edits touching only required lines; (4) Verify changes against concrete goals.
|
|
6
6
|
- **Wiki-First**: Follow the B-Tree retrieval protocol: (1) Read `<wiki_dir>/index.md`; (2) Read the target index shard `<wiki_dir>/repo-nexus*.md` or `<wiki_dir>/repos-<member>*.md` and open only the authoritative source documents referenced by the shard.
|
|
7
|
-
- **Wiki Operations**: Never edit `<wiki_dir>/` shards ad-hoc. Run `rnex plugin
|
|
7
|
+
- **Wiki Operations**: Never edit `<wiki_dir>/` shards ad-hoc. Run `rnex plugin llm-wiki ingest` or `rnex plugin llm-wiki lint`, or load `.rnex/plugins/llm-wiki/skills/ingest.md` / `lint.md` when executing ingestion or linting.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# shellcheck disable=SC2016
|
|
4
4
|
# =============================================================================
|
|
5
|
-
# File: plugins/
|
|
5
|
+
# File: plugins/llm-wiki/lib/btree_helpers.sh
|
|
6
6
|
# Architectural Layer: Domain Helpers (helpers/)
|
|
7
7
|
# Single Responsibility: Incrementally merge newly discovered missing sources
|
|
8
8
|
# into flat B-Tree shards (.rnex/wiki/*.md), maintain strict LC_ALL=C sort
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
# =============================================================================
|
|
21
21
|
|
|
22
22
|
# Guard against redundant multiple inclusion
|
|
23
|
-
if [ "${
|
|
23
|
+
if [ "${RNEX_LLM_WIKI_BTREE_HELPERS_SH_SOURCED:-0}" = "1" ]; then
|
|
24
24
|
# shellcheck disable=SC2317
|
|
25
25
|
return 0 2>/dev/null || exit 0
|
|
26
26
|
fi
|
|
27
|
-
|
|
27
|
+
RNEX_LLM_WIKI_BTREE_HELPERS_SH_SOURCED=1
|
|
28
28
|
|
|
29
29
|
# -----------------------------------------------------------------------------
|
|
30
30
|
# extract_markdown_title_and_summary
|