$npx -y skills add huangjia2019/claude-code-engineering --skill code-health-checkPerform a comprehensive code health check on a directory. Use when the user asks to analyze code quality, find issues, or get a health report.
| 1 | # Code Health Check |
| 2 | |
| 3 | Analyze the codebase at `$ARGUMENTS` and produce a structured health report. |
| 4 | |
| 5 | ## Checks to Perform |
| 6 | |
| 7 | ### 1. File Organization |
| 8 | - Are files reasonably sized? (Flag files > 200 lines) |
| 9 | - Is the directory structure logical? |
| 10 | - Any files that look misplaced? |
| 11 | |
| 12 | ### 2. Error Handling |
| 13 | - Are async operations wrapped in try/catch? |
| 14 | - Are errors propagated correctly (not swallowed)? |
| 15 | - Is there a global error handler? |
| 16 | |
| 17 | ### 3. Security Basics |
| 18 | - Any hardcoded secrets, API keys, or passwords? |
| 19 | - Any use of `eval()` or similar dangerous functions? |
| 20 | - Are user inputs validated before use? |
| 21 | |
| 22 | ### 4. Code Quality |
| 23 | - Any obvious code duplication (similar blocks in multiple files)? |
| 24 | - Any unused variables or imports? |
| 25 | - Are function signatures reasonable (not too many parameters)? |
| 26 | |
| 27 | ### 5. Dependency Hygiene |
| 28 | - Are all imported modules actually used? |
| 29 | - Any circular dependencies? |
| 30 | |
| 31 | ## Severity Levels |
| 32 | |
| 33 | Use these to categorize issues: |
| 34 | |
| 35 | | Severity | Meaning | Example | |
| 36 | |----------|---------|---------| |
| 37 | | CRITICAL | Must fix immediately | Hardcoded secrets, SQL injection | |
| 38 | | WARNING | Should fix soon | Missing error handling, large files | |
| 39 | | INFO | Nice to improve | Minor duplication, naming conventions | |
| 40 | |
| 41 | ## Output Format |
| 42 | |
| 43 | Return a structured report in this exact format: |
| 44 | |
| 45 | ```markdown |
| 46 | # Code Health Report: {directory} |
| 47 | |
| 48 | ## Overall Score: {A/B/C/D/F} |
| 49 | |
| 50 | ## Summary |
| 51 | - Files analyzed: {count} |
| 52 | - Issues found: {critical} critical, {warning} warnings, {info} info |
| 53 | |
| 54 | ## Critical Issues |
| 55 | {list each with file:line and description} |
| 56 | |
| 57 | ## Warnings |
| 58 | {list each with file:line and description} |
| 59 | |
| 60 | ## Info |
| 61 | {list each with file:line and description} |
| 62 | |
| 63 | ## Recommendations |
| 64 | {top 3 actionable recommendations} |
| 65 | ``` |