All skills
lexler avatar

/c4-diagrams

@45ff07e
by Lada Kesselerlexler/skill-factory238 stars
61

Creates C4 architecture diagrams for designing, documenting, or understanding software architecture. Use when working through system design, mapping existing codebases, or visualizing structure at any level from system landscape down to code.

Use this Skill: https://skilld.dev/gh/lexler/skill-factory/c4-diagrams

This session only. Nothing lands on disk.

referencesformatsascii.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

ASCII C4 Diagrams

For inline diagrams in code, commit messages, terminal output, or anywhere rich rendering isn't available.

There is no standard ASCII format for C4. These conventions prioritize readability over decoration.

Core Principle

ASCII diagrams are structured text with visual hints, not pixel art. Keep them simple. Boxes hold the name and technology — nothing else.

Elements

Boxes with corners. Name on the first line, technology in brackets on the second:

┌──────────────────┐
│ API Application  │
│ [Spring Boot]    │
└──────────────────┘

People as simple labels in parentheses:

(Customer)

Do not draw multi-line ASCII person figures. Do not put descriptions inside boxes — the diagram is not the place for prose.

Relationships

Horizontal arrows: ───▶ and ◀─── Vertical arrows: │ with ▼ or ▲ at the end

Labels on a separate line next to the arrow:

(Customer)
    │
    │  manages accounts
    ▼
┌──────────────────┐
│ Banking System   │
└──────────────────┘

System Boundaries

A boundary box wrapping its containers. Every line within the box must be the same character width — verify this after drawing.

┌────────────────────────────────────────────┐
│ Internet Banking System                    │
│                                            │
│  ┌──────────┐   ┌────────┐   ┌──────────┐  │
│  │ Web App  │──▶│ SPA    │──▶│ API      │  │
│  │ [Spring] │   │ [React]│   │ [Spring] │  │
│  └──────────┘   └────────┘   └────┬─────┘  │
│                                   │        │
│                                   ▼        │
│                            ┌──────────┐    │
│                            │ Database │    │
│                            │[Postgres]│    │
│                            └──────────┘    │
└────────────────────────────────────────────┘

Complete System Context Example

                  (Customer)
                      │
               manages accounts
                      │
                      ▼
             ┌────────────────┐
             │ Internet       │
             │ Banking System │
             └───────┬────────┘
                     │
            ┌────────┴────────┐
            │                 │
            ▼                 ▼
   ┌─────────────────┐  ┌───────────────┐
   │ Mainframe       │  │ Email System  │
   │ Banking System  │  │               │
   └─────────────────┘  └───────────────┘

Complete Container Example

                       (Customer)
                        │     │
             visits     │     │  manages accounts
                        ▼     ▼
┌─────────────────────────────────────────────────────┐
│ Internet Banking System                             │
│                                                     │
│  ┌──────────┐    ┌─────────┐    ┌────────────────┐  │
│  │ Web App  │───▶│ SPA     │───▶│ API            │  │
│  │ [Spring] │    │ [React] │    │ [Spring Boot]  │  │
│  └──────────┘    └─────────┘    └───────┬────────┘  │
│                                         │           │
│                                         ▼           │
│                                  ┌────────────┐     │
│                                  │ Database   │     │
│                                  │ [Postgres] │     │
│                                  └────────────┘     │
└─────────────────────────────────────────────────────┘
                  │                    │
                  ▼                    ▼
        ┌─────────────────┐   ┌───────────────┐
        │ Mainframe       │   │ Email System  │
        │ Banking System  │   │               │
        └─────────────────┘   └───────────────┘

Guidelines

  • Use Unicode box-drawing characters: ┌, ┐, └, ┘ for corners, ─ for horizontal, │ for vertical. Do not mix styles (no +---+, no =====).
  • Use Unicode arrow characters: ▶ ◀ ▲ ▼ for arrowheads. Horizontal arrows: ───▶. Vertical arrows: │ with ▼ or ▲ at the end.
  • After drawing a diagram, pipe it through uv run ${CLAUDE_SKILL_DIR}/scripts/check_ascii_alignment.py to verify all boxes are aligned. Fix any issues before presenting the diagram.
  • Verify that vertical arrow lines (│ and ▼) align with the box edge they connect to. A ▼ arrow entering a box should land on a column inside the box's top edge, not off to the side.
  • Put relationship labels on a separate line next to the arrow, not inline
  • Use brackets for technology: [Postgres], [React]
  • Use parentheses for people: (Customer), (Admin)
  • Choose the layout direction (vertical or horizontal) that best fits the relationships being shown
  • When a diagram gets too complex, simplify — drop less important relationships or split into multiple diagrams
  • Do not include legends. The conventions are simple enough to be self-evident.

Source: SKILL.md on GitHub

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill facilitates the creation of C4 architecture diagrams by providing detailed guidelines for various diagram levels and formats. It includes a Python script for validating the visual alignment of ASCII diagrams. The skill's instructions and script are focused on architectural documentation and do not contain malicious patterns.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 45ff07e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago

README badge

README badge for lexler/skill-factory/c4-diagrams