repo-nexus 0.4.2 → 0.4.3

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 CHANGED
@@ -213,7 +213,7 @@ rnex plugin disable karpathy-llm
213
213
 
214
214
  ### Built-in Plugin: `karpathy-llm`
215
215
  The `karpathy-llm` plugin packages Andrej Karpathy's verified LLM agent design patterns, context engineering principles, and the autonomous **Karpathy LLM Wiki** architecture:
216
- * **The 4 Cardinal Agent Rules** (`.rnex/plugins/karpathy-llm/rules/KARPATHY_RULES.md`):
216
+ * **The 4 Cardinal Agent Rules** (`.rnex/plugins/karpathy-llm/rules/behavioral.md`):
217
217
  1. *Think Before Coding:* Formulate explicit assumptions, boundary checks, and trade-offs before writing code.
218
218
  2. *Simplicity First:* Minimal abstractions, readable implementations, zero speculative boilerplate.
219
219
  3. *Surgical Changes:* Minimal blast radius, preserved comments/docstrings, and tight diffs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-nexus",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
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",
@@ -10,16 +10,16 @@ Reference specification: [setup-karpathy-wiki.md](https://github.com/nu-nenoi/ai
10
10
 
11
11
  ## What It Provides
12
12
 
13
- ### 1. The 4 Cardinal Principles for Coding Agents (`rules/KARPATHY_RULES.md`)
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
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
- ### 3. Complete Karpathy LLM Wiki Architecture
22
+ ### 3. Complete Karpathy LLM Wiki Architecture (`instructions/wiki-architecture.md`)
23
23
  * **`/raw/` Intake Directory:** Append-only directory where unmodified source material (articles, transcripts, docs, meeting notes) is deposited. Includes `.gitkeep`.
24
24
  * **`/wiki/` Curated Knowledge Base:** Interlinked atomic markdown pages, each with typed frontmatter relations (`sources`, `related`, `extends`, `contradicts`, `mentioned_in`).
25
25
  * **`/wiki/index.md` Navigation Index:** Master categorized catalog organizing atomic concepts, architecture decisions, and cross-project knowledge.
@@ -37,7 +37,7 @@ Reference specification: [setup-karpathy-wiki.md](https://github.com/nu-nenoi/ai
37
37
  When an AI agent or developer sets up the Karpathy LLM Wiki in a repository or workspace, consult the Step 0 configuration questions:
38
38
 
39
39
  1. **[Q1] Which AI agent instruction file should the wiki rules be written to?**
40
- - In a **Repo Nexus workspace**: Instructions are maintained in separate instructions files (`.rnex/instructions/karpathy-llm.md` and `.rnex/rules/KARPATHY_RULES.md`). Agents read `rnex.yaml` to detect enabled plugins and read their dedicated instructions files automatically.
40
+ - In a **Repo Nexus workspace**: Instructions are scoped under `.rnex/plugins/karpathy-llm/` (`rules/behavioral.md` and `instructions/wiki-architecture.md`). Agents read `rnex.yaml` to detect enabled plugins and route context automatically.
41
41
  - In a **standalone setup** (outside Repo Nexus):
42
42
  - `AGENTS.md` (universal, works across most harnesses)
43
43
  - `CLAUDE.md` (Claude Code / Anthropic)
@@ -82,9 +82,9 @@ my-workspace/
82
82
  │ └── plugins/
83
83
  │ └── karpathy-llm/
84
84
  │ ├── instructions/
85
- │ │ └── karpathy-llm.md # Dedicated plugin instructions
85
+ │ │ └── wiki-architecture.md# LLM Wiki architecture & relation schema
86
86
  │ ├── rules/
87
- │ │ └── KARPATHY_RULES.md# Cardinal principles & wiki rules
87
+ │ │ └── behavioral.md # Cardinal principles & context engineering
88
88
  │ ├── workflows/
89
89
  │ │ ├── wiki-ingest.md # 8-step decomposition & ingestion workflow
90
90
  │ │ └── wiki-lint.md # 10-step graph validation & maintenance workflow
@@ -107,7 +107,7 @@ rnex plugin enable karpathy-llm
107
107
  This command:
108
108
  1. Adds `karpathy-llm` to `plugins:` in `rnex.yaml`.
109
109
  2. Copies initial templates (`wiki/index.md`, `wiki/_log.md`, `wiki/hot.md`, `raw/.gitkeep`, `.rnex/templates/wiki-page.template.md`, `.rnex/templates/LLM_WIKI.sample.md`).
110
- 3. Links `KARPATHY_RULES.md` and workflows into `.rnex/rules/` and `.rnex/workflows/`.
110
+ 3. Scopes `rules/`, `instructions/`, and `workflows/` into `.rnex/plugins/karpathy-llm/`.
111
111
  4. Syncs scope links and AI context files across all registered member repositories via `rnex fix`.
112
112
 
113
113
  ### Option 2: Declarative in `rnex.yaml`
@@ -0,0 +1,43 @@
1
+ # Karpathy LLM Wiki Knowledge Architecture
2
+
3
+ > "A persistent, compounding knowledge base optimized for AI agents." — Andrej Karpathy
4
+
5
+ This instruction document defines the operational rules, intake lifecycle, and typed relation schema for the Karpathy LLM Wiki (`/wiki/` and `/raw/` directories).
6
+
7
+ ---
8
+
9
+ ## 1. Operating Rules
10
+
11
+ When working in a workspace with an active Karpathy LLM Wiki:
12
+
13
+ - **Intake**: All source material (articles, transcripts, docs, notes) goes to `/raw/` unmodified. Never write directly to `/wiki/` without ingesting.
14
+ - **Orientation**: Before answering domain questions, read `/wiki/index.md` to find relevant pages, then read only those pages. If `hot.md` exists, read it first as a quick-orient step.
15
+ - **Ingestion**: When files appear in `/raw/`, run the `wiki-ingest` workflow (`.rnex/plugins/karpathy-llm/workflows/wiki-ingest.md`). One source document typically produces many atomic pages (commonly 5–25 pages) — do not collapse a source into a single file.
16
+ - **Maintenance**: Run the `wiki-lint` workflow (`.rnex/plugins/karpathy-llm/workflows/wiki-lint.md`) to validate paths, update `mentioned_in`, and preserve graph integrity.
17
+
18
+ ---
19
+
20
+ ## 2. Typed Frontmatter Relation Schema
21
+
22
+ Every page in `/wiki/` must maintain typed frontmatter relations:
23
+
24
+ ```yaml
25
+ ---
26
+ title: ""
27
+ tags: []
28
+ last_updated: YYYY-MM-DD
29
+ # Typed relation fields — paths relative to /wiki/
30
+ sources: [] # /raw/ files this page was derived from
31
+ related: [] # thematically related wiki pages
32
+ extends: [] # pages this one builds upon or specialises
33
+ contradicts: [] # pages with conflicting information
34
+ mentioned_in: [] # pages that link to this one (maintained by lint)
35
+ ---
36
+ ```
37
+
38
+ **Body Structure:**
39
+ - Concise summary of the concept.
40
+ - Key facts, definitions, or insights.
41
+ - Inline standard Markdown links (`[Label](./path.md)`) where contextually useful in prose.
42
+
43
+ The relation graph lives in frontmatter, not in prose links. Agents traverse the graph by reading frontmatter fields, not by scanning body text.
@@ -1,14 +1,14 @@
1
1
  name: karpathy-llm
2
- version: 0.4.0
2
+ version: 0.4.1
3
3
  description: Andrej Karpathy's agent behavioral principles, context engineering guidelines, and autonomous LLM Wiki knowledge architecture
4
4
  author: nu-nenoi
5
5
  homepage: https://github.com/nu-nenoi/repo-nexus
6
6
  rules:
7
- - rules/KARPATHY_RULES.md: .rnex/plugins/karpathy-llm/rules/KARPATHY_RULES.md
7
+ - rules/behavioral.md: .rnex/plugins/karpathy-llm/rules/behavioral.md
8
8
  - workflows/wiki-ingest.md: .rnex/plugins/karpathy-llm/workflows/wiki-ingest.md
9
9
  - workflows/wiki-lint.md: .rnex/plugins/karpathy-llm/workflows/wiki-lint.md
10
10
  instructions:
11
- - instructions/karpathy-llm.md: .rnex/plugins/karpathy-llm/instructions/karpathy-llm.md
11
+ - instructions/wiki-architecture.md: .rnex/plugins/karpathy-llm/instructions/wiki-architecture.md
12
12
  templates:
13
13
  - templates/index.md: wiki/index.md
14
14
  - templates/_log.md: wiki/_log.md
@@ -1,8 +1,8 @@
1
- # Karpathy LLM Agent Guidelines & Behavioral Principles
1
+ # Karpathy Coding Agent Behavioral Principles
2
2
 
3
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
4
 
5
- These guidelines provide standing operational instructions for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf) working within multi-repository environments and managing Karpathy LLM Wiki knowledge bases.
5
+ These rules define standing behavioral principles for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf) working in this workspace.
6
6
 
7
7
  ---
8
8
 
@@ -45,38 +45,3 @@ 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
- ---
50
-
51
- ## 3. Karpathy Wiki Rules
52
-
53
- When working in a repository with an active Karpathy LLM Wiki (`/wiki/` and `/raw/` directories):
54
-
55
- - **Intake**: All source material (articles, transcripts, docs, notes) goes to `/raw/` unmodified. Never write directly to `/wiki/` without ingesting.
56
- - **Orientation**: Before answering domain questions, read `/wiki/index.md` to find relevant pages, then read only those pages. If `hot.md` exists, read it first as a quick-orient step.
57
- - **Ingestion**: When files appear in `/raw/`, run the `wiki-ingest` workflow (`.rnex/workflows/wiki-ingest.md`). One source document typically produces many atomic pages (commonly 5–25 pages) — do not collapse a source into a single file.
58
- - **Maintenance**: Run the `wiki-lint` workflow (`.rnex/workflows/wiki-lint.md`) to validate paths, update `mentioned_in`, and preserve graph integrity.
59
-
60
- ---
61
-
62
- ## 4. Typed Frontmatter Relation Schema
63
-
64
- Every page in `/wiki/` must maintain typed frontmatter relations:
65
-
66
- ```yaml
67
- ---
68
- title: ""
69
- tags: []
70
- last_updated: YYYY-MM-DD
71
- # Typed relation fields — paths relative to /wiki/
72
- sources: [] # /raw/ files this page was derived from
73
- related: [] # thematically related wiki pages
74
- extends: [] # pages this one builds upon or specialises
75
- contradicts: [] # pages with conflicting information
76
- mentioned_in: [] # pages that link to this one (maintained by lint)
77
- ---
78
- ```
79
-
80
- **Body:** concise summary, key facts or insights, and inline standard Markdown links (`[Label](./path.md)`) where contextually useful in prose.
81
-
82
- The relation graph lives in frontmatter, not in prose links. Agents traverse the graph by reading frontmatter fields, not by scanning body text.
@@ -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 `KARPATHY_RULES.md`.
40
+ * **Consequences:** Autonomous CI/CD per repo; AI assistants maintain shared context via `AGENTS.md` and `behavioral.md`.
41
41
 
42
42
  ---
43
43
 
@@ -17,7 +17,7 @@ Do not hard-code any specific AI tool or harness into the wiki structure itself.
17
17
  Ask ALL of the following questions and wait for answers:
18
18
 
19
19
  [Q1] Which AI agent instruction file should the wiki rules be written to?
20
- - In a Repo Nexus workspace: plugin instructions are maintained in separate instructions files (`.rnex/instructions/karpathy-llm.md` and `.rnex/rules/KARPATHY_RULES.md`). Agents read `rnex.yaml` to detect enabled plugins and read their separate instructions files.
20
+ - In a Repo Nexus workspace: plugin instructions are maintained under `.rnex/plugins/karpathy-llm/` (`rules/behavioral.md` and `instructions/wiki-architecture.md`). Agents read `rnex.yaml` to detect enabled plugins and read their scoped files.
21
21
  - In a standalone setup (outside Repo Nexus):
22
22
  - `AGENTS.md` (universal, works across most harnesses)
23
23
  - `CLAUDE.md` (Claude Code / Anthropic)
@@ -1,82 +0,0 @@
1
- # Karpathy LLM Agent Guidelines & 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 guidelines provide standing operational instructions for AI coding assistants (Cursor, Claude Code, GitHub Copilot, Antigravity, Windsurf) working within multi-repository environments and managing Karpathy LLM Wiki knowledge bases.
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 independent 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.
48
-
49
- ---
50
-
51
- ## 3. Karpathy Wiki Rules
52
-
53
- When working in a repository with an active Karpathy LLM Wiki (`/wiki/` and `/raw/` directories):
54
-
55
- - **Intake**: All source material (articles, transcripts, docs, notes) goes to `/raw/` unmodified. Never write directly to `/wiki/` without ingesting.
56
- - **Orientation**: Before answering domain questions, read `/wiki/index.md` to find relevant pages, then read only those pages. If `hot.md` exists, read it first as a quick-orient step.
57
- - **Ingestion**: When files appear in `/raw/`, run the `wiki-ingest` workflow (`.rnex/workflows/wiki-ingest.md`). One source document typically produces many atomic pages (commonly 5–25 pages) — do not collapse a source into a single file.
58
- - **Maintenance**: Run the `wiki-lint` workflow (`.rnex/workflows/wiki-lint.md`) to validate paths, update `mentioned_in`, and preserve graph integrity.
59
-
60
- ---
61
-
62
- ## 4. Typed Frontmatter Relation Schema
63
-
64
- Every page in `/wiki/` must maintain typed frontmatter relations:
65
-
66
- ```yaml
67
- ---
68
- title: ""
69
- tags: []
70
- last_updated: YYYY-MM-DD
71
- # Typed relation fields — paths relative to /wiki/
72
- sources: [] # /raw/ files this page was derived from
73
- related: [] # thematically related wiki pages
74
- extends: [] # pages this one builds upon or specialises
75
- contradicts: [] # pages with conflicting information
76
- mentioned_in: [] # pages that link to this one (maintained by lint)
77
- ---
78
- ```
79
-
80
- **Body:** concise summary, key facts or insights, and inline standard Markdown links (`[Label](./path.md)`) where contextually useful in prose.
81
-
82
- The relation graph lives in frontmatter, not in prose links. Agents traverse the graph by reading frontmatter fields, not by scanning body text.