project-health-auditor
Comprehensive codebase health analysis. Use when reviewing code quality, identifying technical debt, checking dependencies, or assessing project structure.
What this skill does
# Project Health Auditor > Inspired by [claude-code-plugins-plus](https://github.com/jeremylongshore/claude-code-plugins-plus) ## Purpose Analyze codebase health across multiple dimensions: code quality, dependencies, security, testing, documentation, and architecture. ## Audit Categories ### 1. Code Quality #### Complexity Analysis ```bash # Count lines per file (identify large files) find src -name "*.ts" -o -name "*.js" | xargs wc -l | sort -n # Find long functions (over 50 lines) # Check for deeply nested code # Identify duplicate code patterns ``` #### Code Smells | Smell | Indicator | Action | |-------|-----------|--------| | Long files | >500 lines | Split into modules | | Long functions | >50 lines | Extract methods | | Deep nesting | >4 levels | Flatten logic | | Many parameters | >5 params | Use objects | | Duplicate code | Similar blocks | Extract shared | | Dead code | Unused exports | Remove | | Magic numbers | Hardcoded values | Use constants | #### Checklist ```markdown ## Code Quality Audit - [ ] No files over 500 lines - [ ] No functions over 50 lines - [ ] No nesting deeper than 4 levels - [ ] No functions with >5 parameters - [ ] No obvious code duplication - [ ] No dead/unused code - [ ] Consistent naming conventions - [ ] Proper error handling ``` ### 2. Dependencies #### Dependency Health ```bash # Check outdated packages (npm) npm outdated # Check for vulnerabilities npm audit # Analyze bundle size npx webpack-bundle-analyzer # Check unused dependencies npx depcheck ``` #### Evaluation Criteria | Metric | Healthy | Warning | Critical | |--------|---------|---------|----------| | Outdated (major) | 0 | 1-3 | >3 | | Outdated (minor) | <5 | 5-10 | >10 | | Vulnerabilities | 0 | Low/Med | High/Crit | | Unused deps | 0 | 1-3 | >3 | | Bundle size | <500KB | 500KB-1MB | >1MB | #### Checklist ```markdown ## Dependencies Audit - [ ] No critical vulnerabilities - [ ] No high vulnerabilities - [ ] <3 major version updates pending - [ ] No unused dependencies - [ ] Lock file in sync - [ ] Bundle size reasonable ``` ### 3. Security #### Security Checks ```bash # Check for secrets in code grep -r "password\|secret\|api_key\|token" --include="*.ts" --include="*.js" # Check for hardcoded credentials grep -r "Bearer \|Basic " --include="*.ts" # Check .env is gitignored cat .gitignore | grep ".env" ``` #### Security Audit Points | Check | Concern | Solution | |-------|---------|----------| | Secrets in code | Credential exposure | Use env vars | | .env committed | Secret leak | Add to .gitignore | | SQL strings | SQL injection | Use parameterized queries | | User input in HTML | XSS | Sanitize/escape | | Outdated deps | Known vulns | Update regularly | | No rate limiting | DoS | Add rate limits | | No input validation | Injection | Validate all inputs | #### Checklist ```markdown ## Security Audit - [ ] No hardcoded secrets - [ ] .env files gitignored - [ ] Dependencies scanned for vulns - [ ] Input validation in place - [ ] Output encoding for XSS - [ ] SQL injection prevention - [ ] Authentication implemented - [ ] Authorization checks exist ``` ### 4. Testing #### Test Coverage Analysis ```bash # Run tests with coverage (npm/jest) npm test -- --coverage # Run tests with coverage (pytest) pytest --cov=src --cov-report=html ``` #### Coverage Standards | Metric | Good | Acceptable | Poor | |--------|------|------------|------| | Line coverage | >80% | 60-80% | <60% | | Branch coverage | >70% | 50-70% | <50% | | Function coverage | >80% | 60-80% | <60% | #### Checklist ```markdown ## Testing Audit - [ ] Unit tests exist - [ ] Integration tests exist - [ ] Line coverage >60% - [ ] Critical paths tested - [ ] Edge cases covered - [ ] Tests run in CI - [ ] Test execution <5 min - [ ] No flaky tests ``` ### 5. Documentation #### Documentation Inventory ```bash # Check for README ls README.md # Check for API docs ls docs/ || ls documentation/ # Check for inline docs (JSDoc, docstrings) grep -r "@param\|@returns\|Args:\|Returns:" src/ ``` #### Documentation Standards | Doc Type | Purpose | Required | |----------|---------|----------| | README.md | Project overview | Always | | CONTRIBUTING.md | Contribution guide | Open source | | API docs | Endpoint reference | APIs | | Code comments | Complex logic | As needed | | Architecture docs | System design | Large projects | | CHANGELOG.md | Version history | Libraries | #### Checklist ```markdown ## Documentation Audit - [ ] README exists and current - [ ] Installation instructions - [ ] Usage examples - [ ] API documentation - [ ] Contributing guide - [ ] License specified - [ ] Complex code documented ``` ### 6. Architecture #### Architecture Review | Aspect | Check | Concern | |--------|-------|---------| | Coupling | Import chains | Tight coupling | | Cohesion | Module size | God modules | | Layers | Directory structure | Layer violations | | Dependencies | Package.json | Circular deps | | Config | Hardcoded values | Environment issues | #### Common Issues ```markdown ## Architecture Smells - Circular dependencies - God classes/modules - Feature envy (cross-module reaching) - Shotgun surgery (changes touch many files) - Inappropriate intimacy (modules know too much) ``` #### Checklist ```markdown ## Architecture Audit - [ ] Clear module boundaries - [ ] No circular dependencies - [ ] Proper layer separation - [ ] Configuration externalized - [ ] Environment-specific settings - [ ] Scalability considered - [ ] Single responsibility ``` ## Health Report Template ```markdown # Project Health Report **Project:** [Name] **Date:** [Date] **Auditor:** Claude ## Summary | Category | Score | Status | |----------|-------|--------| | Code Quality | X/10 | ๐ข/๐ก/๐ด | | Dependencies | X/10 | ๐ข/๐ก/๐ด | | Security | X/10 | ๐ข/๐ก/๐ด | | Testing | X/10 | ๐ข/๐ก/๐ด | | Documentation | X/10 | ๐ข/๐ก/๐ด | | Architecture | X/10 | ๐ข/๐ก/๐ด | | **Overall** | **X/10** | **Status** | ## Critical Issues (Fix Immediately) 1. [Issue description] 2. [Issue description] ## High Priority (Fix Soon) 1. [Issue description] 2. [Issue description] ## Recommendations 1. [Recommendation] 2. [Recommendation] ## Technical Debt - [Debt item with estimated effort] - [Debt item with estimated effort] ``` ## Quick Commands ```bash # Full audit script echo "=== Code Stats ===" && cloc src/ echo "=== Dependencies ===" && npm outdated echo "=== Security ===" && npm audit echo "=== Test Coverage ===" && npm test -- --coverage echo "=== TODO/FIXME ===" && grep -r "TODO\|FIXME" src/ ```
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.