Build complete UI screens by composing multiple uxscii components...
Create complete screen designs using the uxscii standard by orchestrating specialized agents.
READ from (bundled templates - reference only):
{SKILL_ROOT}/../uxscii-component-creator/templates/ - 11 component templates{SKILL_ROOT}/templates/ - 2 screen examples{SKILL_ROOT}/docs/ - DocumentationINVENTORY sources (check all for available components):
./fluxwing/components/ - User-created components (FIRST PRIORITY)./fluxwing/library/ - Customized template copies{SKILL_ROOT}/../uxscii-component-creator/templates/ - Bundled templates (READ-ONLY)WRITE to (project workspace):
./fluxwing/screens/ - Your created screens (via composer agent)NEVER write to skill directories - they are read-only!
LOAD for copy-on-update logic:
{SKILL_ROOT}/../shared/docs/copy-versioning.md - Versioning pattern for existing screensā ļø YOU ARE AN ORCHESTRATOR - DO NOT DO THE WORK YOURSELF! ā ļø
Your role is to spawn agents using the Task tool. You coordinate agents, you don't create components directly.
Help the user scaffold a complete screen by orchestrating agents in two phases:
Concurrency Model:
CRITICAL: Use the Task tool to spawn agents. Do NOT use TodoWrite and work through tasks yourself. Do NOT create files yourself.
MULTI-SCREEN SCENARIOS:
If user requests N screens (N > 1):
Example: 6 screens = ONE message with 6 Task tool calls ā 18 files created by agents
You are an ORCHESTRATOR. Your job is to spawn agents, not do their work.
Scaffolder supports different quality levels for speed vs fidelity tradeoffs:
Output:
Output:
Output:
Output:
Default: detailed (best balance of quality and speed)
Ask about the screen they want to create:
Screen details:
Quality preset (optional):
If user doesn't specify, use detailed preset.
Detect multi-screen requests:
If the user's request indicates multiple screens, detect by:
When multiple screens detected, confirm with the user:
I see you want to create [N] screens:
- [screen-name-1]
- [screen-name-2]
- [screen-name-3]
- ...
I'll create these in parallel using one composer agent per screen.
Each screen will get all 3 files (.uxm, .md, .rendered.md).
Quality preset: [preset] (default: detailed)
Estimated time: ~[X-Y] seconds
Proceed? [Yes/No]
Purpose:
After confirmation, use Path B workflow (see below).
Check what components are available in this order:
./fluxwing/components/ (FIRST PRIORITY)./fluxwing/library/ (customized templates){SKILL_ROOT}/../uxscii-component-creator/templates/ (READ-ONLY)List what exists vs what needs to be created.
// Example inventory check
const userComponents = glob('./fluxwing/components/*.uxm');
const libraryComponents = glob('./fluxwing/library/*.uxm');
const bundledComponents = glob('{SKILL_ROOT}/../uxscii-component-creator/templates/*.uxm');
const available = [...userComponents, ...libraryComponents, ...bundledComponents];
const missing = requiredComponents.filter(c => !available.includes(c));
IMPORTANT: Before creating any screen, check if it already exists to prevent data loss.
Convert screen name to kebab-case ID:
"Login Screen" ā "login-screen"
"User Dashboard" ā "user-dashboard"
Check if screen exists:
# Check for existing screen
test -f ./fluxwing/screens/{screen-id}.uxm
If screen EXISTS:
Inform user and offer choices:
Screen '{screen-id}' already exists (version {current-version}).
Options:
(a) Create new version (copy-on-update: {screen-id}-v{N+1})
(b) Create with different name
(c) Cancel operation
What would you like to do?
Handle user response:
Choice (a) - Create new version:
{SKILL_ROOT}/../shared/docs/copy-versioning.md{screen-id}.uxm{screen-id}-v2, -v3, etc.)v{N+1}baseScreenId: Original ID (e.g., "login-screen")newScreenId: Versioned ID (e.g., "login-screen-v2")baseOnExisting: truesourceVersion: Highest existing version{screen-id}-v{N+1}.uxm{screen-id}-v{N+1}.md{screen-id}-v{N+1}.rendered.mdChoice (b) - Different name:
Choice (c) - Cancel:
If screen DOES NOT exist:
{screen-id}.uxm (no version suffix)After completing the component inventory, choose the appropriate workflow path:
Path A: Single Screen (1 screen requested)
Path B: Multiple Screens (2+ screens requested)
Key distinction: Path B spawns N composer agents in parallel (one per screen) instead of one.
Example scenarios:
Follow the appropriate path based on screen count. Instructions below apply to Path A (single screen). For Path B modifications, see notes in Steps 3 and 4.
If missing components exist, spawn designer agents in FAST MODE - one agent per component:
CRITICAL ORCHESTRATION RULES:
Path B (Multi-screen): Component Deduplication
When creating components for multiple screens:
sidebar-nav, but create it only onceExample:
Don't spawn: 3 Ć 3 = 9 agents (wasteful duplicates) Do spawn: 5 unique agents (sidebar-nav, button-primary, input-email, input-password, card-metric)
Fast Mode Creates:
Example: 6 missing components for banking-chat
Task({
subagent_type: "general-purpose",
model: "haiku", // Fast model
description: "Create message-bubble (fast)",
prompt: "Create sketch-fidelity uxscii component from template.
Component: message-bubble
Type: container
Screen context: banking-chat
FAST MODE - Speed is critical! <10 seconds target.
Your task:
1. Load minimal template: {SKILL_ROOT}/../fluxwing-component-creator/templates/minimal/container.uxm.template
2. Replace variables:
- {{id}} = 'message-bubble'
- {{name}} = 'Message Bubble'
- {{description}} = 'Chat message container for banking-chat'
- {{timestamp}} = '${new Date().toISOString()}'
- {{screenContext}} = 'banking-chat'
3. CRITICAL: Set metadata.fidelity = "sketch"
**REQUIRED FIELD**: The fidelity field is MANDATORY in the schema and tracks progressive enhancement.
Fast mode MUST set fidelity to "sketch" to indicate initial scaffolding quality.
4. Verify JSON is well-formed
5. Save to ./fluxwing/components/message-bubble.uxm
6. DO NOT create .md file
7. DO NOT load documentation
VERIFICATION:
- [ ] metadata.fidelity = "sketch"
- [ ] All required fields present (name, description, created, modified, tags, category, fidelity)
Return: 'Created message-bubble.uxm (sketch fidelity)'
Target: <10 seconds"
})
Task({
subagent_type: "general-purpose",
model: "haiku",
description: "Create message-input (fast)",
prompt: "Create sketch-fidelity uxscii component from template.
Component: message-input
Type: input
Screen context: banking-chat
FAST MODE - Speed is critical! <10 seconds target.
Your task:
1. Load minimal template: {SKILL_ROOT}/../fluxwing-component-creator/templates/minimal/input.uxm.template
2. Replace variables:
- {{id}} = 'message-input'
- {{name}} = 'Message Input'
- {{description}} = 'Chat input field for banking-chat'
- {{timestamp}} = '${new Date().toISOString()}'
- {{placeholder}} = 'Type a message...'
- {{label}} = 'Message'
- {{screenContext}} = 'banking-chat'
3. CRITICAL: Set metadata.fidelity = "sketch"
**REQUIRED FIELD**: The fidelity field is MANDATORY in the schema and tracks progressive enhancement.
Fast mode MUST set fidelity to "sketch" to indicate initial scaffolding quality.
4. Verify JSON is well-formed
5. Save to ./fluxwing/components/message-input.uxm
6. DO NOT create .md file
7. DO NOT load documentation
VERIFICATION:
- [ ] metadata.fidelity = "sketch"
- [ ] All required fields present (name, description, created, modified, tags, category, fidelity)
Return: 'Created message-input.uxm (sketch fidelity)'
Target: <10 seconds"
})
// ... spawn ONE Task per missing component in SAME message ...
Performance: 6 components Ć 10s = ~60 seconds (was 120-180s)
Wait for ALL component agents to complete before Step 4.
Once all components exist, spawn the composer agent:
Path A (Single Screen): Spawn ONE composer agent Path B (Multi-screen): Spawn ONE composer agent PER screen (parallel)
Example Path B:
CRITICAL: Composer generates .md files for ALL components!
This is the "smart composer" - it:
Task({
subagent_type: "general-purpose",
model: "sonnet", // Smart model for quality composition
description: "Compose ${screenName} with components",
prompt: `You are a uxscii screen composer creating production-ready screens.
Screen: ${screenName}
Components: ${componentList}
Layout: ${layoutStructure}
${baseOnExisting ? `
VERSIONING MODE:
- Base on existing: ${baseScreenId}
- New screen ID: ${newScreenId}
- Source version: ${sourceVersion}
- Copy-on-update: Increment minor version, preserve created timestamp
- Create THREE files with -v{N} suffix
` : ''}
YOUR PRIMARY DELIVERABLE: ${screenName}.rendered.md
This is what the user will see. Everything else supports this.
MANDATORY OUTPUTS (all 3 required):
1. ${screenName}.uxm (metadata)
2. ${screenName}.md (template with {{placeholders}})
3. ${screenName}.rendered.md (REAL data, ACTUAL ASCII) ā ļø CRITICAL
If you complete without creating .rendered.md, you have FAILED.
Your task has TWO parts:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
PART 1: Generate Component .md Files
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
For each component in [${componentList}]:
1. Read component .uxm from ./fluxwing/components/
2. Check if .md exists:
- If EXISTS: Skip to next component
- If MISSING: Generate .md file (steps 3-5)
3. Load ASCII patterns (ONCE for all components):
{SKILL_ROOT}/../fluxwing-component-creator/docs/06-ascii-patterns.md
4. Generate simple ASCII art based on component type:
- button: Rounded box with label
- input: Rectangular box with placeholder
- card: Box with title and content area
- container: Large box for children
- Use dimensions from .uxm (ascii.width, ascii.height)
- Keep it simple (sketch quality, not detailed)
5. Create .md file with:
- Component description
- ASCII art in code block
- Variables from .uxm props
- Save to ./fluxwing/components/\${componentId}.md
Example .md for button:
\`\`\`markdown
# \${componentName}
\${description}
## ASCII
\`\`\`
āāāāāāāāāāāāāāāāāāāā®
ā {{label}} ā
ā°āāāāāāāāāāāāāāāāāāāÆ
\`\`\`
## Variables
- label (string): Button text
\`\`\`
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
PART 2: Compose Screen
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
1. Load schema: {SKILL_ROOT}/../fluxwing-component-creator/schemas/uxm-component.schema.json
2. Load screen docs: {SKILL_ROOT}/docs/04-screen-composition.md
3. Create screen .uxm:
- ${baseOnExisting ? `Load existing: ./fluxwing/screens/${sourceVersion}.uxm` : `type: "container"`}
- ${baseOnExisting ? `Base structure on source version` : `props.components: [${componentList}]`}
- layout: ${layoutStructure}
- ${baseOnExisting ? `id: "${newScreenId}" (with -v{N} suffix)` : `id: "${screenId}"`}
- ${baseOnExisting ? `version: Increment minor from source (e.g., 1.0.0 ā 1.1.0)` : `version: "1.0.0"`}
- ${baseOnExisting ? `metadata.created: PRESERVE from ${sourceVersion}` : `metadata.created: current timestamp`}
- ${baseOnExisting ? `metadata.modified: SET to current timestamp` : `metadata.modified: current timestamp`}
CRITICAL: Set metadata.fidelity = "detailed"
**REQUIRED FIELD**: Screen fidelity tracks the screen's completion level.
Even if components are sketch fidelity, the screen itself is detailed (it's a composition).
This enables tracking progressive fidelity at both component and screen levels.
4. Create screen .md (template):
- Use {{component:id}} syntax for component references
- Show layout structure with placeholders
- ${baseOnExisting ? `Filename: ${newScreenId}.md (versioned)` : `Filename: ${screenId}.md`}
5. Create screen .rendered.md (MAIN DELIVERABLE):
- Embed ACTUAL component ASCII (read from .md files you just created)
- Use REAL example data (names: "Sarah Johnson", emails: "sarah@example.com", etc.)
- Show all screen states (idle, loading, error if applicable)
- High visual quality - this is what user will see!
- Make it publication-ready
- ${baseOnExisting ? `Filename: ${newScreenId}.rendered.md (versioned)` : `Filename: ${screenId}.rendered.md`}
6. Save all 3 files to ./fluxwing/screens/
- ${baseOnExisting ? `${newScreenId}.uxm, ${newScreenId}.md, ${newScreenId}.rendered.md` : `${screenId}.uxm, ${screenId}.md, ${screenId}.rendered.md`}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Performance Notes:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
- Load ASCII patterns ONCE, reuse for all components
- Keep component .md simple (detailed version comes with enhancement)
- Focus quality effort on screen .rendered.md
- Target: 60-90 seconds total
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
VERIFICATION CHECKLIST (before returning):
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
- [ ] .uxm file created and saved to ./fluxwing/screens/
- [ ] .md template created and saved to ./fluxwing/screens/
- [ ] .rendered.md created with REAL data and ACTUAL component ASCII
- [ ] All 3 files are in ./fluxwing/screens/
- [ ] .rendered.md uses realistic example data (not placeholders)
- [ ] .rendered.md embeds actual ASCII from component .md files
Return: "Created ${screenName}: .uxm ā, .md ā, .rendered.md ā"
`
})
After screen composition, optionally enhance components based on quality preset.
Determine enhancement level:
If enhancement needed:
Task({
subagent_type: "general-purpose",
model: "sonnet", // Quality model for enhancement
description: "Enhance screen components to ${targetFidelity}",
prompt: `Enhance all components in ${screenName} to ${targetFidelity} fidelity.
Screen: ${screenName}
Components: ${componentList}
Current fidelity: sketch
Target fidelity: ${targetFidelity}
Use fluxwing-enhancer patterns:
Your task:
1. Load enhancement patterns: {SKILL_ROOT}/../fluxwing-enhancer/docs/enhancement-patterns.md
2. Load state templates: {SKILL_ROOT}/../fluxwing-component-creator/templates/state-additions/
3. For EACH component (process in parallel if possible):
Read: ./fluxwing/components/\${componentId}.uxm
Read: ./fluxwing/components/\${componentId}.md
Enhance based on target:
${targetFidelity === 'basic' ? `
basic fidelity:
- Improve metadata.description (specific, 1-2 sentences)
- Add relevant tags
- Polish .md ASCII (clean, aligned)
- Keep default state only
- CRITICAL: Update metadata.fidelity = "basic" (REQUIRED FIELD)
` : ''}
${targetFidelity === 'detailed' ? `
detailed fidelity:
- All "basic" enhancements
- Add hover state (use templates/state-additions/hover.json)
- Add focus state (use templates/state-additions/focus.json)
- Polish ASCII art (rounded corners, smooth)
- Add props.examples array (2-3 examples)
- CRITICAL: Update metadata.fidelity = "detailed" (REQUIRED FIELD)
` : ''}
${targetFidelity === 'production' ? `
production fidelity:
- All "detailed" enhancements
- Add disabled state (if applicable)
- Add error state (if form component)
- Complete accessibility metadata
- Add keyboard shortcuts
- Pixel-perfect ASCII
- CRITICAL: Update metadata.fidelity = "production" (REQUIRED FIELD)
` : ''}
Save: Updated .uxm and .md to ./fluxwing/components/
4. After ALL components enhanced:
Regenerate screen .rendered.md:
- Read enhanced component .md files
- Embed improved ASCII in .rendered.md
- Maintain real example data
- Save to ./fluxwing/screens/
5. Return summary:
- Components enhanced: [list with changes]
- Total time: Xs
- Screen .rendered.md regenerated
Target time:
- basic: 30s (parallel for all components)
- detailed: 90s (parallel for all components)
- production: 180s (parallel for all components)
Note: Process components in parallel when possible for maximum speed!
`
})
Enhancement is parallel: All 6 components enhanced simultaneously, so time ā single component time!
REQUIRED: Validate the screen file against the schema after composition.
# Validate the screen
node {SKILL_ROOT}/../fluxwing-validator/validate-screen.js \
./fluxwing/screens/${screenId}.uxm \
{SKILL_ROOT}/../fluxwing-component-creator/schemas/uxm-component.schema.json
Expected behavior:
Screen-specific checks:
Example output (success):
ā Valid: login-screen
Type: container
Version: 1.0.0
States: 3
Props: 3
ā Warnings:
Warning 1: Referenced component not found: custom-input
Location: composed
If validation fails, show errors to user:
ā Validation Failed
Error 1: must have required property 'fidelity'
Location: metadata
Create comprehensive summary including enhancement details:
# Screen Scaffolding Complete ā
## Screen: ${screenName}
## Quality Preset: ${qualityPreset}
### Phase 1: Fast Component Creation ā”
${missingComponents.map(c => `ā ${c}.uxm (sketch fidelity, ~10s)`).join('\n')}
Time: ~${missingComponents.length * 10}s
### Phase 2: Smart Composition šØ
Component .md files generated:
${componentList.map(c => `ā ${c}.md (by composer)`).join('\n')}
Screen files created:
ā ${screenName}.uxm
ā ${screenName}.md (template)
ā ${screenName}.rendered.md
Time: ~60-90s
${qualityPreset !== 'fast' ? `
### Phase 3: Auto-Enhancement āØ
Components enhanced to ${targetFidelity} fidelity:
${componentList.map(c => `ā ${c}: sketch ā ${targetFidelity}`).join('\n')}
Enhancements applied:
${targetFidelity === 'basic' ? '- Improved descriptions\n- Added specific tags\n- Polished ASCII' : ''}
${targetFidelity === 'detailed' ? '- Improved descriptions\n- Added hover + focus states\n- Polished ASCII\n- Added usage examples' : ''}
${targetFidelity === 'production' ? '- All detailed enhancements\n- Added disabled + error states\n- Complete accessibility\n- Pixel-perfect ASCII' : ''}
Screen .rendered.md regenerated with enhanced components
Time: ~${enhancementTime[targetFidelity]}s
` : ''}
### Total Time: ~${totalTime}s (${Math.round(totalTime/60)} minutes)
### Performance
- Target: ${targetTime[qualityPreset]}
- Actual: ${totalTime}s
- Status: ${totalTime <= targetTime[qualityPreset] ? 'ā ON TARGET' : 'ā OVER TARGET'}
## Files Created
**Components** (./fluxwing/components/):
- ${componentList.length} .uxm files (${finalFidelity} fidelity)
- ${componentList.length} .md files
**Screen** (./fluxwing/screens/):
- ${screenName}.uxm
- ${screenName}.md
- ${screenName}.rendered.md
**Total: ${componentList.length * 2 + 3} files**
## Quality Assessment
- Component fidelity: ${finalFidelity}
- Screen .rendered.md: ${qualityPreset === 'production' ? 'Publication-ready' : qualityPreset === 'detailed' ? 'High quality' : qualityPreset === 'balanced' ? 'Good quality' : 'Basic quality'}
- States included: ${statesCount} states per component
- Accessibility: ${qualityPreset === 'production' ? 'Complete' : qualityPreset === 'detailed' ? 'Good' : 'Basic'}
## Next Steps
1. **Review rendered screen:**
\`cat ./fluxwing/screens/${screenName}.rendered.md\`
2. **Further enhancement (optional):**
${qualityPreset !== 'production' ? `Use /fluxwing-enhance to upgrade to ${nextFidelity} fidelity` : 'Already at maximum fidelity'}
3. **Customize components:**
Edit ./fluxwing/components/ files as needed
4. **View components:**
Use /fluxwing-view to inspect individual components
Two-phase concurrency model:
Phase 1 - Component Creation (Parallel):
Phase 2 - Screen Composition (Sequential):
Performance Example:
User: Create a login screen
Skill: I'll help you create a login screen! Let me check what components we have...
[Checks ./fluxwing/components/, ./fluxwing/library/, bundled templates]
I found:
ā email-input (exists in ./fluxwing/components/)
ā password-input (needs to be created)
ā submit-button (needs to be created)
I'll use a two-phase approach:
- Phase 1: Spawn 2 agents in parallel (one per missing component)
- Phase 2: After components complete, spawn composer agent
[Spawns 2 component agents in parallel]
ā password-input agent completed
ā submit-button agent completed
[Now spawns composer agent]
ā Composer agent created login screen
Total: 7 files created in ./fluxwing/
Performance: ~2x faster with parallel component creation!
If designer agent fails:
If composer agent fails:
If you catch yourself thinking ANY of these thoughts, STOP. You are rationalizing. Use the Task tool to spawn agents instead.
About creating files directly:
About multi-screen scenarios:
About the .rendered.md file:
Why these rationalizations happen:
What to do instead:
STOP. Use the Task tool. You are an orchestrator, not a worker.
You are building complete, production-ready screen designs with maximum agent concurrency!