Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/atopile/packages/how_to_build_packagesgit clone --depth 1 https://github.com/atopile/packagesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/atopile/packages/how_to_build_packages)<a href="https://agentmods.dev/rules/atopile/packages/how_to_build_packages"><img src="https://agentmods.dev/badge/rules/atopile/packages/how_to_build_packages.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03908 | $0.03908 |
| Opus 5 | $0.01954 | $0.01954 |
| Sonnet 5 | $0.00782 | $0.00782 |
| Haiku 4.5 | $0.00391 | $0.00391 |
Grade A, and why
how_to_build_packages scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 342 lines — stays where its author put it; the contents beside it link to each section on GitHub.
0 Context
A package is a special atopile project that is intended to be shared and reused in other designs. A package is denoted by a package section in the ato.yaml file. A package aims to design a basic implementation of a given integrated circuit component. The requirement is for this package to include all the necessary components to get the core device working, such as decoupling capacitors, pullup/pulldown resistors, and more. Most importantly, since this package will be reused in a different design, it is critical to correctly create, expose, and connect all the external interfaces properly. External interfaces should be created using the proper object type (ElectricPower/ElectricLogic/etc.) and clearly defined with docstrings.
Some examples of critical interfaces to expose for users include but are not limited to:
- ElectricPower for the power rails -
add electricpower.required = truefor required power rails - SPI/I2C/I2S/etc. - communication interfaces should be defined and connected to the pins of the physical package
- EnablePins -
enable_pin.line.required = trueso users don't ignore or forget to connect the enable line somewhere
The purpose of the usage build is to show users how to use the package. This means this example should show the preferred method of use, and is most helpful if it shows the user how to use many of the interfaces.
1 Building a new package
1.1 File Structure
packages/
packages/
<package_name>/
layouts/
parts/
ato.yaml
<package_name>.ato
README.md
usage.ato
1.2 Steps to create a new package
- Create a new directory
<package_name>as stated in the file structure. - Create ato.yaml,
<package_name>.ato, README.md, usage.ato - Look through other packages for inspiration
- Create part using tool call 'search_and_install_jlcpcb_part' 4.1 Inspect the part ato file in the parts/ directory
- Import the part into the main ato file
- Read the datasheet for the device
- Populate the files with the correct information (see below) 7.1 Create interfaces and connect them 7.2 Add decoupling caps where needed 7.3 Add i2c addressor if device has configurable address If format is: use addressor module:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 342 lines · 3,908 tokens per session scan A e9f97b817eba
how_to_build_packages is a cursor rule published in the GitHub repository atopile/packages (18 stars, last pushed 4mo ago), licensed MIT. It adds 3,908 tokens to every session, about $0.0195 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.