luban-config

Creates and exports Luban Excel config tables to Go and TypeScript code.

Updated Jun 6, 2026
One-click install
npx skills add https://github.com/jonathanlin768/CS2Match-Nakama --skill luban-config-jonathanlin768
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: luban-config
Source: https://github.com/jonathanlin768/CS2Match-Nakama/tree/main/.agents/skills/luban-config
Command: npx skills add https://github.com/jonathanlin768/CS2Match-Nakama --skill luban-config-jonathanlin768

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Game designers and developers need to maintain game configuration data (players, routes, weapons, combat constants) in Excel and convert it into type-safe Go and TypeScript code plus JSON data. Doing this manually is error-prone and requires deep knowledge of Luban's table registration, header formats, and export pipeline. ## Core Features & Use Cases - Table Creation Guidance: Defines the standard 4-row Excel header format (##var, ##type, ##group, ##) and auto-import naming convention using #<Name>.xlsx files. - Complex Type Support: Covers beans, enums, maps, and nested collections with explicit separators, referencing local Luban examples. - Export & Verification Workflow: Runs scripts/gen-config.ps1 via Docker, then updates hand-written loaders (server/config/loader.go, client/src/config/index.ts) and verifies with go test and tsc --noEmit. - Use Case: A designer asks to add a route config table. The Skill creates configs/Datas/#Route.xlsx with the correct schema, exports it, registers tbroute in the client loader, updates TableCount() on the server, and runs both verification checks. ## Quick Start Ask the AI to add a new Luban config table, for example: "Add a weapon config table with id, name, damage, and fire_rate fields and export it."

Frequently Asked Questions about luban-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Luban config table in Excel?

Create a file named `#<Name>.xlsx` in `configs/Datas/` with the standard 4-row header (##var, ##type, ##group, ##) and data starting at row 5 with column A empty. Files with the `#` prefix are auto-imported, so do not register them in `__tables__.xlsx`.

How do I export Luban tables to Go and TypeScript code?

Run `powershell -File scripts/gen-config.ps1` from the project root with Docker Desktop running. The script builds the Luban Docker image, cleans old generated files, and regenerates Go code, TypeScript code, and JSON data.

Why does Luban export fail with 'is not int type' errors?

This usually means a data row has a value in column A, shifting all fields, or the `##group` header row is missing. Leave column A empty in data rows and ensure all four header rows (##var, ##type, ##group, ##) are present.

Why does Luban report 'type duplicate' after registering a table?

This happens when a `#`-prefixed file like `#Player.xlsx` is also manually registered in `__tables__.xlsx`. Auto-import already handles `#` files, so remove the manual registration entry.

Does the Luban export script work without Docker?

No. The export script builds and runs a Luban Docker image, so Docker Desktop must be running. A 'failed to connect to docker API' error means Docker Desktop is not started.

What must be updated manually after exporting a new Luban table?

Add the new table's lowercase JSON name to `TABLE_NAMES` in `client/src/config/index.ts` and export its types, then update `TableCount()` in `server/config/loader.go`. Verify with `go test -v ./...` and `npx tsc --noEmit`.