Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
PAIML MCP Agent Toolkit (pmat)
Zero-configuration AI context generation system that analyzes any codebase instantly through CLI, MCP, or HTTP interfaces. Built by Pragmatic AI Labs with extreme quality standards and zero tolerance for technical debt.
๐ Installation
Install pmat using one of the following methods:
-
From Crates.io (Recommended):
-
With the Quick Install Script (Linux/macOS):
| -
From Source:
-
From GitHub Releases: Pre-built binaries for Linux, macOS, and Windows are available on the releases page.
Requirements
- Rust: 1.80.0 or later
- Git: For repository analysis
๐ Getting Started
Quick Start
# Analyze current directory
# Get complexity metrics for top 10 files
# Find technical debt
# Run comprehensive quality checks
Using as a Library
Add to your Cargo.toml:
[]
= "0.27.0"
Basic usage:
use ;
async
Key Features
๐ Code Analysis
- Deep Context Analysis - Comprehensive AST-based code analysis with defect prediction
- Complexity Analysis - Cyclomatic and cognitive complexity metrics
- Dead Code Detection - Find unused code across your project
- Technical Debt Gradient (TDG) - Quantify and prioritize technical debt
- SATD Detection - Find Self-Admitted Technical Debt in comments
- Code Duplication - Detect exact, renamed, gapped, and semantic clones
๐ ๏ธ Refactoring Tools
- AI-Powered Auto Refactoring -
pmat refactor autoachieves extreme quality standards- Single File Mode -
pmat refactor auto --single-file-mode --file path/to/file.rsfor targeted refactoring
- Single File Mode -
- Documentation Cleanup -
pmat refactor docsmaintains Zero Tolerance Quality Standards - Interactive Refactoring - Step-by-step guided refactoring with explanations
- Enforcement Mode - Enforce extreme quality standards using state machines
- Single File Mode -
pmat enforce extreme --file path/to/file.rsfor file-specific enforcement
- Single File Mode -
๐ Quality Gates
- Lint Hotspot Analysis - Find files with highest defect density using EXTREME Clippy standards
- Single File Mode -
pmat lint-hotspot --file path/to/file.rsfor targeted analysis
- Single File Mode -
- Provability Analysis - Lightweight formal verification with property analysis
- Defect Prediction - ML-based prediction of defect-prone code
- Quality Enforcement - Exit with error codes for CI/CD integration
๐ง Language Support
- Rust - Full support with cargo integration
- TypeScript/JavaScript - Modern AST-based analysis
- Python - Comprehensive Python 3 support
- Kotlin - Memory-safe parsing with full language support
- C/C++ - Tree-sitter based analysis
- WebAssembly - WASM binary and text format analysis
- AssemblyScript - TypeScript-like syntax for WebAssembly
- Makefiles - Specialized linting and analysis
๐ Tool Usage
CLI Interface
# Zero-configuration context generation
# Code analysis
# Analysis commands
# WebAssembly Support
# Project scaffolding
# Refactoring engine
# Demo and visualization
# Quality enforcement
MCP Integration (Claude Code)
# Add to Claude Code
Available MCP tools:
generate_template- Generate project files from templatesscaffold_project- Generate complete project structureanalyze_complexity- Code complexity metricsanalyze_code_churn- Git history analysisanalyze_dag- Dependency graph generationanalyze_dead_code- Dead code detectionanalyze_deep_context- Comprehensive analysisgenerate_context- Zero-config context generationanalyze_big_o- Big-O complexity analysis with confidence scoresanalyze_makefile_lint- Lint Makefiles with 50+ quality rulesanalyze_proof_annotations- Lightweight formal verificationanalyze_graph_metrics- Graph centrality and PageRank analysisrefactor_interactive- Interactive refactoring with explanations
HTTP API
# Start server
# API endpoints
# POST analysis
Recent Updates
๐ v0.26.3 - Quality Uplift
- SATD Elimination: Removed all TODO/FIXME/HACK comments from implementation.
- Complexity Reduction: All functions now below a cyclomatic complexity of 20.
- Extreme Linting:
make lintpasses with pedantic and nursery standards. - Single File Mode: Enhanced support for targeted quality improvements.
๐งน v0.26.1 - Documentation Cleanup (pmat refactor docs)
- AI-assisted documentation cleanup to maintain Zero Tolerance Quality Standards.
- Identifies and removes temporary files, outdated reports, and build artifacts.
- Interactive mode for reviewing files before removal with automatic backups.
๐ฅ v0.26.0 - New Analysis Commands
- Graph Metrics:
pmat analyze graph-metricsfor centrality analysis. - Name Similarity:
pmat analyze name-similarityfor fuzzy name matching. - Symbol Table:
pmat analyze symbol-tablefor symbol extraction. - Code Duplication:
pmat analyze duplicatesfor detecting duplicate code.
Zero Tolerance Quality Standards
This project follows strict quality standards:
- ZERO SATD: No TODO, FIXME, HACK, or placeholder implementations
- ZERO High Complexity: No function exceeds cyclomatic complexity of 20
- ZERO Known Defects: All code must be fully functional
- ZERO Incomplete Features: Only complete, tested features are merged
๐ Output Formats
- JSON - Structured data for tools and APIs
- Markdown - Human-readable reports
- SARIF - Static analysis format for IDEs
- Mermaid - Dependency graphs and diagrams
๐ฏ Use Cases
For AI Agents
- Context Generation: Give AI perfect project understanding
- Code Analysis: Deterministic metrics and facts
- Template Generation: Scaffolding with best practices
For Developers
- Code Reviews: Automated complexity and quality analysis
- Technical Debt: SATD detection and prioritization
- Onboarding: Quick project understanding
- CI/CD: Integrate quality gates and analysis
For Teams
- Documentation: Auto-generated project overviews
- Quality Gates: Automated quality scoring
- Dependency Analysis: Visual dependency graphs
- Project Health: Comprehensive health metrics
๐ Documentation
Explore our comprehensive documentation to get the most out of pmat.
Getting Started
- Architecture: Understand the system design and principles.
- CLI Reference: View the full command-line interface guide.
- API Documentation: Browse the complete Rust API documentation on docs.rs.
Usage Guides
- Feature Overview: Discover all available features.
- MCP Integration: Learn how to integrate
pmatwith AI agents. - CI/CD Integration: Set up quality gates in your CI/CD pipeline.
Development
- Contributing Guide: Read our guidelines for contributing to the project.
- Release Process: Follow our step-by-step release workflow.
๐ ๏ธ System Operations
Memory Management
For systems with low swap space, we provide a configuration tool:
๐งช Testing
The project uses a distributed test architecture for fast feedback:
# Run specific test suites
# Run all tests in parallel
# Coverage analysis
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Quick Start for Contributors
# Clone and setup
# Install dependencies
# Run tests
# Check code quality
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our Zero Tolerance Quality Standards
- Run
make lintandmake test-fastbefore committing - Submit a pull request with a clear description of changes
See CONTRIBUTING.md for detailed guidelines.
๐ License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Built with โค๏ธ by Pragmatic AI Labs