Smithery Logo
MCPsSkillsDocsPricing
Login
Smithery Logo

Accelerating the Agent Economy

Resources

DocumentationPrivacy PolicySystem Status

Company

PricingAboutBlog

Connect

© 2026 Smithery. All rights reserved.

    neversight

    zig

    neversight/zig
    Coding
    2

    About

    SKILL.md

    Install

    Install via Skills CLI

    or add to your agent
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    ├─
    ├─
    └─

    About

    Zig best practices for system programming with memory safety. Trigger: When writing Zig code with memory safety.

    SKILL.md

    Critical Patterns

    Error Handling (REQUIRED)

    // ✅ ALWAYS: Use error unions
    fn readFile(path: []const u8) ![]u8 {
        const file = try std.fs.cwd().openFile(path, .{});
        defer file.close();
        return try file.readToEndAlloc(allocator, max_size);
    }
    
    // Usage with catch
    const content = readFile("config.txt") catch |err| {
        std.log.err("Failed: {}", .{err});
        return err;
    };
    

    Memory Management (REQUIRED)

    // ✅ ALWAYS: Use allocators explicitly
    const allocator = std.heap.page_allocator;
    
    var list = std.ArrayList(u8).init(allocator);
    defer list.deinit();
    
    try list.append(42);
    

    Comptime (REQUIRED)

    // ✅ Use comptime for compile-time computation
    fn Vec(comptime T: type, comptime N: usize) type {
        return struct {
            data: [N]T,
            
            pub fn init() @This() {
                return .{ .data = undefined };
            }
        };
    }
    
    const Vec3f = Vec(f32, 3);
    

    Decision Tree

    Need error handling?       → Use error unions with try/catch
    Need cleanup?              → Use defer
    Need compile-time?         → Use comptime
    Need optional value?       → Use ?T (optional type)
    Need C interop?            → Use @cImport
    

    Commands

    zig build                  # Build project
    zig run src/main.zig       # Build and run
    zig test src/main.zig      # Run tests
    zig fmt src/               # Format code
    

    Resources

    • Best Practices: best-practices.md
    • Comptime: comptime.md
    • Memory: memory.md
    Recommended Servers
    Vercel Grep
    Vercel Grep
    Memory Tool
    Memory Tool
    Cloudflare Workers Observability
    Cloudflare Workers Observability
    Repository
    neversight/skills_feed