/lgui:lgui-codefrom lgui
Generates Model, View bindings, Controller, Service, and tests following LGUI's MVC conventions. Use when building data flow, operations, server connections, i18n, and tests behind existing UI components.
Ships in lgui. 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.
什么时候用: 界面已经有了(或者用 --pattern 一起生成),要写数据、操作、请求、存档、多语言文字、测试。界面的样子用 lgui-ui。
先读: MVC 开发规范。第 1 节是固定步骤,每次照做。
输入: 要做的功能(有 UX 设计稿 design/<名字>/ 时,元素点了做什么、状态、数据、该用哪些框架能力、行为用例都以它为准)、用到哪些界面(lgui ui list 查组件和控件名)、要不要接服务器。
命令:
| 要做的事 | 命令 |
|---|---|
| 生成 Model、Controller、测试的骨架 | lgui new module <名字>;连界面一起:加 --pattern <模式> |
| 给已有模块加界面和 View | lgui new view <包>/<组件> --pattern <模式> |
| 类型检查和规范检查 | lgui check(LGUI-MVC-xxx、LGUI-UI-03x、TSxxxx),报错全部改掉 |
| ui/ 里的固定文字提取到文本表 | lgui i18n extract,再翻译其他语言的 i18n/<语言>.json |
| 跑测试 | lgui test(headless 后端、假时钟);只跑一部分:lgui test tests/bag.test.ts、--name 出售;测位置、尺寸、文字排版:--browser(真浏览器,规范第 12 节) |
要点: src/ 只 import 自 lgui 和 lgui/ui;Model 只放数据和规则;View 只写绑定表(显示类用 pick,动作只调用一个 Controller 方法);Controller 改 Model、调服务、开关界面;Service 先写接口,再写真实实现和测试用的假实现;不带图片文件时可在 src/icons.ts 定义代码图标并通过 lgui.app({ icons }) 注册(规范第 4 节);不带 mp3 文件时声音地址可写 synth://<名字> 并在 lgui.app({ platform: { audio } }) 或 host/main.ts 的 defineWebHost({ audio }) 提供自定义声音出口(规范第 15 节);网页三维游戏可在 host/main.ts 用 defineWebHost({ mount(stage) }) 接收框架建好的底层画布和按 inputMode 分流后的输入(规范第 17 节,src/ 和 host/ 都不直接访问 document)。用户看得到的文字都用文本键。测试之间 Model 不重置,加 reset() 并在 beforeEach 里调用(规范第 12 节)。
产出: src/ 和 tests/ 里的代码,lgui check 没有错误,lgui test 全部通过。接着用 lgui-verify 截图。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lumiogames/lgui --plugin lgui6 skills in this plugin
/lgui-setup装好 LGUI 之后建工程、检查环境、打开网页预览。用户第一次用 LGUI、要新建一个 UI 工程、或者 lgui 命令报环境问题时用。/lgui-ui在 LGUI 工程里拼界面:按 UI 开发规范写 ui/ 里的 FairyGUI XML、用排布模式生成横竖两版、AI 出图后用 art split / art cut 拆图、加动效、在编辑器里和人一起改。要新做或修改界面的样子时用。/lgui-unity将已有 LGUI 工程导出到 Unity 6000.6/PuerTS 3.0.3,检查本地包、启动场景和 Windows IL2CPP Player。用于 LGUI 原生交付,不用于普通 Unity 游戏逻辑。/lgui-ux把一张原型图(别的游戏的截图、自己的效果图、线框草图)变成 UX 设计稿:量出位置和文字、判断每个元素做什么、和用户定做不做、标出哪些用现成的,按工程的横竖屏、语言、平台出设计,生成可以点着看的原型页;全套模式再出开发交接和行为用例。拿到原型图要做界面之前、要和用户确认界面需求时用。/lgui-verify验证 LGUI 工程:按标准尺寸横竖截图、换语言和伪翻译截图、跑测试、读调试快照。做完界面或功能、交付之前,或者排查界面显示和行为问题时用。Other plugins' skills for the same job