C4 Architecture logo

C4 Architecture

Community
bitsmuggler
c4-architecture

This skill should be used when the user asks to "create a C4 model", "generate architecture diagrams", "create a Structurizr workspace", "analyse the architecture", "model the system architecture", "create a system context diagram", "create a container diagram", "create a component diagram", "generate C4 diagrams", mentions C4, Structurizr, or architecture modelling, or needs to visualise software architecture.

Overview

Publisherbitsmuggler
Repositoryc4-skill
Skill namec4-architecture
Stars
62
Forks
6
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by bitsmuggler on GitHub. Read the source before you install it.

Installation

Install the C4 Architecture AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/bitsmuggler/c4-skill/tree/main/skills/c4-architecture
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bitsmuggler/c4-skill.git /tmp/c4-skill
mkdir -p .claude/skills
cp -r /tmp/c4-skill/skills/c4-architecture .claude/skills/c4-architecture
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable C4 Architecture in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads C4 Architecture on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so C4 Architecture is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

C4 Architecture Modelling with Structurizr DSL

Generate C4 architecture models using the Structurizr DSL and optionally render them as images.

When To Use

  • User wants to analyse and document software architecture
  • User asks for C4 diagrams (System Context, Container, Component, Deployment)
  • User wants to generate or update a Structurizr DSL workspace file
  • User wants to render architecture diagrams as images

Architecture Analysis Process

Step 1: Discover the System

Analyse the codebase to identify architectural elements:

Configuration & Build Files

  • package.json, pom.xml, build.gradle, go.mod, Cargo.toml, requirements.txt
  • docker-compose.yml, Dockerfile, kubernetes/*.yml
  • .env, configuration files, infrastructure-as-code

Identify Elements

  • People/Actors: Who uses the system? (end users, admins, external services)
  • Software Systems: The system being modelled + external systems it interacts with
  • Containers: Deployable units (web apps, APIs, databases, message queues, file stores)
  • Components: Logical groupings within containers (controllers, services, repositories)

Map Relationships

  • API calls between services (REST, gRPC, GraphQL)
  • Database connections and which containers access which stores
  • Message queue producers/consumers
  • External integrations (payment providers, email services, auth providers)
  • User interactions with the system

Step 2: Generate the Structurizr DSL

Write a workspace.dsl file following the Structurizr DSL syntax.

For the full DSL language reference, read: references/structurizr-dsl-reference.md For a working example, read: examples/example-workspace.dsl

Structure the workspace as follows:

workspace "[System Name]" "[Brief description]" {
    model {
        // 1. Define people (actors)
        // 2. Define software systems
        //    - Nest containers inside the primary system
        //    - Nest components inside containers (if needed)
        // 3. Define relationships between elements
    }
    views {
        // 4. Create views at each required C4 level
        // 5. Apply styling via themes or element/relationship styles
    }
}

Naming Conventions:

  • Use camelCase for identifiers: webApp, apiGateway, userDb
  • Use descriptive display names: "Web Application", "API Gateway"
  • Include technology labels: "Spring Boot REST API", "PostgreSQL 15"

Relationship Guidelines:

  • Always include a description: user -> webApp "Browses products using" "HTTPS"
  • Include technology where relevant: "REST/JSON", "JDBC", "AMQP"
  • Direction matters: source -> destination (who initiates the interaction)

Step 3: Create Views

Generate appropriate views based on the level of detail needed:

  • System Landscape: Overview of all systems (systemLandscape)
  • System Context: One system + its direct interactions (systemContext)
  • Container: Internal structure of a system (container)
  • Component: Internal structure of a container (component)
  • Deployment: Infrastructure mapping (deployment)

Always use autoLayout unless the user provides explicit layout preferences.

Step 4: Apply Styling

Use tags and styles to make diagrams readable:

styles {
    element "Person" {
        shape Person
        background #08427B
        color #ffffff
    }
    element "Software System" {
        background #1168BD
        color #ffffff
    }
    element "Container" {
        background #438DD5
        color #ffffff
    }
    element "Component" {
        background #85BBF0
        color #000000
    }
    element "Database" {
        shape Cylinder
    }
    element "External" {
        background #999999
        color #ffffff
    }
}

Step 5: Export and Render Diagrams

All export and rendering is done via Docker. Requires Docker to be installed and running.

Export DSL to C4-PlantUML:

bash
mkdir -p ./diagrams
docker run --rm -v $PWD:/usr/local/structurizr structurizr/structurizr \
    export -workspace /usr/local/structurizr/workspace.dsl -format plantuml/c4plantuml -output /usr/local/structurizr/diagrams

Render PlantUML to PNG:

bash
docker run --rm -v $PWD/diagrams:/data plantuml/plantuml -tpng /data/*.puml

Render PlantUML to SVG:

bash
docker run --rm -v $PWD/diagrams:/data plantuml/plantuml -tsvg /data/*.puml

Other supported export formats: plantuml, mermaid, json.

Prerequisite: Docker (docker pull structurizr/structurizr && docker pull plantuml/plantuml)

Quality Checklist

Before presenting the workspace to the user, verify:

  • All identified systems, containers, and components are modelled
  • Every element has a description and technology label where appropriate
  • Relationships have meaningful descriptions (not just "uses")
  • External systems are clearly distinguished (tagged as "External")
  • Database elements use the Cylinder shape
  • Views exist for each appropriate C4 level
  • autoLayout is applied to all views
  • Styling is consistent and follows C4 colour conventions

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the C4 Architecture AI skill do?

This skill should be used when the user asks to "create a C4 model", "generate architecture diagrams", "create a Structurizr workspace", "analyse the architecture", "model the system architecture", "create a system context diagram", "create a container diagram", "create a component diagram", "generate C4 diagrams", mentions C4, Structurizr, or architecture modelling, or needs to visualise software architecture.

Why use C4 Architecture on TypingMind?

Because you install it once and use it with any model. C4 Architecture is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install C4 Architecture in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/bitsmuggler/c4-skill/tree/main/skills/c4-architecture. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use C4 Architecture?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with C4 Architecture?

As many as you like. As long as a model supports skills, you can use C4 Architecture with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the C4 Architecture AI skill free?

It is published on GitHub by bitsmuggler. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇