Agent skill

Zig Tiger Style

by jiacai2050 in jiacai2050/zigcli

TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase.

MITAuto-check passedDevelopment

Install Zig Tiger Style

skills CLI
$ npx skills add jiacai2050/zigcli --skill zig-tiger-style -a claude-code

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

GitHub CLI
$ gh skill install jiacai2050/zigcli zig-tiger-style --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/jiacai2050/zigcli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/zig-tiger-style .claude/skills/zig-tiger-style && 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-tiger-style
GitHub stars
134
Token cost
~2.4k tokens
SKILL.md length
981 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase.

  • Works in 7 steps: Safety → Performance → Naming → …
  • The user is writing
  • SKILL.md covers 1. Safety, 2. Performance, 3. Naming and 4. Comments, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Zig Tiger Style is an agent skill from jiacai2050/zigcli. 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.

Its SKILL.md is about 2.4k 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, covering Refactoring. The repository describes itself as: A toolkit for building command lines programs in Zig. The licence is MIT.

When your agent uses it

  • The user is writing
  • Refactoring Zig code
  • Asking about Zig idioms
  • Naming conventions

Example prompts

  • “write me some Zig”
  • “/zig-tiger-style”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Safety
  2. Performance
  3. Naming
  4. Comments
  5. Formatting
  6. Off-by-One Errors
  7. Dependencies and Tooling

What it can do on your machine

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

    Links to these hosts (documentation or services it may open):

    • github.com
    • matklad.github.io

    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 Tiger Style loads about 2.4k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 981 words of instructions outside code blocks.

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

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 jiacai2050/zigcli at commit ae972e7, republished under its MIT licence (© jiacai2050). 981 words, ~2,388 tokens.

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

TigerStyle: Zig Coding Guidelines

Distilled from TigerBeetle's 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 ifs up and fors down".

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:

    zig
    // preferred
    @prefetch(a, .{ .cache = .data, .rw = .read, .locality = 3 });
    
    // avoid
    @prefetch(a, .{});

Show full SKILL.md (487 more words)Show less

3. Naming

  • In general, functions are camelCase, types are PascalCase, variables are lowercase_with_underscores. One exception to those rules is functions that return types. They are PascalCase:

    zig
    pub fn ArrayList(comptime T: type) type {
      return ArrayListAligned(T, null);
    }
  • Normally, file names are lowercase_with_underscore. However, files that expose a type directly should be PascalCase.

  • Do not abbreviate variable names (except primitive integer loop indices in sorts/matrices).

  • Acronyms are fully capitalized: VSRState, not VsrState.

  • Append units and qualifiers to names, ordered by descending significance, so the most important word comes first:

    zig
    latency_ms_max    // not max_latency_ms
    latency_ms_min    // aligns nicely with the above
    message_size_max
  • Choose related names with the same character count so they align visually:

    zig
    source         // same length as target
    target
    source_offset
    target_offset
  • Name helper/callback functions with the caller's name as a prefix: read_sector() → read_sector_callback()

  • Callbacks go last in the parameter list (mirrors invocation order).

  • Infuse names with meaning: gpa: Allocator and arena: Allocator are far more informative than allocator: Allocator.

  • Functions that take two u64 arguments must use a named options: struct parameter to prevent argument confusion.

Struct and File Layout
zig
// Struct order: fields → type definitions → methods
time: Time,
process_id: ProcessID,

const ProcessID = struct { cluster: u128, replica: u8 };
const Tracer = @This();

pub fn init(gpa: std.mem.Allocator, time: Time) !Tracer { ... }
  • The main function goes at the top of the file — readers see the most important thing first.
  • Promote complex nested types to top-level structs.

4. Comments

  • Comments are full sentences: space after //, capital letter, ending with a period (or colon when introducing something). Inline end-of-line comments may be phrases without punctuation.
  • Always say why. Code shows what and how; comments explain the reasoning behind decisions.
  • Add a description at the top of tests explaining the goal and methodology.
  • On occasion, use an obviously-true assertion instead of a comment to document a critical, surprising invariant — the assertion is stronger documentation.

5. Formatting

  • Always run zig fmt.

  • Use 4 spaces of indentation (more visually obvious than 2 at a distance).

  • Hard limit of 100 columns per line, no exceptions. Add a trailing comma and let zig fmt handle the wrapping.

  • Always add braces to if statements unless the whole thing fits on one line:

    zig
    // single-line ok without braces
    if (ok) return;
    
    // multi-line always needs braces
    if (condition) {
        do_something();
    }
Division — be explicit about rounding intent
zig
@divExact(a, b)   // asserts no remainder
@divFloor(a, b)   // rounds toward negative infinity
div_ceil(a, b)    // rounds toward positive infinity

6. Off-by-One Errors

index (0-based), count (1-based), and size (= count × unit) are distinct types with clear conversion rules:

  • index → count: add 1
  • count → size: multiply by the unit size
  • Include units and qualifiers in variable names (see Naming) to make these conversions visible.

7. Dependencies and Tooling

  • Zero-dependencies policy: no external dependencies beyond the Zig toolchain.
  • Write scripts as scripts/*.zig instead of *.sh — cross-platform, type-safe, more reliable.
  • Standardize on Zig for tooling to reduce dimensionality as the team grows.

Pre-Commit Checklist

Before submitting, verify:

  • All lines are <= 100 columns; zig fmt has been run
  • All errors are handled (no _ discards)
  • Variable names include units/qualifiers and are not abbreviated
  • Compound conditions are split into nested if/else
  • All loops have an explicit upper bound
  • Comments explain why, not just what
  • Compile-time constant relationships are verified with comptime assert

© jiacai2050, 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 .agents/skills/zig-tiger-style of jiacai2050/zigcli.

Open the folder on GitHubat commit ae972e7

Compare with similar skills

Zig Tiger Style 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 Tiger Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zig Tiger Style this skilljiacai2050/zigcli134—~2.4kAutomated safety check: PassMIT
Guidelinesakash-network/node1.1k20 repos~577Automated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Component Refactoringlangflow-ai/langflow155k—~3.5kAutomated safety check: PassMIT
Ponytail Lazy Developer ModeDietrichGebert/ponytail160k1 repos~873Automated safety check: PassMIT
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT

Similar skills

  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 20 repos~577 tokens
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Component Refactoring

    langflow-ai/langflow

    Refactor high-complexity React components in Langflow frontend.

    155k GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Ponytail Lazy Developer Mode

    DietrichGebert/ponytail

    Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.

    160k GitHub starsUsed in 1 repo~873 tokens
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 10 days ago
    DevelopmentAuto-check passed

Categories

Questions about Zig Tiger Style

What does Zig Tiger Style do?

TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase. Zig Tiger Style is an agent skill from jiacai2050/zigcli. TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase.

When should I use Zig Tiger Style?

Zig Tiger Style fits situations like: the user is writing; refactoring Zig code; asking about Zig idioms; naming conventions.

How do I install Zig Tiger Style in Claude Code?

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

How do I install Zig Tiger Style in Codex?

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

Can I use Zig Tiger Style 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 jiacai2050/zigcli --skill zig-tiger-style -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-tiger-style, .gemini/skills/zig-tiger-style, .github/skills/zig-tiger-style and .opencode/skills/zig-tiger-style in your project.

What does Zig Tiger Style need to run?

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

Does Zig Tiger Style access the network?

SKILL.md names 2 domains. As links in the text: github.com and matklad.github.io. This is read from the text; nothing was executed.

Is Zig Tiger Style 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 Tiger Style use?

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

About 2.4k tokens (SKILL.md is roughly 9.6k 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 Zig Tiger Style?

Skills that share tags, products or a category with Zig Tiger Style: Guidelines (akash-network/node, 1.1k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Component Refactoring (langflow-ai/langflow, 155k stars) and Ponytail Lazy Developer Mode (DietrichGebert/ponytail, 160k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zig Tiger Style?

jiacai2050 (a GitHub user) maintains it in jiacai2050/zigcli, which has 134 GitHub stars. The repository was last updated on October 9, 2026.

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