From agents
Runs code metric tools (scc for LOC, lizard for cyclomatic complexity, jscpd for duplicate detection) to produce triage signals for audits, cleanup, and refactoring prioritization. Use when asked for code health metrics, complexity hotspots, duplicate code, LOC breakdown, technical debt signals, what to clean up first, pre-audit analysis, or to feed metric context into other skills like codebase-audit or simplify. Not a fix-it tool — it surfaces flags, not mandates.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agents:code-metricsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
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*.
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.
| 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).
codebase-audit, simplify, pr-review, or hunting-bugsCode Metrics Progress:
- [ ] Step 1: Check tool availability
- [ ] Step 2: Detect project shape and sensible exclusions
- [ ] Step 3: Run the tools the user asked for (or all three by default)
- [ ] Step 4: Verify flagged hotspots by reading source — skip noise
- [ ] Step 5: Produce a triage report
command -v scc
command -v lizard
command -v jscpd || command -v npx
If a tool is missing, tell the user how to install it and offer to proceed with what's available. Don't block the whole skill on one missing tool.
Install commands:
brew install scc (macOS) or go install github.com/boyter/scc/v3@latestpipx install lizard (never pip install system-wide on macOS — PEP 668 blocks it)npm i -g jscpd or use npx jscpd directlyLook at the project root to figure out what to exclude. Typical noise paths:
node_modules, .nuxt, .next, .output, dist, build, .turbo, .svelte-kittarget (Rust/Java), bin, obj (.NET)__pycache__, .venv, venvvendor (Go/PHP)*.gen.ts, **/generated/**, *.pb.go, *_pb2.py, etc. — these distort every metricSpot-check by globbing **/*.gen.* and **/generated/** before running, so you can exclude them.
For detailed flags, per-tool usage, and output interpretation see:
Quick combined run (adjust exclusions per project):
# LOC overview
scc --exclude-dir node_modules,.nuxt,.output,dist,build --no-cocomo
# Complexity warnings (CCN > 10)
lizard --exclude "node_modules/*" --exclude "**/*.gen.*" -T cyclomatic_complexity=10 -w
# Duplicates (scope to source dirs, don't scan whole tree)
jscpd --ignore "**/node_modules/**,**/*.gen.*,**/dist/**" --min-tokens 50 --reporters consoleFull ./src
For large repos, save output to /tmp/code-metrics/ rather than piping through the terminal — reports get long.
Do not blindly trust the signal. Always spot-read at least the worst offenders before putting them in the report.
Common false positives:
?? / || chains — lizard counts every null-coalescing operator as a branch. A CCN-40 "address formatter" is often just 40 optional fields, not tangled logic. See references/interpreting.md.When flagged code is real:
Organize findings so the reader (human or another skill/agent) can act:
file:line.Lead with the overlap section when present — a function that's both duplicated and high-complexity is the best cleanup ROI.
Other skills can invoke this one (or copy the tool invocations) when they need metric context:
When invoked for context rather than standalone, skip the narrative report and emit structured data (the raw tool output paths, or a bullet list of file:line metric=value).
Signals, not mandates:
Honest about scope:
Reproducible:
npx claudepluginhub saturate/agents --plugin skill-routerProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.