Clear decision criteria for when to delegate frontend/UI work to the frontend-specialist subagent vs. handling it directly.
Delegate to frontend-specialist when:
Handle directly when:
| Scenario | Why Delegate | Example |
|---|---|---|
| New UI design from scratch | Needs staged workflow (layout → theme → animation → implement) | "Create a landing page for our product" |
| Design system work | Requires ContextScout for standards, ExternalScout for UI libs | "Implement our design system with Tailwind + Shadcn" |
| Complex responsive layouts | Needs mobile-first approach across breakpoints | "Build a dashboard with sidebar, cards, and responsive grid" |
| Animation implementation | Requires animation patterns, performance optimization | "Add smooth transitions and micro-interactions to the UI" |
| Multi-stage design iterations | Needs versioning (design_iterations/ folder) | "Design a checkout flow with 3 steps" |
| Theme creation | Requires OKLCH colors, CSS custom properties | "Create a dark mode theme for the app" |
| Component library integration | Needs ExternalScout for current docs (Flowbite, Radix, etc.) | "Integrate Flowbite components into our app" |
| Accessibility-focused UI | Requires WCAG compliance, ARIA attributes | "Build an accessible form with proper labels and validation" |
| Scenario | Why Direct | Example |
|---|---|---|
| Simple HTML edits | Single file, straightforward change | "Change the button text from 'Submit' to 'Send'" |
| Minor CSS tweaks | Small styling adjustment | "Make the header padding 20px instead of 16px" |
| Bug fixes | Fixing existing code, not creating new design | "Fix the broken link in the footer" |
| Content updates | Changing text, images, or data | "Update the hero section copy" |
| Single component updates | Modifying one existing component | "Add a new prop to the Button component" |
| Quick prototypes | Throwaway code for testing | "Create a quick HTML mockup to test an idea" |
Before delegating to frontend-specialist, ensure:
If you're unsure what context the frontend-specialist will need:
task(
subagent_type="ContextScout",
description="Find frontend design context",
prompt="Find design system standards, UI component patterns, animation guidelines, and responsive breakpoint conventions for frontend work."
)
Present a plan to the user:
## Implementation Plan
**Task**: Create landing page with hero section, features grid, and CTA
**Approach**: Delegate to frontend-specialist subagent
**Why**:
- Requires design system implementation
- Needs responsive layout across breakpoints
- Includes animations and micro-interactions
- Benefits from staged workflow (layout → theme → animation → implement)
**Context Needed**:
- Design system standards (ui/web/design-systems.md)
- UI styling standards (ui/web/ui-styling-standards.md)
- Animation patterns (ui/web/animation-patterns.md)
**Approval needed before proceeding.**
Wait for explicit user approval before delegating.
For simple delegation (no session needed):
task(
subagent_type="frontend-specialist",
description="Create landing page design",
prompt="Context to load:
- .opencode/context/ui/web/design-systems.md
- .opencode/context/ui/web/ui-styling-standards.md
- .opencode/context/ui/web/animation-patterns.md
Task: Create a landing page with:
- Hero section with headline, subheadline, CTA button
- Features grid (3 columns on desktop, 1 on mobile)
- Smooth scroll animations
Requirements:
- Use Tailwind CSS + Flowbite
- Mobile-first responsive design
- Animations <400ms
- Save to design_iterations/landing_1.html
Follow your staged workflow:
1. Layout (ASCII wireframe)
2. Theme (CSS theme file)
3. Animation (micro-interactions)
4. Implement (HTML file)
Request approval between each stage."
)
For complex delegation (with session):
Create session context file first, then delegate with session path.
Trigger: User asks for a new landing page, marketing page, or product page
Decision: ✅ Delegate to frontend-specialist
Why: Requires full design workflow (layout, theme, animations, implementation)
Example:
User: "Create a landing page for our SaaS product"
You: [Propose approach] → [Get approval] → [Delegate to frontend-specialist]
Trigger: User wants to implement or update a design system
Decision: ✅ Delegate to frontend-specialist
Why: Needs ContextScout for standards, ExternalScout for UI library docs
Example:
User: "Implement our design system using Tailwind and Shadcn"
You: [Propose approach] → [Get approval] → [Delegate to frontend-specialist]
Trigger: User wants to integrate a UI component library (Flowbite, Radix, etc.)
Decision: ✅ Delegate to frontend-specialist
Why: Requires ExternalScout for current docs, proper integration patterns
Example:
User: "Add Flowbite components to our app"
You: [Propose approach] → [Get approval] → [Delegate to frontend-specialist]
Trigger: User wants animations, transitions, or micro-interactions
Decision: ✅ Delegate to frontend-specialist
Why: Requires animation patterns, performance optimization (<400ms)
Example:
User: "Add smooth animations to the dashboard"
You: [Propose approach] → [Get approval] → [Delegate to frontend-specialist]
Trigger: User wants to change text, fix a link, or update content
Decision: ⚠️ Handle directly (don't delegate)
Why: Simple edit, no design work needed
Example:
User: "Change the button text to 'Get Started'"
You: [Edit the HTML file directly]
Trigger: User reports a styling bug or broken layout
Decision: ⚠️ Handle directly (don't delegate)
Why: Bug fix, not new design work
Example:
User: "The header is overlapping the content on mobile"
You: [Read the CSS, fix the issue directly]
❌ User just wants a quick fix → Handle directly
❌ Task is backend/logic focused → Wrong subagent (use coder-agent or handle directly)
❌ Task is a single line change → Handle directly
❌ Task is content update → Handle directly
❌ Task is testing/validation → Wrong subagent (use tester)
❌ Task is code review → Wrong subagent (use reviewer)
✅ User wants a new UI design → Delegate
✅ Task involves design systems → Delegate
✅ Task requires responsive layouts → Delegate
✅ Task includes animations → Delegate
✅ Task needs UI library integration → Delegate
✅ Task benefits from staged workflow → Delegate
✅ Task requires design expertise → Delegate
What it does well:
What it doesn't do:
The frontend-specialist will automatically load these via ContextScout:
Design System:
ui/web/design-systems.md - Theme templates, color systemsui/web/ui-styling-standards.md - Tailwind, Flowbite, responsive designui/web/design-assets.md - Images, icons, fontsPatterns:
ui/web/animation-patterns.md - Animation syntax, micro-interactionsdevelopment/frontend/react/react-patterns.md - React patterns (if React project)Workflows:
core/workflows/design-iteration-overview.md - Design iteration workflowUser Request: "Create a landing page for our SaaS product with a hero section, features, and pricing"
Your Response:
## Implementation Plan
**Task**: Create SaaS landing page
**Approach**: Delegate to frontend-specialist subagent
**Why**:
- Requires full design workflow (layout, theme, animations)
- Needs responsive design across breakpoints
- Benefits from design system standards
**Context Needed**:
- Design system standards
- UI styling standards
- Animation patterns
**Approval needed before proceeding.**
After Approval:
task(
subagent_type="frontend-specialist",
description="Create SaaS landing page",
prompt="Context to load:
- .opencode/context/ui/web/design-systems.md
- .opencode/context/ui/web/ui-styling-standards.md
- .opencode/context/ui/web/animation-patterns.md
Task: Create a SaaS landing page with:
- Hero section (headline, subheadline, CTA)
- Features section (3-column grid)
- Pricing section (3 tiers)
- Footer
Requirements:
- Tailwind CSS + Flowbite
- Mobile-first responsive
- Smooth scroll animations
- Modern design system
Follow staged workflow and request approval between stages."
)
User Request: "Change the 'Submit' button to say 'Send Message'"
Your Response:
I'll update the button text directly.
Action: Read the HTML file, edit the button text, done. No delegation needed.
User Request: "Implement our design system using Tailwind and Shadcn components"
Your Response:
## Implementation Plan
**Task**: Implement design system with Tailwind + Shadcn
**Approach**: Delegate to frontend-specialist subagent
**Why**:
- Requires UI library integration (Shadcn)
- Needs ExternalScout for current Shadcn docs
- Benefits from design system standards
**Context Needed**:
- Design system standards
- UI styling standards
- External docs (Shadcn)
**Approval needed before proceeding.**
After Approval:
task(
subagent_type="frontend-specialist",
description="Implement Tailwind + Shadcn design system",
prompt="Context to load:
- .opencode/context/ui/web/design-systems.md
- .opencode/context/ui/web/ui-styling-standards.md
Task: Implement design system using Tailwind CSS and Shadcn/ui
Requirements:
- Call ExternalScout for current Shadcn docs
- Set up Tailwind config
- Integrate Shadcn components
- Create theme file with OKLCH colors
- Document component usage
Follow staged workflow and request approval between stages."
)
Delegate to frontend-specialist when:
Handle directly when:
Always:
../../../agent/subagents/development/frontend-specialist.md../../ui/web/design-systems.md../../ui/web/ui-styling-standards.md../../ui/web/animation-patterns.md../../core/workflows/task-delegation-basics.mdreact/react-patterns.md