[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M788PSTA5NDHZZC1MB09A626":3,"skill-same:01M788PSTA5NDHZZC1MB09A626":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M788PSTA5NDHZZC1MB09A626","diagrams-as-code",null,"Produce clean, editorial-quality architecture and flow diagrams as code or SVG — pick the right tool (Mermaid, Graphviz\u002FDOT, PlantUML, or hand-authored SVG), the right pattern, and enforce layout\u002Fquality rules. Use when asked to draw a diagram, visualize a system\u002Farchitecture, make a flowchart, or turn a design into a picture.","jingchaodev\u002Fskills-lab","jingchaodev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8307474?v=4","01M788N3PES0P1DGEKSE9ZYDSD","chao","01M788N3QH1AYYGWKFG9XTX3WF",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Fdiagrams-as-code\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: diagrams-as-code\ndescription: Produce clean, editorial-quality architecture and flow diagrams as code or SVG — pick the right tool (Mermaid, Graphviz\u002FDOT, PlantUML, or hand-authored SVG), the right pattern, and enforce layout\u002Fquality rules. Use when asked to draw a diagram, visualize a system\u002Farchitecture, make a flowchart, or turn a design into a picture.\n---\n\n# Architecture Diagram\n\nGood architecture diagrams make **one argument clearly**. Before drawing, decide\nthe argument, pick a pattern that carries it, choose the lightest tool that can\nrender it well, then iterate on quality. **Layout first, connect second, color\nlast.**\n\n## Step 1: Pick the Tool\n\nMatch the tool to how much control and polish you need. Prefer diagram-as-code\n(diffable, versionable, regenerable) unless you need pixel-level editorial control.\n\n| Tool | Strengths | Use when | Avoid when |\n|------|-----------|----------|-----------|\n| **Mermaid** | Renders in Markdown\u002FGitHub\u002Fdocs, zero setup, easy diffs | Flowcharts, sequence, ER, most docs diagrams | You need precise layout or custom visuals |\n| **Graphviz \u002F DOT** | Excellent auto-layout of large graphs, deterministic | Dependency graphs, call graphs, many-node topologies | Sequence diagrams; fine-grained styling |\n| **PlantUML** | Rich UML (sequence, component, deployment), text-based | Formal UML, detailed sequence diagrams | Lightweight README sketches |\n| **Hand-authored SVG** | Total control of layout, color, typography | Editorial\u002Fmarketing-grade figures, blog\u002Fhero diagrams | Anything you'll edit often or auto-generate |\n\nRule of thumb: **docs → Mermaid; big auto-laid-out graphs → Graphviz; formal UML\n→ PlantUML; a polished one-off figure → SVG.**\n\n## Step 2: Pick the Pattern\n\nChoose the pattern from the *argument the diagram makes*, not from the tool.\n\n| Intent | Pattern |\n|--------|---------|\n| Sequence of steps | Linear workflow (L→R) |\n| Retries \u002F iteration | Feedback loop (main path + one return edge) |\n| Decisions \u002F branching | Branch tree (≤4 balanced branches) |\n| Before\u002Fafter | Split comparison (mirrored panels) |\n| System boundaries \u002F components | Grouped architecture (containers + nodes) |\n| Abstraction layers | Layered stack (T→B bands) |\n| Actors over time | Swimlane sequence (2–5 lanes) |\n| Central concept + supporters | Hub-and-spoke |\n| Concurrent workers | Parallel fan-out \u002F fan-in |\n\n## Step 3: Spec Before You Draw\n\nWrite a short plan first — it prevents rework:\n\n```\nTitle:            \u003Cthe one claim>\nTool:             Mermaid | DOT | PlantUML | SVG\nPattern:          \u003Cfrom table above>\nReading order:    L→R | T→B\nNodes:            \u003Cname → role\u002Ftype>\nGroups\u002FLayers:    \u003Ccontainers, if any>\nEdges:            \u003Csource → target : label>\nEdge budget:      ≤5 cross-group edges, ≤2 line styles\n```\n\n## Step 4: Draw It\n\n### Mermaid (default for docs)\n\n```mermaid\nflowchart LR\n  subgraph Edge[\"Edge\"]\n    LB[Load Balancer]\n  end\n  subgraph App[\"Application\"]\n    API[API Service]\n    W[Worker]\n  end\n  DB[(Database)]\n  Q[[Queue]]\n  LB -->|HTTPS| API\n  API -->|enqueue job| Q\n  Q -->|consume| W\n  W -->|write| DB\n  API -->|read| DB\n```\n\n### Graphviz \u002F DOT (large graphs)\n\n```dot\ndigraph arch {\n  rankdir=LR;\n  node [shape=box, style=rounded, fontname=\"Helvetica\"];\n  lb [label=\"Load Balancer\"];\n  api [label=\"API Service\"];\n  db [label=\"Database\", shape=cylinder];\n  lb -> api [label=\"HTTPS\"];\n  api -> db [label=\"read\u002Fwrite\"];\n}\n```\n\nRender: `dot -Tsvg arch.dot -o arch.svg` (or `-Tpng`).\n\n### PlantUML (formal UML \u002F sequence)\n\n```plantuml\n@startuml\nactor User\nUser -> API : POST \u002Fcharge\nAPI -> PaymentSvc : charge(request)\nPaymentSvc --> API : result\nAPI --> User : 200 OK\n@enduml\n```\n\n### Hand-authored SVG (editorial figures)\n\nOnly when polish justifies the effort. Build the SVG programmatically (assemble\nlines → join → write file) so it's regenerable. Structure and layout rules:\n\n- **Z-order:** background → containers → edges → edge-label backgrounds → nodes → text → legend.\n- Define arrow markers once in `\u003Cdefs>`; never inline per-edge.\n- Inline any icons as SVG paths; never `@import url()` for fonts\u002Ficons (breaks offline\u002Fstandalone rendering).\n- ≥80px spacing between nodes; orthogonal edge routing; connect at midpoints.\n- Node content: **bold name** + regular technical detail (+ optional param line).\n- Edge labels are specific: `POST \u002Fcharge`, `read(userId)` — never \"sends\"\u002F\"process\".\n\n## Step 5: Enforce Quality\n\nUniversal rules regardless of tool:\n\n- **One dominant idea per diagram.** Reading order obvious within ~3 seconds.\n- **Whitespace separates before boxes do.** Don't box everything.\n- **Budgets:** ≤20 nodes, ≤4 accent colors, ≤3 nesting levels, ≤5 cross-group\n  edges, ≤2 line\u002Fdash styles.\n- **Reduce edges before routing them.** If a diagram is a tangle, the fix is\n  usually *fewer edges* (replace a fan-out with one labeled annotation), not\n  cleverer routing.\n- **Consistent semantics:** one color\u002Fline-style = one meaning. Add a legend\n  once you use 2+ edge types or colors.\n- Keep caveats\u002Fassumptions in the surrounding prose, not as footnotes on the canvas.\n\n## Step 6: Validate the Render\n\n- **Code tools:** render to SVG\u002FPNG and confirm it compiles (`dot -Tsvg …`,\n  Mermaid CLI `mmdc`, PlantUML jar). A diagram that doesn't render is worthless.\n- **SVG:** validate with a converter (e.g. `rsvg-convert file.svg -o \u002Fdev\u002Fnull`),\n  then export a PNG and *look at it*. Check: no text overlap\u002Fclipping, no\n  crossing edges that could be avoided, spacing holds, layer\u002Fgroup labels fully\n  visible, legend present if needed. Fix and re-export; iterate a few times.\n\n## Tips\n\n- **Decide the one claim first.** A diagram that argues two things argues neither.\n- **Reach for Mermaid\u002FDOT before SVG.** Diagram-as-code is diffable and regenerable; only hand-author SVG when editorial polish truly pays off.\n- **Layout first, connect second, color last** — and cut edges before you optimize their routing.\n- **One color\u002Fline-style = one meaning.** Inconsistent encoding reads as noise.\n- **Always render and eyeball the output.** Auto-layout and hand SVG both produce overlaps you won't catch by reading the source.\n- **Stay within the budgets** (≤20 nodes, ≤4 colors, ≤3 nesting, ≤5 cross-group edges) — over-budget diagrams are the ones nobody can read.\n","# Architecture Diagram\n\nGood architecture diagrams make **one argument clearly**. Before drawing, decide\nthe argument, pick a pattern that carries it, choose the lightest tool that can\nrender it well, then iterate on quality. **Layout first, connect second, color\nlast.**\n\n## Step 1: Pick the Tool\n\nMatch the tool to how much control and polish you need. Prefer diagram-as-code\n(diffable, versionable, regenerable) unless you need pixel-level editorial control.\n\n| Tool | Strengths | Use when | Avoid when |\n|------|-----------|----------|-----------|\n| **Mermaid** | Renders in Markdown\u002FGitHub\u002Fdocs, zero setup, easy diffs | Flowcharts, sequence, ER, most docs diagrams | You need precise layout or custom visuals |\n| **Graphviz \u002F DOT** | Excellent auto-layout of large graphs, deterministic | Dependency graphs, call graphs, many-node topologies | Sequence diagrams; fine-grained styling |\n| **PlantUML** | Rich UML (sequence, component, deployment), text-based | Formal UML, detailed sequence diagrams | Lightweight README sketches |\n| **Hand-authored SVG** | Total control of layout, color, typography | Editorial\u002Fmarketing-grade figures, blog\u002Fhero diagrams | Anything you'll edit often or auto-generate |\n\nRule of thumb: **docs → Mermaid; big auto-laid-out graphs → Graphviz; formal UML\n→ PlantUML; a polished one-off figure → SVG.**\n\n## Step 2: Pick the Pattern\n\nChoose the pattern from the *argument the diagram makes*, not from the tool.\n\n| Intent | Pattern |\n|--------|---------|\n| Sequence of steps | Linear workflow (L→R) |\n| Retries \u002F iteration | Feedback loop (main path + one return edge) |\n| Decisions \u002F branching | Branch tree (≤4 balanced branches) |\n| Before\u002Fafter | Split comparison (mirrored panels) |\n| System boundaries \u002F components | Grouped architecture (containers + nodes) |\n| Abstraction layers | Layered stack (T→B bands) |\n| Actors over time | Swimlane sequence (2–5 lanes) |\n| Central concept + supporters | Hub-and-spoke |\n| Concurrent workers | Parallel fan-out \u002F fan-in |\n\n## Step 3: Spec Before You Draw\n\nWrite a short plan first — it prevents rework:\n\n```\nTitle:            \u003Cthe one claim>\nTool:             Mermaid | DOT | PlantUML | SVG\nPattern:          \u003Cfrom table above>\nReading order:    L→R | T→B\nNodes:            \u003Cname → role\u002Ftype>\nGroups\u002FLayers:    \u003Ccontainers, if any>\nEdges:            \u003Csource → target : label>\nEdge budget:      ≤5 cross-group edges, ≤2 line styles\n```\n\n## Step 4: Draw It\n\n### Mermaid (default for docs)\n\n```mermaid\nflowchart LR\n  subgraph Edge[\"Edge\"]\n    LB[Load Balancer]\n  end\n  subgraph App[\"Application\"]\n    API[API Service]\n    W[Worker]\n  end\n  DB[(Database)]\n  Q[[Queue]]\n  LB -->|HTTPS| API\n  API -->|enqueue job| Q\n  Q -->|consume| W\n  W -->|write| DB\n  API -->|read| DB\n```\n\n### Graphviz \u002F DOT (large graphs)\n\n```dot\ndigraph arch {\n  rankdir=LR;\n  node [shape=box, style=rounded, fontname=\"Helvetica\"];\n  lb [label=\"Load Balancer\"];\n  api [label=\"API Service\"];\n  db [label=\"Database\", shape=cylinder];\n  lb -> api [label=\"HTTPS\"];\n  api -> db [label=\"read\u002Fwrite\"];\n}\n```\n\nRender: `dot -Tsvg arch.dot -o arch.svg` (or `-Tpng`).\n\n### PlantUML (formal UML \u002F sequence)\n\n```plantuml\n@startuml\nactor User\nUser -> API : POST \u002Fcharge\nAPI -> PaymentSvc : charge(request)\nPaymentSvc --> API : result\nAPI --> User : 200 OK\n@enduml\n```\n\n### Hand-authored SVG (editorial figures)\n\nOnly when polish justifies the effort. Build the SVG programmatically (assemble\nlines → join → write file) so it's regenerable. Structure and layout rules:\n\n- **Z-order:** background → containers → edges → edge-label backgrounds → nodes → text → legend.\n- Define arrow markers once in `\u003Cdefs>`; never inline per-edge.\n- Inline any icons as SVG paths; never `@import url()` for fonts\u002Ficons (breaks offline\u002Fstandalone rendering).\n- ≥80px spacing between nodes; orthogonal edge routing; connect at midpoints.\n- Node content: **bold name** + regular technical detail (+ optional param line).\n- Edge labels are specific: `POST \u002Fcharge`, `read(userId)` — never \"sends\"\u002F\"process\".\n\n## Step 5: Enforce Quality\n\nUniversal rules regardless of tool:\n\n- **One dominant idea per diagram.** Reading order obvious within ~3 seconds.\n- **Whitespace separates before boxes do.** Don't box everything.\n- **Budgets:** ≤20 nodes, ≤4 accent colors, ≤3 nesting levels, ≤5 cross-group\n  edges, ≤2 line\u002Fdash styles.\n- **Reduce edges before routing them.** If a diagram is a tangle, the fix is\n  usually *fewer edges* (replace a fan-out with one labeled annotation), not\n  cleverer routing.\n- **Consistent semantics:** one color\u002Fline-style = one meaning. Add a legend\n  once you use 2+ edge types or colors.\n- Keep caveats\u002Fassumptions in the surrounding prose, not as footnotes on the canvas.\n\n## Step 6: Validate the Render\n\n- **Code tools:** render to SVG\u002FPNG and confirm it compiles (`dot -Tsvg …`,\n  Mermaid CLI `mmdc`, PlantUML jar). A diagram that doesn't render is worthless.\n- **SVG:** validate with a converter (e.g. `rsvg-convert file.svg -o \u002Fdev\u002Fnull`),\n  then export a PNG and *look at it*. Check: no text overlap\u002Fclipping, no\n  crossing edges that could be avoided, spacing holds, layer\u002Fgroup labels fully\n  visible, legend present if needed. Fix and re-export; iterate a few times.\n\n## Tips\n\n- **Decide the one claim first.** A diagram that argues two things argues neither.\n- **Reach for Mermaid\u002FDOT before SVG.** Diagram-as-code is diffable and regenerable; only hand-author SVG when editorial polish truly pays off.\n- **Layout first, connect second, color last** — and cut edges before you optimize their routing.\n- **One color\u002Fline-style = one meaning.** Inconsistent encoding reads as noise.\n- **Always render and eyeball the output.** Auto-layout and hand SVG both produce overlaps you won't catch by reading the source.\n- **Stay within the budgets** (≤20 nodes, ≤4 colors, ≤3 nesting, ≤5 cross-group edges) — over-budget diagrams are the ones nobody can read.\n",{"name":5,"description":7},"main","44b1acb2c22ab1e94663691dda7d7739f1b83cf6","skills\u002Fdiagrams-as-code",0,"https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab","https:\u002F\u002Fgithub.com\u002Fjingchaodev","https:\u002F\u002Fx.com\u002Fcifra1902","Developer","2026-07-13 09:03:55",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add jingchaodev\u002Fskills-lab --skill diagrams-as-code",{"tool":39,"command":40},"bunx","bunx skills add jingchaodev\u002Fskills-lab --skill diagrams-as-code",{"tool":42,"command":43},"pnpm","pnpm dlx skills add jingchaodev\u002Fskills-lab --skill diagrams-as-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Fdiagrams-as-code\u002FSKILL.md",true,[],[48,55,62,69,75,82],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M788VYAVHEH5QAV7T1Z8QFV9","default-skill","Valid default cwd skill.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdefault_cwd\u002Fskills\u002Fdefault-skill\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M788VVHF3TC2RY65NVPR26DN","clean-two","Another valid skill with a quoted trigger phrase \"specific action\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-two\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M788VRPGJXZ09X9AM1ZPNAHA","clean-one","Use when the user needs a clean example.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-one\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M788VPP8BFKCBXDFRHMP67WH","wrong-frontmatter","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Fwrong-frontmatter\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M788VKP781ZRGKXVMHZFR062","trigger-two","Use for the exact phrase \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-two\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M788VJBR5Q14W6MJB2DWRSVE","trigger-one","Use when someone says \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-one\u002FSKILL.md",[],[]]