greglas75/zuvo/code-audit
Claude Code and agent skill by greglas75/zuvo
- community
Checking that the SKILL.md file is still in the repository.
Batch audit of production files against CQ1-CQ40 quality gates and CAP1-CAP29 anti-patterns. Tiered output (A/B/C/D), critical gate enforcement, evidence-backed scoring, cross-file pattern analysis, and prioritized execution plan. Flags: zuvo:code-audit all | [path] | [file] | --deep | --quick | --services | --controllers
Install
npx vskill@latest install greglas75/zuvo/code-auditSKILL.md
The same SKILL.md was published earlier as greglas75/zuvo/code-audit.
zuvo:code-audit — Production Code Quality Triage
Systematic evaluation of production source files through the CQ1-CQ40 binary checklist and CAP anti-pattern catalog. Every file receives a tier classification based on its score, critical gate status, and detected anti-patterns. The output is a prioritized report with actionable fix plans.
When to use: Periodic health checks, before major releases, after adding many production files, when onboarding a new codebase, when code quality feels inconsistent. Out of scope: Single-file code review (use zuvo:review), refactoring (use zuvo:refactor), test quality assessment (use zuvo:test-audit), feature development (use zuvo:build).
Argument Parsing
| Argument | Effect | |
|---|---|---|
all | Audit every production file in the project | |
[path] | Audit production files under a specific directory | |
[file] | Audit a single file with full evidence (forces deep mode) | |
--deep | Collect per-gate evidence and fix recommendations for every file | |
--quick | Binary pass/fail only, skip evidence gathering | |
--services (filter Phase 0.1 discovery to files classified SERVICE in 0.3; without that filter this flag is a no-op) | Restrict scope to service and business logic files | |
--controllers (same: filter Phase 0.1 to CONTROLLER-classified files) | Restrict scope to controller, handler, and route files |
Default behavior: all --quick
| Mode | Scope | Depth | Batch Size | Notes | |
|---|---|---|---|---|---|
all | Entire project | Standard | 6 files/batch | Default | |
[path] | Directory tree | Standard | 6 files/batch | Scoped | |
[file] | One file | Deep (full evidence) | 1 | Single-file deep dive | |
--deep | Any scope | Full evidence | 6 files/batch | Slower, thorough | |
--quick | Any scope | Binary only | 10 files/batch | Fast triage | |
--services | Service files | Standard | 6 | Filter by file type | |
--controllers | Controller files | Standard | 6 | Filter by file type |
Mandatory File Loading
PHASE 0 — Bootstrap (always, before reading any input)
These files are loaded before reading the audit target files. The no-pause protocol is mandatory for any multi-file audit run.
PHASE 0.5 — Classify (read target files, determine domain)
After CodeSift setup, read the target file(s). Classify the primary domain:
- data: touches DB queries, transactions, ORMs, migrations
- async: touches promises, streams, workers, event emitters
- security: touches auth, input validation, secrets, crypto
- general: none of the above (or mixed)
Print: [CLASSIFIED] Domain: {data|async|security|general}
PHASE 1 — Conditional Load (based on domain)
| Include | data | async | security | general | |
|---|---|---|---|---|---|
../../rules/cq-checklist.md | Full | Full | Full | Full | |
../../shared/includes/env-compat.md | Full | Full | Full | Full | |
../../rules/cq-patterns.md | CQ6,7,9,16,17 focus | CQ15,17 focus | CQ4,5 focus | Full | |
../../rules/security.md | SKIP | SKIP | Full | SKIP | |
../../rules/file-limits.md | SKIP | SKIP | SKIP | Full |
Print loaded files:
DEFERRED — Load at completion
If PHASE 0 file missing: STOP. The plugin installation is incomplete.
Dispatch follows ../../shared/includes/execution-policy.md through env-compat. Reuse existing authorization within that policy; session restrictions take precedence. Run each required gate and report its actual independence or an unmet requirement.
Environment Compatibility
Read ../../shared/includes/env-compat.md for agent dispatch patterns, path resolution, and progress tracking across all supported platforms.
MANDATORY TOOL CALLS — Audit Validity Gate
This audit is INVALID if any tool below is skipped when its trigger condition holds. "DEFERRED", "N/A", "no diff vs prior audit", "--quick mode" are NOT valid reasons. The presence of trigger artifacts (a code file list, language detection, dep manifest) is what dictates the call — never delta or risk.
Required tool list
| Tool | Trigger | Reason | Skip allowed? | |
|---|---|---|---|---|
audit_scan | Always (any project with code files) | COMPOUND replacement for find_dead_code+search_patterns+find_clones+analyze_complexity+analyze_hotspots — primary CQ engine | NO | |
find_dead_code | Always | CQ13 unused exports across symbol graph (kept as fallback if audit_scan unavailable) | NO when audit_scan also unavailable | |
search_patterns(empty-catch) | Always | CQ8 empty-catch detection — TOOL-VERIFIED gate, only authoritative source | NO | |
find_clones | Always | CQ14 duplication ≥0.7 similarity — TOOL-VERIFIED gate | NO | |
scan_secrets | Always | CAP5 hardcoded secret pre-scan — every audit, every project | NO | |
trace_call_chain | --deep mode OR finding cites a function with cross-file impact | CQ4 ownership trace; required to verify "this is internal" claims | NO when --deep | |
| Stack-specific (nest_audit/framework_audit/python_audit/php_project_audit/etc.) | Framework/language detected | Stack-specific CQ patterns no generic scan reproduces | NO when language/framework matches |
Forbidden escape hatches
| Value | Forbidden when | Required value instead | |
|---|---|---|---|
audit_scan: DEFERRED | EVER | audit_scan: <findings_count> | |
scan_secrets: skipped (CAP5 covered manually) | EVER | scan_secrets: <count> | |
find_clones: N/A (--quick mode) | EVER | find_clones: <cluster_count> | |
codesift: unavailable | mcp__codesift__* was in deferred-tools session-start banner | codesift: deferred-not-preloaded (FAILURE: skill required preload) | |
retrospective: skipped | EVER | retrospective: appended (retros.log + retros.md) |
Required POSTAMBLE — retrospective + verify-audit gates
After the audit report is written, the audit is NOT complete until:
zuvo/audits/code-quality-audit-<date>.md(orzuvo/audits/code-audit-<date>.md) is on disk — at the project root (zuvo/resolves viagit rev-parse --show-toplevel; override$ZUVO_OUTPUT_DIR. See../../shared/includes/report-output-location.md).~/.zuvo/append-runlogis called with the Run line — this triggers BOTH:
- retro-gate: requires a matching
RETRO:entry in~/.zuvo/retros.logforskill=code-audit project=<this>. If missing → exit 2, runs.log NOT appended. - audit-content gate: runs
~/.zuvo/verify-auditon the report. Every Tier D/C finding (and every Tier B critical-gate-near-miss) must contain at least onepath/to/file.ext:LINEcitation that resolves in the current tree. Findings without citations get rejected. If rejected → fix the report (add file:line per finding), re-runappend-runlog.
- Print
RETRO_APPENDED: retros.log=YES retros.md=YES (verified)and confirm exit 0 fromappend-runlog.
If you reach the Run line and stop without calling append-runlog: the audit is INVALID regardless of finding count. The Validity Gate's gate_status flips to FAIL — postamble incomplete and the verdict overrides to INCOMPLETE.
Mandatory acknowledgment (REQUIRED — print verbatim before Phase 0)
CodeSift Integration
Use the deterministic preload helper FIRST. Before issuing any ToolSearch, run:
Copy the printed [CodeSift matching trace] block verbatim and issue the printed ToolSearch(query="select:...") line without modification. Math gate: [CodeSift loaded] tools=N must equal [Expected after load] tools=N from the helper. If they differ → [PRELOAD MATH MISMATCH] and abort before Phase 1.
CodeSift setup completed in PHASE 0. Use CodeSift tools for all discovery and analysis when available. If not found, fall back to Grep/Read/Glob and inform the user once.
After editing any file: index_file(path="/absolute/path/to/file")
CodeSift-Accelerated Discovery
When CodeSift is available, run these checks before the manual CQ evaluation to pre-populate deterministic findings:
find_dead_code(repo, file_pattern=SCOPE)-- Pre-populate CQ13 (unused exports). Mark as TOOL_VERIFIED.search_patterns(repo, "empty-catch")-- Pre-populate CQ8 (swallowed errors). Mark as TOOL_VERIFIED.find_clones(repo, min_similarity=0.8)-- Pre-populate CQ14 (duplicated logic blocks >10 lines). Mark as TOOL_VERIFIED.
TOOL_VERIFIED findings have deterministic HIGH confidence and bypass the confidence gate. They go directly to the report.
Manual CQ1-CQ40 evaluation still runs for all 40 gates. CodeSift pre-scan accelerates 3 of 29 checks.
Degraded Mode (CodeSift unavailable)
| CodeSift tool | Fallback | Lost capability | |
|---|---|---|---|
find_dead_code | Skip CQ13 pre-scan | No automated dead code detection | |
search_patterns("empty-catch") | Grep for catch\s*\( with empty body | Less precise pattern matching | |
find_clones | Skip CQ14 pre-scan | No automated clone detection | |
get_file_tree | find command | Slower, no symbol counts | |
get_file_outline | Read each file | More tokens consumed | |
trace_call_chain | Grep for imports | No transitive caller analysis | |
search_symbols | Grep for function names | Less precise results |
Phase 0: Discovery and Classification
0.1 Locate Production Files
When CodeSift is available: get_file_tree(repo, name_pattern="*.ts") (adjust extension per stack) with path filters excluding node_modules, .next, dist, __tests__.
When unavailable:
If the file count exceeds 80 and --deep was not explicitly requested, auto-switch to --quick mode. An explicit --deep flag always takes precedence.
0.2 Prioritize by Risk
When file count is large, process in this order:
- CRITICAL: Guards, middleware, auth files + controllers, handlers, routes (public attack surface)
- HIGH: Services, repositories, orchestrators, external API callers (business logic and data)
- MEDIUM: ORM entities, models, components with logic >100 lines (data handling and UI)
- LOW: Utilities, helpers, pure functions (least risk)
0.3 Classify Each File
Assign a code type to each file. This determines which CQ gates are high-risk and which conditional gates activate.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/code-audit/SKILL.md
Popularity
- Repository stars
- 8
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/greglas75/zuvo/code-audit)