gui-draft

Generates MVVM code (Panel.lua and View.cs) for Unity GUI panels from a GUI_PLAN.md contract.

Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AvatarGanymede/dev-gui-plugin --skill gui-draft-avatarganymede
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gui-draft
Source: https://github.com/AvatarGanymede/dev-gui-plugin/tree/main/skills/gui-draft
Command: npx skills add https://github.com/AvatarGanymede/dev-gui-plugin --skill gui-draft-avatarganymede

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Unity MVVM GUI code by hand risks drifting from the agreed requirements contract and from project conventions. This Skill generates the Panel.lua and View.cs implementation directly from the approved GUI_PLAN.md, keeping ViewModel design, naming, and lifecycle patterns consistent with the plan and existing codebase. ## Core Features & Use Cases - MVVM Code Generation: Produces Panel.lua (writes ViewModel) and View.cs (read-only binding) following a strict one-way data flow, with ViewModel properties copied verbatim from the plan rather than invented. - Tool-First ViewModel Export: Uses csharp-tool to export ViewModel artifacts (ViewModel.cs, viewmodel.lua, factory, define files), falling back to manual edits with TODO markers only when the tool fails. - Pattern Reuse & Self-Check Gate: Consults shared pattern references for lists, reusable components, and world-space tracking, then runs a gate verifying plan conformance, bidirectional property matching, and compilation. - Use Case: After gui-plan approves a BagPanel design, run this phase to generate BagPanel.lua and BagView.cs aligned with the planned ViewModel, then trigger C# compilation via unity-cli. ## Quick Start Ask the AI to run the gui-draft phase to generate the MVVM Panel.lua and View.cs code for your panel based on the approved GUI_PLAN.md.

Frequently Asked Questions about gui-draft

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

FAQPage Schema
How do I generate MVVM code for a Unity GUI panel?▼

Run this phase after gui-plan produces GUI_PLAN.md. It reads the plan's module breakdown and ViewModel design, checks existing panels for conventions, then generates Panel.lua and View.cs, triggering C# compilation at the end.

How does Lua Panel and C# View data binding work in this MVVM setup?▼

The Lua Panel writes ViewModel properties while the C# View only reads them, creating one-way data flow through SharedArray. The View registers PropertyChangeHandler callbacks and sends user actions back via SendUIMessage with a synchronized enum.

Can I add new ViewModel properties during code generation?▼

New properties must already exist in GUI_PLAN.md's ViewModel design; this phase copies them verbatim into ViewModelDes files. It then exports generated code via csharp-tool, which works independently of Unity Editor and requires no prior compilation.

What happens if csharp-tool export fails during ViewModel generation?▼

Manual edits to generated files are allowed only as a fallback when the tool fails or is unavailable. Such edits must carry a TODO(模拟导出) marker and be recorded in HUMAN_REVIEW.md for later review.

What if Unity Editor is not running when compilation is needed?▼

The phase checks Unity Editor status via unity-cli and uses either unity-cli or Batch Mode to trigger compilation. If neither path is available, the step is marked BLOCKED and recorded in HUMAN_REVIEW.md.