kicad-skill 0.1.0__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 (224) hide show
  1. kicad_skill-0.1.0/.gitignore +213 -0
  2. kicad_skill-0.1.0/CHANGELOG.md +173 -0
  3. kicad_skill-0.1.0/CONFIG.md +605 -0
  4. kicad_skill-0.1.0/LICENSE +22 -0
  5. kicad_skill-0.1.0/PKG-INFO +222 -0
  6. kicad_skill-0.1.0/README.md +161 -0
  7. kicad_skill-0.1.0/THIRD_PARTY_NOTICES.md +84 -0
  8. kicad_skill-0.1.0/docs/adr/0001-memory-adapters-in-src.md +29 -0
  9. kicad_skill-0.1.0/docs/plans/2026-12-03-kicad-skill-design.md +48 -0
  10. kicad_skill-0.1.0/docs/systemdesign/module_reference.md +292 -0
  11. kicad_skill-0.1.0/pyproject.toml +340 -0
  12. kicad_skill-0.1.0/src/kicad_skill/__init__.py +20 -0
  13. kicad_skill-0.1.0/src/kicad_skill/__init__conf__.py +93 -0
  14. kicad_skill-0.1.0/src/kicad_skill/__main__.py +9 -0
  15. kicad_skill-0.1.0/src/kicad_skill/adapters/__init__.py +16 -0
  16. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/__init__.py +56 -0
  17. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/__init__.py +34 -0
  18. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/config.py +563 -0
  19. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/info.py +41 -0
  20. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/kicad_checks.py +227 -0
  21. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/kicad_writes.py +171 -0
  22. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/mcp.py +34 -0
  23. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/commands/routing.py +353 -0
  24. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/config_load.py +206 -0
  25. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/constants.py +28 -0
  26. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/context.py +177 -0
  27. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/exit_codes.py +52 -0
  28. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/lazy_group.py +65 -0
  29. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/main.py +155 -0
  30. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/output.py +225 -0
  31. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/py.typed +0 -0
  32. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/root.py +173 -0
  33. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/route_output.py +67 -0
  34. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/safe_console.py +315 -0
  35. kicad_skill-0.1.0/src/kicad_skill/adapters/cli/typed_click.py +77 -0
  36. kicad_skill-0.1.0/src/kicad_skill/adapters/config/__init__.py +25 -0
  37. kicad_skill-0.1.0/src/kicad_skill/adapters/config/defaultconfig.d/40-layered-config.toml +78 -0
  38. kicad_skill-0.1.0/src/kicad_skill/adapters/config/defaultconfig.d/50-krt.toml +35 -0
  39. kicad_skill-0.1.0/src/kicad_skill/adapters/config/defaultconfig.d/90-logging.toml +448 -0
  40. kicad_skill-0.1.0/src/kicad_skill/adapters/config/defaultconfig.toml +55 -0
  41. kicad_skill-0.1.0/src/kicad_skill/adapters/config/deploy.py +134 -0
  42. kicad_skill-0.1.0/src/kicad_skill/adapters/config/display.py +61 -0
  43. kicad_skill-0.1.0/src/kicad_skill/adapters/config/loader.py +210 -0
  44. kicad_skill-0.1.0/src/kicad_skill/adapters/config/overrides.py +393 -0
  45. kicad_skill-0.1.0/src/kicad_skill/adapters/config/py.typed +0 -0
  46. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_cli/__init__.py +12 -0
  47. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_cli/checks.py +107 -0
  48. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_cli/fab_export.py +261 -0
  49. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_cli/jlc_files.py +67 -0
  50. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_cli/runner.py +256 -0
  51. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/__init__.py +13 -0
  52. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/footprint_files.py +59 -0
  53. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/guarded_write.py +204 -0
  54. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/library_dirs.py +41 -0
  55. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/schematic_files.py +62 -0
  56. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/symbol_dirs.py +52 -0
  57. kicad_skill-0.1.0/src/kicad_skill/adapters/kicad_files/text_files.py +42 -0
  58. kicad_skill-0.1.0/src/kicad_skill/adapters/krt/provision.py +379 -0
  59. kicad_skill-0.1.0/src/kicad_skill/adapters/krt/router.py +117 -0
  60. kicad_skill-0.1.0/src/kicad_skill/adapters/krt/settings.py +91 -0
  61. kicad_skill-0.1.0/src/kicad_skill/adapters/logging/__init__.py +13 -0
  62. kicad_skill-0.1.0/src/kicad_skill/adapters/logging/py.typed +0 -0
  63. kicad_skill-0.1.0/src/kicad_skill/adapters/logging/setup.py +438 -0
  64. kicad_skill-0.1.0/src/kicad_skill/adapters/mcp_server/__init__.py +7 -0
  65. kicad_skill-0.1.0/src/kicad_skill/adapters/mcp_server/server.py +247 -0
  66. kicad_skill-0.1.0/src/kicad_skill/adapters/memory/__init__.py +45 -0
  67. kicad_skill-0.1.0/src/kicad_skill/adapters/memory/config.py +66 -0
  68. kicad_skill-0.1.0/src/kicad_skill/adapters/memory/logging.py +80 -0
  69. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/__init__.py +39 -0
  70. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/checks.py +214 -0
  71. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/inputs.py +58 -0
  72. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/placement.py +67 -0
  73. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/results.py +271 -0
  74. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/routing.py +316 -0
  75. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/routing_inputs.py +121 -0
  76. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/routing_results.py +175 -0
  77. kicad_skill-0.1.0/src/kicad_skill/adapters/operations/writes.py +288 -0
  78. kicad_skill-0.1.0/src/kicad_skill/adapters/py.typed +0 -0
  79. kicad_skill-0.1.0/src/kicad_skill/application/__init__.py +28 -0
  80. kicad_skill-0.1.0/src/kicad_skill/application/ports.py +93 -0
  81. kicad_skill-0.1.0/src/kicad_skill/application/py.typed +0 -0
  82. kicad_skill-0.1.0/src/kicad_skill/check.py +79 -0
  83. kicad_skill-0.1.0/src/kicad_skill/composition/__init__.py +96 -0
  84. kicad_skill-0.1.0/src/kicad_skill/composition/py.typed +0 -0
  85. kicad_skill-0.1.0/src/kicad_skill/domain/__init__.py +20 -0
  86. kicad_skill-0.1.0/src/kicad_skill/domain/board.py +185 -0
  87. kicad_skill-0.1.0/src/kicad_skill/domain/check/__init__.py +13 -0
  88. kicad_skill-0.1.0/src/kicad_skill/domain/check/connectivity.py +64 -0
  89. kicad_skill-0.1.0/src/kicad_skill/domain/check/courtyard.py +78 -0
  90. kicad_skill-0.1.0/src/kicad_skill/domain/check/report.py +208 -0
  91. kicad_skill-0.1.0/src/kicad_skill/domain/enums.py +55 -0
  92. kicad_skill-0.1.0/src/kicad_skill/domain/errors.py +23 -0
  93. kicad_skill-0.1.0/src/kicad_skill/domain/fab/__init__.py +14 -0
  94. kicad_skill-0.1.0/src/kicad_skill/domain/fab/bom.py +76 -0
  95. kicad_skill-0.1.0/src/kicad_skill/domain/fab/jlc.py +197 -0
  96. kicad_skill-0.1.0/src/kicad_skill/domain/fab/refs.py +22 -0
  97. kicad_skill-0.1.0/src/kicad_skill/domain/fab/rules.py +107 -0
  98. kicad_skill-0.1.0/src/kicad_skill/domain/footprint/__init__.py +13 -0
  99. kicad_skill-0.1.0/src/kicad_skill/domain/footprint/footprint.py +352 -0
  100. kicad_skill-0.1.0/src/kicad_skill/domain/footprint/heatsink.py +104 -0
  101. kicad_skill-0.1.0/src/kicad_skill/domain/footprint/library.py +31 -0
  102. kicad_skill-0.1.0/src/kicad_skill/domain/jobset.py +75 -0
  103. kicad_skill-0.1.0/src/kicad_skill/domain/kicad_install.py +84 -0
  104. kicad_skill-0.1.0/src/kicad_skill/domain/placement.py +331 -0
  105. kicad_skill-0.1.0/src/kicad_skill/domain/py.typed +0 -0
  106. kicad_skill-0.1.0/src/kicad_skill/domain/routing/__init__.py +6 -0
  107. kicad_skill-0.1.0/src/kicad_skill/domain/routing/copper.py +200 -0
  108. kicad_skill-0.1.0/src/kicad_skill/domain/routing/krt.py +196 -0
  109. kicad_skill-0.1.0/src/kicad_skill/domain/routing/rules.py +325 -0
  110. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/__init__.py +15 -0
  111. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/connectivity.py +217 -0
  112. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/geometry.py +73 -0
  113. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/netlist.py +67 -0
  114. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/sheet.py +553 -0
  115. kicad_skill-0.1.0/src/kicad_skill/domain/schematic/symbols.py +195 -0
  116. kicad_skill-0.1.0/src/kicad_skill/domain/sexpr.py +565 -0
  117. kicad_skill-0.1.0/src/kicad_skill/domain/write_guard.py +317 -0
  118. kicad_skill-0.1.0/src/kicad_skill/entry.py +26 -0
  119. kicad_skill-0.1.0/src/kicad_skill/fab.py +84 -0
  120. kicad_skill-0.1.0/src/kicad_skill/footprint.py +51 -0
  121. kicad_skill-0.1.0/src/kicad_skill/guard.py +85 -0
  122. kicad_skill-0.1.0/src/kicad_skill/py.typed +0 -0
  123. kicad_skill-0.1.0/src/kicad_skill/schematic.py +78 -0
  124. kicad_skill-0.1.0/tests/board_fixtures.py +216 -0
  125. kicad_skill-0.1.0/tests/cli_helpers.py +48 -0
  126. kicad_skill-0.1.0/tests/conftest.py +680 -0
  127. kicad_skill-0.1.0/tests/fake_krt_route.py +70 -0
  128. kicad_skill-0.1.0/tests/kicad_fixtures.py +130 -0
  129. kicad_skill-0.1.0/tests/kicad_reports.py +315 -0
  130. kicad_skill-0.1.0/tests/krt_fixtures.py +59 -0
  131. kicad_skill-0.1.0/tests/layer_roots.py +32 -0
  132. kicad_skill-0.1.0/tests/mcp_helpers.py +82 -0
  133. kicad_skill-0.1.0/tests/test_board_file.py +63 -0
  134. kicad_skill-0.1.0/tests/test_board_netlist.py +42 -0
  135. kicad_skill-0.1.0/tests/test_builder_writes_guarded.py +132 -0
  136. kicad_skill-0.1.0/tests/test_cache_effectiveness.py +155 -0
  137. kicad_skill-0.1.0/tests/test_check_connectivity.py +67 -0
  138. kicad_skill-0.1.0/tests/test_check_courtyard.py +47 -0
  139. kicad_skill-0.1.0/tests/test_check_report.py +97 -0
  140. kicad_skill-0.1.0/tests/test_cli_config.py +887 -0
  141. kicad_skill-0.1.0/tests/test_cli_config_errors.py +552 -0
  142. kicad_skill-0.1.0/tests/test_cli_core.py +244 -0
  143. kicad_skill-0.1.0/tests/test_cli_docstring_examples.py +73 -0
  144. kicad_skill-0.1.0/tests/test_cli_env_file.py +172 -0
  145. kicad_skill-0.1.0/tests/test_cli_exit_codes.py +83 -0
  146. kicad_skill-0.1.0/tests/test_cli_kicad.py +253 -0
  147. kicad_skill-0.1.0/tests/test_cli_kicad_real_board.py +77 -0
  148. kicad_skill-0.1.0/tests/test_cli_kicad_small_board.py +61 -0
  149. kicad_skill-0.1.0/tests/test_cli_lazy_mcp.py +70 -0
  150. kicad_skill-0.1.0/tests/test_cli_main_exit.py +156 -0
  151. kicad_skill-0.1.0/tests/test_cli_overrides.py +167 -0
  152. kicad_skill-0.1.0/tests/test_cli_route.py +135 -0
  153. kicad_skill-0.1.0/tests/test_cli_route_kicad.py +65 -0
  154. kicad_skill-0.1.0/tests/test_cli_validation.py +132 -0
  155. kicad_skill-0.1.0/tests/test_config_layer_isolation.py +112 -0
  156. kicad_skill-0.1.0/tests/test_config_overrides.py +479 -0
  157. kicad_skill-0.1.0/tests/test_coverage_database.py +51 -0
  158. kicad_skill-0.1.0/tests/test_declared_dependencies.py +89 -0
  159. kicad_skill-0.1.0/tests/test_deploy_mode_safety.py +191 -0
  160. kicad_skill-0.1.0/tests/test_deploy_permissions.py +369 -0
  161. kicad_skill-0.1.0/tests/test_display.py +214 -0
  162. kicad_skill-0.1.0/tests/test_enums.py +78 -0
  163. kicad_skill-0.1.0/tests/test_errors.py +14 -0
  164. kicad_skill-0.1.0/tests/test_fab_bom.py +44 -0
  165. kicad_skill-0.1.0/tests/test_fab_jlc.py +103 -0
  166. kicad_skill-0.1.0/tests/test_fab_rules.py +35 -0
  167. kicad_skill-0.1.0/tests/test_footprint_footprint.py +121 -0
  168. kicad_skill-0.1.0/tests/test_footprint_heatsink.py +78 -0
  169. kicad_skill-0.1.0/tests/test_footprint_kicad_oracle.py +98 -0
  170. kicad_skill-0.1.0/tests/test_footprint_library.py +56 -0
  171. kicad_skill-0.1.0/tests/test_footprint_move.py +111 -0
  172. kicad_skill-0.1.0/tests/test_footprint_move_kicad_oracle.py +117 -0
  173. kicad_skill-0.1.0/tests/test_footprint_move_operation.py +59 -0
  174. kicad_skill-0.1.0/tests/test_free_threaded.py +72 -0
  175. kicad_skill-0.1.0/tests/test_guard_kicad_lock.py +84 -0
  176. kicad_skill-0.1.0/tests/test_guarded_write.py +194 -0
  177. kicad_skill-0.1.0/tests/test_jobset_effects.py +40 -0
  178. kicad_skill-0.1.0/tests/test_kicad_cli_checks.py +120 -0
  179. kicad_skill-0.1.0/tests/test_kicad_cli_fab.py +183 -0
  180. kicad_skill-0.1.0/tests/test_kicad_cli_runner.py +67 -0
  181. kicad_skill-0.1.0/tests/test_krt_provision.py +195 -0
  182. kicad_skill-0.1.0/tests/test_krt_route_e2e.py +135 -0
  183. kicad_skill-0.1.0/tests/test_krt_router.py +93 -0
  184. kicad_skill-0.1.0/tests/test_library_dirs.py +65 -0
  185. kicad_skill-0.1.0/tests/test_logging.py +31 -0
  186. kicad_skill-0.1.0/tests/test_logging_dotenv_isolation.py +564 -0
  187. kicad_skill-0.1.0/tests/test_mcp_kicad.py +141 -0
  188. kicad_skill-0.1.0/tests/test_mcp_registration.py +57 -0
  189. kicad_skill-0.1.0/tests/test_mcp_server.py +130 -0
  190. kicad_skill-0.1.0/tests/test_memory_logging.py +120 -0
  191. kicad_skill-0.1.0/tests/test_metadata.py +86 -0
  192. kicad_skill-0.1.0/tests/test_metadata_sync.py +83 -0
  193. kicad_skill-0.1.0/tests/test_module_entry.py +152 -0
  194. kicad_skill-0.1.0/tests/test_no_pcbnew_in_src.py +27 -0
  195. kicad_skill-0.1.0/tests/test_operation_fail_on.py +31 -0
  196. kicad_skill-0.1.0/tests/test_packaging.py +155 -0
  197. kicad_skill-0.1.0/tests/test_permission_defaults.py +672 -0
  198. kicad_skill-0.1.0/tests/test_platform_markers.py +31 -0
  199. kicad_skill-0.1.0/tests/test_plugin_manifest.py +43 -0
  200. kicad_skill-0.1.0/tests/test_ports.py +129 -0
  201. kicad_skill-0.1.0/tests/test_property_overrides.py +165 -0
  202. kicad_skill-0.1.0/tests/test_quickstart_notebook.py +120 -0
  203. kicad_skill-0.1.0/tests/test_reset_git_history.py +136 -0
  204. kicad_skill-0.1.0/tests/test_route_operation.py +92 -0
  205. kicad_skill-0.1.0/tests/test_route_operation_kicad.py +92 -0
  206. kicad_skill-0.1.0/tests/test_routing_copper.py +57 -0
  207. kicad_skill-0.1.0/tests/test_routing_krt_source.py +104 -0
  208. kicad_skill-0.1.0/tests/test_routing_rules.py +169 -0
  209. kicad_skill-0.1.0/tests/test_safe_console.py +302 -0
  210. kicad_skill-0.1.0/tests/test_schematic_connectivity.py +106 -0
  211. kicad_skill-0.1.0/tests/test_schematic_geometry.py +55 -0
  212. kicad_skill-0.1.0/tests/test_schematic_kicad_oracle.py +168 -0
  213. kicad_skill-0.1.0/tests/test_schematic_netlist.py +29 -0
  214. kicad_skill-0.1.0/tests/test_schematic_sexpr.py +35 -0
  215. kicad_skill-0.1.0/tests/test_schematic_sheet.py +260 -0
  216. kicad_skill-0.1.0/tests/test_schematic_symbol_source.py +58 -0
  217. kicad_skill-0.1.0/tests/test_schematic_symbols.py +83 -0
  218. kicad_skill-0.1.0/tests/test_settings_dotenv_numbers.py +55 -0
  219. kicad_skill-0.1.0/tests/test_sexpr_lexer.py +226 -0
  220. kicad_skill-0.1.0/tests/test_sexpr_spans.py +37 -0
  221. kicad_skill-0.1.0/tests/test_skill_md.py +155 -0
  222. kicad_skill-0.1.0/tests/test_tool_runner.py +68 -0
  223. kicad_skill-0.1.0/tests/test_write_guard.py +136 -0
  224. kicad_skill-0.1.0/tests/toml_files.py +33 -0
@@ -0,0 +1,213 @@
1
+ # ====================================
2
+ # PYCHARM SPEZIFISCH: Git commands you might run once
3
+ # git add .gitignore && git commit -m "Ignore IDE settings"
4
+ # git push
5
+ # git rm -r --cached .idea
6
+ # git commit -m "Remove .idea and add to .gitignore"
7
+ # git push
8
+ # alternative : BE CAREFUL: overwrites remote history
9
+ # git push origin master --force
10
+
11
+ # ====================================
12
+ # APP
13
+ # ====================================
14
+ website/build/
15
+ website/.docusaurus/
16
+ website/node_modules/
17
+ node_modules/
18
+ web-local-preview/
19
+ translation_app*.log
20
+ translation_web*.log
21
+ tmp_github_web_pages/
22
+ tmp_linkcheck_web_pages/
23
+ .eslintcache
24
+ .vitest/
25
+ npm-debug.log*
26
+ yarn-error.log*
27
+ pnpm-debug.log*
28
+ .env.*
29
+ !.env.example
30
+ todo.md
31
+ tmp_*
32
+
33
+ # ====================================
34
+ # IDEs & Editors
35
+ # ====================================
36
+ # IntelliJ, PyCharm, etc.
37
+ .idea/
38
+ # VS Code workspace settings
39
+ .vscode/
40
+ *.code-workspace
41
+
42
+ # ====================================
43
+ # Python bytecode & caches
44
+ # ====================================
45
+ # __pycache__: compiled .pyc files at any depth
46
+ # *.py[cod]: catches .pyc, .pyo, .pyd
47
+ __pycache__/
48
+ src/kicad_skill/__pycache__/
49
+ *.py[cod]
50
+ # other compiled artifacts
51
+ *$py.class
52
+
53
+ # pytest, coverage, MyPy, Hypothesis
54
+ .pytest_cache/
55
+ .mypy_cache/
56
+ .pyright/
57
+ .coverage*
58
+ htmlcov/
59
+ nosetests.xml
60
+ coverage.xml
61
+ *.cover
62
+ .hypothesis/
63
+ .tox/
64
+ .nox/
65
+
66
+ # general cache directories (any project-level caching)
67
+ .cache/
68
+ .run/
69
+ .import_linter_cache/
70
+
71
+ # ====================================
72
+ # Build & distribution artifacts
73
+ # ====================================
74
+ # source/package builds
75
+ build/
76
+ dist/
77
+ # metadata for pip installs
78
+ *.egg-info/
79
+ *.egg
80
+ *.whl
81
+ pip-wheel-metadata/
82
+ # PyInstaller metadata
83
+ *.manifest
84
+ # PyInstaller spec files
85
+ *.spec
86
+
87
+ # Eggs, parts, wheels, sdist, etc.
88
+ develop-eggs/
89
+ .eggs/
90
+ parts/
91
+ sdist/
92
+ wheels/
93
+ downloads/
94
+ var/
95
+
96
+ # pip logs & installer leftovers
97
+ pip-log.txt
98
+ pip-delete-this-directory.txt
99
+ .installed.cfg
100
+
101
+ # ====================================
102
+ # Virtual environments & secrets
103
+ # ====================================
104
+ # common venv folder names
105
+ env/
106
+ venv/
107
+ ENV/
108
+ .venv/
109
+ # backups, alternate names
110
+ env.bak/
111
+ venv.bak/
112
+ # dotenv files with credentials
113
+ .env
114
+
115
+ # ====================================
116
+ # Project-specific & framework files
117
+ # ====================================
118
+ # Django logs & local overrides
119
+ *.log
120
+ local_settings.py
121
+
122
+ # Flask instance folder
123
+ instance/
124
+ .webassets-cache
125
+
126
+ # Scrapy cache
127
+ .scrapy
128
+
129
+ # Sphinx docs
130
+ docs/_build/
131
+
132
+ # PyBuilder output
133
+ target/
134
+
135
+ # Jupyter notebooks checkpoints
136
+ .ipynb_checkpoints
137
+
138
+ # pyenv Python version file
139
+ .python-version
140
+
141
+ # Celery beat schedule
142
+ celerybeat-schedule
143
+
144
+ # SageMath parsed files
145
+ *.sage.py
146
+
147
+ # Spyder IDE
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope IDE
152
+ .ropeproject
153
+
154
+ # MkDocs static site folder
155
+ /site
156
+
157
+ # ====================================
158
+ # OS-specific files
159
+ # ====================================
160
+ # macOS
161
+ .DS_Store
162
+ # Windows
163
+ Thumbs.db
164
+ ehthumbs.db
165
+
166
+ # Archives
167
+ *.zip
168
+
169
+ # Thunderbird build artifact (created temporarily by pack script)
170
+ sources/manifest.json
171
+
172
+ # ====================================
173
+ # Tool-specific extras
174
+ # ====================================
175
+ # Codecov uploader script (downloaded during local uploads)
176
+ codecov.sh
177
+ codecov.xml
178
+
179
+ # Nix build result symlink
180
+ result
181
+
182
+ # Optional lockfiles (for alternative managers)
183
+ poetry.lock
184
+ pdm.lock
185
+
186
+ # div
187
+ # .devcontainer/ # needed for github codespaces
188
+ .claude/
189
+ CLAUDE.md
190
+ prompts.md
191
+ .grimp_cache/
192
+
193
+ # Local, per-developer settings (Claude Code etc.) - never commit
194
+ *.local.json
195
+ # bitranox curated memory (local; CLAUDE.local.md @imports it)
196
+ CLAUDE.local.md
197
+
198
+ # Python virtual environments (managed by bmk)
199
+ .venv-win/
200
+ .venv-bmk/
201
+
202
+ # Python virtual environments (managed by bmk)
203
+ .venv*/
204
+
205
+ # Autonomous-execution decision log (never committed)
206
+ EXECUTION-USER-REVIEW.md
207
+
208
+ # Local session notes and backlog (never committed)
209
+ handover*.md
210
+ OPEN-WORK*.md
211
+
212
+ # Project-local git worktrees
213
+ .worktrees/
@@ -0,0 +1,173 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file following
4
+ the [Keep a Changelog](https://keepachangelog.com/) format.
5
+
6
+
7
+ ## [Unreleased]
8
+
9
+
10
+ ## [0.1.0] - 2026-12-04
11
+
12
+ First release. kicad-skill designs KiCad 10 boards as code without the SWIG bindings KiCad 11
13
+ removes: KiCad's own checks through kicad-cli, manufacturing and JLCPCB files, routing and
14
+ re-routing with KiCadRoutingTools, a write guard for every KiCad design file the CLI, the MCP
15
+ tools and the Python builders write, the schematic and footprint builders as a Python API, an MCP server and a Claude Code skill.
16
+
17
+ ### Added
18
+
19
+ - `kicad_skill.schematic`: draw a KiCad schematic sheet from code. Parts, values and footprints
20
+ come from the board netlist (`read_netlist`), symbols and pins from the installed KiCad symbol
21
+ libraries (`SymbolLibrary`, `default_symbol_dirs`); `Sheet` places units, runs wires, labels,
22
+ power symbols, frames and notes, positions the drawing on the page, and `Sheet.write` refuses
23
+ to write a sheet whose connections disagree with the netlist (`SheetError` lists every
24
+ problem). It writes through the write guard (`force=True` overwrites uncommitted changes);
25
+ an unchanged `.kicad_sch` is left untouched without asking the guard.
26
+ - `kicad_skill.footprint`: derive footprints from KiCad's stock library. `Footprint` reads a
27
+ `.kicad_mod`, renames it, picks, replaces and adds pads, swaps outlines and merges a second
28
+ footprint; its text is reproducible (UUIDs derived from the name and item position).
29
+ `heatsink_pad` turns a screw hole into a plated heatsink pad with a grid of thermal vias.
30
+ `write_footprint` and `write_fp_lib_table` write through the write guard (`force=True`
31
+ overwrites uncommitted changes) and leave an unchanged file untouched without asking it.
32
+ - `kicad_skill.domain.sexpr`: one KiCad s-expression tokenizer following KiCad's lexer rules
33
+ (C escapes in quoted tokens, `#` comments only at line start, atoms ending only at
34
+ whitespace, NUL or a parenthesis) with two views: `parse` for analysis (brace escapes such as
35
+ `{slash}` decoded, the written form kept, problems such as a truncated file or lists nested
36
+ deeper than 200 levels reported rather than raised) and `loads` for editing (`Symbol`, numbers,
37
+ quoted strings as written). `dumps` writes tab-indented, as KiCad 10 does.
38
+ - A `kicad` pytest marker for tests that need KiCad itself (kicad-cli, the installed
39
+ libraries, a Python importing pcbnew); they skip, naming what is missing, without it.
40
+ - `THIRD_PARTY_NOTICES.md`, shipped in the sdist and the wheel.
41
+ - `kicad_skill.check`: KiCad's own checks through kicad-cli. `erc` and `drc` return typed reports
42
+ (`ErcReport` per sheet; `DrcReport` with rule violations, unconnected items and schematic
43
+ parity) with counts per severity, violations found by KiCad's untranslated type keys and items
44
+ by UUID, so a KiCad running in any language gives the same result. `DrcReport.parity` says
45
+ whether the board was compared with its schematic at all: kicad-cli reports an empty parity
46
+ list, and exits 0, when there is no schematic. `netlist_equivalence` checks that a schematic
47
+ joins exactly the pins of a netlist, net names ignored (`connectivity_diff`, `pin_groups`), and
48
+ `courtyard_overlaps` names the parts whose courtyards collide, matched by footprint UUID read
49
+ from the board file.
50
+ - `kicad_skill.fab`: manufacturing files through kicad-cli. `export_fab` writes Gerbers for every
51
+ copper layer the board declares (inner layers included), Excellon drill files with Gerber drill
52
+ maps, the zip for the board house, the BOM (`bom_rows`: one row per value and footprint, R2
53
+ before R10, mounting holes left out), the schematic PDF, and optionally the pick-and-place file
54
+ and 3D renders; it refuses a netlist the schematic does not match. `export_jlc_assembly` writes
55
+ JLCPCB's BOM and CPL for the fitted parts only and names the parts without an LCSC number,
56
+ fitted parts without a position and placed parts that are not assembled. `JLCPCB` holds the
57
+ board house's limits and `dru_text` the KiCad custom rules written from them.
58
+ - `KICAD_CLI` names the kicad-cli to run instead of the one on `PATH`; every kicad-cli call goes
59
+ through one runner with a timeout.
60
+ - `default_footprint_dirs` beside `default_symbol_dirs`: both read KiCad's `KICAD10_*_DIR` (and
61
+ KiCad 9 and unversioned) variables first, then the platform's KiCad 10 install, on Windows the
62
+ per-user install under `%LOCALAPPDATA%` before the machine-wide one.
63
+ - `kicad_skill.guard`: the write guard every KiCad design file goes through, whether the CLI,
64
+ an MCP tool or a builder (`Sheet.write`, `write_footprint`, `write_fp_lib_table`) writes it
65
+ (`.kicad_sch`, `.kicad_pcb`, `.kicad_pro`, `.kicad_mod`, `.kicad_sym`, `.kicad_dru`,
66
+ `fp-lib-table`, `sym-lib-table`; generated outputs are written freely). A KiCad lock beside
67
+ the file (`~<name>.<ext>.lck`) or, for a project's files and library tables, the project's
68
+ `~<project>.kicad_pro.lck` refuses the write even with `force`, naming the lock's owner and how
69
+ to clear a stale lock; a tracked file with uncommitted changes is refused unless `force` is set
70
+ (a `.bak` then keeps the uncommitted text); a file git cannot restore (outside a repository, or
71
+ untracked) gets a `.bak` first. `guarded_write` replaces the file atomically and reports bytes
72
+ before and after and lines added and removed. git is run through the package's one process
73
+ runner, with the caller's `GIT_*` variables removed.
74
+ - CLI commands over KiCad's own tools: read - `version` (kicad-cli in use), `erc`, `drc`,
75
+ `netlist export`, `netlist same` (two of `.net`, `.kicad_sch`, `.kicad_pcb`, compared by the
76
+ pins each net joins; a board is read from its pads' nets) and `schematic check` (ERC plus the
77
+ schematic against `<name>.net` and `<name>.kicad_pcb` beside it, a missing one reported as
78
+ skipped); write - `fab export`, `bom`, `jlc`, `jobset run` and `drc --refill-zones
79
+ --save-board`. Every command takes `--json` (`{ok, command, answer, data, skipped}`, and
80
+ `error: {type, message}` when it cannot run, usage errors included) and `--json-bare` (the data
81
+ alone, or `{type, message}`); diagnostics go to stderr. Exit codes: 0 yes/clean, 1 no
82
+ (violations, differences, a refused write), 2 could not run. `--fail-on error|warning` sets
83
+ which violations make ERC/DRC answer no. A write that can hit a KiCad design file (zone refill,
84
+ a BOM path, a jobset whose DRC job saves the board) goes through the write guard and takes
85
+ `--force`; zone refill runs kicad-cli on a copy and replaces the board atomically.
86
+ - `kicad_skill.domain.board.board_netlist`: a board's netlist from the nets its pads carry.
87
+ - `kicad-skill mcp`: an MCP server on stdin/stdout (the official `mcp` SDK, `mcp>=2.3.0`, whose
88
+ `FastMCP` is called `MCPServer` from 2.0). Read tools `version`, `erc`, `drc`, `netlist_same`,
89
+ `schematic_check`; write tools `netlist_export`, `bom`, `fab_export`, `jlc`, `jobset_run`,
90
+ `drc_refill`. Each tool runs the same operation as the CLI command and returns the same
91
+ envelope; a failure is a tool error naming its type. Writes are on and go through the write
92
+ guard with a `force` parameter; read tools carry the read-only hint.
93
+ The root group loads the `mcp` command only when it runs or help lists it, so the other
94
+ commands never import the MCP SDK.
95
+ - `.mcp.json` registers the server for work in this repository as `uv run --project
96
+ ${CLAUDE_PROJECT_DIR:-.} kicad-skill mcp` (the checkout); the plugin pins the release.
97
+ - KiCadRoutingTools built from source (`kicad_skill.adapters.krt.provision`): the repository named
98
+ in the new `[krt]` configuration section is fetched at one full commit sha (default: upstream at
99
+ the commit of release v0.24.3; a fork works the same way), `git rev-parse HEAD` must equal the
100
+ pin, the `*.patch`/`*.diff` files of the optional `krt.patches` folder are applied with
101
+ `git apply`, uv makes the router's own environment from its `requirements.txt`, and
102
+ `cargo build --release --locked` builds its Rust core. A `manifest.json` records the commit,
103
+ patches, Python and package versions, toolchain and the built module's SHA-256; a build is
104
+ reused only while that manifest still matches. Missing git, uv, cargo or rustc is reported by
105
+ name with how to install it. KiCadRoutingTools' own `build_router.py`, which downloads
106
+ unhashed binaries, is never run.
107
+ - Routing rips no net outside the request by default: without `rip_existing` (`--rip-existing`)
108
+ every route run passes `--max-ripup 0`. KiCadRoutingTools otherwise rips up to 3 blocking nets
109
+ outside the scope and does not always restore them (measured on a real two-layer THT board:
110
+ re-routing two nets broke a third).
111
+ - Test marker `krt`: builds KiCadRoutingTools from the pinned commit into a session temp cache
112
+ (about 31 s with warm cargo and uv caches) and routes real boards: a ring of four nets on stock
113
+ resistors is routed, a part turned, its nets' copper deleted and routed again at 0.5 mm (only those
114
+ nets change, 0 unconnected, 0 DRC errors), and a part of a real two-layer THT board is turned
115
+ and re-routed.
116
+ Skipped, with the reason, only when cargo is missing.
117
+ - CLI `kicad-skill route setup|all|nets|component|undo` and `kicad-skill board move`, and MCP tools
118
+ `route_setup`, `route`, `route_undo` and `footprint_move`: the same operations, the same envelope,
119
+ exit codes 0/1/2, every board write through the guard with `--force`/`force`. Rules per run:
120
+ `--track-width`, `--clearance`, `--via-size`, `--via-drill`, `--power-net PATTERN=WIDTH`,
121
+ `--escalation off|board|fab` (default `off`), `--rip-existing PATTERN`; `nets` and `component`
122
+ take `--reroute` (delete that copper first); `all`, `nets` and `component` take `--keep-partial`
123
+ (MCP `route`: `keep_partial`) to write a result that leaves nets unconnected or DRC errors.
124
+ KiCadRoutingTools leaves GND/VCC/VDD-like nets out of a component scope; in `route component`
125
+ each `--power-net` pattern that matches one of the parts' nets adds that whole net to the run,
126
+ and `route undo --components --power-net PATTERN` (MCP `route_undo`: `power_nets`) deletes it.
127
+ The loop after turning a part: `board move BOARD R8 --rotate 90`, a commit (or `--force` on the next write), then
128
+ `route component BOARD R8 --reroute`. The router build
129
+ comes from the new `[krt]` configuration section (documented in CONFIG.md); `kicad-skill mcp`
130
+ reads it at start, so a configuration that does not load stops it with exit 78. `route` and
131
+ `board` load lazily.
132
+ - Footprint move at file level (`kicad_skill.domain.placement.move_footprint`, operation
133
+ `move_board_footprint`): turn one part by an angle and/or put its origin at x/y, written through the
134
+ write guard. It turns about the centre of the part's courtyard by default (taken in the part's own
135
+ frame; fallback the box around its drawings and pads), or about its origin as KiCad's rotate does.
136
+ The edit rewrites only the numbers that place the part: the footprint's `(at)`, the absolute
137
+ angles of its pads, properties and texts, and the board coordinates of zones inside it (keep-outs);
138
+ every other byte stays as KiCad wrote it. Locked parts, and parts holding a dimension, text box,
139
+ image, table or barcode, are refused. A test checks pad positions and angles, the part's placement
140
+ and its zone corners against pcbnew's own `FOOTPRINT.Rotate` within 2 nm, for stock parts, a part
141
+ on the bottom side and parts of a real two-layer THT board. KiCad flips a text that would read
142
+ upside down when it next saves the board; this edit leaves the text at the turned angle.
143
+ - `kicad_skill.domain.sexpr.spans`: every list and atom of a KiCad file with its place in the text,
144
+ for edits that replace exactly the characters they change.
145
+ - Routing operations (`kicad_skill.adapters.operations.routing`): `route_board` carries out a
146
+ `RouteRequest` - route, undo (delete the copper of) or re-route every net, named nets or the nets
147
+ of named components, with per-run rules (track width, clearance, via size and drill, power-net
148
+ patterns with their widths, `escalation` defaulting to `off` so sizes stay exact, nets that may
149
+ be ripped up). The write guard is asked before the router is even built; KiCadRoutingTools runs
150
+ on a copy of the board, its `.kicad_pro` and `.kicad_dru` (a re-route is an undo then a route on
151
+ that copy), and KiCad's DRC checks the routed copy beside the board's own project and rules
152
+ (zones refilled for the check only). A route or re-route replaces the board, through the guard,
153
+ only when every run succeeded and the DRC shows no unconnected item and no error; otherwise the
154
+ board stays as it was, the answer is no and `data.not_written` says why (`keep_partial` writes it
155
+ anyway, still answering no). An undo is written once its run succeeded. The outcome names every
156
+ net whose tracks or vias changed, or would have changed (compared by geometry, read with the
157
+ package's own s-expression reader), and the DRC's unconnected items and errors by type; the
158
+ answer is yes when every run succeeded and, for a route, nothing is unconnected and no error is
159
+ left. `route_setup` builds or finds the
160
+ router. Measured on a real two-layer THT board: re-routing two nets at 0.5 mm took 5.7 s,
161
+ changed exactly those two nets (19 others unchanged), 0 unconnected, 0 errors.
162
+ - The process runner starts the router's tools too (`find_tool`, `run_tool`, `ToolMissingError`);
163
+ it stays the package's only process start.
164
+ - The `kicad-skill` skill (`skills/kicad-skill/SKILL.md`): when to use the CLI, the MCP tools or
165
+ the Python API, the write guard's rules, the move-then-re-route workflow, how to judge a route
166
+ result, the checks before an order, and pointers into its reference pages. A test keeps it under
167
+ the 20,000 characters a compaction keeps and checks that every command and option it names exists.
168
+ - Claude Code plugin: the repository is its own marketplace (`.claude-plugin/marketplace.json`)
169
+ with one plugin, `kicad-skill`, which ships the skill and the MCP server pinned to the release
170
+ (`uvx kicad-skill==0.1.0 mcp`). Install with `/plugin marketplace add bitranox/kicad-skill` and
171
+ `/plugin install kicad-skill@kicad-skill`.
172
+ - README for kicad-skill.
173
+