zig-cinterop

Installation
SKILL.md

Zig C Interop

Purpose

Guide agents through Zig's C interoperability: b.addTranslateC (and the deprecated @cImport) for calling C, translate-c for header inspection, extern struct and packed struct for ABI-compatible types, exporting Zig for C consumption, and zig cc for mixed C/Zig builds.

Triggers

  • "How do I call a C function from Zig?"
  • "How do I call a C library from Zig (addTranslateC / @cImport)?"
  • "How do I export Zig functions to be called from C?"
  • "How do I define a struct that matches a C struct?"
  • "What does translate-c do?"
  • "How do I build a mixed C and Zig project?"

Workflow

1. Calling C from Zig

Installs
561
GitHub Stars
297
First Seen
Feb 21, 2026