.claude/skills/faebryk/SKILL.md
How Faebryk's TypeGraph works (GraphView + Zig edges), how to traverse/resolve references, and how FabLL types/traits map onto edge types. Use when working with TypeGraph traversal, edge types, or building type-aware queries.
npx skillsauth add atopile/atopile faebrykInstall 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 Faebryk core here is the TypeGraph + edge types implemented in Zig and exposed to Python via faebryk.core.faebrykpy.
Source-of-truth for API + behavior:
src/faebryk/core/faebrykpy.py (Python-facing wrapper + type-safe EdgeTrait.traverse)src/faebryk/core/zig/gen/faebryk/typegraph.pyi (public stubbed API surface)src/faebryk/core/zig/src/faebryk/* (Zig implementation)import faebryk.core.faebrykpy as fbrk
import faebryk.core.graph as graph
g = graph.GraphView.create()
tg = fbrk.TypeGraph.create(g=g)
src/faebryk/core/faebrykpy.py (re-exports + EdgeTraversal + type-safe EdgeTrait.traverse)src/faebryk/core/zig/gen/faebryk/typegraph.pyi (TypeGraph stub)faebrykpy.py):
EdgeComposition (parent/child structure)EdgeTrait / Trait (trait attachment)EdgePointer (references)EdgeInterfaceConnection (interface connections)EdgeOperand (solver operand wiring)EdgeType / EdgeNext (type graph plumbing)Linker (used by compiler/linking stages)src/faebryk/core/node.py (binds Python classes into the TypeGraph; uses composition/trait edges)src/atopile/compiler/* (creates and links TypeGraphs)src/faebryk/core/solver/* (operand edges and instance traversal)src/atopile/build_steps.py (visits type/instance edges for PCB/layout features)TypeGraph is created against a GraphView:
import faebryk.core.graph as graph
import faebryk.core.faebrykpy as fbrk
g = graph.GraphView.create()
tg = fbrk.TypeGraph.create(g=g)
TypeGraph.ensure_child_reference(..., path=[...]) uses EdgeTraversal items to walk references through the type graph.src/faebryk/core/zig/src/faebryk/* (edges, typegraph internals).ato dev compile (imports faebryk.core.zig).src/faebryk/core/faebrykpy.py (example: type-safe EdgeTrait.traverse).ato dev test --llm test/compiler/test_typegraph.py -qato dev test --llm test/compiler/test_runtime.py -qato dev test --llm test/core/zig/test_interface_pathfinder.py -qfaebryk.core.faebrykpy (so callers get Python helpers, not just raw generated types).EdgeTrait.traverse(trait_type=SomeTrait) over stringly-typed trait_type_name=....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.