zig-knowledge-patch
Zig changes since training cutoff (latest: 0.14.0) — labeled switch, decl literals, @branchHint, DebugAllocator, unmanaged containers, root_module build API. Load before working with Zig.
What this skill does
# Zig Knowledge Patch
Claude's baseline knowledge covers Zig through 0.12.x. This skill provides breaking changes and new features in 0.13.0 and 0.14.0.
## Breaking Changes Quick Reference
| Version | Change | Impact | Details |
|---------|--------|--------|---------|
| 0.13.0 | `ComptimeStringMap` -> `StaticStringMap` | API rename + new init pattern | [stdlib-changes](references/stdlib-changes.md) |
| 0.13.0 | `zig-cache` -> `.zig-cache` | Update .gitignore | [stdlib-changes](references/stdlib-changes.md) |
| 0.13.0 | `std.Progress` rework | Pass `Node` by value, new init API | [stdlib-changes](references/stdlib-changes.md) |
| 0.14.0 | `std.builtin.Type` fields lowercased | `.Int` -> `.int`, `.Struct` -> `.@"struct"` | [language-changes](references/language-changes.md) |
| 0.14.0 | `@setCold` removed | Use `@branchHint(.cold)` | [language-changes](references/language-changes.md) |
| 0.14.0 | `@fence` removed | Use stronger atomic orderings | [language-changes](references/language-changes.md) |
| 0.14.0 | `@export` takes pointer | Add `&` operator | [language-changes](references/language-changes.md) |
| 0.14.0 | `CallingConvention` overhauled | Tagged union, `.C` -> `.c` | [language-changes](references/language-changes.md) |
| 0.14.0 | Anonymous struct types removed | Tuples unified, structural equivalence | [language-changes](references/language-changes.md) |
| 0.14.0 | `GeneralPurposeAllocator` -> `DebugAllocator` | New init pattern | [stdlib-changes](references/stdlib-changes.md) |
| 0.14.0 | `ArrayList` deprecated | Use `ArrayListUnmanaged`, pass allocator | [stdlib-changes](references/stdlib-changes.md) |
| 0.14.0 | `std.mem.page_size` removed | Use `std.heap.pageSize()` | [stdlib-changes](references/stdlib-changes.md) |
| 0.14.0 | Build API: `root_module` | `addExecutable` takes `root_module` | [build-system](references/build-system.md) |
| 0.14.0 | Package hash format changed | New format includes name/version/fingerprint | [build-system](references/build-system.md) |
## New Language Features (0.14.0)
### Labeled Switch
Switch statements can be labeled and targeted by `continue` for state machines:
```zig
foo: switch (@as(u8, 1)) {
1 => continue :foo 2, // jump to case 2
2 => continue :foo 3,
3 => return,
else => unreachable,
}
```
Generates optimized branch prediction code. Also supports `break` from labeled switch.
### Decl Literals
`.foo` syntax resolves to declarations on the target type (not just enum variants):
```zig
const S = struct {
x: u32,
const default: S = .{ .x = 123 };
fn init(val: u32) S {
return .{ .x = val + 1 };
}
};
const a: S = .default; // S.default
const b: S = .init(100); // S.init(100)
```
**Key pattern**: Unmanaged containers use `.empty` instead of `.{}`:
```zig
var list: std.ArrayListUnmanaged(u32) = .empty;
foo: std.ArrayListUnmanaged(u32) = .empty, // as struct field default
```
Fields and declarations in the same container cannot share names.
### @branchHint
Replaces `@setCold`. Must be first statement in block:
```zig
@branchHint(.unlikely); // .none, .likely, .unlikely, .cold, .unpredictable
```
### @FieldType Builtin
```zig
comptime assert(@FieldType(MyStruct, "field_name") == u32);
```
### @splat for Arrays
```zig
var pixels: [W][H]Rgba = @splat(@splat(.black));
```
See [references/language-changes.md](references/language-changes.md) for full details.
## Standard Library (0.14.0)
### Allocator Changes
```zig
// DebugAllocator (replaces GeneralPurposeAllocator)
var debug_allocator: std.heap.DebugAllocator(.{}) = .init;
const gpa = debug_allocator.allocator();
defer _ = debug_allocator.deinit();
// SmpAllocator (for ReleaseFast, competitive with glibc)
const allocator = std.heap.smp_allocator;
```
New `remap` on Allocator.VTable enables relocation during resize (uses `mremap` on Linux).
### Unmanaged Containers (managed versions deprecated)
```zig
var list: std.ArrayListUnmanaged(i32) = .empty;
defer list.deinit(gpa);
try list.append(gpa, 1234); // allocator passed to methods
```
Same for `ArrayHashMapUnmanaged`. `popOrNull` renamed to `pop`.
### ZON Support
Runtime: `std.zon.parse.fromSlice(T, allocator, zon_bytes, .{})`.
Compile-time: `const cfg: Config = @import("config.zon");`.
### Runtime Page Size
`std.heap.pageSize()` (runtime, memoized). Comptime bounds: `page_size_min`, `page_size_max`.
See [references/stdlib-changes.md](references/stdlib-changes.md) for full details.
## Build System (0.14.0)
### File System Watching
```bash
zig build --watch # rebuilds on source changes
zig build --watch --debounce 100 # custom debounce (default 50ms)
```
### Module-First API
```zig
const mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{ .name = "hello", .root_module = mod });
// Reuse same module for tests:
const tests = b.addTest(.{ .name = "hello-test", .root_module = mod });
```
### Incremental Compilation (opt-in)
```bash
zig build -Dno-bin -fincremental --watch # fast error-checking loop
```
### x86 Backend
98% behavior test pass rate. Select with `-fno-llvm`. Expected default for debug mode in 0.15.0.
See [references/build-system.md](references/build-system.md) for full details.
## Major Deprecation Removals (0.14.0)
Now compile errors: `std.mem.tokenize` (use `tokenizeAny`/`tokenizeSequence`/`tokenizeScalar`), `std.mem.split` (use `splitSequence`/`splitAny`/`splitScalar`), `std.rand` (use `std.Random`), `std.TailQueue` (use `std.DoublyLinkedList`), `std.zig.CrossTarget` (use `std.Target.Query`), `std.fs.MAX_PATH_BYTES` (use `max_path_bytes`).
## Reference Files
| File | Contents |
|------|----------|
| [language-changes.md](references/language-changes.md) | Labeled switch, decl literals, @branchHint, @fence removal, CallingConvention, type field renames, packed struct changes, tuple unification |
| [stdlib-changes.md](references/stdlib-changes.md) | DebugAllocator, SmpAllocator, remap API, unmanaged containers, ZON, runtime page size, StaticStringMap, Progress rework, deprecations |
| [build-system.md](references/build-system.md) | --watch, root_module API, addLibrary, package hash format, incremental compilation, fuzzer, WriteFile/RemoveDir changes |
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.