plugins/documentation/skills/c4-diagrams/SKILL.md
Generates C4 model architecture diagrams (System Context, Container, Component) as Mermaid for embedding in docs — picks the right C4 level for the question being answered, labels every element with its technology and responsibility, and avoids the "everything touches everything" spaghetti that makes most architecture diagrams useless. Writes to .context/architecture/diagrams/. Use when the user asks for a diagram of their system, an architecture visualization, a container/component diagram, wants to see how pieces fit together, or mentions "C4".
npx skillsauth add lucasilverentand/skills c4-diagramsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The C4 model gives you four levels of zoom on a software system — Context, Container, Component, Code. Most architecture diagrams try to show everything at once and end up showing nothing useful. C4 fixes that by making you pick one level and one audience.
ls .context/architecture/diagrams/ 2>/dev/null || echo "(none yet)"sequenceDiagram or flowchart instead, and tell the user that's what you're doing.Audience: anyone (execs, product, new hires) Shows: the system as a single box, users (people), and external systems it depends on or integrates with Don't show: anything inside the system
Use when: introducing the system to someone, scoping a conversation, defining the boundary.
Audience: engineers, architects Shows: deployable/runnable units — web apps, APIs, workers, databases, queues, caches — and the protocols they use to talk Don't show: classes, functions, or internal modules
Use when: explaining the runtime architecture, onboarding engineers, planning deploys, discussing scaling.
Audience: engineers working in a specific container Shows: the major modules/packages/classes inside one container and how they collaborate Don't show: other containers in detail — they're just labeled boxes at the edge
Use when: explaining the internals of a service, planning a refactor, documenting a module boundary.
Skip it. Real code diagrams go stale instantly and the IDE already shows them. If the user really wants one, produce a Mermaid classDiagram and call it out as "code-level, likely to drift."
Use AskUserQuestion if unclear:
.context/, code to read, or just conversationIf .context/architecture/ already has a design doc, read it first — diagrams should match the words.
Walk through the system and list:
A good rule of thumb: if you can't label the purpose of an arrow in ~5 words, the relationship is too vague to draw.
When diagramming systems built on the default stack, use these standard labels and shorthand. If the architecture skill is installed in the same package, its references/third-party.md and references/deploy.md files contain the fuller stack rationale.
|Primitive|Label format|Responsibility|
|---|---|---|
|Worker (API)|<Name> API [Hono on Workers]|HTTP request handling, validation, auth|
|Worker (service)|<Name> Worker [Worker]|Queue consumer, cron job, background processing|
|Postgres|<Name> DB [Postgres / Neon]|Source of truth, transactional writes|
|Queue|<topic-name> [CF Queue]|Async event delivery, retry/DLQ|
|Durable Object|<Name> DO [Durable Object]|Per-key state: rate limits, WebSocket rooms, counters|
|KV|<Name> [CF KV]|Key-value cache, config, feature flags|
|R2|<Name> [CF R2]|Object storage, file uploads, access logs|
|D1|<Name> [CF D1]|Lightweight SQLite for tiny projects|
|External: Neon|Neon [Postgres]|Managed serverless Postgres (EU region)|
|External: PostHog|PostHog [External]|Analytics, errors, feature flags|
|External: Resend|Resend [External]|Transactional email|
|External: Polar.sh|Polar.sh [External]|Payments and billing (web)|
|External: RevenueCat|RevenueCat [External]|In-app purchase management (mobile)|
|External: Better Stack|Better Stack [External]|Uptime monitoring and alerting|
Use Service Binding as the protocol label for Worker-to-Worker calls within the same CF account (no network hop). Use Queue for async inter-service communication.
Use flowchart with subgraphs for the system boundary. Mermaid doesn't have native C4 support across all renderers, but flowchart with consistent styling works everywhere. See references/mermaid-c4.md for templates for each level.
Conventions to keep diagrams readable:
[Person], [Web App], [Database]), and a one-line responsibilityOutput to .context/architecture/diagrams/<name>-<level>.md (e.g., orders-service-container.md). The file should contain:
# Orders Service — Container Diagramorders-service-context.md")If there's a design doc in .context/architecture/, add a link to the new diagram file. Diagrams that no doc references get stale fast.
Orders API (Hono on Workers) alone is worse than Orders API (Hono on Workers) — accepts order writes, publishes events.A diagram without prose is usually a riddle. Pair every diagram with:
Remember: the diagram is for the reader, not the writer. A junior engineer or a weaker LLM model should be able to answer "what does this system do?" after reading the diagram + the surrounding prose. If they can't, the prose needs more explanation.
|File|Covers|
|---|---|
|Architecture skill references, when bundled|Default vendors, stack primitives, monorepo layout, and Worker topology|
|references/mermaid-c4.md|Mermaid templates for Context, Container, and Component levels with styling|
tools
Creates, audits, and updates public open-source repository documentation, including README files, CONTRIBUTING guides, SECURITY and SUPPORT docs, project badges, quickstarts, usage guidance, community links, and contributor onboarding. Use when maintaining docs for public GitHub projects, libraries, CLIs, apps, or reusable packages, especially when the user says "update this README", "write CONTRIBUTING.md", "make these docs open-source ready", or "improve the public project docs".
development
Creates, audits, and updates private or closed-source project documentation, including internal README hubs, codebase navigation guides, ownership links, Linear initiative links, onboarding notes, runbooks, and contribution guidance for teams. Use when maintaining docs for private repositories, internal apps, services, infrastructure, or company projects, especially when the user says "make this README an internal hub", "document how to navigate this repo", "add Linear links to the docs", or "write private project documentation".
development
Creates, updates, estimates, and tidies Linear issues using Luca's issue-shaping rules. Use when the user asks to create a Linear issue, write ticket-ready issue text, refine an existing issue, add acceptance criteria, set issue relationships, estimate points, audit issue hygiene, tidy a Linear project, find duplicates, fix stale blockers, or normalize labels, milestones, priorities, and issue state.
testing
Keeps an existing Linear project tidy after planning and during execution. Use when the user asks to "tidy Linear", "clean up the project", "audit issues", "find duplicates", "check stale blockers", "fix project drift", or run periodic Linear housekeeping on a project, initiative, or milestone set. Use when planning is underway or execution has started and relationships, labels, priorities, documents, and issue states need coherence without changing product scope.