
Code metrics audit
Writes a dated static code metrics report with complexity, duplication, CBO and DIT
Code metrics audit is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 7
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Code metrics audit
This skill produces a dated audit report for the current repository that grades four static code metrics: cyclomatic complexity per function, the share of duplicated lines, efferent coupling between objects, and depth of inheritance tree. Each metric gets a pass, warn or fail status against a fixed threshold, along with counts of units in each status and lists of the worst offenders.
The workflow selects production source folders, excludes generated code, tests, migrations and fixtures, and runs analysers such as lizard and jscpd through ephemeral runners, keeping their output in a temporary folder outside the repository. Java coupling and inheritance are measured with CK, while other languages are computed from imports and class declarations. Before the first external run the skill asks the user for approval, and it marks any metric it cannot measure as not measured with a reason.
It expects a repository to audit, the ability to run uvx, npx or Java, and the shared audit contract that ships with the Nexa Claude plugin. The skill is invoked only explicitly through its slash command and writes a single markdown file under docs/audit.
When your agent uses it
Writes a dated code metrics audit report for the current repository: cyclomatic complexity, duplicated code percentage, coupling between objects (CBO), and depth of inheritance tree (DIT), each with a pass / warn / fail status against a fixed threshold. Static analysis only; runs no tests and no builds. Works on any repository and any tech stack. Writes only docs/audit/code-metrics-audit/code-metrics-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /code-metrics-audit — never inferred from user messages.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the nexa-claude-audit plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add nexadevapp/nexa-claude-skills-marketplace
/plugin install nexa-claude-audit@nexa-claude-marketplaceOr copy only this skill to ~/.claude/skills/code-metrics-audit:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/nexadevapp/nexa-claude-skills-marketplace.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/code-metrics-audit &&
cp -R "$tmp/nexa-claude-audit/skills/code-metrics-audit" ~/.claude/skills/code-metrics-audit &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/code-metrics-audit inside it instead.
Copy the skill folder to ~/.agents/skills/code-metrics-audit to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/nexadevapp/nexa-claude-skills-marketplace.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/code-metrics-audit &&
cp -R "$tmp/nexa-claude-audit/skills/code-metrics-audit" ~/.agents/skills/code-metrics-audit &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/code-metrics-audit inside it instead.
Copy the skill folder to ~/.cursor/skills/code-metrics-audit to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/nexadevapp/nexa-claude-skills-marketplace.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/code-metrics-audit &&
cp -R "$tmp/nexa-claude-audit/skills/code-metrics-audit" ~/.cursor/skills/code-metrics-audit &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/code-metrics-audit inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/nexadevapp/nexa-claude-skills-marketplace.git --path nexa-claude-audit/skills/code-metrics-auditOr copy the folder to ~/.gemini/skills/code-metrics-audit yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/code-metrics-audit:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/nexadevapp/nexa-claude-skills-marketplace.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/code-metrics-audit &&
cp -R "$tmp/nexa-claude-audit/skills/code-metrics-audit" ~/.copilot/skills/code-metrics-audit &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/code-metrics-audit inside it instead.
Get the folder:
git clone --depth 1 https://github.com/nexadevapp/nexa-claude-skills-marketplace.gitThen copy nexa-claude-skills-marketplace/nexa-claude-audit/skills/code-metrics-audit into your agent's skills folder as code-metrics-audit. Agents that support SKILL.md read one folder per skill.
What it does
- Cyclomatic complexity check
- Measures per-function complexity with lizard and reports average, P90, maximum and the worst functions.
- Duplication measurement
- Uses jscpd to find duplicated lines across included folders and lists the largest clone pairs.
- Coupling and inheritance metrics
- Computes efferent CBO and DIT per unit, using CK for Java and source parsing for other languages.
- Threshold status grading
- Assigns pass, warn or fail to each metric and unit according to a fixed threshold table.
- Static analysis only
- Runs no tests or builds and writes only the dated report file into the repository.
Good for
- Audit the complexity of functions across my codebase
- Find duplicated code blocks in this repository
- Report coupling between classes and modules
- Check inheritance depth in an object-oriented project
- Generate a dated code quality metrics report
Code metrics audit FAQ
What does the skill need to run?
It needs a repository and the ability to run ephemeral analysers such as uvx, npx or a Java JAR. If the runner is unavailable or the user declines, affected metrics are reported as not measured.
Does Code metrics audit change my repository?
No. Analyser output goes to a temporary folder outside the repository, and the only file written is the dated markdown report under docs/audit/code-metrics-audit.
When does Code metrics audit trigger?
Only when invoked explicitly with the /code-metrics-audit command. It is not inferred from ordinary user messages or run by other skills.
Which languages are supported?
The skill states it works on any repository and tech stack. Lizard supports many languages, CK handles Java, and Go, Rust and other languages use source-based methods with their own limits.
How do I install Code metrics audit in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/code-metrics-audit to use it in all your projects, or to .claude/skills/code-metrics-audit in one project. Or install the nexa-claude-audit plugin, which includes it: /plugin marketplace add nexadevapp/nexa-claude-skills-marketplace, then /plugin install nexa-claude-audit@nexa-claude-marketplace.
Does Code metrics audit run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Code metrics audit?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Code metrics audit?
The closest alternatives to Code metrics audit are Code quality audit, QA audit, Skill audit, Test efficacy audit and Quality audit.
Where this comes from
- Description: from the skill's own SKILL.md.
More from nexadevapp/nexa-claude-skills-marketplace

Writes a dated architecture audit report with Mermaid diagrams drawn from the code
- Open source
- 7 GitHub stars
- Developer tools

Writes a dated CI/CD audit report mapping pipelines, gates, and gaps in a repository
- Open source
- 7 GitHub stars
- Developer tools

Writes a dated report mapping a repository's infrastructure, environments and secret names
- Open source
- 7 GitHub stars
- Developer tools

Writes a dated mutation testing report for a repository's core business logic
- Open source
- 7 GitHub stars
- Developer tools

Writes a dated inventory of automated tests sorted into unit, integration, E2E and misc
- Open source
- 7 GitHub stars
- Developer tools

Writes a dated report tracing use cases to the tests that cover them in a repo
- Open source
- 7 GitHub stars
- Documentation review



