zig-guide

Installation
SKILL.md

Zig Guide

Applies to: Zig 0.13+, Systems Programming, CLIs, Embedded, Game Engines, C/C++ Replacement

Core Principles

  1. Explicit Over Implicit: No hidden control flow, no hidden allocations, no operator overloading, no implicit conversions
  2. Allocator Passing: Every function that allocates receives an std.mem.Allocator as a parameter; never use a global allocator
  3. Errors Are Values: Use error unions (!) with try, catch, and errdefer; never silently discard errors
  4. Comptime Over Runtime: Move computation to compile time with comptime; use it for generics, validation, and code generation
  5. Safety With Escape Hatches: Keep runtime safety enabled by default; disable only in measured hot paths with a justifying comment

Guardrails

Code Style

  • Run zig fmt before every commit (non-negotiable)
  • camelCase functions/variables, PascalCase types/structs/enums, SCREAMING_SNAKE_CASE module constants
  • Prefer snake_case for file names (my_module.zig)
Related skills
Installs
11
Repository
ar4mirez/samuel
First Seen
Mar 1, 2026