cpp-architecture

Analyzes C++ project dependencies and module boundaries using clang AST and Mermaid diagrams.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/chisuhua/home --skill cpp-architecture-chisuhua
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cpp-architecture
Source: https://github.com/chisuhua/home/tree/main/.config/opencode/skills/cpp-architecture
Command: npx skills add https://github.com/chisuhua/home --skill cpp-architecture-chisuhua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Understanding where a class is used, how modules depend on each other, and what the architecture of a large C++ codebase looks like is difficult without tooling. This Skill answers those questions by generating AST-based dependency analysis and visual architecture diagrams. ## Core Features & Use Cases - Dependency Analysis: Uses clang-check to generate an AST and trace where classes and symbols are used across the codebase. - Architecture Visualization: Generates Mermaid dependency graphs showing module boundaries and relationships. - Build Verification: Runs cmake --build to confirm the project still compiles after modifications. - Use Case: When you ask "where is this class used?" or "show me the module dependency graph", the Skill parses the project and produces a Mermaid diagram of the architecture. ## Quick Start Ask the assistant to analyze this C++ project and generate a Mermaid dependency graph of its modules.

Frequently Asked Questions about cpp-architecture

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

FAQPage Schema
How do I find where a C++ class is used in a large codebase?▼

Use clang-check to generate an AST of the project, then trace references to the class across translation units. This Skill automates that process and reports usage locations along with module dependency context.

How to generate a dependency graph for a C++ project?▼

Generate the project AST with clang-check, extract module and include relationships, then render them as a Mermaid diagram. The resulting graph visualizes module boundaries and dependency direction.

Does this work with CMake-based C++ projects?▼

Yes, the Skill uses cmake --build to verify the project compiles after analysis or modification. A working CMake build configuration is expected so compilation checks can run.

What are the limitations of AST-based dependency analysis?▼

AST analysis reflects compile-time structure, so it may miss runtime-only relationships like dynamic loading or reflection-based usage. Template-heavy code can also produce very large ASTs that are slower to process.