AI Skills
ZLua~/skills in the package is a set of notes for AI coding agents. It is not a runtime API. Unity skips the folder because the name ends with ~. Do not move the files into an Assets/ or Packages/ folder that has no ~.
After install:
Packages/com.code-philosophy.zlua/ZLua~/skills/<skill-name>/SKILL.md
Each skill is one directory. The description at the top of SKILL.md decides when the agent reads the body. The agent then writes code in that style. For people, this guide set and the spec stay the contract.
How to use them
Agents do not scan ZLua~/skills inside the package. Use that agent's docs to find its skills root, or a search path it lets you add. Each skill is a directory plus SKILL.md.
Either of these is enough:
- Add a search path. Point the agent at
Packages/com.code-philosophy.zlua/ZLua~/skills. That folder already has one subdirectory per skill. - Copy or link. Place
<skills-root>/<skill-name>/SKILL.mdwhere the agent reads skills.
When the package path is stable (Packages/com.code-philosophy.zlua, or a file: local package), set SKILLS to the agent's skills root and link from the project root. Upgrades keep pointing at the package files:
set "SKILLS=path to the agent's skills root"
if not exist "%SKILLS%" mkdir "%SKILLS%"
for /d %d in ("Packages\com.code-philosophy.zlua\ZLua~\skills\*") do if not exist "%SKILLS%\%~nxd" mklink /J "%SKILLS%\%~nxd" "%~fd"
SKILLS="path to the agent's skills root"
mkdir -p "$SKILLS"
for d in Packages/com.code-philosophy.zlua/ZLua~/skills/*/; do
name=$(basename "$d")
ln -sfn "$(cd "$d" && pwd)" "$SKILLS/$name"
done
A Git URL install stores the package in Library/PackageCache/com.code-philosophy.zlua@<version>/. That cache folder name changes, so copy the skill directories into the agent's skills root and copy them again after a ZLua upgrade. Do not link into PackageCache.
Open a new chat afterwards. Ask in plain language, or name a skill, for example "change this call using zlua-params".
Skills and guides
| Skill | The agent uses it for | Guide |
|---|---|---|
zlua-setup | UPM, luaVersionId, Install, Generate, script paths, HybridCLR order | Install and Lua versions, Editor vs Player |
zlua-lua-call-csharp | CSharp root, construction, members, events | Lua calling C# |
zlua-csharp-call-lua | Initialize, GetFunction, Reset | C# calling Lua |
zlua-method-overload | Short-name dispatch, full-signature keys, when to alias | Method overloads |
zlua-default-arguments | Trailing optional parameters and defaults | Method calls |
zlua-generic-method | Closing generic types and generic methods | Generics |
zlua-params | Expanding params T[] or passing one array | params |
zlua-array | One-dimensional and multidimensional arrays, to_table, to_bytes | Arrays |
zlua-delegate | Action / Func, to_delegate, event subscription | Function |
zlua-in-ref-out | ref / in write-back, out as extra results | ref / in / out |
zlua-marshal | Default value shapes | Value types, 0GC Marshal |
zlua-marshal-as | [LuaMarshalAs] and XML | LuaMarshalAs |
zlua-alias | [LuaAlias] and XML | LuaAlias |
zlua-extension | [LuaExtension] and XML | Extension methods |
zlua-lib | typeof, inflate, box / unbox / cast, opaque, array factories | Common zlua library |
Learning path
| Previous | Settings |
| Next | Hello interop |