/xmake-skills:xmake-zigfrom xmake-skills
Builds Zig projects with xmake — binary/library targets, cross-compilation, and mixing Zig with C.
Ships in xmake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Xmake drives zig build-exe / zig build-lib under the hood. Zig is particularly nice because its native cross-compile story plays well with xmake's toolchain selection.
xmake create -l zig -t console hello
cd hello
xmake run
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/*.zig")
target("app") set_kind("binary")
target("mylib") set_kind("static")
target("mydyn") set_kind("shared")
xmake f --toolchain=zig
xmake f --toolchain=zig --sdk=/opt/zig-0.12
Zig is auto-detected when zig is on PATH. Pin with --sdk for a specific install.
Zig has built-in cross-compile for every target it supports — no extra SDK needed:
xmake f -p windows -a x86_64 --toolchain=zig
xmake f -p linux -a arm64 --toolchain=zig
xmake f -p macosx -a arm64 --toolchain=zig
xmake
Xmake passes -target <triple> to zig build-exe. Far easier than GCC/Clang cross-SDKs.
Zig ships its own C compiler (zig cc) that can build C files. You can mix them in one target:
target("app")
set_kind("binary")
add_files("src/main.zig", "src/helper.c")
add_includedirs("include")
Zig imports C via @cImport. No bridging needed.
Bonus trick: point xmake's C toolchain at zig cc for free cross-compile of C projects:
xmake f --toolchain=zig
xmake f --cc="zig cc" --cxx="zig c++"
This is especially useful for MinGW-free Windows builds from Linux.
build-exe / build-lib flags change between versions. Pin --sdk to a known version in CI..zig and .cpp in one target. .zig + .c is fine; C++ is more brittle — use a separate target with add_deps.-target <triple> gives you a cross-compile, but you still need the right dynamic linker at runtime on the target — Zig can produce static binaries if you prefer (-fno-pie etc.).-p, -a, --sdk) → xmake-cross-compilationxmake-targetsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skills58 skills in this plugin
/xmake-addon-developmentUse when writing an Xmake addon — the `addon.lua` manifest, the payload layout (plugins/rules/toolchains/modules/includes/templates), `@self` references, shipping package definitions with an addon, `add_globalmodules`, testing it locally, and publishing it to xmake-repo as an `addon` kind package./xmake-addonsUse when installing or using an Xmake addon — `xmake addon --install/--list/--remove/--upgrade/--search`, declaring `add_addons(...)` in a project, and referencing addon payloads with `@addon/<name>/<rule>`, `@addon.<name>.<module>` or `@self`. For writing and publishing one, see xmake-addon-development./xmake-async-jobsUse when running parallel / async work inside xmake scripts — `async.runjobs` for parallel job execution, `async.jobgraph` (DAG) for dependency-ordered jobs, `async.jobpool` (tree structure), `core.base.scheduler` coroutine scheduling, semaphores, and `on_build_files(..., {jobgraph = true})` in rules. For running external compile jobs faster, see `xmake-build-optimization`.Other plugins' skills for the same job