Zig Skills
Zig SKILLS for AI agents
Install / Use
/learn @nzrsky/Zig SkillsREADME
Zig Skills for AI Coding Assistants
AI coding assistant skills providing verified, version-specific Zig API documentation and best practices. Prevents LLMs from generating code with deprecated or removed APIs.
Available Skills
| Skill | Description | Target Version | |-------|-------------|----------------| | zig | Zig language API guide with 57 reference files | Zig 0.15.x |
Why?
Most LLM training data contains outdated Zig patterns (0.11-0.13 era) that cause compilation errors on modern Zig. Common mistakes include:
- Using
root_source_fileinstead ofroot_modulein build.zig - Old I/O API (
std.io.getStdOut().writer()) instead of new buffered writer pattern std.ArrayListwithout passing allocator to every method (now unmanaged by default)- PascalCase
@typeInfofields (.Struct) instead of lowercase (.@"struct") - Using removed features:
async/await,usingnamespace,BoundedArray
This skill catches all of these and dozens more breaking changes.
What's Included
Main Skill (SKILL.md)
- Design principles (type-first development, make illegal states unrepresentable)
- All breaking changes from 0.14/0.15 with WRONG/CORRECT examples
- I/O API rewrite ("Writergate") patterns
- Build system migration guide
- Container initialization rules (
.empty/.init) - Quick fixes error table (14 common errors with solutions)
- Verification workflow
- Common pitfalls checklist
Reference Files (57 files in references/)
- Complete std library API references (ArrayList, HashMap, JSON, HTTP, crypto, etc.)
- Language basics, builtins, comptime metaprogramming
- Production patterns from Bun, Ghostty, TigerBeetle
- MCP server patterns for protocol translators
- Code review checklist organized by confidence level
- Style guide, C interop, build system deep-dive
Supported IDEs
| Directory | IDE | Format |
|-----------|-----|--------|
| skills/zig/ | Canonical source | SKILL.md + references/ |
| .agent/skills/zig/ | Agent | SKILL.md + references/ |
| .cursor/skills/zig/ | Cursor | SKILL.md + references/ |
| .opencode/skills/zig/ | OpenCode | SKILL.md + references/ |
| .codex/skills/zig/ | Codex | SKILL.md + references/ |
| .gemini/skills/zig/ | Gemini CLI | SKILL.md + references/ |
| .continue/skills/zig/ | Continue | SKILL.md + references/ |
| .kilocode/skills/zig/ | Kilocode | SKILL.md + references/ |
| .factory/skills/zig/ | Factory AI | SKILL.md + references/ |
| .adal/skills/zig/ | AdaL CLI (Sylph AI) | SKILL.md + references/ |
| .codebuddy/skills/zig/ | CodeBuddy | SKILL.md + references/ |
| .openclaw/skills/zig/ | OpenClaw | SKILL.md + references/ |
| .pi/skills/zig/ | Pi Agent | SKILL.md + references/ |
| .kiro/steering/ | Kiro | zig-skill.md (steering file) |
Installation
Claude Code (recommended)
# Install globally via npx skills
npx -y skills add https://github.com/nzrsky/zig-skills --skill zig --yes --global --agent claude-code
Or manually:
git clone https://github.com/nzrsky/zig-skills.git /tmp/zig-skills
cp -r /tmp/zig-skills/skills/zig ~/.claude/skills/zig
rm -rf /tmp/zig-skills
Cursor
git clone https://github.com/nzrsky/zig-skills.git /tmp/zig-skills
cp -r /tmp/zig-skills/.cursor/skills your-project/.cursor/skills
rm -rf /tmp/zig-skills
Codex / OpenCode / Gemini CLI / Other Agents
Copy the matching IDE directory into your project root:
git clone https://github.com/nzrsky/zig-skills.git /tmp/zig-skills
# Replace .codex with your IDE's directory name
cp -r /tmp/zig-skills/.codex your-project/.codex
rm -rf /tmp/zig-skills
Kiro
git clone https://github.com/nzrsky/zig-skills.git /tmp/zig-skills
mkdir -p your-project/.kiro/steering
cp /tmp/zig-skills/.kiro/steering/zig-skill.md your-project/.kiro/steering/
rm -rf /tmp/zig-skills
Manual
Add to your project's CLAUDE.md:
When writing Zig code, load and follow the patterns in `skills/zig/SKILL.md`.
Keeping IDE Directories in Sync
After editing files in skills/zig/, run:
bash scripts/sync-ide-folders.sh
To verify all directories match:
bash scripts/sync-ide-folders.sh --verify
License
MIT
