Communitygithub.com

zhoushoujianwork/easyeda-agent

嘉立创EDA专业版(EasyEDA Pro)自动化:给 AI harness 装上画板的「手」—— 一套 typed 原理图/PCB 动作,CLI / Agent Skill / stdio MCP 三形态融合接入。承接嘉立创「不以卖板赚钱,以培养中国工程师为己任」 | EasyEDA Pro automation: the hands of your AI harness — typed schematic/PCB actions via CLI, Agent Skill and stdio MCP.

easyeda-agent 是什么?

easyeda-agent is a Claude Code agent skill that 嘉立创EDA专业版(EasyEDA Pro)自动化:给 AI harness 装上画板的「手」—— 一套 typed 原理图/PCB 动作,CLI / Agent Skill / stdio MCP 三形态融合接入。承接嘉立创「不以卖板赚钱,以培养中国工程师为己任」 | EasyEDA Pro automation: the hands of your AI harness — typed schematic/PCB actions via CLI, Agent Skill and stdio MCP.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add zhoushoujianwork/easyeda-agent

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

EasyEDA Agent

Use the local easyeda CLI and daemon to operate EasyEDA Pro through typed, observable actions. This is the community easyeda-agent workflow, not an official EasyEDA skill; the suffix is intentional so users can distinguish it from upstream EasyEDA tooling.

This skill alone is useless — it needs two external components: the local easyeda CLI/daemon + the connector plugin inside EasyEDA Pro. Source code & docs: https://github.com/zhoushoujianwork/easyeda-agent

① Install CLI/daemon (one-liner, auto-detects platform; if already installed, upgrade via easyeda update):

curl -fsSL https://raw.githubusercontent.com/zhoushoujianwork/easyeda-agent/main/install.sh | sh

② Install connector plugin (.eext) — choose one of two options, both require operating within EasyEDA Pro:

  • From JLCPCB's official plugin marketplace (recommended: one-click install, platform automatically updates in place): https://jlc-ext.com/item/zhoushoujian/easyeda-agent-connector ⚠ The marketplace version may lag the CLI by a few minor versions.
  • Directly from GitHub Releases (strictly same version as CLI; use this to align all four components): https://github.com/zhoushoujianwork/easyeda-agent/releases/latest Download easyeda-agent-connector.eext → Import via EasyEDA Extension Manager. For updates with the same uuid, you must first uninstall the old version in "Installed", otherwise the import silently fails; after import, fully exit and restart EasyEDA, otherwise open windows still run old code and conflict with the daemon.

③ Enable permissions: Open your project in EasyEDA → Enable "Allow external interaction". Otherwise, the connector's WebSocket cannot reach the daemon. After installation, verify with easyeda health (you should see window and connectorVersion).

Upgrade: easyeda update (CLI binary + skill directory, sha256 verified, replaced in-place); easyeda update --check only checks without modifying; the connector can only be reinstalled manually → environment-setup.md §0.5.

Optional MCP Entry Point: If the current agent exposes easyeda_* MCP tools, they can be used preferentially for health checks, action discovery, typed calls, blocks, and workflow operations. MCP is just a stdio adaptation layer for the same CLI/daemon; all ironclad rules, inspect-before-mutate, phase gates, and save requirements remain unchanged.

The top of this SKILL.md is a "forget-proof quick-scan" area — before executing any board-level task, scan these screens first; don't rely on memory. Order: ① Ironclad Rules (must not be violated) → ② Flow Stop Points / Gear Defaults / Block Map quick references → ③ Sequential Order Constraints. Specific details are not piled here — read the references on demand according to the What To Read load-trigger table below (progressive disclosure).

① Ironclad Rules (Must Not Be Violated) — Forget-Proof Quick-Scan Area

Scan-and-read hard constraints. In any mode, do not ask the user or negotiate. Violating these means rework or a broken board. Each line has → pointing to detail files.

  1. Before any window operation, run easyeda health — otherwise you could hit the wrong window / no connector; it includes a versionGate determination block; if versions are mismatched, subsequent actions will be immediately rejected (the rejection message includes the fix; knowingly violating: --skip-version-check / EASYEDA_SKIP_VERSION_CHECK=1, writes to the audit log). When hitting a gate, first check versions; don't suspect the circuit or tool are broken. → environment-setup.md §0.5
  2. Only use typed easyeda actions — only use debug.exec_js if there is no corresponding typed action and the user explicitly accepts the debug path.
  3. Inspect before mutating — before placing/moving/connecting/syncing/saving, first read the doc/page/device/pins/board-layer/net/rules; don't modify blindly; for destructive operations (clear/delete/bulk import), first confirm.
  4. No schematic, no placement/routing — if no sheet is found, stop immediately and ask the user to create/approve an A4 (default A4). → design-flow S1
  5. After PCB mutation (rip-up/route/delete/via/track), run easyeda doc reload before reading/judging/DRC — Mechanically enforced: if you don't reload before reading, the daemon rejects with STALE_READ and tells you the next command to run; if you see a sudden surge of Connection Errors for the same net, run pour-rebuild first, they're not real breaks. The normal fix is always doc reload; if you really need to read the stale state, use the escape hatch --force-stale-read "<reason>" (logged in audit, only allowed for PCB reads, does not unlock the routing gate; not --force — that's for routing phase gates). → pcb.md "PCB mutation → doc reload gate"
  6. Judge correctness only by list/check/drc/layout-lint/layout-score, not by screenshots — screenshots can be stale/blank; if data has content but the screenshot is blank = window is not rendered (not in foreground), not a design error. (layout-score is a diagnostic perspective, not a gate — the only gate is layout-lint --gate; and its skipped dimension means "not tested", not "perfect score".) Operations like pcb drc/check that rely on canvas calculation require the PCB to be in the foreground; if they time out, send the request once to the foreground and never retry in a loop (retries are rejected with ACTION_BUSY). Exception for recording/demo mode: screenshots are deliverables → design-flow Recording/Demo mode.
  7. Explicitly save (sch/PCB) after every phase gate — place/wire/modify only changes memory; autosave is only a safety net; save per ~10 components for the whole board. → design-flow S Section 💾
  8. Before manually connecting any known peripheral, first check the block library with easyeda blocks (offline, no daemon/window needed) — use blocks ls to see all available blocks; directly copy verified blocks and only re-bind ports. If not found → draft a block-gap issue; if a block has problems (pin name mismatch, topology error, discontinued) → draft a block-bug issue with evidence — both issues require user confirmation before gh issue create, never auto-report. → ② Block Map Quick Reference · standard-blocks-contributing.md §Seven
  9. Net flags must be connected via actual wires, non-zero distance from pins — overlapping coordinates are not recognized as connections by EasyEDA; zero-length wires are forbidden; if multiple pins share the same name, connect all of them (e.g., multiple GND, AMS1117 dual VOUT). → schematic.md
  10. RF/antenna keepout covers every layer — top+bottom no-copper + inner layers no-inner-electrical; top-only will cause detuning due to bottom layer pour filling in. → pcb.md
  11. Every silkscreen label must fall outside the component body/courtyard and be unobstructed after assembly — terminal plastic covers, connector housings, and button caps will obscure silkscreen inside the footprint, making it as good as missing. → design-flow P9
  12. Do not use eda.sch_Netlist.getNetlist() (deprecated, hangs on floating pins) — use sch read/check/netlist/export for netlists; as a last resort, use getNetlistFile() to read File.text(). → schematic.md / actions.md
  13. Electrical clearance ≠ hand-solder accessibility — at P2, first persist the assembly profile: pcb stage set-assembly --profile hand-solder (default/floor 40mil; soldering iron channel for large pads 60mil); layout-lint --gate fails on any tight pair, and also fails if any component is surrounded on all four sides with no side having at least 60mil of soldering iron channel (no-access); do not confirm layout before passing this gate. → design-flow P2/P6 · issue #99
  14. Phase gates are mechanically enforced; no need to pre-read the details — there is one gate each before and after routing; if you haven't passed them, both are rejected (the daemon also blocks at the /action level, raw calls cannot bypass). The rejection message includes the next command to run; just follow it. To resume a session: workflow status --reconcile → workflow advance. → design-flow P6 (including force levels #132)/P10
  15. Schematic must be partitioned into pages with per-module circuit descriptions; this is required by default ("minimal/single page" is not an excuse) — ① Paginate (page name = function name) ② sch zones set + zone-draw to draw zone boxes (also required for single-page small boards) ③ Add 1~3 lines of sch note per module. ⚠ Manual block-apply / sch place do not automatically draw boxes; you must supplement ②③. Mechanical safety net: sch check's missing-partition + sch gate --strict will block this. → design-flow S1–S3
  16. "Spilling off the page" ≠ "Bigger than the page" — the former can be fixed by nudging; the latter (page-too-small) cannot be fixed by nudging, requires a different approach, and pagination is a design decision → stop and ask the user (the tool does not auto-paginate). Do not manually retry: --max-attempts (default 3) will stop you. → design-flow S3
  17. S0 before any placement — the spec must be on disk and pass easyeda spec validate --strict before the first page-new / place / block-apply; adding it later counts only as a record, not proof that design decisions were frozen. → design-flow S0

② Flow Stop Points + Gear Defaults + Block Map Quick Reference

Before executing, first locate which stage you are in, whether this step is a stop point, which gear to use, and whether to check the block library at this stage. For the full flow S0–S6 / P0–P10, see references/design-flow.md; for non-trivial boards (>~10 components or requiring delivery/PCB layout), always use its gated flow. Here is the top-level quick reference for scanning during execution.

When to Stop and Hand Back to the User (Milestone Gear = Real User Default)

Stop PointTriggerKey Points
① S0 SpecificationBefore entering S1For each dimension (architecture, stackup, ground strategy, interface orientation), present options + pitfalls + recommendations for user sign-off; must be on disk as a file to pass the gate; cannot remain in the conversation
② Before sch→PCBSchematic completePer page: easyeda sch gate --strict --doc <page> outputs verdict=pass (one command runs layout-lint→check→bridge-check→drc in sequence; order and blocking criteria are hardcoded, don't assemble yourself) + pin→net golden table alignment (the gate can't judge "is it connected correctly?", only "is it connected legally?"); verdict=blocked means the checker didn't run, not that the board has a problem — first fix health/doc then re-run, don't modify the circuit; DRC aggregated WARNs must be reviewed and reported; multi-page/multi-module boards also require confirming that zone boxes + zone name labels are drawn (sch zones status to see assignments, sch zone-draw to draw missing ones — manual placement won't auto-draw like autolayout --apply, easy to forget) + per-module circuit descriptions placed (sch note to place, sch text-list to verify — zone boxes only name, descriptions make it readable) → design-flow S5
③ Before board fab/deliveryExport for manufacturingDelivery summary must describe deviations (downgrade decisions, remaining WARNs)
S2/S3 page-too-smallBlock/group larger than entire page's usable areaTool stops, doesn't create pages: present to user for decision ① separate page ② continue pagination ③ shrink component labels to fit (A4-only, no paper change) → design-flow S3
P2 Before placementLayout startFirst ask single- or double-sided + soldering process; immediately persist with pcb stage set-assembly; hand-solder default min-gap=40mil / large pad channel 60mil
P2 Edge interface componentsConnectors/USB/SD/Headers/Buttons/IPEXOrientation + edge order = assembly experience; agent can't guess, must confirm with user; first blocks show to read block placement, present to user
P2 Tier state commitAfter confirming each tierpcb stage confirm-tier <1-4> --parts … persists each tier (#125 mechanized): tier1 holes → tier2 edge components → tier3 main chip + RF → tier4 satellite (default = rest); skipping a tier is rejected; modifying components in a tier only invalidates that tier and those after; without all four tiers, confirm-layout refuses to seal the stage
P7 Dense board routingSee gear below + P7 mini-checklistStop and ask the user to click "Route → Auto Route" in EasyEDA menu; before handing over, you must do the two steps below (P7 mini-checklist), then take over again
Destructive operations / Gate failureclear/delete/bulk; pcb new-board --force (replaces schematic on bound board = loses old board schematic); layout-lint ERROR / DRC fatalStop at failing data, don't continue with the defect

Milestone gear only stops at these points, not at every step (progressive gear stops at every step). Fully automatic mode only for regression/CI/operator/recording.

Gear Defaults (Don't Change Without Reason)

DimensionDefaultNotes
Interaction ModemilestoneNot progressive, not fully automatic
Routing GearChoose based on layout-lint ratsnest densitySparse (<100 crossings) → route-short; Dense → ask user to click native auto-route (default); only in fully headless mode use Freerouting (pcb autoroute, safety net, does not replace default). Before handing over, run ↓P7 mini-checklist
Placement PriorityHoles → Edge components → Main chip + RF → Satellite componentsOnly satellite components get auto-place; holes are placed and locked first
Sheet / Board ShapeA4 / compactcompact when no dimensions known; when in compact mode, seed main chip at compact grid spacing (module center distance ≈ envelope + 300~400 mil, don't scatter 2000 mil away); rely only on pcb list --include-bbox measured bbox (includes courtyard, often 40%+ larger than nominal) for placement/dimension judgments → design-flow P1/P2
Schematic OrganizationPaginate + zone boxes + descriptions, see ironclad rule 15Pagination = one page per functional domain (power/main/interface…); cross-page net_port with same name = same net; autolayout --apply draws boxes automatically; descriptions specify function + key parameters ("LDO: 5V→3V3 1A" "BOOT: GPIO0 low to enter programming"), placed under/near the module box without covering the circuit → design-flow S1–S3 · schematic-layout-conventions.md
GND Inner Layerpower-planes --gnd-plane → final state PLANEPour SIGNAL → convert to PLANE → rebuild; don't stay on SIGNAL
pour-fit --replacetrue (will clear same-net pours on other layers)Top/bottom GND pours must explicitly use --replace=false
Trace Width Gear (net-class)By role: signal = live default / branch (3V3/1V8) = 10mil / trunk (+5V) = 15mil / high-current (VBUS/VIN) = 20milUse pcb net-classes to check current table; route-short automatically assigns width by role; power traces too thin will be caught by pcb check width-under-spec (§7.8)
Power Routing via Copper2‑layer → power-pour / 4‑layer → power-planesRoute power via copper planes, not thin traces (#1 DRC source); don't run thin traces through pad arrays for power; bare power nets without copper will be caught by pcb check power-not-poured
Layout Quality GearGate = layout-lint --gate (only); quality table = pcb layout-score --spec <s0> (diagnostic, not confirmation)Only one gate, don't create two. layout-score has 9 dimensions, each 0-100+, with per-device attribution; default --min-score not set (only non-zero exit for blocking issues like shorts/overlaps/out-of-board); to use as a gate, provide it explicitly (suggested 75 = good floor). With --spec, flow-order and internal connector dimensions are unlocked; otherwise these two dimensions are skipped ("not tested" ≠ "perfect score") → design-flow P6. For schematic, corresponding sch layout-score (5 dimensions: label folding, label reverse, peripheral-touching-core, long-chain crowding, page cleanliness) — also diagnostic only, each attribution line includes a fix command with real location coordinates; copy and execute to fix; the gate remains sch layout-lint + sch check

P7 Two Steps Before Handing Over to Auto-Route (Often Forgotten, Confirmed by Field Experience)

Before stopping at a dense board and handing over for the user to click native auto-route, if you don't do these two steps, handing over means critical nets will be overwritten by the router or handed over tasks it's not good at:

  1. Pre-route and lock critical nets — One command: pcb route-critical (#127: power → planes/pour per layer count; differential pairs → dual-source identification + paired routing + skew measurement → auto track-lock); manually, same as old method (pcb fill/power-planes/pcb track-lock). Lock them (otherwise the auto-router / pour-rebuild will overwrite the hand-routed critical traces).
  2. When stopping, always recite the 4 items of the "Auto-Route Dialog" (missing one will ruin step 1): ① "Existing traces / vias" choose Keep, never "Remove" ② "Routing layers" only check Top + Bottom, uncheck inner layers 1/2 ③ "Ignore nets" add power nets already in planes (GND, 3V3/VDD) ④ Everything else default. → Details design-flow P7.0 + Auto-route dialog checklist

Block Map Quick Reference (Blocks Carry Multi-Dimensional Knowledge; Read the Corresponding Map per Stage)

When a block is hit, read the corresponding map from the block at each stage; always start with easyeda blocks show <id> to read the corresponding map:

StageRead Block's MapContent
S0 / S3internal_nets · ports · partsCopy topology verbatim (use functional pin names with zero renumbers) / re-bind boundary nets / avoid part selection (parts points back to standard-parts)
P2placementBoard edge / orientation (edge/side/orientation, must confirm with user)
P2 / P8pcb_layout (*-adjacency / ep-*)Decoupling caps · crystal placement distance (P2) / EP thermal vias · ground stitching (P8)
P4pcb_layout (rf-keepout / balun-mirror)RF keepout / balun mirror (severity=must)
P7.0signalsDifferential pairs / impedance (impedance_ohm + impedance_kind) / length matching (length_match_mm)
P9silkPer-pin labeling (pins/label/note)

Search strategy: blocks search matches id/desc/category/port/part — search by function (rs485/buck/gnss), chip (ch340/cc1101), port/net (5V/USB_DP); rotate through the three dimensions if one fails; or blocks ls --category <power|usb|usb-serial|rf|comms|storage|sensing|mcu|mcu-support|indicator|button|audio|display> to browse the whole category (categories are determined by the actual output of blocks ls, don't rely on this list being up-to-date).

③ Sequential Order Constraints (Reversing Them Guarantees Rework)

Each line has → design-flow anchor; these are hard constraints at the same level as ironclad rules, scattered deep in the docs and easy to miss; summarized here:

  1. Do not route before passing the assembly + routability gate (hand-solder profile must be persisted; layout-lint --gate must have 0 tight) → design-flow P2/P6
  2. P6 routability gate is before P7 routing (≥ target score, 0 overlap, ratsnest controllable) → design-flow P6
  3. P7.0 power / differential pairs must be routed first and track-locked, then hand over to auto-route (see P7 mini-checklist above) → design-flow P7.0
  4. Keepouts / silkscreen (P4/P5) must be before routing P7 (adding them after routing forces rework and rerouting) → design-flow P4/P5
  5. Changing layer count / outline-fit must be before pouring copper and routing → design-flow P8
  6. PLANE: pour SIGNAL first, then convert to PLANE; after converting to PLANE, vias with different nets are forbidden (official bug #32 doesn't dig anti-pad, pour-rebuild doesn't fix; to change layers, delete vias and route on outer layers; pcb check via-crosses-plane will flag them) → design-flow P8
  7. After routing, you MUST pass the post-route check gate before silkscreen/delivery (workflow advance runs pcb check; all ERROR/power-not-poured/width-under-spec must be cleared; leaving WARNs unaddressed once caused a 5V thin trace violation to slip through to manual review) → Ironclad rule 14

What To Read (Load-Trigger Index — Load More)

Read the corresponding reference on-demand based on the scene/stage you're at (progressive disclosure); don't preload everything:

  • health shows windows: [] / NO_CONNECTOR, or you changed the connector (extension/), or versions are misaligned (connectorVersionOk:false, UNKNOWN_ACTION, user asks "how to upgrade"): read references/environment-setup.md (§0.5 — use easyeda update --check to see all three versions: CLI/skill/connector in one view). On the web editor (pro.lceda.cn) + chrome-devtools MCP, the agent can bootstrap the full environment; the desktop client's chrome-devtools cannot reach the window, so the user must manually open/switch the project (the connector still attaches, typed actions still work).
  • Full board / from scratch / >~10 components, or you're unsure what stage you're at: first read references/design-flow.md (flow spine S0–S6 / P0–P10, with stage TOC at top). Includes pre-analysis steps for S0 in references/design-pre-analysis.md (lightweight, optional, not a gate). After writing the S0 spec, always run easyeda spec validate (no ERROR means passing the gate; --strict for pre-delivery) — field shapes (including flow/modules[].kind/interfaces[].ref·edge·facing·internal) are in design-flow S0.
  • Routing stage (P7) gear selection / pre-routing critical nets / auto-route dialog checklist: read references/design-flow.md P7 three-tier steps — don't stop at pcb.md's command manual (it only gives commands; routing gear defaults are in design-flow).
  • Architecture trade-off pitfalls (real choices, not single answers — stackup, ground strategy, interface orientation, cost tier, single/double-sided, soldering process): read references/design-decisions.md; from it, produce a specification at S0 for user sign-off. (RF/antenna keepout is a guardrail ironclad rule 10, not in this decision table.)
  • Schematic work: read references/schematic.md.
  • Cleaning up messy/already-connected schematic pages, high-quality multi-page layout, functional frames and text annotations: simultaneously read references/design-flow.md's S1–S6, references/auto-layout-sop.md's "Safe cleanup of already-connected pages", and references/schematic.md's "Functional frames + text labels". First save the pin→net/NC golden table; any layout restructuring must be cross-checked page by page.
  • PCB work: read references/pcb.md (top has "Block PCB constraints (check first)" + command index).
  • Check any typed action signature, or >5-step batch operations using playbook (easyeda apply): read references/actions.md.
  • DRC / Manufacturing rule floor and fallback: read references/fab-rules-jlcpcb.json (live pcb.drc.rules takes priority; this table serves as fallback seed and clamps floors, never emits track/via/gap below manufacturingMin).
  • PCB design rule handbook (human-readable original): references/pcb-design-rules.md — trace width tiers/vias/layout/routing/copper/mark points/panelization/silkscreen/stackup/DRC three-level checklist; error messages from pcb check that include [Rule §N] refer to this handbook chapter; fix accordingly.
  • New/uncertain raw eda.* API: first easyeda api search/show, then check the official prodocs reference page (if method is @alpha/@beta/@deprecated or has a known upstream issue), record caveats in references, then solidify into workflow.
  • Schematic layout rules: read references/schematic-layout-conventions.md.
  • PCB placement/routing rules: read references/pcb-layout-conventions.md.
  • CLI placement/routing hard pitfalls + auto-layout/autoconnect SOP: read references/auto-layout-sop.md.
  • Component selection, JLC/LCSC ranking and standardization: read references/part-selection.md (before selecting, check the block library first; block parts already fixes standard peripheral selections) + references/standard-parts.json. To change the model of a placed component: use easyeda sch replace --id <pid> --lcsc <C number> (if pinDiff is non-empty, rewire).
  • Circuit block library: easyeda blocks ls/show/search (offline, see ironclad rule 8 + block map quick reference); to contribute a new block, see references/standard-blocks-contributing.md (verified peripherals are merged back into the library, with attribution + validated gate).
  • Netflag/netport rotation truth table: use references/orientation.json; never hand-edit derived rotation tables.
  • Sheet/title block geometry conventions: read references/sheet-templates.json.

Bundled Scripts

Scripts live in scripts/ and are intended to be run directly when useful:

  • scripts/lint.sh <project>: live schematic lint with optional diff baseline.
  • scripts/tests/run.py: linter rule-trust harness; run after changes to orientation.json, linter rules, fixtures, or connector orientation facts.
  • scripts/bom-enrich.py <bom.tsv/csv>: fill EasyEDA BOM Supplier Part values from standard-parts.json.
  • scripts/parts-add.py: append resolved library parts into standard-parts.json.
  • scripts/parts-select.py: deterministic part-selection helper.
  • scripts/calibrate.js: live bbox calibration for netflag/netport orientation after importing a new connector build.

(For browsing/finding the circuit block library, it's done via the offline CLI easyeda blocks, not scripts/; block validation is Go tests go test ./internal/blocks/, run with make test/CI.)

Deliverables

Summarize changed primitives, commands run, DRC/check/lint status, saved checkpoints, and artifact paths. If a gate cannot pass, stop at the failing data, explain the next repair step, and do not claim the design is complete. In recording/demo mode, additionally list each stage screenshot and label it as native EasyEDA screenshot or data-rendered image, explicitly reporting any stale/replaced frames.

PCB delivery summary must additionally report layout quality (#167) — reporting only a composite score is like nothing.

相关技能