Generates EventCatalog documentation files (services, events, commands, queries, domains, flows, channels, containers) with correct frontmatter, folder structure, and best practices. Use when user asks to "document a service", "create EventCatalog files", "add an event to the catalog", "document my architecture", "generate catalog documentation", "create documentation for my microservice", or "document a database".
Generate properly formatted EventCatalog documentation files following project conventions and best practices.
Before generating any files, ask the user: "Do you already have an EventCatalog project, or would you like to create a new one?"
If they already have a catalog:
~/projects/my-catalog/)eventcatalog.config.js file or known directories (services/, events/, domains/, etc.)If they don't have a catalog yet:
npx @eventcatalog/create-eventcatalog@latest my-catalog --empty
(Replace my-catalog with the user's preferred name)CRITICAL: All generated files must be written to the user's catalog directory, not just displayed. Always ask where they want resources documented — never assume.
Ask the user what they want to document. Common scenarios:
Gather this information before generating:
0.0.1 for new resources)If the user points you at a codebase (not the catalog), analyze it to extract services, messages, schemas, and relationships — then generate the corresponding catalog documentation.
If the catalog directory already has resources, read the existing files to understand:
Match new documentation to these existing conventions.
If the user has the EventCatalog MCP server connected:
getResources to see what already exists in the cataloggetResource to check conventions used in existing entries (naming patterns, owner formats, badge styles)findResourcesByOwner to suggest consistent ownershipgetSchemaForResource to match existing schema formatsThis ensures new documentation is consistent with what's already in the catalog.
Generate files following the resource-specific references. Consult the appropriate reference file for the resource type:
references/services.md — Services with sends/receives, channel routing, containersreferences/events.md — Events with schemas, payload examples, producer/consumer codereferences/commands.md — Commands with REST operations and schemasreferences/queries.md — Queries with REST operations and response schemasreferences/domains.md — Domains with subdomains, services, and business contextreferences/flows.md — Business flows with steps, branching, and external systemsreferences/channels.md — Channels with routing, protocols, and parametersreferences/containers.md — Containers (databases, caches, queues) with data classificationreferences/ubiquitous-language.md — Ubiquitous language terms per domain (DDD glossary/dictionary)references/teams-and-users.md — Teams and users (ownership)references/components.md — Components (NodeGraph, Schema, Mermaid, Tabs, etc.) and resource references ([[type|Name]] wiki-style links)Every resource file MUST include:
--- delimitersid field matching existing catalog conventionsname as human-readable display nameversion as semantic version stringsummary as a concise 1-2 sentence descriptionCRITICAL: Always use index.mdx as the filename for resources (services, events, commands, queries, domains, flows, channels). Teams and users use {id}.mdx files directly. Place files in the correct folder path following the nested structure pattern:
domains/{DomainName}/services/{ServiceName}/events/{EventName}/index.mdx
Or flat structure if the catalog uses that pattern:
services/{ServiceName}/index.mdx
events/{EventName}/index.mdx
Before presenting the files to the user, verify:
--- delimiters on both sidesid fields are consistent (no spaces, match folder name)version fields are valid semver strings (e.g., 0.0.1)sends/receives include id and optionally versionto/from fields correctly in sends/receivesschemaPath actually exist or are generated<NodeGraph /> component is included for architecture visualizationWhen a user says "document my payment service that receives OrderCreated events and sends PaymentProcessed events":
index.mdx with receives and sends arraysto/from fields to the sends/receivesindex.mdx if they don't already exist in the catalog<NodeGraph /> in the service body to show message flowCRITICAL: A domain MUST have at least one service. Never create a domain without services in it. If the user describes a domain, ensure services are identified and generated for it.
When a user wants to document a full domain:
index.mdx with the services field listing every servicedomains/{Domain}/services/{Service}/events/{Event}/ubiquitous-language.mdx file for the domain by extracting domain-specific terms from service names, event/command names, entities, and business processes. Place it at domains/{Domain}/ubiquitous-language.mdx. See references/ubiquitous-language.md for format and examples.services field lists every service that belongs to it. Every service created under a domain MUST be referenced in the domain's index.mdx:
services:
- id: OrdersService
- id: InventoryService
- id: PaymentService
If a service is nested inside the domain folder but not listed in the domain's services frontmatter, it will not appear as part of that domain. Always cross-check.When a user describes a multi-step process:
index.mdx with steps arrayid, title, and appropriate type (actor, service, message, externalSystem)next_step or next_steps for branchingWhen a user describes how messages flow through infrastructure:
index.mdx files with routes for channel-to-channel routingsends/receives with to/from fields pointing to channelsBefore delivering documentation to the user, verify every file against this checklist:
--- delimitersid matches the folder nameversion is a valid semver stringsummary is concise and meaningful (not generic)sends/receives) include idto/from) references valid channel IDs<NodeGraph /> for visualizationindex.mdx (not index.md, README.md, or anything else)services frontmatter lists every service that belongs to that domainubiquitous-language.mdx file with relevant domain terms extracted from services, events, commands, and business processesIf generated events/commands don't appear in the service's node graph:
sends/receives arrays in the service frontmatter reference the exact id of the messageindex.mdx fileIf <Schema /> or <SchemaViewer /> components show errors:
schemaPath in frontmatter points to a file that exists alongside index.mdxIf resources don't appear in EventCatalog:
index.mdx (not INDEX.mdx or readme.md)services/, events/, domains/, etc.)If channel connections don't appear in the visualizer:
routes field in the channel frontmatter references valid channel IDsto/from fields in service sends/receives reference valid channel IDs