c4-to-eventcatalog — Claude Code skill: C4 models into EventCatalog
Turns a C4 model into an EventCatalog documentation plan, then into catalog files once you approve the mapping.
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a claude-codeWhat c4-to-eventcatalog does
The skill accepts Structurizr DSL or JSON, C4-PlantUML, Mermaid C4, Markdown architecture docs and diagrams. It parses people, external systems, containers, relationships, protocols, topics and queues. Components are only pulled out when they cross an ownership, deployment, data or message boundary.
Each element is then mapped to an EventCatalog type: domain, service, agent, event, command, query, channel, container or flow. When a catalog already exists, the skill inspects it first and tags every item as new, update, unchanged or investigate. The output is a .c4-eventcatalog-plan.md file listing decisions, relationships and the files to create. Nothing gets generated until you approve that plan.
One caveat: image-only input is less reliable than source text, so feed it the DSL or Markdown when you can. The skill asks structural questions one at a time — domain boundaries, deployable services, agent classification — and skips prose and cosmetic metadata. Existing catalog resources missing from the C4 model are flagged for review, never deleted.
What it helps with
- map a C4 model onto EventCatalog resources
- reconcile a new architecture with an existing catalog
- separate deployable services from components inside them
- review a migration plan before touching catalog files
- spot drift between diagrams and current documentation
Example prompts for the agent
- Here's our Structurizr DSL, map it into EventCatalog
- Build a
.c4-eventcatalog-plan.mdplan from this Mermaid C4 diagram - Compare this C4 model against the catalog in
./eventcatalogand show what changes
How to install c4-to-eventcatalog
1Skills CLI (Vercel)
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a claude-code2Manually: put the files in place
~/.claude/skills/c4-to-eventcatalog/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/c4-to-eventcatalog/
1Skills CLI (Vercel)
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a codex2Manually: put the files in place
.agents/skills/c4-to-eventcatalog/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a cursor2Manually: put the files in place
.cursor/skills/c4-to-eventcatalog/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install event-catalog/skills c4-to-eventcatalog2Manually: put the files in place
.github/skills/c4-to-eventcatalog/SKILL.md1Skills CLI (Vercel)
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a gemini-cli2Platform CLI
gemini skills install https://github.com/event-catalog/skills --path skills/c4-to-eventcatalogManually: put the files in place
.devin/skills/c4-to-eventcatalog/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add event-catalog/skills --skill c4-to-eventcatalog -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about c4-to-eventcatalog
How do I install c4-to-eventcatalog in Claude?
Run npx skills add event-catalog/skills --skill c4-to-eventcatalog -a claude-code. The skill file then lives at ~/.claude/skills/c4-to-eventcatalog/SKILL.md.
What does c4-to-eventcatalog do?
It reads a C4 model and produces a plan for moving it into EventCatalog, then hands off to catalog-documentation-creator to create or update the catalog files after you approve.
Do I need an existing EventCatalog project?
No. Without one, scaffolding happens during the handoff to catalog-documentation-creator. With one, point the skill at the path and it will reconcile the model against your catalog.
Source text
SKILL.md · MIT
--- name: c4-to-eventcatalog description: Converts C4 architecture models into EventCatalog documentation plans and hands off to catalog-documentation-creator for file generation. Use when user provides a C4 model, Structurizr DSL, C4-PlantUML, Mermaid C4, diagrams, or architecture descriptions and asks to create, update, reconcile, or map them into an EventCatalog project. license: MIT metadata: author: eventcatalog version: "1.0.0" --- # C4 to EventCatalog ## Overview Map a C4 model into EventCatalog resources without flattening architecture intent. Produce a reviewable `.c4-eventcatalog-plan.md` first, then use `catalog-documentation-creator` to generate or update the actual catalog files after the user approves the mapping. ## Load References Always read `references/c4-mapping.md` before mapping a C4 model. When generating files, read the relevant `../catalog-documentation-creator/references/` files: - `domains.md`, `services.md`, `agents.md` - `events.md`, `commands.md`, `queries.md` - `channels.md`, `containers.md`, `flows.md` - `components.md` for NodeGraph, Mermaid, wiki links, schemas, and MDX components ## Workflow Follow these phases in order. ### 1. Locate inputs Ask for the C4 source if it is not provided. Accept Structurizr DSL/JSON, C4-PlantUML, Mermaid C4, Markdown architecture docs, or image diagrams. Warn that source text is more reliable than image-only extraction. Ask whether the user has an EventCatalog project. If yes, ask for the path and verify `eventcatalog.config.js` or known resource directories. If no, note that scaffolding happens during handoff through `catalog-documentation-creator`. ### 2. Inventory the existing catalog If a catalog exists, inspect it before proposing changes: - Detect flat vs domain-nested structure. - Record existing resource IDs, names, versions, owners, and relationships. - Note naming style, schema formats, owner conventions, badges, and use of domains. - Treat existing catalog resources not present in the C4 model as `investigate`, not deletion candidates. ### 3. Parse the C4 model Extract: - People and external systems - Software systems - Containers, including apps, services, agents, databases, queues, and browsers/mobile clients - Components only when they cross an ownership, deployment, data, or message boundary - Relationships, protocols, technologies, tags, descriptions, and views - Dynamic views or narrative scenarios that should become flows - Message names, topics, queues, APIs, commands, queries, events, and schema references Preserve evidence. For source files, cite file paths and line numbers where possible. For diagrams, cite the diagram/view name and element IDs. ### 4. Map and reconcile Use `references/c4-mapping.md` to map each C4 element into one of `domain`, `service`, `agent`, `event`, `command`, `query`, `channel`, `container`, `flow`, `external system only`, `document inside resource body`, or `needs user decision`. For existing catalogs, assign each mapped item a status: `new`, `update`, `unchanged`, or `investigate`. ### 5. Ask only structural questions Ask one question at a time. Each question must include: - The recommended answer - The evidence that led to it - The consequence for generated EventCatalog resources Only ask about decisions that affect structure: domain boundaries, deployable service boundaries, agent classification, whether a relationship is an event/command/query/API call, whether an infrastructure node is a channel or data container, and whether to update an existing resource. Do not grill the user on prose, summaries, or cosmetic metadata. ### 6. Write the plan Write `.c4-eventcatalog-plan.md` in the catalog directory when one exists, otherwise next to the supplied C4 source or in the current working directory. Include the template from `references/c4-mapping.md`: source, decisions, resource mapping, relationships, files to create/update, and open questions. Ask the user to approve the plan before generating catalog files. ### 7. Generate catalog files After approval, use `catalog-documentation-creator` to create or update files. Load only the relevant EventCatalog reference files for the resources in the approved plan. Follow the target catalog's existing structure and never overwrite an existing resource without preserving or reconciling user content. ## Quality Rules - Do not create one EventCatalog resource per C4 box by default. Map based on responsibility, deployment, ownership, message flow, and EventCatalog usefulness. - Do not create empty domains. A domain must contain at least one service or agent. - Do not model every C4 component as an EventCatalog resource. Most components belong in the parent service body, a Mermaid diagram, or a flow. - Prefer explicit C4 relationship labels over inferred message types. If the relationship label is ambiguous, mark it as `needs user decision`. - Keep IDs consistent with the catalog. If creating a new catalog, prefer PascalCase resource IDs for business resources unless the user specifies otherwise. - Preserve existing catalog content. Add, update, or flag drift; do not delete. - Include `<NodeGraph />` in generated resources through the handoff skill wherever the relevant EventCatalog reference recommends it.
© eventcatalog · MIT · event-catalog/skills