/xmake-skills:xmake-gofrom xmake-skills
Builds Go projects with xmake: binary/library targets, Go module support, cross-compilation, and CGO integration. Useful when mixing Go with C/C++/Rust in a single build tool.
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 builds Go via the Go toolchain (go build under the hood, wrapped in xmake's target model). Useful if your project mixes Go with C/C++/Rust and you want a single build tool.
xmake create -l go -t console hello
cd hello
xmake run
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/*.go")
target("app") set_kind("binary") -- executable
target("mylib") set_kind("static") -- Go archive
target("mydyn") set_kind("shared") -- Go shared lib (CGO-compatible)
Keep a normal go.mod at the project root. Xmake picks it up automatically:
myproj/
├── xmake.lua
├── go.mod
├── go.sum
└── src/
└── main.go
Dependencies declared in go.mod (require github.com/... vX.Y.Z) resolve through the Go toolchain as usual — xmake does not second-guess them.
Go is famously easy to cross-compile, and xmake exposes it through standard flags:
xmake f -p windows -a x86_64
xmake # builds a .exe from macOS/Linux
xmake f -p linux -a arm64
xmake
xmake f -p macosx -a arm64 # Apple Silicon
xmake
Xmake sets GOOS / GOARCH for you. Supported plats map to Go's naming automatically.
Keep import "C" in your .go files as usual. When building, add any C dependencies the Go code calls into:
target("app")
set_kind("binary")
add_files("src/*.go", "src/*.c")
add_includedirs("include")
add_links("foo")
Xmake compiles the .c files and links them alongside the Go objects.
xmake f --toolchain=go
xmake f --toolchain=go --sdk=/opt/go-1.22
--sdk pins a specific Go install; otherwise go on PATH is used.
target("app")
add_files("src/*.go")
add_gcflags("-N", "-l") -- passed to `go tool compile`
add_ldflags("-s -w") -- passed to `go tool link` (stripping)
add_gcflags is Go-specific (go compile flags). add_ldflags maps to go tool link -ldflags.
target("app_test")
set_kind("binary")
add_files("tests/*_test.go")
add_tests("default")
Or run Go's native test runner as an xmake task:
task("gotest")
set_menu { usage = "xmake gotest", description = "Run go test" }
on_run(function () os.exec("go test ./...") end)
go.mod after xmake f. Run xmake f -c to re-resolve.CGO_ENABLED=0 is often required for pure-Go cross builds. Set it via env or os.setenv in on_load..go and .cpp (not .c) in one target. Use .c for the C side; Go's CGO expects C, not C++.GOFLAGS in env. Sometimes overrides what xmake sets — unset GOFLAGS if you hit weird behavior.xmake-targetsxmake-cross-compilationxmake-xpackWhat SKILL.md sets; muted values are Claude Code's defaults
58 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`./xmake-basicsUse when the user is starting a new Xmake project, installing Xmake, or needs the minimal xmake.lua structure. Covers installation, `xmake create`, the project layout, and the smallest valid xmake.lua./xmake-build-cacheUse when configuring or debugging xmake's local build cache (built-in, replaces ccache) or the remote compile cache service (shared across machines via `xmake service --ccache`). Covers enabling/disabling, fallbacks to external ccache, remote cache server/client setup, and cache cleaning./xmake-build-optimizationUse when a project builds slowly and you want to make it faster — parallel jobs, unity build, precompiled headers, build cache, LTO, link-time improvements, binary package cache, and profiling with `XMAKE_PROFILE=perf:*`. Covers idiomatic xmake speedups and the order to try them.npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skillsOther plugins' skills for the same job