Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Commit 0b83150

Browse files
mcp-tool-shopclaude
andcommitted
docs: audit handbook + README, add beginner section
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ac922ea commit 0b83150

5 files changed

Lines changed: 39 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ The core matching, merging, and validation modules are pure functions with no si
263263
| Threat | Mitigation |
264264
|--------|------------|
265265
| Malformed frontmatter input | `parseFrontmatter()` returns `null` on invalid input — no exceptions, no eval |
266-
| Prototype pollution | Hand-rolled parser uses plain object literals, no `JSON.parse` of untrusted nested structures |
266+
| Prototype pollution | Hand-rolled parser uses plain object literals, no recursive merge of untrusted input |
267267
| Index with bad data | `validateIndex()` catches structural issues before they propagate |
268268
| Regex DoS | No user-supplied regex — patterns are matched as plain string lookups |
269269

site/src/content/docs/handbook/beginners.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ console.log("On-demand:", plan.onDemand.map(m => m.entry.id));
116116
console.log("Token cost:", plan.preloadTokens, "preload +", plan.onDemandTokens, "on-demand");
117117
```
118118

119+
`planLoad` calls the resolver behind the scenes, which looks for index files at four canonical paths: `~/.ai-loadout/index.json` (global), `$AI_LOADOUT_ORG` (org), `<cwd>/.claude/loadout/index.json` (project), and `$AI_LOADOUT_SESSION` (session). Missing layers are normal -- most setups only use the project layer. If no index is found anywhere, the plan returns empty arrays.
120+
119121
### 5. Validate your index
120122

121123
```bash
@@ -124,6 +126,38 @@ ai-loadout validate .claude/loadout/index.json
124126

125127
This checks for structural issues: missing fields, duplicate IDs, non-kebab-case IDs, domain entries without keywords, summaries over 120 characters, and negative budget values.
126128

129+
Add `--json` for machine-readable output:
130+
131+
```bash
132+
ai-loadout validate .claude/loadout/index.json --json
133+
```
134+
135+
You can also run `ai-loadout --help` to see all available commands, or `ai-loadout --version` to confirm which version is installed.
136+
137+
### 6. Write a payload file with frontmatter
138+
139+
Create the file referenced by your entry's `path` field. Include frontmatter so that the routing metadata lives with the content:
140+
141+
```markdown
142+
---
143+
id: testing-rules
144+
keywords: [test, jest, vitest, coverage]
145+
patterns: [test_suite]
146+
priority: domain
147+
triggers:
148+
task: true
149+
plan: true
150+
edit: false
151+
---
152+
153+
# Testing Conventions
154+
155+
All code must have tests. Minimum coverage: 80%.
156+
Use vitest for unit tests...
157+
```
158+
159+
The frontmatter is the source of truth for routing. The index is derived from it. If they ever drift, `ai-loadout validate` catches the mismatch.
160+
127161
## Common Mistakes
128162

129163
**Putting everything at `core` priority.** Core entries are always loaded regardless of the task. If you make everything core, you lose the benefit of on-demand routing. Reserve core for truly non-negotiable rules (3-5 entries max).

site/src/content/docs/handbook/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The default is `{ task: true, plan: true, edit: false }`. These are advisory —
4545

4646
## Keyword Matching
4747

48-
The matcher tokenizes the task description into lowercase words (stripping non-alphanumeric characters and filtering single-character tokens), then compares against each entry's `keywords` array:
48+
The matcher tokenizes the task description into lowercase words (replacing non-alphanumeric characters with spaces, splitting on whitespace, and filtering out single-character tokens), then compares against each entry's `keywords` array:
4949

5050
1. For each keyword, split it on spaces/hyphens and check if all words are present in the task tokens
5151
2. Calculate **overlap proportion** = matched keywords / total entry keywords

site/src/content/docs/handbook/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const plan = planLoad("fix the CI workflow");
2323
interface LoadPlan {
2424
preload: MatchResult[]; // eager entries — load immediately
2525
onDemand: MatchResult[]; // lazy entries — load when needed
26-
manual: LoadoutEntry[]; // never auto-loaded
26+
manual: LoadoutEntry[]; // manual-priority entries + unmatched domain entries
2727
provenance: Record<string, string>; // entryId → source layer
2828
budget: Budget;
2929
conflicts: MergeConflict[];
@@ -33,7 +33,7 @@ interface LoadPlan {
3333
}
3434
```
3535

36-
Resolves all layers (global → org → project → session), matches the task, and separates entries by load mode.
36+
Resolves all layers (global → org → project → session), matches the task, and separates entries by load mode. The `manual` array includes both entries with `manual` priority and any domain entries that did not match the current task (score below the 0.1 threshold).
3737

3838
---
3939

site/src/site-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const config: SiteConfig = {
9191
kind: 'api',
9292
id: 'api',
9393
title: 'API Reference',
94-
subtitle: 'Six exports. That\'s it.',
94+
subtitle: 'Clean exports for matching, resolving, and observability.',
9595
apis: [
9696
{
9797
name: 'matchLoadout(task, index)',

0 commit comments

Comments
 (0)