Agent skill

Zig

by simoarpe in simoarpe/ziggity

Up-to-date Zig programming language patterns for version 0.15.x.

MITAuto-check passedDevelopment

Install Zig

skills CLI
$ npx skills add simoarpe/ziggity --skill zig -a claude-code

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

GitHub CLI
$ gh skill install simoarpe/ziggity zig --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/simoarpe/ziggity.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/zig .claude/skills/zig && 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
zig
GitHub stars
284
Token cost
~4.1k tokens
SKILL.md length
1,084 words
Files
57 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Up-to-date Zig programming language patterns for version 0.15.x.

  • Debugging Zig code
  • SKILL.md covers Critical: Removed Features…, Critical: I/O API Rewrite…, Critical: Build System (0.15.x) and Critical: Container…, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Working with build.zig and build.zig.zon files

What it does

Zig is an agent skill from simoarpe/ziggity. Up-to-date Zig programming language patterns for version 0.15.x. Use when writing, reviewing, or debugging Zig code, working with build.zig and build.zig.zon files, or using comptime metaprogramming. Critical for avoiding outdated patterns from training data - especially build system APIs (rootmodule instead of rootsourcefile), I/O APIs (buffered writer pattern), container initialization (.empty/.init), allocator selection (DebugAllocator), and removed language features (async/await, usingnamespace).

Its SKILL.md is about 4.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 57 other files, including reference files (for example `references/builtins.md`, `references/c-interop.md` and `references/code-review.md`).

It sits in Development, covering Async programming. It works with Git. The repository describes itself as: ⚡️ Ziggity an ultra fast, keyboard driven terminal UI for Git, written in Zig. The licence is MIT.

When your agent uses it

  • Debugging Zig code
  • Working with build.zig and build.zig.zon files
  • Using comptime metaprogramming

Example prompts

  • “/zig”

What it can do on your machine

Read from SKILL.md and the folder at commit 3075fba. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are zig).

    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

Zig loads about 4.1k tokens when it runs, and up to ~163k if it reads all its reference files. Until then it costs about 128 tokens; SKILL.md has 1,084 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~128
When it runs · the whole SKILL.md, loaded when a task matches
~4.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~163k

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 simoarpe/ziggity at commit 3075fba, republished under its MIT licence (© simoarpe). 1,084 words, ~4,142 tokens.

Download SKILL.mdSave it as .claude/skills/zig/SKILL.md (or your agent's skills folder). This skill also uses 56 other files; get the full folder from GitHub.
name
zig
description
Up-to-date Zig programming language patterns for version 0.15.x. Use when writing, reviewing, or debugging Zig code, working with build.zig and build.zig.zon files, or using comptime metaprogramming. Critical for avoiding outdated patterns from training data - especially build system APIs (root_module instead of root_source_file), I/O APIs (buffered writer pattern), container initialization (.empty/.init), allocator selection (DebugAllocator), and removed language features (async/await, usingnamespace).

Zig Language Reference (v0.15.2)

Zig evolves rapidly. Training data contains outdated patterns that cause compilation errors. This skill documents breaking changes and correct modern patterns.

Critical: Removed Features (0.15.x)

usingnamespace - REMOVED
zig
// WRONG - compile error
pub usingnamespace @import("other.zig");

// CORRECT - explicit re-export
const other = @import("other.zig");
pub const foo = other.foo;
async/await - REMOVED

Keywords removed from language. Async I/O support is planned for future releases.

Critical: I/O API Rewrite ("Writergate")

The entire std.io API changed. New std.Io.Writer and std.Io.Reader are non-generic with buffer in the interface.

Writing
zig
// WRONG - old API
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello\n", .{});

// CORRECT - new API: provide buffer, access .interface, flush
var buf: [4096]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buf);
const stdout = &stdout_writer.interface;
try stdout.print("Hello\n", .{});
try stdout.flush();  // REQUIRED!
Reading
zig
// Reading from file
var buf: [4096]u8 = undefined;
var file_reader = file.reader(&buf);
const r = &file_reader.interface;

// Read line by line (takeDelimiter returns null at EOF)
while (try r.takeDelimiter('\n')) |line| {
    // process line (doesn't include '\n')
}

// Read binary data
const header = try r.takeStruct(Header, .little);
const value = try r.takeInt(u32, .big);
Fixed Buffer Writer (no file)
zig
var buf: [256]u8 = undefined;
var w: std.Io.Writer = .fixed(&buf);
try w.print("Hello {s}", .{"world"});
const result = w.buffered();  // "Hello world"
Fixed Reader (from slice)
zig
var r: std.Io.Reader = .fixed("hello\nworld");
const line = (try r.takeDelimiter('\n')).?;  // "hello" (returns null at EOF)

Deprecated: BufferedWriter, CountingWriter, std.io.bufferedWriter()

Deprecated: GenericWriter, GenericReader, AnyWriter, AnyReader, FixedBufferStream

New: std.Io.Writer, std.Io.Reader - non-generic, buffer in interface

Replacements:

  • CountingWriter → std.Io.Writer.Discarding (has .fullCount())
  • BufferedWriter → buffer provided to .writer(&buf) call
  • Allocating output → std.Io.Writer.Allocating

Critical: Build System (0.15.x)

root_source_file is REMOVED from addExecutable/addLibrary/addTest. Use root_module:

zig
// WRONG - removed field
b.addExecutable(.{
    .name = "app",
    .root_source_file = b.path("src/main.zig"),  // ERROR
    .target = target,
});

// CORRECT
b.addExecutable(.{
    .name = "app",
    .root_module = b.createModule(.{
        .root_source_file = b.path("src/main.zig"),
        .target = target,
        .optimize = optimize,
    }),
});

Module imports changed:

zig
// WRONG (old API)
exe.addModule("helper", helper_mod);

// CORRECT
exe.root_module.addImport("helper", helper_mod);

Adding dependency modules:

zig
const dep = b.dependency("lib", .{ .target = target, .optimize = optimize });
exe.root_module.addImport("lib", dep.module("lib"));

Compile-level methods deprecated: exe.linkSystemLibrary(), exe.addCSourceFiles(), exe.addIncludePath(), exe.linkLibC() are deprecated — use exe.root_module.* equivalents instead.

See std.Build reference for complete build system documentation.

Critical: Container Initialization

Never use .{} for containers. Use .empty or .init:

zig
// WRONG - deprecated
var list: std.ArrayList(u32) = .{};
var gpa: std.heap.DebugAllocator(.{}) = .{};

// CORRECT - use .empty for empty collections
var list: std.ArrayList(u32) = .empty;
var map: std.AutoHashMapUnmanaged(u32, u32) = .empty;

// CORRECT - use .init for stateful types with internal config
var gpa: std.heap.DebugAllocator(.{}) = .init;
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
Naming Changes
  • std.ArrayListUnmanaged → std.ArrayList (Unmanaged is now default, old name deprecated)
  • std.heap.GeneralPurposeAllocator → std.heap.DebugAllocator (GPA alias still works)

std.BoundedArray - REMOVED. Use:

zig
var buffer: [8]i32 = undefined;
var stack = std.ArrayList(i32).initBuffer(&buffer);

Critical: Format Strings (0.15.x)

{f} required to call format methods:

zig
// WRONG - ambiguous error
std.debug.print("{}", .{std.zig.fmtId("x")});

// CORRECT
std.debug.print("{f}", .{std.zig.fmtId("x")});

Format method signature changed:

zig
// OLD - wrong
pub fn format(self: @This(), comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void

// NEW - correct
pub fn format(self: @This(), writer: *std.Io.Writer) std.Io.Writer.Error!void

Breaking Changes (0.14.0+)

@branchHint replaces @setCold
zig
// WRONG
@setCold(true);

// CORRECT
@branchHint(.cold);  // Must be first statement in block
@export takes pointer
zig
// WRONG
@export(foo, .{ .name = "bar" });

// CORRECT
@export(&foo, .{ .name = "bar" });
Inline asm clobbers are typed
zig
// WRONG
: "rcx", "r11"

// CORRECT
: .{ .rcx = true, .r11 = true }
@fence - REMOVED

Use stronger atomic orderings or RMW operations instead.

Decl Literals (0.14.0+)

.identifier syntax works for declarations:

zig
const S = struct {
    x: u32,
    const default: S = .{ .x = 0 };
    fn init(v: u32) S { return .{ .x = v }; }
};

const a: S = .default;      // S.default
const b: S = .init(42);     // S.init(42)
const c: S = try .init(1);  // works with try

Labeled Switch (0.14.0+)

State machines use continue :label:

zig
state: switch (initial) {
    .idle => continue :state .running,
    .running => if (done) break :state result else continue :state .running,
    .error => return error.Failed,
}

Non-exhaustive Enum Switch (0.15.x)

Can mix explicit tags with _ and else:

zig
switch (value) {
    .a, .b => {},
    else => {},  // other named tags
    _ => {},     // unnamed integer values
}

Quick Fixes

ErrorFix
no field 'root_source_file'Use root_module = b.createModule(.{...})
use of undefined valueArithmetic on undefined is now illegal
type 'f32' cannot represent integerUse float literal: 123_456_789.0 not 123_456_789
ambiguous format stringUse {f} for format methods
sanitize_c = trueType changed to ?std.zig.SanitizeC — use .full, .trap, or .off
std.fifo.LinearFifoRemoved — use std.Io.Reader/Writer patterns
posix.sendfileRemoved — use std.fs.File writer .sendFileAll()
std.fmt.FormatterDeprecated — renamed to std.fmt.Alt
fmtSliceEscapeLower/UpperUse std.ascii.hexEscape(bytes, .lower/.upper)

Language References

Load these references when working with core language features:

Code Style
  • Style Guide - Official Zig naming conventions (TitleCase types, camelCase functions, snake_case variables), whitespace rules, doc comment guidance, redundancy avoidance, zig fmt
Language Basics & Built-ins
  • Language Basics - Core language: types, control flow (if/while/for/switch), error handling (try/catch/errdefer), optionals, structs, enums, unions, pointers, slices, comptime, functions
  • Built-in Functions - All @ built-ins: type casts (@intCast, @bitCast, @ptrCast), arithmetic (@addWithOverflow, @divExact), bit ops (@clz, @popCount), memory (@memcpy, @sizeOf), atomics (@atomicRmw, @cmpxchgWeak), introspection (@typeInfo, @TypeOf, @hasDecl), SIMD (@Vector, @splat, @reduce), C interop (@cImport, @export)

Standard Library References

Load these references when working with specific modules:

Memory & Slices
  • std.mem - Slice search/compare, split/tokenize, alignment, endianness, byte conversion
Text & Encoding
  • std.fmt - Format strings, integer/float parsing, hex encoding, custom formatters, {f} specifier (0.15.x)
  • std.ascii - ASCII character classification (isAlpha, isDigit), case conversion, case-insensitive comparison
  • std.unicode - UTF-8/UTF-16 encoding/decoding, codepoint iteration, validation, WTF-8 for Windows
  • std.base64 - Base64 encoding/decoding (standard, URL-safe, with/without padding)
Math & Random
  • std.math - Floating-point ops, trig, overflow-checked arithmetic, constants, complex numbers, big integers
  • std.Random - PRNGs (Xoshiro256, Pcg), CSPRNGs (ChaCha), random integers/floats/booleans, shuffle, distributions
  • std.hash - Non-cryptographic hash functions (Wyhash, XxHash, FNV, Murmur, CityHash), checksums (CRC32, Adler32), auto-hashing
SIMD & Vectorization
  • std.simd - SIMD vector utilities: optimal vector length, iota/repeat/join/interlace patterns, element shifting/rotation, parallel searching, prefix scans, branchless selection
Time & Timing
  • std.time - Wall-clock timestamps, monotonic Instant/Timer, epoch conversions, calendar utilities (year/month/day), time unit constants
  • std.Tz - TZif timezone database parsing (RFC 8536), UTC offsets, DST rules, timezone abbreviations, leap seconds
Sorting & Searching
  • std.sort - Sorting algorithms (pdq, block, heap, insertion), binary search, min/max
Core Data Structures
Show full SKILL.md (425 more words)Show less
Allocators
  • std.heap - Allocator selection guide, ArenaAllocator, DebugAllocator, FixedBufferAllocator, MemoryPool, SmpAllocator, ThreadSafeAllocator, StackFallbackAllocator, custom allocator implementation
I/O & Files
  • std.io - Reader/Writer API (0.15.x): buffered I/O, streaming, binary data, format strings
  • std.fs - File system: files, directories, iteration, atomic writes, paths
  • std.tar - Tar archive reading/writing, extraction, POSIX ustar, GNU/pax extensions
  • std.zip - ZIP archive reading/extraction, ZIP64 support, store/deflate compression
  • std.compress - Compression: DEFLATE (gzip, zlib), Zstandard, LZMA, LZMA2, XZ decompression/compression
Networking
  • std.http - HTTP client/server, TLS, connection pooling, compression, WebSocket
  • std.net - TCP/UDP sockets, address parsing, DNS resolution
  • std.Uri - URI parsing/formatting (RFC 3986), percent-encoding/decoding, relative URI resolution
Process Management
  • std.process - Child process spawning, environment variables, argument parsing, exec
OS-Specific APIs
  • std.os - OS-specific APIs: Linux syscalls, io_uring, Windows NT APIs, WASI, direct platform access
  • std.c - C ABI types and libc bindings: platform-specific types (fd_t, pid_t, timespec), errno values, socket/signal/memory types, fcntl/open flags, FFI with C libraries
Concurrency
  • std.Thread - Thread spawning, Mutex, RwLock, Condition, Semaphore, WaitGroup, thread pools
  • std.atomic - Lock-free atomic operations: Value wrapper, fetch-and-modify (add/sub/and/or/xor), compare-and-swap, atomic ordering semantics, spin loop hints, cache line sizing
Patterns & Best Practices
  • Zig Patterns - Load when writing new code or reviewing code quality. Comprehensive best practices extracted from the Zig standard library: quick patterns (memory/allocators, file I/O, HTTP, JSON, testing, build system) plus idiomatic code patterns covering syntax (closures, context pattern, options structs, destructuring), polymorphism (duck typing, generics, custom formatting, dynamic/static dispatch), safety (diagnostics, error payloads, defer/errdefer, compile-time assertions), and performance (const pointer passing)
  • Code Review - Load when reviewing Zig code. Systematic checklist organized by confidence level: ALWAYS FLAG (removed features, changed syntax, API changes), FLAG WITH CONTEXT (exception safety bugs, missing flush, allocator issues), SUGGEST (style improvements). Includes migration examples for 0.14/0.15 breaking changes
Serialization
  • std.json - JSON parsing, serialization, dynamic values, streaming, custom parse/stringify
  • std.zon - ZON (Zig Object Notation) parsing and serialization for build.zig.zon, config files, data interchange
Testing & Debug
  • std.testing - Unit test assertions and utilities
  • std.debug - Panic, assert, stack traces, hex dump, format specifiers
  • std.log - Scoped logging with configurable levels and output
Metaprogramming
  • Comptime Reference - Comptime fundamentals, type reflection (@typeInfo/@Type/@TypeOf), loop variants (comptime for vs inline for), branch elimination, type generation, comptime limitations
  • std.meta - Type introspection, field iteration, stringToEnum, generic programming
Compiler Utilities
  • std.zig - AST parsing, tokenization, source analysis, linters, formatters, ZON parsing
Security & Cryptography
  • std.crypto - Hashing (SHA2, SHA3, Blake3), AEAD (AES-GCM, ChaCha20-Poly1305), signatures (Ed25519, ECDSA), key exchange (X25519), password hashing (Argon2, scrypt, bcrypt), secure random, timing-safe operations
Build System
  • std.Build - Build system: build.zig, modules, dependencies, build.zig.zon, steps, options, testing, C/C++ integration
Interoperability
  • C Interop - Exporting C-compatible APIs: export fn, C calling convention, building static/dynamic libraries, creating headers, macOS universal binaries, XCFramework for Swift/Xcode, module maps

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

Files

SKILL.md and 56 other files (references) in .claude/skills/zig of simoarpe/ziggity.

  • SKILL.md
  • .DS_Store
  • references/builtins.md
  • references/c-interop.md
  • references/code-review.md
  • references/comptime.md
  • references/language.md
  • references/patterns.md
  • references/std-allocators.md
  • references/std-array-hash-map.md
  • references/std-arraylist.md
  • references/std-ascii.md
  • references/std-atomic.md
  • references/std-base64.md
  • references/std-bit-set.md
  • references/std-buf-map.md
  • references/std-build.md
  • references/std-c.md
  • references/std-compress.md
  • references/std-crypto.md
  • … and 37 more

Open the folder on GitHubat commit 3075fba

Compare with similar skills

Zig 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.

Zig compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zig this skillsimoarpe/ziggity284—~4.1kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything86k1 repos~1.2kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Understand Diff AnalysisEgonex-AI/Understand-Anything86k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • 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
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    86k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    86k GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed

Works with

Categories

Questions about Zig

What does Zig do?

Up-to-date Zig programming language patterns for version 0.15.x. Zig is an agent skill from simoarpe/ziggity.x.

When should I use Zig?

Zig fits situations like: debugging Zig code; working with build.zig and build.zig.zon files; using comptime metaprogramming.

How do I install Zig in Claude Code?

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

How do I install Zig in Codex?

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

Can I use Zig 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 simoarpe/ziggity --skill zig -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zig, .gemini/skills/zig, .github/skills/zig and .opencode/skills/zig in your project.

What does Zig need to run?

SKILL.md names no scripts, command-line tools or credentials: Zig is instructions for the agent only.

Does Zig 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 Zig 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 Zig use?

Zig 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 Zig use?

About 4.1k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 159k tokens, read only when the agent opens those files.

What are the alternatives to Zig?

Skills that share tags, products or a category with Zig: Finishing a Development Branch (obra/superpowers, 296k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 86k stars) and Code Design Rationale Investigator (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zig?

simoarpe (a GitHub user) maintains it in simoarpe/ziggity, which has 284 GitHub stars. The repository was last updated on October 5, 2026.

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