repo-nexus 0.7.0 → 0.7.1

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/docs/.gitkeep ADDED
File without changes
@@ -109,7 +109,7 @@ plugins:
109
109
 
110
110
  # Functional / Knowledge Plugins
111
111
  karpathy-llm:
112
- lint_trigger: git-post-merge
112
+ lint_trigger: manual
113
113
  notify_on_changes: true
114
114
  ```
115
115
 
@@ -97,7 +97,7 @@ plugins:
97
97
 
98
98
  # Automated Git hook trigger for wiki verification
99
99
  # Options: git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual
100
- lint_trigger: git-post-merge
100
+ lint_trigger: manual
101
101
 
102
102
  # Notify developer when changes are committed to ./docs/ or .rnex/wiki/
103
103
  notify_on_changes: true
@@ -110,7 +110,7 @@ plugins:
110
110
  |:---|:---|:---|:---|
111
111
  | `wiki_dir` | string | `.rnex/wiki` | Directory containing curated atomic markdown pages. |
112
112
  | `raw_dir` | string | `./docs` | Append-only directory for unmodified source intake documents. |
113
- | `lint_trigger` | string | `git-post-merge` | Git hook event that triggers wiki change detection (`git-post-merge`, `git-post-commit`, `git-pre-commit`, `git-pre-push`, `manual`). |
113
+ | `lint_trigger` | string | `manual` | Git hook event that triggers wiki change detection (`git-post-merge`, `git-post-commit`, `git-pre-commit`, `git-pre-push`, `manual`). |
114
114
  | `notify_on_changes` | boolean | `true` | Show notification banner when changes are committed to `./docs/` or `.rnex/wiki/`. |
115
115
  | `enabled` | boolean | `true` | Enable or disable the plugin. Overridable in `.local.rnex.yaml`. |
116
116
 
@@ -113,9 +113,9 @@ plugins:
113
113
  # prompts: true # mirror prompts to .windsurf/prompts/*.md (default: true)
114
114
  # workflows: true # mirror workflows as prompts (default: true)
115
115
  # karpathy-llm:
116
- # wiki_dir: .rnex/wiki # Directory for curated atomic markdown pages (default: .rnex/wiki)
117
- # raw_dir: ./docs # Append-only directory for unmodified intake documents (default: ./docs)
118
- # lint_trigger: git-post-merge # Git hook event: git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual
116
+ # raw_dir: "./docs" # Append-only directory for unmodified intake documents (default: ./docs)
117
+ # wiki_dir: ".rnex/wiki" # Directory for curated atomic markdown pages (default: .rnex/wiki)
118
+ # lint_trigger: "manual" # Runs manually via 'rnex sync' or validation checklists (git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual)
119
119
  # notify_on_changes: true # Show notification when changes are committed to ./docs or .rnex/wiki
120
120
 
121
121
  # ------------------------------------------------------------------------------
@@ -15,6 +15,7 @@ cmd_init() {
15
15
  _cli_gemini=""
16
16
  _cli_cursor=""
17
17
  _cli_windsurf=""
18
+ _cli_karpathy=""
18
19
 
19
20
  while [ $# -gt 0 ]; do
20
21
  case "$1" in
@@ -31,6 +32,8 @@ cmd_init() {
31
32
  --no-cursor) _cli_cursor="false" ;;
32
33
  --windsurf) _cli_windsurf="true" ;;
33
34
  --no-windsurf) _cli_windsurf="false" ;;
35
+ --karpathy|--karpathy-llm) _cli_karpathy="true" ;;
36
+ --no-karpathy|--no-karpathy-llm) _cli_karpathy="false" ;;
34
37
  --ai|--instructions|--ai-instructions)
35
38
  shift
36
39
  # Legacy flag ignored in favor of plugins
@@ -116,6 +119,9 @@ cmd_init() {
116
119
  if [ "$_cli_windsurf" = "true" ]; then
117
120
  _init_plugins="${_init_plugins} windsurf:\n instructions: true\n prompts: true\n workflows: true\n"
118
121
  fi
122
+ if [ "$_cli_karpathy" = "true" ]; then
123
+ _init_plugins="${_init_plugins} karpathy-llm:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n"
124
+ fi
119
125
 
120
126
  cat > "$_target_yaml" <<YAML_EOF
121
127
  # Repo Nexus workspace configuration
@@ -87,7 +87,7 @@ cmd_plugin_info() {
87
87
  printf '\n%bConfigurable Options (in rnex.yaml or .local.rnex.yaml):%b\n' "$_BOLD" "$_NC"
88
88
  printf ' - wiki_dir: <dir> (directory for curated markdown pages; current: %s)\n' "$(karpathy_wiki_dir)"
89
89
  printf ' - raw_dir: <dir> (directory for unmodified intake documents; current: %s)\n' "$(karpathy_raw_dir)"
90
- printf ' - lint_trigger: git-post-merge|git-post-commit|git-pre-commit|git-pre-push|manual (current: %s)\n' "${_cur_lt:-git-post-merge}"
90
+ printf ' - lint_trigger: git-post-merge|git-post-commit|git-pre-commit|git-pre-push|manual (current: %s)\n' "${_cur_lt:-manual}"
91
91
  printf ' - notify_on_changes: true|false (show notification when raw/wiki changes are committed; current: %s)\n' "${_cur_nc:-true}"
92
92
  fi
93
93
 
package/lib/yaml.sh CHANGED
@@ -309,6 +309,22 @@ yaml_enable_plugin() {
309
309
  }
310
310
  ' "$_target_file" > "$_tmp" && mv "$_tmp" "$_target_file"
311
311
  ;;
312
+ karpathy-llm)
313
+ awk -v name="$_name" '
314
+ /^plugins:[ ]*$/ || /^plugins:[ ]*#/ {
315
+ print
316
+ printf " %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n", name
317
+ added=1
318
+ next
319
+ }
320
+ { print }
321
+ END {
322
+ if (!added) {
323
+ printf "plugins:\n %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n", name
324
+ }
325
+ }
326
+ ' "$_target_file" > "$_tmp" && mv "$_tmp" "$_target_file"
327
+ ;;
312
328
  *)
313
329
  awk -v name="$_name" '
314
330
  /^plugins:[ ]*$/ || /^plugins:[ ]*#/ {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-nexus",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Lightweight, zero-dependency Virtual Meta-Repo companion for multi-repo workspaces and shared AI context (no git submodules)",
5
5
  "bin": {
6
6
  "repo-nexus": "rnex",
@@ -68,4 +68,4 @@
68
68
  "devDependencies": {
69
69
  "vitepress": "^1.6.0"
70
70
  }
71
- }
71
+ }
@@ -113,9 +113,9 @@ plugins:
113
113
  # prompts: true # mirror prompts to .windsurf/prompts/*.md (default: true)
114
114
  # workflows: true # mirror workflows as prompts (default: true)
115
115
  # karpathy-llm:
116
- # wiki_dir: .rnex/wiki # Directory for curated atomic markdown pages (default: .rnex/wiki)
117
- # raw_dir: ./docs # Append-only directory for unmodified intake documents (default: ./docs)
118
- # lint_trigger: git-post-merge # Git hook event: git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual
116
+ # raw_dir: "./docs" # Append-only directory for unmodified intake documents (default: ./docs)
117
+ # wiki_dir: ".rnex/wiki" # Directory for curated atomic markdown pages (default: .rnex/wiki)
118
+ # lint_trigger: "manual" # Runs manually via 'rnex sync' or validation checklists (git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual)
119
119
  # notify_on_changes: true # Show notification when changes are committed to ./docs or .rnex/wiki
120
120
 
121
121
  # ------------------------------------------------------------------------------
@@ -1,8 +1,15 @@
1
1
  #!/bin/sh
2
2
  set -e
3
3
 
4
+ # Exit early if rnex utilities aren't available
5
+ [ -z "$RNEX_ROOT" ] && { echo "Error: RNEX_ROOT not set"; exit 1; }
6
+
4
7
  # Resolve root workspace
5
- _root="${RNEX_ROOT:-$PWD}"
8
+ _root="$RNEX_ROOT"
9
+
10
+ # Target directory inside .rnex/ (the internal wiki's Raw intake state)
11
+ WIKI_RAW_DIR="$RNEX_ROOT/.rnex/wiki/raw"
12
+ mkdir -p "$WIKI_RAW_DIR"
6
13
 
7
14
  # Helper to read plugin config
8
15
  get_cfg() {
@@ -74,3 +81,51 @@ mkdir -p "$_pdir/templates"
74
81
  if [ -f "$_tmpl_dir/rnex-wiki-page.sample.md" ] && [ ! -f "$_pdir/templates/rnex-wiki-page.template.md" ]; then
75
82
  cp "$_tmpl_dir/rnex-wiki-page.sample.md" "$_pdir/templates/rnex-wiki-page.template.md"
76
83
  fi
84
+
85
+ # 1. Parse 'raw_dir' configuration from rnex.yaml/.local.rnex.yaml (Defaults to './docs')
86
+ # We check if parsed in RNEX_CONFIG_MERGED (YAML) using a standard grep/sed lookup
87
+ RAW_DIR_VAL=$(grep -h -E '^\s*raw_dir:' "$RNEX_ROOT/rnex.yaml" "$RNEX_ROOT/.local.rnex.yaml" 2>/dev/null | tail -n1 | awk -F: '{print $NF}' | awk '{print $1}' | tr -d '"'\''')
88
+ [ -z "$RAW_DIR_VAL" ] && RAW_DIR_VAL="$(get_cfg "raw_dir" "./docs")"
89
+ RAW_DIR="${RAW_DIR_VAL:-./docs}"
90
+
91
+ # Clear and sync the custom local raw folder files to raw intake (if any exist)
92
+ if [ -d "$RNEX_ROOT/$RAW_DIR" ]; then
93
+ _raw_abs="$(cd "$RNEX_ROOT/$RAW_DIR" 2>/dev/null && pwd -P || true)"
94
+ _wiki_raw_abs="$(cd "$WIKI_RAW_DIR" 2>/dev/null && pwd -P || true)"
95
+ if [ -n "$_raw_abs" ] && [ "$_raw_abs" != "$_wiki_raw_abs" ]; then
96
+ find "$RNEX_ROOT/$RAW_DIR" -type f \( -name "*.md" -o -name "*.txt" -o -name "*.json" \) 2>/dev/null | while read -r filepath; do
97
+ filename=$(basename "$filepath")
98
+ # Prevent overwriting standard operational files
99
+ if [ "$filename" != "index.md" ] && [ "$filename" != "hot.md" ] && [ "$filename" != "_log.md" ]; then
100
+ cp "$filepath" "$WIKI_RAW_DIR/$filename"
101
+ fi
102
+ done
103
+ fi
104
+ fi
105
+
106
+ # 2. Automatically sync README.md from all enabled/cloned member repositories
107
+ # Get list of enabled repositories using a secure cross-repo read or `rnex list`
108
+ REPOS_DIR_VAL=$(grep -h -E '^\s*repos_dir:' "$RNEX_ROOT/rnex.yaml" "$RNEX_ROOT/.local.rnex.yaml" 2>/dev/null | tail -n1 | awk -F: '{print $NF}' | awk '{print $1}' | tr -d '"'\''')
109
+ REPOS_DIR="${REPOS_DIR_VAL:-./repos}"
110
+
111
+ if [ -d "$RNEX_ROOT/$REPOS_DIR" ]; then
112
+ for repo_path in "$RNEX_ROOT/$REPOS_DIR"/*; do
113
+ [ ! -d "$repo_path" ] && continue
114
+ repo_name=$(basename "$repo_path")
115
+
116
+ # Ignore repos that are disabled locally (checking status state)
117
+ # Checks if enabled: false exists for this repo in configuration
118
+ if grep -A5 " $repo_name:" "$RNEX_ROOT/rnex.yaml" "$RNEX_ROOT/.local.rnex.yaml" 2>/dev/null | grep -q "enabled: false"; then
119
+ continue
120
+ fi
121
+
122
+ # Read and sync any README file with case-insensitive check
123
+ for readme_name in README.md readme.md README.markdown README; do
124
+ if [ -f "$repo_path/$readme_name" ]; then
125
+ # Namespace the copied file with its repo name to prevent conflicts
126
+ cp "$repo_path/$readme_name" "$WIKI_RAW_DIR/README_${repo_name}.md"
127
+ break
128
+ fi
129
+ done
130
+ done
131
+ fi
@@ -40,7 +40,7 @@ _raw="$(get_cfg "raw_dir" "./docs")"
40
40
  _wiki="$(printf '%s' "$_wiki" | sed -e 's#^/##' -e 's#/$##')"
41
41
  _raw="$(printf '%s' "$_raw" | sed -e 's#^\./##' -e 's#^/##' -e 's#/$##')"
42
42
 
43
- _trigger="$(get_cfg "lint_trigger" "git-post-merge")"
43
+ _trigger="$(get_cfg "lint_trigger" "manual")"
44
44
  if [ "$_trigger" = "git-post-commit" ] || [ "$_trigger" = "post-commit" ]; then
45
45
  if git -C "$_root" diff-tree -r --name-only HEAD 2>/dev/null | grep -qE "(^|/)($_raw|$_wiki)/"; then
46
46
  _notify="$(get_cfg "notify_on_changes" "true")"
@@ -40,7 +40,7 @@ _raw="$(get_cfg "raw_dir" "./docs")"
40
40
  _wiki="$(printf '%s' "$_wiki" | sed -e 's#^/##' -e 's#/$##')"
41
41
  _raw="$(printf '%s' "$_raw" | sed -e 's#^\./##' -e 's#^/##' -e 's#/$##')"
42
42
 
43
- _trigger="$(get_cfg "lint_trigger" "git-post-merge")"
43
+ _trigger="$(get_cfg "lint_trigger" "manual")"
44
44
  if [ "$_trigger" = "git-post-merge" ] || [ "$_trigger" = "post-merge" ]; then
45
45
  if git -C "$_root" diff-tree -r --name-only ORIG_HEAD HEAD 2>/dev/null | grep -qE "(^|/)($_raw|$_wiki)/"; then
46
46
  _notify="$(get_cfg "notify_on_changes" "true")"
@@ -40,7 +40,7 @@ _raw="$(get_cfg "raw_dir" "./docs")"
40
40
  _wiki="$(printf '%s' "$_wiki" | sed -e 's#^/##' -e 's#/$##')"
41
41
  _raw="$(printf '%s' "$_raw" | sed -e 's#^\./##' -e 's#^/##' -e 's#/$##')"
42
42
 
43
- _trigger="$(get_cfg "lint_trigger" "git-post-merge")"
43
+ _trigger="$(get_cfg "lint_trigger" "manual")"
44
44
  if [ "$_trigger" = "git-pre-commit" ] || [ "$_trigger" = "pre-commit" ]; then
45
45
  if git -C "$_root" diff --cached --name-only 2>/dev/null | grep -qE "(^|/)($_raw|$_wiki)/"; then
46
46
  _notify="$(get_cfg "notify_on_changes" "true")"
@@ -40,7 +40,7 @@ _raw="$(get_cfg "raw_dir" "./docs")"
40
40
  _wiki="$(printf '%s' "$_wiki" | sed -e 's#^/##' -e 's#/$##')"
41
41
  _raw="$(printf '%s' "$_raw" | sed -e 's#^\./##' -e 's#^/##' -e 's#/$##')"
42
42
 
43
- _trigger="$(get_cfg "lint_trigger" "git-post-merge")"
43
+ _trigger="$(get_cfg "lint_trigger" "manual")"
44
44
  if [ "$_trigger" = "git-pre-push" ] || [ "$_trigger" = "pre-push" ]; then
45
45
  _notify="$(get_cfg "notify_on_changes" "true")"
46
46
  if [ "$_notify" != "false" ]; then
@@ -1,17 +1,28 @@
1
1
  name: karpathy-llm
2
- version: 0.5.1
3
- description: Andrej Karpathy's agent behavioral principles, context engineering guidelines, and autonomous LLM Wiki knowledge architecture
2
+ version: 1.0.0
3
+ description: Andréj Karpathy's verification frameworks & wiki patterns for AI coding agents.
4
4
  author: unoxen
5
5
  homepage: https://github.com/unoxen/repo-nexus
6
+
7
+ config_defaults:
8
+ raw_dir: "./docs"
9
+ wiki_dir: ".rnex/wiki"
10
+ lint_trigger: "manual" # Default changed to manual to avoid unsolicited background trigger tasks
11
+ notify_on_changes: true
12
+
6
13
  config:
7
- wiki_dir: .rnex/wiki
8
- raw_dir: ./docs
9
- lint_trigger: git-post-merge
14
+ raw_dir: "./docs"
15
+ wiki_dir: ".rnex/wiki"
16
+ lint_trigger: "manual"
10
17
  notify_on_changes: true
18
+
11
19
  rules:
12
20
  - rules/rnex-behavioral.md: .rnex/plugins/karpathy-llm/rules/rnex-behavioral.md
21
+ - rules/behavioral.md: .rnex/plugins/karpathy-llm/rules/behavioral.md
13
22
  - workflows/rnex-wiki-ingest.md: .rnex/plugins/karpathy-llm/workflows/rnex-wiki-ingest.md
23
+ - workflows/wiki-ingest.md: .rnex/plugins/karpathy-llm/workflows/wiki-ingest.md
14
24
  - workflows/rnex-wiki-lint.md: .rnex/plugins/karpathy-llm/workflows/rnex-wiki-lint.md
25
+ - workflows/wiki-lint.md: .rnex/plugins/karpathy-llm/workflows/wiki-lint.md
15
26
  instructions:
16
27
  - instructions/rnex-wiki-architecture.md: .rnex/plugins/karpathy-llm/instructions/rnex-wiki-architecture.md
17
28
  templates:
@@ -0,0 +1,47 @@
1
+ # Karpathy Coding Agent Behavioral Principles
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
4
+
5
+ These rules define standing behavioral principles for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf) working in this workspace.
6
+
7
+ ---
8
+
9
+ ## 1. The Four Cardinal Principles
10
+
11
+ ### Principle 1: Think Before Coding
12
+ * **State Assumptions Explicitly:** Before implementing any non-trivial change, state your understanding of the problem, assumptions made, and proposed solution.
13
+ * **Surface Trade-Offs:** If multiple approaches exist, outline the alternatives with their trade-offs before generating code.
14
+ * **Verify Repository Boundaries:** In multi-repo workspaces, determine which member repositories are affected. Never make silent architectural assumptions that span across repo boundaries.
15
+
16
+ ### Principle 2: Simplicity First
17
+ * **Favor Readable Over Clever:** Write the simplest code that solves the immediate problem. Avoid unnecessary abstractions, speculative generics, and premature optimizations.
18
+ * **Zero Boilerplate Bloat:** Do not introduce extra wrapper layers, helper classes, or framework-heavy patterns unless explicitly requested or required by existing codebase conventions.
19
+ * **Less Code is Better Code:** If an existing utility, POSIX primitive, or library function does the job, reuse it.
20
+
21
+ ### Principle 3: Surgical Changes
22
+ * **Minimal Blast Radius:** Touch *only* the lines and files required to achieve the goal.
23
+ * **Preserve Documentation & Comments:** Never delete or overwrite existing comments, documentation, or code structure unrelated to your changes.
24
+ * **Zero Unintended Reformatting:** Avoid running blanket code formatters across entire files that create massive, unreadable git diffs. Keep diffs tight, focused, and reviewable.
25
+
26
+ ### Principle 4: Goal-Driven Execution & Verification
27
+ * **Define Success Criteria Upfront:** Know how you will prove that your change works before you write the first line of code.
28
+ * **Verify with Automated Checks:** Run linters, unit tests, and build commands before declaring a task complete.
29
+ * **Inspect the Diff:** Review your own git diff before committing or presenting the solution to ensure no extraneous changes were introduced.
30
+
31
+ ---
32
+
33
+ ## 2. Multi-Repo Context Engineering
34
+
35
+ In a Repo Nexus workspace, independent repositories are organized into `./repos/<name>/` as autonomous Git repositories. Coding agents must follow these rules:
36
+
37
+ 1. **Repository Boundaries:**
38
+ - Edits made to `repos/<name>/` modify the underlying member repository directly.
39
+ - Member repositories are autonomous projects. Do not introduce cross-repository source imports or shared runtime dependencies unless an explicit monorepo architecture is configured.
40
+
41
+ 2. **Member .rnex Directory Routing:**
42
+ - Member repositories may contain an `.rnex/` directory (e.g. `repos/<name>/.rnex/`) containing repository-specific documents, instructions, rules, workflows, and scripts. Coding assistants must inspect this directory for member-specific instructions.
43
+ - Run git operations (commits, branches, pushes) directly within the respective member repository root (`repos/<name>/`).
44
+
45
+ 3. **Context Economy:**
46
+ - Do not redundantly read entire files or directory trees when targeted symbol lookups or line ranges suffice.
47
+ - Rely on active workspace context, indexing, and compiled documentation rather than re-scanning raw files repeatedly.
@@ -0,0 +1,66 @@
1
+ # Wiki Ingestion Workflow (`wiki-ingest`)
2
+
3
+ Universal workflow for decomposing and ingesting raw source materials into atomic Karpathy LLM Wiki pages.
4
+
5
+ ---
6
+
7
+ ## Ingestion Protocol
8
+
9
+ 1. **Resolve Configuration & Scan Intake:**
10
+ - Read `rnex.yaml` (and `.local.rnex.yaml` if present) to resolve the active `raw_dir` (default: `./docs`) and `wiki_dir` (default: `.rnex/wiki`) under `plugins.karpathy-llm`.
11
+ - Scan `<raw_dir>/` (default: `./docs`) for source materials (articles, transcripts, documents, research notes, meeting logs) not yet recorded in `<wiki_dir>/_log.md` (default: `.rnex/wiki/_log.md`).
12
+ - All source material must reside in `<raw_dir>/` unmodified. Never write directly to `<wiki_dir>/` without ingesting.
13
+
14
+ 2. **Read & Clarify:**
15
+ - Read each source fully.
16
+ - If scope, domain boundaries, target audience, or level of detail is unclear, ask one round of clarifying questions before proceeding.
17
+
18
+ 3. **Atomic Decomposition:**
19
+ - Decompose each source into atomic wiki pages — **one per distinct concept, person, organization, event, or theme** (or architecture decision/contract).
20
+ - A single source document commonly produces **5–25 pages**. Never collapse an entire source into a single file.
21
+ - Place pages according to workspace wiki organization:
22
+ - **Flat:** directly under `<wiki_dir>/` (e.g., `<wiki_dir>/<topic>.md`)
23
+ - **Structured:** in categorical subfolders within `<wiki_dir>/`:
24
+ - Research → `concepts/`, `people/`, `organizations/`, `sources/`, `analysis/`
25
+ - Second brain → `projects/`, `people/`, `decisions/`, `logs/`
26
+ - Content archive → `sources/`, `people/`, `tools/`, `concepts/`
27
+ - Codebase → `architecture/`, `decisions/`, `runbooks/`, `people/`
28
+
29
+ 4. **Frontmatter Relations:**
30
+ - For each page, write the required YAML frontmatter with typed relations:
31
+ ```yaml
32
+ ---
33
+ title: ""
34
+ tags: []
35
+ last_updated: YYYY-MM-DD
36
+ # Typed relation fields — paths relative to <wiki_dir>/ (or workspace root for raw sources)
37
+ sources: [] # <raw_dir>/ files this page was derived from
38
+ related: [] # thematically related wiki pages
39
+ extends: [] # pages this one builds upon or specialises
40
+ contradicts: [] # pages with conflicting information
41
+ mentioned_in: [] # pages that link to this one (leave empty; maintained by lint)
42
+ ---
43
+ ```
44
+ - **Crucial:** The relation graph lives in frontmatter, not in prose links. Agents traverse the graph by reading frontmatter fields, not by scanning body text.
45
+
46
+ 5. **Author Concise Body:**
47
+ - Write a concise body with summary, key facts, and insights.
48
+ - Add inline standard Markdown links (`[Label](./path.md)`) where contextually useful in prose.
49
+
50
+ 6. **Update Navigation Index (Annotated Links):**
51
+ - Update `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`) with links to all new pages in their corresponding categorized sections.
52
+ - Include a concise 1-line summary next to each link (e.g. `- [Concept Name](path.md): One-line summary of role or contract`) so agents pinpoint target pages in a single read without exploratory scanning.
53
+
54
+ 7. **Update Hot Cache (Bounded ~500-Word Ceiling):**
55
+ - Update `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`) with the rolling orientation summary across 3 structured sections:
56
+ 1. **Architecture & Member Repo Map**: Active domain ownership per member repo.
57
+ 2. **Current Focus & Recent Ingests**: Active topics from recent ingests.
58
+ 3. **Key Contracts & Boundaries**: Critical cross-repo or subsystem rules.
59
+ - **Enforce Token Economy**: Keep `<wiki_dir>/hot.md` strictly under ~500 words. Condense or prune older focus items to prevent bloat.
60
+
61
+ 8. **Append Operation Log:**
62
+ - Append a timestamped entry to `<wiki_dir>/_log.md` (default: `.rnex/wiki/_log.md`) detailing:
63
+ - Date & time
64
+ - Raw intake file processed
65
+ - List of atomic pages generated
66
+ - Any flagged follow-ups or knowledge gaps
@@ -0,0 +1,50 @@
1
+ # Wiki Lint & Maintenance Workflow (`wiki-lint`)
2
+
3
+ Periodic health check and maintenance workflow to preserve wiki graph integrity, validate typed relations, recompute bidirectional links, resolve knowledge gaps, and rebuild indexes.
4
+
5
+ ---
6
+
7
+ ## Lint & Maintenance Protocol
8
+
9
+ 1. **Resolve Configuration & Verify Paths:**
10
+ - Read `rnex.yaml` (and `.local.rnex.yaml` if present) to resolve the active `wiki_dir` (default: `.rnex/wiki`) and `raw_dir` (default: `./docs`) under `plugins.karpathy-llm`.
11
+ - For every page under `<wiki_dir>/`, verify that all paths in frontmatter relation fields (`related`, `extends`, `contradicts`, `sources`) resolve to existing files under `<wiki_dir>/` or `<raw_dir>/`.
12
+ - Fix or flag broken paths.
13
+
14
+ 2. **Recompute `mentioned_in`:**
15
+ - Recompute `mentioned_in` for every page under `<wiki_dir>/` by scanning all other pages' relation fields and inline links.
16
+ - Update the field in frontmatter.
17
+
18
+ 3. **Find Orphaned Pages:**
19
+ - Detect pages under `<wiki_dir>/` not reachable from `<wiki_dir>/index.md` or any `mentioned_in` field.
20
+ - Add them to the index in their appropriate category.
21
+
22
+ 4. **Detect Duplicate or Overlapping Pages:**
23
+ - Detect duplicate or heavily overlapping pages.
24
+ - Consolidate and update relations across the wiki graph.
25
+
26
+ 5. **Check Factual Inconsistencies:**
27
+ - Check for factual inconsistencies between pages in `contradicts` relations or covering the same topic.
28
+ - Clarify or resolve contradictions.
29
+
30
+ 6. **Identify Knowledge Gaps:**
31
+ - Identify knowledge gaps: concepts referenced in relation fields or prose but lacking their own atomic page.
32
+ - Create stub pages or flag for future ingest.
33
+
34
+ 7. **Suggest Source Candidates:**
35
+ - Suggest source candidates from `<raw_dir>/` or external searches to fill identified knowledge gaps.
36
+
37
+ 8. **Rebuild Navigation Index (Annotated Links):**
38
+ - Rebuild `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`) to reflect the current set of pages and categories accurately.
39
+ - Ensure every page entry maintains a concise 1-line descriptive annotation.
40
+
41
+ 9. **Update Hot Cache (Bounded ~500-Word Ceiling):**
42
+ - Refresh `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`), verifying the 3 structured sections (Architecture & Repo Map, Current Focus, Key Contracts).
43
+ - Ensure the total length remains strictly under ~500 words by pruning superseded entries.
44
+
45
+ 10. **Append Operation Log:**
46
+ - Append a lint summary to `<wiki_dir>/_log.md` (default: `.rnex/wiki/_log.md`) detailing:
47
+ - Broken links fixed or flagged
48
+ - `mentioned_in` updates
49
+ - Orphans and duplicates resolved
50
+ - Gaps identified or stubbed
@@ -13,10 +13,10 @@ When an AI assistant is assigned a cross-repo or workspace-wide task, consult th
13
13
  - **Purpose**: Cross-repository health, git status, branch tracking, and configuration validation.
14
14
  - **When to use**: Auditing workspace status, verifying uncommitted changes, or syncing member repositories before releases.
15
15
 
16
- 3. **[`rnex-wiki-ingest.md`](./rnex-wiki-ingest.md)**
16
+ 3. **[`rnex-ingest.md`](./rnex-ingest.md)** (alias: [`rnex-wiki-ingest.md`](./rnex-wiki-ingest.md))
17
17
  - **Purpose**: Autonomous ingestion of intake materials from configured raw intake directory into atomic Karpathy LLM Wiki pages.
18
18
  - **When to use**: Decomposing research papers, documentation, transcripts, or specifications into the knowledge base.
19
19
 
20
- 4. **[`rnex-wiki-lint.md`](./rnex-wiki-lint.md)**
20
+ 4. **[`rnex-lint.md`](./rnex-lint.md)** (alias: [`rnex-wiki-lint.md`](./rnex-wiki-lint.md))
21
21
  - **Purpose**: Deterministic graph audit, dead link validation, `mentioned_in` backlink reconciliation, and index rebuild.
22
22
  - **When to use**: Routine wiki maintenance, pre-commit validation, or after adding/renaming wiki pages.
@@ -0,0 +1,14 @@
1
+ # Operational Task: Ingest New Material
2
+
3
+ You are tasked with executing the ingestion and atomic break-down workflow.
4
+
5
+ ## Context & Inputs
6
+ - Source files location: `.rnex/wiki/raw/` (inclusive of active member repo `README_*.md` files)
7
+ - Goal: Deconstruct files into individual interlinked pages in `.rnex/wiki/`.
8
+
9
+ ## Workflow & Guidelines Router
10
+ 1. Read the strict ingest steps and verification metrics only from `.rnex/plugins/karpathy-llm/workflows/wiki-ingest.md`.
11
+ 2. Follow styling, structural, and behavioral constraints inside `.rnex/plugins/karpathy-llm/rules/behavioral.md`.
12
+ 3. Adhere to global instruction patterns in `.rnex/ai-instructions.md`.
13
+
14
+ Transform unmodified raw documents on ingestion following exactly the referenced workflow. Do not use inline logic or generate outside explicit instructions. Run 'wiki-lint' upon completion to review accuracy. Update Operation Log (`.rnex/wiki/_log.md`).
@@ -0,0 +1,15 @@
1
+ # Operational Task: Workspace Wiki Lint & Audit
2
+
3
+ You are tasked with executing the Workspace Wiki Lint workflow.
4
+
5
+ ## Context & Inputs
6
+ - Target Scope: `.rnex/wiki/` (including `.rnex/wiki/raw/` and synchronized member READMEs)
7
+ - Custom Rules & Workflows loaded: `.rnex/plugins/karpathy-llm/`
8
+ - Current Workspace Manifest: `rnex.yaml` and `.local.rnex.yaml`
9
+
10
+ ## Verification Rule Router
11
+ 1. Locate and parse your validation instructions exclusively from `.rnex/plugins/karpathy-llm/workflows/wiki-lint.md`.
12
+ 2. Evaluate adherence based on the agent behavior standards described in `.rnex/plugins/karpathy-llm/rules/behavioral.md` and compiled rules in `.rnex/ai-instructions.md`.
13
+ 3. Do NOT invent new lint checks or execute uncompiled heuristic instructions.
14
+
15
+ Execute the 10-step protocol defined strictly within the referenced workflow. Audit `raw_dir` items, link paths, index categorization, and relational YAML frontmatter. Provide your structured audit and write feedback output to the Audit trail in `.rnex/wiki/_log.md`.
@@ -0,0 +1,14 @@
1
+ # Operational Task: Ingest New Material
2
+
3
+ You are tasked with executing the ingestion and atomic break-down workflow.
4
+
5
+ ## Context & Inputs
6
+ - Source files location: `.rnex/wiki/raw/` (inclusive of active member repo `README_*.md` files)
7
+ - Goal: Deconstruct files into individual interlinked pages in `.rnex/wiki/`.
8
+
9
+ ## Workflow & Guidelines Router
10
+ 1. Read the strict ingest steps and verification metrics only from `.rnex/plugins/karpathy-llm/workflows/wiki-ingest.md`.
11
+ 2. Follow styling, structural, and behavioral constraints inside `.rnex/plugins/karpathy-llm/rules/behavioral.md`.
12
+ 3. Adhere to global instruction patterns in `.rnex/ai-instructions.md`.
13
+
14
+ Transform unmodified raw documents on ingestion following exactly the referenced workflow. Do not use inline logic or generate outside explicit instructions. Run 'wiki-lint' upon completion to review accuracy. Update Operation Log (`.rnex/wiki/_log.md`).
@@ -0,0 +1,15 @@
1
+ # Operational Task: Workspace Wiki Lint & Audit
2
+
3
+ You are tasked with executing the Workspace Wiki Lint workflow.
4
+
5
+ ## Context & Inputs
6
+ - Target Scope: `.rnex/wiki/` (including `.rnex/wiki/raw/` and synchronized member READMEs)
7
+ - Custom Rules & Workflows loaded: `.rnex/plugins/karpathy-llm/`
8
+ - Current Workspace Manifest: `rnex.yaml` and `.local.rnex.yaml`
9
+
10
+ ## Verification Rule Router
11
+ 1. Locate and parse your validation instructions exclusively from `.rnex/plugins/karpathy-llm/workflows/wiki-lint.md`.
12
+ 2. Evaluate adherence based on the agent behavior standards described in `.rnex/plugins/karpathy-llm/rules/behavioral.md` and compiled rules in `.rnex/ai-instructions.md`.
13
+ 3. Do NOT invent new lint checks or execute uncompiled heuristic instructions.
14
+
15
+ Execute the 10-step protocol defined strictly within the referenced workflow. Audit `raw_dir` items, link paths, index categorization, and relational YAML frontmatter. Provide your structured audit and write feedback output to the Audit trail in `.rnex/wiki/_log.md`.