repo-nexus 0.7.8 → 0.7.11
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/plugins/claude.md +3 -3
- package/docs/plugins/cursor.md +2 -2
- package/docs/plugins/gemini.md +3 -3
- package/docs/plugins/karpathy-llm.md +1 -1
- package/docs/plugins/windsurf.md +3 -3
- package/docs/rnex.example.yaml +2 -0
- package/lib/ai.sh +85 -26
- package/lib/commands/init.sh +1 -1
- package/lib/commands/plugin.sh +2 -0
- package/lib/hooks.sh +74 -24
- package/lib/yaml.sh +2 -2
- package/package.json +1 -1
- package/templates/rnex.example.yaml +2 -0
- package/toolkit/plugins/copilot/README.md +1 -1
- package/toolkit/plugins/copilot/instructions/rnex-copilot-integration.md +1 -1
- package/toolkit/plugins/karpathy-llm/README.md +12 -12
- package/toolkit/plugins/karpathy-llm/hooks/after_sync.sh +54 -29
- package/toolkit/plugins/karpathy-llm/hooks/before_plugin_disable.sh +8 -0
- package/toolkit/plugins/karpathy-llm/hooks/git_pre-push.sh +5 -1
- package/toolkit/plugins/karpathy-llm/instructions/rnex-scaffolding-meta-prompt.md +1 -1
- package/toolkit/plugins/karpathy-llm/instructions/rnex-wiki-architecture.md +19 -3
- package/toolkit/plugins/karpathy-llm/instructions.md +18 -2
- package/toolkit/plugins/karpathy-llm/plugin.yaml +2 -0
- package/toolkit/plugins/karpathy-llm/rules/behavioral.md +4 -0
- package/toolkit/plugins/karpathy-llm/skills/wiki-ingest.md +10 -6
- package/toolkit/plugins/karpathy-llm/skills/wiki-lint.md +5 -1
- package/toolkit/plugins/karpathy-llm/templates/hot.md +2 -2
- package/toolkit/plugins/karpathy-llm/templates/index.md +1 -1
- package/toolkit/plugins/karpathy-llm/templates/rnex-llm-wiki.sample.md +1 -1
- package/toolkit/plugins/karpathy-llm/templates/rnex-wiki-page.sample.md +3 -3
package/docs/plugins/claude.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Integrate Anthropic Claude Code with Repo Nexus, generating zero-lo
|
|
|
7
7
|
|
|
8
8
|
The **`claude`** plugin integrates Anthropic Claude Code CLI (`claude`) and Claude Desktop 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 `claude` plugin generates zero-logic User Skill pointers into `.claude/skills/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-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 `claude` plugin generates zero-logic User Skill pointers into `.claude/skills/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-karpathy-llm-wiki-ingest`).
|
|
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
|
|
|
@@ -84,8 +84,8 @@ my-workspace/
|
|
|
84
84
|
│ ├── rnex-clone-sync.md
|
|
85
85
|
│ ├── rnex-batch-exec.md
|
|
86
86
|
│ ├── rnex-workspace-status.md
|
|
87
|
-
│ ├── rnex-wiki-ingest
|
|
88
|
-
│ └── rnex-wiki-lint
|
|
87
|
+
│ ├── rnex-karpathy-llm-wiki-ingest/
|
|
88
|
+
│ └── rnex-karpathy-llm-wiki-lint/
|
|
89
89
|
├── .rnex/
|
|
90
90
|
│ ├── skills/ # Core workspace agentic skills
|
|
91
91
|
│ └── plugins/
|
package/docs/plugins/cursor.md
CHANGED
|
@@ -83,8 +83,8 @@ my-workspace/
|
|
|
83
83
|
│ ├── rnex-clone-sync.md
|
|
84
84
|
│ ├── rnex-batch-exec.md
|
|
85
85
|
│ ├── rnex-workspace-status.md
|
|
86
|
-
│ ├── rnex-wiki-ingest.md
|
|
87
|
-
│ └── rnex-wiki-lint.md
|
|
86
|
+
│ ├── rnex-karpathy-llm-wiki-ingest.md
|
|
87
|
+
│ └── rnex-karpathy-llm-wiki-lint.md
|
|
88
88
|
├── .rnex/
|
|
89
89
|
│ ├── skills/ # Core workspace agentic skills
|
|
90
90
|
│ └── plugins/
|
package/docs/plugins/gemini.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Integrate Google Gemini and Antigravity IDE with Repo Nexus, genera
|
|
|
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-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 `.gemini/skills/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-karpathy-llm-wiki-ingest`).
|
|
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
|
|
|
@@ -83,8 +83,8 @@ my-workspace/
|
|
|
83
83
|
│ ├── rnex-clone-sync.md
|
|
84
84
|
│ ├── rnex-batch-exec.md
|
|
85
85
|
│ ├── rnex-workspace-status.md
|
|
86
|
-
│ ├── rnex-wiki-ingest
|
|
87
|
-
│ └── rnex-wiki-lint
|
|
86
|
+
│ ├── rnex-karpathy-llm-wiki-ingest/
|
|
87
|
+
│ └── rnex-karpathy-llm-wiki-lint/
|
|
88
88
|
├── .rnex/
|
|
89
89
|
│ ├── skills/ # Core workspace agentic skills
|
|
90
90
|
│ └── plugins/
|
|
@@ -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-wiki-ingest
|
|
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/`).
|
|
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
|
|
package/docs/plugins/windsurf.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Integrate Windsurf IDE and Cascade with Repo Nexus, generating zero
|
|
|
7
7
|
|
|
8
8
|
The **`windsurf`** plugin integrates Codeium's Windsurf IDE and Cascade 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 `windsurf` plugin generates zero-logic User Skill pointers into `.windsurf/rules/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-wiki-ingest.md`).
|
|
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 `windsurf` plugin generates zero-logic User Skill pointers into `.windsurf/rules/` (e.g. `rnex-clone-sync.md`, `rnex-batch-exec.md`, `rnex-karpathy-llm-wiki-ingest.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
|
|
|
@@ -83,8 +83,8 @@ my-workspace/
|
|
|
83
83
|
│ ├── rnex-clone-sync.md
|
|
84
84
|
│ ├── rnex-batch-exec.md
|
|
85
85
|
│ ├── rnex-workspace-status.md
|
|
86
|
-
│ ├── rnex-wiki-ingest.md
|
|
87
|
-
│ └── rnex-wiki-lint.md
|
|
86
|
+
│ ├── rnex-karpathy-llm-wiki-ingest.md
|
|
87
|
+
│ └── rnex-karpathy-llm-wiki-lint.md
|
|
88
88
|
├── .rnex/
|
|
89
89
|
│ ├── skills/ # Core workspace agentic skills
|
|
90
90
|
│ └── plugins/
|
package/docs/rnex.example.yaml
CHANGED
|
@@ -107,6 +107,8 @@ plugins:
|
|
|
107
107
|
# wiki_dir: ".rnex/wiki" # Directory for curated atomic markdown pages (default: .rnex/wiki)
|
|
108
108
|
# lint_trigger: "manual" # Runs manually via 'rnex sync' or validation checklists (git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual)
|
|
109
109
|
# notify_on_changes: true # Show notification when changes are committed to ./docs or .rnex/wiki
|
|
110
|
+
# ingest_member_readmes: true # Automatically ingest member repository READMEs into atomic wiki pages (default: true)
|
|
111
|
+
|
|
110
112
|
|
|
111
113
|
# ------------------------------------------------------------------------------
|
|
112
114
|
# repos — Member repositories managed by Repo Nexus
|
package/lib/ai.sh
CHANGED
|
@@ -367,9 +367,16 @@ if [ -z "$RNEX_PROVIDER_SKILL_DIRS" ]; then
|
|
|
367
367
|
export RNEX_PROVIDER_SKILL_DIRS="$_dirs"
|
|
368
368
|
fi
|
|
369
369
|
|
|
370
|
-
|
|
370
|
+
rnex_generate_user_skill() {
|
|
371
371
|
skill_name="$1"
|
|
372
372
|
target_path="$2"
|
|
373
|
+
plugin_name="${3:-}"
|
|
374
|
+
|
|
375
|
+
if [ -n "$plugin_name" ]; then
|
|
376
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
377
|
+
else
|
|
378
|
+
full_name="rnex-${skill_name}"
|
|
379
|
+
fi
|
|
373
380
|
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-}"
|
|
374
381
|
_r="${RNEX_ROOT:-.}"
|
|
375
382
|
|
|
@@ -385,7 +392,7 @@ rnex_register_user_skill() {
|
|
|
385
392
|
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
386
393
|
fi
|
|
387
394
|
if [ -z "$_skill_desc" ]; then
|
|
388
|
-
_skill_desc="Repo Nexus agentic skill protocol for ${
|
|
395
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${full_name}."
|
|
389
396
|
fi
|
|
390
397
|
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
391
398
|
|
|
@@ -393,24 +400,24 @@ rnex_register_user_skill() {
|
|
|
393
400
|
case "$provider_dir" in
|
|
394
401
|
*rules*)
|
|
395
402
|
mkdir -p "$_r/$provider_dir"
|
|
396
|
-
rm -rf "$_r/$provider_dir
|
|
397
|
-
cat << EOF > "$_r/$provider_dir
|
|
398
|
-
# User Skill:
|
|
403
|
+
rm -rf "${_r:?}/${provider_dir:?}/${full_name:?}" 2>/dev/null || true
|
|
404
|
+
cat << EOF > "$_r/$provider_dir/${full_name}.md"
|
|
405
|
+
# User Skill: ${full_name}
|
|
399
406
|
|
|
400
407
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
401
408
|
\`${target_path}\`
|
|
402
409
|
EOF
|
|
403
410
|
;;
|
|
404
411
|
*)
|
|
405
|
-
mkdir -p "$_r/$provider_dir
|
|
406
|
-
rm -f "$_r/$provider_dir
|
|
407
|
-
cat << EOF > "$_r/$provider_dir
|
|
412
|
+
mkdir -p "$_r/$provider_dir/${full_name}"
|
|
413
|
+
rm -f "$_r/$provider_dir/${full_name}.md" 2>/dev/null || true
|
|
414
|
+
cat << EOF > "$_r/$provider_dir/${full_name}/SKILL.md"
|
|
408
415
|
---
|
|
409
|
-
name:
|
|
416
|
+
name: ${full_name}
|
|
410
417
|
description: "${_skill_desc}"
|
|
411
418
|
---
|
|
412
419
|
|
|
413
|
-
# User Skill:
|
|
420
|
+
# User Skill: ${full_name}
|
|
414
421
|
|
|
415
422
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
416
423
|
\`${target_path}\`
|
|
@@ -420,13 +427,30 @@ EOF
|
|
|
420
427
|
done
|
|
421
428
|
}
|
|
422
429
|
|
|
430
|
+
rnex_register_user_skill() {
|
|
431
|
+
rnex_generate_user_skill "$@"
|
|
432
|
+
}
|
|
433
|
+
|
|
423
434
|
rnex_unregister_user_skill() {
|
|
424
435
|
skill_name="$1"
|
|
436
|
+
plugin_name="${2:-}"
|
|
437
|
+
if [ -n "$plugin_name" ]; then
|
|
438
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
439
|
+
else
|
|
440
|
+
case "$skill_name" in
|
|
441
|
+
rnex-*) full_name="$skill_name" ;;
|
|
442
|
+
*) full_name="rnex-${skill_name}" ;;
|
|
443
|
+
esac
|
|
444
|
+
fi
|
|
425
445
|
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-}"
|
|
426
446
|
_r="${RNEX_ROOT:-.}"
|
|
427
447
|
for provider_dir in $_dirs; do
|
|
428
|
-
rm -f "$_r/$provider_dir
|
|
429
|
-
rm -rf "$_r/$provider_dir
|
|
448
|
+
rm -f "$_r/$provider_dir/${full_name}.md"
|
|
449
|
+
rm -rf "${_r:?}/${provider_dir:?}/${full_name:?}"
|
|
450
|
+
if [ -n "$plugin_name" ]; then
|
|
451
|
+
rm -f "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
452
|
+
rm -rf "${_r:?}/${provider_dir:?}/rnex-${skill_name:?}"
|
|
453
|
+
fi
|
|
430
454
|
done
|
|
431
455
|
}
|
|
432
456
|
ENV_EOF
|
|
@@ -453,10 +477,18 @@ get_active_provider_skill_dirs() {
|
|
|
453
477
|
printf '%s' "$_dirs"
|
|
454
478
|
}
|
|
455
479
|
|
|
456
|
-
# Usage:
|
|
457
|
-
|
|
480
|
+
# Usage: rnex_generate_user_skill <skill_name> <target_path_in_rnex> [plugin_name]
|
|
481
|
+
rnex_generate_user_skill() {
|
|
458
482
|
skill_name="$1"
|
|
459
483
|
target_path="$2"
|
|
484
|
+
plugin_name="${3:-}"
|
|
485
|
+
|
|
486
|
+
if [ -n "$plugin_name" ]; then
|
|
487
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
488
|
+
else
|
|
489
|
+
full_name="rnex-${skill_name}"
|
|
490
|
+
fi
|
|
491
|
+
|
|
460
492
|
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-$(get_active_provider_skill_dirs)}"
|
|
461
493
|
_r="${NEXUS_DIR:-${RNEX_ROOT:-.}}"
|
|
462
494
|
|
|
@@ -472,7 +504,7 @@ rnex_register_user_skill() {
|
|
|
472
504
|
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
473
505
|
fi
|
|
474
506
|
if [ -z "$_skill_desc" ]; then
|
|
475
|
-
_skill_desc="Repo Nexus agentic skill protocol for ${
|
|
507
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${full_name}."
|
|
476
508
|
fi
|
|
477
509
|
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
478
510
|
|
|
@@ -480,24 +512,24 @@ rnex_register_user_skill() {
|
|
|
480
512
|
case "$provider_dir" in
|
|
481
513
|
*rules*)
|
|
482
514
|
mkdir -p "$_r/$provider_dir"
|
|
483
|
-
rm -rf "$_r/$provider_dir
|
|
484
|
-
cat << EOF > "$_r/$provider_dir
|
|
485
|
-
# User Skill:
|
|
515
|
+
rm -rf "${_r:?}/${provider_dir:?}/${full_name:?}" 2>/dev/null || true
|
|
516
|
+
cat << EOF > "$_r/$provider_dir/${full_name}.md"
|
|
517
|
+
# User Skill: ${full_name}
|
|
486
518
|
|
|
487
519
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
488
520
|
\`${target_path}\`
|
|
489
521
|
EOF
|
|
490
522
|
;;
|
|
491
523
|
*)
|
|
492
|
-
mkdir -p "$_r/$provider_dir
|
|
493
|
-
rm -f "$_r/$provider_dir
|
|
494
|
-
cat << EOF > "$_r/$provider_dir
|
|
524
|
+
mkdir -p "$_r/$provider_dir/${full_name}"
|
|
525
|
+
rm -f "$_r/$provider_dir/${full_name}.md" 2>/dev/null || true
|
|
526
|
+
cat << EOF > "$_r/$provider_dir/${full_name}/SKILL.md"
|
|
495
527
|
---
|
|
496
|
-
name:
|
|
528
|
+
name: ${full_name}
|
|
497
529
|
description: "${_skill_desc}"
|
|
498
530
|
---
|
|
499
531
|
|
|
500
|
-
# User Skill:
|
|
532
|
+
# User Skill: ${full_name}
|
|
501
533
|
|
|
502
534
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
503
535
|
\`${target_path}\`
|
|
@@ -507,14 +539,33 @@ EOF
|
|
|
507
539
|
done
|
|
508
540
|
}
|
|
509
541
|
|
|
510
|
-
# Usage:
|
|
542
|
+
# Usage: rnex_register_user_skill <skill_name> <target_path_in_rnex> [plugin_name]
|
|
543
|
+
rnex_register_user_skill() {
|
|
544
|
+
rnex_generate_user_skill "$@"
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
# Usage: rnex_unregister_user_skill <skill_name> [plugin_name]
|
|
511
548
|
rnex_unregister_user_skill() {
|
|
512
549
|
skill_name="$1"
|
|
550
|
+
plugin_name="${2:-}"
|
|
551
|
+
if [ -n "$plugin_name" ]; then
|
|
552
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
553
|
+
else
|
|
554
|
+
case "$skill_name" in
|
|
555
|
+
rnex-*) full_name="$skill_name" ;;
|
|
556
|
+
*) full_name="rnex-${skill_name}" ;;
|
|
557
|
+
esac
|
|
558
|
+
fi
|
|
559
|
+
|
|
513
560
|
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-$(get_active_provider_skill_dirs)}"
|
|
514
561
|
_r="${NEXUS_DIR:-${RNEX_ROOT:-.}}"
|
|
515
562
|
for provider_dir in $_dirs; do
|
|
516
|
-
rm -f "$_r/$provider_dir
|
|
517
|
-
rm -rf "$_r/$provider_dir
|
|
563
|
+
rm -f "$_r/$provider_dir/${full_name}.md"
|
|
564
|
+
rm -rf "${_r:?}/${provider_dir:?}/${full_name:?}"
|
|
565
|
+
if [ -n "$plugin_name" ]; then
|
|
566
|
+
rm -f "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
567
|
+
rm -rf "${_r:?}/${provider_dir:?}/rnex-${skill_name:?}"
|
|
568
|
+
fi
|
|
518
569
|
done
|
|
519
570
|
}
|
|
520
571
|
|
|
@@ -536,10 +587,12 @@ clean_provider_skills() {
|
|
|
536
587
|
clean_plugin_user_skills() {
|
|
537
588
|
_pdir="$1"
|
|
538
589
|
[ -d "$_pdir" ] || return 0
|
|
590
|
+
_pname="$(basename "$_pdir")"
|
|
539
591
|
if [ -d "$_pdir/skills" ]; then
|
|
540
592
|
for _sk_file in "$_pdir/skills"/*.md; do
|
|
541
593
|
[ -f "$_sk_file" ] || continue
|
|
542
594
|
_sk_name="$(basename "$_sk_file" .md)"
|
|
595
|
+
rnex_unregister_user_skill "$_sk_name" "$_pname"
|
|
543
596
|
rnex_unregister_user_skill "$_sk_name"
|
|
544
597
|
done
|
|
545
598
|
fi
|
|
@@ -634,6 +687,12 @@ sync_rnex_base_assets() {
|
|
|
634
687
|
rm -f "$NEXUS_DIR/.rnex/skills/wiki-ingest.md" "$NEXUS_DIR/.rnex/skills/wiki-lint.md" \
|
|
635
688
|
"$NEXUS_DIR/.rnex/skills/rnex-wiki-ingest.md" "$NEXUS_DIR/.rnex/skills/rnex-wiki-lint.md" 2>/dev/null || true
|
|
636
689
|
|
|
690
|
+
# Purge stale unprefixed wiki user skills across provider directories
|
|
691
|
+
for _p_dir in $(get_active_provider_skill_dirs 2>/dev/null || true); do
|
|
692
|
+
rm -f "$NEXUS_DIR/$_p_dir/rnex-wiki-ingest.md" "$NEXUS_DIR/$_p_dir/rnex-wiki-lint.md" 2>/dev/null || true
|
|
693
|
+
rm -rf "$NEXUS_DIR/$_p_dir/rnex-wiki-ingest" "$NEXUS_DIR/$_p_dir/rnex-wiki-lint" 2>/dev/null || true
|
|
694
|
+
done
|
|
695
|
+
|
|
637
696
|
# Register core User Skills across active provider directories
|
|
638
697
|
for _sk_file in "$NEXUS_DIR/.rnex/skills"/*.md; do
|
|
639
698
|
[ -f "$_sk_file" ] || continue
|
package/lib/commands/init.sh
CHANGED
|
@@ -119,7 +119,7 @@ cmd_init() {
|
|
|
119
119
|
_init_plugins="${_init_plugins} windsurf:\n instructions: true\n skills: true\n"
|
|
120
120
|
fi
|
|
121
121
|
if [ "$_cli_karpathy" = "true" ]; then
|
|
122
|
-
_init_plugins="${_init_plugins} karpathy-llm:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n"
|
|
122
|
+
_init_plugins="${_init_plugins} karpathy-llm:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n ingest_member_readmes: true\n"
|
|
123
123
|
fi
|
|
124
124
|
|
|
125
125
|
cat > "$_target_yaml" <<YAML_EOF
|
package/lib/commands/plugin.sh
CHANGED
|
@@ -83,11 +83,13 @@ cmd_plugin_info() {
|
|
|
83
83
|
if [ "$_name" = "karpathy-llm" ]; then
|
|
84
84
|
_cur_lt="$(yaml_plugin_get "karpathy-llm" "lint_trigger" 2>/dev/null || true)"
|
|
85
85
|
_cur_nc="$(yaml_plugin_get "karpathy-llm" "notify_on_changes" 2>/dev/null || true)"
|
|
86
|
+
_cur_imr="$(yaml_plugin_get "karpathy-llm" "ingest_member_readmes" 2>/dev/null || true)"
|
|
86
87
|
printf '\n%bConfigurable Options (in rnex.yaml or .local.rnex.yaml):%b\n' "$_BOLD" "$_NC"
|
|
87
88
|
printf ' - wiki_dir: <dir> (directory for curated markdown pages; current: %s)\n' "$(karpathy_wiki_dir)"
|
|
88
89
|
printf ' - raw_dir: <dir> (directory for unmodified intake documents; current: %s)\n' "$(karpathy_raw_dir)"
|
|
89
90
|
printf ' - lint_trigger: git-post-merge|git-post-commit|git-pre-commit|git-pre-push|manual (current: %s)\n' "${_cur_lt:-manual}"
|
|
90
91
|
printf ' - notify_on_changes: true|false (show notification when raw/wiki changes are committed; current: %s)\n' "${_cur_nc:-true}"
|
|
92
|
+
printf ' - ingest_member_readmes: true|false (automatically track member repository READMEs in wiki; current: %s)\n' "${_cur_imr:-true}"
|
|
91
93
|
fi
|
|
92
94
|
|
|
93
95
|
printf '\n%bScoped Directory:%b .rnex/plugins/%s\n' "$_BOLD" "$_NC" "$_name"
|
package/lib/hooks.sh
CHANGED
|
@@ -59,9 +59,16 @@ run_hook() {
|
|
|
59
59
|
RNEX_PROVIDER_SKILL_DIRS="$_skill_dirs"
|
|
60
60
|
export RNEX_ROOT RNEX_CONFIG_MERGED RNEX_PLUGIN_DIR RNEX_CMD RNEX_ARGS RNEX_QUIET RNEX_PROVIDER_SKILL_DIRS
|
|
61
61
|
# shellcheck disable=SC2329
|
|
62
|
-
|
|
62
|
+
rnex_generate_user_skill() {
|
|
63
63
|
skill_name="$1"
|
|
64
64
|
target_path="$2"
|
|
65
|
+
plugin_name="${3:-}"
|
|
66
|
+
|
|
67
|
+
if [ -n "$plugin_name" ]; then
|
|
68
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
69
|
+
else
|
|
70
|
+
full_name="rnex-${skill_name}"
|
|
71
|
+
fi
|
|
65
72
|
_target_file=""
|
|
66
73
|
if [ -f "$RNEX_ROOT/$target_path" ]; then
|
|
67
74
|
_target_file="$RNEX_ROOT/$target_path"
|
|
@@ -73,7 +80,7 @@ run_hook() {
|
|
|
73
80
|
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
74
81
|
fi
|
|
75
82
|
if [ -z "$_skill_desc" ]; then
|
|
76
|
-
_skill_desc="Repo Nexus agentic skill protocol for ${
|
|
83
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${full_name}."
|
|
77
84
|
fi
|
|
78
85
|
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
79
86
|
|
|
@@ -81,24 +88,24 @@ run_hook() {
|
|
|
81
88
|
case "$provider_dir" in
|
|
82
89
|
*rules*)
|
|
83
90
|
mkdir -p "$RNEX_ROOT/$provider_dir"
|
|
84
|
-
rm -rf "$RNEX_ROOT/$provider_dir
|
|
85
|
-
cat << EOF > "$RNEX_ROOT/$provider_dir
|
|
86
|
-
# User Skill:
|
|
91
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/${full_name:?}" 2>/dev/null || true
|
|
92
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/${full_name}.md"
|
|
93
|
+
# User Skill: ${full_name}
|
|
87
94
|
|
|
88
95
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
89
96
|
\`${target_path}\`
|
|
90
97
|
EOF
|
|
91
98
|
;;
|
|
92
99
|
*)
|
|
93
|
-
mkdir -p "$RNEX_ROOT/$provider_dir
|
|
94
|
-
rm -f "$RNEX_ROOT/$provider_dir
|
|
95
|
-
cat << EOF > "$RNEX_ROOT/$provider_dir
|
|
100
|
+
mkdir -p "$RNEX_ROOT/$provider_dir/${full_name}"
|
|
101
|
+
rm -f "$RNEX_ROOT/$provider_dir/${full_name}.md" 2>/dev/null || true
|
|
102
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/${full_name}/SKILL.md"
|
|
96
103
|
---
|
|
97
|
-
name:
|
|
104
|
+
name: ${full_name}
|
|
98
105
|
description: "${_skill_desc}"
|
|
99
106
|
---
|
|
100
107
|
|
|
101
|
-
# User Skill:
|
|
108
|
+
# User Skill: ${full_name}
|
|
102
109
|
|
|
103
110
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
104
111
|
\`${target_path}\`
|
|
@@ -108,12 +115,30 @@ EOF
|
|
|
108
115
|
done
|
|
109
116
|
}
|
|
110
117
|
|
|
118
|
+
# shellcheck disable=SC2329
|
|
119
|
+
rnex_register_user_skill() {
|
|
120
|
+
rnex_generate_user_skill "$@"
|
|
121
|
+
}
|
|
122
|
+
|
|
111
123
|
# shellcheck disable=SC2329
|
|
112
124
|
rnex_unregister_user_skill() {
|
|
113
125
|
skill_name="$1"
|
|
126
|
+
plugin_name="${2:-}"
|
|
127
|
+
if [ -n "$plugin_name" ]; then
|
|
128
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
129
|
+
else
|
|
130
|
+
case "$skill_name" in
|
|
131
|
+
rnex-*) full_name="$skill_name" ;;
|
|
132
|
+
*) full_name="rnex-${skill_name}" ;;
|
|
133
|
+
esac
|
|
134
|
+
fi
|
|
114
135
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
115
|
-
rm -f "$RNEX_ROOT/$provider_dir
|
|
116
|
-
rm -rf "$RNEX_ROOT/$provider_dir
|
|
136
|
+
rm -f "$RNEX_ROOT/$provider_dir/${full_name}.md"
|
|
137
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/${full_name:?}"
|
|
138
|
+
if [ -n "$plugin_name" ]; then
|
|
139
|
+
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
140
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/rnex-${skill_name:?}"
|
|
141
|
+
fi
|
|
117
142
|
done
|
|
118
143
|
}
|
|
119
144
|
set -- "$@"
|
|
@@ -174,9 +199,16 @@ run_plugin_hook() {
|
|
|
174
199
|
RNEX_PROVIDER_SKILL_DIRS="$_skill_dirs"
|
|
175
200
|
export RNEX_ROOT RNEX_CONFIG_MERGED RNEX_PLUGIN_DIR RNEX_CMD RNEX_ARGS RNEX_QUIET RNEX_PROVIDER_SKILL_DIRS
|
|
176
201
|
# shellcheck disable=SC2329
|
|
177
|
-
|
|
202
|
+
rnex_generate_user_skill() {
|
|
178
203
|
skill_name="$1"
|
|
179
204
|
target_path="$2"
|
|
205
|
+
plugin_name="${3:-}"
|
|
206
|
+
|
|
207
|
+
if [ -n "$plugin_name" ]; then
|
|
208
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
209
|
+
else
|
|
210
|
+
full_name="rnex-${skill_name}"
|
|
211
|
+
fi
|
|
180
212
|
_target_file=""
|
|
181
213
|
if [ -f "$RNEX_ROOT/$target_path" ]; then
|
|
182
214
|
_target_file="$RNEX_ROOT/$target_path"
|
|
@@ -188,7 +220,7 @@ run_plugin_hook() {
|
|
|
188
220
|
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
189
221
|
fi
|
|
190
222
|
if [ -z "$_skill_desc" ]; then
|
|
191
|
-
_skill_desc="Repo Nexus agentic skill protocol for ${
|
|
223
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${full_name}."
|
|
192
224
|
fi
|
|
193
225
|
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
194
226
|
|
|
@@ -196,24 +228,24 @@ run_plugin_hook() {
|
|
|
196
228
|
case "$provider_dir" in
|
|
197
229
|
*rules*)
|
|
198
230
|
mkdir -p "$RNEX_ROOT/$provider_dir"
|
|
199
|
-
rm -rf "$RNEX_ROOT/$provider_dir
|
|
200
|
-
cat << EOF > "$RNEX_ROOT/$provider_dir
|
|
201
|
-
# User Skill:
|
|
231
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/${full_name:?}" 2>/dev/null || true
|
|
232
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/${full_name}.md"
|
|
233
|
+
# User Skill: ${full_name}
|
|
202
234
|
|
|
203
235
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
204
236
|
\`${target_path}\`
|
|
205
237
|
EOF
|
|
206
238
|
;;
|
|
207
239
|
*)
|
|
208
|
-
mkdir -p "$RNEX_ROOT/$provider_dir
|
|
209
|
-
rm -f "$RNEX_ROOT/$provider_dir
|
|
210
|
-
cat << EOF > "$RNEX_ROOT/$provider_dir
|
|
240
|
+
mkdir -p "$RNEX_ROOT/$provider_dir/${full_name}"
|
|
241
|
+
rm -f "$RNEX_ROOT/$provider_dir/${full_name}.md" 2>/dev/null || true
|
|
242
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/${full_name}/SKILL.md"
|
|
211
243
|
---
|
|
212
|
-
name:
|
|
244
|
+
name: ${full_name}
|
|
213
245
|
description: "${_skill_desc}"
|
|
214
246
|
---
|
|
215
247
|
|
|
216
|
-
# User Skill:
|
|
248
|
+
# User Skill: ${full_name}
|
|
217
249
|
|
|
218
250
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
219
251
|
\`${target_path}\`
|
|
@@ -223,12 +255,30 @@ EOF
|
|
|
223
255
|
done
|
|
224
256
|
}
|
|
225
257
|
|
|
258
|
+
# shellcheck disable=SC2329
|
|
259
|
+
rnex_register_user_skill() {
|
|
260
|
+
rnex_generate_user_skill "$@"
|
|
261
|
+
}
|
|
262
|
+
|
|
226
263
|
# shellcheck disable=SC2329
|
|
227
264
|
rnex_unregister_user_skill() {
|
|
228
265
|
skill_name="$1"
|
|
266
|
+
plugin_name="${2:-}"
|
|
267
|
+
if [ -n "$plugin_name" ]; then
|
|
268
|
+
full_name="rnex-${plugin_name}-${skill_name}"
|
|
269
|
+
else
|
|
270
|
+
case "$skill_name" in
|
|
271
|
+
rnex-*) full_name="$skill_name" ;;
|
|
272
|
+
*) full_name="rnex-${skill_name}" ;;
|
|
273
|
+
esac
|
|
274
|
+
fi
|
|
229
275
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
230
|
-
rm -f "$RNEX_ROOT/$provider_dir
|
|
231
|
-
rm -rf "$RNEX_ROOT/$provider_dir
|
|
276
|
+
rm -f "$RNEX_ROOT/$provider_dir/${full_name}.md"
|
|
277
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/${full_name:?}"
|
|
278
|
+
if [ -n "$plugin_name" ]; then
|
|
279
|
+
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
280
|
+
rm -rf "${RNEX_ROOT:?}/${provider_dir:?}/rnex-${skill_name:?}"
|
|
281
|
+
fi
|
|
232
282
|
done
|
|
233
283
|
}
|
|
234
284
|
set -- "$@"
|
package/lib/yaml.sh
CHANGED
|
@@ -281,14 +281,14 @@ yaml_enable_plugin() {
|
|
|
281
281
|
awk -v name="$_name" '
|
|
282
282
|
/^plugins:[ ]*$/ || /^plugins:[ ]*#/ {
|
|
283
283
|
print
|
|
284
|
-
printf " %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n", name
|
|
284
|
+
printf " %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n ingest_member_readmes: true\n", name
|
|
285
285
|
added=1
|
|
286
286
|
next
|
|
287
287
|
}
|
|
288
288
|
{ print }
|
|
289
289
|
END {
|
|
290
290
|
if (!added) {
|
|
291
|
-
printf "plugins:\n %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n", name
|
|
291
|
+
printf "plugins:\n %s:\n raw_dir: \"./docs\"\n wiki_dir: \".rnex/wiki\"\n lint_trigger: \"manual\"\n ingest_member_readmes: true\n", name
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
' "$_target_file" > "$_tmp" && mv "$_tmp" "$_target_file"
|
package/package.json
CHANGED
|
@@ -107,6 +107,8 @@ plugins:
|
|
|
107
107
|
# wiki_dir: ".rnex/wiki" # Directory for curated atomic markdown pages (default: .rnex/wiki)
|
|
108
108
|
# lint_trigger: "manual" # Runs manually via 'rnex sync' or validation checklists (git-post-merge, git-post-commit, git-pre-commit, git-pre-push, manual)
|
|
109
109
|
# notify_on_changes: true # Show notification when changes are committed to ./docs or .rnex/wiki
|
|
110
|
+
# ingest_member_readmes: true # Automatically ingest member repository READMEs into atomic wiki pages (default: true)
|
|
111
|
+
|
|
110
112
|
|
|
111
113
|
# ------------------------------------------------------------------------------
|
|
112
114
|
# repos — Member repositories managed by Repo Nexus
|
|
@@ -5,7 +5,7 @@ A built-in Repo Nexus plugin providing instructions and skill integration for Gi
|
|
|
5
5
|
## Capabilities
|
|
6
6
|
|
|
7
7
|
1. **Instructions Integration**: Generates and maintains `.github/copilot-instructions.md` with Repo Nexus routing instructions while preserving custom instructions outside delimiters.
|
|
8
|
-
2. **User Skills Generation**: Standardized Repo Nexus core skills and active plugins' skills are mirrored as zero-logic User Skill pointers (`rnex-<name
|
|
8
|
+
2. **User Skills Generation**: Standardized Repo Nexus core skills and active plugins' skills are mirrored as zero-logic User Skill pointers (`rnex-<name>/SKILL.md`) in `.github/skills/`.
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@ This workspace has the Repo Nexus `copilot` plugin enabled.
|
|
|
4
4
|
|
|
5
5
|
## Operating Principles
|
|
6
6
|
- **Instructions Integration**: GitHub Copilot natively reads `.github/copilot-instructions.md` and root `AGENTS.md` for workspace routing and active plugin guidelines between `<!-- REPO-NEXUS:START -->` and `<!-- REPO-NEXUS:END -->`. Custom instructions outside these markers are strictly preserved.
|
|
7
|
-
- **User Skills**: Standardized Repo Nexus core skills and active plugin skills can be accessed via `.github/skills/rnex
|
|
7
|
+
- **User Skills**: Standardized Repo Nexus core skills and active plugin skills can be accessed via `.github/skills/rnex-*/SKILL.md` when `skills: true`.
|
|
8
8
|
|
|
9
9
|
## Configuration
|
|
10
10
|
Configure plugin options in `rnex.yaml` or override them per developer in `.local.rnex.yaml`:
|
|
@@ -10,13 +10,13 @@ Reference specification: [setup-karpathy-wiki.md](https://github.com/unoxen/ai-t
|
|
|
10
10
|
|
|
11
11
|
## What It Provides
|
|
12
12
|
|
|
13
|
-
### 1. The 4 Cardinal Principles for Coding Agents (`rules/
|
|
13
|
+
### 1. The 4 Cardinal Principles for Coding Agents (`rules/behavioral.md`)
|
|
14
14
|
* **Think Before Coding:** Explicit assumptions, problem formulation, and trade-off evaluation before writing code.
|
|
15
15
|
* **Simplicity First:** Minimal abstractions, readable implementations, and zero boilerplate bloat.
|
|
16
16
|
* **Surgical Changes:** Minimal blast radius, preserved comments/docstrings, and tightly focused diffs.
|
|
17
17
|
* **Goal-Driven Execution:** Upfront verification criteria, automated tests, and rigorous diff review.
|
|
18
18
|
|
|
19
|
-
### 2. Multi-Repo Context Engineering & Autonomy (`rules/
|
|
19
|
+
### 2. Multi-Repo Context Engineering & Autonomy (`rules/behavioral.md`)
|
|
20
20
|
* Guidelines tailored for Repo Nexus workspaces respecting member repository autonomy and physical repository boundaries.
|
|
21
21
|
|
|
22
22
|
### 3. Complete Karpathy LLM Wiki Architecture (`instructions/rnex-wiki-architecture.md`)
|
|
@@ -26,9 +26,9 @@ Reference specification: [setup-karpathy-wiki.md](https://github.com/unoxen/ai-t
|
|
|
26
26
|
* **Rolling Context Cache (`<wiki_dir>/hot.md`, default: `.rnex/wiki/hot.md`):** High-density ~500-word orientation summary for rapid agent onboarding without full wiki scans (especially for codebase knowledge and second-brain wikis).
|
|
27
27
|
* **Audit Trail (`<wiki_dir>/_log.md`, default: `.rnex/wiki/_log.md`):** Append-only log recording every ingest and lint operation with timestamped details.
|
|
28
28
|
|
|
29
|
-
### 4. Standardized Agent
|
|
30
|
-
* **`
|
|
31
|
-
* **`
|
|
29
|
+
### 4. Standardized Agent Skills (`skills/`)
|
|
30
|
+
* **`wiki-ingest.md` (User Skill: `rnex-karpathy-llm-wiki-ingest`):** Decomposes raw source documents into 5–25 atomic wiki pages with frontmatter relations.
|
|
31
|
+
* **`wiki-lint.md` (User Skill: `rnex-karpathy-llm-wiki-lint`):** Integrity audit protocol to validate paths, recompute `mentioned_in`, eliminate orphans, merge duplicates, audit inconsistencies, identify gaps, suggest source candidates, and rebuild indexes.
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
@@ -45,9 +45,9 @@ Enabling the plugin (`rnex plugin enable karpathy-llm`) performs an exact, zero-
|
|
|
45
45
|
|
|
46
46
|
### Phase 2: Evolutionary Growth & Domain Specialization (Usage Phase)
|
|
47
47
|
Once initialized, the workspace structure organically evolves according to actual domain needs and source materials:
|
|
48
|
-
* **Source Ingestion (`rnex-wiki-ingest`)**: As raw source documents are deposited into `./docs` and ingested, atomic pages are generated. Users or agents can organize pages into categorical subfolders (e.g. `architecture/`, `decisions/`, `concepts/`, `projects/`) or keep them flat.
|
|
49
|
-
* **Customizable Guidelines**: Teams can tailor `rules/
|
|
50
|
-
* **Graph Maintenance (`rnex-wiki-lint`)**: The periodic lint workflow validates relation paths, updates `mentioned_in`, and rebuilds `index.md` and `hot.md` to match the evolved knowledge graph.
|
|
48
|
+
* **Source Ingestion (`rnex-karpathy-llm-wiki-ingest`)**: As raw source documents are deposited into `./docs` and ingested, atomic pages are generated. Users or agents can organize pages into categorical subfolders (e.g. `architecture/`, `decisions/`, `concepts/`, `projects/`) or keep them flat.
|
|
49
|
+
* **Customizable Guidelines**: Teams can tailor `rules/behavioral.md` and `instructions/rnex-wiki-architecture.md` for their specific team conventions.
|
|
50
|
+
* **Graph Maintenance (`rnex-karpathy-llm-wiki-lint`)**: The periodic lint workflow validates relation paths, updates `mentioned_in`, and rebuilds `index.md` and `hot.md` to match the evolved knowledge graph.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
@@ -70,10 +70,10 @@ my-workspace/
|
|
|
70
70
|
│ ├── instructions/
|
|
71
71
|
│ │ └── rnex-wiki-architecture.md# LLM Wiki architecture & relation schema
|
|
72
72
|
│ ├── rules/
|
|
73
|
-
│ │ └──
|
|
74
|
-
│ ├──
|
|
75
|
-
│ │ ├──
|
|
76
|
-
│ │ └──
|
|
73
|
+
│ │ └── behavioral.md # Cardinal principles & context engineering
|
|
74
|
+
│ ├── skills/
|
|
75
|
+
│ │ ├── wiki-ingest.md # 8-step decomposition & ingestion workflow
|
|
76
|
+
│ │ └── wiki-lint.md # 10-step graph validation & maintenance workflow
|
|
77
77
|
│ └── templates/
|
|
78
78
|
│ ├── rnex-wiki-page.template.md# Atomic page template with typed relations
|
|
79
79
|
│ └── rnex-llm-wiki.sample.md# Sample wiki walkthrough
|
|
@@ -7,9 +7,6 @@ set -e
|
|
|
7
7
|
# Resolve root workspace
|
|
8
8
|
_root="$RNEX_ROOT"
|
|
9
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"
|
|
13
10
|
|
|
14
11
|
# Helper to read plugin config
|
|
15
12
|
get_cfg() {
|
|
@@ -48,6 +45,7 @@ get_cfg() {
|
|
|
48
45
|
|
|
49
46
|
_wiki="$(get_cfg "wiki_dir" ".rnex/wiki")"
|
|
50
47
|
_raw="$(get_cfg "raw_dir" "./docs")"
|
|
48
|
+
_ingest_readmes="$(get_cfg "ingest_member_readmes" "true")"
|
|
51
49
|
|
|
52
50
|
# Clean relative paths
|
|
53
51
|
_wiki="$(printf '%s' "$_wiki" | sed -e 's#^/##' -e 's#/$##')"
|
|
@@ -59,6 +57,9 @@ _raw_path="$_root/$_raw"
|
|
|
59
57
|
mkdir -p "$_wiki_path" "$_raw_path"
|
|
60
58
|
[ -f "$_raw_path/.gitkeep" ] || touch "$_raw_path/.gitkeep"
|
|
61
59
|
|
|
60
|
+
# Ensure .rnex/wiki/ contains only agent-maintained wiki artifacts (no raw staging directory)
|
|
61
|
+
rm -rf "$_wiki_path/raw" 2>/dev/null || true
|
|
62
|
+
|
|
62
63
|
_pdir="${RNEX_PLUGIN_DIR:-$_root/.rnex/plugins/karpathy-llm}"
|
|
63
64
|
if [ ! -d "$_pdir/templates" ] && [ -d "$_root/toolkit/plugins/karpathy-llm/templates" ]; then
|
|
64
65
|
_tmpl_dir="$_root/toolkit/plugins/karpathy-llm/templates"
|
|
@@ -78,7 +79,7 @@ fi
|
|
|
78
79
|
|
|
79
80
|
# Ensure template in .rnex/plugins/karpathy-llm/templates
|
|
80
81
|
mkdir -p "$_pdir/templates"
|
|
81
|
-
if [ -f "$_tmpl_dir/rnex-wiki-page.sample.md" ]
|
|
82
|
+
if [ -f "$_tmpl_dir/rnex-wiki-page.sample.md" ]; then
|
|
82
83
|
cp "$_tmpl_dir/rnex-wiki-page.sample.md" "$_pdir/templates/rnex-wiki-page.template.md"
|
|
83
84
|
fi
|
|
84
85
|
|
|
@@ -97,18 +98,31 @@ if [ -n "$_src_k_skills" ] && [ "$_src_k_skills" != "$RNEX_ROOT/.rnex/plugins/ka
|
|
|
97
98
|
cp -R "$_src_k_skills"/. "$RNEX_ROOT/.rnex/plugins/karpathy-llm/skills"/ 2>/dev/null || true
|
|
98
99
|
fi
|
|
99
100
|
|
|
100
|
-
# 2. Register plugin User Skills via contract helper
|
|
101
|
-
if ! command -v rnex_register_user_skill >/dev/null 2>&1; then
|
|
101
|
+
# 2. Register plugin User Skills via contract helper (with plugin name prefix)
|
|
102
|
+
if ! command -v rnex_register_user_skill >/dev/null 2>&1 && ! command -v rnex_generate_user_skill >/dev/null 2>&1; then
|
|
102
103
|
if [ -f "$RNEX_ROOT/.rnex/bin/rnex-env.sh" ]; then
|
|
103
104
|
. "$RNEX_ROOT/.rnex/bin/rnex-env.sh"
|
|
104
105
|
fi
|
|
105
106
|
fi
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
# Clean up stale unprefixed skills
|
|
109
|
+
if command -v rnex_unregister_user_skill >/dev/null 2>&1; then
|
|
110
|
+
rnex_unregister_user_skill "wiki-ingest"
|
|
111
|
+
rnex_unregister_user_skill "wiki-lint"
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
_reg_fn=""
|
|
115
|
+
if command -v rnex_generate_user_skill >/dev/null 2>&1; then
|
|
116
|
+
_reg_fn="rnex_generate_user_skill"
|
|
117
|
+
elif command -v rnex_register_user_skill >/dev/null 2>&1; then
|
|
118
|
+
_reg_fn="rnex_register_user_skill"
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
if [ -n "$_reg_fn" ]; then
|
|
108
122
|
for skill_file in "$RNEX_ROOT/.rnex/plugins/karpathy-llm/skills"/*.md; do
|
|
109
123
|
[ -f "$skill_file" ] || continue
|
|
110
124
|
skill_name=$(basename "$skill_file" .md)
|
|
111
|
-
|
|
125
|
+
"$_reg_fn" "$skill_name" ".rnex/plugins/karpathy-llm/skills/${skill_name}.md" "karpathy-llm"
|
|
112
126
|
done
|
|
113
127
|
fi
|
|
114
128
|
|
|
@@ -134,20 +148,6 @@ RAW_DIR_VAL=$(grep -h -E '^\s*raw_dir:' "$RNEX_ROOT/rnex.yaml" "$RNEX_ROOT/.loca
|
|
|
134
148
|
[ -z "$RAW_DIR_VAL" ] && RAW_DIR_VAL="$(get_cfg "raw_dir" "./docs")"
|
|
135
149
|
RAW_DIR="${RAW_DIR_VAL:-./docs}"
|
|
136
150
|
|
|
137
|
-
# Clear and sync custom local raw folder files to raw intake (skip if RAW_DIR is a documentation site)
|
|
138
|
-
if [ -d "$RNEX_ROOT/$RAW_DIR" ] && [ ! -d "$RNEX_ROOT/$RAW_DIR/.vitepress" ]; then
|
|
139
|
-
_raw_abs="$(cd "$RNEX_ROOT/$RAW_DIR" 2>/dev/null && pwd -P || true)"
|
|
140
|
-
_wiki_raw_abs="$(cd "$WIKI_RAW_DIR" 2>/dev/null && pwd -P || true)"
|
|
141
|
-
if [ -n "$_raw_abs" ] && [ "$_raw_abs" != "$_wiki_raw_abs" ]; then
|
|
142
|
-
find "$RNEX_ROOT/$RAW_DIR" -type f \( -name "*.md" -o -name "*.txt" -o -name "*.json" \) 2>/dev/null | while read -r filepath; do
|
|
143
|
-
filename=$(basename "$filepath")
|
|
144
|
-
# Prevent overwriting standard operational files
|
|
145
|
-
if [ "$filename" != "index.md" ] && [ "$filename" != "hot.md" ] && [ "$filename" != "_log.md" ]; then
|
|
146
|
-
cp "$filepath" "$WIKI_RAW_DIR/$filename"
|
|
147
|
-
fi
|
|
148
|
-
done
|
|
149
|
-
fi
|
|
150
|
-
fi
|
|
151
151
|
|
|
152
152
|
# Ingest member repository README into atomic wiki page, index, and hot cache
|
|
153
153
|
ingest_member_readme() {
|
|
@@ -316,18 +316,24 @@ LOG_EOF
|
|
|
316
316
|
fi
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
# 2. Automatically
|
|
319
|
+
# 2. Automatically ingest README.md from all enabled/cloned member repositories in-place
|
|
320
320
|
# Get list of enabled repositories using a secure cross-repo read or `rnex list`
|
|
321
|
+
case "$(printf '%s' "$_ingest_readmes" | tr '[:upper:]' '[:lower:]')" in
|
|
322
|
+
false|no|0|disabled|off) _skip_all_readmes=1 ;;
|
|
323
|
+
*) _skip_all_readmes=0 ;;
|
|
324
|
+
esac
|
|
325
|
+
|
|
321
326
|
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 '"'\''')
|
|
322
327
|
REPOS_DIR="${REPOS_DIR_VAL:-./repos}"
|
|
323
328
|
|
|
324
|
-
if [ -d "$RNEX_ROOT/$REPOS_DIR" ]; then
|
|
329
|
+
if [ "$_skip_all_readmes" -ne 1 ] && [ -d "$RNEX_ROOT/$REPOS_DIR" ]; then
|
|
325
330
|
for repo_path in "$RNEX_ROOT/$REPOS_DIR"/*; do
|
|
326
331
|
[ ! -d "$repo_path" ] && continue
|
|
327
332
|
repo_name=$(basename "$repo_path")
|
|
328
333
|
|
|
329
334
|
# Check if this repository is explicitly disabled in .local.rnex.yaml or rnex.yaml (block-scoped)
|
|
330
335
|
_is_disabled=""
|
|
336
|
+
_repo_ingest=""
|
|
331
337
|
for _cfg_file in "$RNEX_ROOT/.local.rnex.yaml" "$RNEX_ROOT/rnex.yaml"; do
|
|
332
338
|
[ -f "$_cfg_file" ] || continue
|
|
333
339
|
_en="$(awk -v repo="$repo_name" '
|
|
@@ -344,21 +350,40 @@ if [ -d "$RNEX_ROOT/$REPOS_DIR" ]; then
|
|
|
344
350
|
exit
|
|
345
351
|
}
|
|
346
352
|
' "$_cfg_file")"
|
|
347
|
-
if [ -n "$_en" ]; then
|
|
353
|
+
if [ -n "$_en" ] && [ -z "$_is_disabled" ]; then
|
|
348
354
|
case "$(printf '%s' "$_en" | tr '[:upper:]' '[:lower:]')" in
|
|
349
355
|
false|no|0|disabled|off) _is_disabled=1 ;;
|
|
350
356
|
*) _is_disabled=0 ;;
|
|
351
357
|
esac
|
|
352
|
-
|
|
358
|
+
fi
|
|
359
|
+
|
|
360
|
+
_ingest_val="$(awk -v repo="$repo_name" '
|
|
361
|
+
/^repos:[ ]*$/ || /^repos:[ ]*#/ { r=1; next }
|
|
362
|
+
r && /^[^ #]/ { r=0 }
|
|
363
|
+
r && match($0, "^ " repo ":[ ]*(#.*)?$") { in_target=1; next }
|
|
364
|
+
in_target && /^ [^ #]/ { in_target=0 }
|
|
365
|
+
in_target && match($0, "^ ingest_member_readmes:[ ]*") {
|
|
366
|
+
line = $0
|
|
367
|
+
sub("^ ingest_member_readmes:[ ]*", "", line)
|
|
368
|
+
sub(/[ ]*#.*$/, "", line)
|
|
369
|
+
gsub(/^["\x27]|["\x27]$/, "", line)
|
|
370
|
+
print line
|
|
371
|
+
exit
|
|
372
|
+
}
|
|
373
|
+
' "$_cfg_file")"
|
|
374
|
+
if [ -n "$_ingest_val" ] && [ -z "$_repo_ingest" ]; then
|
|
375
|
+
case "$(printf '%s' "$_ingest_val" | tr '[:upper:]' '[:lower:]')" in
|
|
376
|
+
false|no|0|disabled|off) _repo_ingest=0 ;;
|
|
377
|
+
*) _repo_ingest=1 ;;
|
|
378
|
+
esac
|
|
353
379
|
fi
|
|
354
380
|
done
|
|
355
381
|
[ "$_is_disabled" = "1" ] && continue
|
|
382
|
+
[ "$_repo_ingest" = "0" ] && continue
|
|
356
383
|
|
|
357
|
-
# Read and
|
|
384
|
+
# Read and ingest any README file directly in-place (no staging copy)
|
|
358
385
|
for readme_name in README.md readme.md README.markdown README; do
|
|
359
386
|
if [ -f "$repo_path/$readme_name" ]; then
|
|
360
|
-
# Namespace the copied file with its repo name to prevent conflicts
|
|
361
|
-
cp "$repo_path/$readme_name" "$WIKI_RAW_DIR/README_${repo_name}.md"
|
|
362
387
|
# Ingest member repository README into atomic wiki page, index, and hot cache
|
|
363
388
|
ingest_member_readme "$repo_name" "$repo_path" "$readme_name"
|
|
364
389
|
break
|
|
@@ -11,11 +11,19 @@ if ! command -v rnex_unregister_user_skill >/dev/null 2>&1; then
|
|
|
11
11
|
fi
|
|
12
12
|
|
|
13
13
|
if command -v rnex_unregister_user_skill >/dev/null 2>&1; then
|
|
14
|
+
rnex_unregister_user_skill "wiki-ingest" "karpathy-llm"
|
|
15
|
+
rnex_unregister_user_skill "wiki-lint" "karpathy-llm"
|
|
14
16
|
rnex_unregister_user_skill "wiki-ingest"
|
|
15
17
|
rnex_unregister_user_skill "wiki-lint"
|
|
16
18
|
else
|
|
17
19
|
for _pdir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
20
|
+
rm -f "$RNEX_ROOT/$_pdir/rnex-karpathy-llm-wiki-ingest.md"
|
|
21
|
+
rm -f "$RNEX_ROOT/$_pdir/rnex-karpathy-llm-wiki-lint.md"
|
|
22
|
+
rm -rf "$RNEX_ROOT/$_pdir/rnex-karpathy-llm-wiki-ingest"
|
|
23
|
+
rm -rf "$RNEX_ROOT/$_pdir/rnex-karpathy-llm-wiki-lint"
|
|
18
24
|
rm -f "$RNEX_ROOT/$_pdir/rnex-wiki-ingest.md"
|
|
19
25
|
rm -f "$RNEX_ROOT/$_pdir/rnex-wiki-lint.md"
|
|
26
|
+
rm -rf "$RNEX_ROOT/$_pdir/rnex-wiki-ingest"
|
|
27
|
+
rm -rf "$RNEX_ROOT/$_pdir/rnex-wiki-lint"
|
|
20
28
|
done
|
|
21
29
|
fi
|
|
@@ -44,6 +44,10 @@ _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
|
|
47
|
-
|
|
47
|
+
_wiki_path="$_root/$_wiki"
|
|
48
|
+
if [ ! -f "$_wiki_path/index.md" ] || [ ! -f "$_wiki_path/hot.md" ]; then
|
|
49
|
+
printf '[WIKI] Warning: Required wiki files (index.md or hot.md) missing in %s/.\n' "$_wiki"
|
|
50
|
+
fi
|
|
51
|
+
printf '[WIKI] Reminder: Wiki files changed. Run the rnex-karpathy-llm-wiki-lint skill to verify.\n'
|
|
48
52
|
fi
|
|
49
53
|
fi
|
|
@@ -27,7 +27,7 @@ Do not create arbitrary or speculative subdirectories during initialization. Sca
|
|
|
27
27
|
|
|
28
28
|
### 2. Agent Rules & Routing
|
|
29
29
|
|
|
30
|
-
- **Repo Nexus Workspaces**: Directories (`raw_dir`, default: `./docs`; `wiki_dir`, default: `.rnex/wiki`) are configured in `rnex.yaml` under `plugins.karpathy-llm`. Plugin assets are scoped under `.rnex/plugins/karpathy-llm/` (`rules/
|
|
30
|
+
- **Repo Nexus Workspaces**: Directories (`raw_dir`, default: `./docs`; `wiki_dir`, default: `.rnex/wiki`) are configured in `rnex.yaml` under `plugins.karpathy-llm`. Plugin assets are scoped under `.rnex/plugins/karpathy-llm/` (`rules/behavioral.md` and `instructions/rnex-wiki-architecture.md`). Agents resolve configuration dynamically.
|
|
31
31
|
- **Standalone Repositories**: Append the `## Karpathy 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
|
---
|
|
@@ -8,17 +8,33 @@ The curated wiki directory (`wiki_dir`, default: `.rnex/wiki`) and raw intake di
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## Mandatory Wiki-First Access Gate (Pre-Task Execution)
|
|
12
|
+
|
|
13
|
+
Before inspecting, searching, or modifying code inside member repositories (`repos/`), AI assistants MUST execute this sequence:
|
|
14
|
+
|
|
15
|
+
1. **Orientation Gate (`<wiki_dir>/hot.md`)**:
|
|
16
|
+
- Always read `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`) first to absorb architectural topology, member repo boundaries, and current focus.
|
|
17
|
+
- Do NOT access `repos/` until this high-level orientation is completed.
|
|
18
|
+
2. **Catalog & Topic Lookup (`<wiki_dir>/index.md`)**:
|
|
19
|
+
- If the specific domain concept, API contract, or component required for the task is not resolved in `hot.md`, read `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`).
|
|
20
|
+
- Identify and read the specific atomic wiki page(s) (e.g. `<wiki_dir>/auth.md`) corresponding to the task.
|
|
21
|
+
3. **Targeted Member Repository Access Only**:
|
|
22
|
+
- Only after acquiring domain context and contract specifications from the wiki should you inspect targeted files within `repos/<name>/`. Never execute blind repository-wide grep or unbounded directory scans across `repos/`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
11
26
|
## 1. Operating Rules & Token Economy
|
|
12
27
|
|
|
13
28
|
When working in a workspace with an active Karpathy LLM Wiki:
|
|
14
29
|
|
|
15
30
|
- **Configuration Resolution**: Read `rnex.yaml` / `.local.rnex.yaml` to identify the active `raw_dir` (default: `./docs`) and `wiki_dir` (default: `.rnex/wiki`).
|
|
16
|
-
- **
|
|
31
|
+
- **Read-Only Input Directives**: `raw_dir` (`./docs`) and `./repos/` are strictly read-only inputs during wiki operations. Never create, copy, or modify files inside `./docs`; write generated output exclusively inside `wiki_dir` (`.rnex/wiki/`).
|
|
32
|
+
- **Intake**: All source material (articles, transcripts, docs, notes) goes to `<raw_dir>/` (default: `./docs`) unmodified, and member repository READMEs exist under `./repos/<name>/README.md`. Sources are read directly in-place without staging copies. Never write directly to `<wiki_dir>/` without ingesting.
|
|
17
33
|
- **Orientation (Hot-Cache First)**: Read `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`) for quick ~500-word orientation. Consult `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`) on demand only if the specific topic or contract is not covered in `hot.md`.
|
|
18
34
|
- **Bounded Hot Cache**: `<wiki_dir>/hot.md` enforces a strict ~500-word ceiling with 3 structured sections: 1. Architecture & Repo Map, 2. Current Focus & Recent Ingests, 3. Key Contracts. Ingest and lint workflows must condense older context to prevent bloat.
|
|
19
35
|
- **Annotated Indexing**: `<wiki_dir>/index.md` entries must maintain a single 1-line summary next to each atomic page link (e.g. `- [Auth Flow](auth.md): JWT validation and token rotation`) so agents pinpoint target pages in a single read without trial-and-error scanning.
|
|
20
|
-
- **Ingestion**: When files appear in `<raw_dir
|
|
21
|
-
- **Maintenance**:
|
|
36
|
+
- **Ingestion**: When files appear in `<raw_dir>/` or member repositories are added, execute the `wiki-ingest` agentic skill (`.rnex/plugins/karpathy-llm/skills/wiki-ingest.md`). One source document produces 5–25 atomic pages — never collapse a source into a single file.
|
|
37
|
+
- **Maintenance**: Execute the `wiki-lint` agentic skill (`.rnex/plugins/karpathy-llm/skills/wiki-lint.md`) to validate paths, update `mentioned_in`, and preserve graph integrity.
|
|
22
38
|
|
|
23
39
|
---
|
|
24
40
|
|
|
@@ -8,16 +8,32 @@ The curated wiki directory (`wiki_dir`, default: `.rnex/wiki`) and raw intake di
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## Mandatory Wiki-First Access Gate (Pre-Task Execution)
|
|
12
|
+
|
|
13
|
+
Before inspecting, searching, or modifying code inside member repositories (`repos/`), AI assistants MUST execute this sequence:
|
|
14
|
+
|
|
15
|
+
1. **Orientation Gate (`<wiki_dir>/hot.md`)**:
|
|
16
|
+
- Always read `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`) first to absorb architectural topology, member repo boundaries, and current focus.
|
|
17
|
+
- Do NOT access `repos/` until this high-level orientation is completed.
|
|
18
|
+
2. **Catalog & Topic Lookup (`<wiki_dir>/index.md`)**:
|
|
19
|
+
- If the specific domain concept, API contract, or component required for the task is not resolved in `hot.md`, read `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`).
|
|
20
|
+
- Identify and read the specific atomic wiki page(s) (e.g. `<wiki_dir>/auth.md`) corresponding to the task.
|
|
21
|
+
3. **Targeted Member Repository Access Only**:
|
|
22
|
+
- Only after acquiring domain context and contract specifications from the wiki should you inspect targeted files within `repos/<name>/`. Never execute blind repository-wide grep or unbounded directory scans across `repos/`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
11
26
|
## 1. Operating Rules & Token Economy
|
|
12
27
|
|
|
13
28
|
When working in a workspace with an active Karpathy LLM Wiki:
|
|
14
29
|
|
|
15
30
|
- **Configuration Resolution**: Read `rnex.yaml` / `.local.rnex.yaml` to identify the active `raw_dir` (default: `./docs`) and `wiki_dir` (default: `.rnex/wiki`).
|
|
16
|
-
- **
|
|
31
|
+
- **Read-Only Input Directives**: `raw_dir` (`./docs`) and `./repos/` are strictly read-only inputs during wiki operations. Never create, copy, or modify files inside `./docs`; write generated output exclusively inside `wiki_dir` (`.rnex/wiki/`).
|
|
32
|
+
- **Intake**: All source material (articles, transcripts, docs, notes) goes to `<raw_dir>/` (default: `./docs`) unmodified, and member repository READMEs exist under `./repos/<name>/README.md`. Sources are read directly in-place without staging copies. Never write directly to `<wiki_dir>/` without ingesting.
|
|
17
33
|
- **Orientation (Hot-Cache First)**: Read `<wiki_dir>/hot.md` (default: `.rnex/wiki/hot.md`) for quick ~500-word orientation. Consult `<wiki_dir>/index.md` (default: `.rnex/wiki/index.md`) on demand only if the specific topic or contract is not covered in `hot.md`.
|
|
18
34
|
- **Bounded Hot Cache**: `<wiki_dir>/hot.md` enforces a strict ~500-word ceiling with 3 structured sections: 1. Architecture & Repo Map, 2. Current Focus & Recent Ingests, 3. Key Contracts. Ingest and lint workflows must condense older context to prevent bloat.
|
|
19
35
|
- **Behavioral Principles**: Strictly adhere to the coding agent principles defined at `.rnex/plugins/karpathy-llm/rules/behavioral.md`.
|
|
20
|
-
- **Ingestion**: When files appear in `<raw_dir
|
|
36
|
+
- **Ingestion**: When files appear in `<raw_dir>/` or when member repos are added, execute the `wiki-ingest` agentic skill protocol (`.rnex/plugins/karpathy-llm/skills/wiki-ingest.md`). One source document produces 5–25 atomic pages — never collapse a source into a single file.
|
|
21
37
|
- **Maintenance**: Execute the `wiki-lint` agentic skill protocol (`.rnex/plugins/karpathy-llm/skills/wiki-lint.md`) to validate paths, update `mentioned_in`, and preserve graph integrity.
|
|
22
38
|
|
|
23
39
|
---
|
|
@@ -9,12 +9,14 @@ config_defaults:
|
|
|
9
9
|
wiki_dir: ".rnex/wiki"
|
|
10
10
|
lint_trigger: "manual" # Default changed to manual to avoid unsolicited background trigger tasks
|
|
11
11
|
notify_on_changes: true
|
|
12
|
+
ingest_member_readmes: true
|
|
12
13
|
|
|
13
14
|
config:
|
|
14
15
|
raw_dir: "./docs"
|
|
15
16
|
wiki_dir: ".rnex/wiki"
|
|
16
17
|
lint_trigger: "manual"
|
|
17
18
|
notify_on_changes: true
|
|
19
|
+
ingest_member_readmes: true
|
|
18
20
|
|
|
19
21
|
rules:
|
|
20
22
|
- rules/behavioral.md: .rnex/plugins/karpathy-llm/rules/behavioral.md
|
|
@@ -45,3 +45,7 @@ In a Repo Nexus workspace, independent repositories are organized into `./repos/
|
|
|
45
45
|
3. **Context Economy:**
|
|
46
46
|
- Do not redundantly read entire files or directory trees when targeted symbol lookups or line ranges suffice.
|
|
47
47
|
- Rely on active workspace context, indexing, and compiled documentation rather than re-scanning raw files repeatedly.
|
|
48
|
+
|
|
49
|
+
4. **Read-Only Intake & Source Directories:**
|
|
50
|
+
- `raw_dir` (`./docs`) and `./repos/` are strictly read-only inputs during wiki operations. Never create, copy, or modify files inside `./docs`; write generated output exclusively inside `wiki_dir` (`.rnex/wiki/`).
|
|
51
|
+
|
|
@@ -10,13 +10,17 @@ Use this skill when ingesting new reference materials, architecture documentatio
|
|
|
10
10
|
|
|
11
11
|
## Ingestion Protocol
|
|
12
12
|
|
|
13
|
-
1. **Resolve Configuration &
|
|
13
|
+
1. **Resolve Configuration & Direct Source Paths:**
|
|
14
14
|
- 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`.
|
|
15
|
-
-
|
|
16
|
-
|
|
15
|
+
- Direct input scope explicitly reads:
|
|
16
|
+
1. All files in `raw_dir` (`./docs`) (read-only).
|
|
17
|
+
2. `./repos/<name>/README.md` for every enabled member repository in `rnex.yaml` / `.local.rnex.yaml` (read-only).
|
|
18
|
+
- `raw_dir` (`./docs`) and `./repos/` are strictly read-only inputs during wiki operations. Never create, copy, or modify files inside `./docs`; write generated output exclusively inside `wiki_dir` (`.rnex/wiki/`).
|
|
19
|
+
- Scan direct source paths for source materials not yet recorded in `<wiki_dir>/_log.md`.
|
|
20
|
+
- All source material is read directly in-place without staging copies. Never write directly to `<wiki_dir>/` without ingesting.
|
|
17
21
|
|
|
18
22
|
2. **Read & Clarify:**
|
|
19
|
-
- Read each source document thoroughly.
|
|
23
|
+
- Read each source document thoroughly in-place.
|
|
20
24
|
- If scope, domain boundaries, or terminology are ambiguous, ask one round of clarifying questions before decomposing.
|
|
21
25
|
|
|
22
26
|
3. **Atomic Decomposition:**
|
|
@@ -31,7 +35,7 @@ Use this skill when ingesting new reference materials, architecture documentatio
|
|
|
31
35
|
title: ""
|
|
32
36
|
tags: []
|
|
33
37
|
last_updated: YYYY-MM-DD
|
|
34
|
-
sources: [] # <raw_dir>/
|
|
38
|
+
sources: [] # direct source files (<raw_dir>/... or repos/<name>/README.md) this page was derived from
|
|
35
39
|
related: [] # thematically related wiki pages
|
|
36
40
|
extends: [] # pages this one builds upon or specialises
|
|
37
41
|
contradicts: [] # pages with conflicting information
|
|
@@ -56,4 +60,4 @@ Use this skill when ingesting new reference materials, architecture documentatio
|
|
|
56
60
|
- Maintain the strict ~500-word ceiling. Condense or prune older focus items.
|
|
57
61
|
|
|
58
62
|
8. **Append Operation Log:**
|
|
59
|
-
- Append a timestamped entry to `<wiki_dir>/_log.md` detailing date,
|
|
63
|
+
- Append a timestamped entry to `<wiki_dir>/_log.md` detailing date, direct source path processed, generated atomic pages, and follow-ups.
|
|
@@ -12,7 +12,11 @@ Use this skill to perform health checks and maintenance on the curated wiki know
|
|
|
12
12
|
|
|
13
13
|
1. **Resolve Configuration & Verify Paths:**
|
|
14
14
|
- Read `rnex.yaml` (and `.local.rnex.yaml` if present) to resolve `wiki_dir` (default: `.rnex/wiki`) and `raw_dir` (default: `./docs`) under `plugins.karpathy-llm`.
|
|
15
|
-
-
|
|
15
|
+
- Direct input scope explicitly reads:
|
|
16
|
+
1. All files in `raw_dir` (`./docs`) (read-only).
|
|
17
|
+
2. `./repos/<name>/README.md` for every enabled member repository in `rnex.yaml` / `.local.rnex.yaml` (read-only).
|
|
18
|
+
- `raw_dir` (`./docs`) and `./repos/` are strictly read-only inputs during wiki operations. Never create, copy, or modify files inside `./docs`; write generated output exclusively inside `wiki_dir` (`.rnex/wiki/`).
|
|
19
|
+
- 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>/`, `<raw_dir>/`, or `./repos/<name>/README.md`.
|
|
16
20
|
- Fix or flag broken paths.
|
|
17
21
|
|
|
18
22
|
2. **Recompute `mentioned_in` Relations:**
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
## 2. Current Focus & Recent Ingests
|
|
10
10
|
* **Active Tasks:** Wiki initialization complete.
|
|
11
|
-
* **Recent Ingests:** None yet. Deposit source documents into
|
|
11
|
+
* **Recent Ingests:** None yet. Deposit source documents into `{raw_dir}/` and run `rnex-karpathy-llm-wiki-ingest`.
|
|
12
12
|
|
|
13
13
|
## 3. Key Contracts & Boundaries
|
|
14
14
|
* **Atomic Pages:** Concepts live in discrete files with frontmatter relations (`sources`, `related`, `extends`, `mentioned_in`).
|
|
15
|
-
* **Deep Knowledge:** For detailed RFCs, data contracts, and secondary concepts, consult
|
|
15
|
+
* **Deep Knowledge:** For detailed RFCs, data contracts, and secondary concepts, consult `{wiki_dir}/index.md` on demand.
|
|
@@ -29,4 +29,4 @@ Master navigation index for the Karpathy LLM Wiki. Agents query this index on de
|
|
|
29
29
|
* *(Key contributors, teams, organizations, and stakeholders)*
|
|
30
30
|
|
|
31
31
|
## Sources & Raw References
|
|
32
|
-
* *(Catalog of ingested source materials from
|
|
32
|
+
* *(Catalog of ingested source materials from `{raw_dir}/`)*
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
### ADR-001: Independent Git Repositories over Monorepo
|
|
38
38
|
* **Date:** YYYY-MM-DD
|
|
39
39
|
* **Decision:** Keep repositories completely independent without Git submodules. Orchestrate via Repo Nexus Virtual Meta-Repo.
|
|
40
|
-
* **Consequences:** Autonomous CI/CD per repo; AI assistants maintain shared context via `AGENTS.md` and `
|
|
40
|
+
* **Consequences:** Autonomous CI/CD per repo; AI assistants maintain shared context via `AGENTS.md` and `behavioral.md`.
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
title: "Concept or Entity Name"
|
|
3
3
|
tags: []
|
|
4
4
|
last_updated: YYYY-MM-DD
|
|
5
|
-
# Typed relation fields — paths relative to
|
|
6
|
-
sources: [] #
|
|
5
|
+
# Typed relation fields — paths relative to <wiki_dir>/ (or workspace root for raw sources)
|
|
6
|
+
sources: [] # <raw_dir>/ files this page was derived from
|
|
7
7
|
related: [] # thematically related wiki pages
|
|
8
8
|
extends: [] # pages this one builds upon or specialises
|
|
9
9
|
contradicts: [] # pages with conflicting information
|
|
@@ -16,7 +16,7 @@ mentioned_in: [] # pages that link to this one (maintained by lint)
|
|
|
16
16
|
A concise, 1-2 paragraph summary of the concept, entity, architecture decision, or contract.
|
|
17
17
|
|
|
18
18
|
## Key Facts & Insights
|
|
19
|
-
* **Core Insight:** Grounded directly in source material from
|
|
19
|
+
* **Core Insight:** Grounded directly in source material from `<raw_dir>/`.
|
|
20
20
|
* **Scope & Boundaries:** Context of applicability and interfaces with other components.
|
|
21
21
|
|
|
22
22
|
## Contextual Links
|