mermaid-diagrams
Skill này làm gì
Skill này giúp agent AI vẽ các sơ đồ đơn giản và chính xác trong trang tài liệu. Skill dành cho người viết tài liệu kỹ thuật muốn thể hiện luồng và cấu trúc bằng hình ảnh.
Khi nào nên dùng
- ✓Khi một trang giải thích một yêu cầu hoặc một quy trình mà dễ theo dõi hơn bằng hình ảnh.
- ✓Khi một trang mô tả vòng đời với nhiều trạng thái hoặc một tập các bảng dữ liệu liên kết.
- ✓Khi một cập nhật chạm đến một trang đã có sơ đồ và cần giữ sơ đồ đồng bộ.
Liên kết skill
https://github.com/langchain-ai/openwiki/blob/main/skills/mermaid-diagrams/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể thêm một sơ đồ thể hiện cách một yêu cầu đi qua API của chúng tôi vào trang tài liệu không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chọn loại sơ đồ phù hợp với nội dung, như sơ đồ tuần tự hoặc sơ đồ trạng thái, rồi viết bằng định dạng Mermaid. Nó chỉ vẽ những gì mã nguồn hỗ trợ và thêm một chú thích ngắn dưới mỗi sơ đồ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Mermaid Diagrams In Generated Wiki Pages
Diagrams are part of high-quality wiki generation, not decoration. Where a flow, lifecycle, or data model is easier to grasp visually, embed a Mermaid diagram in a fenced ```mermaid block on the most relevant page.
Choosing a diagram type
sequenceDiagramfor runtime and request flows across components (auth flows, request lifecycles, agent tool loops).stateDiagram-v2for lifecycles and state machines (job states, connection states, run phases).erDiagramfor the data model: entities and their relationships.flowchart TDfor branching control flow and decision logic.
Discipline
- Ground every diagram in inspected source. Do not invent participants, states, entities, or relationships the code does not support.
- Cover the high-value cases: add a diagram wherever a page documents a request or runtime flow, a call sequence, a lifecycle or state machine, or a data model. A repository wiki usually has several such diagrams, not one overall. Skip pages that are navigation, reference tables, or pure configuration.
- Still prefer a few strong diagrams over decorating every page: one accurate diagram on the page that needs it beats a diagram forced onto every page.
- Give each diagram a one-line caption directly below it stating what it shows.
- OpenWiki validates every mermaid fence after your run and converts fences that fail to parse into plain text fences. A degraded diagram is a quality failure; follow the syntax rules below so it does not happen.
Syntax safety
These rules prevent the most common render breakages. When in doubt, rephrase the label.
- Never place semicolons or pipes inside node, message, or edge labels.
- Never place unescaped angle brackets in labels; write "returns Promise of User" instead of "returns Promise<User>".
- In
flowchart, wrap any label containing parentheses, brackets, or other punctuation in double quotes:A["calls foo(bar)"]. - In
flowchart, never use the bare wordendas a node id, and never start a node id withoorxfollowed by a dash (both are edge-marker syntax); rename the node. - In
sequenceDiagram, participant names with spaces or punctuation need an alias:participant AS as Auth Service. - Never use a Mermaid reserved word as a participant name, alias, or node id:
note,end,loop,alt,opt,par,and,else,activate,deactivate,class,state,click,link. For example a notification participant must beNotifier, notNote(which collides with thenotekeyword). - In
erDiagram, entity and attribute names must be single identifier-like tokens; put human phrasing in the relationship label. - Keep labels short. Move explanation into the surrounding prose or the caption, not the diagram.
Update runs
- A wrong diagram is a stale claim, not existing structure to preserve. If a source change makes a diagram inaccurate, update the diagram in the same edit as the surrounding prose.
- Do not rewrite a diagram that is still accurate. Regenerating unchanged diagrams creates diff noise.
- If a page contains a text fence preceded by an HTML comment starting with "openwiki: mermaid parse failed", that is a diagram a previous run degraded. Fix the syntax using the parser error in the comment, restore the ```mermaid fence, and delete the comment.
Câu hỏi thường gặp
Skill có thể tạo những loại sơ đồ nào?
Nó có thể tạo sơ đồ tuần tự, sơ đồ trạng thái, sơ đồ quan hệ thực thể và lưu đồ.
Nó có thêm sơ đồ vào mọi trang không?
Không. Nó ưu tiên vài sơ đồ tốt hơn là trang trí mọi trang.
Ai kiểm tra các sơ đồ có đúng không?
Skill nói các sơ đồ phải khớp với mã nguồn đã được kiểm tra, và công cụ wiki sẽ xác thực chúng sau khi chạy xong.
Chi tiết
Mô tả gốc của tác giả
Embed Mermaid diagrams in generated wiki pages. Use whenever documenting a runtime or request flow, a call sequence, a state machine or lifecycle, a data model or entity relationships, or non-trivial control flow, since these are clearer as a diagram than as prose. Also use when an update run touches a page that already contains a mermaid fence, or a page that contains a text fence a previous run degraded.
repo: langchain-ai/openwiki
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10737
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
technical-documentation
394kGiúp agent của bạn viết và rà soát tài liệu kỹ thuật cùng file hướng dẫn cho agent, rõ ràng để mọi người và công cụ AI đều dễ làm theo.
architecture-decision-records
280kGiúp agent của bạn ghi lại các quyết định quan trọng về cấu trúc dự án, giúp hiểu lý do đằng sau các lựa chọn và giữ lịch sử thay đổi rõ ràng.
code-tour
280kGiúp agent của bạn tạo các hướng dẫn đọc code từng bước, có tham chiếu chính xác đến file và dòng, hữu ích cho phần giới thiệu, giải thích và rà soát.