Agent skill

Pyzig

by atopile in atopile/atopile

How the Zig↔Python binding layer works (pyzig), including build-on-import, wrapper generation patterns, ownership rules, and where to add new exported APIs.

MITAuto-check passedDevelopment

Install Pyzig

skills CLI
$ npx skills add atopile/atopile --skill pyzig -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install atopile/atopile pyzig --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/atopile/atopile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/pyzig .claude/skills/pyzig && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pyzig
GitHub stars
4k
Token cost
~1k tokens
SKILL.md length
361 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

How the Zig↔Python binding layer works (pyzig), including build-on-import, wrapper generation patterns, ownership rules, and where to add new exported APIs.

  • Works in 3 steps: Edit Zig → Rebuild native modules → If you changed stubs/output
  • Adding Zig-Python bindings
  • SKILL.md covers Quick Start, Relevant Files, Dependants (Call Sites) and How to Work With / Develop /…, plus 2 more sections
  • Calls python

What it does

Pyzig is an agent skill from atopile/atopile. 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.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Python. The repository describes itself as: Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️. The licence is MIT.

When your agent uses it

  • Adding Zig-Python bindings
  • Modifying native extensions
  • Debugging C-API interactions

Example prompts

  • “/pyzig”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Edit Zig
  2. Rebuild native modules
  3. If you changed stubs/output

What it can do on your machine

Read from SKILL.md and the folder at commit 619eda7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pyzig loads about 1k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 361 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from atopile/atopile at commit 619eda7, republished under its MIT licence (© atopile). 361 words, ~1,031 tokens.

Download SKILL.mdSave it as .claude/skills/pyzig/SKILL.md (or your agent's skills folder).
name
pyzig
description
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.

Pyzig Module

pyzig is the Zig↔Python interoperability layer used by Faebryk’s native modules (graph, sexp, faebryk typegraph, …).

There are three distinct layers to keep straight:

  • Python loader/glue: src/faebryk/core/zig/__init__.py (build-on-import + .pyi syncing)
  • Zig build: src/faebryk/core/zig/build.zig (builds pyzig.so + pyzig_sexp.so, generates stubs)
  • Zig binding utilities: src/faebryk/core/zig/src/pyzig/* (wrapper generation + minimal C-API surface)

Quick Start

bash
ato dev compile
python -c "import faebryk.core.zig; import faebryk.core.graph"

Relevant Files

  • Python-side loader/build glue:
    • src/faebryk/core/zig/__init__.py (ZIG_NORECOMPILE, ZIG_RELEASEMODE, lock, stub syncing)
  • Zig build + stub generation:
    • src/faebryk/core/zig/build.zig (builds extensions + runs .pyi generator)
  • Core pyzig utilities:
    • src/faebryk/core/zig/src/pyzig/pybindings.zig (minimal CPython C-API declarations)
    • src/faebryk/core/zig/src/pyzig/pyzig.zig (wrapper generation helpers)
    • src/faebryk/core/zig/src/pyzig/type_registry.zig (global type-object registry)
    • src/faebryk/core/zig/src/pyzig/pyi.zig (stub generation helpers)
  • Example consumers:
    • src/faebryk/core/zig/src/python/graph/graph_py.zig
    • src/faebryk/core/zig/src/python/sexp/sexp_py.zig

Dependants (Call Sites)

  • Graph bindings: src/faebryk/core/zig/src/python/graph/*
  • Sexp bindings: src/faebryk/core/zig/src/python/sexp/*
  • TypeGraph bindings: src/faebryk/core/zig/src/python/faebryk/* (and friends)

How to Work With / Develop / Test

Core Concepts
  • Direct binding: pyzig calls the CPython C-API directly (no cffi/ctypes).
  • Wrapper types: most exposed Zig structs become Python heap types via wrap_in_python(...) / wrap_in_python_simple(...).
  • Global type registry: prevents re-creating Python PyTypeObjects for the same Zig type (type_registry).
  • No direct __init__ (by default): many “reference” types are not meant to be user-constructed; pyzig often installs an init that raises.
  • Debug handle: generated wrappers include __zig_address__() to help debug pointer identity.
Development Workflow
  1. Edit Zig:
    • binding helpers: src/faebryk/core/zig/src/pyzig/*
    • module wrappers: src/faebryk/core/zig/src/python/**
  2. Rebuild native modules:
    • ato dev compile (imports faebryk.core.zig; editable installs compile-on-import)
    • set ZIG_RELEASEMODE=ReleaseFast|ReleaseSafe|Debug as needed
  3. If you changed stubs/output:
    • ensure src/faebryk/core/zig/gen/** gets updated (this is driven by src/faebryk/core/zig/__init__.py)
Show full SKILL.md (135 more words)Show less
Testing
  • Smoke tests are usually through downstream modules:
    • python -m faebryk.core.graph (GraphView allocation/cleanup stress)
    • ato dev test --llm test/core/solver (heavy user of graph + bindings via many subsystems)

Best Practices

  • Assume mistakes segfault: treat changes here like unsafe systems programming.
  • Be explicit about ownership:
    • if a wrapper allocates Zig memory, define how it is freed (explicit .destroy() vs tp_dealloc calling .deinit()).
    • if you duplicate input buffers (sexp does), expose a free(...) path and document it.
  • Don’t rely on Python GC for Zig arenas unless you intentionally installed a tp_dealloc that calls deinit.
  • Stub hygiene matters: keep the .pyi surface accurate; many callers rely on types for navigation.

Build-on-import behavior (important)

src/faebryk/core/zig/__init__.py is responsible for:

  • compiling extensions in editable installs (unless ZIG_NORECOMPILE=1)
  • loading pyzig.so and pyzig_sexp.so from src/faebryk/core/zig/zig-out/lib/
  • copying + formatting generated .pyi files into src/faebryk/core/zig/gen/** (black + ruff)

© atopile, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/pyzig of atopile/atopile.

Open the folder on GitHubat commit 619eda7

Compare with similar skills

Pyzig next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pyzig compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pyzig this skillatopile/atopile4k—~1kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Summarise Ecosystem Resultsastral-sh/ruff50k1 repos~2.2kAutomated safety check: PassMIT
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Merge Dependabot PRsonyx-dot-app/onyx32k1 repos~2.2kAutomated safety check: PassMIT
Code Graph Mermaid Diagramstrailofbits/skills7.4k1 repos~1.7kAutomated safety check: PassCC-BY-SA-4.0

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "summarise ecosystem results", "summarize this ty ecosystem report", "what changed in this ecosystem run?", or asks to summarise or summarize ty ecosystem…

    50k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Merge Dependabot PRs

    onyx-dot-app/onyx

    Triages and lands a batch of open Dependabot PRs in the Onyx repo, where main is gated exclusively by GitHub's merge queue: approves and enqueues green PRs, closes superseded duplicates, fixes…

    32k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.4k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 2 repos~1.2k tokens
    DevelopmentAuto-check passed

More from atopile/atopile

All 19 skills in this repo
  • Ato Language

    atopile/atopile

    Reference for the .ato declarative DSL: type system, connection semantics, constraint model, and standard library.

    4k GitHub stars~3.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Compiler

    atopile/atopile

    How the atopile compiler builds and links TypeGraphs from .ato (ANTLR front-end → AST → TypeGraph → Linker → DeferredExecutor), plus the key invariants and test entrypoints.

    4k GitHub stars~1k tokensUpdated 3 mo ago
    Auto-check passed
  • Domain Layer

    atopile/atopile

    Instructions for electronics-specific logic and build processes: netlists, PCBs, build steps, and exporters.

    4k GitHub stars~791 tokensUpdated 3 mo ago
    Auto-check passed
  • Fabll

    atopile/atopile

    How FabLL (faebryk.core.node) maps Python node/trait declarations into the TypeGraph + instance graph, including field/trait invariants and instantiation patterns.

    4k GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Faebryk

    atopile/atopile

    How Faebryk's TypeGraph works (GraphView + Zig edges), how to traverse/resolve references, and how FabLL types/traits map onto edge types.

    4k GitHub stars~861 tokensUpdated 3 mo ago
    Auto-check passed
  • Graph

    atopile/atopile

    How the Zig-backed instance graph works (GraphView/NodeReference/EdgeReference), the real Python API surface, and the invariants around allocation, attributes, and cleanup.

    4k GitHub stars~952 tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Pyzig

What does Pyzig do?

How the Zig↔Python binding layer works (pyzig), including build-on-import, wrapper generation patterns, ownership rules, and where to add new exported APIs. Pyzig is an agent skill from atopile/atopile. How the Zig↔Python binding layer works (pyzig), including build-on-import, wrapper generation patterns, ownership rules, and where to add new exported APIs.

When should I use Pyzig?

Pyzig fits situations like: adding Zig-Python bindings; modifying native extensions; debugging C-API interactions.

How do I install Pyzig in Claude Code?

Run `npx skills add atopile/atopile --skill pyzig -a claude-code`. Or copy the skill folder (.claude/skills/pyzig in atopile/atopile) into .claude/skills/pyzig in your project. Claude Code loads it when a task matches its description.

How do I install Pyzig in Codex?

Run `npx skills add atopile/atopile --skill pyzig -a codex`. Or copy the skill folder (.claude/skills/pyzig in atopile/atopile) into .agents/skills/pyzig in your project. Codex loads it when a task matches its description.

Can I use Pyzig in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add atopile/atopile --skill pyzig -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pyzig, .gemini/skills/pyzig, .github/skills/pyzig and .opencode/skills/pyzig in your project.

What does Pyzig need to run?

Going by SKILL.md and its folder, Pyzig needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Pyzig access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Pyzig safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pyzig use?

Pyzig is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pyzig use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pyzig?

Skills that share tags, products or a category with Pyzig: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Summarise Ecosystem Results (astral-sh/ruff, 50k stars), Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars) and Merge Dependabot PRs (onyx-dot-app/onyx, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pyzig?

atopile (a GitHub organization) maintains it in atopile/atopile, which has 3,976 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on June 13, 2026.

Source: atopile/atopile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.