营销与写作

zig-best-practices

alleneubank/claude-code

Use when reading or writing Zig files (.zig, build.zig, build.zig.zon).

  • 524 次安装
  • 50 星标
  • 收录于

安装命令

npx skills add https://github.com/alleneubank/claude-code --skill zig-best-practices

SKILL.md

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,
};