Generate High Density AST Architectural Passport for LLMs
generate_architectural_passportGenerates a compact, prompt-ready AST architectural passport for a Python source file, distilling module purpose, layer role, complexity, exports, and dependencies for LLM grounding.
Instructions
Generates an ultra-dense, prompt-ready AST architectural passport for a target source file, distinguishing from 'build_project_context' which outputs a multi-tier repository tree and 'generate_architecture_blueprint' which builds Mermaid diagrams by distilling module purpose, layer role, cyclomatic complexity, exported symbol contracts, and dependency topologies into a compact prompt block with up to 95% token savings.
Parameters:
file_path(str, required): Absolute or relative path to the Python source code file to analyze.
Behavior:
Mutability: Strictly read-only; does not modify source files or write to disk.
Idempotency: Deterministic AST extraction producing identical passports for identical source files.
Performance & Latency: Generates complete architectural passport in <20ms using local AST parsing.
Resources: Consumes <30MB RAM; zero disk footprint.
Privacy: 100% offline local processing; zero external network transmission.
Auth & Limits: Zero external credentials or API keys required; zero rate limits.
Error Handling: Returns clear error notification if target file is missing or unparseable.
Usage Guidelines:
When to use: Use when grounding LLMs on a specific module or service before authoring code, generating prompt-ready architectural contracts, or evaluating module complexity and layer boundaries.
When NOT to use: Do not use for entire repository multi-tier trees (use 'build_project_context' instead); do not use for graphical Mermaid visual diagrams (use 'generate_architecture_blueprint' instead).
Returns: Formatted Markdown architectural passport block ready for immediate LLM prompt ingestion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute or relative path to the Python source file to inspect. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |