Deep Context Generation with PMAT
БесплатноБез исполняемых скриптовНе проверенGenerates comprehensive, LLM-optimized codebase context using PMAT (Pragmatic AI Labs MCP Agent Toolkit). Use this skill when: - Starting work on unfamiliar…
от paiml★ 171 звезда на GitHubОб этом скилле
PMAT Deep Context Generation Skill
You are an expert at generating comprehensive codebase context using PMAT (Pragmatic AI Labs MCP Agent Toolkit).
When to Activate
This skill should automatically activate when:
- User asks for codebase overview, architecture, or "how does this work?"
- Starting work on unfamiliar code ("I'm new to this project")
- Need to understand project structure before making changes
- Onboarding scenarios ("walk me through this codebase")
- Creating technical documentation or specifications
Core Command: pmat context
pmat context --output context.md --format llm-optimized
What it does:
- Scans entire codebase (respects .gitignore)
- Generates highly compressed markdown (60-80% smaller than raw code)
- Includes architecture diagrams (ASCII art tree structure)
- Provides complexity heatmaps and hotspot identification
- Extracts key abstractions (classes, functions, modules)
- Maps dependencies and import relationships
Performance:
- Small projects (<100 files): <500ms
- Medium projects (100-1K files): <2s
- Large projects (10K+ files): 5-15s
Usage Workflow
Step 1: Generate Full Context
When user needs comprehensive understanding:
pmat context --output deep_context.md --format llm-optimized
Then read the generated file:
cat deep_context.md
Step 2: Analyze the Context
Look for these key sections in the generated context:
Project Overview
- Language distribution
- Total files/lines of code
- Main entry points
Architecture Tree
- Directory structure
- Module organization
- Key components
Complexity Heatmap
- Files sorted by complexity score
- Hotspots requiring attention
- Maintainability indicators
Dependency Graph
- Import relationships
- Cross-module dependencies
- External libraries
Key Abstractions
- Classes and interfaces
- Public APIs
- Core data structures
Step 3: Answer User Questions
Use the generated context to:
- Explain architecture decisions
- Identify where to make changes
- Suggest refactoring targets
- Map feature implementation paths
Example Usage
Example 1: Quick Codebase Tour
# User: "Can you give me a quick tour of this codebase?"
# Step 1: Generate context
pmat context --output tour.md --format llm-optimized
# Step 2: Read and analyze
cat tour.md
# Step 3: Provide structured response
# "This is a Rust-based CLI tool with the following structure:
#
# **Core Architecture** (from tour.md lines 20-45):
# - `src/main.rs` - Entry point (85 LOC)
# - `src/cli/` - Command-line interface (12 files, 1,234 LOC)
# - `src/services/` - Business logic (45 files, 8,976 LOC)
# - `src/tdg/` - Technical Debt Grading system (23 files)
#
# **Key Components**:
# 1. Deep Context Analyzer (complexity: 45)
# 2. Quality Gate System (complexity: 32)
# 3. MCP Server (Model Context Protocol)
#
# **Complexity Hotspots** (from tour.md lines 120-135):
# - `services/deep_context.rs` - Highest complexity (342)
# - `tdg/analyzer.rs` - Medium complexity (128)
# ..."
Example 2: Find Implementation Location
# User: "Where should I add a new language analyzer?"
# Step 1: Generate context focused on language analyzers
pmat context --output lang_context.md --format llm-optimized
# Step 2: Grep for existing language analyzers
grep -n "LanguageAnalyzer" lang_context.md
# Step 3: Provide specific guidance
# "Based on the codebase context, add your new language analyzer here:
#
# **Location**: `src/services/languages/`
# **Pattern** (from lang_context.md):
# - Each language has its own file (rust.rs, python.rs, etc.)
# - Implement the `LanguageAnalyzer` trait
# - Register in `src/services/language_analyzer.rs:150`
#
# **Example structure**:
# ```rust
# // src/services/languages/kotlin.rs
# pub struct KotlinAnalyzer;
#
# impl LanguageAnalyzer for KotlinAnalyzer {
# fn analyze(&self, content: &str) -> Result<Analysis> {
# // Your implementation
# }
# }
# ```"
Example 3: Refactoring Guidance
# User: "I need to refactor the authentication module. Where should I start?"
# Step 1: Generate full context
pmat context --output refactor_context.md --format llm-optimized
# Step 2: Extract auth-related sections
grep -A 10 -B 2 "auth" refactor_context.md > auth_subset.md
# Step 3: Analyze complexity and dependencies
# "Based on the deep context analysis:
#
# **Current Auth Architecture** (from refactor_context.md):
# - `src/auth/` module (5 files, 892 LOC)
# - Complexity: 78 (HIGH - refactoring recommended)
# - Dependencies: 12 modules depend on this
#
# **Refactoring Strategy**:
# 1. Start with `auth/token.rs` (complexity: 45, lowest coupling)
# 2. Extract interface: `AuthProvider` trait
# 3. Implement: `JwtAuthProvider`, `OAuth2AuthProvider`
# 4. Update dependents (listed in refactor_context.md lines 234-256)
#
# **Risk Assessment**:
# - Medium risk: 12 dependent modules
# - Mitiga
Установить Deep Context Generation with PMAT в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteGlobGrepFAQ
Что делает скилл Deep Context Generation with PMAT?
Generates comprehensive, LLM-optimized codebase context using PMAT (Pragmatic AI Labs MCP Agent Toolkit). Use this skill when: - Starting work on unfamiliar codebases - Onboarding to new projects or repositories - Need quick understanding of project architecture - Preparing for refactoring or feature implementation - Creating documentation or technical specifications Outputs highly compressed markdown (60-80% reduction) optimized for LLM consumption. Supports 25+ languages with architecture visualization, complexity heatmaps, and dependency graphs.
Как установить скилл Deep Context Generation with PMAT?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Deep Context Generation with PMAT запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic