agentleFS
patonkikhpatonkikh/APES/skills/architecture/container-diagram-builder/skill.md

container-diagram-builder

Skill3 starsChanged 4 months agoMITView on GitHub

Produce a C4 Level 2 (Container) diagram decomposing the system into deployable/runnable units with technology choices and communication paths. Use when working on solution architecture, C4 diagrams, APIs, ADRs, or system design.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Place containers inside system boundary.

    line 62
  2. Distinctive:

    Follow C4 Level 2 conventions strictly.

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Container Diagram Builder

Purpose

Produce a C4 Level 2 (Container) diagram decomposing the system into deployable/runnable units with technology choices and communication paths.

Input: System context diagram, solution architecture
Output: Container diagram document with Mermaid diagram, container inventory, and communication matrix Examples: See examples.md for worked input/output.


Workflow

Step 1: Map logical components to containers

From solution architecture, identify containers:

  • Web application, mobile app, API service, worker, database, cache, message broker, file storage

Each container must:

  • Be independently deployable or runnable
  • Have one primary technology
  • Have clear responsibility

Step 2: Define container inventory

ContainerTypeTechnologyResponsibilityOwner

Types: web app, mobile, API, worker, database, cache, queue, gateway.

Step 3: Document container communication

SourceTargetProtocolPurposeSync/AsyncAuth

Step 4: Draw container diagram

flowchart TB
    subgraph system [System Name]
        web[Web App]
        api[API Service]
        db[(Database)]
    end
    user[User] --> web
    web --> api
    api --> db

Place containers inside system boundary. External actors and systems outside.

Step 5: Map to quality attributes

For each container, note NFR implications:

  • Scaling approach
  • Security boundary
  • Data persistence

Step 6: Validate

Run Validation checklist.


Decision Rules

ConditionAction
No system context availableStop; run system-context-builder first
Component not deployableMerge into parent container or split differently
Direct DB access from multiple containersDocument pattern; flag if violating bounded context
Technology unspecifiedRecommend based on solution architecture; mark as proposal
More than 12 containersGroup into subsystems with nested diagrams

Validation

  • Every solution architecture component maps to a container
  • Each container has type, technology, responsibility
  • Communication matrix covers all container pairs that interact
  • Mermaid diagram shows system boundary
  • External actors/systems from context diagram present
  • No component-level (C4 L3) detail inside diagram
  • Auth method noted for external-facing protocols

Anti-patterns

  • Container = class — fine-grained code modules shown as containers.
  • Missing data stores — API without database when persistence required.
  • Spaghetti diagram — unordered arrows without protocol labels.
  • Technology leakage — framework names without container purpose.
  • Skipping async paths — only showing sync HTTP, missing queues/workers.

Best Practices

  • Follow C4 Level 2 conventions strictly.
  • One technology per container (primary).
  • Show both sync and async integration paths.
  • Align container names with deployment units.
  • Reference FR/NFR IDs in container responsibilities.

Output Structure

# Container Diagram: [System Name]

## Container Inventory
| Container | Type | Technology | Responsibility |
|-----------|------|------------|----------------|

## Communication Matrix
| Source | Target | Protocol | Purpose | Sync/Async |
|--------|--------|----------|---------|------------|

## Container Diagram
```mermaid
[diagram]

NFR Mapping

ContainerScalingSecurityPersistence

Open Questions

  • [Question]

---

# Next Skills

| Outcome | Recommended Skill |
|---------|-------------------|
| Document architecture decisions | `architecture/adr-generator` |
| Design container APIs | `architecture/api-designer` |
| Review full architecture | `architecture/architecture-review` |
| Missing context | `architecture/system-context-builder` |

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.