repo-nexus 0.9.21 → 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/ai.sh +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/sdk.sh +5 -5
- 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/claude/tests/test_plugin.sh +1 -1
- package/plugins/codex/plugin.yaml +1 -1
- package/plugins/codex/tests/test_plugin.sh +1 -1
- package/plugins/copilot/plugin.yaml +1 -1
- package/plugins/copilot/tests/test_plugin.sh +2 -2
- package/plugins/cursor/plugin.yaml +1 -1
- package/plugins/cursor/tests/test_plugin.sh +1 -1
- package/plugins/gemini/plugin.yaml +1 -1
- package/plugins/gemini/tests/test_plugin.sh +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/plugins/windsurf/tests/test_plugin.sh +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
|
@@ -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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# =============================================================================
|
|
4
|
-
# File: plugins/
|
|
4
|
+
# File: plugins/llm-wiki/lib/config.sh
|
|
5
5
|
# Architectural Layer: Configuration Management Contract (Fail-Fast)
|
|
6
6
|
# Single Responsibility: Validate and expose read-only runtime configuration
|
|
7
|
-
# contracts for the
|
|
7
|
+
# contracts for the LLM Wiki engine, defaulting to .rnex/wiki.
|
|
8
8
|
#
|
|
9
9
|
# Design Patterns & Principles:
|
|
10
10
|
# - Contract-First Design: Centralizes configuration loading, sanitization,
|
|
@@ -19,33 +19,33 @@
|
|
|
19
19
|
# =============================================================================
|
|
20
20
|
|
|
21
21
|
# Guard against redundant multiple inclusion
|
|
22
|
-
if [ "${
|
|
22
|
+
if [ "${RNEX_LLM_WIKI_CONFIG_SH_SOURCED:-0}" = "1" ]; then
|
|
23
23
|
# shellcheck disable=SC2317
|
|
24
24
|
return 0 2>/dev/null || exit 0
|
|
25
25
|
fi
|
|
26
|
-
|
|
26
|
+
RNEX_LLM_WIKI_CONFIG_SH_SOURCED=1
|
|
27
27
|
|
|
28
28
|
# -----------------------------------------------------------------------------
|
|
29
|
-
#
|
|
30
|
-
# Summary: Looks up a configuration key for the
|
|
29
|
+
# _lookup_llm_wiki_cfg
|
|
30
|
+
# Summary: Looks up a configuration key for the llm-wiki plugin from the
|
|
31
31
|
# workspace YAML configuration (supporting yaml_plugin_get,
|
|
32
32
|
# .local.rnex.yaml, and rnex.yaml).
|
|
33
33
|
# @param $1: target_key - Configuration setting key name.
|
|
34
34
|
# @returns: Setting value string on stdout, or empty string if not configured.
|
|
35
35
|
# @pure (Read-only configuration inspection)
|
|
36
36
|
# -----------------------------------------------------------------------------
|
|
37
|
-
|
|
37
|
+
_lookup_llm_wiki_cfg() {
|
|
38
38
|
_k="$1"
|
|
39
39
|
_v=""
|
|
40
40
|
if command -v yaml_plugin_get >/dev/null 2>&1; then
|
|
41
|
-
_v="$(yaml_plugin_get "
|
|
41
|
+
_v="$(yaml_plugin_get "llm-wiki" "$_k" 2>/dev/null || true)"
|
|
42
42
|
fi
|
|
43
43
|
if [ -z "$_v" ] && [ -n "${RNEX_WORKSPACE_ROOT:-}" ]; then
|
|
44
44
|
for _cf in "${RNEX_WORKSPACE_ROOT}/.local.rnex.yaml" "${RNEX_WORKSPACE_ROOT}/rnex.yaml"; do
|
|
45
45
|
[ -f "$_cf" ] || continue
|
|
46
46
|
_v="$(LC_ALL=C awk -v target_k="$_k" '
|
|
47
47
|
BEGIN { in_plugin=0 }
|
|
48
|
-
/^[ ]*
|
|
48
|
+
/^[ ]*llm-wiki:[ ]*$/ { in_plugin=1; next }
|
|
49
49
|
in_plugin && /^[^ ]/ { in_plugin=0 }
|
|
50
50
|
in_plugin && $1 ~ ("^" target_k ":") {
|
|
51
51
|
line = $0
|
|
@@ -96,7 +96,7 @@ load_wiki_config_contract() {
|
|
|
96
96
|
if [ -n "${RNEX_CFG_WIKI_DIR:-}" ]; then
|
|
97
97
|
_wiki_rel="$RNEX_CFG_WIKI_DIR"
|
|
98
98
|
else
|
|
99
|
-
_wiki_rel="$(
|
|
99
|
+
_wiki_rel="$(_lookup_llm_wiki_cfg "wiki_dir")"
|
|
100
100
|
[ -n "$_wiki_rel" ] || _wiki_rel=".rnex/wiki"
|
|
101
101
|
fi
|
|
102
102
|
|
|
@@ -119,7 +119,7 @@ load_wiki_config_contract() {
|
|
|
119
119
|
if [ -n "${RNEX_CFG_INDEX_FILE:-}" ]; then
|
|
120
120
|
_idx_name="$RNEX_CFG_INDEX_FILE"
|
|
121
121
|
else
|
|
122
|
-
_idx_name="$(
|
|
122
|
+
_idx_name="$(_lookup_llm_wiki_cfg "index_file")"
|
|
123
123
|
[ -n "$_idx_name" ] || _idx_name="index.md"
|
|
124
124
|
fi
|
|
125
125
|
RNEX_WIKI_INDEX_FILE="${RNEX_WIKI_ROOT}/${_idx_name}"
|
|
@@ -128,7 +128,7 @@ load_wiki_config_contract() {
|
|
|
128
128
|
if [ -n "${RNEX_CFG_LOG_FILE:-}" ]; then
|
|
129
129
|
_log_name="$RNEX_CFG_LOG_FILE"
|
|
130
130
|
else
|
|
131
|
-
_log_name="$(
|
|
131
|
+
_log_name="$(_lookup_llm_wiki_cfg "log_file")"
|
|
132
132
|
[ -n "$_log_name" ] || _log_name="log.md"
|
|
133
133
|
fi
|
|
134
134
|
RNEX_WIKI_LOG_FILE="${RNEX_WIKI_ROOT}/${_log_name}"
|
|
@@ -153,14 +153,14 @@ load_wiki_config_contract() {
|
|
|
153
153
|
if [ -n "${RNEX_CFG_BTREE_ROOT_MAX_LINES:-}" ]; then
|
|
154
154
|
RNEX_WIKI_BTREE_MAX_ROOT_LINES="$RNEX_CFG_BTREE_ROOT_MAX_LINES"
|
|
155
155
|
else
|
|
156
|
-
RNEX_WIKI_BTREE_MAX_ROOT_LINES="$(
|
|
156
|
+
RNEX_WIKI_BTREE_MAX_ROOT_LINES="$(_lookup_llm_wiki_cfg "btree_root_max_lines")"
|
|
157
157
|
[ -n "$RNEX_WIKI_BTREE_MAX_ROOT_LINES" ] || RNEX_WIKI_BTREE_MAX_ROOT_LINES=80
|
|
158
158
|
fi
|
|
159
159
|
|
|
160
160
|
if [ -n "${RNEX_CFG_BTREE_SHARD_MAX_ENTRIES:-}" ]; then
|
|
161
161
|
RNEX_WIKI_BTREE_SHARD_MAX_ENTRIES="$RNEX_CFG_BTREE_SHARD_MAX_ENTRIES"
|
|
162
162
|
else
|
|
163
|
-
RNEX_WIKI_BTREE_SHARD_MAX_ENTRIES="$(
|
|
163
|
+
RNEX_WIKI_BTREE_SHARD_MAX_ENTRIES="$(_lookup_llm_wiki_cfg "btree_shard_max_entries")"
|
|
164
164
|
[ -n "$RNEX_WIKI_BTREE_SHARD_MAX_ENTRIES" ] || RNEX_WIKI_BTREE_SHARD_MAX_ENTRIES=100
|
|
165
165
|
fi
|
|
166
166
|
|
|
@@ -168,7 +168,7 @@ load_wiki_config_contract() {
|
|
|
168
168
|
if [ -n "${RNEX_CFG_LOG_MAX_RECORDS:-}" ]; then
|
|
169
169
|
RNEX_WIKI_LOG_MAX_RECORDS="$RNEX_CFG_LOG_MAX_RECORDS"
|
|
170
170
|
else
|
|
171
|
-
RNEX_WIKI_LOG_MAX_RECORDS="$(
|
|
171
|
+
RNEX_WIKI_LOG_MAX_RECORDS="$(_lookup_llm_wiki_cfg "log_max_records")"
|
|
172
172
|
[ -n "$RNEX_WIKI_LOG_MAX_RECORDS" ] || RNEX_WIKI_LOG_MAX_RECORDS=1000
|
|
173
173
|
fi
|
|
174
174
|
|
|
@@ -186,7 +186,7 @@ load_wiki_config_contract() {
|
|
|
186
186
|
if [ -n "${RNEX_CFG_RELATIVE_LINKS:-}" ]; then
|
|
187
187
|
RNEX_WIKI_RELATIVE_LINKS="$RNEX_CFG_RELATIVE_LINKS"
|
|
188
188
|
else
|
|
189
|
-
RNEX_WIKI_RELATIVE_LINKS="$(
|
|
189
|
+
RNEX_WIKI_RELATIVE_LINKS="$(_lookup_llm_wiki_cfg "relative_links")"
|
|
190
190
|
[ -n "$RNEX_WIKI_RELATIVE_LINKS" ] || RNEX_WIKI_RELATIVE_LINKS="rewrite"
|
|
191
191
|
fi
|
|
192
192
|
|
|
@@ -211,17 +211,6 @@ load_wiki_config_contract() {
|
|
|
211
211
|
return 0
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
# -----------------------------------------------------------------------------
|
|
215
|
-
# load_karpathy_wiki_config
|
|
216
|
-
# Summary: Backwards-compatible contract loader aliasing load_wiki_config_contract.
|
|
217
|
-
# @param $1: workspace_root - Optional workspace root path.
|
|
218
|
-
# @returns: 0 on valid configuration; 1 on schema validation error.
|
|
219
|
-
# @sideEffects: Delegates directly to load_wiki_config_contract.
|
|
220
|
-
# -----------------------------------------------------------------------------
|
|
221
|
-
load_karpathy_wiki_config() {
|
|
222
|
-
load_wiki_config_contract "$@"
|
|
223
|
-
}
|
|
224
|
-
|
|
225
214
|
# -----------------------------------------------------------------------------
|
|
226
215
|
# is_repo_enabled
|
|
227
216
|
# Summary: Determines whether a member repository is enabled or disabled
|
|
@@ -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/lint_helpers.sh
|
|
6
6
|
# Architectural Layer: Domain Helpers (helpers/)
|
|
7
7
|
# Single Responsibility: Validate and auto-heal existing Markdown files inside
|
|
8
8
|
# .rnex/wiki/ (root router bounds, orphan shards, dead workspace references,
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
# =============================================================================
|
|
22
22
|
|
|
23
23
|
# Guard against redundant multiple inclusion
|
|
24
|
-
if [ "${
|
|
24
|
+
if [ "${RNEX_LLM_WIKI_LINT_HELPERS_SH_SOURCED:-0}" = "1" ]; then
|
|
25
25
|
# shellcheck disable=SC2317
|
|
26
26
|
return 0 2>/dev/null || exit 0
|
|
27
27
|
fi
|
|
28
|
-
|
|
28
|
+
RNEX_LLM_WIKI_LINT_HELPERS_SH_SOURCED=1
|
|
29
29
|
|
|
30
30
|
# Ensure btree helpers are available for index router compilation and logging
|
|
31
31
|
if ! command -v compile_root_index_router >/dev/null 2>&1; then
|
|
32
32
|
_lh_script_dir="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
|
|
33
|
-
# shellcheck source=plugins/
|
|
33
|
+
# shellcheck source=plugins/llm-wiki/lib/btree_helpers.sh
|
|
34
34
|
. "${_lh_script_dir}/btree_helpers.sh"
|
|
35
35
|
fi
|
|
36
36
|
|
|
@@ -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/source_helpers.sh
|
|
6
6
|
# Architectural Layer: Domain Helpers (helpers/)
|
|
7
7
|
# Single Responsibility: Discover candidate Markdown source files from an
|
|
8
8
|
# explicit CLI source argument or configured `sources` in rnex YAML configs,
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
# =============================================================================
|
|
25
25
|
|
|
26
26
|
# Guard against redundant multiple inclusion
|
|
27
|
-
if [ "${
|
|
27
|
+
if [ "${RNEX_LLM_WIKI_SOURCE_HELPERS_SH_SOURCED:-0}" = "1" ]; then
|
|
28
28
|
# shellcheck disable=SC2317
|
|
29
29
|
return 0 2>/dev/null || exit 0
|
|
30
30
|
fi
|
|
31
|
-
|
|
31
|
+
RNEX_LLM_WIKI_SOURCE_HELPERS_SH_SOURCED=1
|
|
32
32
|
|
|
33
33
|
# -----------------------------------------------------------------------------
|
|
34
34
|
# parse_configured_workspace_sources
|
|
@@ -76,8 +76,8 @@ parse_configured_workspace_sources() {
|
|
|
76
76
|
curr_repo = ""
|
|
77
77
|
in_repo_sources = 0
|
|
78
78
|
in_top_sources = 0
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
in_llm_wiki = 0
|
|
80
|
+
in_llm_wiki_sources = 0
|
|
81
81
|
if (line ~ /^sources:[[:space:]]*\[.*\][[:space:]]*$/) {
|
|
82
82
|
sub(/^sources:[[:space:]]*/, "", line)
|
|
83
83
|
emit_inline(line, "")
|
|
@@ -99,25 +99,25 @@ parse_configured_workspace_sources() {
|
|
|
99
99
|
next
|
|
100
100
|
}
|
|
101
101
|
if (in_plugins) {
|
|
102
|
-
if (line ~ /^
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
if (line ~ /^llm-wiki:[[:space:]]*$/) {
|
|
103
|
+
in_llm_wiki = 1
|
|
104
|
+
in_llm_wiki_sources = 0
|
|
105
105
|
next
|
|
106
106
|
}
|
|
107
|
-
if (
|
|
107
|
+
if (in_llm_wiki) {
|
|
108
108
|
if (line ~ /^sources:[[:space:]]*\[.*\][[:space:]]*$/) {
|
|
109
109
|
sub(/^sources:[[:space:]]*/, "", line)
|
|
110
110
|
emit_inline(line, "")
|
|
111
111
|
found_top_sources = 1
|
|
112
112
|
} else if (line ~ /^sources:[[:space:]]*$/) {
|
|
113
|
-
|
|
113
|
+
in_llm_wiki_sources = 1
|
|
114
114
|
found_top_sources = 1
|
|
115
|
-
} else if (
|
|
115
|
+
} else if (in_llm_wiki_sources && line ~ /^-[[:space:]]+/) {
|
|
116
116
|
sub(/^-[[:space:]]+/, "", line)
|
|
117
117
|
tok = clean_token(line)
|
|
118
118
|
if (tok != "") print tok
|
|
119
119
|
} else if (line !~ /^-[[:space:]]+/) {
|
|
120
|
-
|
|
120
|
+
in_llm_wiki_sources = 0
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# shellcheck shell=sh
|
|
3
3
|
# =============================================================================
|
|
4
|
-
# File: plugins/
|
|
4
|
+
# File: plugins/llm-wiki/lib/utils.sh
|
|
5
5
|
# Architectural Layer: Pure General Utilities (utils/ — Zero Domain Dependencies)
|
|
6
6
|
# Single Responsibility: Provide stateless, deterministic, dependency-free
|
|
7
7
|
# string, slug, path normalization, relative link prefix calculation,
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
# =============================================================================
|
|
21
21
|
|
|
22
22
|
# Guard against redundant multiple inclusion in subshells or helper chains
|
|
23
|
-
if [ "${
|
|
23
|
+
if [ "${RNEX_LLM_WIKI_UTILS_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_UTILS_SH_SOURCED=1
|
|
28
28
|
|
|
29
29
|
# -----------------------------------------------------------------------------
|
|
30
30
|
# get_iso_utc_date
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
> "The delicate art and science of context engineering: filling the context window with just the right information for the next step." — Andrej Karpathy
|
|
1
|
+
# Coding Agent Behavioral Principles
|
|
4
2
|
|
|
5
3
|
These rules define standing behavioral principles for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf) working in this workspace.
|
|
6
4
|
|
|
@@ -47,7 +45,7 @@ In a Repo Nexus workspace, independent repositories are organized into `./repos/
|
|
|
47
45
|
- Rely on active workspace context, indexing, and compiled documentation rather than re-scanning raw files repeatedly.
|
|
48
46
|
|
|
49
47
|
4. **In-Place Source Indexing & Encapsulated Metadata:**
|
|
50
|
-
- Source documents (`plugins.
|
|
48
|
+
- Source documents (`plugins.llm-wiki.sources`, default: `docs`, `repos/**/README.md`) and member repositories (`./<repos_dir>/`, default: `./repos/`) are indexed directly in place without symlinks (`ln -s`) or redundant copies (`wiki/concepts/` and `wiki/repos/` do not exist). Generated wiki metadata (`index.md`, `log.md`, `repo-nexus*.md`, `repos-*.md`) resides exclusively directly inside `wiki_dir` (`wiki/`). Zero `_graph/` and zero `_index/` subdirectories.
|
|
51
49
|
|
|
52
50
|
5. **Wiki Navigation Order:**
|
|
53
51
|
- **Step 1 — B-Tree Root Index**: Consult `<wiki_dir>/_index.md` (bounded root routing table <= 80 lines) to locate the appropriate shard (`_index/repo-nexus*.md` or `_index/repos-<member>*.md`).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Agentic Skill:
|
|
1
|
+
# Agentic Skill: ingest
|
|
2
2
|
|
|
3
3
|
Deterministically ingest missing documentation sources into .rnex/wiki using the rnex CLI.
|
|
4
4
|
|
|
@@ -13,16 +13,16 @@ Use this skill when ingesting new reference materials, architecture documentatio
|
|
|
13
13
|
Always scaffold and ingest missing documentation deterministically using the built-in CLI helper:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
rnex plugin
|
|
16
|
+
rnex plugin llm-wiki ingest [<source_path>] [--file <path>] [--rewrite-links] [--strip-links] [--quiet]
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
- Ingest all configured missing sources:
|
|
20
20
|
```sh
|
|
21
|
-
rnex plugin
|
|
21
|
+
rnex plugin llm-wiki ingest
|
|
22
22
|
```
|
|
23
23
|
- Ingest a specific missing document, directory, or glob pattern:
|
|
24
24
|
```sh
|
|
25
|
-
rnex plugin
|
|
25
|
+
rnex plugin llm-wiki ingest docs/new-feature.md
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Agent Context Retrieval Protocol
|
|
@@ -40,7 +40,7 @@ AI coding agents navigate wiki context via the 3-step zero-token-bloat protocol:
|
|
|
40
40
|
- Generated wiki artifacts reside exclusively directly in `.rnex/wiki/`: `.rnex/wiki/index.md` (root router table), `.rnex/wiki/log.md` (audit log), and flat leaf shards (`.rnex/wiki/repo-nexus*.md`, `.rnex/wiki/repos-*.md`). Zero `_graph/` and zero `_index/` subdirectories.
|
|
41
41
|
|
|
42
42
|
2. **Deterministic CLI Ingestion (Missing Sources Only):**
|
|
43
|
-
- Execute `rnex plugin
|
|
43
|
+
- Execute `rnex plugin llm-wiki ingest [<source_path>]` under the hood.
|
|
44
44
|
- **NEVER** manually create, sort, or edit `.rnex/wiki/index.md` or `.rnex/wiki/*.md` shard files.
|
|
45
45
|
- The CLI identifies which candidate sources have not yet been indexed and appends only missing entries into their respective B-Tree shards, preserving all existing shard entries and custom summaries intact.
|
|
46
46
|
- B-Tree shards are maintained in strict `LC_ALL=C` sort order.
|
|
@@ -53,4 +53,4 @@ AI coding agents navigate wiki context via the 3-step zero-token-bloat protocol:
|
|
|
53
53
|
- Maintain clear Markdown cross-references and backlinks.
|
|
54
54
|
|
|
55
55
|
4. **Integrity Verification:**
|
|
56
|
-
- Execute `rnex plugin
|
|
56
|
+
- Execute `rnex plugin llm-wiki lint` to verify zero symlinks, zero broken links, valid workspace references, and root router line count bounds ($\le 80$ lines).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Agentic Skill:
|
|
1
|
+
# Agentic Skill: lint
|
|
2
2
|
|
|
3
3
|
Validate existing wiki documents, shard links, and workspace references inside .rnex/wiki.
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ Use this skill to validate the curated flat wiki catalog, ensuring all B-Tree sh
|
|
|
13
13
|
Always invoke the deterministic rnex CLI command under the hood:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
rnex plugin
|
|
16
|
+
rnex plugin llm-wiki lint [--strict] [--quiet]
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Agent Context Retrieval Protocol
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Multi-Repo LLM Wiki: Architecture & Knowledge Index
|
|
2
2
|
|
|
3
|
-
> Based on the **
|
|
3
|
+
> Based on the **LLM Wiki Pattern**: Compiling raw multi-repo codebase knowledge into persistent, indexed Markdown notes that compound across AI coding sessions.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|