Langgraph Error Handling
soba-labs/langchain-agent-skills
Implement LangGraph error handling with current v1 patterns.
Modern Zig project architecture guide. An agent skill from majiayu000/spellbook.
$ npx skills add majiayu000/spellbook --skill zig-project -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install majiayu000/spellbook zig-project --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/zig-project .claude/skills/zig-project && rm -rf skills-srcUse ~/.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/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .claude/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/majiayu000/spellbook/tree/main/skills/zig-projectType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add majiayu000/spellbook --skill zig-project -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install majiayu000/spellbook zig-project --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/zig-project .agents/skills/zig-project && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .agents/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/spellbook --skill zig-project -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install majiayu000/spellbook zig-project --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/zig-project .cursor/skills/zig-project && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .cursor/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/majiayu000/spellbook.git --path skills/zig-project--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add majiayu000/spellbook --skill zig-project -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install majiayu000/spellbook zig-project --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/zig-project .gemini/skills/zig-project && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .gemini/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install majiayu000/spellbook zig-projectInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add majiayu000/spellbook --skill zig-project -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/zig-project .github/skills/zig-project && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .github/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/spellbook --skill zig-project -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install majiayu000/spellbook zig-project --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/zig-project .opencode/skills/zig-project && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "zig-project" agent skill from https://github.com/majiayu000/spellbook/tree/main/skills/zig-project into .opencode/skills/zig-project/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "zig-project", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
zig-projectModern Zig project architecture guide. An agent skill from majiayu000/spellbook.
Zig Project is an agent skill from majiayu000/spellbook. Modern Zig project architecture guide. Use when creating Zig projects (systems programming, CLI tools, game dev, high-performance services). Covers explicit allocators, comptime, error handling, and build system.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files (for example `reference/architecture.md`, `reference/extended.md` and `reference/patterns.md`).
It sits in AI & LLM Engineering, covering Game development and Error handling. The repository describes itself as: Cross-runtime skills for Claude Code, Codex, and multi-agent workflows. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit ed52af7. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are zig and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Zig Project loads about 2.6k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 196 words of instructions outside code blocks.
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.
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.
The full file from majiayu000/spellbook at commit ed52af7, republished under its MIT licence (© majiayu000). 196 words, ~2,649 tokens.
.claude/skills/zig-project/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.!T for explicit error handling, avoid anyerrorDelete unused code. Change directly. No compatibility layers.
// ❌ BAD: Deprecated function kept around
/// Deprecated: Use newFunction instead
pub fn oldFunction() void {
@compileLog("oldFunction is deprecated");
newFunction();
}
// ❌ BAD: Alias for renamed functions
pub const old_name = new_name; // "for backwards compatibility"
// ❌ BAD: Unused parameters
fn process(_: *const Config, data: []const u8) !void {
_ = data;
}
// ✅ GOOD: Just delete and update all usages
pub fn newFunction() void {
// ...
}
// ✅ GOOD: Remove unused parameters entirely
fn process(data: []const u8) !void {
// ...
}Use LiteLLM proxy. Don't call provider APIs directly.
const std = @import("std");
const http = std.http;
pub const LLMClient = struct {
allocator: std.mem.Allocator,
base_url: []const u8,
api_key: []const u8,
pub fn init(allocator: std.mem.Allocator, base_url: []const u8, api_key: []const u8) LLMClient {
return .{
.allocator = allocator,
.base_url = base_url, // "http://localhost:4000"
.api_key = api_key,
};
}
pub fn complete(self: *LLMClient, prompt: []const u8, model: []const u8) ![]u8 {
// Use OpenAI-compatible API through LiteLLM proxy
var client = http.Client{ .allocator = self.allocator };
defer client.deinit();
// Build request to LiteLLM proxy...
_ = prompt;
_ = model;
return "";
}
};# Create new project
mkdir myapp && cd myapp
zig init
# Or create executable project
zig init-exe
# Or create library project
zig init-libmyapp/
├── build.zig # Build configuration (in Zig)
├── build.zig.zon # Package manifest (dependencies)
├── src/
│ ├── main.zig # Entry point (for exe)
│ ├── root.zig # Library root (for lib)
│ └── lib/ # Internal modules
│ └── utils.zig
├── tests/ # Integration tests (optional)
└── lib/ # Vendored dependenciesbuild.zig.zon (Package Manifest)
.{
.name = "myapp",
.version = "0.1.0",
.dependencies = .{
// .some_dep = .{
// .url = "https://github.com/...",
// .hash = "...",
// },
},
.paths = .{
"build.zig",
"build.zig.zon",
"src",
},
}build.zig (Build Script)
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "myapp",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
b.installArtifact(exe);
// Run step
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the application");
run_step.dependOn(&run_cmd.step);
// Test step
const unit_tests = b.addTest(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const run_unit_tests = b.addRunArtifact(unit_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_unit_tests.step);
}Every function that allocates must receive an allocator parameter.
const std = @import("std");
// ❌ BAD: Hidden allocation (don't do this)
var global_allocator: std.mem.Allocator = undefined;
fn badAlloc() ![]u8 {
return global_allocator.alloc(u8, 100);
}
// ✅ GOOD: Explicit allocator
fn goodAlloc(allocator: std.mem.Allocator) ![]u8 {
return allocator.alloc(u8, 100);
}const std = @import("std");
pub fn main() !void {
// General purpose (with safety checks in debug)
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Arena (bulk alloc/dealloc)
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const arena_alloc = arena.allocator();
// Fixed buffer (no heap)
var buffer: [1024]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&buffer);
const fixed_alloc = fba.allocator();
// Page allocator (direct OS calls)
const page_alloc = std.heap.page_allocator;
_ = allocator;
_ = arena_alloc;
_ = fixed_alloc;
_ = page_alloc;
}fn handleRequest(permanent_allocator: std.mem.Allocator) !void {
// Create arena for this request
var arena = std.heap.ArenaAllocator.init(permanent_allocator);
defer arena.deinit(); // Free ALL request memory at once
const allocator = arena.allocator();
// All allocations use arena - no individual frees needed
const data = try fetchData(allocator);
const processed = try processData(allocator, data);
try sendResponse(processed);
// arena.deinit() frees everything
}const std = @import("std");
// Define specific error set
const FileError = error{
NotFound,
AccessDenied,
OutOfMemory,
EndOfStream,
};
// Return error union
fn readFile(allocator: std.mem.Allocator, path: []const u8) FileError![]u8 {
const file = std.fs.cwd().openFile(path, .{}) catch |err| {
return switch (err) {
error.FileNotFound => FileError.NotFound,
error.AccessDenied => FileError.AccessDenied,
else => FileError.NotFound,
};
};
defer file.close();
return file.readToEndAlloc(allocator, 1024 * 1024) catch FileError.OutOfMemory;
}fn processFile(allocator: std.mem.Allocator, path: []const u8) !void {
// try: propagate error up
const data = try readFile(allocator, path);
errdefer allocator.free(data); // cleanup on error
// catch: handle error locally
const parsed = parseData(data) catch |err| {
std.log.err("Parse failed: {}", .{err});
return err;
};
try saveResult(parsed);
}fn example() !void {
doSomething() catch |err| {
std.log.err("Operation failed: {s}", .{@errorName(err)});
return err;
};
}fn max(comptime T: type, a: T, b: T) T {
return if (a > b) a else b;
}
// Usage
const result = max(i32, 10, 20); // Returns 20
const float_result = max(f64, 1.5, 2.5); // Returns 2.5pub fn ArrayList(comptime T: type) type {
return struct {
const Self = @This();
items: []T,
capacity: usize,
allocator: std.mem.Allocator,
pub fn init(allocator: std.mem.Allocator) Self {
return .{
.items = &[_]T{},
.capacity = 0,
.allocator = allocator,
};
}
pub fn deinit(self: *Self) void {
if (self.capacity > 0) {
self.allocator.free(self.items.ptr[0..self.capacity]);
}
}
pub fn append(self: *Self, item: T) !void {
// Implementation...
_ = item;
}
};
}
// Usage
var list = ArrayList(u32).init(allocator);
defer list.deinit();fn validateConfig(comptime config: Config) void {
if (config.buffer_size == 0) {
@compileError("buffer_size must be > 0");
}
if (config.buffer_size > 1024 * 1024) {
@compileError("buffer_size too large");
}
}const std = @import("std");
const testing = std.testing;
fn add(a: i32, b: i32) i32 {
return a + b;
}
test "add positive numbers" {
try testing.expectEqual(@as(i32, 5), add(2, 3));
}
test "add negative numbers" {
try testing.expectEqual(@as(i32, -1), add(1, -2));
}test "allocation test" {
// Use testing allocator for leak detection
const allocator = testing.allocator;
const data = try allocator.alloc(u8, 100);
defer allocator.free(data);
try testing.expect(data.len == 100);
}test "expect error" {
const result = failingFunction();
try testing.expectError(error.SomeError, result);
}
test "expect no error" {
const result = try successFunction();
try testing.expect(result > 0);
}# Run all tests
zig build test
# Run tests with output
zig test src/main.zig
# Run specific test
zig test src/main.zig --test-filter "add positive"# Build
zig build # Debug build
zig build -Doptimize=ReleaseFast # Release build
# Run
zig build run # Build and run
# Test
zig build test # Run tests
# Format
zig fmt src/ # Format code
# Cross-compile
zig build -Dtarget=x86_64-linux-gnu
zig build -Dtarget=aarch64-macos
zig build -Dtarget=x86_64-windows
# Use as C compiler
zig cc -o output input.c
zig c++ -o output input.cppDetailed material starting at ## Checklist has been moved to reference/extended.md to keep this skill concise. Load that reference when the task requires the moved examples, command catalogs, checklists, platform details, or implementation templates.
© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 8 other files in skills/zig-project of majiayu000/spellbook.
Open the folder on GitHubat commit ed52af7
Zig Project 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Zig Project this skillmajiayu000/spellbook | 287 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Langgraph Error Handlingsoba-labs/langchain-agent-skills | 107 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Cost Aware LLM PipelineaAAaqwq/AGI-Super-Team | 105 | 5 repos | ~1.4k | Automated safety check: Pass | MIT | |
| Retellai SDK Patternsjeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~1.2k | Automated safety check: Pass | MIT | |
| Semantic Grepoaustegard/claude-skills | 150 | — | ~2.1k | Automated safety check: Pass | MIT | |
| Anth Reliability Patternsjeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2k | Automated safety check: Pass | MIT |
soba-labs/langchain-agent-skills
Implement LangGraph error handling with current v1 patterns.
aAAaqwq/AGI-Super-Team
Cost optimization patterns for LLM API usage — model routing by task complexity, budget tracking, retry logic, and prompt caching.
jeremylongshore/tons-of-skills-marketplace
Production-ready Retell AI SDK patterns for voice agent applications.
oaustegard/claude-skills
In-process semantic search over text files or in-memory strings, using Gemini embeddings via the CF AI Gateway.
jeremylongshore/tons-of-skills-marketplace
Implement reliability patterns for Claude API: circuit breakers, graceful degradation, idempotency, and fallback strategies.
Donchitos/Claude-Code-Game-Studios
Implement a story: ADR guidelines, right programmer agent, code plus test.
majiayu000/spellbook
Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.
majiayu000/spellbook
Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.
majiayu000/spellbook
Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.
majiayu000/spellbook
Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.
majiayu000/spellbook
Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.
majiayu000/spellbook
Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.
Modern Zig project architecture guide. An agent skill from majiayu000/spellbook. Zig Project is an agent skill from majiayu000/spellbook. Modern Zig project architecture guide.
Zig Project fits situations like: creating Zig projects (systems programming; high-performance services).
Run `npx skills add majiayu000/spellbook --skill zig-project -a claude-code`. Or copy the skill folder (skills/zig-project in majiayu000/spellbook) into .claude/skills/zig-project in your project. Claude Code loads it when a task matches its description.
Run `npx skills add majiayu000/spellbook --skill zig-project -a codex`. Or copy the skill folder (skills/zig-project in majiayu000/spellbook) into .agents/skills/zig-project in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill zig-project -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-project, .gemini/skills/zig-project, .github/skills/zig-project and .opencode/skills/zig-project in your project.
SKILL.md names no scripts, command-line tools or credentials: Zig Project is instructions for the agent only.
SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
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.
Zig Project is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Zig Project: Langgraph Error Handling (soba-labs/langchain-agent-skills, 107 stars), Cost Aware LLM Pipeline (aAAaqwq/AGI-Super-Team, 105 stars), Retellai SDK Patterns (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Semantic Grep (oaustegard/claude-skills, 150 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 287 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.
Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.