c4-architecture-c4-architecture

16
1
Source

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

Install

mkdir -p .claude/skills/c4-architecture-c4-architecture && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7074" && unzip -o skill.zip -d .claude/skills/c4-architecture-c4-architecture && rm skill.zip

Installs to .claude/skills/c4-architecture-c4-architecture

About this skill

C4 Architecture Documentation Workflow

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

[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]

Use this skill when

  • Working on c4 architecture documentation workflow tasks or workflows
  • Needing guidance, best practices, or checklists for c4 architecture documentation workflow

Do not use this skill when

  • The task is unrelated to c4 architecture documentation workflow
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Overview

This workflow creates comprehensive C4 architecture documentation following the official C4 model by:

  1. Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
  2. Component Level: Synthesizing code documentation into logical components within containers
  3. Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
  4. Context Level: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)

Note: According to the C4 model, you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.

All documentation is written to a new C4-Documentation/ directory in the repository root.

Phase 1: Code-Level Documentation (Bottom-Up Analysis)

1.1 Discover All Subdirectories

  • Use codebase search to identify all subdirectories in the repository
  • Sort directories by depth (deepest first) for bottom-up processing
  • Filter out common non-code directories (node_modules, .git, build, dist, etc.)
  • Create list of directories to process

1.2 Process Each Directory (Bottom-Up)

For each directory, starting from the deepest:

  • Use Task tool with subagent_type="c4-architecture::c4-code"

  • Prompt: | Analyze the code in directory: [directory_path]

    Create comprehensive C4 Code-level documentation following this structure:

    1. Overview Section:
      • Name: [Descriptive name for this code directory]
      • Description: [Short description of what this code does]
      • Location: [Link to actual directory path relative to repo root]
      • Language: [Primary programming language(s) used]
      • Purpose: [What this code accomplishes]
    2. Code Elements Section:
      • Document all functions/methods with complete signatures:
        • Function name, parameters (with types), return type
        • Description of what each function does
        • Location (file path and line numbers)
        • Dependencies (what this function depends on)
      • Document all classes/modules:
        • Class name, description, location
        • Methods and their signatures
        • Dependencies
    3. Dependencies Section:
      • Internal dependencies (other code in this repo)
      • External dependencies (libraries, frameworks, services)
    4. Relationships Section:
      • Optional Mermaid diagram if relationships are complex

    Save the output as: C4-Documentation/c4-code-[directory-name].md Use a sanitized directory name (replace / with -, remove special chars) for the filename.

    Ensure the documentation includes:

    • Complete function signatures with all parameters and types
    • Links to actual source code locations
    • All dependencies (internal and external)
    • Clear, descriptive names and descriptions
  • Expected output: c4-code-<directory-name>.md file in C4-Documentation/

  • Context: All files in the directory and its subdirectories

Repeat for every subdirectory until all directories have corresponding c4-code-*.md files.

Phase 2: Component-Level Synthesis

2.1 Analyze All Code-Level Documentation

  • Collect all c4-code-*.md files created in Phase 1
  • Analyze code structure, dependencies, and relationships
  • Identify logical component boundaries based on:
    • Domain boundaries (related business functionality)
    • Technical boundaries (shared frameworks, libraries)
    • Organizational boundaries (team ownership, if evident)

2.2 Create Component Documentation

For each identified component:

  • Use Task tool with subagent_type="c4-architecture::c4-component"

  • Prompt: | Synthesize the following C4 Code-level documentation files into a logical component:

    Code files to analyze: [List of c4-code-*.md file paths]

    Create comprehensive C4 Component-level documentation following this structure:

    1. Overview Section:
      • Name: [Component name - descriptive and meaningful]
      • Description: [Short description of component purpose]
      • Type: [Application, Service, Library, etc.]
      • Technology: [Primary technologies used]
    2. Purpose Section:
      • Detailed description of what this component does
      • What problems it solves
      • Its role in the system
    3. Software Features Section:
      • List all software features provided by this component
      • Each feature with a brief description
    4. Code Elements Section:
      • List all c4-code-*.md files contained in this component
      • Link to each file with a brief description
    5. Interfaces Section:
      • Document all component interfaces:
        • Interface name
        • Protocol (REST, GraphQL, gRPC, Events, etc.)
        • Description
        • Operations (function signatures, endpoints, etc.)
    6. Dependencies Section:
      • Components used (other components this depends on)
      • External systems (databases, APIs, services)
    7. Component Diagram:
      • Mermaid diagram showing this component and its relationships

    Save the output as: C4-Documentation/c4-component-[component-name].md Use a sanitized component name for the filename.

  • Expected output: c4-component-<name>.md file for each component

  • Context: All relevant c4-code-*.md files for this component

2.3 Create Master Component Index

  • Use Task tool with subagent_type="c4-architecture::c4-component"

  • Prompt: | Create a master component index that lists all components in the system.

    Based on all c4-component-*.md files created, generate:

    1. System Components Section:
      • List all components with:
        • Component name
        • Short description
        • Link to component documentation
    2. Component Relationships Diagram:
      • Mermaid diagram showing all components and their relationships
      • Show dependencies between components
      • Show external system dependencies

    Save the output as: C4-Documentation/c4-component.md

  • Expected output: Master c4-component.md file

  • Context: All c4-component-*.md files

Phase 3: Container-Level Synthesis

3.1 Analyze Components and Deployment Definitions

  • Review all c4-component-*.md files
  • Search for deployment/infrastructure definitions:
    • Dockerfiles
    • Kubernetes manifests (deployments, services, etc.)
    • Docker Compose files
    • Terraform/CloudFormation configs
    • Cloud service definitions (AWS Lambda, Azure Functions, etc.)
    • CI/CD pipeline definitions

3.2 Map Components to Containers

  • Use Task tool with subagent_type="c4-architecture::c4-container"

  • Prompt: | Synthesize components into containers based on deployment definitions.

    Component documentation: [List of all c4-component-*.md file paths]

    Deployment definitions found: [List of deployment config files: Dockerfiles, K8s manifests, etc.]

    Create comprehensive C4 Container-level documentation following this structure:

    1. Containers Section (for each container):
      • Name: [Container name]
      • Description: [Short description of container purpose and deployment]
      • Type: [Web Application, API, Database, Message Queue, etc.]
      • Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]
      • Deployment: [Docker, Kubernetes, Cloud Service, etc.]
    2. Purpose Section (for each container):
      • Detailed description of what this container does
      • How it's deployed
      • Its role in the system
    3. Components Section (for each container):
      • List all components deployed in this container
      • Link to component documentation
    4. Interfaces Section (for each container):
      • Document all container APIs and interfaces:
        • API/Interface name
        • Protocol (REST, GraphQL, gRPC, Events, etc.)
        • Description
        • Link to OpenAPI/Swagger/API Spec file
        • List of endpoints/operations
    5. API Specifications:
      • For each container API, create an OpenAPI 3.1+ specification
      • Save as: C4-Documentation/apis/[container-name]-api.yaml
      • Include:
        • All endpoints with methods (GET, POST, etc.)
        • Request/response schemas
        • Authentication requirements
        • Error responses
    6. Dependencies Section (for each container):
      • Containers used (other containers this depends on)
      • External systems (databases, third-party APIs, etc.)
      • Communication protocols
    7. Infrastructure Section (for each container):
      • Link to deployment config (Do

Content truncated.

unity-developer

sickn33

Build Unity games with optimized C# scripts, efficient rendering, and proper asset management. Masters Unity 6 LTS, URP/HDRP pipelines, and cross-platform deployment. Handles gameplay systems, UI implementation, and platform optimization. Use PROACTIVELY for Unity performance issues, game mechanics, or cross-platform builds.

304115

mobile-design

sickn33

Mobile-first design and engineering doctrine for iOS and Android apps. Covers touch interaction, performance, platform conventions, offline behavior, and mobile-specific decision-making. Teaches principles and constraints, not fixed layouts. Use for React Native, Flutter, or native mobile apps.

177102

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

23891

frontend-slides

sickn33

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

18087

angular

sickn33

Modern Angular (v20+) expert with deep knowledge of Signals, Standalone Components, Zoneless applications, SSR/Hydration, and reactive patterns. Use PROACTIVELY for Angular development, component architecture, state management, performance optimization, and migration to modern patterns.

10984

minecraft-bukkit-pro

sickn33

Master Minecraft server plugin development with Bukkit, Spigot, and Paper APIs. Specializes in event-driven architecture, command systems, world manipulation, player management, and performance optimization. Use PROACTIVELY for plugin architecture, gameplay mechanics, server-side features, or cross-version compatibility.

7480

You might also like

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,5561,556

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,8251,484

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,7051,235

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,608901

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,885835

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,435791