serena-code-architecture

Analyze codebase architecture and create knowledge graphs with Serena and Forgetful.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/Compass-Brand/compass-forge --skill serena-code-architecture-compass-brand
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serena-code-architecture
Source: https://github.com/Compass-Brand/compass-forge/tree/main/.claude/skills/serena-code-architecture
Command: npx skills add https://github.com/Compass-Brand/compass-forge --skill serena-code-architecture-compass-brand

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps software teams quickly understand and document complex codebases by translating code structure into a clear architectural view using Serena's symbol analysis and Forgetful's knowledge graph.

Core Features & Use Cases

  • Systematic structure discovery: identify the project layout, main modules, and entry points.
  • Dependency tracing and component mapping: map how components interact and depend on each other.
  • Knowledge graph and memory creation: produce a Forgetful memory and entity graph for future reference.

Quick Start

Use the Serena-based workflow to inspect a repository: list the top-level structure, locate entry points, and begin core component mapping. Example commands: mcp__plugin_serena_serena__list_dir({ "relative_path": ".", "recursive": false }) mcp__plugin_serena_serena__search_for_pattern({ "substring_pattern": "def main\(|if name.==.main", "restrict_search_to_code_files": true })

Frequently Asked Questions about serena-code-architecture

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

FAQPage Schema
How do I analyze a codebase's architecture and document existing code structure?

To analyze a codebase's architecture, you can use Serena's symbol-level understanding to systematically discover project layout, locate entry points, and map core component dependencies to produce a clear architectural view.

What is the best way to map dependencies and component interactions in a new codebase?

Mapping dependencies and component interactions is done by applying Serena's symbol analysis to trace how modules depend on each other, translating raw code structure into a clear architectural view and knowledge graph.

Can I generate a knowledge graph from code structure for future reference?

Yes, you can generate a knowledge graph and Forgetful memory from code structure by capturing component entities and their relationships, creating an entity graph for future architectural reference.

How do I locate entry points and main modules when analyzing an unfamiliar codebase?

You locate entry points and main modules by systematically discovering the project layout using Serena's directory listing and pattern search functions to inspect the repository structure and identify core components.

Does Serena work for systematic structure discovery in any software project?

Serena works for systematic structure discovery by using symbol-level understanding to inspect repositories, making it suitable for applying to new codebases and documenting existing architecture regardless of project scale.

What are the limitations of using knowledge graphs for codebase architecture documentation?

While knowledge graphs capture structure and dependencies for future reference, the documentation relies on symbol-level code analysis, meaning incomplete or highly dynamic code structures may limit the accuracy of the generated architectural view.