/memory-kit:system-auditfrom Multi-Agent Driven Development Kit
Periodic evidence-based self-audit of the entire agent system: orchestrator, docs, rules, memory, subagents, tools, infra, and delivered work. Runs seven lenses (delivery reality, knowledge drift, operational layer, layer telemetry, tools & infra, domain gaps, anti-bloat subtraction) and produces a ranked backlog of cheap-safe fixes.
Ships in Multi-Agent Driven Development Kit. 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.
Read when SKILL.md points to them; scripts run unread.
An agent system accretes. Good patterns and bad ones, dead rules nobody reads, facts restated in five places with three of them stale, tools that only ran once. This skill is the periodic sweep that keeps it evolving without inflating: it measures which layers actually fire, deletes what doesn't, and reports findings that carry evidence rather than impressions.
The one thing that makes this audit different from a checklist: every claim must be backed by
something you touched with your own hands — a file:line, a command's output, a query result.
An unverified observation is labelled hypothesis and never counted in the verdict.
standard:
quick — deterministic collector + lenses 1, 4, 7 inline, no subagents. ~10 min. Use for a routine "how are we doing", or when the user asks mid-work.standard — collector + all 7 lenses, lenses 2-6 fanned out to parallel recon subagents (model="sonnet"), synthesis + adjudication inline. The default.deep — standard + an independent architecture critique (idea-validator, model="fable") and an external-family second opinion (/memory-kit:second-opinion), + a fresh-check of external facts (pricing, model ids, deprecated APIs) via WebSearch.node_modules/, .git/, build output, or vendored code.context/audits/ (or wherever it lives).
For each of its priorities: done · partially · ignored. An audit whose last round was
ignored has one finding worth more than all the others — say so first.# from the repo being audited; pass a path as $1 to audit a different repo.
# The output goes to a path of THIS session — the session's scratchpad directory when one is listed
# (use it in place of the mktemp line), else a fresh mktemp file: a fixed /tmp name, even one carrying the
# repo and date, is overwritten by a parallel session, and the first read is then of another run.
FACTS=$(mktemp -t "system-audit-facts-$(basename "$PWD").XXXXXX")
bash "${CLAUDE_PLUGIN_ROOT}/skills/system-audit/scripts/collect.sh" "$PWD" > "$FACTS"
echo "facts: $FACTS"; head -3 "$FACTS"
Check the first three lines: the repo: line must name the repo you are auditing. If it does not, the collector ran
with the wrong argument or working directory — re-run it rather than reason over the file.
(If this skill lives somewhere else on your machine, run scripts/collect.sh from this skill's
own directory — it's read-only and never writes into the audited repo.)
For lens 4 (layer telemetry) also run the transcript profiler — it is the only source of "did this ever actually fire", and it is read-only:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/system-audit/scripts/usage.py"
For lens 5b (gates actually hold) run the gate prober — it feeds a known-bad sample through every PreToolUse hook's exact wiring and says which tools are actually guarded:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/system-audit/scripts/gates.py" "$PWD"
The profiler parses this project's session transcripts and writes knowledge/usage-frequency.md: which
files, skills and tools were deliberately used (mechanical auto-loads and multi-edit bursts are
filtered out), and which have zero reads in 30 days. No transcripts yet → it says so and exits.
The main collector gathers, cheaply and repeatably: layer inventory · doc frontmatter coverage · memory caps ·
broken path references · git activity and cold files · secret exposure (gitleaks if present, an
.env-tracked check always) · layer telemetry (per rule/skill/agent: last mention in
session transcripts and in git history) · TODO/FIXME density.
Read its output first. It is the factbase; the lenses explain and prioritise it — they don't re-derive it. Anything the script measured is a fact; anything a lens adds must earn its own evidence.
Full briefs (what each lens checks, its evidence rules, its "n/a" condition):
references/lenses.md. Read it before dispatching.
| # | Lens | The question it answers |
|---|---|---|
| 1 | Delivery reality | Does the claimed state (backlog, handoff, README) match disk / git / prod? |
| 2 | Knowledge layer | SSOT hygiene: frontmatter, drift, the same fact restated stale in N places, contradictions between SSOTs. Standard: reference/doc-governance.md. |
| 3 | Operational layer | Rules, agents, memory, the self-improvement loops (findings registry → promotion → drop): coherent and non-contradictory? Standards: reference/review-loop.md, reference/parallel-development.md. |
| 4 | Layer telemetry | Which of those layers ever actually fired? Dead rules, never-invoked skills, agents defined once and never spawned. |
| 5 | Tools & infra | Reproducibility (pinned deps, a documented run path), secrets, backup and restore, ownership of external state — and 5b: gates actually hold (every PreToolUse hook proven through its exact wiring, scripts/gates.py). |
| 6 | Domain gaps | What a professional system of this class has and this one doesn't. The domain is named by the user or inferred; the lens brief lists gap-maps per common domain. |
| 7 | Anti-bloat (subtraction) | What to DELETE: never-fired layers, duplicated facts, ceremony with no consumer, over-engineering for a scale that never came. |
Dispatch rule for standard/deep: lenses 2-6 go to recon subagents in one message so
they run concurrently; each gets the collector output path, its brief verbatim, the repo root,
and the instruction "return raw findings with file:line evidence; do not recommend architecture".
Lenses 1, 4 and 7 you run yourself — they need the whole picture and the authority to say "delete".
Model discipline: recon → sonnet; critique → opus; never pass the orchestrator model down.
An audit's only real product is trust in its findings, and that trust is exactly as strong as the weakest unverified claim in it. So subagent reports are INPUT, not record. Before anything enters the report:
file:line, re-run the command.
Proportional to stake: a claim that drives a priority gets checked 100%.file:line outranks three abstract concurrences.hypothesis + the check that would settle it. Never silently dropped, never promoted to fact.Severity vocabulary (use these exact markers — they make audits comparable across time):
| meaning | |
|---|---|
| 🔴 | broken — a load-bearing thing does not work. Evidence attached. |
| 🟠 | drifting — works, but the doc/state/fact describing it is stale or contradicted. |
| 🟡 | unverified — a claim nobody has ever tested end-to-end (loops that never ran count here). |
| ⚪ | missing — a real gap for a system of this class. |
| 🗑 | excess — delete candidate. |
Then:
what · why now · cost (min/hours) · what breaks if we skip it.
A sixth priority is not a priority — park it in the backlog.context/audits/audit-YYYY-MM-DD.md (create the dir if absent) —
template in references/report-template.md. It is the delta baseline for the next audit.projects/<name>/review-findings.md, or wherever that project's README maps it); a class on its 3rd occurrence → promote to the CHEAPEST layer
that prevents it (deterministic check > agent/spec line > lens brief > knowledge article).
Dead layers found by lens 4 → propose the drop.Run it every ~10 sessions, before a milestone, after a large refactor, when memory trips its
caps, or when the user feels the system has bloated. Between runs, quick is cheap enough to
use as a pulse check. Two audits in the same week on an unchanged repo is itself over-engineering.
hypothesis is an honest label; a confident
wrong finding costs a real fix cycle./memory-kit:session-review covers the session's diff); don't probe the running
product — that is /memory-kit:qa-sweep. This audit is about the system that produces the work.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
system-audit, self-audit, agent-health, knowledge-drift, anti-bloat, gap-analysis
npx claudepluginhub awrshift/agent-memory-kit --plugin memory-kit10 skills in this plugin
/close-sessionEnd-of-session ritual — audit today's patterns against accumulated memory, propose promotions, refresh MEMORY.md, and write the session handoff. Use when the user says "/memory-kit:close-session", "закрой сессию", "закрываем", "we're done for today", "wrap up"./code-syncReconcile the project's documents with what the code now shows, after a merge or at the end of a build: spec statuses (building → done only with a named gate, or → stale with the reason), assumed specs owed ratification, the project README map and its Last verified date. Surgical edits only. Use when the user says "/memory-kit:code-sync", "sync the docs", "sync specs with code", "синхронизируй доки с кодом", "что устарело в спеках", or right after merging an executor branch.
/documentWrite the human-facing prose about a change — PR body · changelog entry · release note · postmortem — and put it in the right file. Use when the user says "write the PR", "PR description", "PR body", "changelog", "changelog entry", "release note", "release notes", "postmortem", "write up the incident", "напиши PR", "описание PR", "чейнджлог", "релиз-ноут", "постмортем". Every draft is built ONLY from `git diff` / `git log` output this skill runs itself — never from the session's memory of what it did, never from what it intended. Writes no code, no tests, no specs; it never edits an implementation file and never edits a spec.
/memory-auditAudit MEMORY.md against the memory discipline — oversized sections, settled multi-session patterns that belong in knowledge/concepts/, session-headed chronicle blocks, restated rules, copied numbers, stale entries. Produces a move plan as a table for approval, then executes the approved moves atomically. Use when the SessionStart hook reports a tripped cap or session-headed blocks, when PreCompact blocks on an oversized cache, or when the user says "/memory-kit:memory-audit", "audit memory", "проверь память", "почисти память". Refuses only when no cap is tripped, no session block is flagged AND no settled-pattern candidate exists./qa-sweepRun a multi-lens agent QA sweep of the RUNNING product: spawn `qa` agents (one per lens — user-flow · edge-state · honesty · contract · ux-critique), collect their structured findings, integrator-verify the load-bearing ones, and land verified findings as backlog tickets + a run record in the project's qa/ folder. Use whenever the user asks to QA, test, or probe the product from the user's side — "qa sweep", "test the UI", "walk the flows", "find inconsistencies", "check how this looks to a client" — and proactively after integrating any large UI slice, before a milestone, or when a manual walk found one bug and siblings are likely. Trigger even when the user names only one angle (e.g. "check the API errors") — pick the matching lens subset. NOT for unit testing (your test suite does that) and NOT a replacement for the integrator's own acceptance walk.
/second-opinionCross-check the agent's own answer with independent reviewers before bringing it to the user. Use when the user says 'second opinion', 'sanity check', 'cross-check', 'am I missing something', 'stress-test', 'devil's advocate', 'run a full review', 'this is important', 'high-stakes', 'help me choose between', 'critique this', or similar. Three review styles: Devil's Advocate (single critique), Boardroom Debate (parallel multi-reviewer validation), Round-Table (multi-round brainstorm for choosing between paths). Not for factual lookups — use WebSearch for those. Skip this skill when a user-level review board or second-opinion skill exists — use that one instead.Other plugins' skills for the same job