/xmake-skills:xmake-introspectionfrom xmake-skills
Inspects Xmake project programmatically - listing targets, reading sourcefiles, deps, packages and flags, exporting target/package dependency graphs as JSON or DOT, and querying data via Lua scripts. Prefer over reading xmake.lua by hand.
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.lua is a script, not a manifest: values can come from options, packages, rules,
on_config hooks and the toolchain. Reading the file tells you what the author wrote,
not what the build resolves to. Ask xmake instead.
xmake show # project name, version, toolchains, targets ...
xmake show -t hello # everything resolved for one target
xmake show -l targets # list target names
xmake show -l toolchains # what toolchains this xmake knows
xmake show -l rules # builtin + project rules
xmake show -l policies # policy names and their defaults
xmake show -l packages # required packages of this project
xmake show -l envs # the environment variables xmake reads
Any show output can be emitted as JSON, which is what you want when a script or an agent
consumes it:
xmake show --format=json # whole project as json
xmake show -t hello --format=json # one target as json
xmake show -l targets --format=json
xmake show --format=json --pretty # indented, easier to read in a terminal
::: tip
--json still works but is deprecated, use --format=json.
:::
Query one field without a json parser:
xmake show -t hello --format=json | grep -o '"sourcefiles":[^]]*]'
The target dependency graph, as text, JSON, or graphviz DOT:
xmake show --info=depgraph # human readable tree
xmake show --info=depgraph --target=app # only the subtree of one target
xmake show --info=depgraph --format=json # for tooling
xmake show --info=depgraph --format=dot # graphviz
xmake show --info=depgraph --format=dot | dot -Tsvg -o deps.svg
The package dependency graph comes from xrepo:
xrepo info --depgraph zlib
Anything the show plugin does not print is still reachable from a script, and this is the most precise way to answer "what does the build actually see":
# the sourcefiles a target really compiles, after all rules and options
xmake l -c 'import("core.project.project"); for _, f in ipairs(project.target("hello"):sourcefiles()) do print(f) end'
# the deps and the packages of a target
xmake l -c 'import("core.project.project"); print(project.target("hello"):get("deps"))'
# the value of a config/option
xmake l -c 'import("core.project.config"); config.load(); print(config.get("arch"))'
xmake l runs in the project directory and loads it lazily, so project.target(...)
works without an explicit load.
::: warning
The resolved flags are the exception: reaching for compiler.compflags() from a bare
xmake l prints nothing and warns that the toolchain "has been not checked yet", because
no toolchain check ran in that process. Use xmake show -t <target> for flags — it prints
compflags (cxx) and linkflags (ld) after the real check.
:::
Useful entry points:
| Module | What it answers |
|---|---|
core.project.project | targets, options, requires, rules of the loaded project |
core.project.config | the current configuration (plat, arch, mode, builddir …) |
core.tool.toolchain | the resolved toolchain and its toolset |
core.base.json | encode the result when you need to pipe it somewhere |
xmake show -l envs # XMAKE_* variables in effect
ls .xmake/<plat>/<arch>/ # per-project configuration cache
cat .xmake/<plat>/<arch>/xmake.conf
xmake.lua alone — options and packages change it.xmake show -t <target> first, xmake l only when you need a field it does not print.xmake f -p <plat> -a <arch> — the resolved values
depend on the current configuration.--format=json for anything a program reads; the plain output is for humans and may change.What 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`.Other plugins' skills for the same job