Builds and links TypeGraphs from atopile source files using the internal compiler pipeline.

Install

mkdir -p .claude/skills/compiler && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4182" && unzip -o skill.zip -d .claude/skills/compiler && rm skill.zip

Installs to .claude/skills/compiler

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

How the atopile compiler builds and links TypeGraphs from `.ato` (ANTLR front-end → AST → TypeGraph → Linker → DeferredExecutor), plus the key invariants and test entrypoints. Use when modifying the compiler pipeline, grammar, AST visitors, or type resolution.
260 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Parse .ato files into AST
  • Construct linked TypeGraphs
  • Execute deferred logic like inheritance
  • Regenerate ANTLR parser output
  • Test type resolution logic

How it works

The compiler pipeline uses ANTLR to parse source files, builds an AST, constructs a TypeGraph, and resolves types through a linker and deferred executor.

Inputs & outputs

You give it
.ato source files
You get back
Linked TypeGraph

When to use compiler

  • Regenerating ANTLR parser output
  • Modifying the compiler pipeline or AST visitors
  • Building a linked TypeGraph from an entrypoint
  • Testing type resolution logic

About this skill

Compiler Module

The compiler builds a linked, self-contained TypeGraph from .ato sources. Export/manufacturing artifacts are handled later by build steps/exporters; the compiler’s job is parsing + typegraph construction + linking.

Start with:

  • src/atopile/compiler/README.md (stage overview + example usage)
  • src/atopile/compiler/parser/README.md (how to regenerate ANTLR output)

Quick Start

Build a single .ato file into a linked TypeGraph (and instantiate its entrypoint):

import faebryk.core.faebrykpy as fbrk
import faebryk.core.graph as graph
import faebryk.core.node as fabll
from atopile.compiler.build import Linker, StdlibRegistry, build_file
from atopile.compiler.deferred_executor import DeferredExecutor
from atopile.config import config

g = graph.GraphView.create()
tg = fbrk.TypeGraph.create(g=g)
stdlib = StdlibRegistry(tg)
linker = Linker(config, stdlib, tg)

result = build_file(g=g, tg=tg, import_path="app.ato", path="path/to/app.ato")
linker.link_imports(g=g, state=result.state)
DeferredExecutor(g=g, tg=tg, state=result.state, visitor=result.visitor).execute()

app_type = result.state.type_roots["ENTRYPOINT"]
app_root = tg.instantiate_node(type_node=app_type, attributes={})
app = fabll.Node.bind_instance(app_root)

Relevant Files

  • Core pipeline:
    • src/atopile/compiler/build.py (build_file, build_source, Linker, StdlibRegistry, stage helpers)
    • src/atopile/compiler/parse.py (ANTLR parse + error listener → UserSyntaxError)
    • src/atopile/compiler/antlr_visitor.py (ANTLR CST → internal AST graph with source info)
    • src/atopile/compiler/ast_visitor.py (AST → TypeGraph “preliminary” construction)
    • src/atopile/compiler/gentypegraph.py (typegraph generation utilities + import refs)
    • src/atopile/compiler/deferred_executor.py (terminal stage: inheritance/retypes/for-loops)
  • Parser frontend:
    • src/atopile/compiler/parser/ (AtoLexer.g4, AtoParser.g4, generated Python)

Dependants (Call Sites)

  • CLI (src/atopile/cli/build.py): Calls the compiler to build the project.
  • LSP (src/atopile/lsp/lsp_server.py): Builds per-document graphs and keeps the last successful result for completions/hover.

How to Work With / Develop / Test

Core Concepts

  • ANTLR front-end: parse .ato into an ANTLR parse tree; syntax errors are converted to UserSyntaxError.
  • AST graph: ANTLRVisitor converts ANTLR output into internal AST nodes (FabLL nodes with source info).
  • TypeGraph build: AST visitor emits a preliminary TypeGraph.
  • Linking: Linker resolves imports, executes inheritance ordering, applies retypes, and prepares a self-contained compilation unit.
  • Deferred execution (terminal): DeferredExecutor.execute() runs operations that require resolved types (inheritance, retypes, for-loops).

Development Workflow

  1. Grammar changes:
    • edit src/atopile/compiler/parser/AtoLexer.g4 / AtoParser.g4
    • regenerate (see src/atopile/compiler/parser/README.md)
  2. Language features:
    • CST → AST: src/atopile/compiler/antlr_visitor.py
    • AST → TypeGraph: src/atopile/compiler/ast_visitor.py / gentypegraph.py
  3. Linking/terminal behavior:
    • src/atopile/compiler/build.py / src/atopile/compiler/deferred_executor.py

Testing

  • Compiler tests: ato dev test --llm test/compiler -q
  • Linker behavior: ato dev test --llm test/compiler/test_linker.py -q
  • End-to-end smoke: ato dev test --llm test/test_end_to_end.py -q

Best Practices

  • Keep errors source-attached: raise DslRichException/UserException with AST source info when possible.
  • Watch graph lifetimes: most entrypoints accept (g, tg) explicitly; ensure you destroy GraphView in long-running processes (LSP does this).

When not to use it

  • Non-atopile language projects

Prerequisites

ANTLR parser generator

Limitations

  • Requires graph lifecycle management
  • Errors must be source-attached

How it compares

It provides a formal compiler pipeline for hardware description, unlike manual scripting or ad-hoc parsing.

Compared to similar skills

compiler side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
compiler (this skill)36moNo flagsAdvanced
jupyter-notebook306moReviewIntermediate
unsloth158moNo flagsIntermediate
clojure-write162moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

jupyter-notebook

davila7

Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer the bundled templates and run the helper script `new_notebook.py` to generate a clean starting notebook.

30158

unsloth

zechenzhangAGI

Expert guidance for fast fine-tuning with Unsloth - 2-5x faster training, 50-80% less memory, LoRA/QLoRA optimization

15117

clojure-write

metabase

Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.

1690

add-uint-support

pytorch

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

1883

python-pro

sickn33

Master Python 3.12+ with modern features, async programming, performance optimization, and production-ready practices. Expert in the latest Python ecosystem including uv, ruff, pydantic, and FastAPI. Use PROACTIVELY for Python development, optimization, or advanced Python patterns.

2358

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

Search skills

Search the agent skills registry