From dev-team
Audit code-review agents, skills, and hooks for structural compliance. Use this when adding or modifying any agent, skill, or hook file, or for a periodic health check of the toolkit. Trigger phrases: "audit the agents", "check compliance", "validate the skills", "are the agents correct", or any time agent/skill files change.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-team:agent-audit [file-path | --all] [--fix][file-path | --all] [--fix]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Role: orchestrator. This skill performs mechanical compliance
Role: orchestrator. This skill performs mechanical compliance checks — pattern matching against known-good structure.
You have been invoked with the /agent-audit skill. Audit agents and
skills for compliance with the eval system patterns documented in
.claude/docs/eval-system.md.
--fix is used, apply minimal structural fixes. Insert
missing sections/fields using templates. Do not rewrite existing
content.Arguments: $ARGUMENTS
--all: audit everything.claude/agents/js-fp-review.md): audit that
file only--fix: after generating the report, automatically apply fixes
for FAIL/WARN itemsScope: this audit covers agents from all plugins in the repository, not just
plugins/dev-team/agents/. Currently audited directories:
plugins/dev-team/agents/ — the primary dev-team plugin agentsplugins/security-assessment/agents/ — the security-assessment plugin agentsThe automated effort-band gate (tests/agents/test_agent_effort_frontmatter.py)
discovers and checks agents from both directories; add new plugin agent directories
to AGENTS_DIRS in that test file when a new plugin is introduced.
Read each file in .claude/agents/*.md whose body contains a structured JSON
output schema (a line with "status": "pass|warn|fail|skip") — these are
review agents. Check:
Structured output format: Does the agent specify a JSON output schema?
status, issues, and summary
fieldsSeverity definitions: Does the agent define severity levels?
error, warning, and suggestion with clear
criteriaDetection rules: Does the agent list what it detects?
Scope boundaries: Does the agent declare what it ignores?
Self-describing: Does the agent depend on external config?
config/, review-config.json, or
external config filesFile scope: Does the agent declare which file types it applies to?
Skip support: Does the agent define when to return
status: "skip"?
## Skip sectionEffort band: Does the agent declare effort: low|medium|high in
its YAML frontmatter?
low, medium, highEffort: line (or other
prose) restates the band; that duplicate is a drift source and must be
removed.model: haiku|sonnet|opus tier in frontmatter, WARN
that the tier name is deprecated and name the band to use
(haiku → low, sonnet → medium, opus → high)Context needs: Does the agent declare a Context needs: field?
diff-only — agent reads only the unified difffull-file — agent needs the complete file contentproject-structure — agent needs directory/project layoutartifact-stream — agent consumes upstream JSON artifact streams
(prior-phase findings, RECON output) and does not read source
files directly; qualifies when the agent's only input is an artifact
produced by an earlier pipeline phaseartifact-stream, full-file is valid for an agent that reads both
upstream artifacts and full source files). An unknown token in a
combined declaration still WARNs on that token specifically.No colons in description: Does the description: frontmatter field contain a colon?
description field MUST NOT contain colons — they break argument-hints and other tooling:)Read every file in .claude/agents/*.md (team agents and review agents). Check:
## Skills heading, the tools: frontmatter MUST include Skill.
## Skills section documents which skills an agent invokes. Without Skill in tools:, the agent cannot load skill content at runtime (when tools: is specified as an allowlist, only listed tools are available).## Skills section is present but Skill is absent from tools:.## Skills section is present (the invariant does not apply).## Skills is present and Skill is in tools:.Include the result in the agent report table under a Skills-Tool column.
Fix (when --fix is passed): Append , Skill to the tools: frontmatter line. Report FIXED: <agent> — Added Skill to tools:.
*-review agent MUST grant the five code-intelligence MCP tools in tools: — mcp__codegraph__codegraph_explore and mcp__plugin_repowise_repowise__{get_context,get_symbol,search_codebase,get_risk} — so a review on a repo with a CodeGraph/Repowise index uses verified skeletons and resolved call graphs instead of raw whole-file reads (the grant is inert when the server is absent; agents fall back to Read/Grep/Glob). This mirrors the Skills-Skill invariant: it self-extends to future *-review agents.
*-review agent's tools: line is missing one or more of the five names.*-review agent grants all five.scripts/check_review_agent_mcp_tools.py (with MCP_TOOL_NAMES as the single source of truth); it also checks that code-review/SKILL.md still contains the code-intelligence phrases (the five tool names and .codegraph/) as a proxy for the detection/preference guidance — it asserts the phrases are present, not the instruction wording itself.Include the result in the agent report table under a Code-Intel column.
Fix (when --fix is passed): run python3 scripts/check_review_agent_mcp_tools.py --fix, which appends the missing names (merge, never replacing Read, Grep, Glob/Skill). Report FIXED: <agent> — added code-intelligence MCP tools.
tools: — the narrow tier (software-engineer, mutation-kill, qa-engineer, data-flow-tracer) grants codegraph + the four Repowise tools, with data-flow-tracer also carrying a scoped Bash(graphify *); the rationale tier (adr-author, architect, security-engineer, platform-engineer, codebase-recon) additionally grants mcp__plugin_repowise_repowise__get_why. Coverage is the union of the mapping's config keys and a structural sweep (team agents by ## Behavioral Guidelines or enforcement: script, minus *-review, minus a documented exclusion list), so a new team agent that is neither mapped nor excluded fails rather than silently escaping the mapping.
tools: line is missing any of its tier's names, or a swept team agent is in neither the mapping nor the exclusion list (unclassified).scripts/check_agent_tool_mapping.py (with TIER_CONFIG/EXCLUSIONS as the single source of truth, sharing scripts/lib/mcp_tool_grants.py with the review-agent check as a peer). This is the non-review counterpart to invariant 2: review agents keep their five-tool set there; the mapping check never evaluates *-review agents.Include the result in the agent report table under a Mapping column.
Fix (when --fix is passed): run python3 scripts/check_agent_tool_mapping.py --fix, which appends the missing tier names (merge, never replacing existing grants). Unclassified agents are reported, not auto-fixed — classify each into TIER_CONFIG or EXCLUSIONS. Report FIXED: <agent> — added code-intelligence mapping tools.
A file is a team agent when its body contains a ## Behavioral Guidelines section. Exemption: an agent that declares enforcement: script in its frontmatter is a script-enforced prose spec, not a persona-driven team agent — skip the persona checks below for it and instead verify it carries a > **Implemented by:** <script> pointer immediately after the H1. For each remaining team agent, check:
Persona paragraph: Is there a You are… sentence immediately after the H1 heading and before the first ## section?
You are (case-sensitive).## heading instead of a persona paragraph.You are … paragraph is present between the H1 and the first ##.Non-generic Output discipline: Does the ## Output discipline section exist and contain role-specific content?
## Output discipline section is absent entirely."plans, designs, ADRs, reports" — this indicates the shared boilerplate was never personalised.Include both results in the agent report table under Persona and Output-Disc columns.
Fix (when --fix is passed):
You are a <role>. <Add identity, worldview, communication style.> after the H1. Report FIXED: <agent> — Added persona placeholder (requires manual completion).## Output discipline: insert the section with a placeholder bullet. Report FIXED: <agent> — Added Output discipline placeholder (requires manual completion).WARN: <agent> — Output discipline still contains generic boilerplate; manual update required (no auto-fix — content must be role-specific).Reviewer agents sometimes inline normative rules — numeric thresholds like
"under 50 lines" or "80% coverage" — independently of the canonical skill or
knowledge file. When that source changes, the agent silently keeps enforcing
the stale value. The citation lint makes the dependency explicit: an agent
declares its sources in a cites: frontmatter list, and every numeric threshold
the agent states on an RFC-2119 line (MUST/SHOULD/SHALL/REQUIRED/NEVER/ALWAYS)
must also appear in a cited source.
Perform the check by reading (the same mechanical, deterministic style as the other audits — no judgment):
cites: list. Each entry names
a skill (skills/<name>/SKILL.md) or knowledge file (knowledge/<name>.md).```/~~~) and blockquotes (>). On each such line, collect
the numeric thresholds (50, 80%, 40.5); ignore issue refs like #99.Classify:
cites: present and every threshold backed → PASS in the Citation column.cites: present but a threshold absent from every cited source → WARN
(possible drift): report the token + line number.cites: but the agent states thresholds → WARN (advisory): recommend
adding a cites: list.cites: and no thresholds → PASS (nothing to verify).cites: an unknown source (no matching skill/knowledge file) → WARN.Phase 1 is non-blocking — these are warnings, never failures. Do not
red-line the audit on a citation warning; surface it as an action item so drift
is visible while cites: adoption grows. CI runs the deterministic counterpart,
scripts/citation_lint.py (also advisory, exit 0), on every PR.
The catalog tables (knowledge/agent-registry.md for agents and agent-loaded
skills; the plugin CLAUDE.md slash-command table for user-invocable skills) are
hand-maintained. When an agent or skill is added or removed without updating the
matching table, the catalog drifts and the orchestrator routes against a roster
that no longer matches the filesystem.
Run the deterministic sensor:
python3 scripts/check_registry_sync.py
It asserts a bijection between plugins/dev-team/agents/*.md +
plugins/dev-team/skills/*/SKILL.md and the registry rows, reporting MISSING
(file with no row) and ORPHAN (row with no file). Unlike the citation lint this
is a hard gate — exit 1 on any discrepancy. Fix it by adding or removing the
catalog row by hand (the marketplace-dev plugin's /agent-create /
/agent-remove maintain these tables automatically).
Effort bands are deliberately not checked — they live only in frontmatter. The
pytest suite tests/repo/test_registry_sync.py runs this on every PR.
Agents read shared guidance from knowledge/*.md. Two ways this silently
breaks (issue #1103): the file is renamed/removed but a reference lingers, or
the reference uses a bare knowledge/X.md path that resolves against the
target repo's cwd at runtime — not the plugin dir — so the agent reads
nothing and degrades to hardcoded fallbacks.
Run the deterministic sensor:
python3 -m pytest tests/agents/test_agent_knowledge_anchor.py
It hard-gates three invariants on every knowledge/X.md reference in an
agent body: it cites a valid index.json anchor or carries Whole-file load:; the file is packaged on disk; and it is prefixed with
${CLAUDE_PLUGIN_ROOT}/ (the only runtime-resolvable form — a prose "lives
in plugins/dev-team/knowledge/..." pointer is tolerated). Runs on every PR.
Two deterministic Python scripts validate concerns that the LLM-based review
agents (claude-setup-review and token-efficiency-review) handle as deeper
semantic checks. Run these scripts for a fast, CI-safe structural pass:
CLAUDE.md / setup review (frontmatter schema, field completeness, effort bands, duplicate rules):
python3 scripts/claude_setup_review.py --plugin-root <plugin-root-path>
Token-efficiency review (file line counts, CLAUDE.md size, LLM anti-patterns):
python3 scripts/token_efficiency_review.py --files <path>...
Both scripts exit 0 and emit JSON findings to stdout. Surface any error
or warning severity findings as FAIL/WARN rows in the audit report table.
The scripts are the authoritative structural gate — do not dispatch the
claude-setup-review or token-efficiency-review agents from this skill;
those agents run under /code-review for semantic depth.
Read each file in .claude/skills/*.md and .claude/skills/*/SKILL.md and check:
Role declaration: Does the skill declare its role?
user-invocable: true — slash commands and
workflow initiators) MUST have an explicit Role: line in the SKILL.md
body, immediately after the H1 (matching /plan, /build,
/code-review, /pr, /ship): Role: orchestrator, Role: worker, or
Role: implementation. A frontmatter-only role: field (lowercase key)
does NOT satisfy this — it's easy to add without stating the
orchestration-discipline contract the body line carries. WARN if a
user-invocable skill has no body Role: line.user-invocable: true) are exempt from the body-line requirement — a
frontmatter role: field, or no role at all for pure reference
material, is acceptable. WARN only if such a skill has no role
declared anywhere (frontmatter or body).Constraints section: Does the skill declare its boundaries?
Structured steps: Does the skill have numbered steps?
Argument parsing: Does the skill document its arguments?
Output format: Does the skill describe its output?
Conciseness directive: Does the skill instruct concise output?
Validation gates: Does the skill run validation where appropriate?
No colons in description: Does the description: frontmatter field contain a colon?
description field MUST NOT contain colons — they break argument-hints and other tooling:)Read each file in .claude/hooks/*.sh and check:
Advisory behavior: Does the hook exit 0?
Input handling: Does the hook read stdin and extract file path?
Scope filtering: Does the hook filter by file type?
# Agent Audit Report
## Agents
| Agent | Output Format | Severity | Detection | Scope | Self-Describing | File Scope | Skip | Model Tier | Context Needs | Skills-Tool | No-Colon Desc | Status |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| test-review | PASS | PASS | PASS | PASS | PASS | N/A | PASS | PASS | PASS | PASS | PASS | OK |
| js-fp-review | PASS | PASS | PASS | PASS | PASS | PASS | PASS | PASS | PASS | N/A | PASS | OK |
| ... | | | | | | | | | | |
## Skills
| Skill | Role | Constraints | Steps | Arguments | Output | Validation | No-Colon Desc | Status |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| code-review | PASS | PASS | PASS | PASS | PASS | N/A | PASS | OK |
| apply-fixes | PASS | PASS | PASS | PASS | PASS | PASS | PASS | OK |
| ... | | | | | | | |
## Hooks
| Hook | Advisory | Input | Scope Filter | Status |
| --- | --- | --- | --- | --- |
| js-fp-review.sh | PASS | PASS | PASS | OK |
| token-efficiency-review.sh | PASS | PASS | PASS | OK |
| ... | | | | |
## Citation drift (Phase 1 — advisory)
| Agent | cites | Drift / Advisory | Status |
| --- | --- | --- | --- |
| complexity-review | yes | — | PASS |
| naming-review | no | states 1 threshold, no cites: | WARN |
| ... | | | |
## Summary
- Agents: N OK, N WARN, N FAIL
- Skills: N OK, N WARN, N FAIL
- Hooks: N OK, N WARN, N FAIL
- Citation drift: N PASS, N WARN (advisory, non-blocking)
- Action items: [list of things to fix]
--fix is passed)If --fix was NOT passed, list action items and stop.
If --fix WAS passed, automatically apply fixes for each FAIL/WARN
item:
Agent fixes:
Missing output format → insert after the # <Agent Name> heading:
Output JSON:
\```json
{"status": "pass|warn|fail|skip", "issues": [...], "summary": ""}
\```
Missing severity definitions → insert after the output format:
Severity: error=<agent-specific>, warning=<agent-specific>, suggestion=<agent-specific>
Missing skip support → insert a ## Skip section before
## Detect:
## Skip
Return `{"status": "skip", "issues": [], "summary": "<reason>"}` when:
- <agent-specific inapplicability conditions>
Missing scope boundaries → append ## Ignore section at the end
Colon in description → rewrite the description value to remove colons (use "–" or "and" instead)
Skill fixes:
## Steps with ### 1., ### 2., etc.## Parse Arguments section
after the skill headingdescription → rewrite the description value to remove colons (use "–" or "and" instead)After each fix:
FIXED: <agent/skill> — <what was fixed>If --fix was used, append a fix summary after the audit report:
## Fixes Applied
- FIXED: <name> — Added output format
- FIXED: <name> — Added skip section
- SKIPPED: <name> — <reason fix could not be auto-applied>
Re-run /agent-audit to verify all fixes.
npx claudepluginhub bdfinst/agentic-dev-team --plugin dev-teamGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.