chip-png-d2-gen

chip-png-d2-gen is a skill for Claude Code from zhaixin244-wq/fnw. It costs 78 tokens per session (1,768 once invoked), scanned A, original, MIT.

A diagram generator for chip designs that turns D2 text files into PNG images. It supports architecture, data-flow, and state-machine diagrams, using D2’s dagre layout.

In plain words
What is it for?
Use it to create architecture block diagrams, data-flow diagrams, and finite-state-machine diagrams for hardware projects.
Why use it?
It removes the manual work of drawing chip-module connections and exporting them as images. The source stays as editable text while the result can be placed in documentation.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .claude/skills/chip-png-wavedrom-gen/gen_wavedrom.js <output_dir>.

Good fit Use it to create architecture block diagrams, data-flow diagrams, and finite-state-machine diagrams for hardware projects.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/zhaixin244-wq/fnw
agentmods
npx agentmods add skills/zhaixin244-wq/fnw/chip-png-d2-gen

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chip-png-d2-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhaixin244-wq/fnw/chip-png-d2-gen/github.svg)](https://agentmods.dev/skills/zhaixin244-wq/fnw/chip-png-d2-gen)
Your own site
<a href="https://agentmods.dev/skills/zhaixin244-wq/fnw/chip-png-d2-gen"><img src="https://agentmods.dev/badge/skills/zhaixin244-wq/fnw/chip-png-d2-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chip-png-d2-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhaixin244-wq/fnw/chip-png-d2-gen"><img src="https://agentmods.dev/badge/skills/zhaixin244-wq/fnw/chip-png-d2-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,768 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.01768
Opus 5 $0.00039 $0.00884
Sonnet 5 $0.00016 $0.00354
Haiku 4.5 $0.00008 $0.00177

Measured 13d ago against content hash a0137e2e4ba7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

chip-png-d2-gen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/chip-png-d2-gen/SKILL.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Chip PNG D2 Generator

任务

为芯片模块生成 D2 格式的架构框图、流程图、状态机图,通过 d2 CLI 编译为 PNG。

依赖

  • D2 CLI:独立二进制,见 requirements.txt
  • D2 语言规范:https://d2lang.com
  • 工具路径查找:优先 <project_root>/.claude/tools/d2/d2.exe,其次系统 PATH

执行步骤

  1. 编写 D2 源文件:将 .d2 文件写入项目输出目录,命名规则:

    • 架构/框图:{module}_arch.d2wd_{name}.d2
    • 流程图:wd_{name}_flow.d2
    • 状态机:wd_{name}_fsm.d2
  2. 生成 PNG

    # 单文件:d2 CLI 直接编译(工具路径查找:.claude/tools/d2/d2.exe → 系统 PATH)
    d2 --layout dagre <output_dir>/input.d2 <output_dir>/output.png
    
    # 批量(通过 wavedrom skill 的 gen_wavedrom.js,处理所有 wd_*.d2 + wd_*.json)
    node .claude/skills/chip-png-wavedrom-gen/gen_wavedrom.js <output_dir>
    

    <output_dir> 为项目中存放图表源文件和输出 PNG 的目录。

  3. 在文档中引用

    ![描述](filename.png)
    

D2 编写规范

架构框图模板

direction: right

# 外部端口(左=输入,右=输出)
ext_in: "上游输入" {
  style.fill: "#E8F8F5"
  style.stroke: "#27AE60"
  style.stroke-width: 2
}

ext_out: "下游输出" {
  style.fill: "#FDEDEC"
  style.stroke: "#27AE60"
  style.stroke-width: 2
}

# 功能模块
module_a: "模块A" {
  style.fill: "#EBF5FB"
  style.stroke: "#5B9BD5"
  sub_block: "子功能" {shape: cylinder}
}

# 数据通路连线
ext_in -> module_a: "数据流" {style.stroke: "#2E75B6"; style.stroke-width: 2}
module_a -> ext_out {style.stroke: "#2E75B6"; style.stroke-width: 2}

# 配置连线(虚线)
config -> module_a: "配置" {style.stroke: "#8E44AD"; style.stroke-dash: 3}

流程图模板

direction: right

step1: "步骤1" {
  style.fill: "#EBF5FB"
  style.stroke: "#5B9BD5"
}

step2: "步骤2" {
  style.fill: "#E8F5E9"
  style.stroke: "#27AE60"
}

decision: "条件?" {
  shape: diamond
  style.fill: "#FFEBEE"
  style.stroke: "#C0392B"
}

step1 -> step2 -> decision
decision -> step3: "yes"

状态机模板

direction: right

idle: "IDLE" {
  style.fill: "#E8F5E9"
  style.stroke: "#27AE60"
}

busy: "BUSY" {
  style.fill: "#FFF3E0"
  style.stroke: "#E67E22"
}

error: "ERROR" {
  style.fill: "#FFEBEE"
  style.stroke: "#C0392B"
}

idle -> busy: "start && !err"
busy -> idle: "done"
busy -> error: "err"
error -> idle: "rst"

Read the full file on GitHub · 186 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 186 lines · 78 tokens per session scan A a0137e2e4ba7

Subscribe to this mod's changes

chip-png-d2-gen is a skill published in the GitHub repository zhaixin244-wq/fnw (29 stars, last pushed 3mo ago), licensed MIT. It adds 78 tokens to every session and 1,768 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

visual-ralph

Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ultragoal with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.

Yeachan-Heo/oh-my-codex · 52 tokens

accessibility

Consolidated accessibility skill entrypoint for WCAG 2.2, ARIA Authoring Practices, cognitive accessibility, Section 508, EN 301 549, design intent verification, and the Accessibility Planner workflow.

microsoft/hve-core · 47 tokens

make-resume

A Chinese-language tool for creating editable HTML resumes that can be changed in a browser and printed to PDF. It uses available resume templates when they are installed and otherwise provides a simpler fallback.

Hisn00w/ASu-skills · 86 tokens