From zenflow
Audit codebase sections against configurable code standards using parallel specialist agents. Use when checking code quality, enforcing standards, or running periodic health checks on the codebase.
How this skill is triggered — by the user, by Claude, or both
Slash command
/zenflow:auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit codebase sections against configurable standards using parallel specialist agents. Each section gets reviewed by the right type of agent against the relevant standards. Produces a structured report with file:line findings.
Audit codebase sections against configurable standards using parallel specialist agents. Each section gets reviewed by the right type of agent against the relevant standards. Produces a structured report with file:line findings.
Announce at start: "I'm using the zenflow:audit skill to audit the codebase."
Modes:
/zenflow:audit changed) — only audit files modified in the current branch vs mainWhen invoked with changed, only audit files that have been modified:
git diff --name-only main...HEAD
dir paths)This is fast enough for pre-merge checks and CI. Use full mode for periodic comprehensive audits.
Audit config is read from the agents array in .claude/zen.local.md:
---
project:
language: typescript
framework: nextjs
agents:
- domain: api-routes
dir: packages/server/src/server/routes/
glob: "*.ts"
agent: Backend Architect
rules:
- error-handling
- async-patterns
- domain: frontend
dir: packages/frontend/src/components/
glob: "**/*.tsx"
agent: Frontend Developer
rules:
- react-patterns
---
| Field | Description |
|---|---|
domain | Section label in the audit report |
dir | Directory to audit |
glob | File pattern (default: **/*) |
agent | Agent type to dispatch |
rules | Rule names — resolved to .claude/rules/{name}.md |
If no agents array exists in zen.local.md, run zenflow:init first:
"No zen config found. Run
/zenflow:initto scan the codebase and generate config automatically."
.claude/zen.local.mdagents array from frontmatter/zenflow:init and stopLaunch one subagent per section in parallel via the Agent tool:
Each auditor receives:
Auditor instructions:
You are auditing {section.name} against these standards:
{standards text}
Files to audit:
{file list}
For each file, check compliance with every standard. Report:
## Findings
### {filename}:{line}
- **Standard:** {which standard is violated}
- **Severity:** Critical | Important | Minor
- **Issue:** {what's wrong}
- **Fix:** {how to fix it}
### Summary
- Files audited: N
- Findings: N (Critical: N, Important: N, Minor: N)
- Clean files: N
Agent type selection:
agent field from the matching agents entryagent is set, glob .claude/agents/*.md and ~/.claude/agents/*.md, read each file's name and description, match by section domain and file types, fall back to general-purpose"[N] sections are using auto-selected agents. Run
/zenflow:initto generate agent assignments, or specifyagentin your zen.local.md config."
After all auditors complete:
## Audit Report
**Sections audited:** 4
**Files audited:** 47
**Total findings:** 12 (Critical: 1, Important: 5, Minor: 6)
### Critical
1. [packages/server/src/server/routes/api.ts:45] — Missing error boundary...
### Important
...
### Minor
...
### Clean Sections
- Type Schemas (14 files) — no findings
After presenting the report, ask the user:
Question: "How should we handle the findings?"
Options:
If fixing: dispatch subagents to fix findings, then run zenflow:check-work.
For recurring audits, suggest the user set up a cron job:
/loop 24h /zenflow:audit
npx claudepluginhub brewpirate/zen-flow --plugin zenflowRuns codebase audits (health, evaluation, documentation) with parallel agents, producing intake docs for a pipeline run.
Conducts tiered code reviews for security (OWASP top 10), performance, and quality on staged git changes, PRs, or files before commits or releases.
Runs mechanical checks (build, typecheck, lint, tests, secrets scan) then dispatches specialist reviewers and produces a scored codebase health report. Use for code quality, security, or performance audits.