/xmake-skills:xmake-dlangfrom xmake-skills
Builds D projects with xmake: binary/library targets from .d sources, DUB package integration, and DMD/LDC/GDC compiler selection.
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.
D has three main compilers (DMD, LDC, GDC); xmake drives all of them through a unified target() API and supports DUB for package dependencies.
xmake create -l dlang -t console hello
cd hello
xmake run
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/*.d")
target("app") set_kind("binary")
target("mylib") set_kind("static")
target("mydyn") set_kind("shared")
add_requires("dub::vibe-d ~>0.9.5")
add_requires("dub::libasync")
target("app")
set_kind("binary")
add_files("src/*.d")
add_packages("dub::vibe-d", "dub::libasync")
Known limitation: cascading transitive deps must be declared manually for now. Add every dep in the tree explicitly.
xmake f --toolchain=dlang # DMD (default)
xmake f --toolchain=ldc
xmake f --toolchain=gdc
Or pin paths:
xmake f --toolchain=ldc --sdk=/opt/ldc-1.30
LDC is usually the best choice for release builds (LLVM backend, best optimization). DMD is fastest to compile with.
target("app")
add_files("src/*.d")
add_dcflags("-O", "-release") -- passed to the D compiler
add_ldflags("-Wl,--as-needed")
add_dcflags = D compiler flags. Each compiler has its own flag dialect — prefer portable ones or gate with if is_toolchain("ldc") then ... end.
target("app")
set_kind("binary")
add_files("src/main.d", "src/extern.c") -- mix C and D in one target
add_includedirs("include")
D can call C directly via extern (C) declarations on the D side. No bridging needed.
add_dcflags("-mattr=+avx2") works on LDC, fails on DMD. Gate with is_toolchain.xmake-targets, xmake-build-optimizationxmake-cross-compilation (LDC supports many targets)xmake-packagesWhat 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`.Other plugins' skills for the same job