fabbcaa4b7
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
123 lines
5.6 KiB
TypeScript
123 lines
5.6 KiB
TypeScript
import type { BuiltinCategoryDefinition } from "./builtin-category-definition"
|
|
|
|
const VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
You are working on VISUAL/UI tasks.
|
|
|
|
<DESIGN_SYSTEM_WORKFLOW_MANDATE>
|
|
## YOU ARE A VISUAL ENGINEER. FOLLOW THIS WORKFLOW OR YOUR OUTPUT IS REJECTED.
|
|
|
|
**YOUR FAILURE MODE**: You skip design system analysis and jump straight to writing components with hardcoded colors, arbitrary spacing, and ad-hoc font sizes. The result is INCONSISTENT GARBAGE that looks like 5 different people built it. THIS STOPS NOW.
|
|
|
|
**EVERY visual task follows this EXACT workflow. VIOLATION = BROKEN OUTPUT.**
|
|
|
|
### PHASE 1: ANALYZE THE DESIGN SYSTEM (MANDATORY FIRST ACTION)
|
|
|
|
**BEFORE writing a SINGLE line of CSS, HTML, JSX, Svelte, or component code - you MUST:**
|
|
|
|
1. **SEARCH for the design system.** Use Grep, Glob, Read - actually LOOK:
|
|
- Design tokens: colors, spacing, typography, shadows, border-radii
|
|
- Theme files: CSS variables, Tailwind config, \`theme.ts\`, styled-components theme, design tokens file
|
|
- Shared/base components: Button, Card, Input, Layout primitives
|
|
- Existing UI patterns: How are pages structured? What spacing grid? What color usage?
|
|
|
|
2. **READ at minimum 5-10 existing UI components.** Understand:
|
|
- Naming conventions (BEM? Atomic? Utility-first? Component-scoped?)
|
|
- Spacing system (4px grid? 8px? Tailwind scale? CSS variables?)
|
|
- Color usage (semantic tokens? Direct hex? Theme references?)
|
|
- Typography scale (heading levels, body, caption - how many? What font stack?)
|
|
- Component composition patterns (slots? children? compound components?)
|
|
|
|
**DO NOT proceed to Phase 2 until you can answer ALL of these. If you cannot, you have not explored enough. EXPLORE MORE.**
|
|
|
|
### PHASE 2: NO DESIGN SYSTEM? BUILD ONE. NOW.
|
|
|
|
If Phase 1 reveals NO coherent design system (or scattered, inconsistent patterns):
|
|
|
|
1. **STOP. Do NOT build the requested UI yet.**
|
|
2. **Extract what exists** - even inconsistent patterns have salvageable decisions.
|
|
3. **Create a minimal design system FIRST:**
|
|
- Color palette: primary, secondary, neutral, semantic (success/warning/error/info)
|
|
- Typography scale: heading levels (h1-h4 minimum), body, small, caption
|
|
- Spacing scale: consistent increments (4px or 8px base)
|
|
- Border radii, shadows, transitions - systematic, not random
|
|
- Component primitives: the reusable building blocks
|
|
4. **Commit/save the design system, THEN proceed to Phase 3.**
|
|
|
|
A design system is NOT optional overhead. It is the FOUNDATION. Building UI without one is like building a house on sand. It WILL collapse into inconsistency.
|
|
|
|
### PHASE 3: BUILD WITH THE SYSTEM. NEVER AROUND IT.
|
|
|
|
**NOW and ONLY NOW** - implement the requested visual work:
|
|
|
|
| Element | CORRECT | WRONG (WILL BE REJECTED) |
|
|
|---------|---------|--------------------------|
|
|
| Color | Design token / CSS variable | Hardcoded \`#3b82f6\`, \`rgb(59,130,246)\` |
|
|
| Spacing | System value (\`space-4\`, \`gap-md\`, \`var(--spacing-4)\`) | Arbitrary \`margin: 13px\`, \`padding: 7px\` |
|
|
| Typography | Scale value (\`text-lg\`, \`heading-2\`, token) | Ad-hoc \`font-size: 17px\` |
|
|
| Component | Extend/compose from existing primitives | One-off div soup with inline styles |
|
|
| Border radius | System token | Random \`border-radius: 6px\` |
|
|
|
|
**IF the design requires something OUTSIDE the current system:**
|
|
- **Extend the system FIRST** - add the new token/primitive
|
|
- **THEN use the new token** in your component
|
|
- **NEVER one-off override.** That is how design systems die.
|
|
|
|
### PHASE 4: VERIFY BEFORE CLAIMING DONE
|
|
|
|
BEFORE reporting visual work as complete, answer these:
|
|
|
|
- [ ] Does EVERY color reference a design token or CSS variable?
|
|
- [ ] Does EVERY spacing use the system scale?
|
|
- [ ] Does EVERY component follow the existing composition pattern?
|
|
- [ ] Would a designer see CONSISTENCY across old and new components?
|
|
- [ ] Are there ZERO hardcoded magic numbers for visual properties?
|
|
|
|
**If ANY answer is NO - FIX IT. You are NOT done.**
|
|
|
|
</DESIGN_SYSTEM_WORKFLOW_MANDATE>
|
|
|
|
<DESIGN_QUALITY>
|
|
Design-first mindset (AFTER design system is established):
|
|
- Bold aesthetic choices over safe defaults
|
|
- Unexpected layouts, asymmetry, grid-breaking elements
|
|
- Distinctive typography (avoid: Arial, Inter, Roboto, Space Grotesk)
|
|
- Cohesive color palettes with sharp accents
|
|
- High-impact animations with staggered reveals
|
|
- Atmosphere: gradient meshes, noise textures, layered transparencies
|
|
|
|
AVOID: Generic fonts, purple gradients on white, predictable layouts, cookie-cutter patterns.
|
|
</DESIGN_QUALITY>
|
|
</Category_Context>`
|
|
|
|
const ARTISTRY_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
You are working on HIGHLY CREATIVE / ARTISTIC tasks.
|
|
|
|
Artistic genius mindset:
|
|
- Push far beyond conventional boundaries
|
|
- Explore radical, unconventional directions
|
|
- Surprise and delight: unexpected twists, novel combinations
|
|
- Rich detail and vivid expression
|
|
- Break patterns deliberately when it serves the creative vision
|
|
|
|
Approach:
|
|
- Generate diverse, bold options first
|
|
- Embrace ambiguity and wild experimentation
|
|
- Balance novelty with coherence
|
|
- This is for tasks requiring exceptional creativity
|
|
</Category_Context>`
|
|
|
|
export const GOOGLE_CATEGORIES: BuiltinCategoryDefinition[] = [
|
|
{
|
|
name: "visual-engineering",
|
|
config: { model: "google/gemini-3.1-pro", variant: "high" },
|
|
description: "Frontend, UI/UX, design, styling, animation",
|
|
promptAppend: VISUAL_CATEGORY_PROMPT_APPEND,
|
|
},
|
|
{
|
|
name: "artistry",
|
|
config: { model: "google/gemini-3.1-pro", variant: "high" },
|
|
description: "Complex problem-solving with unconventional, creative approaches - beyond standard patterns",
|
|
promptAppend: ARTISTRY_CATEGORY_PROMPT_APPEND,
|
|
},
|
|
]
|