library
- Repo stars 3,367
- License MIT
- Author updated Live
- Author repo atopile
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @atopile · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js · Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: library
description: How the Faebryk component library is structured, how `_F.py` is generated, and the conventions/i…
category: other
runtime: Node.js / Python
---
# library output preview
## PART A: Task fit
- Use case: 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..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Quick Start / Relevant Files / Dependants (Call Sites)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “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.”.
- **02** When the source has headings, the agent prioritizes “Quick Start / Relevant Files / Dependants (Call Sites)” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Quick Start / Relevant Files / Dependants (Call Sites)”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: library
description: How the Faebryk component library is structured, how `_F.py` is generated, and the conventions/i…
category: other
source: atopile/atopile
---
# library
## When to use
- How the Faebryk component library is structured, how `_F.py` is generated, and the conventions/invariants for adding n…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Quick Start / Relevant Files / Dependants (Call Sites)” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "library" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Quick Start / Relevant Files / Dependants (Call Sites)
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js / Python | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Library Module
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.
Quick Start
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)
Relevant Files
- Facade (auto-generated):
src/faebryk/library/_F.py- Eagerly imports and re-exports library modules/types for the
import faebryk.library._F as Fpattern. - This file is generated; do not hand-edit it.
- Eagerly imports and re-exports library modules/types for the
- Generator:
tools/library/gen_F.py- Scans
src/faebryk/library/*.py, detects whether the file contains a same-named class, and writes_F.py. - Orders exports via a topological sort of
F.<Name>references to avoid import-order cycles.
- Scans
- Components:
src/faebryk/library/contains specific component definitions (e.g.Resistor.py,Capacitor.py,LED.py). - Traits/Interfaces: Also contains trait definitions (e.g.
can_bridge.py,is_power.py).
Dependants (Call Sites)
- User Code: atopile projects heavily import from
faebryk.library._F(aliased asF). - Compiler: The compiler maps
atobuilt-ins to these classes.
How to Work With / Develop / Test
Core Concepts
- Traits vs Components: Use Traits for behavior (what it can do like
can_bridge) and Components for physical things (what it is likeResistor). - Export model:
_F.pyis a generated “barrel” module; importing it is intentionally convenient but can be heavyweight.
Development Workflow
- New Component: Create a new file
MyComponent.pyinsrc/faebryk/library/. Inherit fromNode(or a more specific base). - Naming Convention: Class names should match the file basename (usually).
- Regenerate
_F.py: runpython tools/library/gen_F.pyand commit the updatedsrc/faebryk/library/_F.py.
Testing
- Library tests live under
test/library/(includingtest/library/nodes/). - A good smoke test for new modules is:
ato dev test --llm test/library/test_instance_library_modules.py -q
Best Practices
- Atomic Parts: Mark leaf components (specifically verified part numbers) with the
is_atomic_parttrait. - Parameters: Use
F.Parametersto define physical properties likeresistance,capacitance, etc. - Documentation: Add docstrings to components explaining their ports and parameters.
Decide Fit First
_F.pyis generated, and the conventions/invariants for adding new library…Design Intent
How To Use It
Boundaries And Review