|
| 1 | +<p align="center"><img src="logo.png" alt="loadout-os" width="220"></p> |
| 2 | + |
1 | 3 | # loadout-os |
2 | 4 |
|
3 | | -> **Prototype, 2026-06-10.** Consolidated Knowledge OS for the studio — folds `ai-loadout` (kernel) + `claude-memories` (MEMORY.md adapter) + `claude-rules` (CLAUDE.md adapter) + the runtime UserPromptSubmit pointer-injection hook into a single repo. Wired as npm workspaces (Phase 1 done — `npm install` + `npm run build`/`test`/`verify` work at root). Not yet published; no remote yet (a deliberate Phase-5 waiver — see `.claude/CLAUDE.md`). |
| 5 | +**A Knowledge OS for AI coding agents.** One CLI that routes the right context to the model on demand — instead of dumping every memory file and rule into the context window at the start of each session. |
| 6 | + |
| 7 | +Your instruction files and memory stores grow without bound. Every line costs tokens on every prompt, whether or not it matters to the task at hand. loadout-os keeps a tiny dispatch index always loaded and loads the heavy payloads — memory topics, rule files — only when the task keywords match. Think of it like a game loadout: equip the agent with exactly the knowledge it needs for the mission ahead. |
| 8 | + |
| 9 | +## What's inside |
| 10 | + |
| 11 | +loadout-os unifies four surfaces under one `loadout-os` binary: |
4 | 12 |
|
5 | | -## Pickers start here |
| 13 | +| Surface | What it does | |
| 14 | +|---|---| |
| 15 | +| **Kernel** (knowledge router) | Deterministic keyword/pattern matcher, hierarchical layered resolver (global → org → project → session), and the agent runtime contract. Core entries always load; domain entries load on match; manual entries load on explicit lookup. | |
| 16 | +| **Memories adapter** | Turns a `MEMORY.md` store into a machine-readable dispatch table and lints it (missing files, orphans, duplicates, over-long entries). | |
| 17 | +| **Rules adapter** | Splits a bloated `CLAUDE.md` into a lean always-loaded index plus on-demand rule files, and validates frontmatter against the index. | |
| 18 | +| **Runtime hook** | A `UserPromptSubmit` hook that injects ≤5 pointer lines (≤200 tokens) to the entries relevant to your prompt. Fail-silent: every error path exits 0, so a broken hook can never block a prompt. | |
| 19 | + |
| 20 | +Plus three rituals that keep the system honest: **`refresh`** (regenerate → validate → publish the dispatch index, with a backup compensator), **`doctor`** (a read-only 8-check health screen), and **`report`** (usage / dead-entry / token-budget observability). |
| 21 | + |
| 22 | +## Command surface |
| 23 | + |
| 24 | +``` |
| 25 | +# Memory store adapter |
| 26 | +loadout-os memories index <MEMORY.md> [--lazy] [--json] |
| 27 | +loadout-os memories validate <MEMORY.md> [--json] |
| 28 | +loadout-os memories stats <MEMORY.md> [--json] |
| 29 | +loadout-os memories health [path] [--json] |
6 | 30 |
|
7 | | -- Read [`.claude/CLAUDE.md`](.claude/CLAUDE.md) — project instructions and source-of-truth rules |
8 | | -- Read [`ROADMAP.md`](ROADMAP.md) — five-phase consolidation plan, ~1–2 months of session work |
9 | | -- Then dive in |
| 31 | +# Instruction-file adapter |
| 32 | +loadout-os rules analyze <CLAUDE.md> [--rules-dir <dir>] [--json] |
| 33 | +loadout-os rules validate [--rules-dir <dir>] [--lazy] [--repo-root <dir>] [--json] |
| 34 | +loadout-os rules stats <CLAUDE.md> [--rules-dir <dir>] [--json] |
| 35 | +loadout-os rules split [CLAUDE.md] [--yes] [--dry-run] |
10 | 36 |
|
11 | | -## Layout |
| 37 | +# Knowledge router (flat kernel verbs) |
| 38 | +loadout-os resolve # resolve layered loadouts |
| 39 | +loadout-os explain <entry-id> # how an entry resolved across layers |
| 40 | +loadout-os usage <jsonl> # usage summary from the event log |
| 41 | +loadout-os dead <index> <jsonl> # entries never loaded |
| 42 | +loadout-os overlaps <index> # keyword routing ambiguities |
| 43 | +loadout-os budget <index> [jsonl] # token budget breakdown |
| 44 | +loadout-os validate <index> # validate index STRUCTURE (kernel) |
12 | 45 |
|
| 46 | +# Rituals + hook |
| 47 | +loadout-os doctor [--json] # read-only health screen |
| 48 | +loadout-os report [--index <p>] [--jsonl <p>] # observability over usage.jsonl |
| 49 | +loadout-os hook test [--prompt "<text>"] # drive the runtime hook on a sample prompt |
| 50 | +loadout-os refresh [--store <d>] [--dest <p>] [--dry-run] # index → validate → publish |
13 | 51 | ``` |
14 | | -loadout-os/ |
15 | | -├── packages/ |
16 | | -│ ├── kernel/ # was @mcptoolshop/ai-loadout (npm 1.4.3 — only one published) |
17 | | -│ ├── memories/ # was @mcptoolshop/claude-memories (unpublished) |
18 | | -│ └── rules/ # was @mcptoolshop/claude-rules (unpublished) |
19 | | -├── apps/ |
20 | | -│ └── hook/ # workspace member; mirrors ~/.claude/loadout-hook/ (the LIVE one) |
21 | | -├── .claude/ |
22 | | -│ └── CLAUDE.md |
23 | | -├── ROADMAP.md |
24 | | -└── README.md |
| 52 | + |
| 53 | +> **Name collision, resolved by namespacing.** The flat `validate <index>` is the kernel's index-structure validator. The store and rules linters are namespaced — `memories validate <MEMORY.md>` and `rules validate` — so all three coexist. Run `loadout-os <command> --help` for per-command synopsis, arguments, and exit codes. |
| 54 | +
|
| 55 | +## Install |
| 56 | + |
| 57 | +```bash |
| 58 | +npm install -g @mcptoolshop/loadout-os # the loadout-os CLI |
| 59 | +loadout-os --help # the full command tree |
| 60 | +loadout-os doctor # confirm the system is healthy |
25 | 61 | ``` |
26 | 62 |
|
| 63 | +The kernel is also importable as a library — `@mcptoolshop/ai-loadout` exposes `planLoad`, `matchLoadout`, `resolveLoadout`, `recordLoad`, and the dispatch-table types. |
| 64 | + |
| 65 | +## Documentation |
| 66 | + |
| 67 | +- **[Handbook](https://mcp-tool-shop-org.github.io/loadout-os/handbook/)** — overview, install, architecture, command reference, rituals, and migration from the legacy packages. |
| 68 | +- **[Repository](https://github.com/mcp-tool-shop-org/loadout-os)** — source, roadmap, and issues. |
| 69 | + |
27 | 70 | ## Why consolidate |
28 | 71 |
|
29 | | -Decompose-by-secrets (Parnas 1972) was the clean answer for a team of N humans. The studio runs 1 human + LLM crew — multi-repo work fragments Claude context across sessions and lets unpublished adapters rot. One named umbrella repo serves the operator. Full reasoning: `memory/Feedback/feedback_consolidate_when_cant_juggle_repos.md` in the canonical memory store. |
| 72 | +Decompose-by-secrets (Parnas 1972) was the clean answer for a team of N humans. For a solo operator plus an LLM crew it is operationally broken: multi-repo work fragments the agent's context across sessions, unpublished adapters rot (only the kernel ever shipped), and advancement serializes across repos. One named umbrella repo with one CLI serves the operator. Full reasoning lives in the canonical memory store (`feedback_consolidate_when_cant_juggle_repos.md`). |
| 73 | + |
| 74 | +## Status |
| 75 | + |
| 76 | +Consolidation in progress. loadout-os folds together the kernel and two adapters that previously lived as separate packages, plus the live runtime hook. The published upstream today is **`@mcptoolshop/ai-loadout`** (the kernel); the unified `loadout-os` package ships from this repo. The three legacy bins keep working until their planned retirement. |
30 | 77 |
|
31 | 78 | ## License |
32 | 79 |
|
33 | | -MIT (matches all three upstream sources). |
| 80 | +MIT — matches all upstream sources. |
0 commit comments