Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/alleneubank/claude-code/zig-best-practicesnpx skills add alleneubank/claude-code --skill zig-best-practicesgit clone --depth 1 https://github.com/alleneubank/claude-codeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/alleneubank/claude-code/zig-best-practices)<a href="https://agentmods.dev/skills/alleneubank/claude-code/zig-best-practices"><img src="https://agentmods.dev/badge/skills/alleneubank/claude-code/zig-best-practices.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00026 | $0.00811 |
| Opus 5 | $0.00013 | $0.00405 |
| Sonnet 5 | $0.00005 | $0.00162 |
| Haiku 4.5 | $0.00003 | $0.00081 |
Grade A, and why
zig-best-practices scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- **C library interop** (raylib, SDL, curl): See [C-INTEROP.md](C-INTEROP.md) How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Zig Best Practices
Follows type-first, functional, and error handling patterns from CLAUDE.md. This skill covers Zig-specific idioms only.
Type System Patterns
Tagged unions for mutually exclusive states — prevents invalid combinations that a struct with multiple nullable fields would allow:
const RequestState = union(enum) {
idle,
loading,
success: []const u8,
failure: anyerror,
};
Explicit error sets — documents exactly what can fail; anyerror hides failure modes:
const ParseError = error{ InvalidSyntax, UnexpectedToken, EndOfInput };
fn parse(input: []const u8) ParseError!Ast { ... }
Distinct types for domain IDs — compiler prevents mixing up different ID types:
const UserId = enum(u64) { _ };
const OrderId = enum(u64) { _ };
Comptime validation — catch invalid configurations at compile time, not runtime:
fn Buffer(comptime size: usize) type {
if (size == 0) @compileError("buffer size must be greater than 0");
return struct { data: [size]u8 = undefined, len: usize = 0 };
}
Memory Management
- Pass allocators explicitly to every function that allocates; no global allocator state.
- Place
defer resource.deinit()immediately after acquisition — keeps cleanup co-located with creation. - Use
errdeferfor cleanup on error paths;deferfor unconditional cleanup. - Use arena allocators for batch/temporary work; they free everything at once.
- Use
std.testing.allocatorin tests — reports leaks with stack traces.
fn createResource(allocator: std.mem.Allocator) !*Resource {
const resource = try allocator.create(Resource);
errdefer allocator.destroy(resource); // runs only on error
resource.* = try initializeResource();
return resource;
}
Key Conventions
- Prefer
constovervar; prefer slices over raw pointers. - Prefer
comptime T: typeoveranytype; explicit types produce clearer errors. Useanytypeonly for genuinely polymorphic cases (callbacks,std.debug.print-style). - Exhaustive
switch: include anelsereturning an error orunreachablefor truly impossible cases. - Use
std.log.scoped(.module_name)for namespaced logging; define a module-levelconst logconstant. - Larger cohesive files are idiomatic — tests alongside implementation, comptime generics at file scope.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 93 lines · 26 tokens per session scan A b44bbabb0c66
zig-best-practices is a skill published in the GitHub repository alleneubank/claude-code (52 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 26 tokens to every session and 811 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
development
开发语言能力索引。Python、Go、Rust、TypeScript、Java、C++、Shell。当用户提到编程、开发、代码、语言时路由到此。.
rust-pro
Master modern Rust (2024 edition) with async patterns, advanced type system features, and production-ready systems programming. Expert in the current Rust ecosystem including Tokio, axum, and modern crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.
ax-python-agent
Use when writing Python code with axllm for agents, child delegation, tools, MCP, citations, persistent playbook learning, stage instructions, runtime state, final typed responses, and direct-respond executor skipping.
migrate-better-result-3
Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.
mps-aspect-actions
Use when defining or editing MPS node factories (the "actions" aspect) — NodeFactories roots, per-concept NodeFactory setup functions that initialize a freshly created node and optionally copy data from a replaced sampleNode, plus the actions aspect's CopyPasteHandlers and PasteWrappers roots. Reach for this skill…
product-marketing
Build product marketing strategy including positioning, messaging, and go-to-market. Use when the user says "positioning", "messaging framework", "go-to-market", "GTM strategy", "product marketing", "competitive positioning", "battlecard", "sales enablement", "launch plan", or asks about how to position or message…