agentleFS
intent-driven-devintent-driven-dev/intent-driven-template/.agents/skills/c4-diagrams/SKILL.md

c4-diagrams

Skill185 starsChanged 32 days agoMITView on GitHub

Use when explaining existing code architecture, visualizing a new system before detailed design, mapping software boundaries, or creating C4-style diagrams in ASCII or Mermaid.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use C4 diagrams to clarify software architecture before detailed design.

    line 10
  2. Distinctive:

    Before diagramming, determine these choices.

    line 14
  3. Distinctive:

    If the user asks to skip questions for speed, still preserve unresolved choices as explicit assumptions and keep the first diagram …

    line 22
  4. Distinctive:

    Stop before detailed design unless the user approves the diagram and asks to continue.

    line 31
  5. Distinctive:

    Keep labels concrete: actor, system, container, component, database, queue, external service.

    line 50
  6. Distinctive:

    Do not mix levels accidentally: containers are runnable/deployable units.

    line 51
  7. Distinctive:

    Always include assumptions when diagramming a future system or incomplete codebase.

    line 52
  8. Distinctive:

    Always include open questions when boundaries, ownership, data flow, or deployment are uncertain.

    line 53
  9. Very specific:

    Use templates.md in this skill directory for compact ASCII and Mermaid starting points.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

C4 Diagrams

Overview

Use C4 diagrams to clarify software architecture before detailed design. Focus on boundaries, responsibilities, actors, dependencies, and data flow; draw only the levels that add value.

First Gates

Before diagramming, determine these choices. If the user already specified one, honor it. If multiple choices are ambiguous, ask one concise combined question.

ChoiceOptionsDefault behavior
PurposeExisting code, new system, design reviewExisting code requires codebase exploration first; new systems require assumptions called out.
FormatASCII, MermaidAsk the user. Mermaid means plain Mermaid syntax, not C4-specific Mermaid.
RigorStrict C4, lightweight C4-inspired, hybridAsk the user. Do not decide silently.

If the user asks to skip questions for speed, still preserve unresolved choices as explicit assumptions and keep the first diagram lightweight.

Workflow

  1. Establish purpose, format, and rigor.
  2. For existing code, inspect entry points, runtime boundaries, integrations, and persistence before drawing. For a quick pass, inspect enough to identify language/framework, launch entry points, major directories, external integrations, and data stores; label anything else as unknown.
  3. Pick the smallest useful diagram set. Start with system context or container; add component, dynamic, or deployment only when it answers a real question.
  4. Draw the diagram using ASCII or plain Mermaid.
  5. Explain the diagram in 3-6 bullets: boundaries, responsibilities, key relationships, assumptions, and open questions.
  6. Stop before detailed design unless the user approves the diagram and asks to continue.

C4 Level Selection

LevelUse whenAvoid when
System contextIdentifying users, external systems, and scopeThe scope is already obvious and local.
ContainerShowing deployable/runnable units, data stores, APIs, CLIs, queuesYou only need code-level call flow.
ComponentExplaining internals of one containerThe container has few meaningful internal parts.
CodeRarely, for critical classes/modulesA normal component diagram would be enough.
DynamicShowing request, event, or workflow sequenceStatic structure is the actual question.
DeploymentShowing infrastructure, nodes, networks, runtime placementDeployment is unknown or irrelevant.

For small systems, challenge requests for all four C4 levels and offer a smaller set. If the user still wants all four, produce them but mark low-value levels as lightweight sketches and explain why they may not be worth maintaining.

Output Rules

  • Mermaid diagrams must use plain flowchart or sequenceDiagram syntax for portability.
  • ASCII diagrams should favor readable boxes and arrows over decorative complexity.
  • Keep labels concrete: actor, system, container, component, database, queue, external service.
  • Do not mix levels accidentally: containers are runnable/deployable units; components live inside one container.
  • Always include assumptions when diagramming a future system or incomplete codebase.
  • Always include open questions when boundaries, ownership, data flow, or deployment are uncertain.

Templates

Use templates.md in this skill directory for compact ASCII and Mermaid starting points.

Common Mistakes

MistakeFix
Drawing all four C4 levels by defaultDraw only levels that answer the current question.
Jumping into detailed design immediatelyValidate context/container boundaries first.
Using C4-specific Mermaid syntaxUse plain Mermaid flowchart or sequenceDiagram.
Treating modules as containersContainers are runnable/deployable units; modules are usually components.
Hiding uncertaintyState assumptions and open questions after the diagram.

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.