Zig Programming Language
Entry point for Zig development. Provides an overview, version awareness, and routes to focused skills.
Anti-fabrication
This skill follows core:anti-fabrication. Zig is pre-1.0 with every minor release
breaking std and build APIs, so version-migration claims are the highest-risk content
in this plugin. Verified against zig 0.16.0 (locally installed, claude-skills-204) by
compiling the documented snippets: references/migration-0.16.md's claim that
std.c.arc4random_buf is BSD/Darwin-only was refuted by its own citation (lib/std/c.zig
covers Linux/Android too) and corrected to a compile-probed target table, and
references/version-history.md's listing of fmt.bufPrintZ under "Renamed" was
corrected — it is still present, deprecated in favor of bufPrintSentinel. Re-verify
against a locally installed zig version before asserting a std API claim this skill
doesn't cover — see plugins/languages/zig/skills/sources.md for the full per-claim
record.
Available Skills
This plugin provides focused skills for specific Zig topics:
- zig:language - Core language: comptime, error handling, data types, slices, defer
- zig:build - Build system: build.zig, cross-compilation, dependencies, CI
- zig:allocators - Memory management: allocator types, patterns, leak detection
- zig:testing - Built-in test framework, test allocator, build integration
- zig:c-interop - C interoperability: @cImport, type mappings, translate-c, linking
- zig:troubleshooting - Common errors, debugging, runtime panics, memory issues
Version Awareness
Zig is pre-1.0: every minor release carries breaking changes. Run zig version
first and match guidance to the installed toolchain. This plugin documents
0.16.0 (current stable, released 2026-04-13); 0.15.x and 0.14.x notes are
retained for migration. Check https://ziglang.org/download/index.json for the
release list — GitHub tags lag behind (they stop at 0.15.2).
When borrowing an upstream example, compare it with that project's source and
compiler manifest at a pinned commit. Report any disagreement with general or
official documentation and follow the consuming project's existing pin; do not
silently change its toolchain. For example, Ghostty commit
44f2a44
records Zig 0.16.0 even when Ghostty's official build documentation still
describes 0.15.2.
| Version |
Template |
Highlights |
| 0.16.0 |
templates/0.16.0/mise.toml |
std.Io async architecture (all blocking ops take io, io.async/Future, Io.Threaded), @cImport deprecated for b.addTranslateC(), @Type replaced by dedicated builtins, "juicy main" main(init: std.process.Init), sync primitives moved to std.Io.* |
| 0.15.2 |
templates/0.15.2/mise.toml |
std.Io Reader/Writer redesign ("Writergate"), unmanaged std.ArrayList default, usingnamespace and async/await removed, top-level root_source_file removed from build options, {f} format specifier, self-hosted x86_64 Debug backend |
| 0.14.1 |
templates/0.14.1/mise.toml |
Managed std.ArrayList, root_module introduced (old fields deprecated), build.zig.zon fingerprint + enum-literal name |
The full breaking-change tables and 0.14 → 0.15 migration checklist live in
references/version-history.md. For concrete 0.15 → 0.16 before/after code
snippets (sync primitives, Reader API, ArrayList, ordered maps, C interop,
process API, macOS 26 build) see references/migration-0.16.md.
Quick Start
# Install via mise (pin the exact version)
mise use zig@0.16.0
# Create a new project
mkdir myproject && cd myproject
zig init # add --minimal for just a build.zig.zon stub (0.15+)
Copy templates/0.16.0/mise.toml into the project for build/test/fmt/watch
tasks. Projects pinned to older toolchains use templates/0.15.2/mise.toml or
templates/0.14.1/mise.toml.
Key Principles
- No hidden control flow: if code does not look like it calls a function, it does not
- No hidden memory allocations: allocators are explicit parameters
- No preprocessor, no macros: comptime replaces both
- Explicit over implicit: be clear about allocations, errors, ownership
- Performance and safety: both achievable without compromise
- C ecosystem integration: use existing C libraries without depending on libc
- Cross-compilation first-class: target any platform from any platform
1---2name: zig3description: Guide for Zig programming language. Use when writing Zig code, setting up Zig projects, migrating between Zig versions, or needing an overview of Zig development workflows.4metadata:5 source: https://skillmd.com/skills/vinnie357/zig6---78# Zig Programming Language910Entry point for Zig development. Provides an overview, version awareness, and routes to focused skills.1112## Anti-fabrication1314This skill follows `core:anti-fabrication`. Zig is pre-1.0 with every minor release15breaking `std` and build APIs, so version-migration claims are the highest-risk content16in this plugin. Verified against zig 0.16.0 (locally installed, claude-skills-204) by17compiling the documented snippets: `references/migration-0.16.md`'s claim that18`std.c.arc4random_buf` is BSD/Darwin-only was refuted by its own citation (`lib/std/c.zig`19covers Linux/Android too) and corrected to a compile-probed target table, and20`references/version-history.md`'s listing of `fmt.bufPrintZ` under "Renamed" was21corrected — it is still present, deprecated in favor of `bufPrintSentinel`. Re-verify22against a locally installed `zig version` before asserting a `std` API claim this skill23doesn't cover — see `plugins/languages/zig/skills/sources.md` for the full per-claim24record.2526## Available Skills2728This plugin provides focused skills for specific Zig topics:2930- **zig:language** - Core language: comptime, error handling, data types, slices, defer31- **zig:build** - Build system: build.zig, cross-compilation, dependencies, CI32- **zig:allocators** - Memory management: allocator types, patterns, leak detection33- **zig:testing** - Built-in test framework, test allocator, build integration34- **zig:c-interop** - C interoperability: @cImport, type mappings, translate-c, linking35- **zig:troubleshooting** - Common errors, debugging, runtime panics, memory issues3637## Version Awareness3839Zig is pre-1.0: every minor release carries breaking changes. Run `zig version`40first and match guidance to the installed toolchain. This plugin documents41**0.16.0** (current stable, released 2026-04-13); 0.15.x and 0.14.x notes are42retained for migration. Check https://ziglang.org/download/index.json for the43release list — GitHub tags lag behind (they stop at 0.15.2).4445When borrowing an upstream example, compare it with that project's source and46compiler manifest at a pinned commit. Report any disagreement with general or47official documentation and follow the consuming project's existing pin; do not48silently change its toolchain. For example, Ghostty commit49[`44f2a44`](https://github.com/ghostty-org/ghostty/blob/44f2a44df7e8c4a0c6df3f7d872ef3d7ead88e51/build.zig.zon#L2-L6)50records Zig 0.16.0 even when Ghostty's official build documentation still51describes 0.15.2.5253| Version | Template | Highlights |54|---|---|---|55| 0.16.0 | `templates/0.16.0/mise.toml` | `std.Io` async architecture (all blocking ops take `io`, `io.async`/`Future`, `Io.Threaded`), `@cImport` deprecated for `b.addTranslateC()`, `@Type` replaced by dedicated builtins, "juicy main" `main(init: std.process.Init)`, sync primitives moved to `std.Io.*` |56| 0.15.2 | `templates/0.15.2/mise.toml` | `std.Io` Reader/Writer redesign ("Writergate"), unmanaged `std.ArrayList` default, `usingnamespace` and `async`/`await` removed, top-level `root_source_file` removed from build options, `{f}` format specifier, self-hosted x86_64 Debug backend |57| 0.14.1 | `templates/0.14.1/mise.toml` | Managed `std.ArrayList`, `root_module` introduced (old fields deprecated), `build.zig.zon` `fingerprint` + enum-literal `name` |5859The full breaking-change tables and 0.14 → 0.15 migration checklist live in60`references/version-history.md`. For concrete 0.15 → 0.16 before/after code61snippets (sync primitives, Reader API, ArrayList, ordered maps, C interop,62process API, macOS 26 build) see `references/migration-0.16.md`.6364## Quick Start6566```bash67# Install via mise (pin the exact version)68mise use zig@0.16.06970# Create a new project71mkdir myproject && cd myproject72zig init # add --minimal for just a build.zig.zon stub (0.15+)73```7475Copy `templates/0.16.0/mise.toml` into the project for build/test/fmt/watch76tasks. Projects pinned to older toolchains use `templates/0.15.2/mise.toml` or77`templates/0.14.1/mise.toml`.7879## Key Principles8081- **No hidden control flow**: if code does not look like it calls a function, it does not82- **No hidden memory allocations**: allocators are explicit parameters83- **No preprocessor, no macros**: comptime replaces both84- **Explicit over implicit**: be clear about allocations, errors, ownership85- **Performance and safety**: both achievable without compromise86- **C ecosystem integration**: use existing C libraries without depending on libc87- **Cross-compilation first-class**: target any platform from any platform