Code Quality Analysis with PMAT

Analyze code quality and technical debt with PMAT metrics.

161|27|Updated May 25, 2025
One-click install
npx skills add https://github.com/paiml/paiml-mcp-agent-toolkit --skill code-quality-analysis-with-pmat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Quality Analysis with PMAT
Source: https://github.com/paiml/paiml-mcp-agent-toolkit/tree/main/.claude/skills/pmat-quality
Command: npx skills add https://github.com/paiml/paiml-mcp-agent-toolkit --skill code-quality-analysis-with-pmat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill analyzes code quality, complexity, and technical debt using PMAT to help engineers understand hotspots and plan improvements.

Core Features & Use Cases

  • Quick Quality Overview: High-level health score and language-agnostic metrics.
  • Detailed Complexity: Cyclomatic and cognitive complexity per function.
  • SATD & Dead Code: Detect technical debt annotations and unused code.
  • Contextual Guidance: Use results to guide refactoring and quality gates.

Quick Start

  1. Quick quality snapshot: pmat analyze quality --path <file_or_directory>
  2. Detailed complexity: pmat analyze complexity --path <file_or_directory>
  3. Dead code detection: pmat analyze dead-code --path <file_or_directory>
  4. SATD detection: pmat analyze satd --path <file_or_directory>
  5. Deep context (LLM-optimized): pmat context --output context.md --format llm-optimized

Frequently Asked Questions about Code Quality Analysis with PMAT

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze code quality and identify complexity hotspots?

Code quality analysis with PMAT measures cyclomatic and cognitive complexity per function, detects dead code and technical debt annotations, and generates a maintainability index to pinpoint hotspots across 25+ languages including Python, TypeScript, Java, Go, and Rust for actionable refactoring guidance.

Can I use PMAT to detect technical debt and SATD annotations in my codebase?

Yes. PMAT identifies self-admitted technical debt (SATD) comments and unused code, outputs metrics and annotations, and generates contextual recommendations to plan debt remediation and document improvement areas during code reviews and pull request preparation.

What languages does code quality analysis support?

PMAT analyzes code quality across 25+ languages including Rust, Python, TypeScript, JavaScript, Go, C++, Java, Ruby, PHP, and Swift, applying language-agnostic metrics like maintainability index and complexity scores to assess performance and maintainability concerns.

How do I get started with complexity and dead-code analysis?

Run pmat analyze quality for a health overview, pmat analyze complexity for per-function metrics, pmat analyze dead-code to detect unused code, and pmat context --format llm-optimized to generate deep context for refactoring decisions across your file or directory.

When should I run code quality analysis during development?

Apply PMAT during code reviews, refactoring phases, and pull request preparation to assess complexity, identify performance concerns, detect dead code, and guide simplification and extraction decisions before merging changes into your codebase.