Flow Documentation Wizard
An interactive, conversational skill that guides users through documenting business flows in EventCatalog — step by step, section by section — while cross-referencing their existing catalog resources.
Instructions
Step 1: Locate the User's Catalog
Before anything else, you need to find the user's EventCatalog project so you can cross-reference existing resources.
Ask: "Do you have an EventCatalog project I can look at? If so, where is it?"
- If they provide a path, verify it's an EventCatalog project by checking for
eventcatalog.config.js or known directories (services/, agents/, events/, domains/, flows/).
- If they have the EventCatalog MCP server connected, use
getResources to discover what's in the catalog.
- If they don't have one, that's fine — you'll document steps as plain text descriptions without resource references. Let them know they can still create a useful flow and add resource links later.
Once located, scan the catalog to build an inventory of existing resources:
- Read existing services, agents, events, commands, queries, domains, channels, and flows
- Note their IDs, names, and versions — you'll use these to suggest matches as the user walks through their flow
Step 2: Ask What Flow They Want to Document
Ask: "What flow would you like to document? Describe the end-to-end process you're trying to capture."
Let the user describe the flow in their own words. Examples:
- "User signs up, gets a welcome email, and is added to our CRM"
- "Order is placed, payment is processed, inventory is reserved, and the order is shipped"
- "A customer submits a support ticket, it gets triaged, assigned to an agent, and resolved"
- "A support agent receives an order event, looks up order context, and updates the support case"
From their description, break the flow into sections (high-level stages). Present these sections back to the user for confirmation:
Example response:
Based on your description, I can see roughly these sections:
- User Registration — the user signs up
- Welcome Communication — welcome email is sent
- CRM Integration — user is added to the CRM
Does that look right? We'll walk through each one in detail. Feel free to add, remove, or reorder sections.
Wait for confirmation before proceeding.
Step 3: Walk Through Each Section
Go through each section one at a time. For each section, ask the user to describe what happens. The user leads the conversation — you follow.
For each section, ask something like:
"Let's start with [Section Name]. What happens here? Who or what triggers it, and what happens as a result?"
As the user describes what happens, you need to:
A. Identify the Step Type
From their description, determine which flow step type(s) this section involves:
- Actor — a person or role does something (e.g., "the user clicks sign up", "the admin approves")
- Service — a service in their architecture processes something (e.g., "our auth service handles registration")
- Agent — an AI agent reasons, invokes tools, or automates part of the process (e.g., "the refund agent reviews the case")
- Message — an event, command, or query is exchanged (e.g., "a UserRegistered event is fired")
- External System — a third-party system is involved (e.g., "we call Stripe for payment", "Twilio sends the SMS")
A single section may produce multiple steps (e.g., a user action triggers a command, which is handled by a service, which emits an event).
B. Cross-Reference the Catalog
For each step the user describes, search their EventCatalog (if available) for matching resources:
- Services — Does the service they mention exist in the catalog? Search by name, ID, or similar terms.
- Agents — Does the AI agent, assistant, copilot, or autonomous worker they mention exist in the catalog?
- Events/Commands/Queries — Does the message they describe match something already documented? Look for exact matches and close matches (e.g., user says "order created event" → search for
OrderCreated, OrderPlaced, etc.).
- Channels — Are there channels relevant to how this message flows?
- Domains — Does this step fall within a documented domain?
If you find a match, tell the user:
I found a [resource type] called [ResourceName] (version [version]) in your catalog that looks like it matches. Would you like to reference it in this step?
If they say yes, use the resource's actual id and version in the flow step.
If you find multiple possible matches, present them and let the user choose:
I found a few resources that might match what you're describing:
OrderCreated (event, v1.0.0) — "Emitted when a new order is placed"
OrderPlaced (event, v0.0.1) — "Published when checkout completes"
Which one fits, or is this something new?
If you find no match, that's perfectly fine. Document it as a descriptive step:
- If it sounds like a service, use
service type with a suggested ID and note it's not yet in the catalog
- If it sounds like an AI agent, use
agent type with a suggested ID and note it's not yet in the catalog
- If it sounds like a message, use
message type with a suggested ID
- If it's a person/role, use
actor type
- If it's a third-party tool/API, use
externalSystem type
Let the user know: "I didn't find this in your catalog. I'll document it as [step type] for now. You can create the full resource later if you'd like."
C. Confirm Each Section Before Moving On
After processing a section, summarize what you've captured for that section and ask the user to confirm before moving to the next one.
Example:
Here's what I've captured for Payment Processing:
ProcessPayment command is sent (matched to your existing ProcessPayment command v0.0.1)
PaymentService handles the payment (matched to your existing PaymentService v1.2.0)
FraudReviewAgent reviews fraud signals (matched to your existing FraudReviewAgent v0.0.1)
- Calls Stripe (external system) to charge the card
PaymentProcessed event is emitted (not in your catalog yet — I'll use a placeholder)
Does that look right? Anything to add or change?
Step 4: Handle Branching and Edge Cases
As you walk through sections, watch for:
Branching paths — "If payment succeeds, we continue; if it fails, we notify the user"
- Ask: "It sounds like there's a decision point here. What are the possible paths?"
- Document these as
next_steps (plural) with labels for each branch
Loops — "The service retries if the external call fails"
- Document as a step that references back to an earlier step via
next_step
Error/failure paths — "If validation fails, we send back an error"
- These are terminal steps or branch to a notification/error handling step
Parallel paths — "While payment processes, we also reserve inventory"
- Document as separate branches from a common step using
next_steps
When you detect branching, explicitly confirm the paths with the user:
"It sounds like there's a fork here. After [step], these things could happen:
- [Success path] → continues to [next section]
- [Failure path] → [what happens]
Is that right? Are there other outcomes?"
Step 5: Build the Flow Summary
After walking through all sections, present a complete summary of the flow before generating the file:
Here's the complete flow: [Flow Name]
- [Step 1 summary] → [Step 2]
- [Step 2 summary] → [Step 3]
- [Step 3 summary] → branches to [Step 4a] or [Step 4b]
...
Resources matched from your catalog: [list of matched resources]
New resources (not yet in catalog): [list of unmatched items]
Ready to generate the flow file?
Step 6: Generate the Flow File
Once the user confirms, generate the flow index.mdx file following the format in references/flows.md.
Rules for generation:
Use the user's catalog directory. Ask where the flow should be saved if unclear — either flows/{FlowName}/index.mdx or domains/{Domain}/flows/{FlowName}/index.mdx depending on their catalog structure.
For matched resources (found in catalog), use the exact id and version from the catalog:
- id: "payment_processing"
title: "Payment Service"
service:
id: "PaymentService"
version: "1.2.0"
Agent steps use the agent field:
- id: "fraud_review"
title: "Fraud Review Agent"
agent:
id: "FraudReviewAgent"
version: "0.0.1"
For unmatched resources (not in catalog), use descriptive IDs and version 0.0.1:
- id: "send_welcome_email"
title: "Send Welcome Email"
message:
id: "WelcomeEmailRequested"
version: "0.0.1"
For actors, use the role or persona name:
- id: "user_initiates_signup"
title: "User Signs Up"
actor:
name: "Customer"
For external systems, include name, summary, and URL if known:
- id: "stripe_charges_card"
title: "Stripe Payment"
externalSystem:
name: "Stripe"
summary: "Third-party payment processor"
url: "https://stripe.com"
Connect all steps with next_step or next_steps as appropriate.
Terminal steps (end of flow or end of a branch) should have no next_step.
The body should be <NodeGraph />.
Set version to 0.0.1 for new flows.
Write a meaningful summary that describes the end-to-end business process.
Step 7: Validate and Write
Before writing the file:
- Verify all step IDs are unique within the flow
- Verify all
next_step / next_steps references point to valid step IDs
- Verify matched resource IDs and versions are correct
- Verify the YAML frontmatter is valid
- Verify
<NodeGraph /> is in the body
Write the file to the user's catalog directory.
After writing, let the user know:
- Where the file was saved
- Which resources were matched from their catalog
- Which resources are new/unmatched — suggest they can document these later using the
catalog-documentation-creator skill, especially new agents
- They can view the flow visualization in EventCatalog by running their dev server
Conversation Guidelines
- The user leads. You ask questions and guide, but the user describes what happens in their own words. Don't assume or invent steps.
- One section at a time. Don't rush ahead. Confirm each section before moving on.
- Be helpful with matches. When you find catalog resources that match, proactively suggest them — but always let the user decide.
- Be honest about misses. If nothing in the catalog matches, say so plainly and document it descriptively.
- Keep it conversational. This is a guided walkthrough, not a form to fill out. Be natural and responsive.
- Suggest, don't dictate. If the user's description doesn't perfectly map to a step type, suggest what you think fits and ask if that's right.
- Handle complexity gracefully. If a flow gets complex (many branches, loops), help the user keep track by summarizing periodically.
Searching the Catalog
When searching for matching resources, use these strategies:
- Exact ID match — search for the exact name mentioned (e.g., "OrdersService" → look for
OrdersService)
- Fuzzy match — search for variations (e.g., "orders service" → try
OrdersService, OrderService, orders-service)
- Semantic match — if the user says "the thing that handles payments", search for services with "payment" in the name or summary
- Browse by type — if you know it's an event, search events specifically
- Agent terms — if the user says "assistant", "copilot", "worker", "reviewer", or "agent", search
agents/ before treating it as an external system
If the EventCatalog MCP server is available:
- Use
getResources to list all resources
- Use
getResource to get details on a specific resource
- Use
findResourcesByOwner to explore resources by team
If reading the filesystem directly:
- Look in
services/, agents/, events/, commands/, queries/, domains/, flows/, channels/ directories
- Read
index.mdx files to check id, name, version, and summary fields
Quality Checklist
Before delivering the flow file:
- Every step has a unique
id
- Every step has a
title
- Every step has exactly one type (
actor, service, agent, message, or externalSystem)
- All
next_step and next_steps references point to valid step IDs within the flow
- No orphaned steps (every step is reachable from the first step, except via branching)
- Matched resources use correct
id and version from the catalog
- The flow has a clear start (first step) and at least one terminal step (no
next_step)
- YAML frontmatter is valid with
--- delimiters
- File is named
index.mdx
<NodeGraph /> is in the body
version is a valid semver string
summary describes the business process meaningfully
1---2name: flow-wizard3description: Guides users through documenting business flows step-by-step in EventCatalog, including services, agents, messages, actors, and external systems. Use when user asks to "document a flow", "map a business process", "create a flow diagram", "walk through a process", "document an end-to-end flow", "map an agent workflow", or "map out how something works in my architecture".4license: MIT5---6
7# Flow Documentation Wizard
8
9An interactive, conversational skill that guides users through documenting business flows in EventCatalog — step by step, section by section — while cross-referencing their existing catalog resources.
10
11## Instructions
12
13### Step 1: Locate the User's Catalog
14
15Before anything else, you need to find the user's EventCatalog project so you can cross-reference existing resources.
16
17Ask: **"Do you have an EventCatalog project I can look at? If so, where is it?"**
18
19- If they provide a path, verify it's an EventCatalog project by checking for `eventcatalog.config.js` or known directories (`services/`, `agents/`, `events/`, `domains/`, `flows/`).
20- If they have the EventCatalog MCP server connected, use `getResources` to discover what's in the catalog.
21- If they don't have one, that's fine — you'll document steps as plain text descriptions without resource references. Let them know they can still create a useful flow and add resource links later.
22
23Once located, scan the catalog to build an inventory of existing resources:
24- Read existing services, agents, events, commands, queries, domains, channels, and flows
25- Note their IDs, names, and versions — you'll use these to suggest matches as the user walks through their flow
26
27### Step 2: Ask What Flow They Want to Document
28
29Ask: **"What flow would you like to document? Describe the end-to-end process you're trying to capture."**
30
31Let the user describe the flow in their own words. Examples:
32- "User signs up, gets a welcome email, and is added to our CRM"
33- "Order is placed, payment is processed, inventory is reserved, and the order is shipped"
34- "A customer submits a support ticket, it gets triaged, assigned to an agent, and resolved"
35- "A support agent receives an order event, looks up order context, and updates the support case"
36
37From their description, break the flow into **sections** (high-level stages). Present these sections back to the user for confirmation:
38
39**Example response:**
40> Based on your description, I can see roughly these sections:
41> 1. **User Registration** — the user signs up
42> 2. **Welcome Communication** — welcome email is sent
43> 3. **CRM Integration** — user is added to the CRM
44>
45> Does that look right? We'll walk through each one in detail. Feel free to add, remove, or reorder sections.
46
47Wait for confirmation before proceeding.
48
49### Step 3: Walk Through Each Section
50
51Go through each section **one at a time**. For each section, ask the user to describe what happens. The user leads the conversation — you follow.
52
53For each section, ask something like:
54
55**"Let's start with [Section Name]. What happens here? Who or what triggers it, and what happens as a result?"**
56
57As the user describes what happens, you need to:
58
59#### A. Identify the Step Type
60
61From their description, determine which flow step type(s) this section involves:
62
63- **Actor** — a person or role does something (e.g., "the user clicks sign up", "the admin approves")
64- **Service** — a service in their architecture processes something (e.g., "our auth service handles registration")
65- **Agent** — an AI agent reasons, invokes tools, or automates part of the process (e.g., "the refund agent reviews the case")
66- **Message** — an event, command, or query is exchanged (e.g., "a UserRegistered event is fired")
67- **External System** — a third-party system is involved (e.g., "we call Stripe for payment", "Twilio sends the SMS")
68
69A single section may produce multiple steps (e.g., a user action triggers a command, which is handled by a service, which emits an event).
70
71#### B. Cross-Reference the Catalog
72
73For each step the user describes, search their EventCatalog (if available) for matching resources:
74
751. **Services** — Does the service they mention exist in the catalog? Search by name, ID, or similar terms.
762. **Agents** — Does the AI agent, assistant, copilot, or autonomous worker they mention exist in the catalog?
773. **Events/Commands/Queries** — Does the message they describe match something already documented? Look for exact matches and close matches (e.g., user says "order created event" → search for `OrderCreated`, `OrderPlaced`, etc.).
784. **Channels** — Are there channels relevant to how this message flows?
795. **Domains** — Does this step fall within a documented domain?
80
81**If you find a match**, tell the user:
82
83> I found a **[resource type]** called `[ResourceName]` (version `[version]`) in your catalog that looks like it matches. Would you like to reference it in this step?
84
85If they say yes, use the resource's actual `id` and `version` in the flow step.
86
87**If you find multiple possible matches**, present them and let the user choose:
88
89> I found a few resources that might match what you're describing:
90> - `OrderCreated` (event, v1.0.0) — "Emitted when a new order is placed"
91> - `OrderPlaced` (event, v0.0.1) — "Published when checkout completes"
92>
93> Which one fits, or is this something new?
94
95**If you find no match**, that's perfectly fine. Document it as a descriptive step:
96- If it sounds like a service, use `service` type with a suggested ID and note it's not yet in the catalog
97- If it sounds like an AI agent, use `agent` type with a suggested ID and note it's not yet in the catalog
98- If it sounds like a message, use `message` type with a suggested ID
99- If it's a person/role, use `actor` type
100- If it's a third-party tool/API, use `externalSystem` type
101
102Let the user know: **"I didn't find this in your catalog. I'll document it as [step type] for now. You can create the full resource later if you'd like."**
103
104#### C. Confirm Each Section Before Moving On
105
106After processing a section, summarize what you've captured for that section and ask the user to confirm before moving to the next one.
107
108**Example:**
109> Here's what I've captured for **Payment Processing**:
110>
111> 1. `ProcessPayment` command is sent (matched to your existing `ProcessPayment` command v0.0.1)
112> 2. `PaymentService` handles the payment (matched to your existing `PaymentService` v1.2.0)
113> 3. `FraudReviewAgent` reviews fraud signals (matched to your existing `FraudReviewAgent` v0.0.1)
114> 4. Calls **Stripe** (external system) to charge the card
115> 5. `PaymentProcessed` event is emitted (not in your catalog yet — I'll use a placeholder)
116>
117> Does that look right? Anything to add or change?
118
119### Step 4: Handle Branching and Edge Cases
120
121As you walk through sections, watch for:
122
123- **Branching paths** — "If payment succeeds, we continue; if it fails, we notify the user"
124 - Ask: **"It sounds like there's a decision point here. What are the possible paths?"**
125 - Document these as `next_steps` (plural) with labels for each branch
126
127- **Loops** — "The service retries if the external call fails"
128 - Document as a step that references back to an earlier step via `next_step`
129
130- **Error/failure paths** — "If validation fails, we send back an error"
131 - These are terminal steps or branch to a notification/error handling step
132
133- **Parallel paths** — "While payment processes, we also reserve inventory"
134 - Document as separate branches from a common step using `next_steps`
135
136When you detect branching, explicitly confirm the paths with the user:
137
138> **"It sounds like there's a fork here. After [step], these things could happen:**
139> 1. [Success path] → continues to [next section]
140> 2. [Failure path] → [what happens]
141>
142> **Is that right? Are there other outcomes?"**
143
144### Step 5: Build the Flow Summary
145
146After walking through all sections, present a complete summary of the flow before generating the file:
147
148> **Here's the complete flow: [Flow Name]**
149>
150> 1. [Step 1 summary] → [Step 2]
151> 2. [Step 2 summary] → [Step 3]
152> 3. [Step 3 summary] → branches to [Step 4a] or [Step 4b]
153> ...
154>
155> **Resources matched from your catalog:** [list of matched resources]
156> **New resources (not yet in catalog):** [list of unmatched items]
157>
158> Ready to generate the flow file?
159
160### Step 6: Generate the Flow File
161
162Once the user confirms, generate the flow `index.mdx` file following the format in `references/flows.md`.
163
164**Rules for generation:**
165
1661. Use the user's catalog directory. Ask where the flow should be saved if unclear — either `flows/{FlowName}/index.mdx` or `domains/{Domain}/flows/{FlowName}/index.mdx` depending on their catalog structure.
167
1682. For **matched resources** (found in catalog), use the exact `id` and `version` from the catalog:
169 ```yaml
170 - id: "payment_processing"
171 title: "Payment Service"
172 service:
173 id: "PaymentService"
174 version: "1.2.0"
175 ```
176
177 Agent steps use the `agent` field:
178 ```yaml
179 - id: "fraud_review"
180 title: "Fraud Review Agent"
181 agent:
182 id: "FraudReviewAgent"
183 version: "0.0.1"
184 ```
185
1863. For **unmatched resources** (not in catalog), use descriptive IDs and version `0.0.1`:
187 ```yaml
188 - id: "send_welcome_email"
189 title: "Send Welcome Email"
190 message:
191 id: "WelcomeEmailRequested"
192 version: "0.0.1"
193 ```
194
1954. For **actors**, use the role or persona name:
196 ```yaml
197 - id: "user_initiates_signup"
198 title: "User Signs Up"
199 actor:
200 name: "Customer"
201 ```
202
2035. For **external systems**, include name, summary, and URL if known:
204 ```yaml
205 - id: "stripe_charges_card"
206 title: "Stripe Payment"
207 externalSystem:
208 name: "Stripe"
209 summary: "Third-party payment processor"
210 url: "https://stripe.com"
211 ```
212
2136. Connect all steps with `next_step` or `next_steps` as appropriate.
214
2157. Terminal steps (end of flow or end of a branch) should have no `next_step`.
216
2178. The body should be `<NodeGraph />`.
218
2199. Set `version` to `0.0.1` for new flows.
220
22110. Write a meaningful `summary` that describes the end-to-end business process.
222
223### Step 7: Validate and Write
224
225Before writing the file:
226
2271. Verify all step IDs are unique within the flow
2282. Verify all `next_step` / `next_steps` references point to valid step IDs
2293. Verify matched resource IDs and versions are correct
2304. Verify the YAML frontmatter is valid
2315. Verify `<NodeGraph />` is in the body
232
233Write the file to the user's catalog directory.
234
235After writing, let the user know:
236- Where the file was saved
237- Which resources were matched from their catalog
238- Which resources are new/unmatched — suggest they can document these later using the `catalog-documentation-creator` skill, especially new agents
239- They can view the flow visualization in EventCatalog by running their dev server
240
241## Conversation Guidelines
242
243- **The user leads.** You ask questions and guide, but the user describes what happens in their own words. Don't assume or invent steps.
244- **One section at a time.** Don't rush ahead. Confirm each section before moving on.
245- **Be helpful with matches.** When you find catalog resources that match, proactively suggest them — but always let the user decide.
246- **Be honest about misses.** If nothing in the catalog matches, say so plainly and document it descriptively.
247- **Keep it conversational.** This is a guided walkthrough, not a form to fill out. Be natural and responsive.
248- **Suggest, don't dictate.** If the user's description doesn't perfectly map to a step type, suggest what you think fits and ask if that's right.
249- **Handle complexity gracefully.** If a flow gets complex (many branches, loops), help the user keep track by summarizing periodically.
250
251## Searching the Catalog
252
253When searching for matching resources, use these strategies:
254
2551. **Exact ID match** — search for the exact name mentioned (e.g., "OrdersService" → look for `OrdersService`)
2562. **Fuzzy match** — search for variations (e.g., "orders service" → try `OrdersService`, `OrderService`, `orders-service`)
2573. **Semantic match** — if the user says "the thing that handles payments", search for services with "payment" in the name or summary
2584. **Browse by type** — if you know it's an event, search events specifically
2595. **Agent terms** — if the user says "assistant", "copilot", "worker", "reviewer", or "agent", search `agents/` before treating it as an external system
260
261If the EventCatalog MCP server is available:
262- Use `getResources` to list all resources
263- Use `getResource` to get details on a specific resource
264- Use `findResourcesByOwner` to explore resources by team
265
266If reading the filesystem directly:
267- Look in `services/`, `agents/`, `events/`, `commands/`, `queries/`, `domains/`, `flows/`, `channels/` directories
268- Read `index.mdx` files to check `id`, `name`, `version`, and `summary` fields
269
270## Quality Checklist
271
272Before delivering the flow file:
273
2741. Every step has a unique `id`
2752. Every step has a `title`
2763. Every step has exactly one type (`actor`, `service`, `agent`, `message`, or `externalSystem`)
2774. All `next_step` and `next_steps` references point to valid step IDs within the flow
2785. No orphaned steps (every step is reachable from the first step, except via branching)
2796. Matched resources use correct `id` and `version` from the catalog
2807. The flow has a clear start (first step) and at least one terminal step (no `next_step`)
2818. YAML frontmatter is valid with `---` delimiters
2829. File is named `index.mdx`
28310. `<NodeGraph />` is in the body
28411. `version` is a valid semver string
28512. `summary` describes the business process meaningfully