Skip to content
Back to search

drawthe.net

SkillWorks with Claude CodeGitHub

Draw network/architecture diagrams (AWS, Azure, Cisco) from a natural-language description or from a proposed system architecture, using the drawthe.net MCP server's YAML DSL and icon tools. Use this skill whenever the user asks to "draw a diagram", "create an architecture diagram", "visualize this infrastructure", "sketch the network", or asks you to propose/illustrate a system design.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/cidrblock/drawthe.net with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/cidrblock/drawthe.net'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/cidrblock--drawthe-net/badge.svg)](/listings/cidrblock--drawthe-net)

HTML

<a href="/listings/cidrblock--drawthe-net"><img src="/api/listings/cidrblock--drawthe-net/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Run `npm run dev` to open the editor locally.

Clear the editor and paste the following in, then click draw or ctrl-enter.

diagram:
  fill: "white"
  rows: 5
  columns: 5
title:
  author: Your Name
  company: Comapny Name
  color: black
  logoFill: white
  logoUrl: https://upload.wikimedia.org/wikipedia/commons/b/b3/Wikipedia-logo-v2-en.svg
  text: Hello world
  subText: additional information about this diagram
  type: bar
  stroke: black
# Set defaults for icons, groups, connections
iconDefaults: &iconDefaults
  color: black
  fill: white
  stroke: black
  iconFamily: aws
groupDefaults: &groupDefaults
  fill: "none"
  color: black
  stroke: black
connectionDefaults: &connectionDefaults
  color: "black"
  stroke: "black"
noteDefaults: &noteDefaults
  color: black
  fill: white
  stroke: black
  xAlign: center
  yAlign: center
# Add the icons
icons:
  dns: {<<: *iconDefaults, icon: net_route53_hostedzone, x: 2, y: 3 }
  lb: {<<: *iconDefaults, icon: cmpt_elasticloadbalancing, y: "-1" }
  server1: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "-1", y: "-1" }
  server2: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "+1" }
  server3: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "+1" }
# Add the groups
groups:
  servers: { <<: *groupDefaults, name: Web Servers, members: [server1, server2, server3] }
# Add connections
connections:
  - { <<: *connectionDefaults, endpoints: [dns, lb] }
  - { <<: *connectionDefaults, endpoints: [lb, servers] }
notes:
  note1:
    <<: *noteDefaults
    x: 0
    y: 3
    text: "##Note\n\nThis is the text for the note."

Hopefully, the following diagram is created.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 250 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: drawthe.net
  3. description: Draw network/architecture diagrams (AWS, Azure, Cisco) from a natural-language description or from a proposed system architecture, using the drawthe.net MCP server's YAML DSL and icon tools. Use this skill whenever the user asks to "draw a diagram", "create an architecture diagram", "visualize this infrastructure", "sketch the network", or asks you to propose/illustrate a system design.
  4. ---
  5. # drawthe.net diagram authoring skill
  6. This skill teaches an agent how to turn a description (or a proposed
  7. architecture) into a drawthe.net YAML diagram and render it via the
  8. drawthe.net MCP server's tools. The result should be a build blueprint:
  9. someone reading it should understand what to provision, how traffic and
  10. data move, what is required versus optional, and what to configure next.
  11. ### ARCHITECTURE DIAGRAM DESIGN SYSTEM & AESTHETIC DIRECTIVES
  12. When authoring system architecture diagrams in YAML, adhere strictly to these architectural visual design principles:
  13. #### 1. Architectural Layout & Directional Flow
  14. * **Determine the Primary Axis:**
  15. * **Top-to-Bottom (Layered Systems):** Use for Tiered/Client-Server architectures (Presentation → Processing/Logic → Storage → External Infrastructure).
  16. * **Left-to-Right (Data & Workflow Pipelines):** Use for event-driven systems, ETL pipelines, integration flows, or user journey sequences.
  17. * **Dedicated Cross-Cutting Rows/Columns:** Place auxiliary or cross-cutting services (e.g., Logging, Authentication, Telemetry, Storage) on a dedicated side column or bottom row rather than interspersing them within the core flow.
  18. * **Spatial Breathability:** Always leave 1–2 empty grid steps between connected components to provide space for connection lines without crossing icons or text.
  19. #### 2. Restrained Color System & Contrast
  20. * **Canvas:** Use the established white canvas (`white`) unless the user requests another treatment.
  21. * **Default Elements:** Use dark readable text and lines (`black` for labels and `#334155` for connections/borders). Do not use the historical orange renderer defaults for blueprint styling.
  22. * **Containers:** Use light-gray or very lightly tinted fills with a consistent border, such as `#F1F5F9` with `#94A3B8`. Container color should establish hierarchy without competing with the topology.
  23. * **Icons:** Preserve native vendor icon artwork. Do not impose a diagram-wide accent palette or override icon fills/strokes unless the selected icon has been previewed and the override is intentional.
  24. #### 3. Domain Grouping & Boundaries
  25. * **Container Enclosure:** Wrap related components in named groups (e.g., Services, Data Domain, External System, Core Boundary).
  26. * **Line Style Rules:**
  27. * **Solid Lines:** Direct synchronous calls, primary system processes, or hard structural boundaries.
  28. * **Dashed Lines (`strokeDashArray: [4, 4]`):** Asynchronous events, metadata/telemetry flows, or logical/trust boundaries.
  29. * **Group Headers:** Choose one placement for all group names, commonly `bottomMiddle` for north-to-south flows, and keep it consistent unless a collision is unavoidable.
  30. #### 4. Typography & Label Symmetry
  31. * **Unified Alignment:** Standardize `textLocation` across the entire diagram. Use the selected group/icon placement consistently; the established blueprint default is `bottomMiddle`. Never mix alignments within the same diagram unless a documented collision makes it unavoidable.
  32. * **Readable Display Names:** Always use explicit, concise display text with the `text:` attribute (e.g., `text: "Auth Service"`) instead of raw technical identifiers (e.g., `auth_svc_node_01`).
  33. #### 5. Connection Line Discipline
  34. * Align connected components along straight grid lines to eliminate diagonal line clutter.
  35. * Group multi-destination fan-outs neatly through shared alignment rather than overlapping multiple connection lines across the canvas.
  36. ## Prerequisites
  37. The drawthe.net MCP server must be connected and expose these tools:
  38. - `get_dsl_reference` — returns the full YAML DSL syntax reference.
  39. - `list_icon_families` — lists available icon families and icon counts.
  40. - `list_icons` — lists/searches icon names within a family.
  41. - `get_icon` / `get_icon_svg` — preview a specific icon (PNG/SVG) to confirm it looks right before using it.
  42. - `render_diagram` — renders a YAML diagram to PNG or SVG.
  43. ## Procedure
  44. 1. **Read the DSL reference first.** Call `get_dsl_reference` before
  45. writing any YAML if you have not already seen it in this conversation.
  46. Do not guess at the syntax — the `diagram`, `title`, `icons`, `notes`,
  47. `groups`, and `connections` sections each have specific required and
  48. optional fields.
  49. 2. **Identify the components in the description.** Break the request down
  50. into concrete entities (servers, load balancers, databases, gateways,
  51. VPCs/VNets, users, external services, etc.) and the connections between
  52. them. If the user proposes an architecture rather than describing an
  53. existing one, design a sensible one first (reasonable tiers, redundancy,
  54. networking boundaries), then diagram it.
  55. State the architecture assumption in the title or a note when the
  56. request is ambiguous. For example, RHDH on ROSA is materially different
  57. from RHDH on EKS or RHDH on EC2.
  58. Design the blueprint before choosing icons. Organize it into these layers
  59. where they apply:
  60. - prerequisites and network foundation: account, region, VPC, AZs,
  61. public/private subnets, routing, security groups, IAM, and certificates;
  62. - request path: users, DNS, edge/load balancer, ingress, and application;
  63. - platform: cluster, namespaces, operators, ingress controller, and
  64. workload replicas;
  65. - dependencies: identity, database, secrets, object storage, registries,
  66. source control, and observability;
  67. - build notes: required configuration, optional choices, and an ordered
  68. implementation sequence.
  69. Do not draw every plausible service. Include a component only when it
  70. answers a deployment question, and mark it as required, optional, or
  71. external in its label or notes.
  72. 3. **Choose the right icon family based on vendor keywords in the
  73. request** — there is no fixed default family. Inspect the request for
  74. vendor/platform signals:
  75. - AWS services/terms → `aws2026` (preferred, current) or `aws` (legacy).
  76. - Azure services/terms → `azure2026` (preferred), or `azureCloud` /
  77. `azureEnterprise` (legacy).
  78. - Cisco/network hardware terms → `cisco2026` (preferred) or `cisco` (legacy).
  79. - Generic/vendor-neutral request → pick whichever family has the closest
  80. conceptually matching icon; prefer the modern `*2026` families.
  81. Call `list_icon_families` if you're unsure what's available.
  82. 4. **Never invent an icon name.** For every component, call `list_icons`
  83. with the family and a keyword query (e.g. `query: "load_balanc"`) to find
  84. the real icon name before writing an `icon:` reference in YAML. Use
  85. `get_icon` or `get_icon_svg` to visually confirm an ambiguous match
  86. before committing to it.
  87. 5. **Always prefer a meaningful, accurate icon over a generic
  88. placeholder.** If an exact icon for a component doesn't exist in the
  89. chosen family, search for the closest conceptually similar icon (e.g. a
  90. generic "server" or "compute" icon for an unlisted service type) rather
  91. than defaulting to a plain box or an unrelated icon. Only fall back to a
  92. generic shape (e.g. via `notes`) if truly no reasonable icon exists in
  93. any relevant family.
  94. 6. **Write the YAML diagram** using the DSL: define `diagram` (grid size,
  95. background), optionally `title`, then `icons` (with `x`/`y` grid
  96. coordinates, using relative positions like `x: "+1"` where convenient),
  97. `groups` to box related components together, and `connections` between
  98. icon keys. Use YAML anchors for repeated styling if helpful.
  99. Start from the light, readable style below unless the user explicitly
  100. requests a different visual treatment:
  101. diagram:
  102. fill: "white"
  103. gridLines: false
  104. groupPadding: 0.4
  105. title:
  106. color: "black"
  107. fill: "white"
  108. logoFill: "none"
  109. stroke: "black"
  110. type: "box"
  111. heightPercentage: 6
  112. group: &group
  113. - { color: "black", stroke: "#94a3b8", fill: "#f1f5f9" }
  114. connection: &connection
  115. color: "#334155"
  116. stroke: "#334155"
  117. Use `groups` as a list of objects, not a map. Layer groups must be
  118. visibly distinct from a white canvas. For a hierarchy, use a restrained
  119. sequence of light fills so the layers can be scanned without competing
  120. with the topology, for example: foundation `#eaf2f8`, request/data flow
  121. `#eef6ee`, platform `#fff7e6`, and workloads/dependencies `#f1f5f9`.
  122. Keep the border treatment consistent across all groups. Use
  123. Choose one `textLocation` for every group heading before laying out the
  124. diagram, and use it consistently across the hierarchy. `bottomMiddle` is
  125. often a good choice for north-to-south flows because headings sit outside
  126. the incoming edge of each layer. Label placement must be consistent
  127. unless consistency is impossible because the label is blocked. If a
  128. connection, icon, or note crosses or obscures a heading, first fix the
  129. layout by moving the affected component, changing spacing, or rerouting
  130. the connection. Only when those fixes cannot remove the collision may one
  131. heading use another position, and that exception must be documented.
  132. Do not set `iconFill`, `iconStroke`,
  133. or `preserveWhite` globally without previewing the selected family first;
  134. those overrides can erase or wash out native vendor icon artwork.
  135. Never rely on renderer defaults for presentation output: the historical
  136. defaults use orange and are intended for backward compatibility. Always
  137. specify a background, title colors, group styling, and connection colors.
  138. For blueprint icons, set `color: "black"`, `fill: "white"`, and a dark
  139. `stroke` explicitly so labels remain readable around vendor artwork.
  140. Every icon must have an explicit human-readable `text` label. Never
  141. expect the viewer to infer a service from an icon or filename. Keep icon
  142. labels short (normally one to three words), such as `RHDH`, `ROSA`,
  143. `PostgreSQL`, and `Route 53`; put `(required)`, `(optional)`, or
  144. `(external)` in notes or a legend rather than shrinking a long label until
  145. it becomes unreadable. Use notes for configuration detail rather than
  146. packing prose into icon labels.
  147. Use connections to show meaningful flows, not merely membership. Add
  148. notes that explain numbered flows such as `1. DNS resolves the public
  149. hostname`, `2. ingress terminates TLS`, and `3. RHDH accesses PostgreSQL
  150. and secrets`. Avoid a dense web of lines from one central icon to every
  151. service; group dependencies and use notes to explain shared access.
  152. For layered network, platform, or application diagrams, orient the
  153. dominant data or request flow north-to-south: producers, users, or
  154. external/WAN edge at the top; routing, security, or core next; access,
  155. platform, or processing tiers below that; and databases, storage, or
  156. downstream consumers at the bottom. If the system's dominant flow is
  157. different, state the assumption and preserve one clear direction rather
  158. than mixing vertical and horizontal reading orders. Reuse the same x
  159. coordinates across tiers wherever devices form a logical column or pair.
  160. Inspect every group heading against the rendered connection paths and
  161. icons. Do not leave a label underneath a line or behind an icon. Prefer
  162. repairing the layout while preserving the chosen label position; use a
  163. different position only when the collision cannot otherwise be removed.
  164. Within each layer, calculate and use an intentional spacing rhythm for
  165. sibling icons. Equal-role nodes should use equal x intervals unless a
  166. documented architectural grouping requires otherwise. Do not move one
  167. icon to solve a collision and leave the remaining layer on an accidental
  168. set of unequal gaps; rebalance the entire layer and update its connections.
  169. For nontrivial diagrams, perform at least three render-review passes:
  170. render the initial layout, inspect the actual SVG and PNG/SVG preview,
  171. correct spacing/labels/connections, and render again. Repeat until the
  172. topology, hierarchy, label placement, and whitespace are stable. Do not
  173. deliver a diagram based only on YAML inspection or a single successful
  174. render command.
  175. 7. **Render with `render_diagram`.** Default to `format: png` unless the
  176. user asks for SVG (e.g. for further editing). Always read the
  177. `warnings` returned in the response — a warning like "Icon not found"
  178. means a placeholder was drawn instead of a real icon; if you see one,
  179. go back to `list_icons` and fix the reference, then re-render.
  180. 8. **Run the blueprint quality gate.** Before presenting the result, verify
  181. that the image answers these questions:
  182. - What deployment target and assumptions are shown?
  183. - What must be provisioned first?
  184. - How does a user reach the application?
  185. - Where do authentication, persistence, secrets, and images come from?
  186. - Which components are required, optional, or external?
  187. - What should the reader configure next?
  188. Reject and revise any diagram with unlabeled icons, unexplained vendor
  189. artwork, ambiguous flows, decorative components, or a layout that cannot
  190. be read at normal viewing size.
  191. 9. **Iterate.** If the rendered layout looks cramped, overlapping, or
  192. components are misaligned, adjust the `diagram` grid size (`rows`/
  193. `columns`) or icon `x`/`y` coordinates and re-render rather than leaving
  194. a poor-quality diagram. Check the actual image preview, not just the
  195. tool response: the canvas must be light and opaque, labels must be
  196. readable, groups must not overlap unrelated groups, and connection lines
  197. must not dominate the diagram. Increase the grid size before shrinking
  198. labels or packing more components into one cell.
  199. 11. **Always deliver the source YAML.** After the diagram passes the quality
  200. gate, save the complete YAML as a new `.yaml` document and provide that
  201. document to the user alongside the rendered image. Never provide only a
  202. screenshot or an inline abbreviated snippet; the YAML is the editable
  203. blueprint the user will build from and revise later.
  204. ## Notes
  205. - The MCP server runs locally over stdio (`npm run mcp` in this repo, or
  206. configure your MCP host to spawn `npx tsx mcp/server.ts` from the repo
  207. root). It has no network dependency for rendering.
  208. - Icon families and counts as of this writing: `aws` (231), `aws2026`
  209. (303), `azure2026` (636), `azureCloud` (208), `azureEnterprise` (101),
  210. `cisco` (295), `cisco2026` (295). Always confirm current counts/names via
  211. `list_icon_families`/`list_icons` rather than relying on this list, since
  212. icon sets may be refreshed over time.
README.md · README · 633 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ## drawthe.net: Decent looking diagrams for engineers.
  2. drawthe.net draws network diagrams dynamically from a text file describing the placement, layout and icons. Given a yaml file describing the hierarchy of the network and it's connections, a resulting diagram will be created.
  3. ![screenshot](https://github.com/cidrblock/drawthe.net/raw/main/screenshot_gc.png)
  4. ## Motivation
  5. Complex network diagrams typically involve specific place of icons, connections and labels using a tool like Visio or OmniGraffle using a mouse and constantly zooming in and out for single pixel placement. The goal behind drawthe.net, was to be able to describe the digram in a text file and have it rendered in SVG in the browser.
  6. I simply wanted to be able to draw network diagrams as fast as it could be done on a dry-erase board without using a mouse.
  7. ## Development
  8. Requires Node.js 20.19+, 22.12+, or 24+.
  9. ```
  10. npm install
  11. npm run dev # start the Vite dev server
  12. npm run build # typecheck + production build to dist/
  13. npm run lint # eslint
  14. npm run typecheck # tsc --noEmit
  15. npm run render -- examples/NTP.yaml out.svg # headless YAML -> SVG render (Node/CLI)
  16. ```
  17. The renderer core (`src/renderer`) has no browser dependency and can run headlessly in
  18. Node via `src/cli/render.ts` - this is the seam future automation/agent tooling will use.
  19. The app has three static entry points, built by Vite as a multi-page app:
  20. - `index.html` - the YAML editor (Monaco + JSON Schema diagnostics and live preview)
  21. - `fullscreen.html` - a popup window that renders the design shared by `index.html` (`window.opener`)
  22. - `render.html` - renders a single YAML doc from a `?doc=` (bundled example) or `?key=` (saved doc) query param, with no editor UI
  23. For embedding diagrams in Hugo posts, see [the Hugo shortcode integration](integrations/hugo/README.md). It inlines SVG generated by the headless CLI from a page-bundle YAML resource.
  24. The browser editor validates YAML syntax and documented diagram properties against a JSON Schema. Its diagnostics panel also reports renderer warnings, including unresolved icons and overlapping groups.
  25. Reusable icon defaults can opt into strict schema validation with `type: icon`. Unknown properties on the tagged anchor and on icon mappings that inherit it are reported as editor diagnostics; untagged custom anchors remain extensible. For example:
  26. ```yaml
  27. cisco: &cisco
  28. type: icon
  29. iconFamily: cisco
  30. icon: router
  31. icons:
  32. edge: {<<: *cisco, x: 1, y: 1}
  33. ```
  34. ### npm package releases
  35. Publishing a non-prerelease GitHub Release triggers the npm publish workflow. Configure npm Trusted Publishing for GitHub Actions with organization `cidrblock`, repository `drawthe.net`, and workflow filename `publish-npm.yml`; allow direct publishing with `npm publish`. No long-lived CI token is required. Update the package version, then publish a GitHub Release tagged `v<version>` (for example, `v2.0.3`). The workflow runs lint, typecheck, and build before publishing; npm generates provenance automatically for trusted publishes.
  36. Install the package and render a diagram from another project with:
  37. ```sh
  38. npm install --save-dev drawthe.net
  39. npx drawthe-net diagrams/network.yaml docs/network.svg --width=1200 --height=800
  40. ```
  41. ### Podman container image
  42. Stable GitHub Releases publish versioned images and update the `latest` tag in GHCR. For the first image publication, change the package visibility to **Public** in the GitHub package settings so Podman can pull it without authentication.
  43. ```sh
  44. # Run the web editor at http://localhost:5173
  45. podman pull ghcr.io/cidrblock/drawthe.net:latest
  46. podman run --rm -p 5173:5173 ghcr.io/cidrblock/drawthe.net:latest ui
  47. # Convert YAML to SVG
  48. podman run --rm \
  49. --userns=keep-id \
  50. --user "$(id -u):$(id -g)" \
  51. -v "$PWD:/workspace:Z" \
  52. -w /workspace \
  53. ghcr.io/cidrblock/drawthe.net:latest \
  54. diagrams/network.yaml docs/network.svg --width=1200 --height=800
  55. ```
  56. Use a versioned tag such as `ghcr.io/cidrblock/drawthe.net:v2.0.3` instead of `latest` for a pinned image.
  57. ## Quick start
  58. Run `npm run dev` to open the editor locally.
  59. Clear the editor and paste the following in, then click draw or ctrl-enter.
  60. ```yaml
  61. diagram:
  62. fill: "white"
  63. rows: 5
  64. columns: 5
  65. title:
  66. author: Your Name
  67. company: Comapny Name
  68. color: black
  69. logoFill: white
  70. logoUrl: https://upload.wikimedia.org/wikipedia/commons/b/b3/Wikipedia-logo-v2-en.svg
  71. text: Hello world
  72. subText: additional information about this diagram
  73. type: bar
  74. stroke: black
  75. # Set defaults for icons, groups, connections
  76. iconDefaults: &iconDefaults
  77. color: black
  78. fill: white
  79. stroke: black
  80. iconFamily: aws
  81. groupDefaults: &groupDefaults
  82. fill: "none"
  83. color: black
  84. stroke: black
  85. connectionDefaults: &connectionDefaults
  86. color: "black"
  87. stroke: "black"
  88. noteDefaults: &noteDefaults
  89. color: black
  90. fill: white
  91. stroke: black
  92. xAlign: center
  93. yAlign: center
  94. # Add the icons
  95. icons:
  96. dns: {<<: *iconDefaults, icon: net_route53_hostedzone, x: 2, y: 3 }
  97. lb: {<<: *iconDefaults, icon: cmpt_elasticloadbalancing, y: "-1" }
  98. server1: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "-1", y: "-1" }
  99. server2: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "+1" }
  100. server3: {<<: *iconDefaults, icon: cmpt_ec2_instance, x: "+1" }
  101. # Add the groups
  102. groups:
  103. servers: { <<: *groupDefaults, name: Web Servers, members: [server1, server2, server3] }
  104. # Add connections
  105. connections:
  106. - { <<: *connectionDefaults, endpoints: [dns, lb] }
  107. - { <<: *connectionDefaults, endpoints: [lb, servers] }
  108. notes:
  109. note1:
  110. <<: *noteDefaults
  111. x: 0
  112. y: 3
  113. text: "##Note\n\nThis is the text for the note."
  114. ```
  115. Hopefully, the following diagram is created.
  116. ![screenshot](https://github.com/cidrblock/drawthe.net/raw/main/quick_start.png)
  117. ## Overview
  118. The YAML document has major sections which describe the diagram. These are the basic root types:
  119. **diagram**: The page on which the diagram will be drawn.
  120. **title**: Information about the diagram.
  121. **icons**: Objects to be placed on the diagram.
  122. **notes**: Text boxes with information.
  123. **connections**: Lines drawn between objects.
  124. **groups**: Collections of objects.
  125. ### Custom sections
  126. The YAML document above has the following additional custom sections:
  127. **iconDefaults**: A YAML anchor which describes common icon attributes which will be inherited later.
  128. **groupDefaults:** A YAML anchor which describes common group attributes which will be inherited later.
  129. **connectionDefaults:** A YAML anchor which describes common connection attributes which will be inherited later.
  130. **noteDefaults:** A YAML anchor which describes common note attributes which will be inherited later.
  131. YAML reference: https://en.wikipedia.org/wiki/YAML
  132. ### Placement
  133. Icons and notes have the following attributes, which allows the object to be placed and sized on the place.
  134. **x:** The X coordinate value.
  135. **y:** The Y coordinate value.
  136. **w:** The width of the object, in X coordinate steps, extending right toward the right side of the screen.
  137. **h:** The height of the object, in Y coordinate steps, extending down toward the bottom of the diagram.
  138. ### Basic styling
  139. Common to most entities are the following:
  140. **color:** The color of the text.
  141. **fill:** Sets the color inside the object.
  142. **stroke:** Sets the color of the line drawn around the object.
  143. ### Icons
  144. The following icon families are available:
  145. - aws
  146. - azureCloud
  147. - azureEnterprise
  148. - cisco
  149. - aws2026 (current AWS architecture service icons, full-color pictograms)
  150. - azure2026 (current Azure public service icons, unified set replacing the separate cloud/enterprise split)
  151. - cisco2026 (current revision of the same Cisco network topology icon set)
  152. Icons have the following basic attributes:
  153. **iconFamily:** The family from which to pull the icon.
  154. **icon:** The name of the icon within the family.
  155. **iconFill:** Set the color inside the icon.
  156. **iconStroke:** Sets the color of the line drawn within the icon.
  157. Each icon and icon family may behave differently when the fill and stroke are applied, review the icon cut sheets to see the icons available for each family with the iconFill and iconStroke set.
  158. Note: the icon sets bundled with this project are redistributed legally, but each vendor's icon set carries its own usage terms (some restrict recoloring or other alteration of the icon itself). This tool lets you apply `iconFill`/`iconStroke`/`preserveWhite` to any icon family regardless of those terms - see [Icon licensing](#icon-licensing) below. It is your responsibility to comply with the license that applies to the icon family you use.
  159. ### Notes
  160. Notes can be plain text or markdown. See the 'notes' example for the use of markdown. (Indentation is critical when using markdown for notes.)
  161. ## Additional examples
  162. Run `npm run dev` and choose an example from the editor menu to explore different diagram layouts and styles.
  163. ### Troubleshooting
  164. The most common mistake I've made is in the YAML syntax. The developer tools window in chrome should give you an idea of what might be wrong.
  165. It's also handy to comment out lines (with a #) to see where the issue may be.
  166. ## AI assistance (MCP server + skill)
  167. drawthe.net includes an MCP (Model Context Protocol) server that lets AI
  168. coding agents draw diagrams directly, either from a natural-language
  169. description or by illustrating a proposed system architecture.
  170. ### Running the MCP server
  171. ```bash
  172. npm run mcp
  173. ```
  174. This starts the server over stdio (`mcp/server.ts`). Point your MCP-compatible
  175. agent host at this command (or `npx tsx mcp/server.ts` from the repo root) to
  176. connect. The server has no network dependency — rendering happens locally.
  177. For an MCP host configuration, use the repository root as the working
  178. directory and spawn `npm run mcp`. The server communicates over stdio; it does
  179. not expose an HTTP port.
  180. ### Tools exposed
  181. - `get_dsl_reference` — full YAML DSL syntax reference.
  182. - `list_icon_families` — lists available icon families (`aws`, `aws2026`,
  183. `azure2026`, `azureCloud`, `azureEnterprise`, `cisco`, `cisco2026`) and icon
  184. counts.
  185. - `list_icons` — search icon names within a family.
  186. - `get_icon` / `get_icon_svg` — preview a specific icon (PNG/SVG).
  187. - `render_diagram` — renders a YAML diagram to PNG or SVG, returning any
  188. warnings (e.g. unresolved icon references).
  189. ### Skill
  190. [`SKILL.md`](SKILL.md) documents the procedure an agent should follow: read
  191. the DSL reference, choose an icon family based on vendor keywords in the
  192. request, look up real icon names (never invent one), prefer accurate/similar
  193. icons over generic placeholders, then render and iterate on warnings. It also
  194. requires agents to produce a deployment blueprint rather than an icon collage:
  195. use explicit labels, meaningful flow direction, grouped layers, intentional
  196. spacing, collision-free connections, build notes, and multiple render-review
  197. passes. Agents must save and provide the complete editable YAML source as a
  198. new document alongside the rendered image.
  199. ### Example blueprint
  200. [`examples/hybrid-platform-reference-blueprint.yaml`](examples/hybrid-platform-reference-blueprint.yaml)
  201. demonstrates a complex hybrid platform with AWS edge services, a private Cisco
  202. spine-leaf fabric, redundant application services, data services, backups, and
  203. solid versus dashed connections. Render it locally with:
  204. ```bash
  205. npx tsx src/cli/render.ts \
  206. examples/hybrid-platform-reference-blueprint.yaml \
  207. /tmp/hybrid-platform-reference.svg \
  208. --width=2600 --height=1900
  209. ```
  210. The same YAML can be passed to the MCP server's `render_diagram` tool for PNG
  211. or SVG output.
  212. ## API Reference
  213. ### Diagram
  214. `diagram`:
  215. - `aspectRatio`: (defualt 1:1) The width:height ratio of the diagram.
  216. - `columns`: (default: 10) The number of columns in the diagram.
  217. - `fill`: (default: orange) The background color of the diagram.
  218. - `gridLines:` (default: true)
  219. - `true`: Show the gridlines.
  220. - `false`: Hide the gridlines.
  221. - `gridPaddingInner`: (default: .4) The ration of the icon box size to the spacing between the boxes.
  222. - `groupPadding`: (default: .33) The percentage of the space between icons to use for the group boundary.
  223. - `iconTextRatio`: (default: .33) The percentage of the icon box to allocate to the icon text.
  224. - `iconLabelFontSize`: Optional diagram-wide icon label size in px; defaults to automatic fitting.
  225. - `connectionLabelFontSize`: Optional diagram-wide connection label size in px; defaults to automatic sizing.
  226. - `margins`:
  227. - `top`: (default: 20) The top margin of the diagram in px.
  228. - `right`: (default: 20) The right side margin in px.
  229. - `bottom`: (default: 50) The bottom margin in px.
  230. - `left`: (default: 20) The left side margin in px.
  231. - Example: `margins: {top: 20, right: 20, bottom: 50, left: 20 }`
  232. - `rows:` (default: 10) The number of rows.
  233. ### Title
  234. `title`:
  235. - `author`: (default: "Bradley A. Thornton") The author of the diagram.
  236. - `color`: (default: orange) The title text color.
  237. - `company`: (default: Self) The company name.
  238. - `date`: (default: `new Date().toLocaleDateString()`) The date for the diagram.
  239. - `fill`: (default: orange) The title fill color.
  240. - `heightPercentage`: (default: 6) The percentage of the diagram height to use for the title.
  241. - `logoFill`: (default: orange) The color behind the logo.
  242. - `logoUrl`: (default: `/images/radial.png`) The URL for the logo.
  243. - `stroke`: (default: orange) The line color for the title.
  244. - `subText`: The title subtext.
  245. - `text`: The title text.
  246. - `type`: (default: box). The title type.
  247. - `box`: Draw a box around the title using the stroke color.
  248. - `bar`: Draw a line above the title using the stroke color.
  249. - Example: `type: bar`
  250. - `version`: (default: 1.01) The version of the diagram.
  251. ### Icons
  252. The icon's key will be used as the text value, therefore icon names have to be unique.
  253. `icons`:
  254. - `color`: (default: orange) The icon text color.
  255. - `fill`: (default: orange) The fill color for the icon bounding box.
  256. - `h`: (default: 1) The height of the icon.
  257. - `icon`: (default: none) The name of the icon in the icon family.
  258. - `iconFamily`: (default: none) The name of the icon family from which to get the icon.
  259. - `iconUrl`: Optional custom HTTPS URL pointing directly to an image file, or a base64 image data URL (`SVG`, `PNG`, `JPEG`, `GIF`, or `WebP`, up to 5 MiB). It replaces `iconFamily`/`icon`; an HTML page URL (including a Wikipedia media page) is not an image URL. SVG input is sanitized before embedding. Browser loads require CORS permission; headless HTTPS loads are limited to publicly routed hosts.
  260. - `labelFontSize`: Optional icon label size in px, overriding `diagram.iconLabelFontSize`.
  261. - `iconFill`: (default: use the colors specified in the icon's svg file) The fill color for the icon.
  262. - `iconStroke`: (default: use the colors specified in the icons's svg file) The color of the lines in the icon.
  263. - `iconStrokeWidth`: (default: use the colors specified in the icons's svg file) The size of the lines within the icon.
  264. - `metadata`: (default: none) A hash for the mouse over metadata (see the example)
  265. - `url`: If provided, with HTTP GET the metadata, expects a simple json object as a response.
  266. - Note: The URL can contain {{ var }} for replacements, where var is the key or another attribute of the icon.
  267. - `errorText`: (default: HTTP status and text) Custom error message if HTTP GET fails.
  268. - `preserveWhite`: (default: none) Don't change white in the source svg file. (this is useful for the cisco icon family)
  269. - `stroke`: (default: orange) The color of the icon bounding box line.
  270. - `strokeDashArray`: (default [0,0]) The stroke dash size in px and the spacing between the dashes in px.
  271. - `text`: (default: none) Instead of the the icon's key use this text label for the icon label.
  272. - `textLocation`: (default: bottomMiddle) The location of the text for the icon.
  273. - `bottomLeft`: Position the text along the bottom, in the left corner.
  274. - `bottomMiddle`: Position the text along the bottom, centered.
  275. - `bottomRight`: Position the text along the bottom, in the right corner.
  276. - `center`: Position the text in the center of the bounding box.
  277. - `leftBottom`: Position the text along the left side, in the bottom corner.
  278. - `leftMiddle`: Position the text along the left side, centered.
  279. - `leftTop`: Position the text along the left side, in the top corner.
  280. - `rightBottom`: Position the text along the right side, in the bottom corner.
  281. - `rightMiddle`: Position the text along the right side, centered.
  282. - `rightTop`: Position the text along the right side, in the top corner.
  283. - `topLeft`: Position the text along the top, in the left corner.
  284. - `topMiddle`: Position the text along the top, centered.
  285. - `topRight`: Position the text along the top, in the right corner.
  286. - Example: `textLocation: rightMiddle`
  287. - `url`: (default: none) A link/URL for the icon text
  288. - `w`: (default: 1) The width of the icon.
  289. - `x`: (default: none) The x-coordinate location of the icon.
  290. - `n`: An absolute position.
  291. - `"+n"`: A value added from the previous icon's x value.
  292. - `"-n"`: A value subtracted from the previous icon's x value.
  293. - Example: `{x: "+5", y: 0}`
  294. - `y`: (default: none) The y-coordinate location of the icon.
  295. - `n`: An absolute position.
  296. - `"+n"`: A value added from the previous icon's x value.
  297. - `"-n"`: A value subtracted from the previous icon's x value.
  298. - Example: `{x: 0, y: "+5"}`
  299. ### Groups
  300. Groups are drawn in order, so place groups that should have a lower z-index at the top of the group array. A group is the smallest rectangle that includes it's members, so in the case of large groups, it will only be necessary to include the upper-left and lower-right most members.
  301. `groups`:
  302. - `color`: (default: orange) The group text color.
  303. - `fill`: (default: orange) The fill color for the group.
  304. - `members`: (default: none) An array of members for the group.
  305. - Note: A member can be another group or icon.
  306. - Example: ` inner: { <<: *group, stroke: none, fill: "white", textLocation: "rightMiddle", members: [T1, T4, NSG1] }`
  307. - `padding`: Optional inner padding, as a fraction of the gap between grid cells (default: `diagram.groupPadding`).
  308. - `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft`: Optional side-specific padding values overriding `padding`.
  309. - `margin`: Optional outer margin, in the same gap units, that a parent group reserves around this group and that is kept inside the canvas.
  310. - `marginTop`, `marginRight`, `marginBottom`, `marginLeft`: Optional side-specific margins overriding `margin`.
  311. - `fontSize`: Optional label size in px. The label always sits in the padding on its `textLocation` side; that side grows to fit it, and the font shrinks if the label is longer than the side.
  312. - `name`:
  313. - `stroke`: (default: orange) The color of the group's bounding box line.
  314. - `strokeDashArray`: (default [0,0]) The stroke dash size in px and the spacing between the dashes in px.
  315. - `textLocation`: (default: bottomMiddle) The location of the text for the icon.
  316. - `bottomLeft`: Position the text along the bottom, in the left corner.
  317. - `bottomMiddle`: Position the text along the bottom, centered.
  318. - `bottomRight`: Position the text along the bottom, in the right corner.
  319. - `center`: Position the text in the center of the bounding box.
  320. - `leftBottom`: Position the text along the left side, in the bottom corner.
  321. - `leftMiddle`: Position the text along the left side, centered.
  322. - `leftTop`: Position the text along the left side, in the top corner.
  323. - `rightBottom`: Position the text along the right side, in the bottom corner.
  324. - `rightMiddle`: Position the text along the right side, centered.
  325. - `rightTop`: Position the text along the right side, in the top corner.
  326. - `topLeft`: Position the text along the top, in the left corner.
  327. - `topMiddle`: Position the text along the top, centered.
  328. - `topRight`: Position the text along the top, in the right corner.
  329. - Example: `textLocation: rightMiddle`
  330. ### Connections
  331. Connections are an array of individual connections. The order is insignificant because connections will always be drawn from left to right.
  332. `connections`:
  333. - `color`: (default: orange) The connection text color.
  334. - `curve`: (default: curveLinear) The type of connection to draw.
  335. - `curveLinear`: Draws a line directly connecting the endpoints.
  336. - `curveStep`: Draws a line consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.
  337. - `curveStepAfter`: Draws a line consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.
  338. - `curveStepBefore`: Draws a line consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.
  339. - `endpoints`: An array of 2 icons, groups or notes to draw connections between.
  340. - Note: When an endpoint is a group, lines will be drawn to each group member.
  341. - Example: `endpoints: [spines:40Gb,leaves:40Gb]`
  342. - Example: `endpoints: [allNTP:sync, allNTP:sync]`
  343. - **labels:** Labels can be appended to the endpoint names and will be added to the line.
  344. Example: `endpoints: ["router:eth0", "firewall:eth1"]`
  345. - `labels`: Optional list of labels placed on one connection path. Each item
  346. supports `text`, `position` (`start`, `middle`, or `end`), `side` (`over` or `under`), and `fontSize`.
  347. `side` is relative to the path direction; it defaults to `over`.
  348. Example: `labels: [{text: "HTTPS", position: start}, {text: "443", position: middle, side: under}, {text: "primary", position: end}]`
  349. - `label`: Legacy single-label form; equivalent to one `labels` item.
  350. - `labelPosition`: Legacy placement field for `label`.
  351. - `labelSide`: Legacy side field for `label` (`over` or `under`, default: `over`).
  352. - `endpointLabelSide`: Side for port labels in endpoint strings such as `router:eth0` (`over` or `under`, default: `over`).
  353. - `labelFontSize`: Legacy font-size field for `label`.
  354. - `connectionLabelFontSize`: Diagram-wide default overridden by connection `labelFontSize` or an individual `labels[].fontSize`.
  355. - `lineStyle`: Optional canned line style: `solid` (default), `dashed`, `dotted`, `dashDot`, or `double`. `double` draws two rails around the existing center path, so curves and labels keep their current geometry.
  356. - `stroke`: (default: orange) The line color for the connection.
  357. - `strokeDashArray`: Optional custom dash pattern in px, overriding the canned dash pattern for the selected `lineStyle`.
  358. - `strokeWidth`: Line thickness in px; `double` defaults to 4px overall.
  359. Curve definitions are directly from d3.js: https://github.com/d3/d3-shape (only a subset are implemented.)
  360. ### Notes
  361. See the example call 'Notes' for examples of these attributes.
  362. `notes`:
  363. - `alignItems`: (default: flex-start) This defines the default behaviour for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).
  364. - `flex-start`: cross-start margin edge of the items is placed on the cross-start line
  365. - `flex-end`: cross-end margin edge of the items is placed on the cross-end line
  366. - `center`: items are centered in the cross-axis
  367. - `baseline`: items are aligned such as their baselines align
  368. - `stretch`: stretch to fill the container (still respect min-width/max-width)
  369. - `color`: (default: orange) The note text color.
  370. - `fill`: (default: orange) The fill color for the note bounding box.
  371. - `flexDirection`: (defualt: column) The direction of the note.
  372. - `row`: left to right
  373. - `row-reverse`: right to left
  374. - `column`: stop to bottom
  375. - `column-reverse`: same as row-reverse but bottom to top
  376. - `h`: (default: 1) The height of the note.
  377. - `justifyContent`: (default: flex-start) This defines the alignment along the main axis.
  378. - `flex-start`: items are packed toward the start line
  379. - `flex-end`: items are packed toward to end line
  380. - `center`: items are centered along the line
  381. - `space-between`: items are evenly distributed in the line; first item is on the start line, last item on the end line
  382. - `space-around`: items are evenly distributed in the line with equal space around them. Note that visually the spaces aren't equal, since all the items have equal space on both sides. The first item will have one unit of space against the container edge, but two units of space between the next item because that next item has its own spacing that applies.
  383. - `stroke`: (default: orange) The color of the note bounding box line.
  384. - `strokeDashArray`: (default [0,0]) The stroke dash size in px and the spacing between the dashes in px.
  385. - `text`: The text for the note, can be plain or markdown.
  386. - `textAlign`: (default: left) The text-align property specifies the horizontal alignment of text in an element.
  387. - `left`: Aligns the text to the left
  388. - `right`: Aligns the text to the right
  389. - `center`: Centers the text
  390. - `justify`: Stretches the lines so that each line has equal width (like in newspapers and magazines)
  391. - `w`: (default: 1) The width of the note.
  392. - `x`: (default: none) The x-coordinate location of the note.
  393. - `n`: An absolute position.
  394. - `"+n"`: A value added from the previous note's x value.
  395. - `"-n"`: A value subtracted from the previous note's x value.
  396. - Example: `{x: "+5", y: 0}`
  397. - `xAlign`: (default: left) Positions the text along the x axis.
  398. - `left`: Align the text to the left side of the note's bounding box.
  399. - Note: This sets `textAlign: "left", alignItems: "flex-start"`
  400. - `right`: Align the text to the right side of the note's bounding box.
  401. - Note: This sets `textAlign: "right", alignItems: "flex-end"`
  402. - `center`: Align the text in the middle of the note's bounding box along the x axis.
  403. - Note: This sets `textAlign: "center", alignItems: "center"`
  404. - `y`: (default: none) The y-coordinate location of the note.
  405. - `n`: An absolute position.
  406. - `"+n"`: A value added from the previous note's x value.
  407. - `"-n"`: A value subtracted from the previous note's x value.
  408. - Example: `{x: 0, y: "+5"}`
  409. - `yAlign`: (default: top) Positions the text along the y axis.
  410. - `top`: Align the text to the top of the note's bounding box.
  411. - Note: This sets `justifyContent: "flex-start"`
  412. - `bottom`: Align the text to the bottom side of the note's bounding box.
  413. - Note: This sets `justifyContent: "flex-end"`
  414. - `center`: Align the text in the middle of the note's bounding box along the y axis.
  415. - Note: This sets `justifyContent: "center"`
  416. Each note is an html flexbox. For a good explanation of flex-boxes: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  417. Notes can also contain markdown converted by: Showdown.js https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax
  418. ## Built with great open source software
  419. - **Vite:** https://vite.dev
  420. - **TypeScript:** https://www.typescriptlang.org
  421. - **Monaco Editor:** https://microsoft.github.io/monaco-editor/
  422. - **D3.js:** https://d3js.org
  423. - **js-yaml:** https://github.com/nodeca/js-yaml
  424. - **Showdown:** https://github.com/showdownjs/showdown
  425. - **Prettify:** https://github.com/google/code-prettify
  426. - **Bootstrap:** https://getbootstrap.com
  427. ## Contributing
  428. Please do.
  429. ## Versioning
  430. 1.0 Initial release.
  431. ## Authors
  432. * **Bradley Thornton** - *Initial work* - [cidrblock](https://github.com/cidrblock)
  433. ## License
  434. This project is licensed under the MIT License. [MIT License](http://www.opensource.org/licenses/MIT).
  435. ### Icon licensing
  436. The MIT License above covers this project's own code. It does not cover the third-party icon
  437. sets bundled under `public/images/`. Each icon family is provided by its respective vendor
  438. under that vendor's own usage terms, which are not all identical - some permit recoloring,
  439. some explicitly prohibit altering the icon, some restrict use to specific contexts (e.g.
  440. architecture diagrams only).
  441. This tool's `iconFill`, `iconStroke`, `iconStrokeWidth`, and `preserveWhite` diagram attributes
  442. will recolor/restyle any icon from any family on request - the tool does not know or enforce
  443. what each vendor's license permits. **Determining whether a given use (including recoloring,
  444. redistribution, or publishing a rendered diagram) complies with the applicable icon set's
  445. license is the user's responsibility.** When in doubt, consult the vendor's current published
  446. terms for that icon family before redistributing or publishing diagrams built with it.
  447. ### Icon set provenance
  448. | Family | Source | Retrieved | Notes |
  449. | --- | --- | --- | --- |
  450. | `azure2026` | [Azure architecture icons](https://learn.microsoft.com/en-us/azure/architecture/icons/) (`Azure_Public_Service_Icons` package) | 2026-09 | Bundled Terms of Use PDF permits use in architectural diagrams/training/documentation; don't crop/flip/rotate/distort shape; don't use Microsoft product icons to represent your own product. |
  451. | `aws2026` | [AWS architecture icons](https://aws.amazon.com/architecture/icons/) ("Icon package", Architecture-Service-Icons, 48px tier) | 2026-09 | AWS's page states the icons are for building architecture diagrams; a machine-readable terms/license file was not bundled in this release and full current wording was not independently verified - review AWS's current published guidance yourself before relying on this family. |
  452. | `cisco2026` | [Cisco network topology icons](https://www.cisco.com/c/en/us/about/brand-center/network-topology-icons.html) (PMS 3015 color EPS package) | 2026-09 | Cisco's page states "You may use them freely, but you may not alter them" - this is the same underlying icon set as the original `cisco` family (which this project already recolors via `iconFill`/`iconStroke`); see the general disclaimer above. EPS source converted to SVG via Inkscape. |
  453. Both `azure2026` and `aws2026` are added as new, additional families - the original `aws`,
  454. `azureCloud`, `azureEnterprise`, and `cisco` families are untouched, so existing diagrams keep
  455. rendering identically. `cisco2026` refreshes the same Cisco network topology icon set to its
  456. current (2026) revision, converted from EPS via Inkscape.
  457. ------------------------
  458. ### Additional development information
  459. #### Converting icons (legacy manual process - `aws`, `azureCloud`, `azureEnterprise`, `cisco`)
  460. 1. copy the icons into a public/images/xxxx directory
  461. 2. clean up the names a little
  462. 3. convert from svg to eps and back to svg (this sizes the svg to the bounding window of the icon)
  463. 4. use svgo to cleaup the svg files
  464. 5. run `npm run icons:list` to regenerate `public/images/iconFamilies.json`
  465. azure-cloud
  466. ```
  467. cd public/images/azureCloud
  468. cp ~/Downloads/Microsoft_CloudnEnterprise_Symbols_v2.5_PUBLIC/Symbols/CnE_Cloud/SVG/*.svg .
  469. rename 's/[^a-zA-Z0-9_.]//g' *.svg
  470. rename -f 'y/A-Z/a-z/' *.svg
  471. rename 's/^Azure//g' *.svg
  472. for i in `pwd`/*.svg; do inkscape $i -E ${i%.svg}.eps; done
  473. rm *.svg
  474. for i in `pwd`/*.eps; do inkscape $i -l ${i%.eps}.svg; done
  475. rm *.eps
  476. svgo .
  477. cd ../.. && npm run icons:list
  478. ```
  479. AWS
  480. ```
  481. mkdir aws && cd aws
  482. find ~/Downloads/AWS_Simple_Icons_EPS-SVG_v16.2.22/ -type f -name \*.eps -exec cp \{\} . \;
  483. for i in `pwd`/*.eps; do inkscape $i -l ${i%.eps}.svg; done
  484. rm *.eps
  485. rename 's/Amazon//g' *.svg
  486. rename 's/AWS//g' *.svg
  487. rename 's/^Analytics/anlt/g' *.svg
  488. rename 's/^Application-Services/app/g' *.svg
  489. rename 's/^Compute/cmpt/g' *.svg
  490. rename 's/^Database/db/g' *.svg
  491. rename 's/^Developer/dev/g' *.svg
  492. rename 's/^Enterprise/ent/g' *.svg
  493. rename 's/^General/gen/g' *.svg
  494. rename 's/^Internet-Of-Things_IoT/iot_/g' *.svg
  495. rename 's/^Management-Tools/mgmt/g' *.svg
  496. rename 's/^Mobile-Services/mbl/g' *.svg
  497. rename 's/^Networking/net/g' *.svg
  498. rename 's/^On-Demand-Workforce_MechanicalTurk/odwmt/g' *.svg
  499. rename 's/^Security-Identity/sec/g' *.svg
  500. rename 's/^Storage-Content-Delivery/stor/g' *.svg
  501. rename 's/[^a-zA-Z0-9_.]//g' *.svg
  502. rename -f 'y/A-Z/a-z/' *.svg
  503. svgo .
  504. ```
  505. #### Refreshing icons (current process - `aws2026`, `azure2026`, `cisco2026`)
  506. `scripts/icons/refresh-icon-family.ts` replaces the manual steps above with a repeatable pipeline:
  507. download and unzip the vendor's current icon package yourself (see the provenance table above for
  508. links), then run:
  509. ```
  510. npx tsx scripts/icons/refresh-icon-family.ts azure2026 --source /path/to/extracted/Icons
  511. npx tsx scripts/icons/refresh-icon-family.ts aws2026 --source /path/to/extracted
  512. npx tsx scripts/icons/refresh-icon-family.ts cisco2026 --source /path/to/extracted
  513. npm run icons:list
  514. ```
  515. This dedupes icons that vendors repeat across category folders, strips vendor ID/size-suffix
  516. cruft from filenames into the `icon:` key used in YAML, and runs everything through svgo. Families
  517. configured with `sourceExt: "eps"` (e.g. `cisco2026`) are first converted to SVG via Inkscape
  518. (`inkscape <file> -o <file>.svg`), which must be installed and on `PATH`. Vendor packages are not
  519. committed to the repo - only the resulting normalized SVGs under `public/images/<family>/`. To add
  520. another family, add a `FamilyConfig` entry to `scripts/icons/refresh-icon-family.ts`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.