/xmake-skills:xmake-devfrom xmake-skills
Builds xmake from source, loads the local source tree so changes take effect without reinstalling, and debugs Lua scripts or the native C core.
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.
This skill is for working on the xmake-io/xmake source tree — not for projects that use xmake. Xmake is split into two layers:
xmake/) — most of xmake's behavior: actions, modules, rules, toolchains, sandbox. Editable without recompiling.core/src/xmake/) — the Lua runtime and xmake extension C APIs (os.*, io.*, process.*, fwatcher, etc.), plus tbox. Changes here require rebuilding the xmake binary.git clone --recursive https://github.com/xmake-io/xmake.git
cd xmake
Use --recursive — xmake bundles tbox and other submodules under core/src.
xmake binary./configure
make -j
Artifacts land in core/build/xmake (also symlinked via build/xmake).
cd core
xmake
This uses an existing xmake to bootstrap the new one; the resulting binary is core/build/xmake.exe.
make clean
./configure && make -j
On Windows: cd core && xmake clean && xmake.
So the xmake command in your shell points at the freshly built binary and loads Lua scripts from your checkout instead of the installed ~/.xmake:
source scripts/srcenv.profile
xmake --version
This script:
xmake to ./core/build/xmake (or ./build/xmake)XMAKE_PROGRAM_FILE to that binaryXMAKE_PROGRAM_DIR to ./xmake (the Lua script tree)xrepo to scripts/xrepo.shprogramdir / programfile so you can verifyscripts\srcenv.bat
Opens a new shell pre-configured with XMAKE_PROGRAM_DIR and XMAKE_PROGRAM_FILE, and core\build on PATH.
If you do not want to source the script, set the env vars yourself:
export XMAKE_PROGRAM_DIR=/path/to/xmake/xmake # the Lua tree
export XMAKE_PROGRAM_FILE=/path/to/xmake/core/build/xmake
Now every xmake invocation in any project uses your local checkout.
Verify with:
xmake l xmake.programdir
xmake l xmake.programfile
Both should point inside your checkout.
This is the fast loop — no rebuild required. Once srcenv.profile is sourced, edit any file under xmake/ and rerun xmake in a test project to see the effect.
-- inside xmake/modules/... or xmake/actions/...
import("core.base.option")
print("DEBUG value = %s", some_table)
utils.vprint("only in -v mode: %s", val) -- verbose-gated
cprint("${bright}colored output${clear}")
Run the user's command with diagnostics:
xmake -vD build # -v verbose, -D diagnosis (full Lua tracebacks)
-D turns every error into a stack trace anchored in the Lua source files — point at those line numbers to find the failure.
import("core.base.option")
import("core.project.project")
import("core.project.config")
print(config.plat(), config.arch(), config.mode())
for name, target in pairs(project.targets()) do
print("target %s -> %s", name, target:targetfile())
end
Run ad-hoc Lua with the full xmake module environment:
xmake l -vD path/to/script.lua
xmake l -c 'print(os.host(), os.arch())'
xmake l
> import("core.base.option")
> print(os.host())
Great for exploring module APIs (core.project.project, lib.detect.find_tool, core.tool.toolchain, …).
xmake l tests/run.lua # full suite
xmake l tests/run.lua [testname] # one group
Tests live under tests/ in the xmake checkout; each directory is a mini project exercising a feature.
Native code is under core/src/xmake/ (Lua C bindings), core/src/sv/, and the bundled core/src/tbox. Changes require a rebuild; the Lua tree is untouched.
cd /path/to/xmake
./configure --mode=debug
make -j
(Or, equivalently, building core/ directly: cd core && xmake f -m debug && xmake.)
The resulting core/build/xmake has symbols and assertions enabled. srcenv.profile still points at it, so xmake in any project now runs the debug binary.
Linux:
gdb --args ./core/build/xmake build -vD
(gdb) break xm_os_cpdir # any C symbol in core/src/xmake
(gdb) run
macOS:
lldb -- ./core/build/xmake build -vD
(lldb) b xm_os_cpdir
(lldb) run
Windows (MSVC): open core/build/xmake.exe in Visual Studio, set it as startup target, pass the command-line args, and set breakpoints in core/src/xmake/*.c.
core/src/xmake/os/ — os.cp, os.mv, os.ls, process spawn, …core/src/xmake/io/ — io.open, io.readable, …core/src/xmake/process/ — subprocess handlingcore/src/xmake/fwatcher/ — file watchingcore/src/xmake/string/, hash/, base64/, libc/ — misc helpersEach C function is registered to Lua under a name like xm_os_cpdir. The full call path for a user-visible API is:
sandbox_os.cp() (xmake/core/sandbox/modules/os.lua)
-> os.cp() (xmake/core/base/os.lua)
-> os.cpdir() bound to xm_os_cpdir() (core/src/xmake/os/cpdir.c)
-> tb_directory_copy() (core/src/tbox)
To trace a misbehaving os.cp, set a breakpoint in xm_os_cpdir (C) and drop a print(...) in xmake/core/base/os.lua (Lua) — you usually need both sides to understand what arguments crossed the boundary.
core/src/xmake/<module>/<name>.c.xmake.h / registration table.xmake/core/base/<module>.lua wrapper.xmake/core/sandbox/modules/<module>.lua.make -j to rebuild.xmake l -c 'print(os.mynewfn())' to smoke test../configure --mode=debug
make -j
valgrind --leak-check=full ./core/build/xmake build -vD
# or on macOS
leaks --atExit -- ./core/build/xmake build -vD
tbox ships its own allocator hooks as well — look under core/src/tbox/src/tbox/memory.
xmake -vD # verbose + Lua tracebacks on error
xmake l path/to/script.lua # run arbitrary Lua in xmake env
xmake l xmake.programdir # which script tree is active
xmake l xmake.programfile # which binary is active
xmake g --clean # clear global caches if something is stuck
xmake f -c # re-run configure on a test project
srcenv.profile. xmake will still resolve to the installed binary in /usr/local/bin, so your Lua edits in the checkout appear to do nothing. Confirm with xmake l xmake.programdir.~/.xmake/repositories/.... That is a clone of xmake-repo, not the xmake source — changes there affect package recipes, not xmake itself.make -j). If you only ran source srcenv.profile, that does not recompile — it just points at whatever binary you already have.--mode=debug and --mode=release, run ./configure --mode=<mode> again before make.git submodule update --init --recursive.xmake-pluginsxmake-rulesxmake-repo-testingWhat SKILL.md sets; muted values are Claude Code's defaults
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`./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.Other plugins' skills for the same job