/xmake-skills:xmake-networkfrom xmake-skills
Configures Xmake network settings for slow/failed package downloads: proxies, host allow-lists, pac.lua routing, mirror URL rewriting, and manual download directories.
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.
When xrepo install, xmake require, or package fetches are slow or fail, xmake gives you several tools in increasing order of power: manual download dir → global proxy → proxy with host allow-list → pac.lua for full rule-based routing and URL mirroring.
All of these are configured with xmake g (global config) — settings persist across all projects on the machine.
If you already have the source tarballs (downloaded by hand, from a mirror, or shared across a team), drop them in a directory and point xmake at it:
xmake g --pkg_searchdirs="/download/packages"
Xmake will search this directory before hitting the network. To find out what filename to put there:
xmake require --info zlib
# -> searchnames: zlib-1.2.11.tar.gz
Drop zlib-1.2.11.tar.gz into /download/packages/ and the next install uses it offline.
Good for: CI caches, air-gapped machines, shared team caches on a file server.
xmake g --proxy="http://127.0.0.1:7890"
xmake g --proxy="https://host:port"
xmake g --proxy="socks5://127.0.0.1:1086"
This proxies everything xmake downloads — git, curl, wget, HTTP packages. Unset with xmake g --proxy=.
Notes:
socks5:// only works for curl/git — wget does not support socks5, so packages that xmake fetches via wget may fail. Prefer http:// or https:// proxies for maximum compatibility.xmake g --help lists all network-related flags.Global proxying slows down non-blocked traffic. Scope it down:
xmake g --proxy="http://127.0.0.1:7890" \
--proxy_hosts="github.com,*.githubusercontent.com,gitlab.*,*.xmake.io"
Only matching hosts go through the proxy; everything else goes direct. * is a Lua pattern wildcard (more flexible than shell glob — any Lua pattern works).
Unset with xmake g --proxy_hosts=.
pac.lua — rule-based proxy + URL mirroringFor anything more complex than "proxy these hosts", use a pac.lua (proxy auto-config) file. Default location:
~/.xmake/pac.lua
Xmake automatically picks it up if --proxy is set and the file exists. Override the location with xmake g --proxy_pac=/abs/path/pac.lua.
main(url, host) — decide whether to proxyReturn true to route through the proxy, false or nothing to go direct:
-- ~/.xmake/pac.lua
function main(url, host)
if host == "github.com" then
return true
end
if host:find("githubusercontent.com", 1, true) then
return true
end
if host:find("gitlab%.") then
return true
end
-- everything else: direct
return false
end
--proxy_hosts and pac.lua exist, --proxy_hosts wins. Remove --proxy_hosts if you want pac.lua to take over.if, string patterns, and tables all work.mirror(url) — rewrite URLs for accelerationAvailable since v2.5.4. The function rewrites download URLs before xmake hits the network — use it to swap github.com for a mirror that is fast in your region:
-- ~/.xmake/pac.lua
function mirror(url)
-- GitHub → a fast mirror (pick one that works for you)
url = url:gsub("github%.com", "kkgithub.com")
url = url:gsub("raw%.githubusercontent%.com", "raw.kkgithub.com")
return url
end
After:
xrepo install libpng
# -> curl https://kkgithub.com/glennrp/libpng/archive/v1.6.37.zip ...
mirror and main coexist: mirror rewrites the URL, then main decides whether to proxy the rewritten host.
-- ~/.xmake/pac.lua
-- Rewrite slow/blocked URLs to fast mirrors
function mirror(url)
-- GitHub archives and raw content
url = url:gsub("https://github%.com", "https://kkgithub.com")
url = url:gsub("https://raw%.githubusercontent%.com", "https://raw.kkgithub.com")
url = url:gsub("https://codeload%.github%.com", "https://codeload.kkgithub.com")
return url
end
-- Fall back to proxy for hosts that have no good mirror
function main(url, host)
local proxied = {
["sourceforge.net"] = true,
["www.sourceforge.net"] = true,
["download.qt.io"] = true,
}
if proxied[host] then
return true
end
return false
end
With this file and xmake g --proxy="http://127.0.0.1:7890" set, GitHub traffic uses the fast mirror directly, SourceForge/Qt fall through to your local proxy, and everything else goes direct.
xmake-repo itselfThe recipe repository (xmake-repo, where add_requires resolves names) is cloned to ~/.xmake/repositories/xmake-repo. If cloning from GitHub is slow:
# Switch to the Gitee mirror of xmake-repo
xmake g --repositories="xmake-repo https://gitee.com/tboox/xmake-repo.git"
# Or Gitea/self-hosted mirror
xmake g --repositories="xmake-repo https://my-gitea.example.com/mirror/xmake-repo.git"
Verify / reset:
xmake repo --list
xmake repo --clean # wipe cloned repos, forces re-clone next run
xmake repo --update # update all configured repos now
Xmake supports binary package caches (precompiled archives). Many xmake-repo packages ship binaries — set this up to skip local compilation entirely for common deps:
xmake g --pkg_installdir=~/.xmake/packages # default; installed packages
To force a package to try the precompiled binary:
xrepo install --precompiled fmt
In CI, cache ~/.xmake/packages and ~/.xmake/cache between runs for instant second builds.
xmake g --show # show all global config including proxy
xmake require --info <pkg> # resolved URLs, searchdirs, searchnames
xmake require --force <pkg> # rebuild/re-download
xmake -vD # verbose + diagnosis — shows actual download commands
XMAKE_PROFILE=trace xmake ... # trace every subprocess (incl. curl/git)
If a download hangs, use XMAKE_PROFILE=stuck to see which URL xmake is blocked on — see xmake-troubleshooting.
Package downloads failing / slow?
│
├── Tarballs already on disk → xmake g --pkg_searchdirs=...
│
├── One global proxy is fine → xmake g --proxy=http://host:port
│
├── Only specific hosts blocked
│ └─ xmake g --proxy=... --proxy_hosts="github.com,*.githubusercontent.com,..."
│
├── Need per-URL rewriting / mirror acceleration
│ └─ write ~/.xmake/pac.lua with main()+mirror()
│
├── xmake-repo clone itself is slow
│ └─ xmake g --repositories="xmake-repo https://gitee.com/tboox/xmake-repo.git"
│
└── Nothing works / hang
└─ XMAKE_PROFILE=stuck xmake ... → see xmake-troubleshooting
socks5:// + wget. Packages downloaded via wget break. Prefer http:// proxies, or install a SOCKS-to-HTTP bridge (e.g. privoxy).--proxy_hosts overrides pac.lua. If your main() isn't being called, check whether --proxy_hosts is set — it takes precedence.*.github.com in --proxy_hosts is a Lua pattern; * matches zero-or-more of the previous character (usually fine for hosts, but not shell semantics). Test with xmake -vD if unsure.xmake require --force <pkg> to re-download.git, which also needs the proxy. git config --global http.proxy ... or set it in pac.lua via --proxy.xrepo-cli, xmake-packagesxmake-troubleshootingxmake-private-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`./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