Skip to main content

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:

  1. Add a search path. Point the agent at Packages/com.code-philosophy.zlua/ZLua~/skills. That folder already has one subdirectory per skill.
  2. Copy or link. Place <skills-root>/<skill-name>/SKILL.md where 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​

SkillThe agent uses it forGuide
zlua-setupUPM, luaVersionId, Install, Generate, script paths, HybridCLR orderInstall and Lua versions, Editor vs Player
zlua-lua-call-csharpCSharp root, construction, members, eventsLua calling C#
zlua-csharp-call-luaInitialize, GetFunction, ResetC# calling Lua
zlua-method-overloadShort-name dispatch, full-signature keys, when to aliasMethod overloads
zlua-default-argumentsTrailing optional parameters and defaultsMethod calls
zlua-generic-methodClosing generic types and generic methodsGenerics
zlua-paramsExpanding params T[] or passing one arrayparams
zlua-arrayOne-dimensional and multidimensional arrays, to_table, to_bytesArrays
zlua-delegateAction / Func, to_delegate, event subscriptionFunction
zlua-in-ref-outref / in write-back, out as extra resultsref / in / out
zlua-marshalDefault value shapesValue types, 0GC Marshal
zlua-marshal-as[LuaMarshalAs] and XMLLuaMarshalAs
zlua-alias[LuaAlias] and XMLLuaAlias
zlua-extension[LuaExtension] and XMLExtension methods
zlua-libtypeof, inflate, box / unbox / cast, opaque, array factoriesCommon zlua library

Learning path​

PreviousSettings
NextHello interop