Draw Schematic logo

Draw Schematic

Community
Zane456
draw-schematic

KiCad schematic generation pipeline expert (Phase 3). ALWAYS invoke this skill when generating or regenerating .kicad_sch from a frozen BOM + topology, or rendering schematic PDF (画原理图 / 重新生成 sch / 生成 PDF / regenerate after BOM change). Do not write .kicad_sch by string concatenation, skip the .bom_readiness.json sentinel gate, or hand-add PWR_FLAG. Use this skill first. Owns generation only; deep review (sch analyzer / SPICE / datasheet cross-ref) belongs to check-schematic.

Overview

PublisherZane456
RepositoryPCB-Agent-Teams
Skill namedraw-schematic
Stars
79
Forks
20
Bundled files
17
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 17 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Zane456 on GitHub. Read the source before you install it.

Installation

Install the Draw Schematic AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Zane456/PCB-Agent-Teams/tree/main/.claude/skills/draw-schematic
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Zane456/PCB-Agent-Teams.git /tmp/PCB-Agent-Teams
mkdir -p .claude/skills
cp -r /tmp/PCB-Agent-Teams/.claude/skills/draw-schematic .claude/skills/draw-schematic
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Draw Schematic in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Draw Schematic on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Draw Schematic is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Draw Schematic — KiCad 原理图生成 pipeline

"BOM + 拓扑 → circuit-synth .py → .kicad_sch + PDF + ERC clean" 自动化流水线。 只生成;深度审图归 check-schematic。

前置依赖:component-preparing 的 BOM sentinel

pipeline.py Phase 0 检 <project>/datasheets/.bom_readiness.json(由 component-preparing 写):

  • 不存在 / mtime 不对 / all_pass=false → fail-fast,回 component-preparing
  • 通过 → 继续

理由:library/stock/datasheet 是选品阶段的事;画到一半发现 footprint 没了等于全返工。

何时用 / 不用

用不用
BOM + 拓扑已冻结,要生成 schBOM 没冻结 → circuit-design
改了 BOM/拓扑要重生审图 / SPICE / rule-id triage → check-schematic
验证生成的 sch 跟项目 CLAUDE.md 一致选元件 / 查库存 → component-selecting-JP
画图前 BOM gate → component-preparing
PCB 阶段 → draw-pcb / release(出货 umbrella)

边界:generation-time correctness vs design review

项归属理由
L1 ERC total_errors == 0本 skill结构错的 sch 不可用
L2 PDF + 视觉本 skill确认生成没崩
L3 拓扑 vs CLAUDE.md本 skill"画的是不是用户要的"
L4 footprint 全可用本 skillPCB 阶段 "Footprint not found" 必须早堵
sch analyzer 深度 / rule_id / findings[]check-schematicreview 不是生成对错
SPICE 子电路仿真check-schematic数值验证
Datasheet pin-level 交叉验证check-schematic设计层

设计原则:硬编码优先

LLM 不稳定。所有 critical 步骤(pipeline 顺序 / ERC 阈值 / 坐标变换 / Y 轴翻转)写死在脚本,LLM 只调脚本不做决策。90% 任务 = python pipeline.py <project.py>。

死规定:passive value 填电学量不填 MPN

R/C/L/LED/通用 D/J/SW 的 Component(value=...) 必须是电学量或角色名(1M、100nF、LED_GREEN、HV_INPUT),不许是 distributor SKU。U/复杂 D 允许 MPN。理由:板上 silk 印 1M 焊接时一眼能认,印 TNPW12061M00BEEA 没人认得。详细表 + Pipeline gate 正则 → references/passive_value_rule.md(draw-pcb silk audit 共用)。

工作流

一键(推荐)

bash
# 跑前先 cd 到 KICAD 工作区根(或 export KICAD_ROOT=...)
"$KICAD_ROOT/.venv/bin/python" \
  ".claude/skills/draw-schematic/scripts/pipeline.py" \
  /path/to/project.py

输出 JSON dict(ok、sch_path、pdf_path、l1_total_errors、lib_id_count 等)。Claude 读 dict 判成败。

阶段总览(分步排查用)

0. BOM sentinel check    → 不过 fail-fast
1. 读 CLAUDE.md 提 BOM + 拓扑
2. 元件库对齐(消费 sentinel + lib_external)
3. 写/改 <project>.py(circuit-synth DSL)
4. pipeline.py(generate → fix_labels → add_hier_labels → ERC → PDF → L3)
5. Claude Read PDF 做 L2 视觉 + L3 拓扑
   ↓ 生成成功后
6. 切给 check-schematic(深度 review + SPICE)

默认单图(一个 @circuit 里写所有元件)。fix_labels.py 用 kicad-sch-api 精确 pin 坐标重写 label,已能压住上游 bug #2 的 label collision,元件数量不再是 拆图门槛。检查工具(analyzer / detect_rc_filters / SPICE)也都是为单图优化的—— hierarchical 模式下 net 会被分片成 name 与 /uuid/name 两份,detector 失效。

仅在以下情况 才考虑拆 hierarchical(每片 ≤15 元件):

  • 单图 ≥38 元件且实测 net 错合并(fix_labels 仍漏修)
  • 业务上需要做 IP 复用 / 子板分文件交付

pipeline 两种模式都支持(自动跑 fix_labels;hierarchical 时自动补 hier_label)。 详细 Bug 历史 → references/known-bugs.md #2/#3/#6。

每个 Stage 详细(写 .py 模式、ERC JSON 解析、L1–L4 验证脚本、L4-bis/tris 路径、PWR_FLAG 自动注入)→ references/pipeline_stages.md。

环境检查(KiCad CLI / venv / 工具栈版本)→ references/preflight.md(pipeline.py 内部已 fail-fast)。

脚本清单(scripts/ 下)

pipeline.py(一键)/ verify_footprints.py(L4 + fuzzy 自动修)/ fix_labels.py(修 pin label + 删 power 符号 + auto-NC 未映射 pin)/ add_hier_labels.py(hierarchical 跨表连通修复)/ add_pwr_flags.py(自动加 PWR_FLAG)/ verify_topology.py(L3 比对)。每个 --help 看用法。

输出格式

完成后给用户的报告模板(L1/L2/L3 状态行 + 下一步建议 + 禁止报告事项)→ references/output_template.md。

references / examples

  • references/passive_value_rule.md — value 字段死规定(draw-pcb 共用)
  • references/pipeline_stages.md — Stage 1–5 + L4-bis/tris 详细
  • references/preflight.md — KiCad CLI / venv / 工具栈
  • references/output_template.md — 完成后给用户的报告格式
  • references/known-bugs.md — circuit-synth + easyeda2kicad bug + workaround

触发关键词

中:画原理图 / 生成 sch / 重新生成 / 改 BOM 重画 / 看 PDF / 验证连接 EN: draw schematic, regenerate after BOM change, render PDF, run schematic pipeline

红线

  • ❌ 只看 ERC 数字不看 PDF 就报完成
  • ❌ 工具回 success: true 直接相信
  • ❌ 只 grep 一种 ERC 错误(必须 total_errors == 0)
  • ❌ 自己手动加 PWR_FLAG(pipeline 自动跑)
  • ❌ LLM 凭记忆猜 MPN / 不查就改 .py value
  • ❌ 字符串拼接 .kicad_sch(用 circuit-synth + ksa)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Draw Schematic AI skill do?

KiCad schematic generation pipeline expert (Phase 3). ALWAYS invoke this skill when generating or regenerating .kicad_sch from a frozen BOM + topology, or rendering schematic PDF (画原理图 / 重新生成 sch / 生成 PDF / regenerate after BOM change). Do not write .kicad_sch by string concatenation, skip the .bom_readiness.json sentinel gate, or hand-add PWR_FLAG. Use this skill first. Owns generation only; deep review (sch analyzer / SPICE / datasheet cross-ref) belongs to check-schematic.

Why use Draw Schematic on TypingMind?

Because you install it once and use it with any model. Draw Schematic is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Draw Schematic in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zane456/PCB-Agent-Teams/tree/main/.claude/skills/draw-schematic. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Draw Schematic?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Draw Schematic?

As many as you like. As long as a model supports skills, you can use Draw Schematic with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Draw Schematic AI skill free?

It is published on GitHub by Zane456. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇