agentleFS
selamy-labsselamy-labs/agent-skills/skills/c4-architecture/SKILL.md

c4-architecture

Skill0 starsChanged 6 days agoMITView on GitHub

Use when documenting a system's architecture, not just drawing one diagram. Apply the C4 model — context, container, component, deployment — choosing the level by audience, stopping at context plus container for most teams, and writing the result into versioned markdown.

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

C4 Architecture Documentation

C4 is a methodology, not a notation: it documents a system at four zoom levels so each audience sees the right amount of detail. The discipline is choosing the level deliberately and stopping early — most teams over-diagram.

The four levels — pick by audience

LevelDiagramAudienceShowsWhen
1C4ContextEveryoneThe system + the people/systems around itAlways
2C4ContainerTechnicalApps, services, databases inside itAlways
3C4ComponentDevelopersInternals of one containerOnly if it adds value
4C4DeploymentOpsInfra nodes the containers run onProduction systems

Context + Container is enough for most software teams. Reach for Component only when one container is complex enough that its internals are a real question; reach for Deployment when how-it-runs matters. A diagram nobody asked a question about is maintenance debt.

Workflow

  1. Scope — decide which level(s) the audience actually needs (default: 1+2).
  2. Analyze — read the codebase to identify the real containers (deployable units) and their relationships, not the aspirational architecture.
  3. Generate — write the diagrams in Mermaid C4 syntax (see mermaid-diagrams for the rendering mechanics).
  4. Document — commit them to markdown with a sentence of context per diagram explaining what decision it informs.

Example — Level 1

C4Context
    title System Context — Orders Service
    Person(customer, "Customer", "Places orders")
    System(orders, "Orders Service", "Accepts and tracks orders")
    System_Ext(payments, "Payments", "Third-party processor")
    Rel(customer, orders, "Places order")
    Rel(orders, payments, "Charges via", "HTTPS")

Keep it true

Architecture docs are only valuable if they match reality — diagram the containers that actually deploy, and update the C4 markdown in the same PR that changes the architecture. A pretty diagram of a system that no longer exists is worse than none.


Adapted from the MIT-licensed softaworks/agent-toolkit c4-architecture skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.