mermaid-sequence
Complete Mermaid sequence diagram reference — participants, arrows, activations, control flow
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Complete Mermaid sequence diagram reference — participants, arrows, activations, control flow
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Create architecture decision records using MADR 4.0 format
Create effective D2/Mermaid diagrams optimized for terminal display
Add an image to a decision document — rename, move to docs/assets/, insert reference
Create blameless incident reports and post-mortems
Complete Mermaid flowchart reference — shapes, edges, subgraphs, styling
Create business opportunity documents with thorough questioning
استنادا إلى تصنيف SOC المهني
| name | mermaid-sequence |
| description | Complete Mermaid sequence diagram reference — participants, arrows, activations, control flow |
Complete reference for building Mermaid sequence diagrams in DecisionGraph documents.
participant API %% Rectangle box
actor User %% Stick figure
participant DB as Database %% Alias
actor Admin as "Admin User" %% Actor with alias
participant DB, {"type": "database"}
participant Q, {"type": "queue"}
participant Cache, {"type": "collections"}
participant Auth, {"type": "boundary"}
participant Logic, {"type": "control"}
participant User, {"type": "entity"}
box "Backend" rgb(230, 240, 255)
participant API
participant DB
end
box "External"
participant Stripe
participant SendGrid
end
A -> B: Solid line, no arrow
A --> B: Dotted line, no arrow
A ->> B: Solid with arrowhead (most common)
A -->> B: Dotted with arrowhead (response/async return)
A -x B: Solid with cross (failure/rejection)
A --x B: Dotted with cross
A -) B: Solid open arrow (async fire-and-forget)
A --) B: Dotted open arrow
A <<->> B: Bidirectional solid (v11+)
A <<-->> B: Bidirectional dotted (v11+)
| Arrow | Use for |
|---|---|
->> | Synchronous request |
-->> | Response / return value |
-) | Async message (fire-and-forget) |
-x | Failed request / rejection |
<<->> | Bidirectional / handshake |
Show when a participant is actively processing:
sequenceDiagram
User ->>+ API: POST /login
API ->>+ DB: SELECT user
DB -->>- API: user row
API -->>- User: 200 JWT token
+ after arrow activates the target- after arrow deactivates the targetExplicit form:
activate API
deactivate API
Note right of API: Validates JWT
Note left of User: Enters credentials
Note over API: Processing...
Note over API, DB: Shared context
Use <br/> for line breaks in notes.
loop Every 30 seconds
Monitor ->> API: Health check
API -->> Monitor: 200 OK
end
alt Success
API -->> User: 200 OK
else Unauthorized
API -->> User: 401
else Server Error
API -->> User: 500
end
opt User has 2FA enabled
API ->> User: Enter OTP
User ->> API: OTP code
end
par Notify user
API -) Email: Send confirmation
and Update analytics
API -) Analytics: Track event
and Invalidate cache
API -) Cache: Delete key
end
critical Payment processing
API ->> Stripe: Charge card
Stripe -->> API: Success
option Card declined
Stripe -->> API: Declined
API -->> User: Payment failed
option Timeout
API -->> User: Try again later
end
break Auth token expired
API -->> User: 401 Unauthorized
end
Highlight regions with color:
rect rgba(0, 128, 255, 0.1)
User ->> API: Request
API -->> User: Response
end
User ->> API: POST /webhook
create participant Worker
API ->> Worker: Process job
Worker -->> API: Done
destroy Worker
API ->> Worker: Cleanup
autonumber
User ->> API: Step 1
API ->> DB: Step 2
DB -->> API: Step 3
link API: Swagger Docs @ https://api.example.com/docs
link API: Source Code @ https://github.com/org/api
links DB: {"Schema": "/docs/schema", "Migrations": "/docs/migrations"}
%% This is a comment
autonumber for incident timelines so steps can be referencedsequenceDiagram
actor User
participant API
participant DB, {"type": "database"}
participant Cache, {"type": "collections"}
User ->>+ API: GET /profile
API ->> Cache: Lookup
alt Cache hit
Cache -->> API: Cached data
else Cache miss
API ->>+ DB: SELECT
DB -->>- API: Row
API ->> Cache: Store
end
API -->>- User: 200 Profile JSON
sequenceDiagram
autonumber
participant LB as Load Balancer
participant API
participant DB, {"type": "database"}
LB ->> API: Route request
API ->>+ DB: Query
Note over DB: Connection pool exhausted
DB --x API: Timeout (30s)
API -->> LB: 503
loop Retry storm
LB ->> API: Retry
API -x DB: Connection refused
API -->> LB: 503
end
sequenceDiagram
participant API
participant Q, {"type": "queue"}
participant Worker
participant Email
API -)+ Q: Enqueue job
Q ->>+ Worker: Dequeue
Worker ->> Worker: Process
Worker -)- Email: Send notification
Worker -->>- Q: Ack