Slim Audit
Invoke as $slim-audit.
Use this skill when the user wants to identify opportunities to reduce lines of code while maintaining or improving functionality, performance, and code quality.
Process
- Read project context (CLAUDE.md, specs, docs, conventions).
- Determine scope (specific path from arguments, or entire project).
- Analyze for reduction opportunities:
- Duplicate and near-duplicate code that can be consolidated.
- Over-abstraction: unnecessary wrappers, adapters, single-implementation interfaces.
- Verbose patterns with idiomatic shorter equivalents (optional chaining, collection methods, etc.).
- Redundant logic: duplicate validation, always-true branches, redundant conversions.
- Hand-rolled implementations replaceable by already-imported dependencies.
- Structural bloat: unnecessary barrel files, excessive file splitting, boilerplate.
- Cross-reference findings against specs/docs — skip intentionally verbose patterns.
- Estimate LOC savings, risk level, and effort for each opportunity.
- Cross-reference with git history for context and prioritization.
- Verify findings (false-positive filter):
- Re-read actual source code for every finding. Confirm duplicates are genuine, wrappers don't handle hidden edge cases, replacements are behaviorally equivalent, and redundant checks are truly redundant.
- Drop any finding you cannot re-confirm on second read. If uncertain, move to "Needs Investigation."
Output
- Summary: total opportunities, estimated LOC reduction, risk breakdown
- High-Value Reductions: low risk, high savings — with location, category, savings, and proposed approach
- Medium-Value Reductions: moderate savings or risk
- Low-Value Reductions: small wins worth tracking
- Behavior Change Risk: reductions that may alter visible behavior
- Intentional Decisions: verbose patterns kept for documented reasons
- Needs Investigation: ambiguous findings needing manual review
Constraints
- Never automatically modify code — only report.
- Functionality preservation is the top priority — every recommendation must preserve existing behavior.
- Do not recommend reductions that trade LOC for readability.
- Do not suggest adding new dependencies — only use what's already imported.
- Do not flag test code unless reduction clearly improves maintainability.
- Be specific with file paths and line numbers.
Alignment Page
Follow the shared alignment-page convention via the packaged convention resolver; output path is alignment/slim-audit-{topic}.html.
Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
1---2name: slim-audit3description: Audit codebase for opportunities to reduce lines of code while preserving functionality, performance, and quality4---56# Slim Audit78Invoke as `$slim-audit`.910Use this skill when the user wants to identify opportunities to reduce lines of code while maintaining or improving functionality, performance, and code quality.1112## Process13141. Read project context (CLAUDE.md, specs, docs, conventions).152. Determine scope (specific path from arguments, or entire project).163. Analyze for reduction opportunities:17 - Duplicate and near-duplicate code that can be consolidated.18 - Over-abstraction: unnecessary wrappers, adapters, single-implementation interfaces.19 - Verbose patterns with idiomatic shorter equivalents (optional chaining, collection methods, etc.).20 - Redundant logic: duplicate validation, always-true branches, redundant conversions.21 - Hand-rolled implementations replaceable by already-imported dependencies.22 - Structural bloat: unnecessary barrel files, excessive file splitting, boilerplate.234. Cross-reference findings against specs/docs — skip intentionally verbose patterns.245. Estimate LOC savings, risk level, and effort for each opportunity.256. Cross-reference with git history for context and prioritization.267. Verify findings (false-positive filter):27 - Re-read actual source code for every finding. Confirm duplicates are genuine, wrappers don't handle hidden edge cases, replacements are behaviorally equivalent, and redundant checks are truly redundant.28 - Drop any finding you cannot re-confirm on second read. If uncertain, move to "Needs Investigation."2930## Output3132- **Summary**: total opportunities, estimated LOC reduction, risk breakdown33- **High-Value Reductions**: low risk, high savings — with location, category, savings, and proposed approach34- **Medium-Value Reductions**: moderate savings or risk35- **Low-Value Reductions**: small wins worth tracking36- **Behavior Change Risk**: reductions that may alter visible behavior37- **Intentional Decisions**: verbose patterns kept for documented reasons38- **Needs Investigation**: ambiguous findings needing manual review3940## Constraints4142- Never automatically modify code — only report.43- Functionality preservation is the top priority — every recommendation must preserve existing behavior.44- Do not recommend reductions that trade LOC for readability.45- Do not suggest adding new dependencies — only use what's already imported.46- Do not flag test code unless reduction clearly improves maintainability.47- Be specific with file paths and line numbers.484950## Alignment Page5152Follow the shared alignment-page convention via the packaged convention resolver; output path is `alignment/slim-audit-{topic}.html`.5354## Default Shipping Contract5556Follow the shared shipping contract convention in CLAUDE.md.