/xmake-skills:xmake-templatesfrom xmake-skills
Creates new xmake projects from built-in or third-party templates, lists available templates, and guides authoring custom templates with placeholder substitution.
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.
A template is a directory tree with an xmake.lua and some starter source files. xmake create copies it into a new project directory, substituting a few placeholders. Templates come from three places, searched in this order:
xmake repo --list), e.g. packages/templates from xmake-repo.~/.xmake/templates/.$(programdir)/repository/templates/.xmake create --list # all languages, all sources
xmake create --list -l c++ # only C++ templates
Output groups templates by source (repo / global / builtin) and by language, so you can see which names are available for -t.
xmake create hello # default: c++ console
xmake create -l c hello # C, default "console" template
xmake create -l c++ -t console myapp
xmake create -l c++ -t static mylib
xmake create -l c++ -t shared mydyn
xmake create -l c -t module mymod
xmake create -l rust hello
xmake create -l go -t console hello
Flags:
-l, --language — language (c, c++, rust, go, swift, objc, cuda, dlang, fortran, kotlin, nim, pascal, vala, zig, csharp).-t, --template — template id inside that language.-P <dir> — create into a specific directory instead of the current one.demo).Qt, SDL, Python bindings, Linux drivers, raylib, verilator, wxWidgets, etc. are shipped in xmake-repo/templates/. They live under nested template ids using . as separator:
xmake create -l c++ -t qt.widgetapp myqtapp
xmake create -l c++ -t qt.quickapp myquick
xmake create -l c++ -t wxwidgets mywx
xmake create -l c++ -t python.pybind11 mybind
xmake create -l c -t sdl mysdl
xmake create -l c -t raylib mygame
xmake create -l c -t linux.driver mydriver
qt.widgetapp resolves to <repo>/templates/c++/qt/widgetapp/. Each path segment between dots is a directory level.
xmake create -P myproj -l c++ -t console hello
cd myproj && xmake
A template is just:
<root>/<language>/<template-id-path>/
├── xmake.lua # with ${TARGET_NAME} / ${FAQ} placeholders
└── src/
└── main.cpp # or whatever source files the template needs
When you run xmake create, xmake copies the entire directory tree to the destination and substitutes placeholders in both filenames and file contents.
Verified from xmake/actions/create/template.lua:
| Placeholder | Value |
|---|---|
${TARGET_NAME} | The positional project/target name passed to xmake create |
${FAQ} | Contents of $(programdir)/scripts/faq.lua — a short FAQ block appended to the generated xmake.lua |
Example built-in c/console/xmake.lua:
add_rules("mode.debug", "mode.release")
target("${TARGET_NAME}")
set_kind("binary")
add_files("src/*.c")
${FAQ}
After xmake create -l c hello, the emitted xmake.lua has target("hello") and the FAQ block inlined.
Either of these is picked up automatically; no registration step needed:
~/.xmake/templates/<language>/<template-id>/ — personal, visible on your machine only.<repo>/templates/<language>/<template-id>/ — distributable to anyone who adds your repo.Template IDs can be nested: ~/.xmake/templates/c++/game/sdl2/ → -t game.sdl2.
~/.xmake/templates/c++/game/sdl2/
├── xmake.lua
├── src/
│ └── main.cpp
└── assets/
└── .gitkeep
Template xmake.lua:
add_rules("mode.debug", "mode.release")
set_languages("c++17")
add_requires("libsdl2")
target("${TARGET_NAME}")
set_kind("binary")
add_files("src/*.cpp")
add_packages("libsdl2")
${FAQ}
Template src/main.cpp:
#include <SDL2/SDL.h>
int main(int, char**) {
SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return 0;
}
xmake create --list -l c++ # your template should appear under "c++/game.sdl2"
xmake create -l c++ -t game.sdl2 myshooter
cd myshooter
xmake
${TARGET_NAME}.h becomes myshooter.h.${...} — they will be left as literal text in the output.Nothing special — just drop more files into the template tree. Globs in the template xmake.lua (add_files("src/*.cpp")) will pick up whatever the user adds later, so keep file lists glob-based rather than enumerated.
If you want other people to use your template:
xmake-repo.templates/<language>/<id...>/.Or, for a private template library, host your own repo:
xrepo add-repo my-templates https://github.com/me/my-xmake-templates
Once the repo is registered globally, its templates/ directory is picked up by xmake create --list and usable via -t.
. on the CLI (-t qt.widgetapp) — not /. xmake splits on . to walk the template tree.--list doesn't show my template. Either the directory is not at <root>/<language>/<id>/, or there is no xmake.lua in it. templatedir() requires both.${TARGET_NAME} and ${FAQ} are real. Anything else you write with ${...} is left verbatim.-l must exactly match the directory name under templates/. c++ not cpp; objc++ not objcxx.xmake create rejects ., .., /, \, :, or NUL in template ids and language names. Keep template ids to plain identifiers separated by dots.xmake create for scaffolding an existing project. It creates files in an otherwise empty directory; running it inside a populated directory will error out if files would be overwritten. Use a fresh directory or -P <new-dir>.xmake create flow as part of "getting started" → xmake-basicsxmake-packagesxmake.lua body that ends up in the template → xmake-targets, xmake-rulesWhat 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`./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