# C4 Architecture

Model and document existing or planned software architectures with the C4 model across...

- Repository: https://github.com/microsoft/hve-core (1591 stars)
- Category: DevOps
- License: CC-BY-4.0 AND MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add microsoft/hve-core --skill c4-architecture -g -a claude-code -y`
Codex: `npx skills add microsoft/hve-core --skill c4-architecture -g -a codex -y`
Cursor: `npx skills add microsoft/hve-core --skill c4-architecture -g -a cursor -y`
Gemini CLI: `npx skills add microsoft/hve-core --skill c4-architecture -g -a gemini-cli -y`

## Description

Model and document existing or planned software architectures with the C4 model across System Context, Container, and Component levels plus deployment diagrams, then emit diagrams through a selected renderer. Use when an architect needs audience-appropriate software architecture documentation; use the 'architecture-diagrams' skill for infrastructure topology.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# C4 Architecture Skill

## Goal

Produce audience-appropriate C4 diagrams for existing systems from code or planned systems from requirements. Create new diagrams with the selected [renderer](#supported-renderers), or update existing diagrams when their renderer is supported.

## Supported Diagrams

These defaults apply when creating new diagrams. Updates change only what the request targets.

| Diagram                 | Generated by default   | User selection                        | Answers                                                       |
|-------------------------|------------------------|---------------------------------------|---------------------------------------------------------------|
| Level 1: System Context | Yes                    | Which system when several qualify     | Who uses the system and what does it interact with            |
| Level 2: Container      | Yes                    | None                                  | What separately deployable or runnable units make up a system |
| Level 3: Component      | Yes                    | Which containers when several qualify | What major building blocks sit inside one container           |
| Level 4: Code           | On request only        | Which component to detail             | How one component maps to code structures                     |
| Deployment              | Offered when evidenced | Opt-in and which environment          | Where container instances run in one named environment        |

## Supported Renderers

Read the selected renderer reference in full before generating or modifying diagrams. Apply every relevant rule.

| Renderer  | Reference                                                        | Status  |
|-----------|------------------------------------------------------------------|---------|
| `mermaid` | [references/renderer-mermaid.md](references/renderer-mermaid.md) | Default |

## Process

Follow these steps when activating this skill:

The rest: https://github.com/microsoft/hve-core/blob/HEAD/.github/skills/hve-core/c4-architecture/SKILL.md
