Expand description
§PMAT (Professional Project Quantitative Analysis Toolkit)
A comprehensive toolkit for project analysis, quality assurance, and technical debt management. PMAT provides multiple interfaces (CLI, MCP, HTTP API) for analyzing code quality, complexity, and generating actionable insights for software development teams.
§Core Modules
§Analysis Engines
complexity- Code complexity analysis using AST parsingentropy- Actionable entropy analysis for pattern detectiontdg- Technical Debt Grading system with persistent scoring- [
wasm] - WebAssembly quality assurance and verification
§Quality Assurance
qdd- Quality-Driven Development with automated code generationservices- Core analysis services and quality gatesmodels- Data models for analysis results and reports
§Interface Modules
cli- Command-line interface with 25+ commandsmcp_server- Model Context Protocol server implementationhandlers- HTTP API handlers for REST endpoints- [
demo] - Demo server and showcase functionality
§Infrastructure
- [
agent] - Claude Code Agent Mode implementation ast- Unified AST module for multi-language parsingcontracts- Uniform contracts across ALL interfaces (CLI, MCP, HTTP)protocol- Unified protocol design per SPECIFICATION.md Section 3utils- Common utilities and helpers
§Quick Start Examples
§Basic Usage
ⓘ
use pmat::{MetadataCache, ContentCache};
use std::sync::Arc;
use tokio::sync::RwLock;
use lru::LruCache;
use std::num::NonZeroUsize;
// Create caches for template management
let metadata_cache: MetadataCache = Arc::new(RwLock::new(
LruCache::new(NonZeroUsize::new(100).expect("internal error"))
));
let content_cache: ContentCache = Arc::new(RwLock::new(
LruCache::new(NonZeroUsize::new(50).expect("internal error"))
));
// Caches are ready for use
assert!(metadata_cache.read().await.len() == 0);
assert!(content_cache.read().await.len() == 0);§Template Server Implementation
ⓘ
use pmat::{TemplateServerTrait, S3Client};
use anyhow::Result;
use std::sync::Arc;
// Example template server implementation
struct MyTemplateServer {
client: S3Client,
}
#[async_trait::async_trait]
impl TemplateServerTrait for MyTemplateServer {
async fn get_template_metadata(&self, uri: &str) -> Result<Arc<pmat::PublicTemplateResource>> {
// Implementation would fetch from storage
Ok(Arc::new(PublicTemplateResource::default()))
}
async fn get_template_content(&self, s3_key: &str) -> Result<Arc<str>> {
// Implementation would fetch content from S3
Ok(Arc::from("template content"))
}
async fn list_templates(&self, prefix: &str) -> Result<Vec<Arc<pmat::PublicTemplateResource>>> {
// Implementation would list templates with prefix filter
Ok(vec![])
}
fn get_metadata_cache(&self) -> Option<&pmat::MetadataCache> {
None // Optional caching
}
}
let server = MyTemplateServer { client: S3Client };
// Server is ready to handle template requestsRe-exports§
pub use crate::models::template::TemplateResource as PublicTemplateResource;pub use crate::services::renderer::TemplateRenderer as PublicTemplateRenderer;pub use models::error::TemplateError;pub use models::template::ParameterSpec;pub use models::template::ParameterType;pub use services::template_service::generate_template;pub use services::template_service::list_templates;pub use services::template_service::scaffold_project;pub use services::template_service::search_templates;pub use services::template_service::validate_template;
Modules§
- ast
- Unified AST module for cross-language code analysis
- cli
- CLI module for the paiml-mcp-agent-toolkit
- cli_
exit - Process exit codes, declared by the site that raises the error.
- contracts
- Unified contract definitions for ALL interfaces (CLI, MCP, HTTP)
- docs_
enforcement - Documentation Enforcement
- entropy
- Actionable Entropy Analysis Module
- explain
- Centralized check/metric explanation registry.
- graph
- handlers
- maintenance
- Maintenance system for managing roadmaps and tickets.
- mcp
- mcp_
pmcp - High-performance MCP server implementation using the pmcp SDK
- mcp_
server - models
- Core data models for PMAT.
- prompts
- protocol
- Unified Protocol Design implementation per SPECIFICATION.md Section 3
- qdd
- Quality-Driven Development (QDD) Tool
- quality
- red_
team - roadmap
- Roadmap management with PDMT todo generation and quality gate enforcement
- scaffold
- Scaffolding system for generating projects and agents.
- services
- Core services for code analysis and refactoring.
- state
- stateless_
server - tdg
- test_
performance - Performance testing module for SPECIFICATION.md Section 30
- unified_
quality - Unified Quality Enforcement System
- utils
- Utility functions and helpers for PMAT.
- viz
- Terminal Graph Visualization Module
Macros§
- __
kaizen0178_ schema_ const - Compile-time tool schema lookup by literal tool name.
- impl_
service_ adapter - Macro to quickly implement Service trait for adapted services
- record_
telemetry - Convenience macro for recording operation telemetry
- status_
eprintln eprintln!for status/progress chatter: silent under--quiet.- status_
println println!for status/progress chatter: silent under--quiet.- tool_
metadata - Expand to
pmcp::types::ToolInfofor$name, with a schema lookup that cannot silently fall back to an empty schema.
Structs§
- S3Client
- Placeholder S3 client for template storage operations.
- Template
Server - Template server.
Traits§
- Template
Server Trait - Template server trait defining the interface for template management operations.
Type Aliases§
- Content
Cache - Shared cache for template content with LRU eviction policy.
- Metadata
Cache - Shared cache for template metadata with LRU eviction policy.