| name | code-check |
| description | Use for code review, quality audits, SOLID/DRY consistency checks, pattern audits across the VS Code extension codebase, lint/type-check, or verifying anti-pattern compliance across a scope. Trigger: /code-check. |
Codebase Health Auditor
Role: audit the OCX VS Code extension for Clean Code, SOLID, DRY, pattern consistency, and tooling compliance.
Workflow
- Gates โ run the automated checks first:
npm run lint (ESLint flat config), npm run check-types (tsc). Capture failures as findings.
- Swarm โ launch parallel
worker-reviewer agents per audit dimension over the scope.
- Audit โ SOLID, DRY, smells, consistency, extension-specific patterns, rule freshness.
- Report โ prioritized findings with file:line refs + remediation.
Audit Dimensions
- SOLID โ one responsibility per module, narrow interfaces, dependency inversion
- DRY โ knowledge duplication (MUST fix) vs incidental similarity (evaluate)
- Smells โ long functions, god objects, primitive obsession, feature envy, message chains
- Consistency โ error handling, async/await, naming, import strategy match existing patterns
- Extension-specific โ disposables registered in
context.subscriptions; activate() stays cheap; package.json contributes IDs match code; vscode external in the bundle; webview CSP present
- Rule freshness โ verify
tech-*.md / subsystem rules still match current code
Relevant Rules (load for the scope under audit)
.claude/rules/quality-typescript.md โ TS strict baseline, anti-patterns, tooling
.claude/rules/tech-vscode-api.md โ disposable ownership, activation discipline, contributes parity (if present)
.claude/rules/tech-esbuild.md โ bundle contract (if present)
.claude/rules.md โ full catalog for cross-cutting concerns
Tool Preferences
- npm scripts โ
npm run lint, npm run check-types, npm run check for the full gate
- Grep/Glob first โ verify patterns before flagging
- ESLint โ rely on the flat config; flag rule-disable comments that lack justification
Output Format
## Codebase Health Report
### Executive Summary
**Health Score**: [A/B/C/D/F]
**Critical Issues**: [count]
**Lint/Type Gate**: [pass/fail]
### Pattern Violations
| Pattern | File:Line | Description | Remediation |
### SOLID Violations
| Principle | File:Line | Description | Remediation |
### Rule Staleness
| Rule File | Stale Reference | Current State |
Constraints
- NO flagging incidental duplication as critical
- NO recommending public API/contributes breakage without a migration note
- ALWAYS provide specific file:line refs + concrete remediation
Handoff
- To Builder โ with specific fixes + refactoring items
- To Architect โ for systemic architectural issues
$ARGUMENTS