Skip to content
Back to skills

C4 Diagrams

ASecurity

Genera y mantiene actualizados los modelos C4 dentro de docs/architecture/diagrams. Trigger: archivos en docs/architecture/diagrams, cambios en diagramas .mmd/.puml/.puml.md

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbashgit

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill c4-diagrams --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C4 Diagrams?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C4 Diagrams
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-c4-diagrams/badge)](https://www.skillsdirectory.com/skills/david-li0406-c4-diagrams)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: c4-diagrams
description: >
  Genera y mantiene actualizados los modelos C4 dentro de docs/architecture/diagrams.
  Trigger: archivos en docs/architecture/diagrams, cambios en diagramas .mmd/.puml/.puml.md
license: Apache-2.0
metadata:
  author: cvix-team
  version: "1.0"
---
# C4 Diagrams Skill

## When to Use

- When you need to generate or update system/containers/components/context diagrams following the C4 model.
- Trigger: changes under `docs/architecture/diagrams` or creating new architecture artifacts.

## Critical Patterns

- Keep diagrams as source files in `docs/architecture/diagrams` using either Mermaid (.mmd/.mmdx) or PlantUML (.puml).
- Prefer small, focused diagrams per file (one diagram per file). Don't bloat a single file with all C4 levels.
- Use consistent IDs and naming for elements across diagrams (SYSTEM_xxx, CONTAINER_xxx, COMP_xxx).
- Version diagrams in git. The skill MUST not modify files without creating clear diffs and a suggested commit message.
- Always provide both Mermaid and PlantUML variants when a diagram is shared with external stakeholders who may prefer one renderer.

## Commands

```bash
# Validate Mermaid syntax (requires mmdc installed)
mmdc -i docs/architecture/diagrams/example.mmd -o /tmp/example.png

# Render PlantUML (requires plantuml.jar or plantuml binary)
plantuml -tpng docs/architecture/diagrams/example.puml

# Quick lint: search for .mmd/.puml files changed by git
git diff --name-only --diff-filter=ACMRTUXB HEAD~1..HEAD | rg "docs/architecture/diagrams/.*\.(mmd|puml)"
```

## Templates (assets)

- assets/mermaid-template.mmd -> minimal C4-style Mermaid snippet
- assets/plantuml-template.puml -> PlantUML using C4-PlantUML macros
- assets/README.md -> instructions to render locally

## Code Examples

Mermaid (minimal C4-like context diagram):

```mmd
%% assets/mermaid-template.mmd
flowchart TB
  %% Context - System and external actors
  actor(User):::person
  subgraph SYSTEM [My System]
    APP["Web App"]
  end
  User --> APP

  classDef person fill:#f9f,stroke:#333,stroke-width:1px
```

PlantUML (using C4-PlantUML):

```puml
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
Person(user, "User")
System(webapp, "Web App")
Rel(user, webapp, "uses")
@enduml
```

## Rules for the Agent

- When asked to update diagrams, propose both Mermaid and PlantUML outputs when possible.
- Validate diagram syntax and show render command output or error.
- When creating new diagram files, place them under `docs/architecture/diagrams/<level>/<name>.<ext>` where `<level>` is context|container|component|code.
- Add a short header comment in each generated file with: generation timestamp, generator name (`c4-diagrams skill`), and git SHA (if available).

## Resources

- Templates: `assets/`
- Docs location: `docs/architecture/diagrams/`

Files in this skill

  • SKILL.md2.8 KB
  • assets/README.md394 B
  • assets/mermaid-example.mmd289 B
  • assets/plantuml-example.puml306 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…