prompt logo

prompt

Free

Turn any codebase into a queryable knowledge graph

FreeFree tier
Type
Open Source

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

Parse 28+ programming languages into AST-level entities (modules, classes, functions, variables, etc.)
Extract relational-schema nodes from SQL/DDL files
Model infrastructure (Terraform, Kubernetes, Docker, GitHub Actions) as deployment-topology nodes
Parse documentation (Markdown, ADRs, API specs) for design decisions and rationale
Build a property graph with 9 node types (Concept, Module, Type, Function, Variable, Schema, Resource, DesignRationale, CrossCuttingConcern) and 9 edge types
Capture inline annotations (#WHY, #NOTE, #HACK, #TODO, #FIXME) as DesignRationale nodes
Identify God Nodes – the top-5 most-connected concepts as entry points for new developers
Identify Surprising Connections linking different domains (e.g., frontend auth hook linked to DB)
Support multimodal assets: PDFs, images (ER diagrams, flowcharts), videos (demo recordings)

Pros & Cons

Pros
  • 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
Cons
  • 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

Best For

Codebase analysis and architectural documentationOnboarding new developers to large or complex projectsArchitectural review, refactoring, and identifying technical debtUnderstanding cross-module dependencies and hidden relationshipsGenerating a structured, queryable representation of software systems for analysisCapturing and preserving design rationale from comments and commit messages

FAQ

What input formats does the prompt support?
It accepts code in 28+ languages, SQL/DDL, infrastructure definitions (Terraform, CloudFormation, Kubernetes, Dockerfiles, GitHub Actions, Nix), documentation (Markdown, reST, RFCs, ADRs, API specs), and auxiliary assets (PDFs, images, videos).
What is a God Node?
God Nodes are the top-5 most-connected concepts in the generated knowledge graph. They serve as entry points for new developers because everything flows through them.
How does the prompt capture design rationale?
It extracts inline annotations such as #WHY:, #NOTE:, #HACK:, #TODO:, and #FIXME: as DesignRationale nodes, preserving the reasons behind architectural decisions.
What edge types are used in the graph?
Edge types include DEPENDS_ON, IMPORTS, CALLS, IMPLEMENTS, EXTENDS, PERSISTS_TO, DEPLOYS_ON, EXPLAINS, CROSS_CUTS, and SURPRISING_LINK.