agentleFS
Novin3dpNovin3dp/claude-KiCad-pcb-designer-skill/toolkit/AGENTS.md

claude-KiCad-pcb-designer-skill / toolkit

AGENTS.md4 starsChanged 57 days agoMITView on GitHub

Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board. Work in stages, write a new file at every stage, and report each stage to the user. Never present a partial board as final. 1. Schematic. Generate it from Python (schematic/, see examples/demo_sch/make_sch.py) or take the user's. Loop kicad-cli sch erc until 0, then kicad-cli sch export netlist and python3 schematic/netcheck.py. 2. Placement with the pcbnew API: - Place outline and holes first, then…

  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board.

    line 3
  2. Very specific:

    Check python3 -c "import pcbnew.

    line 8
  3. Very specific:

    Run pip install -r requirements.txt (add --break-system-packages on a managed Python), then make.

    line 9
  4. Very specific:

    Run examples/demo/run_demo.sh and tests/smoke.sh.

    line 10
  5. Distinctive:

    Place outline and holes first, then keepouts for escape corridors, then parts block by block.

    line 17
  6. Distinctive:

    Check courtyards with DRC.

    line 20
  7. Very specific:

    Read failed and dropped at the end of the log.

    line 29
  8. Distinctive:

    Check every footprint pad has the intended net (pads with none = symbol/footprint mismatch).

    line 47
  9. Distinctive:

    Check SoC power and special pins against the vendor reference schematic.

    line 48
  10. Distinctive:

    Check connector orientation (look at the Fab layer and the bottom render).

    line 49
  11. Distinctive:

    Check power-path widths, buck input-cap distance, exposed-pad vias, and part voltage ratings against the input range.

    line 50
  12. Distinctive:

    Verify each review finding yourself before changing anything.

    line 52
  13. Very specific:

    Never trust zone results in DRC without a refill.

    line 63
  14. Very specific:

    Do not compare pcbnew objects with is / in.

    line 64
  15. Very specific:

    Look at the board, not only at numbers: layerplot.py / netplot.py PNGs of the region you change.

    line 67
  16. Distinctive:

    When a change cannot be undone or alters the architecture, ask the user first.

    line 68
  17. Very specific:

    Use oracle.py / gate.py to compare connectivity between stages.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Instructions for AI agents using this toolkit

Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board. Work in stages, write a new file at every stage, and report each stage to the user. Never present a partial board as final.

Setup (once)

  1. Check python3 -c "import pcbnew; print(pcbnew.Version())" and kicad-cli --version.
  2. Run pip install -r requirements.txt (add --break-system-packages on a managed Python), then make.
  3. Run examples/demo/run_demo.sh and tests/smoke.sh. Both must succeed before you touch the user's board.

Pipeline

  1. Schematic. Generate it from Python (schematic/, see examples/demo_sch/make_sch.py) or take the user's. Loop kicad-cli sch erc until 0, then kicad-cli sch export netlist and python3 schematic/netcheck.py.
  2. Placement with the pcbnew API:
    • Place outline and holes first, then keepouts for escape corridors, then parts block by block.
    • Each buck goes as a unit: input cap within 1 mm of VIN/GND, SW pin facing the inductor.
    • Point edge connectors' mating side out of the board.
    • Check courtyards with DRC.
  3. Fan-out and planes.
    • BGA dog-bone vias and plane zones.
    • plane_via.py for pads of plane nets.
    • Lock fan-outs (SetLocked(True)).
  4. Route. Copy kat/cfg_template.py to cfg_<board>.py and set layers, clearances (match the .kicad_dru), widths, pairs and plane nets.
    • Run ncroute.py cfg IN OUT.
    • Route in stages with NETRX (memory, then pairs, then the rest).
    • Read failed and dropped at the end of the log.
  5. Repair loop. drc.sh OUT, then fix in this order: shorts > clearance > unconnected > items_not_allowed > dangling.
    • Local problem: delete that copper and re-run ncroute.py with NETRX on those nets. It only adds missing links.
    • Single connection in a dense spot: use astar1.py. If it finds no path, open a channel with movevia.py or move a part with place_free.py.
    • Lost BGA escape: use restore_net.py from an earlier board.
    • Stranded plane island: use cluster_link.py.
    • Dangling copper: use dangle2.py with the DRC JSON, 2-3 rounds.
  6. Length and skew. pair_skew.py for HDMI / USB / Ethernet. For DDR: ddr_rubber.py, then ddr_tune.py, then ddrsum.py, after adapting ddr_profile.py. Report residual mismatch in mm and ps (~6-7 ps/mm).
  7. Finish.
    • gnd_pour.py for outer GND pours and stitching.
    • silk_refs.py for references.
    • copy_fields.py after adding MPN / LCSC fields.
    • drc.sh OUT dir --parity until 0 errors, 0 unconnected, parity 0.
  8. Review before calling it done. Clean DRC is not enough.
    • Check every footprint pad has the intended net (pads with none = symbol/footprint mismatch).
    • Check SoC power and special pins against the vendor reference schematic.
    • Check connector orientation (look at the Fab layer and the bottom render).
    • Check power-path widths, buck input-cap distance, exposed-pad vias, and part voltage ratings against the input range.
    • Verify each review finding yourself before changing anything.
  9. Hand-off.
    • make_viewer.py gives the user an interactive page per stage.
    • Release Gerber X2 / Excellon / positions / BOM with kicad-cli, with the project's .kicad_pro, .kicad_dru and schematic in one folder.
    • examples/h3_sbc/release_v5.sh shows a complete release script.

Rules

  • Copy the board's .kicad_pro and .kicad_dru next to every intermediate .kicad_pcb (same base name) before loading, filling zones or running DRC.
  • Never trust zone results in DRC without a refill. drc.sh refills a copy.
  • Do not compare pcbnew objects with is / in. Collect, then remove at the end. Use separate processes for edit and analysis.
  • Long jobs: setsid nohup bash job.sh & plus a .done marker. Never kill ncroute.py mid-run.
  • Look at the board, not only at numbers: layerplot.py / netplot.py PNGs of the region you change.
  • When a change cannot be undone or alters the architecture, ask the user first.

v4.4 tools and guardrails

  • Plane-layer escalation is a last resort: normal routing layers first, then only remaining open signal nets. Preserve inherited keep-outs, shield high-speed reference copper, bridge every slot crossing, refill, and inspect esc_layer.py report.
  • ncroute_msla.py push-and-shove is transactional and expensive. Enable it late, bound its depth/budget, and accept only a net improvement in conflict score followed by DRC and connectivity checks.
  • cluster_place.py moves connected signal groups; always inspect its JSON/NETRX outputs, check decoupling and mechanical constraints, and reroute affected copper. Avoid using it around dense ICs/buses where it cannot create usable space.
  • Use oracle.py / gate.py to compare connectivity between stages. Never promote a stage that loses a net or increases open links.
  • For 2-layer boards, keep the v3 GND-as-tracks rule; the 4-layer plane-layer escalation workflow is not a substitute for a properly connected return path.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.