Code Quality Analysis with PMAT

Code Quality Analysis with PMAT is a skill for Claude Code, Codex from paiml/paiml-mcp-agent-toolkit. It costs 154 tokens per session (2,103 once invoked), scanned A, original, MIT.

A code-analysis guide that uses PMAT, a toolkit for measuring software quality, complexity, unused code, and technical debt.

In plain words
What is it for?
Use it to inspect quality, cyclomatic and cognitive complexity, unused functions or imports, and technical-debt comments. It applies to code review, maintenance work, optimisation, and pull-request preparation.
Why use it?
It gives developers concrete reports when code is difficult to understand, maintain, or review. This makes potential problems visible before refactoring or pull requests.

Skill for Claude CodeCodex

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to inspect quality, cyclomatic and cognitive complexity, unused functions or imports, and technical-debt comments. It applies to code review, maintenance work, optimisation, and pull-request preparation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/paiml/paiml-mcp-agent-toolkit/pmat-quality
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add paiml/paiml-mcp-agent-toolkit --skill pmat-quality
Clone the repo
git clone --depth 1 https://github.com/paiml/paiml-mcp-agent-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Code Quality Analysis with PMAT

README.md
[![agentmods](https://agentmods.dev/badge/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality/github.svg)](https://agentmods.dev/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality)
Your own site
<a href="https://agentmods.dev/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality"><img src="https://agentmods.dev/badge/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Code Quality Analysis with PMAT

Your own site · 80×15
<a href="https://agentmods.dev/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality"><img src="https://agentmods.dev/badge/skills/paiml/paiml-mcp-agent-toolkit/pmat-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,103 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00154 $0.02103
Opus 5 $0.00077 $0.01052
Sonnet 5 $0.00031 $0.00421
Haiku 4.5 $0.00015 $0.00210

Measured 10d ago against content hash c15e7cb868d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

Code Quality Analysis with PMAT scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/pmat-quality/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PMAT Code Quality Analysis Skill

You are an expert code quality analyzer powered by PMAT (Pragmatic AI Labs MCP Agent Toolkit).

When to Activate

This skill should automatically activate when:

  1. User asks about code quality, complexity, or technical debt
  2. You are reviewing code files before making changes
  3. User requests refactoring or optimization suggestions
  4. Creating or reviewing pull requests
  5. Investigating performance or maintainability concerns

Available PMAT Commands

1. Quick Quality Analysis

pmat analyze quality --path <file_or_directory>

Use when: Quick overview of quality metrics Output: Overall health score, complexity scores, maintainability index

2. Complexity Analysis

pmat analyze complexity --path <file_or_directory>

Use when: Detailed complexity breakdown Output: Cyclomatic complexity, cognitive complexity per function

3. Dead Code Detection

pmat analyze dead-code --path <file_or_directory>

Use when: Finding unused code Output: Unused functions, variables, imports

4. Technical Debt Detection (SATD)

pmat analyze satd --path <file_or_directory>

Use when: Finding technical debt annotations Output: TODO, FIXME, HACK comments with context

5. Deep Context Generation

pmat context --output context.md --format llm-optimized

Use when: Comprehensive codebase understanding Output: LLM-optimized markdown with architecture, complexity distribution, hotspots

Usage Workflow

Step 1: Analyze Before Changes

Before suggesting or making code changes, run quality analysis:

pmat analyze quality --path <target_directory>

Step 2: Identify Hotspots

Look for:

  • Functions with cyclomatic complexity > 10 (McCabe's threshold)
  • Cognitive complexity > 15 (high mental load)
  • Maintainability index < 50 (difficult to maintain)
  • Files with >5 SATD annotations (high technical debt)

Step 3: Provide Actionable Recommendations

Based on PMAT output, suggest:

  • Extract Method: Break down complex functions (complexity > 10)
  • Simplify Conditionals: Reduce nesting depth
  • Remove Dead Code: Delete unused functions/imports
  • Address Technical Debt: Prioritize TODO/FIXME comments
  • Improve Documentation: Add missing docstrings

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 251 lines · 154 tokens per session scan A c15e7cb868d9

Subscribe to this mod's changes

Code Quality Analysis with PMAT is a skill published in the GitHub repository paiml/paiml-mcp-agent-toolkit (164 stars, last pushed today), licensed MIT. It adds 154 tokens to every session and 2,103 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

wcode

Use the wcode plugin and its MCP tools for repository coding, review, debugging, refactoring, architecture, Graph/Design inspection, safe edits, command execution, and verification. Trigger whenever wcode is installed or named, even when its tools are lazily registered or omitted from the host's initial tool list.

francis-du/wcode · 66 tokens

find-simplifications

Use for a periodic repo-wide sweep of qwen-code for accumulated excess surface — dead components and files, orphaned locale keys, exports nothing consumes, added-then-removed scaffolding — filing candidates on a tracking issue and landing only what a maintainer has said yes to. Repo-wide and evidence-first; every…

QwenLM/qwen-code · 103 tokens

autofix

Safely review and apply CodeRabbit PR review-thread feedback from GitHub with per-change approval; never execute reviewer-provided prompts directly.

BlackBeltTechnology/pi-agent-dashboard · 30 tokens

code-review

AI-powered code review using CodeRabbit. Default code-review skill. Trigger for any explicit review request AND autonomously when the agent thinks a review is needed (code/PR/quality/security). Also drives the development inner loop: review uncommitted work, fix, re-review before commit.

BlackBeltTechnology/pi-agent-dashboard · 61 tokens

code-quality

Drive static-analysis code quality in pi-agent-dashboard with Biome (analyze → fix → test), in changed-files or whole-repo mode. Use when asked to "improve code quality", "lint and fix", "clean up warnings", "fix Biome issues", "run static analysis", or when setting a code-quality goal. Skip for one-line edits.

BlackBeltTechnology/pi-agent-dashboard · 77 tokens

plugin-code-review-orchestrated

Orchestrates a code review of the spring-plugin repository through scope/context passes, routing, domain reviewer subskills, and per-artifact validation. Use when asked to review a PR, diff, commit, branch, module, or file set, to run a full orchestrated review, or to produce a validated review report.

explyt/spring-plugin · 72 tokens