/harness-config:audit-automation-gaps [--recommend-only] [--implement] [hooks|mcp|skills|subagents|scheduled|all]from harness-config
Audits a repo's Claude Code automation landscape (hooks, MCP servers, skills, subagents, scheduled tasks) against an enforcement hierarchy, producing PASS/REJECT/CONDITIONAL verdicts. Defaults to REJECT; use --implement to apply recommendations or filter by scope.
Ships in harness-config. 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.
Arguments. [--recommend-only] [--implement] [hooks|mcp|skills|subagents|scheduled|all]. default: all
Automation inventory: !bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-automation-gaps/scripts/inventory.sh" 2>/dev/null || echo "inventory unavailable"
That block counts files present separately from handlers registered, and marks a scope it could not read as unreadable, not zero. Treat it as a starting point, never a finding. Re-derive any count a verdict leans on; where your count disagrees with the block, report both and say which the verdict used. A partial inventory that reads as complete anchors every later verdict wrong: see context/gotchas.md.
Find evidence-backed automation gaps, where no mechanism in the enforcement hierarchy covers the concern, not surface-level "you don't have X" observations.
Design principle: most "missing automation" gaps are already covered by higher enforcement levels (compiler, analyzers, build-time checks, architecture tests, behavioral rules). Prove a gap exists before recommending a solution. The default verdict is REJECT, not PASS.
The enforcement hierarchy is the rung list in
context/enforcement-ladder.md; this skill's selection rule there
is the strongest rung that covers the concern. A consuming repo's own hierarchy, documented in
CLAUDE.md, in an AGENTS.md the session reads natively (in place of or beside a CLAUDE.md), or
in rules files, overrides this default ordering: read and use theirs.
A proposed deterministic check meets the "Guardrail criterion" section of that same file before it earns a PASS verdict.
This skill ships no hook-enumeration mode, by decision. The native /hooks menu already reports the harness's resolved set, with each hook's source; a script here would restate that set from the settings files instead of the harness's own resolution, the weaker source. Revisiting the decision first requires recording a native-surface verdict for /hooks in whatever registry the repository keeps for native-overlap decisions, because whether such a reference should exist is a human's call. This paragraph is a boundary, not a routing verdict.
/hooks lists, or what it shows for a selected hook, fetch
the /hooks menu live.update-config skillaudit's Boundary, "Boundary, the bundled update-config skill" owns the surfaces and mutation gate.
Phase 4 makes each approved settings-file edit through update-config when it resolves; other files it writes directly.
claude-code-setup marketplace pluginclaude-code-setup (official marketplace plugin, opt-in): recommends automations for a repository, invoked as /claude-code-setup:claude-automation-recommender; read what it covers and writes through reference/native-surfaces.md before relying on it. This skill (marketplace plugin) proves each gap against the enforcement hierarchy, REJECT by default, and implements approved items with --implement./claude-code-setup:claude-automation-recommender (if enabled); this skill keeps the gated verdicts and --implement. Mutation gate: this skill never starts the plugin; the person does. Pointers: reference/native-surfaces.md.Where a phase names an adjacent capability (a research skill, an implementation-planning skill, a
work-item tracker, an outcome verifier), it is optional: use your setup's equivalent if it has one,
else follow the inline guidance, which stands on its own. Neighboring questions belong to the
sibling audit skill (are the config files correct?) and the audit skill in the harness-memory
plugin (is the instruction layer healthy?).
This skill proposes new automation. Whether automation already in place still earns its carry cost
is owned by /overengineering:audit (if enabled), whose evidence-earned-keep walk treats every incumbent as a
retirement candidate until evidence keeps it. Send a retirement question there when the
overengineering plugin is enabled; when it is not, the Already enforced gate still names the
mechanism covering a concern, and any retirement observation is recorded in the verdict for the
human, not acted on here.
Parse $ARGUMENTS for:
--recommend-only: Run evaluation phases only, skipping implementation. Default behavior--implement: After presenting validated recommendations, implement user-chosen items sequentiallyhooks, mcp, skills, subagents, scheduled): Limit to a specific automation type. Default: allThere is deliberately no ci category. Two skills own that ground: the ci-lanes layer of
/overengineering:audit (if enabled) judges whether each lane already running still earns its carry cost, and
/corrections:codify (if enabled) maps one recurring mistake or review finding to the strongest enforcement rung
that can catch it, including a check that runs in CI. Route a CI concern to whichever fits when the
overengineering or corrections plugin is enabled; when neither is, record the concern in the
verdict as out of scope and name its owner, rather than widening this audit's categories.
For any deep-dive run (Phases 1-4), keep a phase checklist and tick each phase and every anti-noise
doctrine check as it completes, in-response or in a copy of
${CLAUDE_PLUGIN_ROOT}/skills/audit-automation-gaps/templates/checklist.md wherever the consuming
repo keeps working task notes. Phase 4 is skipped in default --recommend-only mode.
Analyze the automation landscape directly, with no external recommender dependency.
The pre-computed block already ran
bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-automation-gaps/scripts/inventory.sh"; re-run it directly
if that block is missing. It settles the per-scope hook-location counts, the component counts, and
the enablement inputs. It leaves three things to you: effective plugin enablement,
because enabledPlugins follows precedence rather than the merge that hook entries follow; the
contents of any frontmatter hooks: block, which it counts but does not parse; and plugins
installed on the machine from outside this repository. Then read:
| What | Source |
|---|---|
| Hooks | Every hook location: user + project + local settings.json → hooks, managed policy settings when readable, each enabled plugin's hooks/hooks.json, and skill or agent frontmatter hooks:. Also record which hook events you considered: the documented set is far wider than PreToolUse and PostToolUse, and an event nobody looked at cannot surface a candidate, so a no-gaps hooks verdict names the events it examined |
| MCP servers | .mcp.json + settings.json → disabledMcpjsonServers |
| Permissions | settings.json → permissions (deny/ask/allow) |
| Enforcement | The root build or project configuration files where the repository sets its compiler, analyzer and lint options, .editorconfig (top 20 lines), any enforcement-hierarchy section in the repo's own instruction files |
| Codebase shape | File counts per language, by file extension over git ls-files |
| Incident history | git log --oneline | wc -l for the denominator, then a --grep count for the concern. That count is a ceiling, never a frequency: read a sample before citing one, and carry the match count, the denominator, the sample size and what the sampled commits actually were into the verdict |
For each automation category, check for gaps with the checklists in context/gap-analysis.md: Hooks (formatter exists? fast enough? higher enforcement already covers?), MCP Servers (configured? CLI equivalent? service in use yet?), Skills (skill exists? frequency? simpler mechanism?), Subagents (value over hook/skill? isolation help? plugin exists?), Scheduled (tracked in the repo's work-item tracker? Dependabot/CI covers? right durability model?).
Produce a numbered list of candidates, each with category and one-line rationale. Target 5-10 candidates. Cast a wide net and include borderline items: the quality gates filter, and rejecting with evidence beats silently excluding.
Batch the Explore phase (read all configs once), then evaluate candidates sequentially.
For each candidate:
automated-review) to the strongest (make-impossible). Stop when you find coverage. Document which level covers itgit log --grep for related problems, then read a sample of the hits.
The count is a ceiling, not a count of incidents or a frequency. Report the match count, the
total commit count, the sample size read, and what the sampled commits actually weretime <tool-command> 2>&1 | tail -5
Judge that measurement against the consuming repository's own documented hook budget where one
exists, and say which source the threshold came from. No upstream latency budget exists, so any
fixed number this skill supplies is a house rule, labeled as one in the verdict. We judge a
PostToolUse hook's cost as turn latency, never as a blocked call; the record that points at the
live per-event blocking table is in hook-timing.md. For the budget-resolution ladder, per-event
costs, the documented levers, and the dated upstream-fact records, read
context/hook-timing.md.
Research splits by who owns the fact.
Mandatory: one batched docs fetch for harness mechanisms. Any candidate whose mechanism is a
Claude Code surface gets its harness facts fetched before its verdict, however settled the local
evidence looks. That covers hook event semantics and what each event can and cannot block,
async and timeout behavior, MCP server scope and configuration, and skill, agent or plugin
frontmatter fields. Collect every such question across every surviving candidate into one fetch
pass. The batch is mandatory because a docs pass routinely reshapes a candidate that local evidence
had settled: a per-event exit-code gate can look settled locally while the event's decision
control upstream says it never fires, which no local reading surfaces.
Conditional: facts the harness does not own. Third-party tool performance, an ecosystem's standard formatter, server stability and auth, known issues in a tool the candidate would run. Fetch these only where the verdict turns on them.
When a conditional fetch is skipped, record how the fact was settled in that candidate's verdict: the measurement taken, the file read, or the existing dated record relied on. "Not needed" and "not done" must stay distinguishable in the artifact.
Group related queries to minimize agent count, and run the mandatory batch as one dispatch for all candidates.
Per-candidate research questions by type:
| Type | Research Questions |
|---|---|
| Hook | Tool per-file performance? Ecosystem standard formatter? Known hook compatibility issues? |
| MCP Server | Server stability? Auth requirements? CLI equivalent comparison? Known issues? |
| Skill | Existing solutions? Frequency justification? Similar skills in marketplaces? |
| Subagent | Can a hook/skill do this more deterministically? Is context isolation needed? |
| Scheduled | Platform requirements (CLI vs Desktop vs cloud)? Durability model? Existing coverage via Dependabot/CI/work items? |
Verify Claude Code mechanisms against official docs (code.claude.com/docs/en/hooks, code.claude.com/docs/en/mcp); use web search for tool performance and community practices. Research agents gather evidence and state no verdict; the gates in 2.3 read that evidence and decide.
A candidate fails if any gate triggers.
Run this gate in a fresh context. Phase 1 generated these candidates in the context now asked to refuse them, and a context that produced work is a biased judge of it. Dispatch a fresh-context subagent with the candidate list, the Phase 2.1 and 2.2 evidence, and this table, and keep the gate results it returns. Where the environment exposes no subagent surface, run the gates inline and say in the report that the refusal gate ran in the context that generated the candidates, so the bias is visible.
Verification level. Before this gate, run bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin harness-config --skill audit-automation-gaps
and copy its line into the report (levels).
standard and strict are the paragraph above. Under light, and off, which acts as light
here, dispatch neither this gate nor the Phase 4 step 6 reviewer, and never run either inline in
its place: write verification: skipped (<level>) where the gate results or the review would go.
The gate's verdict is this audit's product, so each candidate is listed as unverified, never
PASS, CONDITIONAL or REJECT; each is persisted with verdict unverified, which --implement
never implements.
| Gate | Condition | Evidence Required |
|---|---|---|
| Already enforced | A higher enforcement hierarchy level covers it, and the shift-left carve-out below does not apply | Name the level and mechanism; where the candidate claims the carve-out, the result of each of its three conjuncts |
| Too slow | Measured cost exceeds the resolved budget (context/hook-timing.md) for the event's actual cost: a blocked call on a blocking event, turn latency on PostToolUse | Timing measurement + the budget it was judged against and that budget's source |
| Not scriptable | The mechanism can't be automated with available tools | Specific limitation cited |
| Zero incidents | A read sample of the matching commits shows the problem has never occurred. A --grep count alone never triggers this gate, in either direction | Keyword match count, total commit count, the sample size read, and what the sampled commits turned out to be |
| Already exists | A skill, behavioral rule, or convention already handles it | File path and line |
| YAGNI | Low frequency (<5% of commits) AND low severity, where the frequency is sampled rather than counted | The match count over total commits as the ceiling; plus a sampled frequency whenever that ceiling is 5% or higher, and none when it is already below |
| Platform mismatch | Requires infrastructure the user doesn't have | Platform requirement cited |
| Premature | Depends on unfinished work (planned database, future CI) | What's missing cited |
Zero incidents and YAGNI both read a git log --grep count, and that count is an upper
bound on the concern, not a measure of it: it counts commits whose message mentions a word. Cite a
frequency only after reading a sample and saying what the sampled commits were.
The discipline is asymmetric, which keeps it cheap. A ceiling already below the 5% YAGNI threshold settles that gate on its own, because the true frequency cannot exceed the ceiling. Only a PASS, or an affirmative claim that the concern is frequent, has to pay for a sample.
When a candidate deliberately duplicates a check a higher rung already runs, read context/shift-left-carve-out.md before rejecting it as Already enforced.
These gates answer should we mechanize. Whether a candidate can be, and how far up the hierarchy
it climbs, is a separate enforceability question: the Not scriptable gate maps to concerns no
hook type reaches, Already enforced to a deterministic finding already escalated. prompt and
agent hooks do evaluate reasoning-only concerns.
prompt or agent hook, fetch its status and fields live at
hooks: prompt and agent hook fields.Produce a verdict per candidate:
| # | ID | Candidate | Category | Verdict | Key Evidence |
|---|----|-----------|----------|---------|--------------|
| 1 | h1 | ... | hooks | REJECT | [gate]: [evidence] |
| 2 | s1 | ... | skills | PASS | No existing coverage, [n] of [total] commits, [k] sampled |
ID is a short stable token for the candidate, and Category is one of hooks, mcp, skills,
subagents, scheduled. Both are what the persisted artifact is keyed and filtered by, so a row
without them cannot be written back or read by --implement.
For each candidate, provide:
PASS or CONDITIONAL without a plan cannot be persisted, because the plan is precisely what
--implement reads back in a later sessionSize. Resolve time_units once, lowest layer first: the default false; the user's option,
${user_config.time_units} (empty or a literal, unexpanded placeholder means unset); and the
time_units key of <home>/harness-config.yaml, which wins when set. <home> is what
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" prints, else docs/conventions; its
exit 5 (the root is $HOME, an ancestor of it, or not a git working tree) skips that layer, and a
missing file or key leaves it unset. A value other than a bare true or false is named with its
file or option, the key and the value, and that layer is dropped: a valid repository value still
wins over an invalid user value, and an invalid repository value resolves false, never the
user's value.
Only a resolved true turns it on. State the resolved value, on or off, and the layer that
supplied it at the top of the report.
Either way, a time budget the user states is quoted in the user's words.
Order by value/impact, highest value first. Value = frequency × severity × ease of implementation.
Print how the repository's enforcement spreads across the ladder's tiers, on every run and whatever the category filter:
bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-automation-gaps/scripts/rule-inventory.sh"
Copy its tier table and its "Sits lower than it could" list into the report as printed, with the
script's line naming what a row counts and every source line that names an absent or unreadable
file or a source it does not count, such as CI workflows or git hooks. The table holds all five tiers; a tier the script found empty stays in it with its reason.
Both are rollups of one inventory, one row per rule (rule, enforcer, rung, tier), which --rows
prints when a reader needs the rows behind a count.
This section is read-only and sets no target. State no share, ratio or count a tier should reach,
and do not call a tier too high or too low: the ladder's proportion is a direction with no number.
The "Sits lower than it could" entries are candidates for a person to judge, not verdicts. One that
looks worth moving up goes to /corrections:codify (if enabled), and
is otherwise named for the human; this audit adds none of them to its candidate list. A rule held
by a mechanism no file shows, such as a type that makes the mistake impossible, is counted only
when the repository declares it under rule_inventory.declared in its harness-config.yaml
convention file; say so when the codebase tier reads zero. A repository that declined a convention
home, or whose home does not resolve, has no declared rows, and the script's declared line says
why: copy it.
End with a one-paragraph assessment of the repo's automation maturity: what's well-covered, the genuine gaps (if any), and whether the automation investment fits the project stage.
If items pass: "Which items would you like to implement? I'll work through them sequentially."
If no items pass: State that clearly. A clean bill of health is a valid outcome.
Write twice, because the selection does not exist yet when the verdicts do.
Write once as soon as the verdicts are presented, so an audit is never lost to a session that ends
at the question above. Every candidate carries approved: false at this point, which is true: the
human has not chosen yet.
Write again once the human answers, with approved: true on the candidates they picked. Run ids
are suffixed rather than overwritten and read serves the newest run, so the second write is what
a later --implement sees, and the first survives as the record of what the audit actually found.
Skip the second write only when nothing passed, since there is then nothing to select.
bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-automation-gaps/scripts/findings-state.sh" write \
--plugin-data "${CLAUDE_PLUGIN_DATA}" --root <audited-repo-root> --findings <file-or-->
We pass ${CLAUDE_PLUGIN_DATA} as that argument rather than relying on the shell to have it; the
script exits 2 rather than guessing when it is missing. --root is the absolute path of the
repository the audit covered, so the findings key follows that repository rather than the shell's
working directory; every findings-state.sh call in a run passes the same --root.
The payload is exactly one JSON object with a candidates array, each entry carrying
id, candidate, category, verdict, an evidence array, and a plan object on any PASS or
CONDITIONAL. Each entry also carries approved, the boolean that records the human's selection.
A malformed payload, or a stream carrying more than one document, exits 3 and writes nothing,
listing every problem at once.
Writes are all or nothing. A run id already taken is reserved under the next free suffix rather than overwritten, so two runs racing for one id both survive and each is told the id it actually got.
Findings are keyed per project, so one checkout never reads another's verdicts. This tree is the only durable copy, and an uninstall can delete it.
--implement or user requests)Runs only with --implement or when the user picks items: read ${CLAUDE_SKILL_DIR}/context/implement.md. Its <plugin-root> is ${CLAUDE_PLUGIN_ROOT} and its <plugin-data> is ${CLAUDE_PLUGIN_DATA}.
Principles that govern every verdict:
git log --grep count is a ceiling, and a check a higher rung already runs suppresses its own incidents/planning:plan./work-items:decompose./overengineering:audit./work-items:track add.Six failure modes to check for, each with its evidence and dated upstream records: a partial inventory anchoring every later verdict, keyword counts read as
frequencies, PostToolUse candidates phrased as gates, an exit 2 gate on PermissionRequest that
is silently inert, an exit 1 refusal counted as a gate before its event's semantics are read, and a candidate generator that reaches four of the
documented hook events.
Read context/gotchas.md before any run whose verdicts a human will act on.
context/enforcement-ladder.md (opens in a new tab)context/gap-analysis.md (opens in a new tab)context/gotchas.md (opens in a new tab)context/hook-timing.md (opens in a new tab)context/implement.md (opens in a new tab)context/shift-left-carve-out.md (opens in a new tab)evals/evals.json (opens in a new tab)reference/native-surfaces.md (opens in a new tab)scripts/findings-state.sh (opens in a new tab)scripts/findings-state.test.sh (opens in a new tab)scripts/inventory.sh (opens in a new tab)scripts/inventory.test.sh (opens in a new tab)scripts/rule-inventory.sh (opens in a new tab)scripts/rule-inventory.test.sh (opens in a new tab)templates/checklist.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
bashnpx claudepluginhub melodic-software/claude-code-plugins --plugin harness-config10 skills in this plugin
/auditIf update-config resolves in this session, prefer it to change settings; this skill audits settings.json, settings.local.json, .mcp.json, hooks, plugins, permissions, env vars (correctness, security, drift vs official docs; --fix confirms auto-fix). Use when: 'audit settings', 'check config', 'check for config drift', after Claude Code update./audit-instructionsAudit instructionsIf claude-api resolves in this session, prefer it for app prompts; this skill audits Claude Code instructions (CLAUDE.md, AGENTS.md, rules, skills, agents, hooks) report-only for stale/conflicting text. Use when: 'audit instructions', 'too prescriptive', 'which instruction wins'. Not for missing text: /harness-config:audit-prompting-postures./audit-passAudit passRun one coordinated, resumable audit pass over a repo: three-scope inventory, each owning plugin's checks lane by lane, findings persisted per lane with one human gate (read-only unless --fix) for one reconciled findings report/release artifact. Use when: 'audit pass', 'audit this repo end to end', 'resume the audit', or sweep all three scopes./audit-permission-grantsAudit permission grantsReport-only permission grant audit: allowed-tools frontmatter, permissions.allow, portable auto-mode durability (dropped interpreter wildcards, machine paths, substitution tokens, inert plugin grants, guarded helper denied despite allow rule). Use when: 'why was my allowed-tools grant ignored', 'audit allow rules', 'is this permission portable'./audit-permission-stateAudit permission stateIf fewer-permission-prompts resolves in this session, prefer it for prompts; this skill merges every settings scope read-only into allow/ask/deny set in effect (source/precedence per rule), flagging auto-mode drops. Use when: 'what permissions are actually in effect', 'which of my rules survive auto mode', 'is my managed policy being read'./audit-prompting-posturesAudit prompting posturesReport-only audit of posture guidance instructions lack per official prompting guide: missing delegation criteria, guardrails, stop rules (when to stop), confirm destructive actions. Use when: 'posture audit', 'audit prompting postures', 'is my skill missing guardrails', or align CLAUDE.md. Not for wrong text: /harness-config:audit-instructions.Other plugins' skills for the same job