with one click
skill-design
// Create the Visual Interface for audio plugins. Use when user mentions UI design, mockup, WebView interface, or requests 'design UI for [plugin]'.
// Create the Visual Interface for audio plugins. Use when user mentions UI design, mockup, WebView interface, or requests 'design UI for [plugin]'.
Quick-start guide for building JUCE 8 audio plugins with WebView2 UIs on Windows. Covers essential setup, critical member ordering, and step-by-step implementation workflow.
Quick-start guide for building JUCE 8 audio plugins with WebView2 UIs on Windows. Covers essential setup, critical member ordering, and step-by-step implementation workflow.
Quick-start guide for building JUCE 8 audio plugins with WebView2 UIs on Windows. Covers essential setup, critical member ordering, and step-by-step implementation workflow.
Autonomous Debugging Instructions for Visual Studio Code: for [plugin].
| name | skill_design |
| description | Create the Visual Interface for audio plugins. Use when user mentions UI design, mockup, WebView interface, or requests 'design UI for [plugin]'. |
Goal: Create the Visual Interface for audio plugins.
Output Location: plugins/[Name]/Design/ and Source/
Check if design_library/manifest.json exists and count available designs.
Import state management:
# Import state management module
. "$PSScriptRoot\..\scripts\state-management.ps1"
Validate prerequisites:
# Check that planning phase is complete and framework is selected
if (-not (Test-PluginState -PluginPath "plugins\[Name]" -RequiredPhase "plan_complete" -RequiredFiles @(".ideas/architecture.md", ".ideas/plan.md"))) {
Write-Error "Prerequisites not met. Complete planning phase first with framework selection."
exit 1
}
# Get current state to check framework
$state = Get-PluginState -PluginPath "plugins\[Name]"
if ($state.ui_framework -eq "pending") {
Write-Error "UI framework not selected. Complete planning phase first."
exit 1
}
If designs exist, present menu:
Found {N} saved designs in library.
How would you like to start?
1. Use existing design - Apply saved visual style
2. Start from scratch - Create custom design
3. Browse library - View all designs first
Choose (1-3): _
Routing:
If no designs: Skip to Phase 1.
Check for existing designs first:
# Check if design library exists
$manifestPath = "design_library/manifest.json"
if (Test-Path $manifestPath) {
$manifest = Get-Content $manifestPath | ConvertFrom-Json
$designCount = $manifest.totalDesigns
Write-Host "Found $designCount saved designs in library." -ForegroundColor Cyan
Write-Host ""
# Present menu
Write-Host "How would you like to start?" -ForegroundColor Yellow
Write-Host "1. Use existing design - Apply saved visual style"
Write-Host "2. Start from scratch - Create custom design"
Write-Host "3. Browse library - View all designs first"
Write-Host ""
$choice = Read-Host "Choose (1-3)"
switch ($choice) {
"1" {
# Show available designs and let user pick
Show-DesignLibrary -Manifest $manifest
$selectedDesign = Read-Host "Enter design ID to use"
# Apply selected design as v1
Apply-DesignFromLibrary -DesignId $selectedDesign
# Skip to Phase 2 with applied design
}
"2" {
# Continue to Phase 1 (requirements gathering)
}
"3" {
# List all designs with details
Show-DesignLibrary -Manifest $manifest -Detailed
# Return to menu
# (Loop back to choice prompt)
}
}
} else {
Write-Host "No design library found. Starting from scratch." -ForegroundColor Yellow
# Continue to Phase 1
}
Design Library Integration:
Do NOT write code yet. Gather requirements through focused questions.
Exception: For Visage only, a preview scaffold may be generated after Phase 2 if the user approves.
Helper Functions for Design Library:
function Show-DesignLibrary {
param($Manifest, [switch]$Detailed)
Write-Host "Available Designs:" -ForegroundColor Cyan
Write-Host ("=" * 50) -ForegroundColor Cyan
foreach ($design in $Manifest.designs) {
Write-Host "$($design.id)" -ForegroundColor Green
Write-Host " Name: $($design.name)"
Write-Host " Style: $($design.vibe)"
Write-Host " Best for: $($design.bestFor -join ', ')"
if ($Detailed) {
Write-Host " Colors: $($design.colors.primary) (primary), $($design.colors.accent) (accent)"
Write-Host " Supports: $($design.supports.webview ? 'WebView' : ''), $($design.supports.visage ? 'Visage' : '')"
Write-Host " Usage: $($design.usageCount) times"
Write-Host ""
}
}
}
function Apply-DesignFromLibrary {
param($DesignId)
$manifest = Get-Content "design_library/manifest.json" | ConvertFrom-Json
$design = $manifest.designs | Where-Object { $_.id -eq $DesignId }
if ($design) {
Write-Host "Applying design: $($design.name)" -ForegroundColor Green
# Copy design files as v1 starting point
$designPath = "design_library/$($design.path)"
# Copy preview.html as v1-test.html (WebView only)
$state = Get-PluginState -PluginPath "plugins/[$PluginName]"
if ($state.ui_framework -eq "webview") {
Copy-Item "$designPath/preview.html" "plugins/[$PluginName]/Design/v1-test.html"
}
# Generate v1-ui-spec.md based on design metadata
$specContent = @"
# UI Specification v1 (Based on $($design.name))
## Design Source
- **Library Design:** $($design.name)
- **ID:** $($design.id)
- **Style:** $($design.vibe)
## Layout
[Layout details from design]
## Colors
- Primary: $($design.colors.primary)
- Accent: $($design.colors.accent)
- Background: $($design.colors.background)
## Controls
[Control specifications based on design]
"@
$specContent | Out-File "plugins/[$PluginName]/Design/v1-ui-spec.md"
# Generate v1-style-guide.md
$styleContent = @"
# Style Guide v1 (Based on $($design.name))
## Color Palette
- **Primary:** $($design.colors.primary)
- **Accent:** $($design.colors.accent)
- **Background:** $($design.colors.background)
## Typography
[Typography details]
## Visual Style
- **Theme:** $($design.vibe)
- **Best for:** $($design.bestFor -join ', ')
"@
$styleContent | Out-File "plugins/[$PluginName]/Design/v1-style-guide.md"
Write-Host "Design applied as v1. You can now iterate on this foundation." -ForegroundColor Green
} else {
Write-Error "Design '$DesignId' not found in library."
}
}
Rules:
AskUserQuestion toolCreate design specification files (all frameworks):
plugins/[Name]/Design/v1-ui-spec.md - Structured design plan: # UI Specification v1
## Layout
- Window: [width]x[height]px
- Sections: [list sections]
- Grid: [describe layout structure]
## Controls
| Parameter | Type | Position | Range | Default |
|-----------|------|----------|-------|---------|
| ... | ... | ... | ... | ... |
## Color Palette
- Background: #______
- Primary: #______
- Accent: #______
- Text: #______
## Style Notes
[Key visual decisions, inspirations, constraints]
plugins/[Name]/Design/v1-style-guide.md - Visual reference:
Framework-specific preview artifacts:
ui_framework == webviewGenerate plugins/[Name]/Design/v1-test.html - WORKING HTML PREVIEW:
CRITICAL: For WebView framework, this HTML MUST be production-ready with proper JUCE integration.
Required structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[Name] Plugin</title>
<script type="module" src="js/index.js"></script>
<style>
/* Complete CSS based on style guide */
:root {
--primary: [color from style guide];
--accent: [color from style guide];
--background: [color from style guide];
}
body {
background: var(--background);
color: var(--primary);
font-family: [font from style guide];
margin: 0;
padding: [padding from style guide];
width: [width]px;
height: [height]px;
overflow: hidden;
}
/* All UI component styles */
</style>
</head>
<body>
<!-- Complete HTML structure matching UI spec -->
<div id="plugin-ui">
<!-- Controls with proper IDs matching parameter IDs -->
<div class="control" id="[PARAMETER_ID]-control">
<div class="knob" id="[PARAMETER_ID]-knob"></div>
<div class="label">[Parameter Name]</div>
<div class="value" id="[PARAMETER_ID]-value">[Default Value]</div>
</div>
<!-- Repeat for all controls -->
</div>
</body>
</html>
JavaScript placeholder (for preview only):
// This is a placeholder for preview - actual implementation goes in Source/ui/public/js/index.js
document.addEventListener("DOMContentLoaded", () => {
console.log("Preview mode - UI structure loaded");
// Preview-only code here
});
For WebView plugins: The HTML in v1-test.html should be identical to what will be in Source/ui/public/index.html (minus the preview JavaScript).
CRITICAL WebView Requirements:
<script type="module"> for JavaScript importsparameter-spec.md<style> tag)ui_framework == visageDo NOT generate HTML. Instead, offer a Visage preview scaffold (default Yes):
Ask:
Generate a Visage preview scaffold now? (Y/n)
Default: Yes (generate unless user explicitly says no).
If yes, generate:
plugins/[Name]/Source/VisageControls.h using templates/visage/VisageControls.h.templateplugins/[Name]/Source/PluginEditor.h and PluginEditor.cpp using templates/visage/These files are preview-only and will be refined during /impl.
Present decision menu:
šØ Design specification v1 created
Files:
- plugins/[Name]/Design/v1-ui-spec.md
- plugins/[Name]/Design/v1-style-guide.md
- WebView: plugins/[Name]/Design/v1-test.html (preview in browser)
- Visage: Source/VisageControls.h + PluginEditor.* (preview via preview-design.ps1)
ā ļø STOP HERE - Do NOT create Source/ files yet!
What would you like to do?
1. Iterate - Refine layout or style (creates v2)
2 Implement - Generate production code in Source/
3. Save as template - Add to design library
4. Preview - WebView: open v1-test.html in browser; Visage: run preview-design.ps1
Choose (1-4): _
Routing:
After design approval (Option 2):
# Mark design phase complete
Complete-Phase -PluginPath "plugins\[Name]" -Phase "design" -Updates @{
"validation.design_complete" = $true
}
Write-Host "Design phase complete! Ready for implementation."
Write-Host "Run /impl [Name] to start building the plugin."
plugins/[Name]/.ideas/todo.md - Check off GUI tasksPLUGINS.md - Mark design stage completePresent instructions:
GUI files generated and committed!
Next steps:
- Preview Visage: powershell -ExecutionPolicy Bypass -File .\scripts\preview-design.ps1 -PluginName [Name]
- Preview WebView: Open plugins/[Name]/Design/index.html in browser
- Build: Follow standard build process
Files created:
[list generated files]
STOP HERE. Let user test before proceeding.
v2-ui-spec.md, v2-PluginEditor.hInvoked by:
Creates:
plugins/[Name]/Design/v[N]-*.mdSource/PluginEditor.{h,cpp}Source/VisageControls.h, v[N]-ui.htmlUpdates:
PLUGINS.md - Design statusplugins/[Name]/.ideas/todo.md - Task completion