c4-architecture-c4-architecture

Generate C4 architecture documentation with code, component, container, and context files.

54|18|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/hainamchung/agent-assistant --skill c4-architecture-c4-architecture-hainamchung
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: c4-architecture-c4-architecture
Source: https://github.com/hainamchung/agent-assistant/tree/main/skills/c4-architecture-c4-architecture
Command: npx skills add https://github.com/hainamchung/agent-assistant --skill c4-architecture-c4-architecture-hainamchung

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This workflow automates the generation of comprehensive C4 architecture documentation for an existing repository or codebase, enabling teams to produce consistent, multi-level architectural artifacts without manual drafting.

Core Features & Use Cases

  • Bottom-up Code-Level Documentation: Analyze deepest code directories first to generate per-directory c4-code-*.md files.
  • Phase-based Synthesis: Convert code docs into Component, Container, and Context documentation (c4-component-*.md, c4-container.md, c4-context.md).
  • Automated Outputs & Diagrams: Produce Mermaid diagrams and link-rich artifacts, with outputs saved under C4-Documentation/.
  • API & Deployment Alignment: Generate container API specs (OpenAPI) and align documentation with deployment definitions.

Quick Start

Run the c4-architecture-c4-architecture skill on your repository to generate complete C4 documentation.

Frequently Asked Questions about c4-architecture-c4-architecture

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

FAQPage Schema
How do I generate C4 architecture documentation from an existing codebase?▼

You can generate C4 architecture documentation by running an automated bottom-up analysis on your repository. This process scans directories to produce code-level markdown files, then synthesizes them into Component, Container, and Context docs with Mermaid diagrams and OpenAPI specs.

What is bottom-up code discovery in C4 architecture documentation?▼

Bottom-up code discovery is an approach that analyzes the deepest code directories first to generate per-directory c4-code-*.md files. It systematically builds up Component, Container, and Context documentation by synthesizing these granular code-level artifacts upwards.

Can I automate OpenAPI spec generation alongside C4 diagrams for my project?▼

Yes, the workflow generates container API specifications in OpenAPI format and aligns them with deployment definitions. It automatically outputs these specs under the C4-Documentation/apis directory while producing Mermaid diagrams throughout the architecture documentation.

Does automated C4 documentation work for software projects of any size?▼

Automated C4 documentation applies to software projects of any size. It guides analysts through code discovery, component synthesis, container mapping, and context documentation regardless of repository scale, producing consistent multi-level architectural artifacts.

What is the best way to structure C4 container and component documentation for a repository?▼

The best way is to use phase-based synthesis that converts code docs into c4-component-*.md and c4-container.md files, then creates a c4-context.md file. This structure outputs link-rich artifacts with Mermaid diagrams saved under C4-Documentation/.