.claude/skills/library/SKILL.md
How the Faebryk component library is structured, how `_F.py` is generated, and the conventions/invariants for adding new library modules. Use when adding or modifying library components, traits, or module definitions.
npx skillsauth add atopile/atopile libraryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The library module (located in src/faebryk/library/) contains the collection of reusable components, traits, and interfaces that form the "standard library" of the hardware design language.
import faebryk.core.faebrykpy as fbrk
import faebryk.core.graph as graph
import faebryk.library._F as F
g = graph.GraphView.create()
tg = fbrk.TypeGraph.create(g=g)
resistor = F.Resistor.bind_typegraph(tg=tg).create_instance(g=g)
src/faebryk/library/_F.py
import faebryk.library._F as F pattern.tools/library/gen_F.py
src/faebryk/library/*.py, detects whether the file contains a same-named class, and writes _F.py.F.<Name> references to avoid import-order cycles.src/faebryk/library/ contains specific component definitions (e.g. Resistor.py, Capacitor.py, LED.py).can_bridge.py, is_power.py).faebryk.library._F (aliased as F).ato built-ins to these classes.can_bridge) and Components for physical things (what it is like Resistor)._F.py is a generated “barrel” module; importing it is intentionally convenient but can be heavyweight.MyComponent.py in src/faebryk/library/. Inherit from Node (or a more specific base)._F.py: run python tools/library/gen_F.py and commit the updated src/faebryk/library/_F.py.test/library/ (including test/library/nodes/).ato dev test --llm test/library/test_instance_library_modules.py -qis_atomic_part trait.F.Parameters to define physical properties like resistance, capacitance, etc.development
How the Faebryk parameter solver works (Sets/Literals, Parameters, Expressions), the core invariants enforced during mutation, and practical workflows for debugging and extending the solver. Use when implementing or modifying constraint solving, parameter bounds, or debugging expression simplification.
development
# SEXP Benchmark Strategy ## Goal Measure and improve S-expression pipeline performance with a focus on: - Throughput per stage - Peak memory per stage - End-to-end behavior on realistic KiCad PCB inputs ## Pipeline Stages Benchmark these layers separately: - `tokenizer` - `ast` - `parser` (typed decode) - `encode` (typed encode to raw SEXP) - `pretty` (formatting) ## Dataset Dimensions Use a matrix over: - `depth`: shallow vs deep nesting - `size`: small, medium, large Recommended size buck
development
How the Zig S-expression engine and typed KiCad models work, how they are exposed to Python (pyzig_sexp), and the invariants around parsing, formatting, and freeing. Use when working with KiCad file parsing, S-expression generation, or layout sync.
tools
How the Zig↔Python binding layer works (pyzig), including build-on-import, wrapper generation patterns, ownership rules, and where to add new exported APIs. Use when adding Zig-Python bindings, modifying native extensions, or debugging C-API interactions.