Crates.io | pmat |
lib.rs | pmat |
version | 2.33.0 |
created_at | 2025-07-03 14:05:27.92401+00 |
updated_at | 2025-08-29 18:55:29.645279+00 |
description | PMAT - Zero-config AI context generation and code quality toolkit (CLI, MCP, HTTP) |
homepage | https://paiml.com |
repository | https://github.com/paiml/paiml-mcp-agent-toolkit |
max_upload_size | |
id | 1736295 |
size | 7,712,545 |
Zero-configuration AI context generation system with extreme quality enforcement and Toyota Way standards. Analyze any codebase instantly through CLI, MCP, or HTTP interfaces. Built by Pragmatic AI Labs.
π§ v2.14.0 Release: Technical Debt Elimination via TDD! Major fixes using Test-Driven Development:
- β Language Detection Fixed: Functions now properly detected (was 0, now detects all)
- π« Zero Stub Implementations: All stub code eliminated with real implementations
- π Complexity Reduced: Ruchy parser from 89 to β€4 cyclomatic complexity (95% reduction)
- π§ͺ TDD Coverage: 80%+ test coverage on critical language detection paths
- π Toyota Way Applied: ONE implementation principle, zero defect tolerance
π― v2.13.0: Technical Debt Grading (TDG) System! Complete code quality scoring with 6 orthogonal metrics:
- π Comprehensive Scoring: Structural complexity, semantic complexity, code duplication, coupling analysis
- π Documentation Coverage: Language-specific documentation pattern detection and scoring
- π¨ Consistency Analysis: Naming conventions, indentation patterns, and code style consistency
- π Grade Classification: A+ through F grading system with detailed component breakdowns
- π Multi-Language Support: 10+ languages including Rust, Python, JavaScript, TypeScript, Go, Java, C/C++
- π οΈ CLI & MCP Integration:
pmat analyze tdg
command and MCP tools for programmatic access- π Project Analysis: Directory-level analysis with language distribution and aggregated scoring
π v2.10.0: Claude Code Agent Mode - "Always Working" Achievement! Transform PMAT into a persistent background quality agent:
- π€ Claude Code Integration: Native MCP server for seamless Claude Code integration
- πΎ Persistent State: Monitoring state maintained across restarts with auto-save
- βοΈ Production Ready: Environment-specific configs for dev, prod, and CI/CD
- π Real-time Monitoring: Continuous quality tracking with file system watching
- ποΈ Service Architecture: Systemd deployment with health checks and auto-restart
π― v2.9.0: Universal Demo "Just Works" Achievement! Complete AI-powered repository intelligence with multi-language analysis:
- π€ AI-Powered Recommendations: Framework-aware repository recommendations with complexity-based learning tiers
- π Multi-Language Intelligence: Advanced polyglot analysis with cross-language dependency detection
- ποΈ Architecture Pattern Recognition: Microservices, Layered, Event-driven pattern detection with confidence scoring
- π Repository Showcase Gallery: Curated collection of 8+ repositories across languages and complexity levels
- β‘ Universal Demo: Any GitHub repository URL β Complete analysis with AI recommendations
- π Enhanced Web Demo: Interactive visualizations with 3 new API endpoints (/api/recommendations, /api/polyglot, /api/showcase)
- Toyota Way Excellence: Zero compilation defects maintained throughout development
Choose your preferred installation method - PMAT is available across all major package ecosystems:
cargo install pmat
# macOS/Linux - Homebrew
brew install pmat
# Windows - Chocolatey
choco install pmat
# Ubuntu/Debian - APT
sudo apt install pmat # (via PPA - coming soon)
# Arch Linux - AUR
yay -S pmat
# Node.js - npm (global)
npm install -g pmat-agent
# Latest version
docker run --rm -v $(pwd):/workspace paiml/pmat:latest pmat --version
# Interactive analysis
docker run --rm -v $(pwd):/workspace -w /workspace paiml/pmat:latest pmat context
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit
make build
# Linux/macOS Quick Install
curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
# Windows PowerShell
# Download from: https://github.com/paiml/paiml-mcp-agent-toolkit/releases
# Analyze current directory
pmat context
# Technical Debt Grading (TDG) - NEW!
pmat analyze tdg --path . --include-components
# Get complexity metrics
pmat analyze complexity --top-files 10
# Find technical debt
pmat analyze satd
# Analysis with timeout control - NEW! π§
pmat analyze complexity --timeout 30 # 30-second timeout
pmat analyze dead-code --timeout 60 # 60-second timeout
pmat analyze satd --timeout 45 # 45-second timeout
# Run quality gates
pmat quality-gate --strict
# Start MCP server
pmat mcp
# Analyze any GitHub repository with AI recommendations
cargo run --example analyze_github_repo -- --url https://github.com/rust-lang/rust-clippy
# Compare multiple repositories across languages
cargo run --example compare_repos
# Run quality gates on GitHub repositories
cargo run --example quality_gate_github -- https://github.com/owner/repo
# Start interactive web demo
pmat demo --serve
# Then visit http://localhost:8080 for:
# β’ AI-powered repository recommendations
# β’ Multi-language project intelligence
# β’ Repository showcase gallery
# β’ Interactive analysis visualizations
# Setup quality enforcement (one-time)
make setup-quality
# Start development with quality checks
make dev
# Create quality-enforced commit
make commit
# Verify sprint quality
make sprint-close
PMAT implements Toyota Production System principles through rigorous static analysis:
// Unified service layer with dependency injection
pub trait Service: Send + Sync {
type Input: Serialize + DeserializeOwned;
type Output: Serialize + DeserializeOwned;
async fn process(&self, input: Self::Input) -> Result<Self::Output, Self::Error>;
}
// All protocols use unified request/response
#[derive(Serialize, Deserialize)]
pub struct UnifiedRequest {
pub operation: Operation,
pub params: Value,
pub context: RequestContext,
}
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit
# Setup Toyota Way quality enforcement
make setup-quality
# Build and test
make build
make validate
# Run examples
make examples
[dependencies]
pmat = "2.33.0"
use pmat::services::code_analysis::CodeAnalysisService;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let service = CodeAnalysisService::new();
// Generate AI-optimized context
let context = service.generate_context(".", None).await?;
// Analyze complexity with Toyota Way standards
let complexity = service.analyze_complexity(".", Some(10)).await?;
Ok(())
}
PMAT provides 18 MCP tools via unified pmcp SDK server:
# Start MCP server (auto-detects transport)
pmat mcp
# Test with Claude Code
cargo run --example mcp_server_pmcp
cargo run --example test_pmcp_server
analyze_tdg
- NEW! Technical Debt Grading with 6-metric scoringanalyze_tdg_compare
- NEW! Compare TDG scores between files/projectsanalyze_complexity
- Complexity metricsanalyze_satd
- Technical debt detectionanalyze_dead_code
- Unused code analysisquality_gate
- Comprehensive quality validationrefactor_start
- Begin refactoring workflowpdmt_deterministic_todos
- Generate quality todosgithub_create_issue
- Create GitHub issuesTransform PMAT into a persistent background quality agent that continuously monitors your codebase:
# Start agent as MCP server for Claude Code
pmat agent mcp-server
# Configure in Claude Code settings.json:
{
"mcpServers": {
"pmat": {
"command": "pmat",
"args": ["agent", "mcp-server"],
"env": {}
}
}
}
# Start monitoring a project
pmat agent start --project-path /path/to/project
# Check monitoring status
pmat agent status
# Stop monitoring
pmat agent stop
start_quality_monitoring
- Begin monitoring a projectstop_quality_monitoring
- Stop monitoringget_quality_status
- Current quality metricsrun_quality_gates
- Execute quality checksanalyze_complexity
- Complexity analysishealth_check
- Agent health statusSee Claude Code Agent Guide for detailed setup and deployment instructions.
# AI-powered repository recommendations
GET /api/recommendations
# Multi-language project intelligence
GET /api/polyglot
# Repository showcase gallery
GET /api/showcase
# Core analysis APIs
GET /api/summary
GET /api/metrics
GET /api/hotspots
GET /api/dag
PMAT enforces extreme quality standards:
# Run comprehensive quality analysis
pmat quality-gate --strict
# CI/CD integration
pmat analyze complexity --fail-on-violation
pmat analyze satd --fail-on-violation
pmat quality-gate --strict --fail-on-violation
PMAT follows Toyota Way development principles:
make setup-quality
make dev
make commit
make sprint-close
All contributions must meet:
See CONTRIBUTING.md for detailed guidelines.
Licensed under the MIT License. See LICENSE for details.
Built with β€οΈ by Pragmatic AI Labs