prompt
FreeTurn any codebase into a queryable knowledge graph
About prompt
The Codebase Knowledge Graph Architect is a system prompt designed to be used with an AI model to transform a folder of code, schemas, infrastructure definitions, documentation, and multimodal assets into a structured, queryable knowledge graph. It goes beyond simple file summarization to surface latent structure, hidden cross-module dependencies, design rationale, and architectural tension points. The prompt defines an ontology of node types (Concept, Module, Type, Function, Variable, Schema, Resource, DesignRationale, CrossCuttingConcern) and edge types (DEPENDS_ON, IMPORTS, CALLS, IMPLEMENTS, EXTENDS, PERSISTS_TO, DEPLOYS_ON, EXPLAINS, CROSS_CUTS, SURPRISING_LINK) and outlines a two-phase analysis protocol: Extraction and Synthesis. It also includes advanced features like identifying God Nodes (most-connected concepts) and Surprising Connections across domains.
Key Features
Pros & Cons
- Generates a detailed, structured knowledge graph from static code and assets
- Reveals hidden dependencies and cross-domain connections that might otherwise be missed
- Captures design rationale from comments, ADRs, and commit messages
- Handles multiple input formats: code, SQL, infrastructure, documentation, and auxiliary files
- Identifies critical nodes (God Nodes) to help new developers navigate the codebase
- Flags surprising links that indicate architectural tension or cross-cutting concerns
- Requires manual execution of the prompt with an AI model (not an automated tool)
- The complex ontology may need customization for specific projects or languages
- Static analysis only – runtime behavior and dynamic dependencies are not captured
- Effectiveness depends on the AI model's ability to parse and reason about the input files
- Does not include a graphical visualization; output is a structured graph representation