Documenting Business Processes
Document the business processes and workflows a system implements: how domain entities move through the system, what triggers each step, what the outcomes are, and what can go wrong. Business process docs tell the end-to-end story that no single component's documentation can tell on its own.
Core Principles
- End-to-End Perspective: Process docs describe a complete flow from trigger to outcome. They cross component boundaries — that's their purpose.
- Business Language: Describe processes in business terms, referencing domain concepts. "User submits registration form" not "POST /api/v1/users handler validates input."
- NOT Development Processes: This skill documents business workflows the system implements (user registration, order fulfillment). Development processes (how to test, deploy, contribute) belong in skills and contribution guidelines — not here.
- No Duplication Across Levels: Reference domain docs for entity definitions and architecture docs for system structure. Process docs describe the FLOW — how entities traverse the architecture. Don't redefine domain terms or re-explain architectural patterns.
- Include Failure Paths: Happy paths are easy. Document what happens when things go wrong — failed payments, validation errors, timeouts, partial completions.
Documentation Hierarchy
Domain ← Defines the entities involved in processes
↓
Architecture ← Defines the system structure processes traverse
↓
Business Processes ← You are here (end-to-end flows across the system)
↓
Components ← Implements individual steps of processes
Workflow
Step 1: Discover Existing Documentation
Before writing anything:
- Check for existing process docs, flow diagrams, or sequence diagrams
- Read AGENTS.md for pointers to existing documentation
- Check domain and architecture docs for references to processes
- If process docs already exist: Understand their structure and extend them
Step 2: Trace the Process
Follow the targeted process through the codebase:
- Identify the trigger — what initiates this process (user action, scheduled job, external event)
- Trace the happy path step by step across component boundaries
- Identify decision points — where the flow branches based on conditions
- Map failure modes — what can go wrong at each step and how the system handles it
- Identify the outcomes — what state changes when the process completes (or fails)
- Note any asynchronous steps, retries, or eventual consistency patterns
Stay within the requested scope. Document one process at a time.
Step 3: Write Process Documentation
Follow the project's existing doc style. If none exists, use this structure:
# <Process Name>
## Overview
<What this process accomplishes from a business perspective — 2-3 sentences>
## Trigger
<What initiates this process — user action, system event, schedule, external call>
## Actors
<Who or what is involved — users, services, external systems>
- <Actor>: <role in this process>
## Diagram
<Mermaid diagram visualizing the process flow — see diagram guidance below>
## Flow
### Happy Path
1. <Step 1> — <what happens, which component handles it>
2. <Step 2> — <what happens, which component handles it>
3. ...
<Result: what state changes when the process completes successfully>
### Failure Scenarios
#### <Failure Scenario 1>
- **Trigger**: <What causes this failure>
- **At step**: <Where in the flow it occurs>
- **Handling**: <How the system responds — rollback, retry, partial completion, error state>
- **User impact**: <What the user experiences>
#### <Failure Scenario 2>
...
## State Changes
<What entities are created, modified, or deleted when this process completes>
- <Entity>: <from state> → <to state>
## Dependencies
<External systems, services, or conditions this process relies on>
Mermaid Diagrams
Every process doc should include a mermaid diagram placed before the textual flow description. The diagram gives humans an instant visual overview; the text provides the detail.
Choose the diagram type based on the process shape:
- Flowchart (
flowchart TD): Best for most processes — decision branches, parallel paths, error terminals. Use subgraphs to group related phases.
- Sequence diagram (
sequenceDiagram): Best when the process is a back-and-forth between distinct actors or systems (e.g., sourcing chain, API handshakes).
Guidelines:
- Keep diagrams focused — show the main flow and key decision points, not every edge case
- Use descriptive node labels in business language, not function names
- Mark error terminals distinctly (e.g., red styling or stop symbols)
- Use subgraphs to separate phases when a process has distinct stages
Sub-Process Decomposition
When tracing a process, some steps may be complex enough to warrant their own dedicated process doc. Decompose a step into a sub-process when:
- The step has its own decision branches, failure modes, or actors beyond the parent flow
- The step involves multiple sequential actions that would bloat the parent doc
- The step is reusable — referenced by multiple parent processes
- Documenting it inline would make the parent doc's flow section harder to scan
When you identify a sub-process:
- In the parent doc: Replace the inline description with a link to the sub-process doc. Keep only a one-line summary in the flow step — the detail lives in the sub-process doc.
3. **[Check system compatibility][compat-check]** — Verify the system meets minimum requirements
- Add a Sub-Processes table to the parent doc (if one doesn't exist) listing all sub-processes with links and brief descriptions.
- Create the sub-process doc using the same template as the parent — Overview, Trigger, Actors, Diagram, Flow, Failure Scenarios, State Changes, Dependencies. The trigger should reference the parent process (e.g., "Called during step 3 of [installation][installation]").
- Match existing patterns — if the parent doc already has sub-process links, follow the exact same structure (link style, summary length, Sub-Processes table format). Consistency across sub-processes matters.
When NOT to decompose:
- The step is a single action with no branching or failure modes
- The step's behavior is fully captured in one sentence
- Breaking it out would create a trivially short doc that adds navigation overhead without value
Step 4: Update AGENTS.md Pointers
If new documentation files were created, propose adding a pointer in AGENTS.md:
## Business Processes
See `docs/processes/<process>.md` for <brief description>.
Never put process details into AGENTS.md itself — only add a pointer.
Integration with Other Skills
- documenting-domain: Process docs reference domain entities (e.g., "creates a new User — see domain/users.md for the User entity definition"). Never redefine domain terms here.
- documenting-architecture: Process docs reference architectural patterns when relevant (e.g., "this step publishes an event via the event bus — see architecture/event-bus.md"). Never re-explain the architecture here.
- documenting-components: Component docs describe how individual steps are implemented; process docs describe the end-to-end flow across components.
- project-feature-planning: Process docs help agents understand the full impact of changes — modifying one step of a process affects the entire flow.
Rules
- Never document development processes — testing, deployment, and CI/CD belong in skills and contribution guidelines
- Never document all processes at once — only the targeted process
- Never redefine domain concepts or architectural patterns — reference the appropriate docs
- Always include failure paths — happy-path-only docs are incomplete and misleading
- Business language first — describe what happens from the business perspective, then note which components are involved
- Use reference-style links — when linking to other docs or source files, use reference links (
[text][ref] with [ref]: path at the bottom of the file) rather than inline links. They read better in source and are easier to maintain.
- Decompose complex steps into sub-processes — if a step has its own decision branches, failure modes, or multiple sequential actions, it needs its own doc. Don't inline what should be a sub-process.
- Match existing sub-process patterns — if a parent doc already has sub-process links, new sub-processes must follow the exact same structure and link style
- Propose structure first — if no process docs exist yet, propose a directory structure and format before creating files
1---2name: documenting-business-processes3description: Document business processes and workflows that a system implements. Describes end-to-end flows like user registration, order fulfillment, or payment processing — how domain entities move through the system. Use when (1) business workflows are undocumented, (2) a flow spans multiple components and no single component's docs tell the full story, (3) agents need to understand end-to-end behavior to implement changes, or (4) stakeholders need visibility into how the system handles a business process. NOT for development processes — those belong in skills and contribution guidelines.4---5
6# Documenting Business Processes
7
8Document the business processes and workflows a system implements: how domain entities move through the system, what triggers each step, what the outcomes are, and what can go wrong. Business process docs tell the **end-to-end story** that no single component's documentation can tell on its own.
9
10## Core Principles
11
121. **End-to-End Perspective**: Process docs describe a complete flow from trigger to outcome. They cross component boundaries — that's their purpose.
132. **Business Language**: Describe processes in business terms, referencing domain concepts. "User submits registration form" not "POST /api/v1/users handler validates input."
143. **NOT Development Processes**: This skill documents business workflows the system implements (user registration, order fulfillment). Development processes (how to test, deploy, contribute) belong in skills and contribution guidelines — not here.
154. **No Duplication Across Levels**: Reference domain docs for entity definitions and architecture docs for system structure. Process docs describe the FLOW — how entities traverse the architecture. Don't redefine domain terms or re-explain architectural patterns.
165. **Include Failure Paths**: Happy paths are easy. Document what happens when things go wrong — failed payments, validation errors, timeouts, partial completions.
17
18## Documentation Hierarchy
19
20```
21Domain ← Defines the entities involved in processes
22 ↓
23Architecture ← Defines the system structure processes traverse
24 ↓
25Business Processes ← You are here (end-to-end flows across the system)
26 ↓
27Components ← Implements individual steps of processes
28```
29
30## Workflow
31
32### Step 1: Discover Existing Documentation
33
34Before writing anything:
35
361. Check for existing process docs, flow diagrams, or sequence diagrams
372. Read AGENTS.md for pointers to existing documentation
383. Check domain and architecture docs for references to processes
394. **If process docs already exist**: Understand their structure and extend them
40
41### Step 2: Trace the Process
42
43Follow the targeted process through the codebase:
44
451. Identify the trigger — what initiates this process (user action, scheduled job, external event)
462. Trace the happy path step by step across component boundaries
473. Identify decision points — where the flow branches based on conditions
484. Map failure modes — what can go wrong at each step and how the system handles it
495. Identify the outcomes — what state changes when the process completes (or fails)
506. Note any asynchronous steps, retries, or eventual consistency patterns
51
52**Stay within the requested scope.** Document one process at a time.
53
54### Step 3: Write Process Documentation
55
56Follow the project's existing doc style. If none exists, use this structure:
57
58```markdown
59# <Process Name>
60
61## Overview
62<What this process accomplishes from a business perspective — 2-3 sentences>
63
64## Trigger
65<What initiates this process — user action, system event, schedule, external call>
66
67## Actors
68<Who or what is involved — users, services, external systems>
69- <Actor>: <role in this process>
70
71## Diagram
72<Mermaid diagram visualizing the process flow — see diagram guidance below>
73
74## Flow
75
76### Happy Path
771. <Step 1> — <what happens, which component handles it>
782. <Step 2> — <what happens, which component handles it>
793. ...
80<Result: what state changes when the process completes successfully>
81
82### Failure Scenarios
83
84#### <Failure Scenario 1>
85- **Trigger**: <What causes this failure>
86- **At step**: <Where in the flow it occurs>
87- **Handling**: <How the system responds — rollback, retry, partial completion, error state>
88- **User impact**: <What the user experiences>
89
90#### <Failure Scenario 2>
91...
92
93## State Changes
94<What entities are created, modified, or deleted when this process completes>
95- <Entity>: <from state> → <to state>
96
97## Dependencies
98<External systems, services, or conditions this process relies on>
99```
100
101#### Mermaid Diagrams
102
103Every process doc should include a mermaid diagram placed **before** the textual flow description. The diagram gives humans an instant visual overview; the text provides the detail.
104
105Choose the diagram type based on the process shape:
106
107- **Flowchart** (`flowchart TD`): Best for most processes — decision branches, parallel paths, error terminals. Use subgraphs to group related phases.
108- **Sequence diagram** (`sequenceDiagram`): Best when the process is a back-and-forth between distinct actors or systems (e.g., sourcing chain, API handshakes).
109
110Guidelines:
111- Keep diagrams focused — show the main flow and key decision points, not every edge case
112- Use descriptive node labels in business language, not function names
113- Mark error terminals distinctly (e.g., red styling or stop symbols)
114- Use subgraphs to separate phases when a process has distinct stages
115
116#### Sub-Process Decomposition
117
118When tracing a process, some steps may be complex enough to warrant their own dedicated process doc. Decompose a step into a sub-process when:
119
120- The step has its own **decision branches, failure modes, or actors** beyond the parent flow
121- The step involves **multiple sequential actions** that would bloat the parent doc
122- The step is **reusable** — referenced by multiple parent processes
123- Documenting it inline would make the parent doc's flow section harder to scan
124
125**When you identify a sub-process:**
126
1271. **In the parent doc**: Replace the inline description with a link to the sub-process doc. Keep only a one-line summary in the flow step — the detail lives in the sub-process doc.
128 ```markdown
129 3. **[Check system compatibility][compat-check]** — Verify the system meets minimum requirements
130 ```
1312. **Add a Sub-Processes table** to the parent doc (if one doesn't exist) listing all sub-processes with links and brief descriptions.
1323. **Create the sub-process doc** using the same template as the parent — Overview, Trigger, Actors, Diagram, Flow, Failure Scenarios, State Changes, Dependencies. The trigger should reference the parent process (e.g., "Called during step 3 of [installation][installation]").
1334. **Match existing patterns** — if the parent doc already has sub-process links, follow the exact same structure (link style, summary length, Sub-Processes table format). Consistency across sub-processes matters.
134
135**When NOT to decompose:**
136
137- The step is a single action with no branching or failure modes
138- The step's behavior is fully captured in one sentence
139- Breaking it out would create a trivially short doc that adds navigation overhead without value
140
141### Step 4: Update AGENTS.md Pointers
142
143If new documentation files were created, propose adding a pointer in AGENTS.md:
144
145```markdown
146## Business Processes
147See `docs/processes/<process>.md` for <brief description>.
148```
149
150**Never put process details into AGENTS.md itself** — only add a pointer.
151
152## Integration with Other Skills
153
154- **documenting-domain**: Process docs reference domain entities (e.g., "creates a new User — see domain/users.md for the User entity definition"). Never redefine domain terms here.
155- **documenting-architecture**: Process docs reference architectural patterns when relevant (e.g., "this step publishes an event via the event bus — see architecture/event-bus.md"). Never re-explain the architecture here.
156- **documenting-components**: Component docs describe how individual steps are implemented; process docs describe the end-to-end flow across components.
157- **project-feature-planning**: Process docs help agents understand the full impact of changes — modifying one step of a process affects the entire flow.
158
159## Rules
160
161- **Never document development processes** — testing, deployment, and CI/CD belong in skills and contribution guidelines
162- **Never document all processes at once** — only the targeted process
163- **Never redefine domain concepts or architectural patterns** — reference the appropriate docs
164- **Always include failure paths** — happy-path-only docs are incomplete and misleading
165- **Business language first** — describe what happens from the business perspective, then note which components are involved
166- **Use reference-style links** — when linking to other docs or source files, use reference links (`[text][ref]` with `[ref]: path` at the bottom of the file) rather than inline links. They read better in source and are easier to maintain.
167- **Decompose complex steps into sub-processes** — if a step has its own decision branches, failure modes, or multiple sequential actions, it needs its own doc. Don't inline what should be a sub-process.
168- **Match existing sub-process patterns** — if a parent doc already has sub-process links, new sub-processes must follow the exact same structure and link style
169- **Propose structure first** — if no process docs exist yet, propose a directory structure and format before creating files