This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- This project uses
pipfor dependency management. - Tests are managed using
pytest. toxis used to run tests across multiple environments (different Python/KiCad versions).
- Run all tests (default environment):
pytest tests - Run tests across all supported test environments:
tox - Run a specific test: Navigate to the
testsdirectory and usepytest path/to/test.py - Build the package:
python setup.py sdist - Clean build artifacts:
rm dist/*
SKiDL acts as an infrastructure-as-code tool for circuit design, converting Python-based circuit descriptions into netlists for PCB layout tools (primarily KiCad).
src/skidl/: Contains the core package logic.- Core circuitry elements like
Part,Net, andCircuitdefinitions. - Netlist generation and ERC (Electrical Rules Checking) logic.
schematics: Logic for generating schematics from SKiDL.scripts: User-facing CLI utilities.tools: Backend interfaces from SKiDL to various EDA packages.
- Core circuitry elements like
tests/: Extensive test suite for functionalities ranging from basic circuit construction to hierarchical schematic generation and SPICE integration.unit_tests: Unit tests, both manually and AI-generated.ai_tests: AI-generated unit tests.
test_data: Data (mostly part libraries) needed to run unit tests.examples/: Examples to test various features.
For KiCad integration (specifically KiCad 6-9), the process involves:
- Symbol definition extraction from draw commands.
- Hierarchical UUID generation and multi-file schematic output.
- Force-directed placement and routing algorithms to handle component positioning and connectivity.
- Coordinate system handling (KiCad is Y-down, requiring transformations).