Skip to content
Back to skills

C4 Architecture Docs

ASecurity

Document an epic/feature architecture with the C4 model -- system context/container/component/dynamic diagrams as Mermaid .mmd plus a narrative doc. NOT for rendering an existing .mmd (use mermaid-viewer).

  • 9 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 5, 2026
ai-agentsgoapidocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add atretyak1985/swarmery --skill c4-architecture-docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C4 Architecture Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C4 Architecture Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/atretyak1985-c4-architecture-docs/badge)](https://www.skillsdirectory.com/skills/atretyak1985-c4-architecture-docs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: c4-architecture-docs
version: "1.0.0"
owner: "swarmery-core"
description: "Document an epic/feature architecture with the C4 model -- system context/container/component/dynamic diagrams as Mermaid .mmd plus a narrative doc. NOT for rendering an existing .mmd (use mermaid-viewer)."
color: cyan
docs:
  status: reviewed
  source_sha: ff189543c257
  updated: 2026-08-06
---

# Purpose

Produce house-consistent **C4 architecture documentation** for a big issue: a small set of Mermaid C4 diagrams (`.mmd`) plus a short narrative doc, filed in the task dir and rendered for review. This skill owns the **HOW** — level selection, diagram grammar, labelling rules, and the file-and-promote workflow; it does not render (hand the `.mmd` to the project's Mermaid viewer) and does not replace an ADR. Project tiers and containers are never baked in — read them from `.claude/project.json` and the project's `CLAUDE.md`.

# Rules (never violate)

- Draw the **minimum** levels: L1+L2 always; one L3 only per touched container; Dynamic only for a non-obvious runtime flow; L4 almost never.
- Ground every box in the project's real inventory (`.claude/project.json`, `CLAUDE.md`) — never invent systems or protocols.
- Complexity gate: a view exceeding ~10 elements / ~12 relationships / ~10 dynamic steps must be split or authored as a styled `flowchart`, never Mermaid C4.
- Every element typed + described; every container/component technology-labelled; every relationship directed, labelled, protocol-labelled across containers.
- Render **and visually inspect a screenshot** of every diagram — console-clean is not the readability bar; crossing lines or overlapping labels fail review.
- File artifacts in the task dir (narrative ≤200 lines); record each boundary/technology decision as a linked ADR; promotion is deliberate and ASK-gated when contract-touching.

# Resources

- Read `resources/authoring-workflow.md` when executing — the 8-step procedure, inputs/outputs, checklists, escalation, examples, failure modes.
- Read `resources/c4-levels.md` when choosing abstraction levels.
- Read `resources/notation-and-review-checklist.md` before finalizing a diagram.
- Read `resources/mermaid-c4-syntax.md` when writing `.mmd` (syntax + gotchas).
- Copy starters from `templates/`; study the neutral idiom in `examples/`.

# How to use

## What it does

Turns a big issue — an epic, cross-tier feature, or incident review — into C4 documentation: minimal Mermaid diagrams plus a ≤200-line narrative, grounded in the project's real repos, rendered and visually reviewed, decisions captured as ADRs.

## When to use it

- Someone asks to "document the architecture" or "draw the system context / container diagram" for a feature or epic.
- A cross-tier change needs a durable structural picture, or a post-mortem needs a numbered dynamic flow.

NOT for viewing an existing `.mmd`, decision-only records (ADR), state machines/ERDs, or single-file changes.

## How to invoke

```
Skill(skill: "core:c4-architecture-docs")
```

Invoke once you know the issue scope and affected repos; the skill reads the rest from project configuration.

## Worked example

Epic "persist per-order event history for replay" touching the API server and DB: scope, pick L1+L2 plus one L3 for the API server, inventory real containers, fill the starter skeletons, write the narrative, render and inspect each diagram, and record the append-only-log vs snapshot-table choice as an ADR — yielding `reports/{architecture.md, c4-l1-context.mmd, c4-l2-container.mmd, c4-l3-api-server.mmd, adr-001-event-store.md}` plus rendered `.html`.

Files in this skill

  • SKILL.md3.5 KB
  • examples/example-container.mmd1.6 KB
  • examples/example-dynamic.mmd1.4 KB
  • examples/example-system-context.mmd1.6 KB
  • resources/authoring-workflow.md16.3 KB
  • resources/c4-levels.md10.2 KB
  • resources/mermaid-c4-syntax.md10.7 KB
  • resources/notation-and-review-checklist.md5.6 KB
  • templates/architecture-doc-template.md6.2 KB
  • templates/starter-component.mmd977 B
  • templates/starter-container.mmd924 B
  • templates/starter-dynamic.mmd965 B
  • templates/starter-system-context.mmd845 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.