From zig-claude-kit
Audit Zig source files for Zig 0.15.x mistakes -- checks for removed APIs (getStdOut, usingnamespace, BoundedArray, async), missing flush, wrong ArrayList usage, ambiguous format strings, signed division, and renamed stdlib functions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/zig-claude-kit:zig-checkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit Zig source files for common Zig 0.15.x mistakes. If a file
Audit Zig source files for common Zig 0.15.x mistakes. If a file
path is given, check that file. Otherwise check all src/*.zig
files that were modified in the current git diff (staged and
unstaged).
If argument provided:
If no argument:
git diff --name-only and git diff --cached --name-onlysrc/*.zig filesUse the Read tool to read the full contents of each file.
Search each file for these patterns. Report each violation with file path, line number, and the specific issue.
Deleted API usage:
std.io.getStdOut or std.io.getStdErr -- use buffered
writer patternusingnamespace -- removed from languageasync / await -- removed from languagestd.BoundedArray -- use ArrayListUnmanaged.initBufferstd.json.Parser -- use std.json.parseFromSliceRenamed API usage:
std.mem.tokenize( without Any/Scalar/Sequence --
use tokenizeAny, tokenizeScalar, or
tokenizeSequencestd.process.args() without Alloc -- use
std.process.argsAlloc(allocator)takeDelimiterExclusive in while loops:
while loop calling takeDelimiterExclusive -- use
appendRemaining instead (hangs on stdin)Missing writer flush:
stdout_writer or stderr_writer created without a
corresponding defer ... flush() catch {}ArrayList without allocator:
.append(, .appendSlice(, .deinit() etc. without
allocator as first argument (for ArrayListUnmanaged)Ambiguous format strings:
"{}" in print/format calls -- must use {s}, {d},
{any}, etc.Signed division without builtins:
/ or % on runtime signed integer variables -- use
@divTrunc, @divFloor, @divExact, @rem, @modOld for-loop index syntax:
for (items) |item, i| without explicit index range --
use for (items, 0..) |item, i|Format output as:
## /zig-check Results
### <file_path>
CRITICAL: <line>: <description>
CRITICAL: <line>: <description>
### <file_path>
No issues found.
---
Summary: X critical across Z files
If no issues found in any file:
## /zig-check Results
All files pass. No Zig 0.15.x issues found.
For each critical issue, include a one-line fix suggestion:
std.io.getStdOut() with buffered writer pattern
(see zig-patterns skill)"while (reader.takeDelimiterExclusive(...)) with
reader.appendRemaining()"defer stdout.flush() catch {}; after writer creation"list.append(val) to list.append(allocator, val)""{}" to "{s}" (or appropriate specifier)"a / b with @divTrunc(a, b) for signed integers"std.mem.tokenize with std.mem.tokenizeAny"std.process.args() with std.process.argsAlloc"for (items) |x, i| to for (items, 0..) |x, i|"std.json.Parser with std.json.parseFromSlice"npx claudepluginhub kelp/kelp-claude-plugins --plugin zig-claude-kitProvides Zig 0.13-0.14 updates: breaking changes like DebugAllocator, unmanaged arrays, root_module build API; new features including labeled switches, decl literals, @branchHint. Use for Zig coding.
Guides Zig troubleshooting: compiler errors, runtime panics, memory leaks, build failures, error traces, and common pitfalls.
Diagnoses compiler errors, runtime panics, memory issues, and build failures in Zig programs.