sad-mcp 0.1.20 → 0.1.22

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.20",
3
+ "version": "0.1.22",
4
4
  "description": "MCP server for Software Analysis and Design course materials at BGU",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,22 +18,48 @@ This skill creates professional, standards-compliant BPMN diagrams rendered as i
18
18
 
19
19
  Before writing any SVG code, analyze the process description to identify:
20
20
 
21
- 1. **Participants**: Who are the actors? Determine if they are internal (lanes in the same pool) or external (separate pools)
22
- - External participants (customers, patients, citizens) → **separate pool** with message flows
21
+ 1. **Participants — CRITICAL (Pool vs Lane)**: Who are the actors? Classify each based on **process control**, not just organizational membership:
22
+ - 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
23
+ - 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
23
24
  - Internal roles within the same organization → **lanes** within one pool
25
+ - **The test**: "Does the organization orchestrate this participant's actions, or do they act on their own initiative?" If they act independently → separate pool
24
26
  2. **Activities/Tasks**: List every action/task mentioned
25
27
  3. **Decision Points**: Identify every conditional branch (if/else, exists/doesn't exist)
26
28
  4. **Data**: What information is created, read, updated, or stored?
27
29
  5. **Handoffs**: Where does work pass between participants? These become message flows between pools or sequence flows between lanes
28
30
  6. **Waiting Points**: Is any participant passively waiting? Use intermediate events, not regular tasks
29
- 7. **Data Persistence**: If the process description mentions a "system" or implies that data is stored, read, or updated across multiple steps or participants model a Data Store (DB). Connect it with data associations to every task that reads from or writes to it. Do NOT substitute a lightweight Data Object when persistent shared storage is implied. A system = a data store.
31
+ 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.
30
32
  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.
31
33
  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.
32
34
  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.
33
35
 
36
+ ## Mandatory Structural Analysis Output — CRITICAL
37
+
38
+ **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).
39
+
40
+ ### Required Output Format:
41
+
42
+ ```
43
+ STRUCTURAL ANALYSIS:
44
+
45
+ 1. PARTICIPANTS:
46
+ - [Name] → POOL (acts independently: [reason]) / LANE (org controls: [reason])
47
+ - ...
48
+
49
+ 2. DATA STORES:
50
+ - [Store name] — triggered by: [task X writes/reads/updates ...]
51
+ - ...
52
+
53
+ 3. MESSAGE FLOWS (between pools):
54
+ - [Pool A] ↔ [Pool B]: [what is communicated]
55
+ - ...
56
+ ```
57
+
58
+ **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.
59
+
34
60
  ## Architecture & Layout Rules
35
61
 
36
- ### Pools and Lanes
62
+ ### Pools and Lanes — CRITICAL
37
63
 
38
64
  - **External participants** (e.g., patient, customer, citizen) get their own **pool** at the top of the diagram
39
65
  - Use a distinct color scheme for the external pool header (e.g., brown) to differentiate from the organization pool (dark gray)
@@ -43,6 +69,16 @@ Before writing any SVG code, analyze the process description to identify:
43
69
  - Separate lanes with dashed divider lines
44
70
  - Pool headers are vertical text bars on the left side of the pool
45
71
 
72
+ **Common Mistakes to Avoid:**
73
+ - Putting a customer/patient/citizen as a lane when they act independently — they need a separate pool with message flows, not sequence flows
74
+ - Using sequence flows between independent participants instead of message flows between separate pools
75
+ - Forgetting that external companies (e.g., חברת אשראי, ספק, קבלן) also need their own pool — they are not part of the organization
76
+ - 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
77
+
78
+ ### Element Placement — CRITICAL
79
+
80
+ **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.
81
+
46
82
  ### Color Scheme by Participant Type
47
83
 
48
84
  | Element | Fill | Stroke |
@@ -78,13 +114,28 @@ Example: If a Resident interacts with both a Delivery Company and a Development
78
114
 
79
115
  ### Gateways — CRITICAL RULE
80
116
 
81
- **Every gateway both split AND merge/joinMUST display the X marker (for XOR) or + marker (for AND/parallel).** Merge gateways are never left as blank diamonds. This is a non-negotiable requirement.
117
+ **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.
118
+
119
+ - XOR (exclusive): **X** marker inside the diamond
120
+ - AND (parallel): **+** marker inside the diamond
121
+ - OR (inclusive): **O** marker inside the diamond
122
+
123
+ **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.
124
+
125
+ **Anti-pattern — NEVER do this:**
126
+ ```svg
127
+ <!-- WRONG: text inside gateway diamond -->
128
+ <polygon points="..." fill="..." stroke="..."/>
129
+ <text x="CX" y="CY">כמה ימים?</text> <!-- FORBIDDEN -->
130
+ ```
82
131
 
132
+ **Correct pattern:**
83
133
  ```svg
84
- <!-- XOR Gateway template (both split and merge) -->
134
+ <!-- RIGHT: X marker inside, label outside -->
85
135
  <rect x="X" y="Y" width="34" height="34" class="gateway" transform="rotate(45, CX, CY)"/>
86
136
  <line x1="CX-7" y1="CY-10" x2="CX+7" y2="CY+10" class="gateway-x"/>
87
137
  <line x1="CX+7" y1="CY-10" x2="CX-7" y2="CY+10" class="gateway-x"/>
138
+ <text x="CX" y="CY-25" text-anchor="middle">כמה ימים?</text> <!-- label ABOVE -->
88
139
  ```
89
140
 
90
141
  ### Intermediate Events (Waiting/Catching)
@@ -190,20 +241,23 @@ Output a single self-contained HTML file with:
190
241
  - Height: Scale based on number of pools and lanes (~130px per external pool, ~250px per lane, plus spacing for data artifacts)
191
242
  - Use `viewBox` matching width/height for proper scaling
192
243
 
193
- ## Iterative Refinement Checklist
244
+ ## Verification Gate — MANDATORY
194
245
 
195
- After generating the initial diagram, verify:
246
+ **STOP before delivering the diagram. Verify EVERY item below. If any item fails, you MUST fix it before delivering. Do NOT skip this step.**
196
247
 
197
- - [ ] Every gateway (split AND merge) has an X or + symbol
248
+ - [ ] Every gateway (split AND merge) has ONLY an X/+/O marker inside — no text inside the diamond
249
+ - [ ] Gateway labels (questions, conditions) are positioned ABOVE or BESIDE the diamond, never inside
250
+ - [ ] Every element (task, gateway, event) is fully inside a single lane — nothing sits on a lane boundary
198
251
  - [ ] No arrow paths overlap or cross ambiguously
199
252
  - [ ] Data objects (📄) and data stores (🗄️) use different icons
253
+ - [ ] Every participant mentioned in the process description appears in the diagram — none are omitted
200
254
  - [ ] External participants are in separate pools with message flows
201
255
  - [ ] Passive waiting uses intermediate events, not regular tasks
202
256
  - [ ] Flow labels (כן/לא) are clearly positioned near their gateway
203
257
  - [ ] The legend includes every symbol type used in the diagram
204
258
  - [ ] Data artifacts don't overlap with sequence flow paths
205
259
  - [ ] Every pool has a complete internal flow (start → ... → end), not just a single task
206
- - [ ] A Data Store is modeled if the process mentions a "system" or database
260
+ - [ ] A Data Store is modeled for every persistent system (accounts, invoices, records, registrations — see trigger words in Process Analysis step 7)
207
261
  - [ ] Every message flow that expects a response has a return message flow
208
262
  - [ ] Phone calls, emails, and direct contacts mentioned in the description are modeled as tasks, not annotations
209
263
  - [ ] After a rejection/refusal gateway, the rejecting participant's subsequent state (waiting/action) is explicitly modeled