<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shahriar M Abu Hena</title>
    <description>The latest articles on DEV Community by Shahriar M Abu Hena (@imshaikot).</description>
    <link>https://dev.to/imshaikot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4091366%2F8779c24b-b16a-446d-9f4f-e253d39dcd00.jpg</url>
      <title>DEV Community: Shahriar M Abu Hena</title>
      <link>https://dev.to/imshaikot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imshaikot"/>
    <language>en</language>
    <item>
      <title>How I got Claude Code, Cursor and Copilot to draw real architecture diagrams &amp; Bi-visuals</title>
      <dc:creator>Shahriar M Abu Hena</dc:creator>
      <pubDate>Mon, 24 Aug 2026 00:31:43 +0000</pubDate>
      <link>https://dev.to/imshaikot/how-i-got-claude-code-cursor-and-copilot-to-draw-real-architecture-diagrams-bi-visuals-263g</link>
      <guid>https://dev.to/imshaikot/how-i-got-claude-code-cursor-and-copilot-to-draw-real-architecture-diagrams-bi-visuals-263g</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;An Agent Skill that renders diagrams, slides, social cards and animated sequence GIFs to PNG by authoring HTML and screenshotting it with headless Chrome. No design tool, no API, no npm dependencies.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyp67klvtj8vkg5dztuuy.png" alt="Cover Image" width="800" height="336"&gt;
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ask your coding agent for an architecture diagram. Go on, try it right now.&lt;/p&gt;

&lt;p&gt;You will get ASCII art. Or a Mermaid block that renders as three grey boxes with the labels overlapping. Or, if the model is feeling honest, a paragraph describing what the diagram &lt;em&gt;would&lt;/em&gt; look like if it could draw one.&lt;/p&gt;

&lt;p&gt;Your agent can write a parser, refactor a service and explain a race condition it has never seen before. It cannot draw a rectangle.&lt;/p&gt;

&lt;p&gt;That gap bothered me enough to close it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fszgbqunb1z9ccwdztzb9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fszgbqunb1z9ccwdztzb9.png" alt="A rendered architecture diagram: nodes, labelled arrows, a return path" width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That diagram was not drawn in Figma. My agent wrote an HTML file and a script screenshotted it. So did every other image in this post, including the cover.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it actually does
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/imshaikot/render-visual-skill" rel="noopener noreferrer"&gt;render-visual&lt;/a&gt; is an &lt;a href="https://agentskills.io" rel="noopener noreferrer"&gt;Agent Skill&lt;/a&gt;: a folder of instructions and scripts that any skills-compatible agent can load. Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI, OpenCode, Amp and Goose all read the same format.&lt;/p&gt;

&lt;p&gt;Once it is installed you stop asking for code and start asking for pictures:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"make a diagram of our auth flow"&lt;br&gt;
"turn these notes into a 6-slide deck, paper theme"&lt;br&gt;
"an og card for this repo"&lt;br&gt;
"put this screenshot in a browser frame"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thirteen templates ship with it: architecture diagrams, swimlanes, trees, cluster diagrams, deployment diagrams, mind maps, sequence diagrams (static or animated), code windows, slides at 1920x1080, and social cards at 1200x630.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it in about thirty seconds
&lt;/h2&gt;

&lt;p&gt;You need Node 18 or newer and any Chromium based browser. Chrome, Chromium, Brave and Edge all work, and you almost certainly have one already.&lt;/p&gt;

&lt;p&gt;For Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude plugin marketplace add imshaikot/render-visual-skill
claude plugin &lt;span class="nb"&gt;install &lt;/span&gt;render-visual-skill@render-visual-skill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For everything else, clone the published skill branch straight into your skills folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 1 &lt;span class="nt"&gt;-b&lt;/span&gt; skill https://github.com/imshaikot/render-visual-skill.git &lt;span class="se"&gt;\&lt;/span&gt;
  ~/.agents/skills/render-visual
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the whole install. There is no npm install step, because there are no dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The pipeline is deliberately boring, which is the point.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6dbw93jf9z7pwm4358sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6dbw93jf9z7pwm4358sw.png" alt="The render pipeline: your ask, HTML, prepare, Chrome, verify, PNG, with two failure paths" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Your agent copies a template, replaces the placeholder content, and runs one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node ~/.agents/skills/render-visual/scripts/render.mjs figure.html figure.png &lt;span class="nt"&gt;--theme&lt;/span&gt; slate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The canvas size comes from the CSS on the page body. Scale defaults to 2, so a 1360x740 canvas becomes a 2720x1480 PNG that holds up on a retina display.&lt;/p&gt;

&lt;p&gt;Authoring figures as HTML buys three things that a design tool cannot:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;They are diffable.&lt;/strong&gt; A figure is a text file in your repo. Regenerating it after a copy change is one command, not forty minutes of nudging boxes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They are consistent by construction.&lt;/strong&gt; Templates consume design tokens and never hard code a colour, so nothing gets hand picked per image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agents are good at it.&lt;/strong&gt; A model writes HTML far better than it steers a canvas.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The part I actually care about
&lt;/h2&gt;

&lt;p&gt;Here is the thing that shaped every design decision in this project.&lt;/p&gt;

&lt;p&gt;An agent cannot see its own output. If a render silently produces a blank white PNG, the agent reports success, moves on, and you find out three steps later when the image lands in your README. &lt;strong&gt;A wrong image at exit 0 is the worst outcome this pipeline can produce.&lt;/strong&gt; It is worse than a crash, because a crash is information.&lt;/p&gt;

&lt;p&gt;So the renderer is aggressively paranoid, in two phases you can see in the diagram above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before Chrome launches&lt;/strong&gt;, everything the page needs is resolved rather than left for the browser to fetch. A missing stylesheet is fatal. An unknown element id is fatal, and the error lists the ones that exist. An image is read off disk, format checked and inlined as a data URI. A file that is really a text file with a &lt;code&gt;.png&lt;/code&gt; extension is fatal, naming the path.&lt;/p&gt;

&lt;p&gt;Why bother? Because every one of those failures otherwise produces a page that renders perfectly and screenshots as a flawless success, with an invisible hole where your content should be.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After the screenshot&lt;/strong&gt;, the PNG is decoded and inspected. If the luminance spread says nothing but background got painted, it is rejected. Truncated files are rejected. Wrong dimensions are rejected. The bad file is left on disk so you can look at it.&lt;/p&gt;

&lt;p&gt;Every guard exists because something once succeeded quietly and wrongly. Twenty two invariants in the self test suite keep them honest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Themes are just tokens
&lt;/h2&gt;

&lt;p&gt;Eight themes ship with it. Templates consume tokens only, so one source file renders in any of them. Same markup, one flag:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwo1dmb02g8mjkhr3lvt8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwo1dmb02g8mjkhr3lvt8.png" alt="A deployment blueprint generated with different theme" width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every colour token also ships a component twin, three bare OKLCH numbers, so any transparency of any accent is one expression away:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.badge&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--a1-raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;12%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--a1-raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;45%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--a1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The solid token is built from those same components, so a wash can never drift from the colour it is a wash of. An invariant refuses any theme whose component tokens are not composable, because a broken one paints nothing rather than failing.&lt;/p&gt;

&lt;p&gt;Adding a theme is one CSS file defining the same token set.&lt;/p&gt;

&lt;h2&gt;
  
  
  57 elements you reference, not copy
&lt;/h2&gt;

&lt;p&gt;Figures assemble from a library of parts: browser and phone and terminal frames, databases, servers, queues, routers, a 3D deployment cube, thirty icon glyphs, and the full chart vocabulary. A figure references one instead of carrying a copy of its geometry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;g&lt;/span&gt; &lt;span class="na"&gt;data-part=&lt;/span&gt;&lt;span class="s"&gt;"el-database"&lt;/span&gt; &lt;span class="na"&gt;data-accent=&lt;/span&gt;&lt;span class="s"&gt;"2"&lt;/span&gt; &lt;span class="na"&gt;transform=&lt;/span&gt;&lt;span class="s"&gt;"translate(70,452)"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvd2pekcpbasp92vnilws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvd2pekcpbasp92vnilws.png" alt="The element library rendered in the slate theme" width="800" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are chart and BI parts too, but with an important caveat worth repeating loudly: &lt;strong&gt;these are schematics of charts, not charts.&lt;/strong&gt; Every proportion in them is fixed and arbitrary. They exist so a figure can say "a dashboard goes here" the way a cylinder says "a database goes here". If your numbers are the point, plot them with a real charting library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Animated GIFs, with no ffmpeg
&lt;/h2&gt;

&lt;p&gt;This is my favourite corner of the codebase. Sequence diagrams can animate, one step at a time:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F565zbp3v9k29f0hohgqg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F565zbp3v9k29f0hohgqg.gif" alt="An animated sequence diagram" width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is no ffmpeg, no encoder binary, no dependency. Chrome renders the frames in parallel, Node's built in zlib decodes the PNGs, a median cut quantizer builds a shared palette with ordered dithering, and a hand rolled GIF89a and LZW encoder assembles the result. Frames after the first store only the changed region as transparent pixel deltas, so tween frames cost almost nothing.&lt;/p&gt;

&lt;p&gt;GIF is a 1989 format. It turns out you really do not need a toolchain for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it deliberately does not do
&lt;/h2&gt;

&lt;p&gt;Being clear about the edges is more useful than overselling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It is not a charting library.&lt;/strong&gt; Give it a dataset and it will still draw a schematic. Use a plotting library.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It needs a shell and a local browser.&lt;/strong&gt; That rules out claude.ai chat, the Skills API and most CI images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Theme fonts come from Google Fonts.&lt;/strong&gt; Offline renders still succeed, but they fall back to system fonts and will not match the previews. Inlining the fonts as data URIs is on the list.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Give it a go
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude plugin marketplace add imshaikot/render-visual-skill
claude plugin &lt;span class="nb"&gt;install &lt;/span&gt;render-visual-skill@render-visual-skill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then just ask for a diagram.&lt;/p&gt;

&lt;p&gt;The repo is &lt;a href="https://github.com/imshaikot/render-visual-skill" rel="noopener noreferrer"&gt;imshaikot/render-visual-skill&lt;/a&gt;, MIT licensed. Issues and pull requests welcome, and I am especially interested in new themes, since each one is a single CSS file.&lt;/p&gt;

&lt;p&gt;If you build something with it, I would genuinely like to see it.&lt;/p&gt;

</description>
      <category>agentskills</category>
      <category>claude</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
