@mcptoolshop/loadout-os
v1.0.2
Published
Unified Knowledge OS CLI — wraps ai-loadout (kernel) + claude-memories + claude-rules and absorbs the operational rituals (doctor, report, refresh) into one loadout-os binary.
Readme
@mcptoolshop/loadout-os
The unified Knowledge OS CLI. One loadout-os binary that wraps the three
library packages of this workspace and absorbs the operational rituals that used
to be a multi-step manual sequence.
It wraps:
- kernel —
@mcptoolshop/ai-loadout— the knowledge router (resolve / match / budget / usage analysis) - memories —
@mcptoolshop/claude-memories— MEMORY.md → dispatch index - rules —
@mcptoolshop/claude-rules— CLAUDE.md section analysis + rule-file linting - the runtime hook —
apps/hook/loadout-hook.mjs— theUserPromptSubmitpointer-injector
Every wrapped surface calls the library export directly (one process, one arg
parser, one structured-error shape) — loadout-os does not shell out to the
legacy ai-loadout / claude-memories / claude-rules bins.
Command tree
Namespaces (wrapped library surfaces)
loadout-os memories index <MEMORY.md> [--lazy] [--json]
loadout-os memories validate <MEMORY.md> [--json]
loadout-os memories stats <MEMORY.md> [--json]
loadout-os memories health [path] [--json]
loadout-os rules analyze <CLAUDE.md> [--rules-dir <dir>] [--json]
loadout-os rules validate [--rules-dir <dir>] [--lazy] [--repo-root <dir>] [--json]
loadout-os rules stats <CLAUDE.md> [--rules-dir <dir>] [--json]
loadout-os rules split # interactive — wrapped via passthrough to the claude-rules binFlat verbs (knowledge router / kernel)
loadout-os resolve # resolve layered loadouts (global → org → project → session)
loadout-os explain <entry-id> # how an entry resolved across layers
loadout-os usage <jsonl> # usage summary from the event log
loadout-os dead <index> <jsonl> # entries never loaded
loadout-os overlaps <index> # keyword routing ambiguities
loadout-os budget <index> [jsonl] # token budget breakdown
loadout-os validate <index> # validate index STRUCTURE (kernel)Name collision, resolved by namespacing. The flat
validate <index>is the kernel's index-structure validator. The store/rules linters are namespaced —memories validate <MEMORY.md>andrules validate— so all three coexist.
Rituals
loadout-os doctor [--json] # read-only health screen
loadout-os report [--index <p>] [--jsonl <p>] # observability over usage.jsonl
loadout-os hook test [--prompt "<text>"] # drive the runtime hook on a sample prompt
loadout-os refresh [--store <d>] [--dest <p>] [--dry-run] # index → validate → publishdoctor— one read-only screen: storeMEMORY.mdvalidates, the global index parses + validates, the runtime hook mirror matches the repo source (drift check), no malformed resolver layers, at least one core entry, observability loop wired, hook wired insettings.json, andusage.jsonlgrowing.--jsonemits{ checks: [{ id, status, message, hint }], ok }. Exit 0 when all checks pass or warn; exit 1 on any fail. Never writes.report— composes usage summary + dead-entry detection + token budget, plus a score distribution when usage events carry ascore.--jsonfor the machine-readable shape. Exit 2 when an input is missing. Read-only.hook test— runs the realloadout-hook.mjsagainst a sample prompt in an isolated HOME so the liveusage.jsonlis never written.refresh— folds the Index Freshness Ritual into one command: regenerate the store index → validate (andon halt on any error) → rewrite relative paths to absolute + publish to~/.ai-loadout/index.json. The irreversible write is guarded by a.baknamed compensator (restored on failure, undo line printed);--dry-runpreviews without writing. Exit1on validation/write failure,2on a missing store.
Build & test
npm run build # tsc
npm test # node --test dist/tests/*.test.js
npm run verify # tsc --noEmit && node --test dist/tests/*.test.jsSDK use
Importing the package is side-effect-free — the dispatcher only runs when the
file is the process entrypoint. Composable exports: dispatch, runDoctor /
buildReport / runHookTest (and their print* renderers + default*Paths
helpers).
