c4-architecture-c4-architecture

Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.

Author

Install

Hot:32

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-c4-architecture-c4-architecture&locale=en&source=copy

C4 Architecture Documentation Workflow

Skill Overview


Automatically generate complete C4 architecture documentation for an existing codebase using a bottom-up analysis approach, synthesizing architecture views layer by layer from code level to system level.

Applicable Scenarios


  • Taking over an existing project: Quickly understand the architecture and component relationships of an unfamiliar codebase, reducing onboarding time

  • Architecture documentation maintenance: Automatically update architecture documentation after code changes to keep docs in sync with code

  • Team architecture communication: Provide a unified architecture view for technical reviews, design discussions, and knowledge sharing
  • Core Features


  • Code-level analysis: Perform bottom-up analysis of each code directory to generate comprehensive documentation including function signatures, class definitions, and dependency relationships

  • Component and container mapping: Synthesize code elements into logical components and map them to actual deployment containers, generating OpenAPI specifications

  • System context modeling: Create user personas, user journeys, and external system dependency diagrams readable by non-technical stakeholders
  • Frequently Asked Questions

    What layers does the C4 architecture documentation include?


    The C4 model includes four layers: Context (system context), Container, Component, and Code. This workflow starts from the lowest code level and synthesizes upward layer by layer, ultimately generating a complete set of architecture documents. Most teams find the Context and Container layers sufficient; this workflow generates all four layers for teams to choose as needed.

    Do the generated documents require manual edits?


    The workflow provides automated base documentation but it is recommended to review and adjust manually based on actual conditions. In particular, the user personas and business scenario descriptions in the Context layer should be supplemented with real business context. API documentation and code dependency relationships are generally more accurate and can often be used directly.

    Which programming languages and project types are supported?


    This workflow generates documentation by analyzing code directory structures and file contents, and in theory supports all programming languages. It performs best at recognizing code structures for major languages like Python, JavaScript, TypeScript, Java, and Go. It supports documentation generation for various deployment models including monolithic applications, microservices, and serverless architectures.