code-metricslisted
Install: claude install-skill Saturate/agents
# Code Metrics
Measure a codebase with three cheap, fast tools to produce signals other skills (or humans) can act on. This skill **measures**, it does not **fix** — the output is a set of flags and hotspots, not a list of mandates. Many flagged items are legitimately fine; the point is to know *where to look*.
## What each tool tells you
| Tool | Measures | Best for |
|------|----------|----------|
| **scc** | Lines of code, file counts, per-language breakdown, rough complexity estimate | Sizing the codebase, spotting bloated files, before/after cleanup comparisons |
| **lizard** | Cyclomatic complexity (CCN), NLOC, token count, nesting depth — per function | Finding gnarly functions worth a second look |
| **jscpd** | Duplicate code blocks across files | Monorepo duplication, copy-paste debt, missing shared packages |
Use all three when you want broad coverage. Use one when the question is specific (e.g. "is there copy-paste?" → jscpd only).
## When to invoke this skill
- User asks for a code audit, health check, or "what should I clean up"
- Planning a refactor — which files/functions are worth attacking
- Feeding context to `codebase-audit`, `simplify`, `pr-review`, or `hunting-bugs`
- Before/after comparison on a cleanup PR
- Surfacing hotspots to prioritize test coverage or documentation
## Process
```
Code Metrics Progress:
- [ ] Step 1: Check tool availability
- [ ] Step 2: Detect project shape and sensible exclusions
- [ ] Step 3: Run the tools the user asked