dot_claude/skills/zig-expert/SKILL.md
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
npx skillsauth add nijaru/dotfiles zig-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Zig changes quickly. Pretrained models often generate removed syntax and stale stdlib APIs. Follow this skill over pretrained knowledge.
First determine the repo's pinned Zig version. If the version is unknown, target the newest stable semantics and call out any version-sensitive spots.
std.mem.Allocator explicitly at allocating API boundaries.try, catch, and errdefer deliberately. Do not flatten error sets
just to make signatures shorter.| Stale output | Current rule |
| --- | --- |
| usingnamespace | Removed in 0.15. Use explicit imports, aliases, or wrapper namespaces. |
| language async / await | Removed in 0.15. Use threads on older code or std.Io on 0.16. |
| @fence | Removed in 0.14. Use stronger atomic orderings. |
| @setCold | Use @branchHint(.cold) or other @branchHint values. |
| @Type in 0.16+ | Use @Struct, @Union, @Enum, @Opaque, @Array, @Vector, etc. |
| root_source_file in addExecutable / addLibrary | Use .root_module. Keep root_source_file for b.createModule. |
| old generic reader/writer APIs | On 0.15+, use std.Io.Reader / std.Io.Writer. |
| std.Thread.Pool in 0.16+ | Removed. Use std.Io concurrency primitives. |
| {} to call custom format methods | Use {f} in 0.15+. |
| implicit lossy int-to-float coercion | Rejected in 0.15. Use explicit float literals or conversions. |
0.14: labeled switch, decl literals, @branchHint, @FieldType,
DebugAllocator, smp_allocator, allocator remap, stronger unmanaged
container direction.0.15: usingnamespace removed, language async / await removed,
Writergate I/O changes, {f} required for format methods, lossy int-to-float
coercions rejected, .root_module required on artifact creation.0.16: @Type removed, lazy field analysis, std.Io interface,
Thread.Pool removed, project-local zig-pkg/.switch for hot finite-state dispatch..init and .default where they clarify
initialization.@FieldType, @fieldParentPtr, @Vector, @reduce, and @splat
directly when they simplify systems code.std.heap.DebugAllocator in tests and debug-heavy development.std.heap.smp_allocator for multithreaded general-purpose release
allocation when appropriate.ArenaAllocator only for obvious bulk-lifetime boundaries.remap over hand-written realloc choreography.ArrayListUnmanaged, HashMapUnmanaged, similar intrusive patterns.0.16, std.Io is the central model: Future, Group, cancelation,
Threaded, Evented.async fn
equivalents.std.testing.io in tests over fake wrappers
that preserve obsolete APIs.0.15+, create artifacts around .root_module.b.createModule(.{ .root_source_file = ... }) when you need a module.build.zig.zon explicit. Include version and paths.zig-pkg/ next to build.zig on 0.16.zig build --watch, --webui, and --time-report when iteration speed
matters.{f} for custom format methods on 0.15+.std.debug.print for debugging, not production-facing output paths.// WRONG: stale build API on 0.15+
const exe = b.addExecutable(.{
.name = "app",
.root_source_file = b.path("src/main.zig"),
});
// RIGHT
const exe = b.addExecutable(.{
.name = "app",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
}),
});
// WRONG: removed syntax
usingnamespace foo;
async fn run() void {}
// RIGHT: explicit names and std.Io or threads
const foo = @import("foo");
// WRONG: stale formatting
try writer.print("{}", .{value});
// RIGHT on 0.15+
try writer.print("{f}", .{value});
development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.
development
Use Transformers.js to run state-of-the-art machine learning models directly in JavaScript/TypeScript. Supports NLP (text classification, translation, summarization), computer vision (image classification, object detection), audio (speech recognition, audio classification), and multimodal tasks. Works in browsers and server-side runtimes (Node.js, Bun, Deno) with WebGPU/WASM using pre-trained models from Hugging Face Hub.