/lore:lore-evalfrom lore
Evaluates whether lore-guard catches past mistakes by replaying recorded violations against a fresh guard pass. Scores detection rate and surfaces misses for maintenance.
Ships in lore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read ${CLAUDE_PLUGIN_ROOT}/reference/lore-spec.md first — the entry-meta format and the feedback-log format come from there.
lore-check asks whether lore looks healthy. This skill asks whether it works: if someone made the same mistake again, would lore-guard catch it? Each pitfall or business rule was recorded because a change once broke it, so that change is a ready-made test question. Replaying those questions gives a score you can compare before and after rewording an entry, moving it to another area, or changing the guard itself — without the score, you can't tell an improvement from a regression.
On an explicit ask ("does our lore actually catch anything?", "run the lore eval"), after a batch of lore-maintain rewrites, or when lore-check shows entries that are surfaced but never heeded. Only meaningful when docs/lore/ holds at least ~10 active entries in pitfalls.md / business-rules.md — below that, say the base is too small for the score to mean anything and stop.
Everything lives in docs/lore/.lore-eval/:
cases.jsonl — the test questions, one JSON object per line. Commit it: the cases are reusable project knowledge.results.jsonl — one line per run with the scores. Gitignored by default, like the feedback log.Case shape:
{"id": "payments-rounding-01", "entry": "payments/pitfalls.md#contractCalc rounding", "kind": "violation", "source": "commit", "diff_ref": "a1b2c3d^..a1b2c3d", "note": "the commit that introduced the rounding bug"}
kind: violation (the guard should flag entry) or clean (a change in the same code that respects the entry; the guard should flag nothing).source: commit (taken from git history) or synthetic (written for the eval).diff_ref for commit cases; for synthetic cases store the diff text in diff instead.Collect or refresh cases. For each active entry without a case yet:
code: paths around its updated: date for the commit that fixed the problem; the change that introduced it, or the fix reversed, is the violation case. Real cases beat synthetic ones because they carry the shape mistakes actually take.clean case for roughly every three violation cases, so the score also measures false alarms.cases.jsonl. Skip entries with code: — that can't be expressed as a diff, and say how many were skipped.Run each case blind. For every case, dispatch a fresh subagent with a clean context that runs the lore-guard procedure on that diff. Give it the diff and the repo path only, never the expected entry. Run cases in parallel when the environment allows.
Score. For each case record one outcome:
caught — a violation case where the guard flagged the expected entry.missed-retrieval — the guard never looked at the expected entry. Usually a wrong or missing code: link, or the entry sits in an area the changed files don't map to.missed-judgement — the guard read the entry but judged the diff compliant. Usually the body is vague or lacks an observable success criterion.false-alarm — a clean case flagged, or a violation case flagged with an unrelated entry. Record which entry fired.Report. Give the catch rate (caught / violation cases) and the false-alarm count as separate numbers; don't merge them into one score. List each miss with its outcome type and the likely fix. Compare against the previous line in results.jsonl when one exists, and name every case that flipped between runs — a flip says more than the totals.
Record the run. Append one line to results.jsonl:
{"ts": "2026-10-19", "cases": 24, "caught": 17, "missed_retrieval": 3, "missed_judgement": 2, "false_alarm": 1, "flipped": ["payments-rounding-01"], "note": "after rewording billing pitfalls"}
Make sure docs/lore/.gitignore ignores .lore-eval/results.jsonl. Follow the lore-spec date rule for ts.
Hand off. missed-retrieval → fix code: links or area placement via lore-maintain. missed-judgement → reword the entry via lore-maintain, adding the observable "done right" state from lore-spec. false-alarm → narrow the entry that fired. After the fixes land, run the eval again: keep a change only if the catch rate rises without new false alarms.
Read-only toward lore and code: this skill never edits an entry or the code under test. Its only writes are cases.jsonl (after the user confirms new cases) and results.jsonl. Synthetic diffs are evaluated as text and never applied to the working tree. Never tune an entry to pass one specific case — that overfits the eval; a reword has to read as a better rule for a human first.
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/lore-captureUse when the conversation surfaces knowledge that code, types, tests, or git history can't reveal — the user explains a business rule or a spec, shares a gotcha, gives the why behind a decision, says "that's intentional, not a bug", or you hit a pitfall or dig up a non-obvious root cause while debugging. Record it into docs/lore/ before the session ends and it evaporates./lore-checkUse when asked whether the project's lore is healthy or still helping, or when the 30-day heartbeat suggests a re-check — audits coverage, link health, freshness, entry quality, adoption, and language health, read-only, then hands fixes off to lore-maintain, lore-capture, and lore-ul./lore-consultUse when about to plan a feature, fix a bug, or touch unfamiliar code in a repo that has a docs/lore/ folder, before writing any implementation — surfaces the business rules, pitfalls, glossary terms, and API map relevant to the task, and flags entries that look stale.npx claudepluginhub mukiwu/muki-ai-plugins --plugin loreOther plugins' skills for the same job