Audit agents

From woditschka/agentic-coding-reference · View interactive version

Audit agents is an AI agent skill from the GitHub repository woditschka/agentic-coding-reference. Audit the agentic configuration for consistency, coherence, and conciseness. Load when modifying agent definitions, skills, or pipeline structure, or to verify cross-tool parity.

How to use this skill

Skill file

Channel Scope

This skill audits a committed harness runtime and applies to the copy channel only. On the marketplace channel the runtime ships inside the plugin, so install hygiene is the plugin repository's CI concern, not the consumer project's. Doc-form validation is owned elsewhere: the doctor skill (blocking, deterministic), audit-docs (advisory judgment), and document-writing (review-time form checks).

When to Run

Run this audit after any change to:

Audit Checklist

1. Skills Coverage

2. Agent Thinness

An agent file is the agent's job description; a skill is reusable mechanics. They overlap by design. The audit must distinguish real duplication (drift hazard) from parallel description (different audience, different level of detail) before flagging anything.

Positive shape of a thin agent file. A well-shaped agent body contains, in roughly this order: persona statement, skill/doc references, write scope (which files the agent may modify), a short process overview (≤7 lines naming what the agent does, not how the skill works), and any agent-specific conduct rules. Anything beyond this is a candidate for the drift test.

The drift test. For each candidate finding, run this test before tagging it a violation:

If the skill changes, must the agent file also change to keep the system correct? If yes, it's duplication. If no, it's parallel description — leave it.

Concretely, this means:

Mandatory false-positive examples — these have been wrongly flagged as duplication; do NOT flag them:

Real-duplication checklist:

Grep patterns — candidates only, run the drift test before flagging:

| Pattern | Where to Search | Likely violation when… |

|---|---|---|

| - \[ \] (3+ rows) | Agent body | The checkbox list mirrors a skill's checklist body. Single-row reminders are fine. |

| \*\*Red\*\*.*failing test | Agent body | Restates TDD cycle mechanics from tdd-workflow. |

| ## Review Focus with criteria | Agent body | Restates a review skill's checklist. |

| ## PRD Boundary with rules | Agent body | Restates prd-authoring validation rules. |

| ## Output Format with full template | Agent body | Restates a template that exists in .claude/templates/ or a skill's output contract. |

| Numbered process 5+ steps mirroring a skill | Agent body | The agent's process is the skill's process verbatim. |

Patterns that look like duplication but routinely pass the drift test (do not flag without confirming):

3. Cross-Tool Parity

For each agent, compare all three tool versions (.claude/, .github/, .opencode/):

| Tier | Claude Code | GitHub Copilot | OpenCode |

|------|-------------|----------------|----------|

| Sonnet | claude-sonnet-5-5 | ['Claude Sonnet 5.5 (copilot)', 'Claude Sonnet 5 (copilot)'] | openrouter/anthropic/claude-sonnet-5.5 |

| Opus | claude-opus-5-5 | ['Claude Opus 5.5 (copilot)', 'Claude Opus 5 (copilot)'] | openrouter/anthropic/claude-opus-5.5 |

Both tiers are symmetric across tools today: Claude Code, GitHub Copilot, and OpenRouter all serve Claude Opus 5.5 and Claude Sonnet 5.5. The Copilot pin is a two-entry fallback chain: Copilot silently substitutes its session default for an unavailable model, so the chain pins the fallback to the prior same-tier release. Pins advance with the harness release that ships them; report upstream drift to the harness maintainer rather than editing pins locally.

4. Reference Integrity

The rule is uniform: every path-shaped string in agent and skill files must resolve to an existing file or directory. Path-shaped means a token containing / and ending in a known extension (.md, .yaml, .yml, .json, .jsonl, .sh, or a source-file extension) or referring to a known directory (docs/, .claude/, .github/, .opencode/, .scratch/, schemas/, or a source root declared in scripts/layout.toml).

Use grep to find candidates. The alternation below covers the universal doc and config extensions; append your stack's source-file extension(s) — a Go project adds go, a Java project adds java — so source references are caught too:

grep -rohE '[A-Za-z0-9_./-]+\.(md|ya?ml|json|jsonl|sh)' \
  .claude/ .github/ .opencode/ CLAUDE.md docs/ | sort -u

Then check each against the filesystem. Same for directory references.

5. Review Output Records

Verify the floor author values match across all locations:

The roster is the floor plus any extra_reviewers declared in scripts/layout.toml [harness]. schemas/scratch/review-feedback.schema.json validates author by the *-reviewer shape pattern, not a closed enum — the roster's authority is the floor (harness-owned) plus the declared extras (doctor-enforced), not the schema.

Expected floor author values for review-feedback records:

Each reviewer appends one review-feedback record per dispatch to .scratch/handoff.jsonl. There is no per-reviewer markdown file.

6. No Duplication

7. State File Consistency

Verify state file references match across:

Expected state files:

The change-grader writes no separate state files (both records live in .scratch/handoff.jsonl).

Expected schema files (one per record type):

Expected design-block.verdict enum: covered, minor, new, refactor-first, foundational, conflicting. Flag any occurrence of the retired values needs_changes, revised, or escalated in a design-block context, in this project's docs, skills, agents, or schemas. They are stale and must not leak. approved and blocked stay valid for review-feedback and are flagged only where a design-block verdict is meant.

Expected review-feedback.verdict enum (distinct from design-block): approved, changes_requested, blocked. Do not confuse the two enums when auditing. Other project domains may reuse some of these tokens (e.g. as work-unit outcome values in their PRD or system-design) — those are unrelated to the design-block verdict.

8. Quality Gate Consistency

Verify the quality gate matches across all locations:

9. Pipeline Philosophy Enforcement

Verify the handoff-routing skill contains:

Verify agents do NOT contain:

10. Reviewer Conduct

For each reviewer agent in all three tool directories — the four-reviewer floor (code-quality, test, security, doc) plus any extra_reviewers declared in scripts/layout.toml [harness]:

11. Skill Cross-References

12. Consultation Routing Semantics

The consultation roundtrip is the mechanism by which an in-flight specialist (typically feature-implementer) gets a focused answer from another specialist (typically system-design-expert) or from the human without advancing the pipeline. Verify the semantics are consistently described:

13. system-design-expert Modes and Verdict Coverage

The system-design-expert operates in two demand-driven modes plus the fix dispatch; verify each is documented consistently:

14. Principle Taxonomy (Judgment vs Hard Contract)

Per CODE0 § Principles Over Rigid Rules, every instruction in an agent or skill is a hard contract or a judgment instruction, written differently. This check keeps the split from decaying into a flat rule list. As with the drift test, flag only a clear miss, not every terse line.

15. Truncation Detection Semantics

Truncation recovery fires on a deterministic signal read from .scratch/handoff.jsonl alone — a dispatch-start with no subsequent substantive record from the same (req_id, author). An earlier design gated recovery on an out-of-band signal from root; that trigger is superseded. Verify every description of the mechanism agrees:

The check is on the detection mechanism, not a single stale phrase: flag any file that describes truncation as undetectable from state or dependent on an out-of-band trigger.

Output Format

Report each item as:

Fix Hygiene

When applying fixes for the issues this audit surfaces, three anti-patterns recur and have to be resisted explicitly — otherwise the fix re-creates the same class of problem the audit caught.

Prefer pattern phrasing over instance enumeration. When a finding cites a stale list of paths, the replacement should name the pattern, not enumerate current instances:

The rule: if the list might grow, name the shape and parenthesize the current members.

Spread-check every stale reference. A stale string almost never appears in one file. Before declaring a fix done, grep the entire harness corpus (.claude/, .github/, .opencode/, docs/, CLAUDE.md) for the original token and fix every occurrence in one pass. Piecemeal fixing across audit runs is how zombie references accumulate.

Redundancy check on new content. When a finding's fix adds a checklist item, process step, or section, verify no sibling item already covers it. If step 1 says "read every Go file under internal/", a step 2 enumerating four files under internal/ is dead weight — fold or delete.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.