Generate a complete AHK v2 GUI from a natural language description. Creates class-based, mathematically positioned GUIs with proper event binding. TRIGGER when: user says "generate a GUI", "build me a window", "create a dialog", "make a form", "design a settings panel", "build a tool with UI".
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Generate a complete AHK v2 GUI from a natural language description. Creates class-based, mathematically positioned GUIs with proper event binding. TRIGGER when: user says "generate a GUI", "build me a window", "create a dialog", "make a form", "design a settings panel", "build a tool with UI".
AHK v2 GUI Generator
Generate complete, production-quality GUIs from natural language descriptions.
Before Generating
Invoke/ahk-gui skill to load GUI module knowledge
ReadModules/Module_GUI.md for patterns
ReadModules/Supplemental/Module_GUI_Layout.md for positioning rules
Plan the layout mathematically (compute all positions)
Generate a complete class-based GUI
Validate with check /Diag=json
Observe (optional): run the GUI, then capture it with Tools/CaptureWindow.ahk —
AutoHotkey64.exe Tools/CaptureWindow.ahk <pid|wintitle> [outPng] [zoom] [print|screen]
(print mode works occluded; screen mode shows exact pixels incl. GetDC overpaints).
Read the PNG to verify layout, then close the GUI.
GUI Template
#Requires AutoHotkey v2.0
#SingleInstance Force
class <AppName> {
static margin := 10
static spacing := 10
__New() {
this.gui := Gui("+Resize", "<Window Title>")
this.gui.BackColor := "0x1a1a2e"
this.gui.SetFont("s10 c0xe0e0e0", "Segoe UI")
this.BuildControls()
this.gui.OnEvent("Close", (*) => ExitApp())
this.gui.OnEvent("Size", this.OnSize.Bind(this))
this.gui.Show("w<width> h<height>")
}
BuildControls() {
m := <AppName>.margin
s := <AppName>.spacing
w := <width> - m * 2
currentY := m
; === Controls with mathematical positioning ===
this.gui.AddText("x" . m . " y" . currentY . " w" . w . " h25", "Label")
currentY += 25 + s
this.editCtrl := this.gui.AddEdit("x" . m . " y" . currentY . " w" . w . " h100")
currentY += 100 + s
btnW := 100
btnX := <width> - m - btnW
this.gui.AddButton("x" . btnX . " y" . currentY . " w" . btnW . " h30", "OK")
.OnEvent("Click", this.OnOK.Bind(this))
}
OnSize(guiObj, minMax, width, height) {
if minMax = -1
return
; Reposition ALL controls based on new dimensions
}
OnOK(*) {
; Handle button click
}
__Delete() {
if this.HasProp("gui") && this.gui
this.gui.Destroy()
}
}
<AppName>()
Checklist
All controls use computed positions (no hard-coded Y)