/gluatest:gluatestfrom gluatest
Writes and runs GLuaTest tests for Garry's Mod Lua projects. Handles test creation under lua/tests/, suite execution via Docker, and log-based failure diagnosis.
Ships in gluatest. 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.
Read when SKILL.md points to them.
GLuaTest is the test framework for Garry's Mod Lua. Tests live in the project at lua/tests/<project>/, and the suite runs in a disposable GMod server through Docker.
Read the complete reference in LLM_GUIDE.md, next to this file, before writing any test file. It is authoritative; matchers from Jest, Busted, or luassert do not exist here and error at runtime.
Rules that come up most:
lua/tests/<project>/*.lua.expect( subject ).to.<matcher>(); stub with stub( tbl, "key" ).expect at least once. Teardown goes in cleanup, never at the bottom of func.async = true and end every path with done() or fail().The runner is docker/run_local.sh in the GLuaTest repository. As a Claude Code plugin it is already installed here:
${CLAUDE_PLUGIN_ROOT}/docker/run_local.sh
If the path above still starts with a literal $, this skill was installed without the repository. Fetch it once per session, and use ~/.gluatest/docker/run_local.sh as the runner:
if [ -d ~/.gluatest ]; then git -C ~/.gluatest pull --ff-only; else git clone --depth 1 https://github.com/CFC-Servers/GLuaTest ~/.gluatest; fi
A failed pull while offline is fine; continue with the existing copy.
Before the first run in a project:
gluatest-run.log to the project's .git/info/exclude so the log never lands in a commit.Run from the project's root directory, with the runner path from the section above:
bash "<runner>" --quiet
--timeout.gluatest-run.log in the directory the command ran from before changing anything. FAIL marks failed cases and Test failures: heads the failure details. If the log has no GLuaTest output, or the runner says the server produced no output, the failure is in Docker or the network (a failed image pull, a full disk), so report it to the user and leave the tests alone.==> A newer GLuaTest runner and agent skill is available, finish the task, then tell the user about the update and the command printed on that line. If you fetched the runner into ~/.gluatest, also tell them that npx skills update refreshes this skill.--filter "<terms>" to run only the test groups whose path or group name contains one of the space-separated terms, for example --filter getRank.lua while iterating on one file. Run the whole suite without a filter before reporting the work as done. If the runner says the image does not support --filter, every test ran.--gamemode <name> when the project is a gamemode, or --branch x86-64 on Apple Silicon.gluatest_requirements.txt (dependencies) and gluatest_custom.cfg (server config) at the root; the runner picks them up automatically.GLuaTest has a reusable GitHub Actions workflow that runs the suite on every pull request. Offer it only in a session where you created the project's first GLuaTest test file and that file passes locally. Then check two things: git remote -v shows a GitHub remote, and no file in .github/workflows/ mentions CFC-Servers/GLuaTest. When both hold, ask the user whether they want the workflow added. Never add it unasked.
If they say yes, create .github/workflows/gluatest.yml:
name: GLuaTest Runner
on:
pull_request:
jobs:
run-tests:
uses: CFC-Servers/GLuaTest/.github/workflows/run_tests.yml@main
with: block under uses:. The names match the flags: gamemode, map, collection, branch, and timeout. All values are strings, so quote the numbers.gluatest_requirements.txt and gluatest_custom.cfg are picked up in CI by the same names, so they need no input.gluatest_requirements.txt need credentials. Add a secrets: block beside with: in the workflow, such as secrets: with ssh-private-key: "${{ secrets.GLUATEST_PRIVATE_KEY }}", and tell the user to create that repository secret with a passwordless SSH key that can read the private repositories. A GitHub token works the same way through github-token. Never write a key or token into the workflow file itself, and never pass these under with:, where GitHub rejects the secrets context.GLuaTest isn't only for testing real code. While building an addon, when you're not sure how a GLua function or engine behavior actually behaves, run the question as a test instead of guessing from memory.
lua/tests/scratch/experiment.lua, one case per question, with groupName = "Scratch". Files directly in lua/tests/ are never loaded, so the file has to live inside a folder.expect, or print intermediate values and read the output in gluatest-run.log.lua/tests/scratch/ so the throwaway file doesn't sneak into a commit.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cfc-servers/gluatest --plugin gluatestOther plugins' skills for the same job