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 quality4type: analysis5version: v0.16required_conventions: [alignment-page]7metadata:8 source: https://skillmd.com/skills/georgeqle/slim-audit9---1011# Slim Audit1213Invoke as `$slim-audit`.1415Use this skill when the user wants to identify opportunities to reduce lines of code while maintaining or improving functionality, performance, and code quality.1617## Process18191. Read project context (CLAUDE.md, specs, docs, conventions).202. Determine scope (specific path from arguments, or entire project).213. Analyze for reduction opportunities:22 - Duplicate and near-duplicate code that can be consolidated.23 - Over-abstraction: unnecessary wrappers, adapters, single-implementation interfaces.24 - Verbose patterns with idiomatic shorter equivalents (optional chaining, collection methods, etc.).25 - Redundant logic: duplicate validation, always-true branches, redundant conversions.26 - Hand-rolled implementations replaceable by already-imported dependencies.27 - Structural bloat: unnecessary barrel files, excessive file splitting, boilerplate.284. Cross-reference findings against specs/docs — skip intentionally verbose patterns.295. Estimate LOC savings, risk level, and effort for each opportunity.306. Cross-reference with git history for context and prioritization.317. Verify findings (false-positive filter):32 - 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.33 - Drop any finding you cannot re-confirm on second read. If uncertain, move to "Needs Investigation."3435## Output3637- **Summary**: total opportunities, estimated LOC reduction, risk breakdown38- **High-Value Reductions**: low risk, high savings — with location, category, savings, and proposed approach39- **Medium-Value Reductions**: moderate savings or risk40- **Low-Value Reductions**: small wins worth tracking41- **Behavior Change Risk**: reductions that may alter visible behavior42- **Intentional Decisions**: verbose patterns kept for documented reasons43- **Needs Investigation**: ambiguous findings needing manual review4445## Constraints4647- Never automatically modify code — only report.48- Functionality preservation is the top priority — every recommendation must preserve existing behavior.49- Do not recommend reductions that trade LOC for readability.50- Do not suggest adding new dependencies — only use what's already imported.51- Do not flag test code unless reduction clearly improves maintainability.52- Be specific with file paths and line numbers.535455## Alignment Page5657Follow the shared alignment-page convention via the packaged convention resolver; output path is `alignment/slim-audit-{topic}.html`.5859## Default Shipping Contract6061Follow the shared shipping contract convention in CLAUDE.md.