/xmake-skills:xmake-project-generatorfrom xmake-skills
Exports xmake projects to other build systems and IDEs: compile_commands.json for LSP, CMakeLists.txt, build.ninja, Visual Studio solutions, Xcode projects, and GNU Makefiles.
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 project exports your xmake project into another build system's format. The core command is:
xmake project -k <kind> [options]
Use a generator when you need to hand the project to a tool that does not speak xmake: an IDE, an LSP, a CI system that only runs CMake, or someone reviewing the build graph.
xmake project -k compile_commands # compile_commands.json (clangd/ccls/LSP)
xmake project -k cmakelists # CMakeLists.txt
xmake project -k ninja # build.ninja
xmake project -k vsxmake # Visual Studio solution (xmake-driven)
xmake project -k vs # Visual Studio solution (native, older)
xmake project -k xcode # Xcode .xcodeproj
xmake project -k makefile # GNU Makefile
List available kinds on your install:
xmake project --help
compile_commands.json (clangd / ccls / LSP)This is by far the most-used generator. It emits a compile_commands.json that clangd / ccls / nvim-lsp / VS Code's clangd extension read to provide cross-project navigation and diagnostics.
xmake project -k compile_commands
xmake project -k compile_commands -o . # write to current dir
xmake project -k compile_commands build # write to build/
The file is written to the project root by default. Pass an output dir as positional argument.
Add this to xmake.lua once:
add_rules("plugin.compile_commands.autoupdate", {outputdir = "."})
Now compile_commands.json is refreshed on every xmake build, including when you add files or change flags. No more stale LSP data.
Options:
outputdir = "." — where to write the file (use . so clangd finds it without extra config).lsp = "clangd" — tweak for non-clangd LSPs (rarely needed).xmake f -m debug && xmake project -k compile_commands -o build/debug
xmake f -m release && xmake project -k compile_commands -o build/release
Useful if your LSP config points at a specific config.
CMakeLists.txtExports a CMake project equivalent. Handy when a downstream consumer can only build with CMake, or when migrating away from xmake.
xmake project -k cmakelists
xmake project -k cmakelists -o build/cmake
Caveats:
on_buildcmd_file, codegen, xmake-specific toolchains) may not translate 1:1. Review the output.xmake.lua.build.ninjaSkip xmake's runner and drive the build with ninja directly. Occasionally useful for integration with tools that already sit on top of ninja.
xmake project -k ninja
ninja -C build
You still need xmake to configure (xmake f ...) first — ninja just executes the graph.
vsxmake vs vsvsxmake (preferred)Generates a .sln + project files that shell out to xmake for the actual build. Keeps xmake as the source of truth: any edit to xmake.lua is reflected immediately in VS without regenerating.
xmake project -k vsxmake # default modes+archs
xmake project -k vsxmake -m "debug,release" # specific modes
xmake project -k vsxmake -m "debug,release" -a "x64,x86" # modes + archs
Opens cleanly in Visual Studio 2019/2022. Debugging, IntelliSense, and breakpoints work.
vs (native)Generates a native VS project that uses MSBuild end-to-end — no xmake at build time. Less fidelity; use only if you need to hand the solution to a team that never wants to install xmake.
xmake project -k vs -m "debug,release"
xmake project -k xcode
xmake project -k xcode -m "debug,release"
Generates an .xcodeproj. Use for iOS/macOS debugging, Instruments profiling, or distributing an Xcode project to Apple-ecosystem teammates.
Caveats similar to vs: regenerate from xmake when the build changes; don't edit the Xcode project directly.
xmake project -k makefile
make
Rarely needed, but useful for embedded CI that only has make.
| Flag | Purpose |
|---|---|
-k, --kind=<kind> | Which generator |
-m, --modes="debug,release" | Emit multiple build modes (vs/vsxmake/xcode) |
-a, --archs="x64,x86" | Emit multiple architectures |
-o, --outputdir=<dir> | Where to write the generated files |
[positional] | Same as -o — target directory |
-- xmake.lua
add_rules("plugin.compile_commands.autoupdate", {outputdir = "."})
Then:
xmake f -m debug
xmake # build + auto-generate compile_commands.json
Point clangd at the project root and you're done.
xmake project -k cmakelists -o dist/cmake
cp -r src include dist/cmake/
tar czf myproject-cmake.tar.gz -C dist cmake
xmake project -k vsxmake -m "debug,release" -a "x64,x86"
start vsxmake/vs2022/myproject.sln
xmake f -m release
xmake project -k ninja
ninja -C build -j 8
xmake f first. Generators read the configured state (plat/arch/mode). Run xmake f -m release (or whatever) before generating, otherwise you export whatever happens to be in .xmake/.CMakeLists.txt, .vcxproj, .xcodeproj are lost on the next regeneration. Treat them like compiler output.compile_commands.json. If your LSP is showing errors for files that xmake builds fine, regenerate — or use plugin.compile_commands.autoupdate so it happens automatically.vs vs vsxmake. If you hit weird incremental-build bugs or missing custom rules in Visual Studio, you probably want vsxmake instead of vs. vsxmake keeps xmake in the loop.rule() with C/Lua-side logic (codegen, file-extension handlers) may not survive the export. Verify the output.xmake-targets, xmake-rulesxmake-commandsxmake-pluginsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
xmake, build-system-export, compile-commands, ide-integration
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`.npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skillsOther plugins' skills for the same job