Lightweight skills (feat, hotfix, bugfix) had zero plugin awareness — design tasks ran without ui-ux-pro-max even when relevant. Add a design gate (lib/design-gate.md) that auto-detects UI/style signals in task description and filesystem, then asks the user to activate ui-ux-pro-max if inactive. Orchestrators already handle this via their STEP 0 plugin-check. Co-Authored-By: Claude <noreply@anthropic.com>
2.1 KiB
2.1 KiB
DESIGN GATE — Auto-detect design tasks, activate ui-ux-pro-max
Inline snippet. Include in any agent STEP 0 that may touch UI/design.
WHEN TO RUN
Run this gate when the task description OR target files match design signals.
DETECTION
Check BOTH the task description AND the filesystem:
Task description signals (case-insensitive match on $ARGUMENTS):
- UI keywords:
component,button,card,modal,dialog,tooltip,dropdown,sidebar,navbar,header,footer,layout,grid,form,input,table - Style keywords:
css,style,theme,color,font,spacing,margin,padding,border,shadow,animation,transition,hover,responsive,dark mode,light mode - Design keywords:
design,ui,ux,visual,polish,pixel,figma,mockup,wireframe,prototype - Framework UI:
tailwind,styled-component,emotion,chakra,radix,shadcn,headless
Filesystem signals (quick check, no deep scan):
- Target files have
.tsx,.jsx,.css,.scss,.less, or.module.cssextension tailwind.configorpostcss.configpresent in project roottokens/,theme/, ordesign-system/directory exists- Storybook config (
.storybook/) present
DECISION
If at least one signal is detected:
-
Check if
ui-ux-pro-maxis active:source "$HOME/.claude/lib/detect-plugins.sh" detect_uiux_pro_max && echo "ACTIVE" || echo "INACTIVE" -
If ACTIVE → proceed silently. The plugin context is already available.
-
If INACTIVE → ask the user:
🎨 DESIGN DETECTED — task touches UI/styling. ui-ux-pro-max is not active. Activate it for design-aware guidance? (yes / no)- On yes → print
⚡ Activating ui-ux-pro-max...and proceed with design context. - On no → print
Proceeding without design plugin.and continue normally.
- On yes → print
IMPORTANT
- This gate adds ~5 seconds overhead. Worth it for design quality.
- Do NOT run this gate on pure backend/API/CLI tasks (no signals = no gate).
- If no signal detected → skip entirely, zero overhead.