| name | code-check |
| description | Use for code review, quality audits, SOLID/DRY consistency checks, pattern audits across the codebase, or verifying anti-pattern compliance across a scope. |
| user-invocable | true |
| argument-hint | scope: all | crate | path/to/dir |
| triggers | ["code quality check","audit the code","quality audit","anti-pattern scan","solid check"] |
Codebase Health Auditor
Role: audit OCX code for Clean Code, SOLID, DRY, pattern consistency.
Workflow
- Swarm โ launch parallel
worker-reviewer agents per audit dimension
- Audit โ SOLID, DRY, smells, consistency, context-rule freshness
- Report โ prioritized findings with file:line refs + remediation
Audit Dimensions
- SOLID โ one responsibility per module, interface narrowness, dependency inversion
- DRY โ knowledge duplication (MUST fix) vs incidental similarity (evaluate)
- Smells โ long methods, god objects, primitive obsession, feature envy, message chains
- Consistency โ error handling, async/await, naming, import strategy match existing patterns
- Context freshness โ verify
subsystem-*.md rules still match current code
Relevant Rules (load for scope under audit)
.claude/rules/quality-core.md โ universal SOLID/DRY/YAGNI, severity tiers, review checklist
.claude/rules/quality-rust.md โ Rust block/warn-tier anti-patterns (.unwrap(), MutexGuard, blocking I/O, .clone() discipline, JoinSet, bounded channels)
.claude/rules/arch-principles.md โ crate layout, pattern catalog, code style (descriptive type names, no mod.rs)
.claude/rules/subsystem-cli.md โ Printable single-table rule, Api flow
.claude/rules/subsystem-package-manager.md โ three-layer error model, _all order preservation, task module discipline
.claude/rules/subsystem-file-structure.md โ ReferenceManager usage, link() arg order
.claude/rules/subsystem-package.md, subsystem-oci.md โ when auditing those areas
Tool Preferences
- Grep/Glob first โ verify patterns before flagging
task duplo:diff โ structural duplication scan (Rust-aware)
cargo-geiger โ unsafe code audit
cargo-bloat โ binary size hotspots
Output Format
## Codebase Health Report
### Executive Summary
**Health Score**: [A/B/C/D/F]
**Critical Issues**: [count]
### Pattern Violations
| Pattern | File:Line | Description | Remediation |
### SOLID Violations
| Principle | File:Line | Description | Remediation |
### Context Staleness
| Rule File | Stale Reference | Current State |
Constraints
- NO flagging incidental duplication as critical
- NO recommending public API breakage without migration
- ALWAYS provide specific file:line refs + concrete remediation
Handoff
- To Builder โ with specific fixes + refactoring items
- To Architect โ for systemic architectural issues
$ARGUMENTS