[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77W8EERJ7B2QZGKWQJXF36K":3,"skill-same:01M77W8EERJ7B2QZGKWQJXF36K":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M77W8EERJ7B2QZGKWQJXF36K","skill_design",null,"Create the Visual Interface for audio plugins. Use when user mentions UI design, mockup, WebView interface, or requests 'design UI for [plugin]'.","johnson-cooper\u002Fsolara","johnson-cooper","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F129237833?v=4","01M77W77NPX34PNKYKJGW9GHE8","Cooper Johnson","01M77W77PE71KVTKQCGJYV7Z0X",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdesign\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skill_design\ndescription: Create the Visual Interface for audio plugins. Use when user mentions UI design, mockup, WebView interface, or requests 'design UI for [plugin]'.\n---\n\n\n# SKILL: GUI DESIGN\n**Goal:** Create the Visual Interface for audio plugins.\n**Output Location:** `plugins\u002F[Name]\u002FDesign\u002F` and `Source\u002F`\n\n---\n\n## 🎨 PHASE 0: DESIGN LIBRARY CHECK\n\nCheck if `design_library\u002Fmanifest.json` exists and count available designs.\n\n**Import state management:**\n```powershell\n# Import state management module\n. \"$PSScriptRoot\\..\\scripts\\state-management.ps1\"\n```\n\n**Validate prerequisites:**\n```powershell\n# Check that planning phase is complete and framework is selected\nif (-not (Test-PluginState -PluginPath \"plugins\\[Name]\" -RequiredPhase \"plan_complete\" -RequiredFiles @(\".ideas\u002Farchitecture.md\", \".ideas\u002Fplan.md\"))) {\n    Write-Error \"Prerequisites not met. Complete planning phase first with framework selection.\"\n    exit 1\n}\n\n# Get current state to check framework\n$state = Get-PluginState -PluginPath \"plugins\\[Name]\"\nif ($state.ui_framework -eq \"pending\") {\n    Write-Error \"UI framework not selected. Complete planning phase first.\"\n    exit 1\n}\n```\n\n**If designs exist, present menu:**\n```\nFound {N} saved designs in library.\n\nHow would you like to start?\n1. Use existing design - Apply saved visual style\n2. Start from scratch - Create custom design\n3. Browse library - View all designs first\n\nChoose (1-3): _\n```\n\n**Routing:**\n- Option 1: Show designs with previews, let user pick, skip to Phase 2 with applied style\n- Option 2: Continue to Phase 1 (requirements gathering)\n- Option 3: List all designs with metadata, return to menu\n\n**If no designs:** Skip to Phase 1.\n\n---\n\n## 🎨 PHASE 0: DESIGN LIBRARY CHECK\n\n**Check for existing designs first:**\n```powershell\n# Check if design library exists\n$manifestPath = \"design_library\u002Fmanifest.json\"\nif (Test-Path $manifestPath) {\n    $manifest = Get-Content $manifestPath | ConvertFrom-Json\n    $designCount = $manifest.totalDesigns\n\n    Write-Host \"Found $designCount saved designs in library.\" -ForegroundColor Cyan\n    Write-Host \"\"\n\n    # Present menu\n    Write-Host \"How would you like to start?\" -ForegroundColor Yellow\n    Write-Host \"1. Use existing design - Apply saved visual style\"\n    Write-Host \"2. Start from scratch - Create custom design\"\n    Write-Host \"3. Browse library - View all designs first\"\n    Write-Host \"\"\n    $choice = Read-Host \"Choose (1-3)\"\n\n    switch ($choice) {\n        \"1\" {\n            # Show available designs and let user pick\n            Show-DesignLibrary -Manifest $manifest\n            $selectedDesign = Read-Host \"Enter design ID to use\"\n            # Apply selected design as v1\n            Apply-DesignFromLibrary -DesignId $selectedDesign\n            # Skip to Phase 2 with applied design\n        }\n        \"2\" {\n            # Continue to Phase 1 (requirements gathering)\n        }\n        \"3\" {\n            # List all designs with details\n            Show-DesignLibrary -Manifest $manifest -Detailed\n            # Return to menu\n            # (Loop back to choice prompt)\n        }\n    }\n} else {\n    Write-Host \"No design library found. Starting from scratch.\" -ForegroundColor Yellow\n    # Continue to Phase 1\n}\n```\n\n**Design Library Integration:**\n- If user chooses existing design: Apply it as the starting point, still allow iteration\n- If user chooses from scratch: Continue to Phase 1\n- Browse option: Show metadata without committing to use\n\n---\n\n## 📋 PHASE 1: REQUIREMENTS GATHERING\n\n**Do NOT write code yet.** Gather requirements through focused questions.  \nException: For **Visage** only, a preview scaffold may be generated after Phase 2 if the user approves.\n\n### Tier 1 - Critical (always ask if missing):\n1. **Style Direction:** Cyberpunk? Analog hardware? Minimal modern? Skeuomorphic?\n2. **Primary Layout:** Big central knob? Horizontal strip? Vertical rack? Multi-section?\n3. **Control Count:** How many knobs\u002Fsliders\u002Fbuttons? (affects spacing)\n4. **Window Size:** Compact (400x300)? Standard (600x400)? Large (800x600)?\n\n### Tier 2 - Visual (ask if Tier 1 complete):\n5. **Color Palette:** Primary accent color? Dark\u002Flight theme?\n6. **Control Style:** Rotary knobs? Linear sliders? Toggles? Mix?\n7. **Metering:** VU meters? LED indicators? Waveform display?\n\n### Tier 3 - Polish (ask last):\n8. **Branding:** Logo placement? Plugin name display?\n9. **Special Features:** Preset browser? Analyzer? Custom graphics?\n\n**Helper Functions for Design Library:**\n\n```powershell\nfunction Show-DesignLibrary {\n    param($Manifest, [switch]$Detailed)\n\n    Write-Host \"Available Designs:\" -ForegroundColor Cyan\n    Write-Host (\"=\" * 50) -ForegroundColor Cyan\n\n    foreach ($design in $Manifest.designs) {\n        Write-Host \"$($design.id)\" -ForegroundColor Green\n        Write-Host \"  Name: $($design.name)\"\n        Write-Host \"  Style: $($design.vibe)\"\n        Write-Host \"  Best for: $($design.bestFor -join ', ')\"\n\n        if ($Detailed) {\n            Write-Host \"  Colors: $($design.colors.primary) (primary), $($design.colors.accent) (accent)\"\n            Write-Host \"  Supports: $($design.supports.webview ? 'WebView' : ''), $($design.supports.visage ? 'Visage' : '')\"\n            Write-Host \"  Usage: $($design.usageCount) times\"\n            Write-Host \"\"\n        }\n    }\n}\n\nfunction Apply-DesignFromLibrary {\n    param($DesignId)\n\n    $manifest = Get-Content \"design_library\u002Fmanifest.json\" | ConvertFrom-Json\n    $design = $manifest.designs | Where-Object { $_.id -eq $DesignId }\n\n    if ($design) {\n        Write-Host \"Applying design: $($design.name)\" -ForegroundColor Green\n\n        # Copy design files as v1 starting point\n        $designPath = \"design_library\u002F$($design.path)\"\n\n        # Copy preview.html as v1-test.html (WebView only)\n        $state = Get-PluginState -PluginPath \"plugins\u002F[$PluginName]\"\n        if ($state.ui_framework -eq \"webview\") {\n            Copy-Item \"$designPath\u002Fpreview.html\" \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-test.html\"\n        }\n\n        # Generate v1-ui-spec.md based on design metadata\n        $specContent = @\"\n# UI Specification v1 (Based on $($design.name))\n\n## Design Source\n- **Library Design:** $($design.name)\n- **ID:** $($design.id)\n- **Style:** $($design.vibe)\n\n## Layout\n[Layout details from design]\n\n## Colors\n- Primary: $($design.colors.primary)\n- Accent: $($design.colors.accent)\n- Background: $($design.colors.background)\n\n## Controls\n[Control specifications based on design]\n\"@\n\n        $specContent | Out-File \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-ui-spec.md\"\n\n        # Generate v1-style-guide.md\n        $styleContent = @\"\n# Style Guide v1 (Based on $($design.name))\n\n## Color Palette\n- **Primary:** $($design.colors.primary)\n- **Accent:** $($design.colors.accent)\n- **Background:** $($design.colors.background)\n\n## Typography\n[Typography details]\n\n## Visual Style\n- **Theme:** $($design.vibe)\n- **Best for:** $($design.bestFor -join ', ')\n\"@\n\n        $styleContent | Out-File \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-style-guide.md\"\n\n        Write-Host \"Design applied as v1. You can now iterate on this foundation.\" -ForegroundColor Green\n    } else {\n        Write-Error \"Design '$DesignId' not found in library.\"\n    }\n}\n```\n\n**Rules:**\n- Ask max 4 questions at once using `AskUserQuestion` tool\n- Check creative brief first (if exists) - extract known requirements\n- Calculate recommended window size before asking (based on control count)\n- Present decision gate after each batch: Finalize \u002F Ask more \u002F Add context\n\n---\n\n## 🎨 PHASE 2: MOCKUP GENERATION\n\n**Create design specification files (all frameworks):**\n\n1. **`plugins\u002F[Name]\u002FDesign\u002Fv1-ui-spec.md`** - Structured design plan:\n```markdown\n   # UI Specification v1\n   \n   ## Layout\n   - Window: [width]x[height]px\n   - Sections: [list sections]\n   - Grid: [describe layout structure]\n   \n   ## Controls\n   | Parameter | Type | Position | Range | Default |\n   |-----------|------|----------|-------|---------|\n   | ...       | ...  | ...      | ...   | ...     |\n   \n   ## Color Palette\n   - Background: #______\n   - Primary: #______\n   - Accent: #______\n   - Text: #______\n   \n   ## Style Notes\n   [Key visual decisions, inspirations, constraints]\n```\n\n2. **`plugins\u002F[Name]\u002FDesign\u002Fv1-style-guide.md`** - Visual reference:\n   - Hex codes for all colors\n   - Font choices and sizes\n   - Spacing\u002Fpadding rules\n   - Control visual styles\n   - Example UI state descriptions\n\n3. **Framework-specific preview artifacts:**\n\n### If `ui_framework == webview`\nGenerate **`plugins\u002F[Name]\u002FDesign\u002Fv1-test.html`** - **WORKING HTML PREVIEW**:\n   \n   **CRITICAL:** For WebView framework, this HTML MUST be production-ready with proper JUCE integration.\n\n   **Required structure:**\n   ```html\n   \u003C!DOCTYPE html>\n   \u003Chtml lang=\"en\">\n   \u003Chead>\n     \u003Cmeta charset=\"UTF-8\">\n     \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n     \u003Ctitle>[Name] Plugin\u003C\u002Ftitle>\n     \u003Cscript type=\"module\" src=\"js\u002Findex.js\">\u003C\u002Fscript>\n     \u003Cstyle>\n       \u002F* Complete CSS based on style guide *\u002F\n       :root {\n         --primary: [color from style guide];\n         --accent: [color from style guide];\n         --background: [color from style guide];\n       }\n       \n       body {\n         background: var(--background);\n         color: var(--primary);\n         font-family: [font from style guide];\n         margin: 0;\n         padding: [padding from style guide];\n         width: [width]px;\n         height: [height]px;\n         overflow: hidden;\n       }\n       \n       \u002F* All UI component styles *\u002F\n     \u003C\u002Fstyle>\n   \u003C\u002Fhead>\n   \u003Cbody>\n     \u003C!-- Complete HTML structure matching UI spec -->\n     \u003Cdiv id=\"plugin-ui\">\n       \u003C!-- Controls with proper IDs matching parameter IDs -->\n       \u003Cdiv class=\"control\" id=\"[PARAMETER_ID]-control\">\n         \u003Cdiv class=\"knob\" id=\"[PARAMETER_ID]-knob\">\u003C\u002Fdiv>\n         \u003Cdiv class=\"label\">[Parameter Name]\u003C\u002Fdiv>\n         \u003Cdiv class=\"value\" id=\"[PARAMETER_ID]-value\">[Default Value]\u003C\u002Fdiv>\n       \u003C\u002Fdiv>\n       \u003C!-- Repeat for all controls -->\n     \u003C\u002Fdiv>\n   \u003C\u002Fbody>\n   \u003C\u002Fhtml>\n   ```\n\n   **JavaScript placeholder (for preview only):**\n   ```javascript\n   \u002F\u002F This is a placeholder for preview - actual implementation goes in Source\u002Fui\u002Fpublic\u002Fjs\u002Findex.js\n   document.addEventListener(\"DOMContentLoaded\", () => {\n       console.log(\"Preview mode - UI structure loaded\");\n       \u002F\u002F Preview-only code here\n   });\n   ```\n\n   **For WebView plugins:** The HTML in `v1-test.html` should be **identical** to what will be in `Source\u002Fui\u002Fpublic\u002Findex.html` (minus the preview JavaScript).\n\n   **CRITICAL WebView Requirements:**\n   - HTML must use `\u003Cscript type=\"module\">` for JavaScript imports\n   - All element IDs must match parameter IDs from `parameter-spec.md`\n   - CSS must be complete and production-ready (embedded in `\u003Cstyle>` tag)\n   - HTML structure must match the approved design exactly\n   - No external dependencies (all assets embedded or served via resource provider)\n\n### If `ui_framework == visage`\n**Do NOT generate HTML.** Instead, offer a **Visage preview scaffold** (default **Yes**):\n\nAsk:\n```\nGenerate a Visage preview scaffold now? (Y\u002Fn)\n```\n\nDefault: **Yes** (generate unless user explicitly says no).\n\nIf yes, generate:\n- `plugins\u002F[Name]\u002FSource\u002FVisageControls.h` using `templates\u002Fvisage\u002FVisageControls.h.template`\n- `plugins\u002F[Name]\u002FSource\u002FPluginEditor.h` and `PluginEditor.cpp` using `templates\u002Fvisage\u002F`\n\nThese files are **preview-only** and will be refined during `\u002Fimpl`.\n\n**Present decision menu:**\n```\n🎨 Design specification v1 created\nFiles:\n   - plugins\u002F[Name]\u002FDesign\u002Fv1-ui-spec.md\n   - plugins\u002F[Name]\u002FDesign\u002Fv1-style-guide.md\n   - WebView: plugins\u002F[Name]\u002FDesign\u002Fv1-test.html (preview in browser)\n   - Visage: Source\u002FVisageControls.h + PluginEditor.* (preview via preview-design.ps1)\n\n⚠️ STOP HERE - Do NOT create Source\u002F files yet!\nWhat would you like to do?\n1. Iterate - Refine layout or style (creates v2)\n2  Implement - Generate production code in Source\u002F\n3. Save as template - Add to design library\n4. Preview - WebView: open v1-test.html in browser; Visage: run preview-design.ps1\nChoose (1-4): _\n```\n\n**Routing:**\n- Option 1: Collect feedback, create v2 specs and v2-test.html, return to this menu\n- Option 2: Mark design as approved and complete Design phase, suggest starting Implementation phase\n- Option 3: Save to design_library\u002F, return to menu\n- Option 4: Open v1-test.html or run Visage preview, return to menu\n\n**After design approval (Option 2):**\n```powershell\n# Mark design phase complete\nComplete-Phase -PluginPath \"plugins\\[Name]\" -Phase \"design\" -Updates @{\n  \"validation.design_complete\" = $true\n}\n\nWrite-Host \"Design phase complete! Ready for implementation.\"\nWrite-Host \"Run \u002Fimpl [Name] to start building the plugin.\"\n```\n\n---\n\n## ✅ PHASE 4: COMPLETION\n\n1. **Commit files to git**\n2. **Update `plugins\u002F[Name]\u002F.ideas\u002Ftodo.md`** - Check off GUI tasks\n3. **Update `PLUGINS.md`** - Mark design stage complete\n\n**Present instructions:**\n```\nGUI files generated and committed!\n\nNext steps:\n- Preview Visage: powershell -ExecutionPolicy Bypass -File .\\scripts\\preview-design.ps1 -PluginName [Name]\n- Preview WebView: Open plugins\u002F[Name]\u002FDesign\u002Findex.html in browser\n- Build: Follow standard build process\n\nFiles created:\n[list generated files]\n```\n\n**STOP HERE.** Let user test before proceeding.\n\n---\n\n## 🔄 VERSIONING SYSTEM\n\n- Each iteration creates new version: v1, v2, v3...\n- All files prefixed with version: `v2-ui-spec.md`, `v2-PluginEditor.h`\n- Keep all versions for comparison\n- Latest version used for build unless specified\n\n---\n\n## 📚 INTEGRATION\n\n**Invoked by:**\n- Natural language: \"Design UI for [Name]\", \"Create GUI mockup\"\n- After creative brief in plugin workflow\n- During plugin redesign\n\n**Creates:**\n- Design specs: `plugins\u002F[Name]\u002FDesign\u002Fv[N]-*.md`\n- Source code: `Source\u002FPluginEditor.{h,cpp}`\n- Optional: `Source\u002FVisageControls.h`, `v[N]-ui.html`\n\n**Updates:**\n- `PLUGINS.md` - Design status\n- `plugins\u002F[Name]\u002F.ideas\u002Ftodo.md` - Task completion\n\n---\n\n## ⚠️ CRITICAL RULES\n\n1. **Never write code before gathering requirements** - Always complete Phase 1 first\n2. **Respect the decision gates** - Wait for user approval at each menu\n3. **One phase at a time** - Don't skip ahead\n4. **Version everything** - Never overwrite previous iterations\n5. **Check design library first** - Reuse before creating\n6. **Commit after each phase** - Preserve progress\n","# SKILL: GUI DESIGN\n**Goal:** Create the Visual Interface for audio plugins.\n**Output Location:** `plugins\u002F[Name]\u002FDesign\u002F` and `Source\u002F`\n\n---\n\n## 🎨 PHASE 0: DESIGN LIBRARY CHECK\n\nCheck if `design_library\u002Fmanifest.json` exists and count available designs.\n\n**Import state management:**\n```powershell\n# Import state management module\n. \"$PSScriptRoot\\..\\scripts\\state-management.ps1\"\n```\n\n**Validate prerequisites:**\n```powershell\n# Check that planning phase is complete and framework is selected\nif (-not (Test-PluginState -PluginPath \"plugins\\[Name]\" -RequiredPhase \"plan_complete\" -RequiredFiles @(\".ideas\u002Farchitecture.md\", \".ideas\u002Fplan.md\"))) {\n    Write-Error \"Prerequisites not met. Complete planning phase first with framework selection.\"\n    exit 1\n}\n\n# Get current state to check framework\n$state = Get-PluginState -PluginPath \"plugins\\[Name]\"\nif ($state.ui_framework -eq \"pending\") {\n    Write-Error \"UI framework not selected. Complete planning phase first.\"\n    exit 1\n}\n```\n\n**If designs exist, present menu:**\n```\nFound {N} saved designs in library.\n\nHow would you like to start?\n1. Use existing design - Apply saved visual style\n2. Start from scratch - Create custom design\n3. Browse library - View all designs first\n\nChoose (1-3): _\n```\n\n**Routing:**\n- Option 1: Show designs with previews, let user pick, skip to Phase 2 with applied style\n- Option 2: Continue to Phase 1 (requirements gathering)\n- Option 3: List all designs with metadata, return to menu\n\n**If no designs:** Skip to Phase 1.\n\n---\n\n## 🎨 PHASE 0: DESIGN LIBRARY CHECK\n\n**Check for existing designs first:**\n```powershell\n# Check if design library exists\n$manifestPath = \"design_library\u002Fmanifest.json\"\nif (Test-Path $manifestPath) {\n    $manifest = Get-Content $manifestPath | ConvertFrom-Json\n    $designCount = $manifest.totalDesigns\n\n    Write-Host \"Found $designCount saved designs in library.\" -ForegroundColor Cyan\n    Write-Host \"\"\n\n    # Present menu\n    Write-Host \"How would you like to start?\" -ForegroundColor Yellow\n    Write-Host \"1. Use existing design - Apply saved visual style\"\n    Write-Host \"2. Start from scratch - Create custom design\"\n    Write-Host \"3. Browse library - View all designs first\"\n    Write-Host \"\"\n    $choice = Read-Host \"Choose (1-3)\"\n\n    switch ($choice) {\n        \"1\" {\n            # Show available designs and let user pick\n            Show-DesignLibrary -Manifest $manifest\n            $selectedDesign = Read-Host \"Enter design ID to use\"\n            # Apply selected design as v1\n            Apply-DesignFromLibrary -DesignId $selectedDesign\n            # Skip to Phase 2 with applied design\n        }\n        \"2\" {\n            # Continue to Phase 1 (requirements gathering)\n        }\n        \"3\" {\n            # List all designs with details\n            Show-DesignLibrary -Manifest $manifest -Detailed\n            # Return to menu\n            # (Loop back to choice prompt)\n        }\n    }\n} else {\n    Write-Host \"No design library found. Starting from scratch.\" -ForegroundColor Yellow\n    # Continue to Phase 1\n}\n```\n\n**Design Library Integration:**\n- If user chooses existing design: Apply it as the starting point, still allow iteration\n- If user chooses from scratch: Continue to Phase 1\n- Browse option: Show metadata without committing to use\n\n---\n\n## 📋 PHASE 1: REQUIREMENTS GATHERING\n\n**Do NOT write code yet.** Gather requirements through focused questions.  \nException: For **Visage** only, a preview scaffold may be generated after Phase 2 if the user approves.\n\n### Tier 1 - Critical (always ask if missing):\n1. **Style Direction:** Cyberpunk? Analog hardware? Minimal modern? Skeuomorphic?\n2. **Primary Layout:** Big central knob? Horizontal strip? Vertical rack? Multi-section?\n3. **Control Count:** How many knobs\u002Fsliders\u002Fbuttons? (affects spacing)\n4. **Window Size:** Compact (400x300)? Standard (600x400)? Large (800x600)?\n\n### Tier 2 - Visual (ask if Tier 1 complete):\n5. **Color Palette:** Primary accent color? Dark\u002Flight theme?\n6. **Control Style:** Rotary knobs? Linear sliders? Toggles? Mix?\n7. **Metering:** VU meters? LED indicators? Waveform display?\n\n### Tier 3 - Polish (ask last):\n8. **Branding:** Logo placement? Plugin name display?\n9. **Special Features:** Preset browser? Analyzer? Custom graphics?\n\n**Helper Functions for Design Library:**\n\n```powershell\nfunction Show-DesignLibrary {\n    param($Manifest, [switch]$Detailed)\n\n    Write-Host \"Available Designs:\" -ForegroundColor Cyan\n    Write-Host (\"=\" * 50) -ForegroundColor Cyan\n\n    foreach ($design in $Manifest.designs) {\n        Write-Host \"$($design.id)\" -ForegroundColor Green\n        Write-Host \"  Name: $($design.name)\"\n        Write-Host \"  Style: $($design.vibe)\"\n        Write-Host \"  Best for: $($design.bestFor -join ', ')\"\n\n        if ($Detailed) {\n            Write-Host \"  Colors: $($design.colors.primary) (primary), $($design.colors.accent) (accent)\"\n            Write-Host \"  Supports: $($design.supports.webview ? 'WebView' : ''), $($design.supports.visage ? 'Visage' : '')\"\n            Write-Host \"  Usage: $($design.usageCount) times\"\n            Write-Host \"\"\n        }\n    }\n}\n\nfunction Apply-DesignFromLibrary {\n    param($DesignId)\n\n    $manifest = Get-Content \"design_library\u002Fmanifest.json\" | ConvertFrom-Json\n    $design = $manifest.designs | Where-Object { $_.id -eq $DesignId }\n\n    if ($design) {\n        Write-Host \"Applying design: $($design.name)\" -ForegroundColor Green\n\n        # Copy design files as v1 starting point\n        $designPath = \"design_library\u002F$($design.path)\"\n\n        # Copy preview.html as v1-test.html (WebView only)\n        $state = Get-PluginState -PluginPath \"plugins\u002F[$PluginName]\"\n        if ($state.ui_framework -eq \"webview\") {\n            Copy-Item \"$designPath\u002Fpreview.html\" \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-test.html\"\n        }\n\n        # Generate v1-ui-spec.md based on design metadata\n        $specContent = @\"\n# UI Specification v1 (Based on $($design.name))\n\n## Design Source\n- **Library Design:** $($design.name)\n- **ID:** $($design.id)\n- **Style:** $($design.vibe)\n\n## Layout\n[Layout details from design]\n\n## Colors\n- Primary: $($design.colors.primary)\n- Accent: $($design.colors.accent)\n- Background: $($design.colors.background)\n\n## Controls\n[Control specifications based on design]\n\"@\n\n        $specContent | Out-File \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-ui-spec.md\"\n\n        # Generate v1-style-guide.md\n        $styleContent = @\"\n# Style Guide v1 (Based on $($design.name))\n\n## Color Palette\n- **Primary:** $($design.colors.primary)\n- **Accent:** $($design.colors.accent)\n- **Background:** $($design.colors.background)\n\n## Typography\n[Typography details]\n\n## Visual Style\n- **Theme:** $($design.vibe)\n- **Best for:** $($design.bestFor -join ', ')\n\"@\n\n        $styleContent | Out-File \"plugins\u002F[$PluginName]\u002FDesign\u002Fv1-style-guide.md\"\n\n        Write-Host \"Design applied as v1. You can now iterate on this foundation.\" -ForegroundColor Green\n    } else {\n        Write-Error \"Design '$DesignId' not found in library.\"\n    }\n}\n```\n\n**Rules:**\n- Ask max 4 questions at once using `AskUserQuestion` tool\n- Check creative brief first (if exists) - extract known requirements\n- Calculate recommended window size before asking (based on control count)\n- Present decision gate after each batch: Finalize \u002F Ask more \u002F Add context\n\n---\n\n## 🎨 PHASE 2: MOCKUP GENERATION\n\n**Create design specification files (all frameworks):**\n\n1. **`plugins\u002F[Name]\u002FDesign\u002Fv1-ui-spec.md`** - Structured design plan:\n```markdown\n   # UI Specification v1\n   \n   ## Layout\n   - Window: [width]x[height]px\n   - Sections: [list sections]\n   - Grid: [describe layout structure]\n   \n   ## Controls\n   | Parameter | Type | Position | Range | Default |\n   |-----------|------|----------|-------|---------|\n   | ...       | ...  | ...      | ...   | ...     |\n   \n   ## Color Palette\n   - Background: #______\n   - Primary: #______\n   - Accent: #______\n   - Text: #______\n   \n   ## Style Notes\n   [Key visual decisions, inspirations, constraints]\n```\n\n2. **`plugins\u002F[Name]\u002FDesign\u002Fv1-style-guide.md`** - Visual reference:\n   - Hex codes for all colors\n   - Font choices and sizes\n   - Spacing\u002Fpadding rules\n   - Control visual styles\n   - Example UI state descriptions\n\n3. **Framework-specific preview artifacts:**\n\n### If `ui_framework == webview`\nGenerate **`plugins\u002F[Name]\u002FDesign\u002Fv1-test.html`** - **WORKING HTML PREVIEW**:\n   \n   **CRITICAL:** For WebView framework, this HTML MUST be production-ready with proper JUCE integration.\n\n   **Required structure:**\n   ```html\n   \u003C!DOCTYPE html>\n   \u003Chtml lang=\"en\">\n   \u003Chead>\n     \u003Cmeta charset=\"UTF-8\">\n     \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n     \u003Ctitle>[Name] Plugin\u003C\u002Ftitle>\n     \u003Cscript type=\"module\" src=\"js\u002Findex.js\">\u003C\u002Fscript>\n     \u003Cstyle>\n       \u002F* Complete CSS based on style guide *\u002F\n       :root {\n         --primary: [color from style guide];\n         --accent: [color from style guide];\n         --background: [color from style guide];\n       }\n       \n       body {\n         background: var(--background);\n         color: var(--primary);\n         font-family: [font from style guide];\n         margin: 0;\n         padding: [padding from style guide];\n         width: [width]px;\n         height: [height]px;\n         overflow: hidden;\n       }\n       \n       \u002F* All UI component styles *\u002F\n     \u003C\u002Fstyle>\n   \u003C\u002Fhead>\n   \u003Cbody>\n     \u003C!-- Complete HTML structure matching UI spec -->\n     \u003Cdiv id=\"plugin-ui\">\n       \u003C!-- Controls with proper IDs matching parameter IDs -->\n       \u003Cdiv class=\"control\" id=\"[PARAMETER_ID]-control\">\n         \u003Cdiv class=\"knob\" id=\"[PARAMETER_ID]-knob\">\u003C\u002Fdiv>\n         \u003Cdiv class=\"label\">[Parameter Name]\u003C\u002Fdiv>\n         \u003Cdiv class=\"value\" id=\"[PARAMETER_ID]-value\">[Default Value]\u003C\u002Fdiv>\n       \u003C\u002Fdiv>\n       \u003C!-- Repeat for all controls -->\n     \u003C\u002Fdiv>\n   \u003C\u002Fbody>\n   \u003C\u002Fhtml>\n   ```\n\n   **JavaScript placeholder (for preview only):**\n   ```javascript\n   \u002F\u002F This is a placeholder for preview - actual implementation goes in Source\u002Fui\u002Fpublic\u002Fjs\u002Findex.js\n   document.addEventListener(\"DOMContentLoaded\", () => {\n       console.log(\"Preview mode - UI structure loaded\");\n       \u002F\u002F Preview-only code here\n   });\n   ```\n\n   **For WebView plugins:** The HTML in `v1-test.html` should be **identical** to what will be in `Source\u002Fui\u002Fpublic\u002Findex.html` (minus the preview JavaScript).\n\n   **CRITICAL WebView Requirements:**\n   - HTML must use `\u003Cscript type=\"module\">` for JavaScript imports\n   - All element IDs must match parameter IDs from `parameter-spec.md`\n   - CSS must be complete and production-ready (embedded in `\u003Cstyle>` tag)\n   - HTML structure must match the approved design exactly\n   - No external dependencies (all assets embedded or served via resource provider)\n\n### If `ui_framework == visage`\n**Do NOT generate HTML.** Instead, offer a **Visage preview scaffold** (default **Yes**):\n\nAsk:\n```\nGenerate a Visage preview scaffold now? (Y\u002Fn)\n```\n\nDefault: **Yes** (generate unless user explicitly says no).\n\nIf yes, generate:\n- `plugins\u002F[Name]\u002FSource\u002FVisageControls.h` using `templates\u002Fvisage\u002FVisageControls.h.template`\n- `plugins\u002F[Name]\u002FSource\u002FPluginEditor.h` and `PluginEditor.cpp` using `templates\u002Fvisage\u002F`\n\nThese files are **preview-only** and will be refined during `\u002Fimpl`.\n\n**Present decision menu:**\n```\n🎨 Design specification v1 created\nFiles:\n   - plugins\u002F[Name]\u002FDesign\u002Fv1-ui-spec.md\n   - plugins\u002F[Name]\u002FDesign\u002Fv1-style-guide.md\n   - WebView: plugins\u002F[Name]\u002FDesign\u002Fv1-test.html (preview in browser)\n   - Visage: Source\u002FVisageControls.h + PluginEditor.* (preview via preview-design.ps1)\n\n⚠️ STOP HERE - Do NOT create Source\u002F files yet!\nWhat would you like to do?\n1. Iterate - Refine layout or style (creates v2)\n2  Implement - Generate production code in Source\u002F\n3. Save as template - Add to design library\n4. Preview - WebView: open v1-test.html in browser; Visage: run preview-design.ps1\nChoose (1-4): _\n```\n\n**Routing:**\n- Option 1: Collect feedback, create v2 specs and v2-test.html, return to this menu\n- Option 2: Mark design as approved and complete Design phase, suggest starting Implementation phase\n- Option 3: Save to design_library\u002F, return to menu\n- Option 4: Open v1-test.html or run Visage preview, return to menu\n\n**After design approval (Option 2):**\n```powershell\n# Mark design phase complete\nComplete-Phase -PluginPath \"plugins\\[Name]\" -Phase \"design\" -Updates @{\n  \"validation.design_complete\" = $true\n}\n\nWrite-Host \"Design phase complete! Ready for implementation.\"\nWrite-Host \"Run \u002Fimpl [Name] to start building the plugin.\"\n```\n\n---\n\n## ✅ PHASE 4: COMPLETION\n\n1. **Commit files to git**\n2. **Update `plugins\u002F[Name]\u002F.ideas\u002Ftodo.md`** - Check off GUI tasks\n3. **Update `PLUGINS.md`** - Mark design stage complete\n\n**Present instructions:**\n```\nGUI files generated and committed!\n\nNext steps:\n- Preview Visage: powershell -ExecutionPolicy Bypass -File .\\scripts\\preview-design.ps1 -PluginName [Name]\n- Preview WebView: Open plugins\u002F[Name]\u002FDesign\u002Findex.html in browser\n- Build: Follow standard build process\n\nFiles created:\n[list generated files]\n```\n\n**STOP HERE.** Let user test before proceeding.\n\n---\n\n## 🔄 VERSIONING SYSTEM\n\n- Each iteration creates new version: v1, v2, v3...\n- All files prefixed with version: `v2-ui-spec.md`, `v2-PluginEditor.h`\n- Keep all versions for comparison\n- Latest version used for build unless specified\n\n---\n\n## 📚 INTEGRATION\n\n**Invoked by:**\n- Natural language: \"Design UI for [Name]\", \"Create GUI mockup\"\n- After creative brief in plugin workflow\n- During plugin redesign\n\n**Creates:**\n- Design specs: `plugins\u002F[Name]\u002FDesign\u002Fv[N]-*.md`\n- Source code: `Source\u002FPluginEditor.{h,cpp}`\n- Optional: `Source\u002FVisageControls.h`, `v[N]-ui.html`\n\n**Updates:**\n- `PLUGINS.md` - Design status\n- `plugins\u002F[Name]\u002F.ideas\u002Ftodo.md` - Task completion\n\n---\n\n## ⚠️ CRITICAL RULES\n\n1. **Never write code before gathering requirements** - Always complete Phase 1 first\n2. **Respect the decision gates** - Wait for user approval at each menu\n3. **One phase at a time** - Don't skip ahead\n4. **Version everything** - Never overwrite previous iterations\n5. **Check design library first** - Reuse before creating\n6. **Commit after each phase** - Preserve progress\n",{"name":5,"description":7},"main","12b9e0c7363e91ca0140b9c7f1c6c37c10d2eafb",".claude\u002Fskills\u002Fdesign","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper","2026-07-01 07:58:33",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add johnson-cooper\u002Fsolara --skill skill_design",{"tool":36,"command":37},"bunx","bunx skills add johnson-cooper\u002Fsolara --skill skill_design",{"tool":39,"command":40},"pnpm","pnpm dlx skills add johnson-cooper\u002Fsolara --skill skill_design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdesign\u002FSKILL.md",true,[],[45,51,57,63,69,75],{"skillNo":46,"name":47,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":19},"01M77WA1DG7127E93ZCEJN9920","skill_troubleshooting","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_troubleshooting\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M77WA08NK9TBCTFKVHBD5Z2Q","skill_testing","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_testing\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M77W9Y67EC89BY21MYH3ZE34","skill_planning","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_planning\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M77W9TKWJN8QQWHJNNJM27NH","skill_packaging","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_packaging\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M77W9NG6DFVNY6PMPM09VHEE","skill_implementation","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_implementation\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M77W9KCB9VRE83Q6PHK6RDMK","skill_ideation","https:\u002F\u002Fgithub.com\u002Fjohnson-cooper\u002Fsolara\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fskill_ideation\u002FSKILL.md",[],[]]