zig-tiger-style
TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase.
Skill by Yabuku-xD
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/yabuku-xd-zig-tiger-style
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/zig-tiger-style
What's inside
- Skill name
zig-tiger-style- Description
- TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase. Use this skill whenever the user is writing, reviewing, or refactoring Zig code, asking about Zig idioms, best practices, assertions, memory layout, naming conventions, or code style. Also trigger when the user asks how to structure Zig structs, handle errors, write safe loops, or design Zig APIs. Even if the user just says "write me some Zig" or pastes Zig code for review, consult this skill first.
- License
- MIT
- Instructions
- 254 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# TigerStyle: Zig Coding Guidelines
Distilled from TigerBeetle's [TIGER_STYLE.md](https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TIGER_STYLE.md).
Design goal priority: **Safety > Performance > Developer Experience**.
---
## 1. Safety
### Control Flow
- Use only **simple, explicit control flow**. No recursion unless provably bounded.
- Split compound conditions into nested `if/else` branches — ensure both the positive and negative
spaces are handled or asserted.
- State invariants positively:
```zig
// preferred
if (index < length) { ... } else { ... }
// avoid
if (index >= length) { ... }
```
- Every `if` branch should prompt the question: does a corresponding `else` also need to be handled?
### Assertions
Assertions detect **programmer errors** — not expected runtime errors. The only correct response
to corrupt state is to crash. Assertions downgrade catastrophic correctness bugs into liveness bugs.
- A function must not operate blindly on data it has not checked; assert arguments at the entry point.
- **Pair assertions**: for any property you want to enforce, add assertions on at least two different
code paths (e.g. just before writing to disk, and immediately after reading back).
- Split compound assertions:
```zig
// preferred
assert(a);
assert(b);
// avoid
assert(a and b);
```
- Use a single-line `if` to assert an implication: `if (a) assert(b);`
- **Assert relationships between compile-time constants** to verify design integrity before the
program even runs:
```zig
comptime assert(@sizeOf(Header) == 128);
comptime assert(config.pipeline_max <= config.batch_max);
```
- Assert both the **positive space** (what you expect to be true) and the **negative space** (what
you expect to be false) — the boundary between valid and invalid is where bugs hide.
### Memory
- Initialize large structs **in-place via an out pointer** to eliminate intermediate copies and
guarantee pointer stability:
```zig
// preferred
fn init(target: *LargeStruct) !void {
target.* = .{ ... };
}
// avoid
fn init() !LargeStruct {
return LargeStruct{ ... };
}
```
### Variable Scope
- Declare variables at the **smallest possible scope** to reduce the chance of misuse.
- Declare variables **close to where they are used** — do not introduce them before they are needed.
This avoids POCPOU bugs (a distant cousin of TOCTOU).
### Loops and Queues
- All loops and queues must have a **fixed upper bound** to prevent infinite loops or tail-latency
spikes. Follow the fail-fast principle.
- Loops that genuinely cannot terminate (e.g. an event loop) must be explicitly asserted as such.
### Error Handling
- **All errors must be handled.** Most catastrophic production failures stem from incorrect handling
of non-fatal errors.
- Never discard error return values with `_`.
### Other
- Use **explicitly-sized integer types** (`u32`, `i64`, etc.), avoid architecture-dependent `usize` when possible
- Enable and respect the **compiler's strictest warning settings** — zero tolerance for warnings.
- Do not react directly to external events inline; let the program run at its own pace (enables
batching and maintains control-flow ownership).
- **Keep functions as small as possible.** When splitting, find semantically clean cut points:
- Centralize all `if`/`switch` in the "parent" function; extract pure logic into helpers.
- Let the parent own all mutable state; helpers compute what to change but don't apply it.
- Rule of thumb: ["push `if`s up and `for`s down"](https://matklad.github.io/2023/11/15/push-ifs-up-and-fors-down.html).
---
## 2. Performance
- Solve performance in the **design phase** — the biggest wins (1000x) come from architecture,
not post-hoc profiling.
- Do **back-of-the-envelope sketches** across the four resources (network, disk, memory, CPU) and
their two characteristics (bandwidth, latency).
- Optimize slowest resources first: network → disk → memory → CPU, weighted by access frequency.
- **Batching** is the primary tool: amortize network, disk, memory, and CPU costs.
- Distinguish **control plane** from **data plane**; batching lets both coexist safely and fast.
- Extract hot-path loops into **standalone functions with primitive arguments** (no `self`) so the
compiler can cache fields in registers and humans can spot redundant work:
```zig
// hot loop extracted, no self
fn process_batch(items: []const Item, result: []Output) void { ... }
```
- Be explicit. Do not rely on the compiler to do the right thing.
- **Always pass options explicitly** at library call sites — never rely on defaults:
```zigFrom Yabuku-xD/omfx, MIT.
More from Yabuku-xD/omfx
- 0.529score
zig-memory-management
Yabuku-xD
Memory management in Zig including allocators, pointers, slices, alignment, and ownership patterns.
SkillBFreshness: BClaude Code +9 - 0.524score
zig-comptime
Yabuku-xD
Zig comptime skill for compile-time evaluation and metaprogramming.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-debugging
Yabuku-xD
Zig debugging skill.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-code-review
Yabuku-xD
Review Zig project code for style, correctness, and logic.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-testing
Yabuku-xD
Zig testing skill for writing and running tests.
SkillBFreshness: BClaude Code +9 - 0.518score
zig-project-structure
Yabuku-xD
Zig 项目结构全生命周期管理。创建项目骨架(exe/lib/多模块/带依赖)或检查已有项目的目录结构、文件命名、构建配置合规性,输出结构化报告。
SkillBFreshness: BClaude Code +9 - 0.518score
zig-testing
Yabuku-xD
Zig 测试与调试技能。涉及 std.testing 的断言、测试组织、内存泄漏检测、以及 std.debug 的日志、堆栈回溯。在需要编写测试、调试代码、诊断问题时调用。
SkillBFreshness: BClaude Code +9 - 0.518score
code-audit
Yabuku-xD
Conducts an exhaustive, multi-pass, line-by-line technical audit and verification of local files or directories.
SkillBFreshness: BClaude Code +9 - 0.518score
zig-build-system
Yabuku-xD
Zig 构建系统专项技能。涉及 build.zig 和 build.zig.zon 的编写、模块管理、依赖配置、交叉编译、C/C++ 集成、自定义构建步骤和测试配置。在需要配置或调试项目构建时调用。
SkillBFreshness: BClaude Code +9 - 0.518score
zig-concurrency
Yabuku-xD
Zig 并发编程技能。涉及 std.Thread 的线程创建、同步原语(Mutex、RwLock、Condition、Semaphore、WaitGroup)、线程池和原子操作。在需要多线程或并行计算时调用。
SkillBFreshness: BClaude Code +9 - 0.516score
zig-build-system
Yabuku-xD
Zig build system skill for multi-file Zig projects.
SkillBFreshness: BClaude Code +9 - 0.515score
hello-omfx
Yabuku-xD
Example skill.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 24, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Yabuku-xD/omfx
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Yabuku-xD
- 0.529score
zig-memory-management
Yabuku-xD
Memory management in Zig including allocators, pointers, slices, alignment, and ownership patterns.
SkillBFreshness: BClaude Code +9 - 0.524score
zig-comptime
Yabuku-xD
Zig comptime skill for compile-time evaluation and metaprogramming.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-debugging
Yabuku-xD
Zig debugging skill.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-code-review
Yabuku-xD
Review Zig project code for style, correctness, and logic.
SkillBFreshness: BClaude Code +9 - 0.520score
zig-testing
Yabuku-xD
Zig testing skill for writing and running tests.
SkillBFreshness: BClaude Code +9 - 0.518score
code-audit
Yabuku-xD
Conducts an exhaustive, multi-pass, line-by-line technical audit and verification of local files or directories.
SkillBFreshness: BClaude Code +9
Cite this page
zig-tiger-style skill. Agent Mart. https://agentmart.dev/skills/yabuku-xd-zig-tiger-style (last updated 2026-10-24)