Contributing to Circuit-Synthο
Thank you for your interest in contributing to circuit-synth.
Development Setupο
Clone the repository:
git clone https://github.com/circuit-synth/circuit-synth.git
cd circuit-synth
Install dependencies:
uv sync
Run tests:
./tools/testing/run_full_regression_tests.py
(Optional) Register Claude Code agents:
uv run register-agents
Development Workflowο
Create a feature branch from
developMake your changes with tests
Run the test suite:
./tools/testing/run_full_regression_tests.pySubmit a pull request to
develop
Code Styleο
Python: Use
black,isort,mypy,flake8Write tests for new functionality
Update documentation as needed
Quick Start Optionsο
1. Add a Circuit Example (15 mins)ο
Create a new example in examples/ showing a common circuit pattern:
# examples/led_driver.py
from circuit_synth import *
@circuit(name="led_driver")
def led_driver():
"""LED with current limiting resistor."""
led = Component("Device:LED", ref="D")
resistor = Component("Device:R", ref="R", value="220")
VCC = Net('VCC')
GND = Net('GND')
resistor[1] += VCC
resistor[2] += led[1]
led[2] += GND
Component processing (Issue #40) - 97% of generation time
Netlist processing (Issue #36)
KiCad parsing (Issue #37)
3. Component Search Improvementsο
Extend manufacturing integrations in src/circuit_synth/manufacturing/:
Add Digi-Key support
Improve JLCPCB filtering
Add alternative component suggestions
Development Environment Setupο
# Clone and install
git clone https://github.com/circuit-synth/circuit-synth.git
cd circuit-synth
uv sync
# Run tests
uv run pytest
Development Workflowο
Fork and clone the repository
Create a feature branch:
git checkout -b feature/your-featureMake changes following existing patterns
Test:
./tools/testing/run_full_regression_tests.pyFormat:
black src/ && isort src/Push and create a pull request
Testingο
# Run all tests
./tools/testing/run_full_regression_tests.py
# Python tests only
uv run pytest --cov=circuit_synth
# Specific test
uv run pytest tests/unit/test_core_circuit.py -v
We follow Test-Driven Development (TDD):
Write tests first
Make them pass with minimal code
Refactor while keeping tests green
Types of Contributionsο
Bug Reportsο
Include:
Circuit-synth version
Minimal reproduction code
Error messages
Expected vs actual behavior
Feature Requestsο
Describe the problem being solved
Provide use cases
Consider implementation complexity
Code Contributionsο
Discuss in an issue first
Follow code standards (black, mypy, flake8)
Add tests for new features
Update documentation
Code Styleο
Follow PEP 8 (88 char line length)
Use type hints for public functions
Write docstrings for public APIs
No bare
exceptclauses
Architectureο
Circuit-synth uses a JSON-centric architecture:
Python β JSON β KiCad for circuit generation
KiCad β JSON β Python for round-trip conversion
JSON serves as the canonical data format
Key directories:
src/circuit_synth/core/- Core circuit classessrc/circuit_synth/kicad/- KiCad file I/Osrc/circuit_synth/manufacturing/- JLCPCB integration
Use pure Python for all functionality
Focus on readability and maintainability
High-impact areas:
Component processing (97% of time)
Netlist generation
KiCad parsing
Pull Request Guidelinesο
Reference related issues (βFixes #123β)
Include tests for new features
Update documentation as needed
Ensure all CI checks pass
We review PRs within 48 hours and provide constructive feedback.
Getting Helpο
GitHub Issues - Bug reports
GitHub Discussions - Questions
Claude Code agents - Use
contributoragent for guidance
Code of Conductο
We are committed to a welcoming environment for all contributors.
Be respectful and constructive
Accept feedback gracefully
Focus on whatβs best for the community
Recognitionο
Significant contributors are:
Added to CONTRIBUTORS.md
Mentioned in release notes
Credited in documentation
Thank you for contributing to Circuit-Synth!