codebase-analysis

Generate a knowledge graph JSON from codebase directories and file relationships.

2|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/ran729/context-rot-skill --skill codebase-analysis-ran729
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-analysis
Source: https://github.com/ran729/context-rot-skill/tree/main/.claude/.claude/skills/codebase-analysis
Command: npx skills add https://github.com/ran729/context-rot-skill --skill codebase-analysis-ran729

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of understanding complex codebases by automatically generating a structured knowledge graph, making it easier to navigate, analyze, and document code architecture.

Core Features & Use Cases

  • Codebase Traversal: Systematically scans directories to identify repositories, applications, libraries, and files.
  • Knowledge Graph Generation: Creates a JSON output detailing nodes (files, directories, apps, libraries) and edges (relationships like 'contains', 'uses', 'dependsOn').
  • Entrypoint Detection: Identifies key application entry points (APIs, pages, CLIs, etc.) for better architectural overview.
  • Use Case: Quickly generate a visual map of a new microservice architecture to understand inter-service dependencies and identify potential structural issues before deployment.

Quick Start

Analyze the codebase at /Users/dev/my-project and output the knowledge graph to /Users/dev/output/knowledge-graph.json.

Frequently Asked Questions about codebase-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a knowledge graph from my codebase?

To generate a knowledge graph from your codebase, this Skill traverses your project directories to map code structures into a JSON file of nodes and edges. It systematically identifies files, directories, and their relationships.

How does code structure mapping work for understanding complex repositories?

Code structure mapping works by scanning directories to identify repositories, applications, libraries, and files, then translating them into graph nodes. It defines relationships like 'contains', 'uses', and 'dependsOn' as edges between these nodes.

Can this tool identify application entrypoints during code analysis?

Yes, the code analysis process includes entrypoint detection. It automatically identifies key application entry points such as APIs, pages, and CLIs to provide a clearer architectural overview within the generated knowledge graph.

What is the best way to map microservice dependencies before deployment?

The best way to map microservice dependencies is to generate a structured knowledge graph JSON. This approach details inter-service relationships and structural properties, helping you identify potential structural issues before deployment.

Does the generated codebase knowledge graph validate against a schema?

Yes, the generated knowledge graph is validated against a predefined schema. This ensures the output JSON correctly details nodes, edges, and properties representing your codebase architecture without structural errors.

What are the limitations of mapping code structure to a knowledge graph?

A limitation of mapping code structure to a knowledge graph is that the output is a static JSON representation of nodes and edges. It requires external tools to visualize the architecture and does not dynamically update without re-running the directory traversal.