code-health
Analyze codebase health - large files, test coverage gaps, duplicate code, dead/legacy code, and documentation issues. Use when asked to scan, audit, or assess code quality, find refactoring targets, or identify technical debt.
What this skill does
# Code Health Analysis Run `scripts/health.py` to analyze codebase health. The script auto-detects project type (Go, Python, JS/TS) and runs appropriate checks. ## Usage **Primary (LLM/programmatic use):** ```bash # Full scan with JSON output (recommended for LLM consumption) python /path/to/skill/scripts/health.py --json [directory] # Specific checks with JSON output python /path/to/skill/scripts/health.py --check size --json [directory] python /path/to/skill/scripts/health.py --check tests --json [directory] python /path/to/skill/scripts/health.py --check dupes --json [directory] python /path/to/skill/scripts/health.py --check dead --json [directory] python /path/to/skill/scripts/health.py --check docs --json [directory] ``` **Secondary (human debugging):** ```bash # Human-readable output with emojis (for manual inspection) python /path/to/skill/scripts/health.py [directory] python /path/to/skill/scripts/health.py --check size [directory] ``` ## Checks | Check | Description | |-------|-------------| | `size` | Large files, function counts, git churn | | `tests` | Coverage gaps, missing test files, test quality | | `dupes` | Duplicate function names, similar patterns | | `dead` | Legacy markers, unused exports, stale code | | `docs` | Undocumented exports, missing READMEs | ## Output **JSON format (recommended):** Structured output for LLM/programmatic parsing with severity levels: - `"critical"`: Immediate attention needed - `"warning"`: Should address soon - `"info"`: Nice to fix Each finding includes file path, line number (when applicable), message, and suggested action. **Human-readable format (debugging only):** Pretty-printed output with emoji severity indicators (๐ด critical, ๐ก warning, ๐ข info) for manual inspection. ## AST-Based Function Analysis For more accurate function analysis, use the included AST parsers: ### gofuncs - Go Function Analyzer ```bash go run scripts/gofuncs.go -dir /path/to/project ``` **Output format:** `file:line:type:exported:name:receiver:signature` - `type`: `f`=function, `m`=method - `exported`: `y`=public, `n`=private **Example:** ```plain api.go:15:f:n:fetchItems:()[]Item config.go:144:m:y:GetCategory:*Mapper:(string)string ``` ### pyfuncs - Python Function Analyzer ```bash python scripts/pyfuncs.py --dir /path/to/project ``` **Output format:** `file:line:type:exported:name:class:signature:decorators` - `type`: `f`=function, `m`=method, `s`=staticmethod, `c`=classmethod, `p`=property - `exported`: `y`=public, `n`=private (underscore prefix) **Example:** ```plain main.py:15:f:y:process_data::(data:List[str])->Dict[str,int]: api.py:45:m:y:fetch:APIClient:async (url:str)->Response:cache,retry ``` ### jsfuncs - JavaScript/TypeScript Function Analyzer ```bash node scripts/jsfuncs.js --dir /path/to/project ``` **Output format:** `file:line:type:exported:name:class:signature:decorators` - `type`: `f`=function, `m`=method, `a`=arrow, `c`=constructor, `g`=getter, `s`=setter - `exported`: `y`=public, `n`=private **Example:** ```plain main.js:15:f:y:processData::(data:string[])=>Promise<Object>: api.ts:45:m:y:fetch:APIClient:async (url:string)=>Response: ``` ## Use Cases for AST Tools These tools provide accurate function-level analysis for: - **Complexity analysis**: Count functions per file, analyze parameter complexity - **Test coverage**: Identify which specific functions lack tests - **Duplicate detection**: Find similar function signatures across the codebase - **API surface analysis**: List all public vs private functions - **Documentation gaps**: Cross-reference with doc comments Combine with `health.py` for comprehensive codebase health analysis. ## Requirements Required: `python3` Optional (for better results): `rg` (ripgrep), `fd`, `git`, `go` (for Go projects), `staticcheck`, `node` (for JS/TS projects) Missing tools are reported but don't block execution.
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations โ diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.