kcaa 0.2.8__tar.gz → 0.2.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. {kcaa-0.2.8 → kcaa-0.2.10}/PKG-INFO +56 -13
  2. {kcaa-0.2.8 → kcaa-0.2.10}/README.md +55 -12
  3. {kcaa-0.2.8 → kcaa-0.2.10}/README_CN.md +59 -12
  4. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/route_engine.py +992 -13
  5. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/router.py +309 -41
  6. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/world_model.py +75 -16
  7. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/kipy_tools.py +14 -2
  8. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/netlist_tools.py +78 -22
  9. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_group_tools.py +1 -1
  10. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_library_tools.py +371 -46
  11. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_query_tools.py +10 -1
  12. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/placement_helpers.py +14 -2
  13. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/skill_tools.py +23 -4
  14. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/symbol_edit_tools.py +298 -57
  15. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/symbol_tools.py +166 -118
  16. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/wire_edit_tools.py +6 -6
  17. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/footprint_index_manager.py +6 -3
  18. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pcb_footprint_utils.py +100 -3
  19. kcaa-0.2.10/kcaa/utils/skip_helpers.py +395 -0
  20. {kcaa-0.2.8 → kcaa-0.2.10}/kicad_plugin/README.md +25 -5
  21. {kcaa-0.2.8 → kcaa-0.2.10}/pyproject.toml +1 -1
  22. kcaa-0.2.8/kcaa/tools/validation_tools.py +0 -298
  23. kcaa-0.2.8/kcaa/utils/boundary_validator.py +0 -365
  24. kcaa-0.2.8/kcaa/utils/skip_helpers.py +0 -245
  25. {kcaa-0.2.8 → kcaa-0.2.10}/.gitignore +0 -0
  26. {kcaa-0.2.8 → kcaa-0.2.10}/LICENSE +0 -0
  27. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/__init__.py +0 -0
  28. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/context.py +0 -0
  29. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/prompts/__init__.py +0 -0
  30. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/prompts/bom_prompts.py +0 -0
  31. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/prompts/drc_prompt.py +0 -0
  32. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/prompts/pattern_prompts.py +0 -0
  33. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/prompts/templates.py +0 -0
  34. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/__init__.py +0 -0
  35. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/bom_resources.py +0 -0
  36. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/drc_resources.py +0 -0
  37. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/files.py +0 -0
  38. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/netlist_resources.py +0 -0
  39. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/pattern_resources.py +0 -0
  40. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/resources/projects.py +0 -0
  41. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/__init__.py +0 -0
  42. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/grid_a_star.py +0 -0
  43. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/path_postprocess.py +0 -0
  44. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/pns/__init__.py +0 -0
  45. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/pns/direction45.py +0 -0
  46. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/pns/node.py +0 -0
  47. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/pns/shove.py +0 -0
  48. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/pns/walkaround.py +0 -0
  49. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/via_check.py +0 -0
  50. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/router/visibility_graph.py +0 -0
  51. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/server.py +0 -0
  52. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/__init__.py +0 -0
  53. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/analysis_tools.py +0 -0
  54. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/bom_tools.py +0 -0
  55. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/drc_tools.py +0 -0
  56. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/erc_tools.py +0 -0
  57. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/export_tools.py +0 -0
  58. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/no_connect_tools.py +0 -0
  59. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pattern_tools.py +0 -0
  60. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_edit_tools.py +0 -0
  61. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_placement_helpers.py +0 -0
  62. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_placement_tools.py +0 -0
  63. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_routing_tools.py +0 -0
  64. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/pcb_zone_tools.py +0 -0
  65. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/project_tools.py +0 -0
  66. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/render_board_tools.py +0 -0
  67. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/render_route_state.py +0 -0
  68. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/schematic_group_tools.py +0 -0
  69. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/sheet_tools.py +0 -0
  70. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/tools/version_tools.py +0 -0
  71. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/__init__.py +0 -0
  72. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/component_utils.py +0 -0
  73. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/config.py +0 -0
  74. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/file_utils.py +0 -0
  75. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/footprint_database.py +0 -0
  76. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/fp_lib_table_utils.py +0 -0
  77. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/ipc_drc.py +0 -0
  78. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/kicad_api_detection.py +0 -0
  79. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/kicad_cli.py +0 -0
  80. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/kicad_utils.py +0 -0
  81. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/kipy_reload.py +0 -0
  82. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/net_settings.py +0 -0
  83. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/netlist_parser.py +0 -0
  84. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/path_validator.py +0 -0
  85. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pattern_recognition.py +0 -0
  86. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pcb_board_utils.py +0 -0
  87. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pcb_design_rules.py +0 -0
  88. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pcb_library_utils.py +0 -0
  89. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/pcb_sexp_utils.py +0 -0
  90. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/schematic_sexp_utils.py +0 -0
  91. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/secure_subprocess.py +0 -0
  92. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/skip_compat.py +0 -0
  93. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/sym_lib_table_utils.py +0 -0
  94. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_database.py +0 -0
  95. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_extractor.py +0 -0
  96. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_geometry.py +0 -0
  97. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_index_manager.py +0 -0
  98. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_index_reader.py +0 -0
  99. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/symbol_library_utils.py +0 -0
  100. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/temp_dir_manager.py +0 -0
  101. {kcaa-0.2.8 → kcaa-0.2.10}/kcaa/utils/version_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kcaa
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: Model Context Protocol (MCP) server for KiCad electronic design automation (EDA) files
5
5
  Project-URL: Homepage, https://github.com/paul356/KiCad-AI-Assistant
6
6
  Project-URL: Bug Tracker, https://github.com/paul356/KiCad-AI-Assistant/issues
@@ -46,6 +46,8 @@ Tested on **KiCad 10.0 / Linux & Windows**.
46
46
 
47
47
  [![CI](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml/badge.svg)](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml)
48
48
 
49
+ **Contributions welcome!** Bug reports, feature ideas, and pull requests are all appreciated — see [Contributing](#contributing) for how to get started.
50
+
49
51
  ## Table of Contents
50
52
 
51
53
  - [KiCad AI Assistant](#kicad-ai-assistant)
@@ -63,11 +65,13 @@ Tested on **KiCad 10.0 / Linux & Windows**.
63
65
  - [Project Tools](#project-tools)
64
66
  - [Symbol Library](#symbol-library)
65
67
  - [Schematic Editing](#schematic-editing)
68
+ - [Schematic Groups](#schematic-groups)
66
69
  - [Schematic Analysis](#schematic-analysis)
67
70
  - [Hierarchical Sheets](#hierarchical-sheets)
68
71
  - [PCB Library](#pcb-library)
69
72
  - [PCB Query](#pcb-query)
70
73
  - [PCB Editing](#pcb-editing)
74
+ - [PCB Routing](#pcb-routing)
71
75
  - [PCB Placement](#pcb-placement)
72
76
  - [PCB Groups](#pcb-groups)
73
77
  - [PCB Zones](#pcb-zones)
@@ -247,6 +251,14 @@ kcaa
247
251
 
248
252
  ## Available Tools
249
253
 
254
+ **Naming convention** — a `library_` prefix means a **definition inside a library**; no prefix means an **object placed on a board or in a schematic**. A `library_` tool never returns placement.
255
+
256
+ - `get_library_footprint` — footprint **definition** in a library; key `library_name` + `footprint_name`. Returns pads/courtyard/attributes; pad coordinates are footprint-local, with no board-level placement anchor.
257
+ - `get_footprint` — footprint **placed on a PCB**; key `pcb_path` + `references[]` (world position, rotation, layer, properties, pads).
258
+ - `list_symbol_properties` — symbol **placed in a schematic**; key `schematic_path` + `references[]` (properties only, no geometry, position, or nets).
259
+ - `extract_schematic_netlist` — returns the **whole netlist**, including the placement of **every** placed symbol (`components[ref].units[n].position`, `rotation`, per-unit `body_bbox`, world-coordinate `pins`); not a cheap single-coordinate lookup.
260
+ - `find_component_connections` — placement and connections for a **single reference** (`project_path` + `component_ref`); returns only that reference's `component_info` (also with `units[n].position`), not the whole netlist.
261
+
250
262
  ### Project Tools
251
263
 
252
264
  | Tool | Description |
@@ -262,11 +274,16 @@ kcaa
262
274
  | `sync_symbol_index` | Build or refresh the symbol library index |
263
275
  | `get_symbol_sync_status` | Query symbol index build progress |
264
276
  | `get_symbol_index_stats` | Get statistics about the symbol index |
265
- | `list_symbol_libraries` | List symbol libraries from the index |
266
- | `search_symbols` | Full-text search across indexed symbols |
267
- | `get_symbol` | Look up a symbol by library and name |
268
- | `get_library_symbols` | Return symbols in a specific library |
269
- | `get_symbol_pins` | Get pin definitions for a symbol |
277
+ | `list_symbol_libraries` | List all symbol libraries; `list_library_symbols` lists the symbols inside one library (keyed by `library_name`) |
278
+ | `search_library_symbols` | Full-text search across indexed symbols |
279
+ | `get_library_symbol` | Look up a symbol by library and name |
280
+ | `list_library_symbols` | List the symbols inside one library, keyed by `library_name`; `list_symbol_libraries` lists all libraries |
281
+ | `get_library_symbol_pins` | Get pin definitions for a symbol |
282
+ | `create_symbol_library` | Create a new `.kicad_sym` library (global 3rd-party or project-local) and register it in the library table |
283
+ | `delete_symbol_library` | Delete an empty symbol library (file, library-table entry, and index) |
284
+ | `add_symbols_to_library` | Copy symbols from a schematic's cached `lib_symbols` into an existing library |
285
+ | `remove_symbols_from_library` | Remove named symbol definitions from a library and re-index it |
286
+ | `find_symbols_not_in_libraries` | List schematic symbols that resolve to no available library (read-only) |
270
287
 
271
288
  ### Schematic Editing
272
289
 
@@ -279,11 +296,10 @@ kcaa
279
296
  | `move_component` | Move and/or rotate a placed component |
280
297
  | `set_symbol_property` | Set a property field on a placed symbol |
281
298
  | `rename_symbol` | Rename a placed symbol's reference designator |
282
- | `list_symbol_properties` | List all properties of a placed symbol |
299
+ | `list_symbol_properties` | List properties (name → value) of placed schematic symbols — no geometry, position, or nets |
283
300
  | `delete_symbol_property` | Delete a property from a placed symbol |
284
301
  | `check_reference_conflicts` | Check for duplicate reference designators |
285
302
  | `connect_points_with_wire` | Route a smart orthogonal wire between two points |
286
- | `add_wire_to_schematic` | Add a single wire segment by endpoints |
287
303
  | `connect_pins_with_wire` | Connect two symbol pins with a wire |
288
304
  | `delete_wire_from_schematic` | Remove wire segments by endpoints |
289
305
  | `add_label_to_schematic` | Add a local net label |
@@ -295,6 +311,18 @@ kcaa
295
311
  | `get_schematic_sheet_info` | Get drawing area, paper size, and grid |
296
312
  | `find_free_area` | Find candidate areas for placing a block |
297
313
 
314
+ ### Schematic Groups
315
+
316
+ | Tool | Description |
317
+ |------|-------------|
318
+ | `assign_symbols_to_group` | Assign symbols to a named placement group (stored as the `placement_group` property) |
319
+ | `list_symbol_groups` | List all symbol placement groups with member counts and bounding boxes |
320
+ | `get_symbol_group` | Get a group's members, positions, anchor and bounding box |
321
+ | `score_symbol_group` | Score intra-group spacing (mean nearest-neighbour distance and spread) |
322
+ | `place_symbol_group` | Arrange a group in a grid around its anchor and drop it in a free sheet area |
323
+ | `move_symbol_group` | Translate a whole group to a new anchor position, keeping its internal layout |
324
+ | `rotate_symbol_group` | Rotate a whole group rigidly around its anchor (counter-clockwise positive) |
325
+
298
326
  ### Schematic Analysis
299
327
 
300
328
  | Tool | Description |
@@ -304,8 +332,6 @@ kcaa
304
332
  | `run_erc` | Run Electrical Rules Check (headless `kicad-cli`) and return violations |
305
333
  | `identify_circuit_patterns` | Identify common circuit patterns |
306
334
  | `validate_project` | Basic validation of a KiCad project |
307
- | `validate_project_boundaries` | Validate component boundaries |
308
- | `generate_validation_report` | Generate a comprehensive validation report |
309
335
 
310
336
  ### Hierarchical Sheets
311
337
 
@@ -326,11 +352,14 @@ kcaa
326
352
  | `sync_footprint_index` | Build or refresh the footprint library index |
327
353
  | `get_footprint_sync_status` | Query footprint index build progress |
328
354
  | `list_footprint_libraries` | List all available footprint libraries |
329
- | `search_footprints` | Search footprints by name, description, or tag |
330
- | `get_footprint_details` | Get footprint details (pads, bounding box, etc.) |
355
+ | `search_library_footprints` | Search footprints by name, description, or tag |
356
+ | `get_library_footprint` | Get a footprint **library definition** (pads, bounding box, etc.) by library name + footprint name — not a board placement |
357
+ | `list_library_footprints` | List every footprint in one library (names and light metadata) (offset paging) |
331
358
  | `find_footprints_not_in_libraries` | List board footprints missing from every indexed library |
332
359
  | `create_footprint_library` | Create a global 3rdparty or project-local footprint library |
333
360
  | `add_footprints_to_library` | Export explicitly named board footprints into a library |
361
+ | `delete_footprint_library` | Delete an empty footprint library (directory, library-table entry, and index) |
362
+ | `remove_footprints_from_library` | Remove named footprints from a footprint library and re-index it |
334
363
 
335
364
  ### PCB Query
336
365
 
@@ -338,10 +367,12 @@ kcaa
338
367
  |------|-------------|
339
368
  | `get_board_info` | Get basic PCB board information |
340
369
  | `list_footprints` | List all footprints placed on the board |
341
- | `get_footprint` | Get details of a placed footprint (pads, properties, Edge.Cuts geometry) |
370
+ | `get_footprint` | Get details of footprints **placed on the PCB**, one payload per reference in `references` (pads, properties, Edge.Cuts geometry) |
342
371
  | `get_footprint_bbox` | Get the courtyard bounding box of a footprint |
343
372
  | `get_board_bounding_box` | Get the union bounding box of all footprints |
344
373
  | `list_nets` | List all nets on the board |
374
+ | `list_tracks` | List track segments and arcs grouped into traces, optionally filtered by net and layer |
375
+ | `list_vias` | List through-hole vias with position, size, drill, layers and net, optionally filtered by net |
345
376
  | `get_ratsnest` | Get unrouted ratsnest connections |
346
377
  | `score_placement` | Score the current PCB placement quality |
347
378
  | `suggest_placement_order` | Get recommended footprint placement order |
@@ -356,8 +387,19 @@ kcaa
356
387
  | `add_board_outline_arc` | Add an arc to the board outline |
357
388
  | `set_board_outline_rect` | Set a rectangular board outline (with optional rounded corners) |
358
389
  | `set_footprint_property` | Set a property field on a footprint |
390
+ | `add_footprints_to_pcb` | Import footprints from footprint libraries onto the board at given positions, assigning every pad's net |
391
+ | `remove_footprints_from_pcb` | Remove footprints from the board by reference designator (batch) |
359
392
  | `update_pcb_from_schematic` | Trigger *Update PCB from Schematic* via KiCad IPC |
360
393
 
394
+ ### PCB Routing
395
+
396
+ | Tool | Description |
397
+ |------|-------------|
398
+ | `pcb_route_pad_to_pad` | Route a single track between two pads with the obstacle-avoiding router (PNS shove or grid A*), optionally across layers via through-vias |
399
+ | `pcb_add_vias` | Add one or more through-hole vias in a single write, pre-checked against netclass and clearance rules |
400
+ | `pcb_delete_tracks` | Delete track segments and arcs matched by their endpoint coordinates |
401
+ | `pcb_delete_vias` | Delete vias matched by their (x, y) position |
402
+
361
403
  ### PCB Placement
362
404
 
363
405
  | Tool | Description |
@@ -414,6 +456,7 @@ kcaa
414
456
  | `list_project_versions` | List saved project version archives |
415
457
  | `restore_project_version` | Restore project files together to a saved archive |
416
458
  | `generate_pcb_thumbnail` | Render a PCB thumbnail image |
459
+ | `export_pcb_layer_image` | Render the board — or a single copper layer — as an image returned to the model; writes a PNG file only when `output_dir` is given |
417
460
 
418
461
  ### Skill System
419
462
 
@@ -6,6 +6,8 @@ Tested on **KiCad 10.0 / Linux & Windows**.
6
6
 
7
7
  [![CI](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml/badge.svg)](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml)
8
8
 
9
+ **Contributions welcome!** Bug reports, feature ideas, and pull requests are all appreciated — see [Contributing](#contributing) for how to get started.
10
+
9
11
  ## Table of Contents
10
12
 
11
13
  - [KiCad AI Assistant](#kicad-ai-assistant)
@@ -23,11 +25,13 @@ Tested on **KiCad 10.0 / Linux & Windows**.
23
25
  - [Project Tools](#project-tools)
24
26
  - [Symbol Library](#symbol-library)
25
27
  - [Schematic Editing](#schematic-editing)
28
+ - [Schematic Groups](#schematic-groups)
26
29
  - [Schematic Analysis](#schematic-analysis)
27
30
  - [Hierarchical Sheets](#hierarchical-sheets)
28
31
  - [PCB Library](#pcb-library)
29
32
  - [PCB Query](#pcb-query)
30
33
  - [PCB Editing](#pcb-editing)
34
+ - [PCB Routing](#pcb-routing)
31
35
  - [PCB Placement](#pcb-placement)
32
36
  - [PCB Groups](#pcb-groups)
33
37
  - [PCB Zones](#pcb-zones)
@@ -207,6 +211,14 @@ kcaa
207
211
 
208
212
  ## Available Tools
209
213
 
214
+ **Naming convention** — a `library_` prefix means a **definition inside a library**; no prefix means an **object placed on a board or in a schematic**. A `library_` tool never returns placement.
215
+
216
+ - `get_library_footprint` — footprint **definition** in a library; key `library_name` + `footprint_name`. Returns pads/courtyard/attributes; pad coordinates are footprint-local, with no board-level placement anchor.
217
+ - `get_footprint` — footprint **placed on a PCB**; key `pcb_path` + `references[]` (world position, rotation, layer, properties, pads).
218
+ - `list_symbol_properties` — symbol **placed in a schematic**; key `schematic_path` + `references[]` (properties only, no geometry, position, or nets).
219
+ - `extract_schematic_netlist` — returns the **whole netlist**, including the placement of **every** placed symbol (`components[ref].units[n].position`, `rotation`, per-unit `body_bbox`, world-coordinate `pins`); not a cheap single-coordinate lookup.
220
+ - `find_component_connections` — placement and connections for a **single reference** (`project_path` + `component_ref`); returns only that reference's `component_info` (also with `units[n].position`), not the whole netlist.
221
+
210
222
  ### Project Tools
211
223
 
212
224
  | Tool | Description |
@@ -222,11 +234,16 @@ kcaa
222
234
  | `sync_symbol_index` | Build or refresh the symbol library index |
223
235
  | `get_symbol_sync_status` | Query symbol index build progress |
224
236
  | `get_symbol_index_stats` | Get statistics about the symbol index |
225
- | `list_symbol_libraries` | List symbol libraries from the index |
226
- | `search_symbols` | Full-text search across indexed symbols |
227
- | `get_symbol` | Look up a symbol by library and name |
228
- | `get_library_symbols` | Return symbols in a specific library |
229
- | `get_symbol_pins` | Get pin definitions for a symbol |
237
+ | `list_symbol_libraries` | List all symbol libraries; `list_library_symbols` lists the symbols inside one library (keyed by `library_name`) |
238
+ | `search_library_symbols` | Full-text search across indexed symbols |
239
+ | `get_library_symbol` | Look up a symbol by library and name |
240
+ | `list_library_symbols` | List the symbols inside one library, keyed by `library_name`; `list_symbol_libraries` lists all libraries |
241
+ | `get_library_symbol_pins` | Get pin definitions for a symbol |
242
+ | `create_symbol_library` | Create a new `.kicad_sym` library (global 3rd-party or project-local) and register it in the library table |
243
+ | `delete_symbol_library` | Delete an empty symbol library (file, library-table entry, and index) |
244
+ | `add_symbols_to_library` | Copy symbols from a schematic's cached `lib_symbols` into an existing library |
245
+ | `remove_symbols_from_library` | Remove named symbol definitions from a library and re-index it |
246
+ | `find_symbols_not_in_libraries` | List schematic symbols that resolve to no available library (read-only) |
230
247
 
231
248
  ### Schematic Editing
232
249
 
@@ -239,11 +256,10 @@ kcaa
239
256
  | `move_component` | Move and/or rotate a placed component |
240
257
  | `set_symbol_property` | Set a property field on a placed symbol |
241
258
  | `rename_symbol` | Rename a placed symbol's reference designator |
242
- | `list_symbol_properties` | List all properties of a placed symbol |
259
+ | `list_symbol_properties` | List properties (name → value) of placed schematic symbols — no geometry, position, or nets |
243
260
  | `delete_symbol_property` | Delete a property from a placed symbol |
244
261
  | `check_reference_conflicts` | Check for duplicate reference designators |
245
262
  | `connect_points_with_wire` | Route a smart orthogonal wire between two points |
246
- | `add_wire_to_schematic` | Add a single wire segment by endpoints |
247
263
  | `connect_pins_with_wire` | Connect two symbol pins with a wire |
248
264
  | `delete_wire_from_schematic` | Remove wire segments by endpoints |
249
265
  | `add_label_to_schematic` | Add a local net label |
@@ -255,6 +271,18 @@ kcaa
255
271
  | `get_schematic_sheet_info` | Get drawing area, paper size, and grid |
256
272
  | `find_free_area` | Find candidate areas for placing a block |
257
273
 
274
+ ### Schematic Groups
275
+
276
+ | Tool | Description |
277
+ |------|-------------|
278
+ | `assign_symbols_to_group` | Assign symbols to a named placement group (stored as the `placement_group` property) |
279
+ | `list_symbol_groups` | List all symbol placement groups with member counts and bounding boxes |
280
+ | `get_symbol_group` | Get a group's members, positions, anchor and bounding box |
281
+ | `score_symbol_group` | Score intra-group spacing (mean nearest-neighbour distance and spread) |
282
+ | `place_symbol_group` | Arrange a group in a grid around its anchor and drop it in a free sheet area |
283
+ | `move_symbol_group` | Translate a whole group to a new anchor position, keeping its internal layout |
284
+ | `rotate_symbol_group` | Rotate a whole group rigidly around its anchor (counter-clockwise positive) |
285
+
258
286
  ### Schematic Analysis
259
287
 
260
288
  | Tool | Description |
@@ -264,8 +292,6 @@ kcaa
264
292
  | `run_erc` | Run Electrical Rules Check (headless `kicad-cli`) and return violations |
265
293
  | `identify_circuit_patterns` | Identify common circuit patterns |
266
294
  | `validate_project` | Basic validation of a KiCad project |
267
- | `validate_project_boundaries` | Validate component boundaries |
268
- | `generate_validation_report` | Generate a comprehensive validation report |
269
295
 
270
296
  ### Hierarchical Sheets
271
297
 
@@ -286,11 +312,14 @@ kcaa
286
312
  | `sync_footprint_index` | Build or refresh the footprint library index |
287
313
  | `get_footprint_sync_status` | Query footprint index build progress |
288
314
  | `list_footprint_libraries` | List all available footprint libraries |
289
- | `search_footprints` | Search footprints by name, description, or tag |
290
- | `get_footprint_details` | Get footprint details (pads, bounding box, etc.) |
315
+ | `search_library_footprints` | Search footprints by name, description, or tag |
316
+ | `get_library_footprint` | Get a footprint **library definition** (pads, bounding box, etc.) by library name + footprint name — not a board placement |
317
+ | `list_library_footprints` | List every footprint in one library (names and light metadata) (offset paging) |
291
318
  | `find_footprints_not_in_libraries` | List board footprints missing from every indexed library |
292
319
  | `create_footprint_library` | Create a global 3rdparty or project-local footprint library |
293
320
  | `add_footprints_to_library` | Export explicitly named board footprints into a library |
321
+ | `delete_footprint_library` | Delete an empty footprint library (directory, library-table entry, and index) |
322
+ | `remove_footprints_from_library` | Remove named footprints from a footprint library and re-index it |
294
323
 
295
324
  ### PCB Query
296
325
 
@@ -298,10 +327,12 @@ kcaa
298
327
  |------|-------------|
299
328
  | `get_board_info` | Get basic PCB board information |
300
329
  | `list_footprints` | List all footprints placed on the board |
301
- | `get_footprint` | Get details of a placed footprint (pads, properties, Edge.Cuts geometry) |
330
+ | `get_footprint` | Get details of footprints **placed on the PCB**, one payload per reference in `references` (pads, properties, Edge.Cuts geometry) |
302
331
  | `get_footprint_bbox` | Get the courtyard bounding box of a footprint |
303
332
  | `get_board_bounding_box` | Get the union bounding box of all footprints |
304
333
  | `list_nets` | List all nets on the board |
334
+ | `list_tracks` | List track segments and arcs grouped into traces, optionally filtered by net and layer |
335
+ | `list_vias` | List through-hole vias with position, size, drill, layers and net, optionally filtered by net |
305
336
  | `get_ratsnest` | Get unrouted ratsnest connections |
306
337
  | `score_placement` | Score the current PCB placement quality |
307
338
  | `suggest_placement_order` | Get recommended footprint placement order |
@@ -316,8 +347,19 @@ kcaa
316
347
  | `add_board_outline_arc` | Add an arc to the board outline |
317
348
  | `set_board_outline_rect` | Set a rectangular board outline (with optional rounded corners) |
318
349
  | `set_footprint_property` | Set a property field on a footprint |
350
+ | `add_footprints_to_pcb` | Import footprints from footprint libraries onto the board at given positions, assigning every pad's net |
351
+ | `remove_footprints_from_pcb` | Remove footprints from the board by reference designator (batch) |
319
352
  | `update_pcb_from_schematic` | Trigger *Update PCB from Schematic* via KiCad IPC |
320
353
 
354
+ ### PCB Routing
355
+
356
+ | Tool | Description |
357
+ |------|-------------|
358
+ | `pcb_route_pad_to_pad` | Route a single track between two pads with the obstacle-avoiding router (PNS shove or grid A*), optionally across layers via through-vias |
359
+ | `pcb_add_vias` | Add one or more through-hole vias in a single write, pre-checked against netclass and clearance rules |
360
+ | `pcb_delete_tracks` | Delete track segments and arcs matched by their endpoint coordinates |
361
+ | `pcb_delete_vias` | Delete vias matched by their (x, y) position |
362
+
321
363
  ### PCB Placement
322
364
 
323
365
  | Tool | Description |
@@ -374,6 +416,7 @@ kcaa
374
416
  | `list_project_versions` | List saved project version archives |
375
417
  | `restore_project_version` | Restore project files together to a saved archive |
376
418
  | `generate_pcb_thumbnail` | Render a PCB thumbnail image |
419
+ | `export_pcb_layer_image` | Render the board — or a single copper layer — as an image returned to the model; writes a PNG file only when `output_dir` is given |
377
420
 
378
421
  ### Skill System
379
422
 
@@ -6,6 +6,7 @@ KiCad AI Assistant 是一个 KiCad 动作插件,在 KiCad 内部直接嵌入
6
6
 
7
7
  [![CI](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml/badge.svg)](https://github.com/paul356/KiCad-AI-Assistant/actions/workflows/ci.yml)
8
8
 
9
+ **欢迎贡献!** Bug 报告、功能建议和 Pull Request 都非常欢迎——参见[贡献指南](#贡献指南)了解如何开始。
9
10
 
10
11
  ## 目录
11
12
 
@@ -24,11 +25,13 @@ KiCad AI Assistant 是一个 KiCad 动作插件,在 KiCad 内部直接嵌入
24
25
  - [项目工具](#项目工具)
25
26
  - [符号库](#符号库)
26
27
  - [原理图编辑](#原理图编辑)
28
+ - [原理图分组](#原理图分组)
27
29
  - [原理图分析](#原理图分析)
28
30
  - [层次化图纸](#层次化图纸)
29
31
  - [PCB 封装库](#pcb-封装库)
30
32
  - [PCB 查询](#pcb-查询)
31
33
  - [PCB 编辑](#pcb-编辑)
34
+ - [PCB 布线](#pcb-布线)
32
35
  - [PCB 摆放](#pcb-摆放)
33
36
  - [PCB 分组](#pcb-分组)
34
37
  - [PCB 区域](#pcb-区域)
@@ -175,6 +178,14 @@ kcaa
175
178
 
176
179
  ## 工具列表
177
180
 
181
+ **命名约定** — 前缀 `library_` 表示**库中的定义**;无前缀表示**已放置在板上或图中的实例**。带 `library_` 的工具不返回放置信息。
182
+
183
+ - `get_library_footprint` — 封装库中的封装**定义**;键为 `library_name` + `footprint_name`,返回焊盘/courtyard/属性;焊盘坐标为封装本地(footprint-local)坐标,没有板级放置锚点。
184
+ - `get_footprint` — **PCB 上已放置的封装**;键为 `pcb_path` + `references[]`(世界坐标、旋转、层、属性、焊盘)。
185
+ - `list_symbol_properties` — **原理图中已放置的符号**;键为 `schematic_path` + `references[]`(仅属性,不含几何、位置或网络)。
186
+ - `extract_schematic_netlist` — 返回**整份网表**,因此带有**每个**已放置符号的放置信息(`components[ref].units[n].position`、`rotation`、每个 unit 的 `body_bbox`、世界坐标 `pins`);不是廉价的单点坐标查询。
187
+ - `find_component_connections` — **单个位号**的放置信息与连接(`project_path` + `component_ref`);只返回该位号自己的 `component_info`(同样含 `units[n].position`),不返回整份网表。
188
+
178
189
  ### 项目工具
179
190
 
180
191
  | 工具 | 说明 |
@@ -190,45 +201,64 @@ kcaa
190
201
  | `sync_symbol_index` | 构建或刷新符号库索引 |
191
202
  | `get_symbol_sync_status` | 查询符号索引构建进度 |
192
203
  | `get_symbol_index_stats` | 获取符号索引统计信息 |
193
- | `list_symbol_libraries` | 列出索引中的符号库 |
194
- | `search_symbols` | 全文搜索已索引的符号 |
195
- | `get_symbol` | 按库名和符号名查找符号 |
196
- | `get_library_symbols` | 获取指定库中的符号列表 |
197
- | `get_symbol_pins` | 获取符号的引脚定义 |
204
+ | `list_symbol_libraries` | 列出所有符号库;`list_library_symbols` 列出单个库中的符号(按 `library_name` 指定) |
205
+ | `search_library_symbols` | 全文搜索已索引的符号 |
206
+ | `get_library_symbol` | 按库名和符号名查找符号 |
207
+ | `list_library_symbols` | 列出单个库中的符号(按 `library_name` 指定);`list_symbol_libraries` 列出所有符号库 |
208
+ | `get_library_symbol_pins` | 获取符号的引脚定义 |
209
+ | `create_symbol_library` | 新建 `.kicad_sym` 符号库(全局第三方或项目级)并在库表中注册 |
210
+ | `delete_symbol_library` | 删除空符号库(连同文件、库表条目和索引) |
211
+ | `add_symbols_to_library` | 将原理图缓存 `lib_symbols` 中的符号复制到已有符号库 |
212
+ | `remove_symbols_from_library` | 从符号库中删除指定符号定义并重新建立索引 |
213
+ | `find_symbols_not_in_libraries` | 列出在所有可用符号库中都解析不到的原理图符号(只读) |
198
214
 
199
215
  ### 原理图编辑
200
216
 
201
217
  | 工具 | 说明 |
202
218
  |------|------|
203
219
  | `add_symbol_to_schematic` | 在原理图上放置符号 |
220
+ | `create_symbol` | 在符号库中定义新符号(仅定义,不在原理图中放置) |
204
221
  | `place_symbol_relative` | 相对于已有元件放置符号 |
205
222
  | `remove_symbol_from_schematic` | 按位号删除已放置的符号 |
206
223
  | `move_component` | 移动/旋转已放置的元件 |
207
224
  | `set_symbol_property` | 设置已放置符号的属性字段 |
208
225
  | `rename_symbol` | 重命名已放置符号的位号 |
209
- | `list_symbol_properties` | 列出已放置符号的所有属性 |
226
+ | `list_symbol_properties` | 列出已放置原理图符号的属性(名称 → 值),不含几何、位置或网络 |
210
227
  | `delete_symbol_property` | 删除已放置符号的属性 |
211
228
  | `check_reference_conflicts` | 检查重复的位号 |
212
229
  | `connect_points_with_wire` | 在两点之间智能正交布线 |
213
- | `add_wire_to_schematic` | 按端点添加单条导线段 |
214
230
  | `connect_pins_with_wire` | 用导线连接两个引脚 |
215
231
  | `delete_wire_from_schematic` | 按端点删除导线段 |
216
232
  | `add_label_to_schematic` | 添加局部网络标签 |
217
233
  | `list_labels_in_schematic` | 列出所有局部网络标签 |
218
234
  | `delete_label_from_schematic` | 删除网络标签 |
235
+ | `add_no_connect` | 在引脚坐标处添加不连接(no-connect)标志 |
236
+ | `list_no_connects` | 列出所有不连接标志 |
237
+ | `remove_no_connect` | 按坐标删除不连接标志 |
219
238
  | `get_schematic_sheet_info` | 获取图纸尺寸和网格信息 |
220
239
  | `find_free_area` | 查找可放置模块的候选区域 |
221
240
 
241
+ ### 原理图分组
242
+
243
+ | 工具 | 说明 |
244
+ |------|------|
245
+ | `assign_symbols_to_group` | 将符号分配到命名摆放分组(保存在 `placement_group` 属性中) |
246
+ | `list_symbol_groups` | 列出所有符号摆放分组及其成员数与边界框 |
247
+ | `get_symbol_group` | 获取分组的成员、位置、锚点和边界框 |
248
+ | `score_symbol_group` | 评估分组内间距质量(平均最近邻距离和离散程度) |
249
+ | `place_symbol_group` | 以锚点为中心按网格排布分组,并自动放到图纸空白区域 |
250
+ | `move_symbol_group` | 按新锚点位置整体平移分组,保持组内相对布局不变 |
251
+ | `rotate_symbol_group` | 绕锚点整体旋转分组(逆时针为正) |
252
+
222
253
  ### 原理图分析
223
254
 
224
255
  | 工具 | 说明 |
225
256
  |------|------|
226
257
  | `extract_schematic_netlist` | 从原理图提取网表 |
227
258
  | `find_component_connections` | 查找元件的所有连接 |
259
+ | `run_erc` | 运行电气规则检查(调用无界面的 `kicad-cli`)并返回违规项 |
228
260
  | `identify_circuit_patterns` | 识别常见电路模式 |
229
261
  | `validate_project` | 项目基本验证 |
230
- | `validate_project_boundaries` | 验证元件边界 |
231
- | `generate_validation_report` | 生成综合验证报告 |
232
262
 
233
263
  ### 层次化图纸
234
264
 
@@ -249,11 +279,14 @@ kcaa
249
279
  | `sync_footprint_index` | 构建或刷新封装库索引 |
250
280
  | `get_footprint_sync_status` | 查询封装索引构建进度 |
251
281
  | `list_footprint_libraries` | 列出所有可用封装库 |
252
- | `search_footprints` | 按名称/描述/标签搜索封装 |
253
- | `get_footprint_details` | 获取封装详情(焊盘、边界框等) |
282
+ | `search_library_footprints` | 按名称/描述/标签搜索封装 |
283
+ | `get_library_footprint` | 按库名 + 封装名获取封装库中的封装**定义**(焊盘、边界框等),不是板上的封装实例 |
284
+ | `list_library_footprints` | 列出单个库中的全部封装(名称及简要元数据)(支持 offset 分页) |
254
285
  | `find_footprints_not_in_libraries` | 列出板上缺失于所有已索引库的封装 |
255
286
  | `create_footprint_library` | 创建全局 3rdparty 或项目级封装库 |
256
287
  | `add_footprints_to_library` | 将显式指定的板载封装导出到库 |
288
+ | `delete_footprint_library` | 删除空封装库(连同目录、库表条目和索引) |
289
+ | `remove_footprints_from_library` | 从封装库中删除指定封装并重新建立索引 |
257
290
 
258
291
  ### PCB 查询
259
292
 
@@ -261,10 +294,12 @@ kcaa
261
294
  |------|------|
262
295
  | `get_board_info` | 获取 PCB 板基本信息 |
263
296
  | `list_footprints` | 列出板上已放置的所有封装 |
264
- | `get_footprint` | 获取单个已放置封装的详情 |
297
+ | `get_footprint` | 获取板上已放置封装的详情(按 `references` 列表,每个位号一份结果;含焊盘、属性、Edge.Cuts 几何) |
265
298
  | `get_footprint_bbox` | 获取封装的 courtyard 边界框 |
266
299
  | `get_board_bounding_box` | 获取全板封装的联合边界框 |
267
300
  | `list_nets` | 列出板上所有网络 |
301
+ | `list_tracks` | 列出走线段和圆弧,按连通性归并为走线,可按网络和层过滤 |
302
+ | `list_vias` | 列出过孔的位置、外径、孔径、层和网络,可按网络过滤 |
268
303
  | `get_ratsnest` | 获取未布线飞线(ratsnest) |
269
304
  | `score_placement` | 评估当前 PCB 摆放质量 |
270
305
  | `suggest_placement_order` | 获取推荐的封装放置顺序 |
@@ -279,8 +314,19 @@ kcaa
279
314
  | `add_board_outline_arc` | 向板框添加圆弧 |
280
315
  | `set_board_outline_rect` | 设置矩形板框(支持圆角) |
281
316
  | `set_footprint_property` | 设置封装的属性字段 |
317
+ | `add_footprints_to_pcb` | 从封装库批量导入封装并按焊盘逐一指定网络后放到板上 |
318
+ | `remove_footprints_from_pcb` | 按位号从板上删除封装(支持批量) |
282
319
  | `update_pcb_from_schematic` | 通过 KiCad IPC 触发"从原理图更新 PCB" |
283
320
 
321
+ ### PCB 布线
322
+
323
+ | 工具 | 说明 |
324
+ |------|------|
325
+ | `pcb_route_pad_to_pad` | 用带避障的布线器(PNS 推挤或网格 A*)在两个焊盘之间布一条走线,可跨层并通过过孔衔接 |
326
+ | `pcb_add_vias` | 一次写入添加一个或多个通孔过孔,写入前按网络类和间距规则校验 |
327
+ | `pcb_delete_tracks` | 按端点坐标删除走线段和圆弧 |
328
+ | `pcb_delete_vias` | 按 (x, y) 坐标删除过孔 |
329
+
284
330
  ### PCB 摆放
285
331
 
286
332
  | 工具 | 说明 |
@@ -337,6 +383,7 @@ kcaa
337
383
  | `list_project_versions` | 列出已保存的项目版本归档 |
338
384
  | `restore_project_version` | 将项目文件一起恢复到已保存的归档 |
339
385
  | `generate_pcb_thumbnail` | 渲染 PCB 缩略图 |
386
+ | `export_pcb_layer_image` | 将整板或单个铜层渲染为图片返回给模型,仅在传入 `output_dir` 时才写出 PNG 文件 |
340
387
 
341
388
  ### 技能系统
342
389