sad-mcp 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sad-mcp",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "MCP server for Software Analysis and Design course materials at BGU",
5
5
  "type": "module",
6
6
  "bin": {
@@ -7,6 +7,8 @@ description: Create BPMN (Business Process Model and Notation) diagrams as inter
7
7
 
8
8
  This skill creates professional BPMN 1.1 diagrams rendered as interactive HTML files with embedded SVG. The diagrams support Hebrew (RTL) and English text.
9
9
 
10
+ **This skill operates in 3 phases. You MUST complete each phase fully before moving to the next.**
11
+
10
12
  ## NON-NEGOTIABLE RULES — READ BEFORE ANYTHING ELSE
11
13
 
12
14
  These rules are violated most often. You MUST follow every one. No exceptions.
@@ -21,8 +23,6 @@ These rules are violated most often. You MUST follow every one. No exceptions.
21
23
 
22
24
  5. **EVERY PARTICIPANT MUST APPEAR**: If the process description mentions a customer/patient/company — they MUST appear in the diagram. Never omit a participant.
23
25
 
24
- 6. **OUTPUT STRUCTURAL ANALYSIS FIRST**: Before writing ANY SVG, you must output the structural analysis (participants → pool/lane, data stores, message flows). The SVG must match this analysis.
25
-
26
26
  ## When to Use
27
27
 
28
28
  - User asks to create a BPMN diagram, process model, or workflow diagram
@@ -30,72 +30,133 @@ These rules are violated most often. You MUST follow every one. No exceptions.
30
30
  - User provides a process narrative in any language and wants a BPMN representation
31
31
  - User asks to model a process with swim lanes, pools, gateways, or data flows
32
32
 
33
- ## Process Analysis — Before Drawing
33
+ ---
34
34
 
35
- Before writing any SVG code, analyze the process description to identify:
35
+ # ═══════════════════════════════════════════════════
36
+ # PHASE 1 — STRUCTURAL MODEL (text only, NO SVG)
37
+ # ═══════════════════════════════════════════════════
36
38
 
37
- 1. **Participants CRITICAL (Pool vs Lane)**: Who are the actors? Classify each based on **process control**, not just organizational membership:
38
- - If the participant acts **independently** and communicates with the organization from outside (e.g., a customer calling to cancel a subscription, a patient arriving at a clinic, a citizen filing a complaint, an external company like a credit card company or supplier) → **separate pool** with message flows
39
- - If the organization **dictates and controls** how the participant performs their activities within its own system (e.g., a customer using the bank's app to make a transaction, a user following a guided online workflow) → **lane** within the organization pool with sequence flows
40
- - Internal roles within the same organization → **lanes** within one pool
41
- - **The test**: "Does the organization orchestrate this participant's actions, or do they act on their own initiative?" If they act independently → separate pool
42
- 2. **Activities/Tasks**: List every action/task mentioned
43
- 3. **Decision Points**: Identify every conditional branch (if/else, exists/doesn't exist)
44
- 4. **Data**: What information is created, read, updated, or stored?
45
- 5. **Handoffs**: Where does work pass between participants? These become message flows between pools or sequence flows between lanes
46
- 6. **Waiting Points**: Is any participant passively waiting? Use intermediate events, not regular tasks
47
- 7. **Data Persistence — CRITICAL**: Model a Data Store whenever the process involves persistent storage. **Trigger words** that require a data store: "system", "database", "account", "record", "registry". **Action verbs** that imply a data store: "block account", "update record", "generate invoice", "credit account", "register", "log", "store", "look up", "check status". If a task reads from or writes to shared persistent state, it MUST have a data association to a data store. Do NOT substitute a lightweight Data Object when persistent shared storage is implied. A system = a data store. An account = a data store.
48
- 8. **Complete Each Participant's Flow**: Every pool must have its own complete internal sequence flow (start → tasks → end), even for external parties. If the description says "Company X will handle the complaint," model the full handling sequence inside that pool (receive → process → respond → close), not just the first step. Never collapse an external participant's process into a single task or annotation.
49
- 9. **Bidirectional Communication**: When one participant sends something to another, check: does the receiver send something back? Every message flow that triggers a response must have a corresponding return message flow. Model both directions explicitly. Common pairs: request→acknowledgment, notification→confirmation, complaint→response.
50
- 10. **Implied Activities**: Read the description for activities that are described but not explicitly named as "tasks." Phrases like "she can and is expected to be in phone contact" or "will coordinate directly" describe real activities that should be modeled as tasks, NOT as text annotations. Annotations are only for meta-information that clarifies context but isn't an executable step.
39
+ In this phase you analyze the process description and output a structured text model. Do NOT write any HTML, SVG, or code. Only text analysis.
51
40
 
52
- ## Mandatory Structural Analysis Output — CRITICAL
41
+ ## Step 1.1 Identify Participants
53
42
 
54
- **Before writing ANY SVG code, you MUST output the following structured analysis as text.** This is non-negotiable — skipping this step is the primary cause of structural modeling errors (wrong pool/lane assignments, missing data stores).
43
+ List every actor/role mentioned in the process. For each one, classify as POOL or LANE:
55
44
 
56
- ### Required Output Format:
45
+ - **POOL** (separate, independent): The participant acts on their own initiative and communicates with the organization from outside. Examples: a customer calling to cancel, a patient arriving at a clinic, a citizen filing a complaint, an external company (credit card company, supplier, contractor).
46
+ - **LANE** (within org pool): The participant is an internal role within the organization, OR the organization fully dictates and controls how they perform activities within its system (e.g., customer using the bank's app).
47
+ - **The test**: "Does the organization orchestrate this participant's actions, or do they act independently?" Independent → POOL.
57
48
 
58
- ```
59
- STRUCTURAL ANALYSIS:
49
+ ## Step 1.2 — Identify Tasks
50
+
51
+ List every action/task mentioned in the process description. For each task, specify which lane or pool it belongs to. Also identify implied activities — phrases like "she can and is expected to be in phone contact" or "will coordinate directly" describe real tasks, NOT annotations.
52
+
53
+ ## Step 1.3 — Identify Gateways (with type!)
54
+
55
+ List every decision point / conditional branch. For each gateway, specify:
56
+ - **Type**: XOR (exclusive — only one path), AND (parallel — all paths), or OR (inclusive — one or more paths)
57
+ - **Question/condition**: What is being decided
58
+ - **Outgoing branches**: The possible outcomes and where each leads
59
+ - **Merge**: Where the branches reconverge (if applicable) — merge gateways must also be listed with their type
60
+
61
+ ## Step 1.4 — Identify Data Stores
62
+
63
+ Scan all tasks for persistent storage operations. **Trigger words**: "system", "database", "account", "record", "registry". **Action verbs**: "block account", "update record", "generate invoice", "credit account", "register", "log", "store", "look up", "check status".
64
+
65
+ If ANY task reads from or writes to shared persistent state → Data Store is required. A system = a data store. An account = a data store.
66
+
67
+ List each data store with a name and which tasks connect to it (read/write).
68
+
69
+ ## Step 1.5 — Identify Data Objects
70
+
71
+ List specific pieces of data that flow between tasks (e.g., "בקשת ביטול", "חשבונית זיכוי"). These are different from data stores — data objects are transient documents, not persistent systems.
72
+
73
+ ## Step 1.6 — Identify Flows
60
74
 
61
- 1. PARTICIPANTS:
62
- - [Name] POOL (acts independently: [reason]) / LANE (org controls: [reason])
63
- - ...
75
+ - **Sequence flows** (within a pool/between lanes): List the order of tasks within each pool
76
+ - **Message flows** (between pools): List every communication between separate pools. Check for bidirectional communication — every message that expects a response needs a return message flow.
77
+ - **Data associations**: List connections between tasks and data stores / data objects.
64
78
 
65
- 2. DATA STORES:
66
- - [Store name] — triggered by: [task X writes/reads/updates ...]
67
- - ...
79
+ ## Step 1.7 Identify Events
80
+
81
+ - **Start events**: One per pool
82
+ - **End events**: One or more per pool (for different outcomes)
83
+ - **Intermediate events**: Use for passive waiting (not tasks). When a participant is waiting for a signal/message from another participant.
84
+
85
+ ## Step 1.8 — Complete Each Participant's Flow
86
+
87
+ Verify that every pool has a complete internal sequence flow: start → tasks/gateways → end. Even external parties must have their full process modeled (receive → process → respond → close), not just a single task.
88
+
89
+ ## Required Output Format
68
90
 
69
- 3. MESSAGE FLOWS (between pools):
70
- - [Pool A] ↔ [Pool B]: [what is communicated]
71
- - ...
72
91
  ```
92
+ STRUCTURAL MODEL:
93
+
94
+ POOLS:
95
+ - [Pool name] — [reason: acts independently / external company]
96
+ Tasks: [task1] → [task2] → ...
97
+ Start: [description]
98
+ End(s): [description(s)]
99
+
100
+ ORGANIZATION POOL: [org name]
101
+ LANE: [lane name]
102
+ Tasks: [task1] → [task2] → ...
103
+ LANE: [lane name]
104
+ Tasks: ...
105
+ Start: [description]
106
+ End(s): [description(s)]
107
+
108
+ GATEWAYS:
109
+ - [G1] Type: XOR | Question: [question] | In: [lane/pool] | Branches: [branch1 → ..., branch2 → ...]
110
+ - [G2] Type: XOR (merge) | In: [lane/pool] | Merges: [branches from G1]
111
+ - ...
112
+
113
+ DATA STORES:
114
+ - [Store name] — reads: [task X, task Y] | writes: [task Z]
115
+ - ...
116
+
117
+ DATA OBJECTS:
118
+ - [Object name] — from: [task X] → to: [task Y]
119
+ - ...
120
+
121
+ MESSAGE FLOWS:
122
+ - [Pool A] → [Pool B]: [what is communicated]
123
+ - [Pool B] → [Pool A]: [response]
124
+ - ...
125
+ ```
126
+
127
+ ## ⛔ HARD STOP — DO NOT PROCEED
128
+
129
+ **STOP HERE.** Present the structural model above to the user. Do NOT write any HTML, SVG, or code yet.
73
130
 
74
- **The SVG diagram MUST match this analysis exactly.** If the analysis says "separate pool," the SVG must have a separate pool. If the analysis identifies a data store, the SVG must include it with data associations.
131
+ Ask the user: "הנה המודל המבני של התהליך. האם לעבור לשלב הבא ולייצר את הדיאגרמה, או שיש שינויים שתרצה לבצע?"
75
132
 
76
- ## Architecture & Layout Rules
133
+ Wait for the user to confirm or request changes. If they request changes, revise the model and present it again. Only proceed to Phase 2 after explicit user confirmation.
77
134
 
78
- ### Pools and Lanes — CRITICAL
135
+ ---
136
+
137
+ # ═══════════════════════════════════════════════════
138
+ # PHASE 2 — SVG RENDERING (only after Phase 1 approval)
139
+ # ═══════════════════════════════════════════════════
140
+
141
+ Take the approved structural model from Phase 1 and render it as an HTML file with embedded SVG. **Every participant, task, gateway, data store, data object, and flow from the approved model MUST appear in the SVG.** Do not add or remove elements.
142
+
143
+ ## Architecture & Layout
79
144
 
80
- - **External participants** (e.g., patient, customer, citizen) get their own **pool** at the top of the diagram
81
- - Use a distinct color scheme for the external pool header (e.g., brown) to differentiate from the organization pool (dark gray)
145
+ ### Pools and Lanes
146
+
147
+ - **External participant pools** get their own pool rectangle, visually separated from the organization pool
148
+ - Use a distinct color scheme for external pool headers (e.g., brown) to differentiate from the organization pool (dark gray)
82
149
  - External pool tasks use a warm color (e.g., orange `#fff3e0` fill, `#e65100` stroke)
83
- - **Internal roles** within the organization are modeled as **lanes** within the organization pool
150
+ - **Organization pool** contains internal lanes
84
151
  - Each lane gets a labeled sidebar and a subtle background tint
85
152
  - Separate lanes with dashed divider lines
86
153
  - Pool headers are vertical text bars on the left side of the pool
87
154
 
88
- **Common Mistakes to Avoid:**
89
- - Putting a customer/patient/citizen as a lane when they act independently — they need a separate pool with message flows, not sequence flows
90
- - Using sequence flows between independent participants instead of message flows between separate pools
91
- - Forgetting that external companies (e.g., חברת אשראי, ספק, קבלן) also need their own pool — they are not part of the organization
92
- - Omitting a participant entirely — if the process description mentions a customer/patient/citizen, they MUST appear in the diagram as a pool with their own flow
93
-
94
- ### Element Placement — CRITICAL
155
+ ### Element Placement
95
156
 
96
- **Every BPMN element (task, gateway, event) must be fully contained within a single lane or pool.** No element may overlap a lane divider line or sit on the boundary between two lanes. If an element belongs to a lane, it must be clearly centered vertically within that lane's area, with visible spacing from the lane borders above and below.
157
+ **Every BPMN element (task, gateway, event) must be fully contained within a single lane or pool.** No element may overlap a lane divider line or sit on the boundary between two lanes. Center elements vertically within their lane with visible spacing from borders.
97
158
 
98
- ### Color Scheme by Participant Type
159
+ ### Color Scheme
99
160
 
100
161
  | Element | Fill | Stroke |
101
162
  |---------|------|--------|
@@ -108,35 +169,33 @@ STRUCTURAL ANALYSIS:
108
169
  | Data objects | `#fff` | `#1565c0` |
109
170
  | Data stores | `#fff` | `#2e7d32` |
110
171
 
111
- ### Pool Ordering — Optimal Layout
112
-
113
- When multiple external pools exist, order pools to **minimize message flow crossing distance**:
172
+ ### Pool Ordering
114
173
 
115
- - Place the **primary actor** (the one who initiates and interacts with multiple parties) in the **middle**, not at the top
116
- - Place pools they interact with **above and below** so message flows go in both directions naturally
117
- - Rule of thumb: Count message flows between each pair of pools. Adjacent pools should be the pairs with the most message flows between them
118
-
119
- Example: If a Resident interacts with both a Delivery Company and a Development Company → place Delivery Company on top, Resident in the middle, Development Company on the bottom.
174
+ When multiple external pools exist, order to **minimize message flow crossing distance**:
175
+ - Place the primary actor (initiates and interacts with multiple parties) in the middle
176
+ - Place pools they interact with above and below
120
177
 
121
178
  ### Flow Types
122
179
 
123
180
  - **Sequence flows** (within a pool): Solid lines with filled arrowheads (`#546e7a`)
124
181
  - **Message flows** (between pools): Dashed lines (`stroke-dasharray: 10 5`) with open circle at source and filled arrow at target (`#37474f`)
125
- - **Data associations**: Dashed lines (`stroke-dasharray: 4 3`) with small arrowheads, colored by type:
182
+ - **Data associations**: Dashed lines (`stroke-dasharray: 4 3`) with small arrowheads:
126
183
  - Data object associations: `#7986cb`
127
184
  - Data store associations: `#4caf50`
128
185
 
129
- ## BPMN Element Standards
130
-
131
- ### Gateways — CRITICAL RULE
186
+ ## BPMN Element SVG Templates
132
187
 
133
- **Gateway diamonds must contain ONLY the marker symbol — NEVER text.** No labels, descriptions, or questions inside the diamond shape. Gateway labels go ABOVE or BESIDE the diamond, never inside it.
188
+ ### Gateways
134
189
 
135
- - XOR (exclusive): **X** marker inside the diamond
136
- - AND (parallel): **+** marker inside the diamond
137
- - OR (inclusive): **O** marker inside the diamond
190
+ **Gateway diamonds contain ONLY the marker symbol — NEVER text.** Labels go ABOVE the diamond.
138
191
 
139
- **Every gateway — both split AND merge/join — MUST display its marker symbol.** Merge gateways are never left as blank diamonds. This is a non-negotiable requirement.
192
+ ```svg
193
+ <!-- XOR Gateway (split or merge) — X marker inside -->
194
+ <rect x="X" y="Y" width="34" height="34" class="gateway" transform="rotate(45, CX, CY)"/>
195
+ <line x1="CX-7" y1="CY-10" x2="CX+7" y2="CY+10" class="gateway-x"/>
196
+ <line x1="CX+7" y1="CY-10" x2="CX-7" y2="CY+10" class="gateway-x"/>
197
+ <text x="CX" y="CY-25" text-anchor="middle">label ABOVE</text>
198
+ ```
140
199
 
141
200
  **Anti-pattern — NEVER do this:**
142
201
  ```svg
@@ -145,47 +204,25 @@ Example: If a Resident interacts with both a Delivery Company and a Development
145
204
  <text x="CX" y="CY">כמה ימים?</text> <!-- FORBIDDEN -->
146
205
  ```
147
206
 
148
- **Correct pattern:**
149
- ```svg
150
- <!-- RIGHT: X marker inside, label outside -->
151
- <rect x="X" y="Y" width="34" height="34" class="gateway" transform="rotate(45, CX, CY)"/>
152
- <line x1="CX-7" y1="CY-10" x2="CX+7" y2="CY+10" class="gateway-x"/>
153
- <line x1="CX+7" y1="CY-10" x2="CX-7" y2="CY+10" class="gateway-x"/>
154
- <text x="CX" y="CY-25" text-anchor="middle">כמה ימים?</text> <!-- label ABOVE -->
155
- ```
156
-
157
- ### Intermediate Events (Waiting/Catching)
207
+ ### Intermediate Events (BPMN 1.1 style)
158
208
 
159
- Use **BPMN 1.1 style**: plain double circle with NO icon inside. Just two concentric circles.
209
+ Plain double circle with NO icon inside:
160
210
 
161
211
  ```svg
162
- <!-- Intermediate event — plain double circle -->
163
212
  <circle cx="X" cy="Y" r="16" fill="#fff" stroke="#1565c0" stroke-width="2"/>
164
213
  <circle cx="X" cy="Y" r="12" fill="none" stroke="#1565c0" stroke-width="1.2"/>
165
214
  ```
166
215
 
167
- Use intermediate events (not tasks) when a participant is passively waiting for a signal, message, or trigger from another participant.
168
-
169
- ### Data Objects vs Data Stores — MUST DISTINGUISH
170
-
171
- These are two different BPMN artifacts and must be visually distinct:
172
-
173
- **Data Objects** (folded-corner document icon, blue):
174
- - Represent a specific piece of data flowing through the process (e.g., "פרטי תינוק", "סיכום ביקור", "הערת מעקב")
175
- - Drawn as a rectangle with a folded top-right corner
216
+ ### Data Objects (folded-corner document, blue)
176
217
 
177
218
  ```svg
178
- <!-- Data Object template (w≈34, h≈38) -->
179
219
  <path d="M X,Y L X+26,Y L X+34,Y+8 L X+34,Y+38 L X,Y+38 Z" class="data-object-shape"/>
180
220
  <path d="M X+26,Y L X+26,Y+8 L X+34,Y+8" class="data-object-fold"/>
181
221
  ```
182
222
 
183
- **Data Stores** (cylinder icon, green):
184
- - Represent persistent storage / databases (e.g., "מאגר כרטיסי תינוקות", "מאגר מדדים")
185
- - Drawn as a cylinder (two ellipses connected by vertical lines)
223
+ ### Data Stores (cylinder, green)
186
224
 
187
225
  ```svg
188
- <!-- Data Store template -->
189
226
  <ellipse cx="CX" cy="TOP" rx="28" ry="8" class="data-store-body"/>
190
227
  <path d="M CX-28,TOP L CX-28,BOTTOM" fill="none" stroke="#2e7d32" stroke-width="1.3"/>
191
228
  <path d="M CX+28,TOP L CX+28,BOTTOM" fill="none" stroke="#2e7d32" stroke-width="1.3"/>
@@ -194,91 +231,96 @@ These are two different BPMN artifacts and must be visually distinct:
194
231
 
195
232
  ### Data Artifact Placement
196
233
 
197
- - Place data objects **above** or **below** their associated task, never overlapping flow lines
198
- - Place data objects to the **left** of a task if vertical placement would cross flow paths
199
- - Data stores typically go below their associated tasks
200
- - **Never** place data artifacts in a location where their association lines cross or overlap with sequence flow arrows
201
-
202
- ## Arrow Routing — CRITICAL
203
-
204
- The most important visual quality rule: **arrows must never be ambiguous**.
234
+ - Place data objects above or below their associated task, never overlapping flow lines
235
+ - Place data stores typically below their associated tasks
236
+ - Never place data artifacts where association lines cross sequence flow arrows
205
237
 
206
- ### Split-Merge Pattern (Two Outcome Paths)
238
+ ## Arrow Routing
207
239
 
208
- When a gateway splits into two paths (e.g., "תקין" vs "דורש מעקב") and then merges:
240
+ **Arrows must never be ambiguous.**
209
241
 
210
- 1. Place the **YES task** above the gateway's horizontal center line
211
- 2. Place the **NO task** below the gateway's horizontal center line
212
- 3. Place the **merge gateway** clearly to the right of BOTH tasks
213
- 4. Route the YES path: task → **right** → **down** into merge gateway (entering from top)
214
- 5. Route the NO path: task → **right** → **up** into merge gateway (entering from bottom)
215
- 6. From the merge gateway, route a **single clean vertical line down** to the next task
242
+ ### Split-Merge Pattern
216
243
 
217
- **The merge area must have clear visual separation between all paths. No path should overlap another.**
244
+ 1. YES task above the gateway's horizontal center line
245
+ 2. NO task below
246
+ 3. Merge gateway clearly to the right of BOTH tasks
247
+ 4. YES path: task → right → down into merge (entering from top)
248
+ 5. NO path: task → right → up into merge (entering from bottom)
249
+ 6. From merge: single clean line to next task
218
250
 
219
251
  ### General Routing Rules
220
252
 
221
- - Prefer orthogonal (right-angle) routing over diagonal lines
253
+ - Prefer orthogonal (right-angle) routing
222
254
  - Leave at least 30px spacing between parallel flow lines
223
- - When routing a flow from one lane to another, use a clear vertical drop/rise
255
+ - Cross-lane flows use clear vertical drops/rises
224
256
  - Label YES/NO (כן/לא) near the gateway, not at the end of the path
225
- - Flow labels should not overlap with other elements
257
+ - Flow labels must not overlap other elements
226
258
 
227
259
  ## Modeling Rejection/Retry Loops
228
260
 
229
- When a process includes an approval step where the participant can reject:
261
+ 1. Model rejection as an explicit task (not just a gateway output)
262
+ 2. After rejection, model the rejecting participant's next state (waiting/action)
263
+ 3. Model the response to rejection as a concrete task sequence
264
+ 4. Loop-back arrows return to the earliest meaningful re-entry point
230
265
 
231
- 1. Model the **rejection action** as an explicit task in the rejecting participant's pool (e.g., "שליחת ביטול סגירה"), not just a gateway output
232
- 2. After rejection, model what the rejecting participant **does next** — typically a waiting intermediate event (e.g., waiting for follow-up contact)
233
- 3. In the receiving pool, model the **response to rejection** as a concrete task sequence (e.g., "contact customer" → "decide next step")
234
- 4. Loop-back arrows should return to the earliest meaningful re-entry point in the process, not to an arbitrary task
235
-
236
- ## Typography & Hebrew Support
266
+ ## Typography & Hebrew
237
267
 
238
268
  - Use `Noto Sans Hebrew` (imported from Google Fonts) for all text
239
269
  - Set `lang="he"` and `dir="rtl"` on the HTML element
240
- - Task text: 11.5px, font-weight 500, centered in the task box
270
+ - Task text: 11.5px, font-weight 500, centered
241
271
  - Gateway labels: 10.5px, font-weight 400, positioned above the diamond
242
272
  - Data labels: 9.5px, font-weight 500
243
- - Flow labels (כן/לא): 10px
273
+ - Flow labels: 10px
244
274
 
245
275
  ## File Structure
246
276
 
247
277
  Output a single self-contained HTML file with:
248
278
 
249
279
  1. **Header bar**: Gradient background with process title in Hebrew + English subtitle. Must say "BPMN 1.1" (NOT 2.0)
250
- 2. **Legend**: Horizontal bar showing all BPMN symbols used in the diagram (start, end, task, XOR gateway, intermediate event, data object, data store, message flow)
280
+ 2. **Legend**: Horizontal bar showing all BPMN symbols used (start, end, task, XOR gateway, intermediate event, data object, data store, message flow)
251
281
  3. **SVG canvas**: The full BPMN diagram in a scrollable wrapper
252
282
  4. **SVG definitions**: Drop shadow filters, arrow markers (sequence, message, data association)
253
283
 
254
284
  ### SVG Sizing
255
285
 
256
286
  - Width: 1700–1800px typical (allow overflow scroll)
257
- - Height: Scale based on number of pools and lanes (~130px per external pool, ~250px per lane, plus spacing for data artifacts)
258
- - Use `viewBox` matching width/height for proper scaling
287
+ - Height: Scale based on pools and lanes (~130px per external pool, ~250px per lane, plus data artifacts)
288
+ - Use `viewBox` matching width/height
289
+
290
+ ---
259
291
 
260
- ## Verification Gate — MANDATORY
292
+ # ═══════════════════════════════════════════════════
293
+ # PHASE 3 — VALIDATION & FIX
294
+ # ═══════════════════════════════════════════════════
261
295
 
262
- **STOP before delivering the diagram. Verify EVERY item below. If any item fails, you MUST fix it before delivering. Do NOT skip this step.**
296
+ **Before delivering the diagram, go through EVERY item below. If ANY item fails, fix the SVG immediately. Do NOT deliver until all pass.**
263
297
 
298
+ ## Structural Accuracy (cross-reference with Phase 1 model)
299
+ - [ ] Every participant from the Phase 1 model appears in the SVG — none are omitted
300
+ - [ ] External participants are in separate pools with message flows (not lanes with sequence flows)
301
+ - [ ] Every pool has a complete internal flow (start → ... → end)
302
+ - [ ] Every gateway from Phase 1 appears with the correct type marker
303
+ - [ ] Every data store from Phase 1 appears as a cylinder with data associations
304
+ - [ ] Every message flow from Phase 1 appears as a dashed line between pools
305
+
306
+ ## BPMN Compliance
264
307
  - [ ] Every gateway (split AND merge) has ONLY an X/+/O marker inside — no text inside the diamond
265
- - [ ] Gateway labels (questions, conditions) are positioned ABOVE or BESIDE the diamond, never inside
308
+ - [ ] Gateway labels are positioned ABOVE or BESIDE the diamond, never inside
266
309
  - [ ] Every element (task, gateway, event) is fully inside a single lane — nothing sits on a lane boundary
267
- - [ ] No arrow paths overlap or cross ambiguously
268
- - [ ] Data objects (📄) and data stores (🗄️) use different icons
269
- - [ ] Every participant mentioned in the process description appears in the diagram — none are omitted
270
- - [ ] External participants are in separate pools with message flows
271
310
  - [ ] Passive waiting uses intermediate events, not regular tasks
311
+ - [ ] Data objects (folded document) and data stores (cylinder) use different icons
312
+
313
+ ## Visual Quality
314
+ - [ ] No arrow paths overlap or cross ambiguously
272
315
  - [ ] Flow labels (כן/לא) are clearly positioned near their gateway
273
316
  - [ ] The legend includes every symbol type used in the diagram
274
317
  - [ ] Data artifacts don't overlap with sequence flow paths
275
- - [ ] Every pool has a complete internal flow (start → ... → end), not just a single task
276
- - [ ] A Data Store is modeled for every persistent system (accounts, invoices, records, registrations — see trigger words in Process Analysis step 7)
277
- - [ ] Every message flow that expects a response has a return message flow
278
- - [ ] Phone calls, emails, and direct contacts mentioned in the description are modeled as tasks, not annotations
279
- - [ ] After a rejection/refusal gateway, the rejecting participant's subsequent state (waiting/action) is explicitly modeled
280
318
  - [ ] Pool ordering minimizes message flow crossing distance
281
319
 
320
+ ---
321
+
322
+ # APPENDIX
323
+
282
324
  ## Example Process Categories
283
325
 
284
326
  This skill handles processes such as: