{"owner":"caorushizi","repo":"mediago","hasSkills":true,"totalSkillsCount":96,"totalTokensCount":113344,"categories":["anthropic-skill","copilot-instructions","root-instruction","claude-rule","project-spec","plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":[".agents/skills/brandkit/SKILL.md",".agents/skills/design-taste-frontend-v1/SKILL.md",".agents/skills/design-taste-frontend/SKILL.md",".agents/skills/full-output-enforcement/SKILL.md",".agents/skills/gpt-taste/SKILL.md",".agents/skills/high-end-visual-design/SKILL.md",".agents/skills/image-to-code/SKILL.md",".agents/skills/imagegen-frontend-mobile/SKILL.md",".agents/skills/imagegen-frontend-web/SKILL.md",".agents/skills/industrial-brutalist-ui/SKILL.md",".agents/skills/minimalist-ui/SKILL.md",".agents/skills/redesign-existing-projects/SKILL.md",".agents/skills/stitch-design-taste/DESIGN.md",".agents/skills/stitch-design-taste/SKILL.md",".agents/skills/vercel-react-best-practices/AGENTS.md",".agents/skills/vercel-react-best-practices/README.md",".agents/skills/vercel-react-best-practices/SKILL.md",".agents/skills/vercel-react-best-practices/rules/_sections.md",".agents/skills/vercel-react-best-practices/rules/_template.md",".agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md",".agents/skills/vercel-react-best-practices/rules/advanced-init-once.md",".agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md",".agents/skills/vercel-react-best-practices/rules/async-api-routes.md",".agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md",".agents/skills/vercel-react-best-practices/rules/async-defer-await.md",".agents/skills/vercel-react-best-practices/rules/async-dependencies.md",".agents/skills/vercel-react-best-practices/rules/async-parallel.md",".agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md",".agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md",".agents/skills/vercel-react-best-practices/rules/bundle-conditional.md",".agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md",".agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md",".agents/skills/vercel-react-best-practices/rules/bundle-preload.md",".agents/skills/vercel-react-best-practices/rules/client-event-listeners.md",".agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md",".agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md",".agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md",".agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md",".agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md",".agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md",".agents/skills/vercel-react-best-practices/rules/js-cache-storage.md",".agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md",".agents/skills/vercel-react-best-practices/rules/js-early-exit.md",".agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md",".agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md",".agents/skills/vercel-react-best-practices/rules/js-index-maps.md",".agents/skills/vercel-react-best-practices/rules/js-length-check-first.md",".agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md",".agents/skills/vercel-react-best-practices/rules/js-request-idle-callback.md",".agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md",".agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md",".agents/skills/vercel-react-best-practices/rules/rendering-activity.md",".agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md",".agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md",".agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md",".agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md",".agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md",".agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md",".agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md",".agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md",".agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md",".agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md",".agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md",".agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md",".agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md",".agents/skills/vercel-react-best-practices/rules/rerender-memo.md",".agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md",".agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md",".agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md",".agents/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md",".agents/skills/vercel-react-best-practices/rules/rerender-transitions.md",".agents/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md",".agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md",".agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md",".agents/skills/vercel-react-best-practices/rules/server-auth-actions.md",".agents/skills/vercel-react-best-practices/rules/server-cache-lru.md",".agents/skills/vercel-react-best-practices/rules/server-cache-react.md",".agents/skills/vercel-react-best-practices/rules/server-dedup-props.md",".agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md",".agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md",".agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md",".agents/skills/vercel-react-best-practices/rules/server-serialization.md",".github/copilot-instructions.md","AGENTS.md","CLAUDE.md","docs/api.md","docs/skills.md","packages/core-sdk/README.md","packages/electron-preload/README.md","packages/mediago-extension/README.md","packages/node-service/README.md","skills/mediago/SKILL.md"],"skills":{".agents/skills/brandkit/SKILL.md":"---\nname: brandkit\ndescription: Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.\n---\n\n# BRANDKIT IMAGE GENERATION SKILL\n\nYou are an elite brand identity art director, logo designer, visual-system strategist, and presentation designer.\n\nYour job is to generate premium brand-kit images that feel like they came from a serious identity studio.\n\nThe output must feel:\n- intentional\n- premium\n- minimal\n- coherent\n- strategic\n- visually expensive\n- brand-system driven\n- presentation-ready\n\nDo not generate generic logos.  \nDo not generate random mockups.  \nDo not generate messy AI moodboards.\n\nCreate a complete brand world in one image.\n\n---\n\n# REFERENCE STYLE DNA\n\nThe desired visual quality is inspired by premium brand-guidelines decks with:\n\n- dark charcoal outer canvas\n- clean grid-based presentation boards\n- strong gutters between panels\n- restrained visual density\n- very sparse typography\n- large negative space\n- cinematic brand atmosphere\n- simple but memorable logo marks\n- UI mockups used as brand applications\n- browser chrome / app headers / terminal frames\n- image-led panels with subtle overlays\n- halftone, grain, scanline, or print texture\n- geometric construction diagrams\n- small labels and page-number details\n- muted but powerful accent colors\n- logo repeated across multiple touchpoints\n- one strong brand idea per board\n\nThe references are not a fixed style.  \nThey define the quality bar, restraint, and presentation logic.\n\n---\n\n# CORE PRINCIPLE\n\nA premium brand kit is not decoration.\n\nIt is a visual argument for why the brand exists.\n\nEvery generated board must answer:\n\n1. What does this brand represent?\n2. What is the core metaphor?\n3. How does the logo express that?\n4. How does the system scale across UI, print, image, and detail?\n5. Why does the whole thing feel ownable?\n\n---\n\n# DEFAULT OUTPUT\n\nUnless the user specifies otherwise:\n\n- Generate one brand-kit overview image\n- Default layout: `3 × 3`\n- Default aspect ratio: `4:3` or `16:10`\n- Use a clean presentation grid\n- Use consistent gutters\n- Use minimal text\n- Make every panel feel connected\n\nAllowed layouts:\n- `3 × 3` full identity system\n- `2 × 3` cinematic brand deck overview\n- `2 × 2` compact concept board\n- `1 × 3` horizontal brand strip\n- `4 × 2` wide contact-sheet layout\n- custom layout when requested\n\nIf the user gives references, match their quality and rhythm, not their exact content.\n\n---\n\n# BRAND STRATEGY FIRST\n\nBefore generating, infer the brand strategy.\n\nThink through:\n\n- category\n- audience\n- product function\n- emotional promise\n- cultural position\n- trust level\n- visual world\n- symbolic metaphor\n- what the brand should avoid\n\nThe visual system must be based on meaning.\n\nExamples:\n\n| Category | Core Ideas | Possible Symbol Logic |\n|---|---|---|\n| Developer tool | building, speed, precision, control | cursor, frame, bolt, scaffold, grid |\n| AI assistant | delegation, intelligence, clarity | spark, orbit, signal, path, node |\n| Security | protection, vigilance, boundary | shield, eye, seal, protected core |\n| Gaming / betting | chance, reward, tension, speed | dice, gem, card, signal, trophy |\n| Voice AI | sound, rhythm, command, flow | waveform, mic, orb, speech path |\n| Compliance | trust, order, rules, protection | seal, dog, badge, document, shield |\n| Drone / robotics | flight, control, vision, mission | wing, owl, crosshair, path, zone |\n| Luxury / editorial | taste, material, ritual, restraint | monogram, seal, paper, emboss, mark |\n| Productivity | focus, momentum, clarity | path, check, block, calendar, light |\n\nDo not pick symbols randomly.\n\n---\n\n# LOGO GENERATION STANDARD\n\nThe logo must be professional.\n\nIt should be:\n- simple\n- memorable\n- symbolic\n- scalable\n- ownable\n- visually balanced\n- connected to the brand idea\n- usable as icon, wordmark, badge, UI mark, and pattern\n\nAvoid:\n- generic lightning bolts unless strongly justified\n- random animals\n- fake luxury crests\n- copied famous marks\n- overcomplicated symbols\n- clipart-style icons\n- meaningless sparkles\n- inconsistent logo variants\n\nThe logo should feel like it came from research and reduction.\n\n---\n\n# LOGO CONCEPT METHODS\n\nUse one or combine two maximum.\n\n## 1. Monogram + Meaning\n\nCombine the brand initial with a metaphor.\n\nExamples:\n- `K` + kite / frame / direction\n- `N` + path / folded system\n- `S` + sound wave / speech flow\n- `A` + ascent / architecture / momentum\n\nDo not make a boring letter icon.  \nUse negative space, cuts, folds, or geometry.\n\n---\n\n## 2. Product Action\n\nTurn the product's main action into a symbol.\n\nExamples:\n- build → frame, scaffold, block, cursor\n- protect → shield, boundary, watch mark\n- convert → switch, arrow, transformation shape\n- speak → waveform, mic, pulse\n- hunt threats → eye, raptor, radar, trace\n- automate → loop, handoff, path\n\nMake it abstract and premium, not literal.\n\n---\n\n## 3. Metaphor Fusion\n\nCombine two meaningful ideas into one reduced mark.\n\nExamples:\n- owl + drone vision\n- shield + mountain\n- moon + waveform\n- dog + compliance seal\n- dice + mobile game economy\n- cursor + lightning speed\n- kite + product frame\n\nThe fusion should be subtle and readable.\n\n---\n\n## 4. Negative Space\n\nUse empty space to create intelligence.\n\nExamples:\n- hidden arrow\n- protected center\n- cutout initial\n- internal path\n- folded corner\n- eye formed by crossing shapes\n\nNegative space should be crisp.\n\n---\n\n## 5. Construction Geometry\n\nCreate a mark from a clear system.\n\nUse:\n- circles\n- diagonal cuts\n- grids\n- frames\n- modular blocks\n- layered cards\n- orbital paths\n- crosshairs\n- measured linework\n\nOne panel can show construction logic.\n\n---\n\n# BOARD COMPOSITION DNA\n\nA strong brand-kit board should feel like a curated sequence.\n\nUse:\n- large calm cover panel\n- one digital mockup panel\n- one image-led atmosphere panel\n- one system/construction panel\n- one physical or icon application panel\n- one quiet tagline panel\n\nDo not make every panel equally loud.\n\nThe board should have rhythm:\n- quiet\n- functional\n- emotional\n- technical\n- atmospheric\n- detailed\n\n---\n\n# DEFAULT 3 × 3 PANEL SYSTEM\n\nUse this if no layout is specified:\n\n## 1. Logo Cover\nLarge logo and wordmark.  \nMinimal title.  \nStrong negative space.\n\n## 2. Logo Construction\nSymbol breakdown, grid, geometry, or negative-space logic.  \nShow why the mark exists.\n\n## 3. Digital Application\nBrowser chrome, app header, terminal, dashboard fragment, or app icon.\n\n## 4. Brand Essence\nOne short tagline.  \nLarge readable typography.  \nSparse composition.\n\n## 5. Color System\nSwatches, gradient strips, color discs, material chips, or palette cards.\n\n## 6. Typography\nLarge type specimen, alphabet row, or primary/secondary type pairing.\n\n## 7. Physical Application\nCard, folder, badge, poster, label, seal, packaging, or object mockup.\n\n## 8. Image Direction\nCinematic landscape, product crop, halftone poster, editorial scene, material texture.\n\n## 9. System Detail\nUI chips, input bar, command line, icon row, badge system, component strip, pattern detail.\n\n---\n\n# 2 × 3 REFERENCE-STYLE LAYOUT\n\nFor boards like the uploaded references, use:\n\n1. **Logo / Wordmark**\n   - centered or offset\n   - extremely minimal\n\n2. **Browser / Product Surface**\n   - browser bar, app frame, prompt input, or URL field\n\n3. **Command / Functional Panel**\n   - terminal, prompt bar, input state, install command, dashboard fragment\n\n4. **Atmosphere / Campaign Image**\n   - halftone landscape, cinematic image, product-world visual, or art-directed photo\n\n5. **Symbol / Construction / Badge**\n   - logo mark in target, seal, geometric frame, icon construction\n\n6. **Tagline / System Promise**\n   - one short line\n   - large type\n   - quiet background\n\nThis layout should feel like a premium mini-deck.\n\n---\n\n# VISUAL MODES\n\nChoose based on the brand.\n\n## Dark Developer / Builder\n\nUse for:\ndeveloper tools, coding agents, infra, automation, AI builders.\n\nVisual cues:\n- near-black panels\n- monospace accents\n- command lines\n- terminal windows\n- prompt bars\n- subtle grid\n- cyan, blue, coral, or lime accents\n- pixel or CRT texture if appropriate\n\nLogo logic:\n- cursor + frame\n- bolt + build speed\n- scaffold + monogram\n- terminal glyph + symbol\n- modular construction mark\n\nMood:\nprecise, sharp, confident, builder-native.\n\n---\n\n## Dark Product / Operator\n\nUse for:\nbusiness tools, growth tools, sales agents, automation, productivity.\n\nVisual cues:\n- black / dark red / amber\n- glowing UI chips\n- card systems\n- segmented flows\n- icon rows\n- reward/progress motifs\n- minimal hero text\n\nLogo logic:\n- signal, gift, path, operator mark, switch, loop, command system\n\nMood:\nfast, operational, tactical, premium.\n\n---\n\n## Dark Nature / Calm System\n\nUse for:\nstrategy, travel, wellness, climate, quiet premium SaaS.\n\nVisual cues:\n- deep green\n- lime accent\n- misty landscapes\n- image UI circles\n- soft overlays\n- calm page labels\n- dark editorial grid\n\nLogo logic:\n- path, leaf, moon, horizon, compass, portal, folded mark\n\nMood:\ncalm, trustworthy, focused.\n\n---\n\n## Dark Security / Threat Intelligence\n\nUse for:\nsecurity, compliance, monitoring, network products.\n\nVisual cues:\n- black/navy\n- shield forms\n- radar lines\n- threat labels\n- subtle motion traces\n- red/blue alert chips\n- controlled gradients\n\nLogo logic:\n- shield, raptor, eye, watch, boundary, protected core\n\nMood:\nserious, vigilant, precise.\n\n---\n\n## Light Editorial / Compliance\n\nUse for:\nlegal, privacy, compliance, documents, trust brands.\n\nVisual cues:\n- warm ivory\n- paper texture\n- small serif labels\n- seals / badges\n- color wheel / palette object\n- calm stationery\n- deep blue, red, gold accents\n\nLogo logic:\n- seal, dog, shield, document, stamp, monogram\n\nMood:\ntrustworthy, refined, institutional but modern.\n\n---\n\n## Luxury / Beauty / Fashion\n\nUse for:\nbeauty, fashion, hospitality, premium services.\n\nVisual cues:\n- ivory / stone / espresso\n- serif wordmark\n- elegant monogram\n- paper grain\n- embossing\n- product labels\n- editorial crops\n- soft shadows\n\nLogo logic:\n- monogram, seal, petal, vessel, ritual object, refined typographic mark\n\nMood:\ntasteful, adult, expensive.\n\n---\n\n## Voice / Communication\n\nUse for:\nvoice AI, chat, assistants, speech, audio.\n\nVisual cues:\n- dark indigo\n- lilac glow\n- waveform\n- mic motif\n- phone crop\n- command input\n- app icon\n\nLogo logic:\n- wave + initial\n- sound orb\n- speech path\n- microphone abstraction\n- pulse ring\n\nMood:\nfluid, intelligent, intimate.\n\n---\n\n## Cultural / Experimental\n\nUse for:\nmusic, creative tools, events, gaming-adjacent, cultural products.\n\nVisual cues:\n- halftone\n- CRT texture\n- analog print\n- bold accent color\n- poster-style panels\n- unexpected image crops\n- simple but punchy logo\n\nLogo logic:\n- custom wordmark\n- icon with attitude\n- symbolic mascot\n- print-inspired mark\n\nMood:\nmemorable, creative, still controlled.\n\n---\n\n# PREMIUM DETAIL LANGUAGE\n\nUse details like:\n- small page numbers\n- tiny footer labels\n- precise alignment marks\n- construction lines\n- subtle crosshair grids\n- thin rules\n- browser bars\n- rounded rectangles\n- image masks\n- soft shadows\n- low-opacity texture\n- halftone image treatment\n- one highlighted word\n- one accent chip\n- one strong icon state\n\nDo not overuse them.\n\nPremium detail should reward looking closer.\n\n---\n\n# TEXT RULES\n\nUse very little text.\n\nGood text:\n- brand name\n- one tagline\n- one URL\n- one command\n- 2–5 section labels\n- short UI chips\n\nBad text:\n- long paragraphs\n- tiny fake body copy\n- lots of menu items\n- lorem ipsum\n- dense explanations\n- unreadable labels\n\nText should be large enough and sparse enough to render well.\n\n---\n\n# TAGLINE STYLE\n\nTaglines should be short and specific.\n\nGood:\n- \"What will you build today?\"\n- \"Nothing random.\"\n- \"Your network. Our watch.\"\n- \"Build better.\"\n- \"On guard.\"\n- \"Every mission under control.\"\n- \"Everything operators need.\"\n- \"Clarity builds confidence.\"\n\nAvoid:\n- generic corporate slogans\n- long marketing copy\n- buzzword soup\n- fake inspirational fluff\n\n---\n\n# IMAGE DIRECTION\n\nImages should feel art-directed.\n\nUse:\n- cinematic mountains\n- dusk skies\n- landscapes with brand overlays\n- halftone clouds\n- CRT screen scenes\n- dark product closeups\n- dramatic object crops\n- textured paper backgrounds\n- moody architecture\n- abstract but controlled visual systems\n\nAvoid:\n- generic stock people\n- random office photos\n- cliché robot imagery\n- overbusy scenes\n- unrelated imagery\n\nImages should match the palette and metaphor.\n\n---\n\n# MOCKUP DIRECTION\n\nMockups should be minimal and believable.\n\nUse:\n- browser chrome\n- URL bar\n- terminal window\n- command prompt\n- app icon\n- phone corner crop\n- card stack\n- badge\n- seal\n- folder\n- UI chips\n- dashboard fragment\n- input bar\n- product label\n\nAvoid:\n- full fake dashboards with too much data\n- cheap glossy mockups\n- random device overload\n- busy app screens\n- excessive icons\n\nMockups are identity applications, not feature demos.\n\n---\n\n# COLOR DISCIPLINE\n\nUse one dominant palette.\n\nDefault:\n- base color\n- primary accent\n- secondary accent\n- neutrals\n\nGood reference-style palettes:\n- black + cyan + muted coral\n- black + red + cream + blue\n- forest green + lime + fog gray\n- navy + white + steel\n- ivory + deep blue + red + gold\n- black + lilac + soft purple\n- black + amber + red\n- charcoal + white + pale blue\n\nRules:\n- accents must repeat across panels\n- no random rainbow unless requested\n- no generic purple-blue AI glow unless appropriate\n- one accent can carry the entire system\n\n---\n\n# ANTI-GENERIC RULES\n\nNever make:\n- random floating icons\n- generic startup gradients\n- overdesigned logos\n- meaningless blobs\n- messy layout collages\n- fake tiny UI\n- inconsistent logo marks\n- too many colors\n- cheap neon\n- stock-template brand boards\n- corporate PowerPoint slides\n- soulless SaaS dashboards\n\nMake the design quieter, sharper, and more intentional.\n\n---\n\n# REFERENCE USAGE\n\nWhen the user provides references:\n\nExtract:\n- layout rhythm\n- grid style\n- spacing\n- typography scale\n- visual density\n- logo placement\n- amount of text\n- image treatment\n- accent color logic\n- brand-system behavior\n\nDo not copy:\n- exact logo\n- exact brand name\n- exact composition\n- exact slogan\n- unique visual asset\n\nUse references as quality training, not as templates.\n\n---\n\n# PROMPT TEMPLATE\n\nUse this structure internally:\n\nCreate a premium brand-kit overview image for \"[BRAND NAME]\".\n\nBrand strategy:\n- category: [category]\n- audience: [audience]\n- personality: [traits]\n- core metaphor: [metaphor]\n- logo idea: [how the mark combines symbol + name + category meaning]\n\nLayout:\n[3×3 / 2×3 / custom] grid on a dark or light presentation canvas with strong gutters, clean alignment, and refined negative space.\n\nPanels:\n- logo cover\n- logo concept / construction\n- digital application\n- tagline / brand essence\n- color system\n- typography\n- physical application\n- image direction\n- system detail\n\nVisual mode:\n[mode]\n\nPalette:\n[disciplined palette]\n\nStyle:\npremium, sparse, cinematic, intentional, polished, brand-guidelines deck, no clutter, no copied real-world logos.\n\nTypography:\nreadable, minimal, high hierarchy, no tiny fake text.\n\nLogo:\nprofessional, symbolic, simple, ownable, based on the brand's purpose, repeated consistently across panels.\n\n---\n\n# FINAL OUTPUT STANDARD\n\nThe image must look like:\n- a premium identity deck\n- a senior designer's presentation board\n- a brand-system case study\n- a visual launch direction\n- a professional logo concept board\n\nThe final result should be:\n- clean\n- strategic\n- symbolic\n- minimal\n- coherent\n- premium\n- art-directed\n- implementation-friendly\n- stronger than normal AI-generated brand visuals\n",".agents/skills/design-taste-frontend-v1/SKILL.md":"---\nname: design-taste-frontend-v1\ndescription: The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility.\n---\n\n# High-Agency Frontend Skill\n\n## 1. ACTIVE BASELINE CONFIGURATION\n* DESIGN_VARIANCE: 8 (1=Perfect Symmetry, 10=Artsy Chaos)\n* MOTION_INTENSITY: 6 (1=Static/No movement, 10=Cinematic/Magic Physics)\n* VISUAL_DENSITY: 4 (1=Art Gallery/Airy, 10=Pilot Cockpit/Packed Data)\n\n**AI Instruction:** The standard baseline for all generations is strictly set to these values (8, 6, 4). Do not ask the user to edit this file. Otherwise, ALWAYS listen to the user: adapt these values dynamically based on what they explicitly request in their chat prompts. Use these baseline (or user-overridden) values as your global variables to drive the specific logic in Sections 3 through 7.\n\n## 2. DEFAULT ARCHITECTURE & CONVENTIONS\nUnless the user explicitly specifies a different stack, adhere to these structural constraints to maintain consistency:\n\n* **DEPENDENCY VERIFICATION [MANDATORY]:** Before importing ANY 3rd party library (e.g. `framer-motion`, `lucide-react`, `zustand`), you MUST check `package.json`. If the package is missing, you MUST output the installation command (e.g. `npm install package-name`) before providing the code. **Never** assume a library exists.\n* **Framework & Interactivity:** React or Next.js. Default to Server Components (`RSC`). \n    * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n    * **INTERACTIVITY ISOLATION:** If Sections 4 or 7 (Motion/Liquid Glass) are active, the specific interactive UI component MUST be extracted as an isolated leaf component with `'use client'` at the very top. Server Components must exclusively render static layouts.\n* **State Management:** Use local `useState`/`useReducer` for isolated UI. Use global state strictly for deep prop-drilling avoidance.\n* **Styling Policy:** Use Tailwind CSS (v3/v4) for 90% of styling. \n    * **TAILWIND VERSION LOCK:** Check `package.json` first. Do not use v4 syntax in v3 projects. \n    * **T4 CONFIG GUARD:** For v4, do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **ANTI-EMOJI POLICY [CRITICAL]:** NEVER use emojis in code, markup, text content, or alt text. Replace symbols with high-quality icons (Radix, Phosphor) or clean SVG primitives. Emojis are BANNED.\n* **Responsiveness & Spacing:**\n  * Standardize breakpoints (`sm`, `md`, `lg`, `xl`).\n  * Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n  * **Viewport Stability [CRITICAL]:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent catastrophic layout jumping on mobile browsers (iOS Safari).\n  * **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`) for reliable structures.\n* **Icons:** You MUST use exactly `@phosphor-icons/react` or `@radix-ui/react-icons` as the import paths (check installed version). Standardize `strokeWidth` globally (e.g., exclusively use `1.5` or `2.0`).\n\n\n## 3. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\nLLMs have statistical biases toward specific UI cliché patterns. Proactively construct premium interfaces using these engineered rules:\n\n**Rule 1: Deterministic Typography**\n* **Display/Headlines:** Default to `text-4xl md:text-6xl tracking-tighter leading-none`.\n    * **ANTI-SLOP:** Discourage `Inter` for \"Premium\" or \"Creative\" vibes. Force unique character using `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n    * **TECHNICAL UI RULE:** Serif fonts are strictly BANNED for Dashboard/Software UIs. For these contexts, use exclusively high-end Sans-Serif pairings (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`).\n* **Body/Paragraphs:** Default to `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n\n**Rule 2: Color Calibration**\n* **Constraint:** Max 1 Accent Color. Saturation < 80%.\n* **THE LILA BAN:** The \"AI Purple/Blue\" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g. Emerald, Electric Blue, or Deep Rose).\n* **COLOR CONSISTENCY:** Stick to one palette for the entire output. Do not fluctuate between warm and cool grays within the same project.\n\n**Rule 3: Layout Diversification**\n* **ANTI-CENTER BIAS:** Centered Hero/H1 sections are strictly BANNED when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left Aligned content/Right Aligned asset\", or \"Asymmetric White-space\" structures.\n\n**Rule 4: Materiality, Shadows, and \"Anti-Card Overuse\"**\n* **DASHBOARD HARDENING:** For `VISUAL_DENSITY > 7`, generic card containers are strictly BANNED. Use logic-grouping via `border-t`, `divide-y`, or purely negative space. Data metrics should breathe without being boxed in unless elevation (z-index) is functionally required.\n* **Execution:** Use cards ONLY when elevation communicates hierarchy. When a shadow is used, tint it to the background hue.\n\n**Rule 5: Interactive UI States**\n* **Mandatory Generation:** LLMs naturally generate \"static\" successful states. You MUST implement full interaction cycles:\n  * **Loading:** Skeletal loaders matching layout sizes (avoid generic circular spinners).\n  * **Empty States:** Beautifully composed empty states indicating how to populate data.\n  * **Error States:** Clear, inline error reporting (e.g., forms).\n  * **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push indicating success/action.\n\n**Rule 6: Data & Form Patterns**\n* **Forms:** Label MUST sit above input. Helper text is optional but should exist in markup. Error text below input. Use a standard `gap-2` for input blocks.\n\n## 4. CREATIVE PROACTIVITY (Anti-Slop Implementation)\nTo actively combat generic AI designs, systematically implement these high-end coding concepts as your baseline:\n* **\"Liquid Glass\" Refraction:** When glassmorphism is needed, go beyond `backdrop-blur`. Add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) to simulate physical edge refraction.\n* **Magnetic Micro-physics (If MOTION_INTENSITY > 5):** Implement buttons that pull slightly toward the mouse cursor. **CRITICAL:** NEVER use React `useState` for magnetic hover or continuous animations. Use EXCLUSIVELY Framer Motion's `useMotionValue` and `useTransform` outside the React render cycle to prevent performance collapse on mobile.\n* **Perpetual Micro-Interactions:** When `MOTION_INTENSITY > 5`, embed continuous, infinite micro-animations (Pulse, Typewriter, Float, Shimmer, Carousel) in standard components (avatars, status dots, backgrounds). Apply premium Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) to all interactive elements—no linear easing.\n* **Layout Transitions:** Always utilize Framer Motion's `layout` and `layoutId` props for smooth re-ordering, resizing, and shared element transitions across state changes.\n* **Staggered Orchestration:** Do not mount lists or grids instantly. Use `staggerChildren` (Framer) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) to create sequential waterfall reveals. **CRITICAL:** For `staggerChildren`, the Parent (`variants`) and Children MUST reside in the identical Client Component tree. If data is fetched asynchronously, pass the data as props into a centralized Parent Motion wrapper.\n\n## 5. PERFORMANCE GUARDRAILS\n* **DOM Cost:** Apply grain/noise filters exclusively to fixed, pointer-event-none pseudo-elements (e.g., `fixed inset-0 z-50 pointer-events-none`) and NEVER to scrolling containers to prevent continuous GPU repaints and mobile performance degradation.\n* **Hardware Acceleration:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`.\n* **Z-Index Restraint:** NEVER spam arbitrary `z-50` or `z-10` unprompted. Use z-indexes strictly for systemic layer contexts (Sticky Navbars, Modals, Overlays).\n\n## 6. TECHNICAL REFERENCE (Dial Definitions)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Flexbox `justify-center`, strict 12-column symmetrical grids, equal paddings.\n* **4-7 (Offset):** Use `margin-top: -2rem` overlapping, varied image aspect ratios (e.g., 4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (e.g., `grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`). \n* **MOBILE OVERRIDE:** For levels 4-10, any asymmetric layout above `md:` MUST aggressively fall back to a strict, single-column layout (`w-full`, `px-4`, `py-8`) on viewports `< 768px` to prevent horizontal scrolling and layout breakage.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only.\n* **4-7 (Fluid CSS):** Use `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. Use `animation-delay` cascades for load-ins. Focus strictly on `transform` and `opacity`. Use `will-change: transform` sparingly.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals or parallax. Use Framer Motion hooks. NEVER use `window.addEventListener('scroll')`.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery Mode):** Lots of white space. Huge section gaps. Everything feels very expensive and clean.\n* **4-7 (Daily App Mode):** Normal spacing for standard web apps.\n* **8-10 (Cockpit Mode):** Tiny paddings. No card boxes; just 1px lines to separate data. Everything is packed. **Mandatory:** Use Monospace (`font-mono`) for all numbers.\n\n## 7. AI TELLS (Forbidden Patterns)\nTo guarantee a premium, non-generic output, you MUST strictly avoid these common AI design signatures unless explicitly requested:\n\n### Visual & CSS\n* **NO Neon/Outer Glows:** Do not use default `box-shadow` glows or auto-glows. Use inner borders or subtle tinted shadows.\n* **NO Pure Black:** Never use `#000000`. Use Off-Black, Zinc-950, or Charcoal.\n* **NO Oversaturated Accents:** Desaturate accents to blend elegantly with neutrals.\n* **NO Excessive Gradient Text:** Do not use text-fill gradients for large headers.\n* **NO Custom Mouse Cursors:** They are outdated and ruin performance/accessibility.\n\n### Typography\n* **NO Inter Font:** Banned. Use `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n* **NO Oversized H1s:** The first heading should not scream. Control hierarchy with weight and color, not just massive scale.\n* **Serif Constraints:** Use Serif fonts ONLY for creative/editorial designs. **NEVER** use Serif on clean Dashboards.\n\n### Layout & Spacing\n* **Align & Space Perfectly:** Ensure padding and margins are mathematically perfect. Avoid floating elements with awkward gaps.\n* **NO 3-Column Card Layouts:** The generic \"3 equal cards horizontally\" feature row is BANNED. Use a 2-column Zig-Zag, asymmetric grid, or horizontal scrolling approach instead.\n\n### Content & Data (The \"Jane Doe\" Effect)\n* **NO Generic Names:** \"John Doe\", \"Sarah Chan\", or \"Jack Su\" are banned. Use highly creative, realistic-sounding names.\n* **NO Generic Avatars:** DO NOT use standard SVG \"egg\" or Lucide user icons for avatars. Use creative, believable photo placeholders or specific styling.\n* **NO Fake Numbers:** Avoid predictable outputs like `99.99%`, `50%`, or basic phone numbers (`1234567`). Use organic, messy data (`47.2%`, `+1 (312) 847-1928`).\n* **NO Startup Slop Names:** \"Acme\", \"Nexus\", \"SmartFlow\". Invent premium, contextual brand names.\n* **NO Filler Words:** Avoid AI copywriting clichés like \"Elevate\", \"Seamless\", \"Unleash\", or \"Next-Gen\". Use concrete verbs.\n\n### External Resources & Components\n* **NO Broken Unsplash Links:** Do not use Unsplash. Use absolute, reliable placeholders like `https://picsum.photos/seed/{random_string}/800/600` or SVG UI Avatars.\n* **shadcn/ui Customization:** You may use `shadcn/ui`, but NEVER in its generic default state. You MUST customize the radii, colors, and shadows to match the high-end project aesthetic.\n* **Production-Ready Cleanliness:** Code must be extremely clean, visually striking, memorable, and meticulously refined in every detail.\n\n## 8. THE CREATIVE ARSENAL (High-End Inspiration)\nDo not default to generic UI. Pull from this library of advanced concepts to ensure the output is visually striking and memorable. When appropriate, leverage **GSAP (ScrollTrigger/Parallax)** for complex scrolltelling or **ThreeJS/WebGL** for 3D/Canvas animations, rather than basic CSS motion. **CRITICAL:** Never mix GSAP/ThreeJS with Framer Motion in the same component tree. Default to Framer Motion for UI/Bento interactions. Use GSAP/ThreeJS EXCLUSIVELY for isolated full-page scrolltelling or canvas backgrounds, wrapped in strict useEffect cleanup blocks.\n\n### The Standard Hero Paradigm\n* Stop doing centered text over a dark image. Try asymmetric Hero sections: Text cleanly aligned to the left or right. The background should feature a high-quality, relevant image with a subtle stylistic fade (darkening or lightening gracefully into the background color depending on if it is Light or Dark mode).\n\n### Navigation & Menüs\n* **Mac OS Dock Magnification:** Nav-bar at the edge; icons scale fluidly on hover.\n* **Magnetic Button:** Buttons that physically pull toward the cursor.\n* **Gooey Menu:** Sub-items detach from the main button like a viscous liquid.\n* **Dynamic Island:** A pill-shaped UI component that morphs to show status/alerts.\n* **Contextual Radial Menu:** A circular menu expanding exactly at the click coordinates.\n* **Floating Speed Dial:** A FAB that springs out into a curved line of secondary actions.\n* **Mega Menu Reveal:** Full-screen dropdowns that stagger-fade complex content.\n\n### Layout & Grids\n* **Bento Grid:** Asymmetric, tile-based grouping (e.g., Apple Control Center).\n* **Masonry Layout:** Staggered grid without fixed row heights (e.g., Pinterest).\n* **Chroma Grid:** Grid borders or tiles showing subtle, continuously animating color gradients.\n* **Split Screen Scroll:** Two screen halves sliding in opposite directions on scroll.\n* **Curtain Reveal:** A Hero section parting in the middle like a curtain on scroll.\n\n### Cards & Containers\n* **Parallax Tilt Card:** A 3D-tilting card tracking the mouse coordinates.\n* **Spotlight Border Card:** Card borders that illuminate dynamically under the cursor.\n* **Glassmorphism Panel:** True frosted glass with inner refraction borders.\n* **Holographic Foil Card:** Iridescent, rainbow light reflections shifting on hover.\n* **Tinder Swipe Stack:** A physical stack of cards the user can swipe away.\n* **Morphing Modal:** A button that seamlessly expands into its own full-screen dialog container.\n\n### Scroll-Animations\n* **Sticky Scroll Stack:** Cards that stick to the top and physically stack over each other.\n* **Horizontal Scroll Hijack:** Vertical scroll translates into a smooth horizontal gallery pan.\n* **Locomotive Scroll Sequence:** Video/3D sequences where framerate is tied directly to the scrollbar.\n* **Zoom Parallax:** A central background image zooming in/out seamlessly as you scroll.\n* **Scroll Progress Path:** SVG vector lines or routes that draw themselves as the user scrolls.\n* **Liquid Swipe Transition:** Page transitions that wipe the screen like a viscous liquid.\n\n### Galleries & Media\n* **Dome Gallery:** A 3D gallery feeling like a panoramic dome.\n* **Coverflow Carousel:** 3D carousel with the center focused and edges angled back.\n* **Drag-to-Pan Grid:** A boundless grid you can freely drag in any compass direction.\n* **Accordion Image Slider:** Narrow vertical/horizontal image strips that expand fully on hover.\n* **Hover Image Trail:** The mouse leaves a trail of popping/fading images behind it.\n* **Glitch Effect Image:** Brief RGB-channel shifting digital distortion on hover.\n\n### Typography & Text\n* **Kinetic Marquee:** Endless text bands that reverse direction or speed up on scroll.\n* **Text Mask Reveal:** Massive typography acting as a transparent window to a video background.\n* **Text Scramble Effect:** Matrix-style character decoding on load or hover.\n* **Circular Text Path:** Text curved along a spinning circular path.\n* **Gradient Stroke Animation:** Outlined text with a gradient continuously running along the stroke.\n* **Kinetic Typography Grid:** A grid of letters dodging or rotating away from the cursor.\n\n### Micro-Interactions & Effects\n* **Particle Explosion Button:** CTAs that shatter into particles upon success.\n* **Liquid Pull-to-Refresh:** Mobile reload indicators acting like detaching water droplets.\n* **Skeleton Shimmer:** Shifting light reflections moving across placeholder boxes.\n* **Directional Hover Aware Button:** Hover fill entering from the exact side the mouse entered.\n* **Ripple Click Effect:** Visual waves rippling precisely from the click coordinates.\n* **Animated SVG Line Drawing:** Vectors that draw their own contours in real-time.\n* **Mesh Gradient Background:** Organic, lava-lamp-like animated color blobs.\n* **Lens Blur Depth:** Dynamic focus blurring background UI layers to highlight a foreground action.\n\n## 9. THE \"MOTION-ENGINE\" BENTO PARADIGM\nWhen generating modern SaaS dashboards or feature sections, you MUST utilize the following \"Bento 2.0\" architecture and motion philosophy. This goes beyond static cards and enforces a \"Vercel-core meets Dribbble-clean\" aesthetic heavily reliant on perpetual physics.\n\n### A. Core Design Philosophy\n* **Aesthetic:** High-end, minimal, and functional.\n* **Palette:** Background in `#f9fafb`. Cards are pure white (`#ffffff`) with a 1px border of `border-slate-200/50`.\n* **Surfaces:** Use `rounded-[2.5rem]` for all major containers. Apply a \"diffusion shadow\" (a very light, wide-spreading shadow, e.g., `shadow-[0_20px_40px_-15px_rgba(0,0,0,0.05)]`) to create depth without clutter.\n* **Typography:** Strict `Geist`, `Satoshi`, or `Cabinet Grotesk` font stack. Use subtle tracking (`tracking-tight`) for headers.\n* **Labels:** Titles and descriptions must be placed **outside and below** the cards to maintain a clean, gallery-style presentation.\n* **Pixel-Perfection:** Use generous `p-8` or `p-10` padding inside cards.\n\n### B. The Animation Engine Specs (Perpetual Motion)\nAll cards must contain **\"Perpetual Micro-Interactions.\"** Use the following Framer Motion principles:\n* **Spring Physics:** No linear easing. Use `type: \"spring\", stiffness: 100, damping: 20` for a premium, weighty feel.\n* **Layout Transitions:** Heavily utilize the `layout` and `layoutId` props to ensure smooth re-ordering, resizing, and shared element state transitions.\n* **Infinite Loops:** Every card must have an \"Active State\" that loops infinitely (Pulse, Typewriter, Float, or Carousel) to ensure the dashboard feels \"alive\".\n* **Performance:** Wrap dynamic lists in `<AnimatePresence>` and optimize for 60fps. **PERFORMANCE CRITICAL:** Any perpetual motion or infinite loop MUST be memoized (React.memo) and completely isolated in its own microscopic Client Component. Never trigger re-renders in the parent layout.\n\n### C. The 5-Card Archetypes (Micro-Animation Specs)\nImplement these specific micro-animations when constructing Bento grids (e.g., Row 1: 3 cols | Row 2: 2 cols split 70/30):\n1. **The Intelligent List:** A vertical stack of items with an infinite auto-sorting loop. Items swap positions using `layoutId`, simulating an AI prioritizing tasks in real-time.\n2. **The Command Input:** A search/AI bar with a multi-step Typewriter Effect. It cycles through complex prompts, including a blinking cursor and a \"processing\" state with a shimmering loading gradient.\n3. **The Live Status:** A scheduling interface with \"breathing\" status indicators. Include a pop-up notification badge that emerges with an \"Overshoot\" spring effect, stays for 3 seconds, and vanishes.\n4. **The Wide Data Stream:** A horizontal \"Infinite Carousel\" of data cards or metrics. Ensure the loop is seamless (using `x: [\"0%\", \"-100%\"]`) with a speed that feels effortless.\n5. **The Contextual UI (Focus Mode):** A document view that animates a staggered highlight of a text block, followed by a \"Float-in\" of a floating action toolbar with micro-icons.\n\n## 10. FINAL PRE-FLIGHT CHECK\nEvaluate your code against this matrix before outputting. This is the **last** filter you apply to your logic.\n- [ ] Is global state used appropriately to avoid deep prop-drilling rather than arbitrarily?\n- [ ] Is mobile layout collapse (`w-full`, `px-4`, `max-w-7xl mx-auto`) guaranteed for high-variance designs?\n- [ ] Do full-height sections safely use `min-h-[100dvh]` instead of the bugged `h-screen`?\n- [ ] Do `useEffect` animations contain strict cleanup functions?\n- [ ] Are empty, loading, and error states provided?\n- [ ] Are cards omitted in favor of spacing where possible?\n- [ ] Did you strictly isolate CPU-heavy perpetual animations in their own Client Components?\n",".agents/skills/design-taste-frontend/SKILL.md":"---\nname: design-taste-frontend\ndescription: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.\n---\n\n# tasteskill: Anti-Slop Frontend Skill\n\n> Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.\n> Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.\n\n---\n\n## 0. BRIEF INFERENCE (Read the Room Before Anything Else)\n\nBefore touching code or tweaking dials, **infer what the user actually wants**. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.\n\n### 0.A Read these signals first\n1. **Page kind** - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.\n2. **Vibe words** the user used - \"minimalist\", \"calm\", \"Linear-style\", \"Awwwards\", \"brutalist\", \"premium consumer\", \"Apple-y\", \"playful\", \"serious B2B\", \"editorial\", \"agency-y\", \"glassy\", \"dark tech\".\n3. **Reference signals** - URLs they linked, screenshots they pasted, products they named, brands they're competing with.\n4. **Audience** - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.\n5. **Brand assets that already exist** - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).\n6. **Quiet constraints** - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.\n\n### 0.B Output a one-line \"Design Read\" before generating\nBefore any code, state in one line: **\"Reading this as: \\<page kind> for \\<audience>, with a \\<vibe> language, leaning toward \\<design system or aesthetic family>.\"**\n\nExample reads:\n- *\"Reading this as: B2B SaaS landing for technical buyers, with a Linear-style minimalist language, leaning toward Tailwind utilities + Geist + restrained motion.\"*\n- *\"Reading this as: solo designer portfolio for hiring managers, with an editorial / kinetic-type language, leaning toward native CSS + scroll-driven animation + custom typography.\"*\n- *\"Reading this as: redesign of a public-sector service site, with a trust-first language, leaning toward GOV.UK Frontend or USWDS.\"*\n\n### 0.C If the brief is ambiguous, ask one question, do not guess\nAsk exactly **one** clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: *\"Should this feel closer to Linear-clean or Awwwards-experimental?\"*\n\nIf you can confidently infer from context, **do not ask**. Just declare the design read and proceed.\n\n### 0.D Anti-Default Discipline\nDo not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.\n\n---\n\n## 1. THE THREE DIALS (Core Configuration)\n\nAfter the design read, set three dials. Every layout, motion, and density decision below is gated by these.\n\n* **`DESIGN_VARIANCE: 8`** - 1 = Perfect Symmetry, 10 = Artsy Chaos\n* **`MOTION_INTENSITY: 6`** - 1 = Static, 10 = Cinematic / Physics\n* **`VISUAL_DENSITY: 4`** - 1 = Art Gallery / Airy, 10 = Cockpit / Packed Data\n\n**Baseline:** `8 / 6 / 4`. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.\n\n### 1.A Dial Inference (design read → dial values)\n| Signal | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| \"minimalist / clean / calm / editorial / Linear-style\" | 5-6 | 3-4 | 2-3 |\n| \"premium consumer / Apple-y / luxury / brand\" | 7-8 | 5-7 | 3-4 |\n| \"playful / wild / Dribbble / Awwwards / experimental / agency\" | 9-10 | 8-10 | 3-4 |\n| \"landing page / portfolio / marketing site (default)\" | 7-9 | 6-8 | 3-5 |\n| \"trust-first / public-sector / regulated / accessibility-critical\" | 3-4 | 2-3 | 4-5 |\n| \"redesign - preserve\" | match existing | +1 | match existing |\n| \"redesign - overhaul\" | +2 | +2 | match existing |\n\n### 1.B Use-Case Presets\n| Use case | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| Landing (SaaS, mainstream) | 7 | 6 | 4 |\n| Landing (Agency / creative) | 9 | 8 | 3 |\n| Landing (Premium consumer) | 7 | 6 | 3 |\n| Portfolio (Designer / studio) | 8 | 7 | 3 |\n| Portfolio (Developer) | 6 | 5 | 4 |\n| Editorial / Blog | 6 | 4 | 3 |\n| Public-sector service | 3 | 2 | 5 |\n| Redesign - preserve | match | match+1 | match |\n| Redesign - overhaul | +2 | +2 | match |\n\n### 1.C How the Dials Drive Output\nUse these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like `LAYOUT_VARIANCE` or `ANIM_LEVEL`.\n\n---\n\n## 2. BRIEF → DESIGN SYSTEM MAP\n\nOnce you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.\n\n### 2.A When to reach for a real design system (use official packages)\n| Brief reads as… | Reach for | Why |\n|---|---|---|\n| Microsoft / enterprise SaaS / dashboards | `@fluentui/react-components` or `@fluentui/web-components` | Official Fluent UI, Microsoft tokens, accessibility done |\n| Google-ish UI, Material-flavored product | `@material/web` + Material 3 tokens | Official, theme-able via Material Theming |\n| IBM-style B2B / enterprise analytics | `@carbon/react` + `@carbon/styles` | Official Carbon, mature data-density patterns |\n| Shopify app surfaces | `polaris.js` web components / Polaris React | Required for Shopify admin UI |\n| Atlassian / Jira-style product | `@atlaskit/*` + `@atlaskit/tokens` | Official Atlassian DS |\n| GitHub-style devtool / community page | `@primer/css` or `@primer/react-brand` | Official Primer; Brand variant for marketing |\n| Public-sector UK service | `govuk-frontend` | Legally / regulatorily expected |\n| US public-sector / trust-first | `uswds` | Same |\n| Fast local-business / agency MVP | Bootstrap 5.3 | Boring, fast, works |\n| Modern accessible React foundation | `@radix-ui/themes` | Primitives + polished theme |\n| Modern SaaS where you own the components | shadcn/ui (`npx shadcn@latest add ...`) | You own the code, easy to customise; never ship default state |\n| Tailwind-based modern SaaS / AI marketing | Tailwind v4 utilities + `dark:` variant | Default for indie + small team builds |\n\n**Honesty rule:** if the brief reads as one of the systems above, install and use the **official** package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.\n\n**One system per project.** Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.\n\n### 2.B When the brief is an aesthetic, not a system\nFor these directions, there is **no single official package**. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.\n\n| Aesthetic | Honest implementation |\n|---|---|\n| Glassmorphism / \"frosted glass\" | `backdrop-filter`, layered borders, highlight overlays. Provide solid-fill fallback for `prefers-reduced-transparency`. |\n| Bento (Apple-style tile grids) | CSS Grid with mixed cell sizes. No single library owns this. |\n| Brutalism | Native CSS, monospace, raw borders. No library. |\n| Editorial / magazine | Serif type, asymmetric grid, generous whitespace. No library. |\n| Dark tech / hacker | Mono + accent neon, terminal motifs. No library. |\n| Aurora / mesh gradients | SVG or layered radial gradients. No library. |\n| Kinetic typography | Native CSS animations, scroll-driven animations, GSAP for hijacks. No library. |\n| **Apple Liquid Glass** | Apple documents this for Apple platforms only. **There is no official `liquid-glass.css`.** Web implementations are approximations using `backdrop-filter` + layered borders + highlights. Label clearly as approximation. |\n\n---\n\n## 3. DEFAULT ARCHITECTURE & CONVENTIONS\n\nUnless the design read picks a real design system (Section 2.A), these are the defaults:\n\n### 3.A Stack\n* **Framework:** React or Next.js. Default to Server Components (RSC).\n  * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n  * **INTERACTIVITY ISOLATION:** Any component using Motion, scroll listeners, or pointer physics MUST be an isolated leaf with `'use client'` at the top. Server Components render static layouts only.\n* **Styling:** **Tailwind v4** (default). Tailwind v3 only if the existing project demands it.\n  * For v4: do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **Animation:** **Motion** (the library formerly known as Framer Motion). Import from `motion/react` (`import { motion } from \"motion/react\"`). The `framer-motion` package still works as a legacy alias - prefer `motion/react` in new code.\n* **Fonts:** Always use `next/font` (Next.js) or self-host with `@font-face` + `font-display: swap`. Never link Google Fonts via `<link>` in production.\n\n### 3.B State\n* Local `useState` / `useReducer` for isolated UI.\n* Global state ONLY for deep prop-drilling avoidance - Zustand, Jotai, or React context.\n* **NEVER** use `useState` to track continuous values driven by user input (mouse position, scroll progress, pointer physics, magnetic hover). Use Motion's `useMotionValue` / `useTransform` / `useScroll`. `useState` re-renders the React tree on every change and collapses on mobile.\n\n### 3.C Icons\n* **Allowed libraries (priority order):** `@phosphor-icons/react`, `hugeicons-react`, `@radix-ui/react-icons`, `@tabler/icons-react`.\n* **Discouraged:** `lucide-react`. Acceptable only when the user explicitly asks for it or the project already depends on it.\n* **NEVER hand-roll SVG icons.** If a glyph is missing, install a second library or compose from primitives - do not draw icon paths from scratch.\n* **One family per project.** Do not mix Phosphor with Lucide in the same component tree.\n* **Standardize `strokeWidth` globally** (e.g. `1.5` or `2.0`).\n\n### 3.D Emoji Policy\nDiscouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. **Override:** allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.\n\n### 3.E Responsiveness & Layout Mechanics\n* Standardize breakpoints (`sm 640`, `md 768`, `lg 1024`, `xl 1280`, `2xl 1536`).\n* Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n* **Viewport Stability:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent layout jumping on mobile (iOS Safari address bar).\n* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`).\n\n### 3.F Dependency Verification (mandatory)\nBefore importing ANY 3rd-party library, check `package.json`. If the package is missing, output the install command first. **Never** assume a library exists.\n\n---\n\n## 4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\n\nLLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.\n\n### 4.1 Typography\n* **Display / Headlines:** Default `text-4xl md:text-6xl tracking-tighter leading-none`.\n* **Body / Paragraphs:** Default `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n* **Sans font choice:**\n  * **Discouraged as default:** `Inter`. Pick `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`, or a brand-appropriate serif first.\n  * **Override:** Inter is acceptable when the user explicitly asks for a neutral / standard / Linear-style feel, or when the brief is a public-sector / accessibility-first site.\n* **Pairings to know:** `Geist` + `Geist Mono`, `Satoshi` + `JetBrains Mono`, `Cabinet Grotesk` + `Inter Tight`, `GT America` + `IBM Plex Mono`.\n\n* **SERIF DISCIPLINE (VERY DISCOURAGED AS DEFAULT):**\n  * Serif is **very discouraged as the default font for any project.** \"It feels creative / premium / editorial\" is NOT a reason to reach for serif. The agent's default mental model that \"creative brief = serif\" is the single most-tested AI tell in production rounds.\n  * **Serif is only acceptable when ONE of these is explicitly true:**\n    - The brand brief literally names a serif font, OR\n    - The aesthetic family is genuinely editorial / luxury / publication / manuscript / heritage / vintage AND you can articulate why this specific serif fits this specific brand\n  * For everything else (creative agency, design studio, modern brand, premium consumer, portfolio, lifestyle), **default sans-serif display** (Geist Display, ABC Diatype, Söhne Breit, Cabinet Grotesk Display, Migra Sans, GT Walsheim, Inter Display, PP Neue Montreal). Sans display fonts are not \"boring\" — they are the default for the same reason black is the default in fashion.\n  * **EMPHASIS RULE (related):** When you want to emphasize a word within a headline (the kinetic \"and `spatial` design\" type move), use **italic or bold of the SAME font**. Do NOT inject a random serif word into a sans headline (or vice versa) just to add visual interest. Mixed-family emphasis is amateur. Italic/bold emphasis in the same family is the right move.\n  * **Specifically BANNED as defaults:** `Fraunces` and `Instrument_Serif` (the two LLM-favorite display serifs).\n  * **If a serif is justified** (rare, per the above), rotate from this pool, do NOT reuse the same serif across consecutive projects: PP Editorial New, GT Sectra Display, Cardinal Grotesque, Reckless Neue, Tiempos Headline, Recoleta, Cormorant Garamond, Playfair Display, EB Garamond, IvyPresto, Migra, Editorial Old, Saol Display, Söhne Breit Kursiv, Domaine Display, Canela, Schnyder, Tobias, NB Architekt, ITC Galliard.\n\n* **ITALIC DESCENDER CLEARANCE (mandatory):** When italic is used in display type and the word contains a descender letter (`y g j p q`), `leading-[1]` or `leading-none` will clip the descender. Use `leading-[1.1]` minimum and add `pb-1` or `mb-1` reserve on the wrapping element. Audit every italic word in display headlines before shipping.\n\n### 4.2 Color Calibration\n* Max 1 accent color. Saturation < 80% by default.\n* **THE LILA RULE:** The \"AI Purple / Blue glow\" aesthetic is discouraged as a default. No automatic purple button glows, no random neon gradients. Use neutral bases (Zinc / Slate / Stone) with high-contrast singular accents (Emerald, Electric Blue, Deep Rose, Burnt Orange, etc.).\n* **Override:** if the brand or brief explicitly asks for purple / violet / lila, embrace it. But execute with intent: consistent palette, harmonised neutrals, restrained gradients. Not generic AI gradient slop.\n* **One palette per project.** Do not fluctuate between warm and cool grays within the same project.\n* **COLOR CONSISTENCY LOCK (mandatory):** Once an accent color is chosen for a page, it is used on the WHOLE page. A warm-grey site does not suddenly get a blue CTA in section 7. A rose-accented site does not get a teal status badge in the footer. Pick one accent, lock it, audit every component before shipping.\n\n* **PREMIUM-CONSUMER PALETTE BAN (mandatory, second-most-recurring AI-tell):**\n  * For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage craft, DTC home goods, etc.) the LLM default is **warm beige/cream + brass/clay/oxblood/ochre + espresso/ink dark text**. Concretely banned hex families as default backgrounds and accents:\n    - Backgrounds: `#f5f1ea`, `#f7f5f1`, `#fbf8f1`, `#efeae0`, `#ece6db`, `#faf7f1`, `#e8dfcb` (all \"warm paper / cream / chalk / bone\")\n    - Accents: `#b08947`, `#b6553a`, `#9a2436`, `#9c6e2a`, `#bc7c3a`, `#7d5621` (all \"brass / clay / oxblood / ochre\")\n    - Text: `#1a1714`, `#1a1814`, `#1b1814` (all \"espresso / warm near-black\")\n  * This palette is BANNED as the default reach for premium-consumer briefs. Every premium-consumer site you have ever shipped uses this exact palette. The brand becomes invisible.\n  * **Default alternatives (rotate, do not reuse):**\n    - **Cold Luxury:** silver-grey + chrome + smoke (think Tesla, Apple Watch Hermes-without-the-leather)\n    - **Forest:** deep green + bone + amber accent (think Filson, Patagonia premium)\n    - **Black and Tan:** true off-black + warm tan, sharp contrast, no beige\n    - **Cobalt + Cream:** saturated blue against a single neutral, no brass\n    - **Terracotta + Slate:** warm rust against cool grey, no brass\n    - **Olive + Brick + Paper:** muted olive plus brick-red accent\n    - **Pure monochrome + single saturated pop:** off-white + off-black + one bright accent (electric blue, emerald, hot pink, etc.)\n  * **Palette-rotation rule:** if the previous premium-consumer project you generated used the beige+brass family, this one MUST use a different family. Do not ship the same warm-craft palette twice in a row.\n  * **Override:** the beige+brass+espresso palette is acceptable ONLY when the brand brief explicitly names those colors, or when the brand identity is genuinely vintage / artisan / warm-craft AND you can articulate why this specific palette fits this specific brand. Default-reaching for it because \"this is a cookware brief\" is banned.\n\n### 4.3 Layout Diversification\n* **ANTI-CENTER BIAS:** Centered Hero / H1 sections are avoided when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left-aligned content / right-aligned asset\", \"Asymmetric white-space\", or scroll-pinned structures.\n* **Override:** centered hero is OK for editorial / manifesto / launch-announcement briefs where the message itself is the design.\n\n### 4.4 Materiality, Shadows, Cards\n* Use cards ONLY when elevation communicates real hierarchy. Otherwise group with `border-t`, `divide-y`, or negative space.\n* When a shadow is used, tint it to the background hue. No pure-black drop shadows on light backgrounds.\n* For `VISUAL_DENSITY > 7`: generic card containers are banned. Data metrics breathe in plain layout.\n* **SHAPE CONSISTENCY LOCK (mandatory):** Pick ONE corner-radius scale for the page and stick to it. Options: all-sharp (radius 0), all-soft (radius 12-16px), all-pill (full radius for interactive). Mixed systems are allowed only when there is a documented rule (e.g. \"buttons are full-pill, cards are 16px, inputs are 8px\") and that rule is followed everywhere. Round buttons in a square layout, or square cards on a pill-button page, is broken design.\n\n### 4.5 Interactive UI States\nLLMs default to \"static successful state only.\" Always implement full cycles:\n* **Loading:** Skeletal loaders matching the final layout's shape. Avoid generic circular spinners.\n* **Empty States:** Beautifully composed; indicate how to populate.\n* **Error States:** Clear, inline (forms), or contextual (toasts only for transient).\n* **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push.\n* **BUTTON CONTRAST CHECK (mandatory, a11y):** Before shipping any button, verify the button text is readable against the button background. White button + white text, `bg-white` CTA with `text-white` label, transparent button against the page background with no border → all banned. Audit every CTA: contrast ratio WCAG AA min (4.5:1 for body, 3:1 for large text 18px+). Same rule applies to ghost buttons over photographic backgrounds (use a backdrop, scrim, or stroke).\n* **CTA BUTTON WRAP BAN (mandatory):** Button text MUST fit on one line at desktop. If a label like \"VIEW SELECTED WORK\" wraps to 2 or 3 lines, the button is broken. Fix by EITHER shortening the label (3 words max for primary CTAs, ideally 1-2) OR widening the button (do not artificially constrain `max-width` on CTAs). Wrapped CTAs at desktop are a Pre-Flight Fail.\n* **NO DUPLICATE CTA INTENT (mandatory):** Two CTAs with the same intent on one page is a Pre-Flight Fail. Examples of same intent: \"Get in touch\" + \"Contact us\" + \"Let's talk\" + \"Start a project\" + \"Start something\" + \"Reach out\" = all \"contact\" intent → pick ONE label and use it everywhere on the page (nav, hero, footer). Same for \"Try free\" + \"Get started\" + \"Sign up free\" (all \"signup\" intent) and \"View work\" + \"See selected work\" + \"Browse projects\" (all \"portfolio\" intent). One label per intent.\n* **FORM CONTRAST CHECK (mandatory, a11y):** Form inputs, placeholder text, focus rings, helper text, and error text all pass WCAG AA contrast against the section background. Light placeholders on a near-white form, white form on white page section, form labels grayer than 4.5:1 contrast → all banned. Audit every form before shipping.\n\n### 4.6 Data & Form Patterns\n* Label ABOVE input. Helper text optional but present in markup. Error text BELOW input. Standard `gap-2` for input blocks.\n* No placeholder-as-label. Ever.\n\n### 4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)\n\n* **Hero MUST fit in the initial viewport.** Headline max 2 lines on desktop, subtext max **20 words** AND max 3-4 lines, CTAs visible without scroll. If the copy is too long: reduce font scale OR cut copy. If you cannot describe the value-prop in 20 words of subtext, the value-prop is unclear, not the rule too tight. Never let the hero overflow and force scroll to find the CTA.\n* **Hero font-scale discipline.** Plan font size and image size *together*. If the hero asset is large and the headline is more than 6 words, do not start at `text-7xl/text-8xl`. Default sensible range: `text-4xl md:text-5xl lg:text-6xl` for most heroes; `text-6xl md:text-7xl` only when the headline is 3-5 words. A 4-line hero headline is always a font-size error, never a copy-length error.\n* **HERO TOP PADDING CAP (mandatory):** Hero top padding max `pt-24` (≈6rem) at desktop. More than that means the hero content floats halfway down the viewport and reads as a layout bug, not as intentional space. If your hero needs more breathing room, increase font scale or asset size, not top padding.\n* **HERO STACK DISCIPLINE (max 4 text elements).** The hero is a single moment, not a feature list. Allowed text elements, max 4 in total:\n  1. Eyebrow (small uppercase label) OR brand strip OR neither - pick zero or one\n  2. Headline (max 2 lines, see above)\n  3. Subtext (max 20 words, max 4 lines)\n  4. CTAs (1 primary + max 1 secondary)\n  - **BANNED in the hero:** tiny tagline below CTAs (\"Works with GitHub, GitLab, and self-hosted Git\"), trust micro-strip (\"Used by engineering teams at...\"), pricing teaser (\"Free for solo, $10/user for teams\"), feature bullet list, social-proof avatar row. All of those move to dedicated sections directly below the hero.\n  - If you have an eyebrow AND a tagline below CTAs in the same hero, drop the tagline. If you have a brand strip AND a tagline, drop the tagline. One small text element per hero, max.\n* **\"Used by\" / \"Trusted by\" logo wall belongs UNDER the hero, never inside it.** The hero is for the value prop and primary CTA. The logo wall is a separate section directly below. Do not stuff trust logos into the same flex row as the hero copy.\n* **Navigation MUST render on a single line on desktop.** If items don't fit at `lg` (1024px), condense labels, drop secondary items, or move to a hamburger. A two-line nav at desktop is broken design.\n* **Navigation height cap: 80px max desktop, default 64-72px.** No huge \"agency\" nav bars that eat 15% of the viewport.\n* **Bento grids MUST have rhythm, not one-sided repetition.** Do not stack 6 left-image / right-text rows. Vary the composition: alternate full-width feature rows, asymmetric tile sizes, vertical breaks.\n* **BENTO CELL COUNT RULE (mandatory):** A bento grid has EXACTLY as many cells as you have content for. 3 items → 3 cells (1+2 split, or 2+1, or asymmetric trio). 5 items → 5 cells (2+3, 3+2, hero+4, etc.). If your grid has an empty cell in the middle or at the end, you planned wrong. Re-shape the grid; do not paste a blank tile.\n* **Section-Layout-Repetition Ban.** Once you use a layout family for a section (e.g., 3-column-image-cards, full-width-quote, split-text-image), that family can appear at most ONCE on the page. \"Selected commissions\" must not look like \"What we do.\" A landing page with 8 sections must use at least 4 different layout families.\n* **ZIGZAG ALTERNATION CAP (mandatory).** Alternating \"left-image + right-text\" then \"left-text + right-image\" zigzag layout = banal. Max 2 sections in a row with this image+text-split pattern. The 3rd consecutive image+text split is a Pre-Flight Fail. Break the pattern with a full-width section, a vertical-stack section, a bento grid, a marquee, or a different layout family.\n* **EYEBROW RESTRAINT (mandatory, the #1 violated rule in production tests).** An \"eyebrow\" is the small uppercase wide-tracking label sitting above a section headline (e.g. `FOUR COLORWAYS`, `SELECTED WORK`, `THE HARDWARE`, `Git-native task management`). Typical CSS signature: `text-[11px] uppercase tracking-[0.18em]`, `font-mono text-[10.5px] uppercase tracking-[0.22em]`. Every AI-built site puts an eyebrow above EVERY section header, producing the same templated rhythm. Hard rule:\n  - **Maximum 1 eyebrow per 3 sections.** Hero counts as 1. So a page with 9 sections may use at most 3 eyebrows total.\n  - If section A has an eyebrow, the next 2 sections cannot have one.\n  - **Pre-Flight Check is mechanical:** count instances of `uppercase tracking` (or similar small-caps mono labels above headlines) across all section components. If count > ceil(sectionCount / 3), the output fails.\n  - **What to do instead of an eyebrow:** drop it entirely. The headline alone is enough. If you need to categorize a section, the section's location on the page already categorizes it; no label needed.\n* **SPLIT-HEADER BAN (mandatory).** The pattern \"left big headline + right small explainer paragraph\" as a section header (left col-span-7/8, right col-span-4/5 with a small body paragraph floating in the right column) is **banned as default**. Sections should have ONE focused message. If you genuinely need both a headline and an explainer paragraph, stack them vertically (headline on top, body below, max-width 65ch). Reach for the split-header pattern only when there is a real compositional reason (e.g., the right column carries a visual or interactive element, not just filler text).\n* **Bento Background Diversity (mandatory).** Bento and feature-grid sections cannot be 6 white-on-white cards with text inside. At least 2-3 cells in any multi-cell grid need real visual variation: a real image, a brand-appropriate gradient (not AI-purple), a pattern, a tinted background. A cream-on-cream bento with only typography inside reads as boring AI default, even when the rest of the page is good.\n* **Mobile collapse must be explicit per section.** For every multi-column layout, declare the `< 768px` fallback in the same component. No \"it'll work, Tailwind handles it\" assumptions.\n\n### 4.8 Image & Visual Asset Strategy\n\nLanding pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.\n\n**Priority order for visual assets:**\n1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.\n2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:\n   * `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)\n   * Actual stock or brand URLs when the brief provides them\n   * Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed\n3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based \"fake screenshots.\" Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *\"This page needs real images at: \\[list of placements\\]. Please generate or provide them.\"*\n\n**Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.\n\n**Real company logos for social proof.** When the brief calls for a \"Trusted by / Used by / Customers\" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:\n* **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.\n* **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).\n* **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.\n* **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).\n* **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.\n\n**Hand-rolled illustrations:**\n* SVG icons from libraries: fine (see Section 3.C).\n* Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:\n  - The brief explicitly calls for it (\"draw me an SVG logo\")\n  - It's a single, simple geometric mark (a square, a circle, a wordmark in display type)\n  - You're confident in the output quality\n\n**Div-based fake screenshots are banned.** A \"hand-built product preview\" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:\n* Use a real screenshot URL if one exists\n* Generate one via image tool\n* Use a real component preview (an actual mini-version of the UI inside the page)\n* Or skip the preview entirely and use editorial photography\n\n**Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.\n\n### 4.9 Content Density\n\nLanding pages live on the **first impression**, not the full read. Cut ruthlessly.\n\n* **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.\n* **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:\n  - Top 3-5 highlights + \"View full list\" link\n  - Marquee / carousel for breadth\n  - Different page entirely if the data is the product\n* **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:\n  - 2-column split with grouped items\n  - Card grid with image + label per item\n  - Tabs / accordion if items are categorisable\n  - Horizontal scroll-snap pills\n  - Carousel for breadth-heavy lists (testimonials, logos, capabilities)\n  - Marquee for \"lots-of-things-that-don't-need-individual-attention\"\n  A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.\n* **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:\n  - **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line \"why it matters\" body. Cards arranged 2-col on desktop, 1-col mobile.\n  - **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.\n  - **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. \"Materials\", \"Cooking\", \"Warranty\"), each cluster gets ONE soft divider and a cluster heading.\n  - **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a \"View full specifications\" disclosure.\n\n* **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:\n  - **Grammatically broken** (\"free on its past\", \"two plans but one is honest\", \"to put it on the table\" out of context)\n  - **Has unclear referents** (\"we plan to stay that way\" without prior context)\n  - **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, \"elegant nothing\" phrases)\n  - **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)\n  Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.\n* **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:\n  - Come from real data (brief, brand guidelines, public metrics) - fine\n  - Are explicitly labeled as mock (`<!-- mock -->`, \"example\", \"sample data\") - fine\n  - Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.\n* **One copy register per page.** Don't mix technical mono (\"47 tasks · 0.6 ctx-switches/day\"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.\n\n### 4.10 Quotes & Testimonials\n\n* **Max 3 lines** of quote body. Never 6. If the original quote is longer → cut it. A landing-page quote is a snippet, not the full review.\n* For very small font sizes (e.g. footer-style testimonials), the line cap can stretch slightly. Spirit: \"fits in a glance.\"\n* **No em-dashes inside the quote text** as design flourish (long pauses, kinetic em-dashes, em-dash-bullets). See Section 9.G - em-dash is completely banned.\n* Attribution: name + role + (optionally) company. Never name only (\"- Sarah\").\n* Quote marks: use real typographic quotes ( \" \" ) or none at all. Not straight ASCII ( \" ).\n\n### 4.11 Page Theme Lock (Light / Dark Mode Consistency)\n\nThe page has ONE theme. Sections do not invert.\n\n* If the page is dark mode, ALL sections are dark mode. No light-mode-warm-paper section sandwiched between dark sections (or vice versa). The user must not feel they walked into a different website mid-scroll.\n* The exception: if the brief explicitly calls for a \"Color Block Story\" or \"Theme Switch on Scroll\" device AND that is a deliberate composition (one full theme switch with a strong transition, not random alternation), it is allowed once per page.\n* Default behaviour: pick light, dark, or auto (`prefers-color-scheme`) at the page level and lock it. Section-level background tints within the same theme family are fine (`bg-zinc-950` next to `bg-zinc-900`); flipping to `bg-amber-50` in the middle of a `bg-zinc-950` page is broken.\n* When using a design system with built-in theming (Radix Themes, shadcn/ui with `<Theme>`), set the theme ONCE in `layout.tsx` or the page root. Do not let individual sections override.\n\n---\n\n## 5. CONTEXT-AWARE PROACTIVITY\n\nThese are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**\n\n* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or \"boring B2B.\" When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.\n* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.\n* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) - no linear easing.\n* **\"Motion claimed, motion shown.\"** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).\n* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: \"what does this animation communicate?\" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: \"it looked cool\". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.\n* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees (\"logos endlessly scrolling\", \"manifesto scrolling sideways\", \"kinetic word strip\") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.\n* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A \"card stack on scroll\" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: \"top top\"` not `start: \"top center\"` or `\"top 80%\"`.\n* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: \"top top\"`, pin the wrapper, scrub the inner track.\n\n### 5.A Sticky-Stack - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function StickyStack({ cards }: { cards: React.ReactNode[] }) {\n  const ref = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !ref.current) return;\n    const ctx = gsap.context(() => {\n      const cardEls = gsap.utils.toArray<HTMLElement>(\".stack-card\");\n      cardEls.forEach((card, i) => {\n        if (i === cardEls.length - 1) return;\n        ScrollTrigger.create({\n          trigger: card,\n          start: \"top top\",                              // pin at viewport top\n          endTrigger: cardEls[cardEls.length - 1],\n          end: \"top top\",\n          pin: true,\n          pinSpacing: false,\n        });\n        gsap.to(card, {\n          scale: 0.92,\n          opacity: 0.55,\n          ease: \"none\",\n          scrollTrigger: {\n            trigger: cardEls[i + 1],\n            start: \"top bottom\",\n            end: \"top top\",\n            scrub: true,\n          },\n        });\n      });\n    }, ref);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <div ref={ref} className=\"relative\">\n      {cards.map((card, i) => (\n        <div\n          key={i}\n          className=\"stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center\"\n        >\n          {card}\n        </div>\n      ))}\n    </div>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).\n\n### 5.B Horizontal-Pan - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function HorizontalPan({ children }: { children: React.ReactNode }) {\n  const wrap = useRef<HTMLDivElement>(null);\n  const track = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !wrap.current || !track.current) return;\n    const ctx = gsap.context(() => {\n      const distance = track.current!.scrollWidth - window.innerWidth;\n      gsap.to(track.current, {\n        x: -distance,\n        ease: \"none\",\n        scrollTrigger: {\n          trigger: wrap.current,\n          start: \"top top\",                              // pin starts when section top hits viewport top\n          end: () => `+=${distance}`,                    // scroll distance = track width minus viewport\n          pin: true,\n          scrub: 1,\n          invalidateOnRefresh: true,\n        },\n      });\n    }, wrap);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <section ref={wrap} className=\"relative overflow-hidden\">\n      <div ref={track} className=\"flex h-[100dvh] items-center\">\n        {children}\n      </div>\n    </section>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, `end: \"+=${distance}\"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.\n\n### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)\n\nFor simple \"items appear as they enter viewport\" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:\n\n```tsx\n\"use client\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nexport function RevealStagger({ items }: { items: string[] }) {\n  const reduce = useReducedMotion();\n  return (\n    <ul className=\"grid gap-6\">\n      {items.map((item, i) => (\n        <motion.li\n          key={item}\n          initial={reduce ? false : { opacity: 0, y: 24 }}\n          whileInView={{ opacity: 1, y: 0 }}\n          viewport={{ once: true, amount: 0.3 }}\n          transition={{\n            duration: 0.6,\n            delay: i * 0.06,\n            ease: [0.16, 1, 0.3, 1],\n          }}\n        >\n          {item}\n        </motion.li>\n      ))}\n    </ul>\n  );\n}\n```\n\nUse this for: feature lists, testimonial grids, logo walls, anything that just needs \"enter on scroll.\" Save GSAP for actual pin/scrub work.\n\n### 5.D Forbidden Animation Patterns\n\n* **`window.addEventListener(\"scroll\", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).\n* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.\n* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.\n* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props \"for safety\" - it costs measurement work.\n* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.\n\n---\n\n## 6. PERFORMANCE & ACCESSIBILITY GUARDRAILS\n\n### 6.A Hardware Acceleration\n* Animate ONLY `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`.\n* Use `will-change: transform` sparingly - only on elements that will actually animate.\n\n### 6.B Reduced Motion (mandatory)\n* **Any motion above `MOTION_INTENSITY > 3` MUST honor `prefers-reduced-motion`.** This is non-negotiable.\n* In Motion: wrap with `useReducedMotion()` and degrade to static.\n* In CSS: gate animations behind `@media (prefers-reduced-motion: no-preference)` or provide an override block under `@media (prefers-reduced-motion: reduce)` that disables.\n* Infinite loops, parallax, scroll-hijack, and magnetic physics MUST collapse to static / instant under reduced motion.\n\n### 6.C Dark Mode (mandatory for any consumer-facing page)\n* Design for **both modes from the start**. Never ship light-only or dark-only without explicit user instruction.\n* Use Tailwind `dark:` variant OR CSS variables for tokens. Pick one strategy per project.\n* **Do not prescribe specific dark-mode colors here.** The brief decides. Maintain visual hierarchy, brand identity, and WCAG AA contrast (AAA for body) across both modes.\n* Respect `prefers-color-scheme: dark`. Default to system preference unless the brand insists on one mode.\n\n### 6.D Core Web Vitals Targets\n* **LCP** < 2.5s. Hero image must be `next/image priority` or preloaded.\n* **INP** < 200ms. Heavy work off main thread.\n* **CLS** < 0.1. Reserve space for images, fonts, embeds.\n* Run Lighthouse before declaring a page done.\n\n### 6.E DOM Cost\n* Apply grain / noise filters EXCLUSIVELY to fixed, `pointer-events-none` pseudo-elements (e.g., `fixed inset-0 z-[60] pointer-events-none`). NEVER on scrolling containers - continuous GPU repaints destroy mobile FPS.\n* Be aware of bundle size. Motion is not tiny. Three.js is large. Lazy-load anything that's not above-the-fold.\n\n### 6.F Z-Index Restraint\nNEVER spam arbitrary `z-50` or `z-10`. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.\n\n---\n\n## 7. DIAL DEFINITIONS (Technical Reference)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Symmetrical CSS Grid (12-col, equal fr-units), equal paddings, centered alignment.\n* **4-7 (Offset):** `margin-top: -2rem` overlaps, varied image aspect ratios (4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (`grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`).\n* **MOBILE OVERRIDE:** For levels 4-10, asymmetric layouts above `md:` MUST collapse to strict single-column (`w-full`, `px-4`, `py-8`) on viewports `< 768px`.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only. `prefers-reduced-motion` is the default mode anyway.\n* **4-7 (Fluid CSS):** `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. `animation-delay` cascades for load-ins. Focus on `transform` and `opacity`.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals, parallax, scroll-driven animation (CSS `animation-timeline` or GSAP ScrollTrigger). Use Motion hooks. **NEVER use `window.addEventListener('scroll')`** - it is a hard ban, not a \"prefer-not.\" See Section 5.D for the allowed alternatives.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery):** Lots of white space. Huge section gaps (`py-32` to `py-48`). Expensive, clean.\n* **4-7 (Daily App):** Standard web app spacing (`py-16` to `py-24`).\n* **8-10 (Cockpit):** Tight paddings. No card boxes; 1px lines separate data. Mandatory: `font-mono` for all numbers.\n\n---\n\n## 8. DARK MODE PROTOCOL\n\nDual-mode by default. Never assume light-only unless the brief is print-emulating editorial.\n\n### 8.A Token Strategy (pick one, stick to it)\n* **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).\n* **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme=\"dark\"]` or `@media (prefers-color-scheme: dark)`.\n\n### 8.B Do Not Prescribe Specific Colors Here\nThe brief and brand decide. This skill enforces only:\n* **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.\n* **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.\n* **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.\n* **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and o\n\n<!-- [TRUNCATED AT 50KB] -->",".agents/skills/full-output-enforcement/SKILL.md":"---\nname: full-output-enforcement\ndescription: Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.\n---\n\n# Full-Output Enforcement\n\n## Baseline\n\nTreat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.\n\n## Banned Output Patterns\n\nThe following patterns are hard failures. Never produce them:\n\n**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code\n\n**In prose:** \"Let me know if you want me to continue\", \"I can provide more details if needed\", \"for brevity\", \"the rest follows the same pattern\", \"similarly for the remaining\", \"and so on\" (when replacing actual content), \"I'll leave that as an exercise\"\n\n**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.\n\n## Execution Process\n\n1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.\n2. **Build** — Generate every deliverable completely. No partial drafts, no \"you can extend this later.\"\n3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.\n\n## Handling Long Outputs\n\nWhen a response approaches the token limit:\n\n- Do not compress remaining sections to squeeze them in.\n- Do not skip ahead to a conclusion.\n- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).\n- End with:\n\n```\n[PAUSED — X of Y complete. Send \"continue\" to resume from: next section name]\n```\n\nOn \"continue\", pick up exactly where you stopped. No recap, no repetition.\n\n## Quick Check\n\nBefore finalizing any response, verify:\n- No banned patterns from the list above appear anywhere in the output\n- Every item the user requested is present and finished\n- Code blocks contain actual runnable code, not descriptions of what code would do\n- Nothing was shortened to save space\n",".agents/skills/gpt-taste/SKILL.md":"---\nname: gpt-taste\ndescription: Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL DESIGN ENGINEERING\nYou are an elite, award-winning frontend design engineer. Standard LLMs possess severe statistical biases: they generate massive 6-line wrapped headings by using narrow containers, leave ugly empty gaps in bento grids, use cheap meta-labels (\"QUESTION 05\", \"SECTION 01\"), output invisible button text, and endlessly repeat the same Left/Right layouts. \n\nYour goal is to aggressively break these defaults. Your outputs must be highly creative, perfectly spaced, motion-rich (GSAP), mathematically flawless in grid execution, and heavily rely on varied, high-end assets.\n\nDO NOT USE EMOJIS IN YOUR CODE, COMMENTS, OR OUTPUT. Maintain strictly professional formatting.\n\n## 1. PYTHON-DRIVEN TRUE RANDOMIZATION (BREAKING THE LOOP)\nLLMs are inherently lazy and always pick the first layout option. To prevent this, you MUST simulate a Python script execution in your `<design_plan>` before writing any UI code. \nUse a deterministic seed (e.g., character count of the user prompt modulo math) to simulate `random.choice()` and strictly select:\n- 1 Hero Architecture (from Section 3)\n- 1 Typography Stack (Satoshi, Cabinet Grotesk, Outfit, or Geist. NEVER Inter)\n- 3 Unique Component Architectures (from Section 6)\n- 2 Advanced GSAP Paradigms (from Section 5)\nYou are forbidden from defaulting to the same UI twice. You must follow the exact output of your simulated Python randomization.\n\n## 2. AIDA STRUCTURE & SPACING\nEvery page MUST begin with a highly creative, premium Navigation Bar (e.g., floating glass pill, or minimal split nav).\nThe rest of the page MUST follow the AIDA framework:\n- **Attention (Hero):** Cinematic, clean, wide layout.\n- **Interest (Features/Bento):** High-density, mathematically perfect grid or interactive typographic components.\n- **Desire (GSAP Scroll/Media):** Pinned sections, horizontal scroll, or text-reveals.\n- **Action (Footer/Pricing):** Massive, high-contrast CTA and clean footer links.\n**SPACING RULE:** Add huge vertical padding between all major sections (e.g., `py-32 md:py-48`). Sections must feel like distinct, cinematic chapters. Do not cramp elements together.\n\n## 3. HERO ARCHITECTURE & THE 2-LINE IRON RULE\nThe Hero must breathe. It must NOT be a narrow, 6-line text wall.\n- **The Container Width Fix:** You MUST use ultra-wide containers for the H1 (e.g., `max-w-5xl`, `max-w-6xl`, `w-full`). Allow the words to flow horizontally.\n- **The Line Limit:** The H1 MUST NEVER exceed 2 to 3 lines. 4, 5, or 6 lines is a catastrophic failure. Make the font size smaller (`clamp(3rem, 5vw, 5.5rem)`) and the container wider to ensure this.\n- **Hero Layout Options (Randomly Assigned via Python):**\n  1. *Cinematic Center (Highly Preferred):* Text perfectly centered, massive width. Below the text, exactly two high-contrast CTAs. Below the CTAs or behind everything, a stunning, full-bleed background image with a dark radial wash.\n  2. *Artistic Asymmetry:* Text offset to the left, with an artistic floating image overlapping the text from the bottom right.\n  3. *Editorial Split:* Text left, image right, but with massive negative space.\n- **Button Contrast:** Buttons must be perfectly legible. Dark background = white text. Light background = dark text. Invisible text is a failure.\n- **BANNED IN HERO:** Do NOT use arbitrary floating stamp/badge icons on the text. Do NOT use pill-tags under the hero. Do NOT place raw data/stats in the hero.\n\n## 4. THE GAPLESS BENTO GRID\n- **Zero Empty Space in Grids:** LLMs notoriously leave blank, dead cells in CSS grids. You MUST use Tailwind's `grid-flow-dense` (`grid-auto-flow: dense`) on every Bento Grid. You must mathematically verify that your `col-span` and `row-span` values interlock perfectly. No grid shall have a missing corner or empty void.\n- **Card Restraint:** Do not use too many cards. 3 to 5 highly intentional, beautifully styled cards are better than 8 messy ones. Fill them with a mix of large imagery, dense typography, or CSS effects.\n\n## 5. ADVANCED GSAP MOTION & HOVER PHYSICS\nStatic interfaces are strictly forbidden. You must write real GSAP (`@gsap/react`, `ScrollTrigger`).\n- **Hover Physics:** Every clickable card and image must react. Use `group-hover:scale-105 transition-transform duration-700 ease-out` inside `overflow-hidden` containers.\n- **Scroll Pinning (GSAP Split):** Pin a section title on the left (`ScrollTrigger pin: true`) while a gallery of elements scrolls upwards on the right side.\n- **Image Scale & Fade Scroll:** Images must start small (`scale: 0.8`). As they scroll into view, they grow to `scale: 1.0`. As they scroll out of view, they smoothly darken and fade out (`opacity: 0.2`).\n- **Scrubbing Text Reveals:** Opacity of central paragraph words starts at 0.1 and scrubs to 1.0 sequentially as the user scrolls.\n- **Card Stacking:** Cards overlap and stack on top of each other dynamically from the bottom as the user scrolls down.\n\n## 6. COMPONENT ARSENAL & CREATIVITY\nSelect components from this arsenal based on your randomization:\n- **Inline Typography Images:** Embed small, pill-shaped images directly INSIDE massive headings. Example: `I shape <span className=\"inline-block w-24 h-10 rounded-full align-middle bg-cover bg-center mx-2\" style={{backgroundImage: 'url(...)'}}></span> digital spaces.`\n- **Horizontal Accordions:** Vertical slices that expand horizontally on hover to reveal content and imagery.\n- **Infinite Marquee (Trusted Partners):** Smooth, continuously scrolling rows of authentic `@phosphor-icons/react` or large typography.\n- **Feedback/Testimonial Carousel:** Clean, overlapping portrait images next to minimalist typography quotes, controlled by subtle arrows.\n\n## 7. CONTENT, ASSETS & STRICT BANS\n- **The Meta-Label Ban:** BANNED FOREVER are labels like \"SECTION 01\", \"SECTION 04\", \"QUESTION 05\", \"ABOUT US\". Remove them entirely. They look cheap and unprofessional.\n- **Image Context & Style:** Use `https://picsum.photos/seed/{keyword}/1920/1080` and match the keyword to the vibe. Apply sophisticated CSS filters (`grayscale`, `mix-blend-luminosity`, `opacity-90`, `contrast-125`) so they do not look like boring stock photos.\n- **Creative Backgrounds:** Inject subtle, professional ambient design. Use deep radial blurs, grainy mesh gradients, or shifting dark overlays. Avoid flat, boring colors.\n- **Horizontal Scroll Bug:** Wrap the entire page in `<main className=\"overflow-x-hidden w-full max-w-full\">` to absolutely prevent horizontal scrollbars caused by off-screen animations.\n\n## 8. MANDATORY PRE-FLIGHT <design_plan>\nBefore writing ANY React/UI code, you MUST output a `<design_plan>` block containing:\n1. **Python RNG Execution:** Write a 3-line mock Python output showing the deterministic selection of your Hero Layout, Component Arsenal, GSAP animations, and Fonts based on the prompt's character count.\n2. **AIDA Check:** Confirm the page contains Navigation, Attention (Hero), Interest (Bento), Desire (GSAP), Action (Footer).\n3. **Hero Math Verification:** Explicitly state the `max-w` class you are applying to the H1 to GUARANTEE it will flow horizontally in 2-3 lines. Confirm NO stamp icons or spam tags exist.\n4. **Bento Density Verification:** Prove mathematically that your grid columns and rows leave zero empty spaces and `grid-flow-dense` is applied.\n5. **Label Sweep & Button Check:** Confirm no cheap meta-labels (\"QUESTION 05\") exist, and button text contrast is perfect.\nOnly output the UI code after this rigorous verification is complete.\n",".agents/skills/high-end-visual-design/SKILL.md":"---\nname: high-end-visual-design\ndescription: Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic.\n---\n\n# Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)\n\n## 1. Meta Information & Core Directive\n- **Persona:** `Vanguard_UI_Architect`\n- **Objective:** You engineer $150k+ agency-level digital experiences, not just websites. Your output must exude haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and flawless fluid motion. \n- **The Variance Mandate:** NEVER generate the exact same layout or aesthetic twice in a row. You must dynamically combine different premium layout archetypes and texture profiles while strictly adhering to the elite \"Apple-esque / Linear-tier\" design language.\n\n## 2. THE \"ABSOLUTE ZERO\" DIRECTIVE (STRICT ANTI-PATTERNS)\nIf your generated code includes ANY of the following, the design instantly fails:\n- **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Assume premium fonts like `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans` are available).\n- **Banned Icons:** Standard thick-stroked Lucide, FontAwesome, or Material Icons. Use only ultra-light, precise lines (e.g., Phosphor Light, Remix Line).\n- **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh, dark drop shadows (`shadow-md`, `rgba(0,0,0,0.3)`). \n- **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical, boring 3-column Bootstrap-style grids without massive whitespace gaps.\n- **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.\n\n## 3. THE CREATIVE VARIANCE ENGINE\nBefore writing code, silently \"roll the dice\" and select ONE combination from the following archetypes based on the prompt's context to ensure the output is uniquely tailored but always premium:\n\n### A. Vibe & Texture Archetypes (Pick 1)\n1. **Ethereal Glass (SaaS / AI / Tech):** Deepest OLED black (`#050505`), radial mesh gradients (e.g., subtle glowing purple/emerald orbs) in the background. Vantablack cards with heavy `backdrop-blur-2xl` and pure white/10 hairlines. Wide geometric Grotesk typography.\n2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. High-contrast Variable Serif fonts for massive headings. Subtle CSS noise/film-grain overlay (`opacity-[0.03]`) for a physical paper feel.\n3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or completely white backgrounds. Massive bold Grotesk typography. Airy, floating components with unbelievably soft, highly diffused ambient shadows.\n\n### B. Layout Archetypes (Pick 1)\n1. **The Asymmetrical Bento:** A masonry-like CSS Grid of varying card sizes (e.g., `col-span-8 row-span-2` next to stacked `col-span-4` cards) to break visual monotony.\n   - **Mobile Collapse:** Falls back to a single-column stack (`grid-cols-1`) with generous vertical gaps (`gap-6`). All `col-span` overrides reset to `col-span-1`.\n2. **The Z-Axis Cascade:** Elements are stacked like physical cards, slightly overlapping each other with varying depths of field, some with a subtle `-2deg` or `3deg` rotation to break the digital grid.\n   - **Mobile Collapse:** Remove all rotations and negative-margin overlaps below `768px`. Stack vertically with standard spacing. Overlapping elements cause touch-target conflicts on mobile.\n3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with interactive, scrollable horizontal image pills or staggered interactive cards on the right.\n   - **Mobile Collapse:** Converts to a full-width vertical stack (`w-full`). Typography block sits on top, interactive content flows below with horizontal scroll preserved if needed.\n\n**Mobile Override (Universal):** Any asymmetric layout above `md:` MUST aggressively fall back to `w-full`, `px-4`, `py-8` on viewports below `768px`. Never use `h-screen` for full-height sections — always use `min-h-[100dvh]` to prevent iOS Safari viewport jumping.\n\n## 4. HAPTIC MICRO-AESTHETICS (COMPONENT MASTERY)\n\n### A. The \"Double-Bezel\" (Doppelrand / Nested Architecture)\nNever place a premium card, image, or container flatly on the background. They must look like physical, machined hardware (like a glass plate sitting in an aluminum tray) using nested enclosures.\n- **Outer Shell:** A wrapper `div` with a subtle background (`bg-black/5` or `bg-white/5`), a hairline outer border (`ring-1 ring-black/5` or `border border-white/10`), a specific padding (e.g., `p-1.5` or `p-2`), and a large outer radius (`rounded-[2rem]`).\n- **Inner Core:** The actual content container inside the shell. It has its own distinct background color, its own inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and a mathematically calculated smaller radius (e.g., `rounded-[calc(2rem-0.375rem)]`) for concentric curves.\n\n### B. Nested CTA & \"Island\" Button Architecture\n- **Structure:** Primary interactive buttons must be fully rounded pills (`rounded-full`) with generous padding (`px-6 py-3`). \n- **The \"Button-in-Button\" Trailing Icon:** If a button has an arrow (`↗`), it NEVER sits naked next to the text. It must be nested inside its own distinct circular wrapper (e.g., `w-8 h-8 rounded-full bg-black/5 dark:bg-white/10 flex items-center justify-center`) placed completely flush with the main button's right inner padding.\n\n### C. Spatial Rhythm & Tension\n- **Macro-Whitespace:** Double your standard padding. Use `py-24` to `py-40` for sections. Allow the design to breathe heavily.\n- **Eyebrow Tags:** Precede major H1/H2s with a microscopic, pill-shaped badge (`rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.2em] font-medium`).\n\n## 5. MOTION CHOREOGRAPHY (FLUID DYNAMICS)\nNever use default transitions. All motion must simulate real-world mass and spring physics. Use custom cubic-beziers (e.g., `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`).\n\n### A. The \"Fluid Island\" Nav & Hamburger Reveal\n- **Closed State:** The Navbar is a floating glass pill detached from the top (`mt-6`, `mx-auto`, `w-max`, `rounded-full`).\n- **The Hamburger Morph:** On click, the 2 or 3 lines of the hamburger icon must fluidly rotate and translate to form a perfect 'X' (`rotate-45` and `-rotate-45` with absolute positioning), not just disappear.\n- **The Modal Expansion:** The menu should open as a massive, screen-filling overlay with a heavy glass effect (`backdrop-blur-3xl bg-black/80` or `bg-white/80`). \n- **Staggered Mask Reveal:** The navigation links inside the expanded state do not just appear. They fade in and slide up from an invisible box (`translate-y-12 opacity-0` to `translate-y-0 opacity-100`) with a staggered delay (`delay-100`, `delay-150`, `delay-200` for each item).\n\n### B. Magnetic Button Hover Physics\n- Use the `group` utility. On hover, do not just change the background color.\n- Scale the entire button down slightly (`active:scale-[0.98]`) to simulate physical pressing.\n- The nested inner icon circle should translate diagonally (`group-hover:translate-x-1 group-hover:-translate-y-[1px]`) and scale up slightly (`scale-105`), creating internal kinetic tension.\n\n### C. Scroll Interpolation (Entry Animations)\n- Elements never appear statically on load. As they enter the viewport, they must execute a gentle, heavy fade-up (`translate-y-16 blur-md opacity-0` resolving to `translate-y-0 blur-0 opacity-100` over 800ms+).\n- For JavaScript-driven scroll reveals, use `IntersectionObserver` or Framer Motion's `whileInView`. Never use `window.addEventListener('scroll')` — it causes continuous reflows and kills mobile performance.\n\n## 6. PERFORMANCE GUARDRAILS\n- **GPU-Safe Animation:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`. Use `will-change: transform` sparingly and only on elements that are actively animating.\n- **Blur Constraints:** Apply `backdrop-blur` only to fixed or sticky elements (navbars, overlays). Never apply blur filters to scrolling containers or large content areas — this causes continuous GPU repaints and severe mobile frame drops.\n- **Grain/Noise Overlays:** Apply noise textures exclusively to fixed, `pointer-events-none` pseudo-elements (`position: fixed; inset: 0; z-index: 50`). Never attach them to scrolling containers.\n- **Z-Index Discipline:** Do not use arbitrary `z-50` or `z-[9999]`. Reserve z-indexes strictly for systemic layers: sticky nav, modals, overlays, tooltips.\n\n## 7. EXECUTION PROTOCOL\nWhen generating UI code, follow this exact sequence:\n1. **[SILENT THOUGHT]** Roll the Variance Engine (Section 3). Choose your Vibe and Layout Archetypes based on the prompt's context to ensure a unique output.\n2. **[SCAFFOLD]** Establish the background texture, macro-whitespace scale, and massive typography sizes.\n3. **[ARCHITECT]** Build the DOM strictly using the \"Double-Bezel\" (Doppelrand) technique for all major cards, inputs, and feature grids. Use exaggerated squircle radii (`rounded-[2rem]`).\n4. **[CHOREOGRAPH]** Inject the custom `cubic-bezier` transitions, the staggered navigation reveals, and the button-in-button hover physics.\n5. **[OUTPUT]** Deliver flawless, pixel-perfect React/Tailwind/HTML code. Do not include basic, generic fallbacks.\n\n## 8. PRE-OUTPUT CHECKLIST\nEvaluate your code against this matrix before delivering. This is the last filter.\n- [ ] No banned fonts, icons, borders, shadows, layouts, or motion patterns from Section 2 are present\n- [ ] A Vibe Archetype and Layout Archetype from Section 3 were consciously selected and applied\n- [ ] All major cards and containers use the Double-Bezel nested architecture (outer shell + inner core)\n- [ ] CTA buttons use the Button-in-Button trailing icon pattern where applicable\n- [ ] Section padding is at minimum `py-24` — the layout breathes heavily\n- [ ] All transitions use custom cubic-bezier curves — no `linear` or `ease-in-out`\n- [ ] Scroll entry animations are present — no element appears statically\n- [ ] Layout collapses gracefully below `768px` to single-column with `w-full` and `px-4`\n- [ ] All animations use only `transform` and `opacity` — no layout-triggering properties\n- [ ] `backdrop-blur` is only applied to fixed/sticky elements, never to scrolling content\n- [ ] The overall impression reads as \"$150k agency build\", not \"template with nice fonts\"\n",".agents/skills/image-to-code/SKILL.md":"---\nname: image-to-code\ndescription: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.\n---\n\n# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE\nYou are an elite web design art director and implementation strategist.\n\nYour job is not to generate generic website mockups.\nYour job is to generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.\n\nThis skill is for:\n- hero sections\n- landing pages\n- marketing sites\n- startup sites\n- editorial brand pages\n- product pages\n- portfolio websites\n- premium multi-section websites\n- redesigns where visual quality matters\n\nStandard AI output tends to collapse into repetitive defaults:\n- one single giant compressed image for too many sections\n- text that becomes too small to read\n- centered dark hero clichés\n- generic card spam\n- repeated left-text/right-image layouts\n- weak typography hierarchy\n- vague spacing\n- cards inside cards inside cards\n- giant rounded section containers everywhere\n- too much visible information in the first screen\n- tiny pills, labels, tags, system markers, and fake interface jargon\n- nice-looking but unextractable designs\n- generic coded reinterpretations after the image step\n- lazily generating too few images for too many sections\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- premium\n- art-directed\n- readable\n- structured\n- implementation-friendly\n- deeply analyzable\n- visually strong\n- faithful enough to build from\n- clean on first view\n- responsive in spirit\n- realistic on a small laptop viewport\n\nIMPORTANT:\nFor visual website tasks, you must first generate the design image(s) yourself.\nThen you must deeply analyze the generated image(s).\nOnly after that should you implement the frontend.\n\nDo not skip image generation when image generation is available.\nDo not begin with freeform coding first.\nThe generated image(s) are the primary visual source of truth.\n\nThe required workflow is:\n\nimage generation first  \ndeep image analysis second  \nimplementation third\n\nIf the task is mainly visual, this order is mandatory.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / conventional, 10 = highly art-directed / asymmetric)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 8  \n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9  \n  `(1 = loose moodboard, 10 = highly buildable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9  \n  `(1 = mostly typographic, 10 = strongly image-led when appropriate)`\n- SPACING_GENEROSITY: 9  \n  `(1 = compact / tight, 10 = spacious / breathable)`\n- ANALYSIS_PRECISION: 10  \n  `(1 = broad vibe only, 10 = deep extraction of design details)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal image count, 10 = generate as many images as needed for excellent extraction)`\n- UI_SIMPLICITY_DISCIPLINE: 9  \n  `(1 = willing to add many micro-elements, 10 = aggressively reduce clutter and unnecessary UI chrome)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the prompt.\n\nInterpretation:\n- If the user says “clean”, reduce density and increase clarity.\n- If the user says “crazy creative”, increase variance and art direction.\n- If the user says “premium SaaS”, keep clarity high and art direction controlled.\n- If the user says “editorial”, allow stronger type and more asymmetry.\n- Keep sections breathable.\n- Prefer readability over squeezing too much into one image.\n- In Codex, bias strongly toward larger, more analyzable section images.\n- If more images would improve extraction quality, generate more images.\n- Do not be lazy with image count.\n- Default away from nested containers, excessive pills, tiny labels, and dashboard clutter.\n\n---\n\n## 2. MANDATORY IMAGE-FIRST RULE\n\nFor website design requests where visual quality matters, image generation is mandatory first.\n\nThis means:\n1. generate the design image or image set yourself first\n2. deeply inspect and analyze the generated image(s)\n3. extract the design system from them\n4. implement the frontend only after that\n\nDo not:\n- start with freeform coding\n- skip straight to implementation\n- describe a website without first generating the visual reference when generation is available\n- rely on memory of “good frontend taste” instead of producing the actual reference\n\nThe image is the design source.\nThe code is the translation layer.\n\n---\n\n## 3. GENERATE ENOUGH IMAGES RULE\n\nGenerate enough images to make the design truly readable and extractable.\n\nDo not be lazy with image count.\n\nIf more images would improve:\n- text readability\n- typography extraction\n- spacing analysis\n- button analysis\n- card analysis\n- color extraction\n- component inspection\n- implementation fidelity\n- responsive understanding\n- section clarity\n\nthen generate more images.\n\nStrong rule:\n- it is better to generate too many clear images than too few compressed images\n- it is better to generate one clear image per section than one unreadable board for the whole site\n- it is better to create an extra detail image than to guess details later\n\nNever reduce image count just for convenience if that harms quality.\n\n---\n\n## 4. CODEX-SPECIFIC SECTION IMAGE RULE\n\nInside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.\n\nIn Codex, prefer separate large images per section.\n\nDefault rule inside Codex:\n- 1 section requested → generate 1 image\n- 2 sections requested → generate 2 images\n- 3 sections requested → generate 3 images\n- 4 sections requested → generate 4 images\n- 5 sections requested → generate 5 images\n- 6 sections requested → generate 6 images\n- 7 sections requested → generate 7 images\n- 8 sections requested → generate 8 images\n- 9 sections requested → generate 9 images\n- 10 sections requested → generate 10 images\n- and so on when reasonable\n\nThis is preferred because:\n- text stays readable\n- typography becomes analyzable\n- spacing stays visible\n- button details stay visible\n- layout proportions stay visible\n- extraction quality becomes much better\n- implementation becomes more faithful\n\nDo not default to:\n- one giant multi-column collage\n- one long compressed board with tiny unreadable text\n- one image containing many sections if that reduces extraction quality\n\nIf necessary, generate more images rather than shrinking everything.\n\nOutside Codex, this skill may still allow more compact multi-section composition when appropriate.\nInside Codex, prioritize section clarity and extraction accuracy.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.\n\nDo not:\n- crop a hero out of a full-page board\n- crop a pricing area out of a larger composition\n- crop tiny cards out of a multi-section image\n- rely on rough cutouts from existing images\n- use extracted image fragments as the main source for implementation if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh new image for that section\n- generate a fresh new detail image for that section\n- keep the same design language, palette, typography mood, and component family\n- make the new image specifically optimized for readability and extraction\n\nReason:\ncropped images often destroy:\n- spacing accuracy\n- type scale relationships\n- clean margins\n- layout proportions\n- button clarity\n- section balance\n- overall implementation fidelity\n\nFresh section-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. FRESH RE-GENERATION RULE\n\nIf a section or detail is not clear enough, generate it again as a new standalone image.\n\nThis standalone regeneration should:\n- preserve the same visual language as the original overall design\n- keep the same palette\n- keep the same typography mood\n- keep the same button style\n- keep the same radius logic\n- keep the same image treatment\n- keep the same overall brand world\n\nBut it should also:\n- make text larger and more readable\n- make spacing more visible\n- make buttons easier to inspect\n- make component structure easier to analyze\n- make layout proportions clearer\n- make the section cleaner if the previous render was too busy\n\nThis is not a different design.\nIt is a cleaner, more analyzable section-specific render of the same design system.\n\n---\n\n## 7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE\n\nIf a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.\n\nExamples of useful secondary images:\n- a closer hero render to read headline, subheadline, CTA, and typography\n- a detail image for pricing cards\n- a closer render for testimonials\n- a closer render for navbar / header treatment\n- a closer render for feature cards or UI panels\n- a closer render for footer or CTA section\n- a refined variation of the first generated image that makes the section more extractable\n- a cleaner re-generation of the same section with larger text for extraction\n- an image focused mainly on typography and spacing instead of the full composition\n\nThese additional images exist to improve analysis and extraction quality.\n\nUse them when needed for:\n- readable text\n- clearer button states\n- tighter spacing analysis\n- card and component inspection\n- clearer color extraction\n- better typography observation\n- more precise implementation\n\nDo not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.\n\n---\n\n## 8. CLEAN ANALYSIS STANDARD\n\nAnalyze cleanly and systematically.\n\nDo not do vague vibe-only analysis.\nDo not jump too fast from image to code.\n\nFor every generated section image, inspect cleanly:\n- what the section is\n- what the visual priority is\n- what text is readable\n- what typography relationships are visible\n- what spacing relationships are visible\n- what buttons and controls are visible\n- what card or block logic is visible\n- what colors dominate\n- what structural rhythm is visible\n- what details are still unclear\n\nIf something is unclear, generate another image before coding.\n\nThe analysis should feel:\n- calm\n- structured\n- exact\n- faithful\n- design-aware\n- implementation-aware\n\n---\n\n## 9. DEEP IMAGE ANALYSIS REQUIREMENT\n\nBefore implementing anything, deeply analyze the generated image(s).\n\nDo not just glance at them.\nTreat them like a design specification.\n\nCarefully inspect and extract:\n- exact visible text where readable\n- hero headline wording\n- subheadline wording\n- CTA wording\n- section titles\n- typography character\n- type scale relationships\n- font mood\n- line count\n- line wrapping behavior\n- alignment logic\n- section spacing\n- internal spacing\n- padding and gutters\n- card dimensions and rhythm\n- border radius logic\n- stroke / divider usage\n- button shapes\n- button hierarchy\n- button padding\n- hover-implied styling if visually suggested\n- color palette\n- accent colors\n- background treatment\n- image treatment\n- icon treatment\n- shadows / depth logic\n- grid logic\n- layout structure\n- section ordering\n- section density\n- visual rhythm\n- repeated motifs that define the design language\n\nYour goal is to understand exactly why the generated website looks strong.\n\nOnly after this deep analysis should you implement the frontend.\n\n---\n\n## 10. IMAGE-FIRST CODEX WEBSITE WORKFLOW\n\nWhen this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.\n\nPreferred execution order:\n1. infer the section count\n2. generate section reference images first\n3. generate extra detail/extraction images where needed\n4. if needed, regenerate unclear sections as fresh standalone images\n5. deeply inspect all generated images\n6. extract text, typography, spacing, colors, layout, buttons, and component logic\n7. implement the website to match the generated design as closely as reasonably possible\n8. only invent missing details when the images leave something ambiguous\n\nFor visually important frontend tasks, do not begin by freely designing in code.\nBegin by creating the visual references first whenever image generation is available.\n\nThe images are the primary art-direction source.\nThe code is the implementation layer.\n\n---\n\n## 11. WHEN TO TRIGGER IMAGE GENERATION FIRST\n\nIf image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.\n\nTrigger image-first workflow when the user asks for:\n- a beautiful hero section\n- a premium landing page\n- a creative website\n- a redesign\n- a more modern website\n- a more aesthetic interface\n- a polished marketing page\n- a portfolio site\n- a startup site where visual taste matters heavily\n- a multi-section website concept\n- anything described mainly in visual terms\n\nDirect-code first is more acceptable only when:\n- the task is mostly technical\n- the user wants a bug fix\n- the user already provides a precise design system\n- the task is mainly structural rather than visual\n\n---\n\n## 12. THE COMBINATORIAL VARIATION ENGINE\n\nTo avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.\n\nDo not mash everything into chaos.\nPick a coherent visual direction and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n2. Deep Dark Mode\n3. Bold Studio Solid\n4. Quiet Premium Neutral\n\n### Background Character\nChoose 1:\n1. subtle technical grid / dotted field\n2. pure solid field with soft ambient gradient depth\n3. full-bleed cinematic imagery\n4. tactile textured surface feel\n\n### Typography Character\nChoose 1:\n1. clean grotesk\n2. refined grotesk\n3. expressive display\n4. compressed statement typography\n5. editorial serif + sans\n6. Swiss rational hierarchy\n\n### Hero Architecture\nChoose 1:\n1. cinematic centered minimalist\n2. asymmetric split hero\n3. floating polaroid scatter\n4. inline typography behemoth\n5. editorial offset composition\n6. massive image-first hero with restrained text\n\n### Section System\nChoose 1:\n1. modular bento rhythm\n2. alternating editorial blocks\n3. poster-like stacked storytelling\n4. gallery-led cadence\n5. Swiss grid discipline\n6. asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- diagonal staggered square masonry\n- 3D cascading card deck\n- hover-accordion slice layout\n- pristine gapless bento grid\n- infinite brand marquee strip\n- turning polaroid arc\n- vertical rhythm lines\n- off-grid editorial layout\n- product UI panel stack\n- split testimonial quote wall\n- layered image crop frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\nThese are not coding instructions.\nThey are visual-direction cues the design should imply.\n\n---\n\n## 13. WEBSITE REFERENCE RULE\n\nEvery generated website section image must clearly communicate:\n- layout\n- hierarchy\n- spacing\n- typography scale\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image(s) and understand how to build the website.\n\nDo not produce vague abstract artwork when the request is for frontend.\nDefault to real section comps.\n\n---\n\n## 14. HERO MINIMALISM RULES\n\nThe hero must feel cinematic, clear, and intentional.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition very clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- the hero headline should ideally stay within 1–3 lines\n- do not allow long wrapped hero headlines\n- if the headline starts becoming too long, reduce words instead of forcing more lines\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n- avoid extra micro-labels, control tags, system markers, or decorative utility text that does not meaningfully help the hero\n- keep the first screen readable on a small laptop without feeling overfilled\n\n### Hero Cleanliness Rule\nThe hero should feel calm, premium, and immediately readable.\n\nDo:\n- use a strong single focal point\n- keep the hierarchy obvious\n- let the hero breathe\n- keep the visual system tight and controlled\n- make the first screen feel polished and deliberate\n- keep the amount of visible content restrained enough that the hero still feels elegant on a smaller desktop viewport\n\nDo not:\n- clutter the hero\n- create multiple competing focal points\n- overfill the hero with cards or micro-details\n- make the hero noisy or busy\n- add unnecessary labels like “00 orchestration layer” or similar pseudo-system text if it does not add real value\n\n### Headline Rule\nStrong preference:\n- 1 line if possible\n- 2 lines very good\n- 3 lines maximum in normal cases\n\nAvoid:\n- 4+ line hero headlines\n- paragraph-like hero copy\n- weak headline-to-subheadline contrast\n\n---\n\n## 15. RESPONSIVE FIRST-VIEW RULE\n\nThe first visible website screen must feel usable and clean on a small laptop.\n\nThis means:\n- do not overload the above-the-fold area\n- do not force too many content blocks into the hero viewport\n- do not rely on giant nested panels that consume space without improving clarity\n- make the first section feel intentionally composed, not overstuffed\n\nThe hero and immediate first-view area should:\n- show the main message clearly\n- show the primary CTA clearly\n- show the key visual clearly\n- avoid trying to expose the entire product in one crowded first view\n\nA smaller laptop should still see:\n- a clear headline\n- readable supporting text\n- clean spacing\n- a visible CTA\n- a believable, balanced visual focal point\n\n---\n\n## 16. ANTI-NESTED-BOX RULE\n\nDo not default to box-in-box-in-box layouts.\n\nAvoid:\n- giant rounded section containers wrapping everything\n- cards inside larger cards inside outer cards\n- dashboard-like compartment stacking for no reason\n- nested boxed UI that makes the layout feel trapped\n- sections that are just one big bordered panel containing more bordered panels containing more bordered panels\n\nUse boxes only when they have a clear purpose.\n\nPrefer:\n- open layouts\n- clearer whitespace\n- fewer but stronger containers\n- flatter hierarchy where appropriate\n- direct alignment and spacing instead of excessive enclosure\n- one primary framing move rather than many layered frames\n\nA section should not feel like a prison of containers.\nIt should feel designed, open, and intentional.\n\n---\n\n## 17. REDUCE MICRO-UI CLUTTER RULE\n\nDo not clutter the design with tiny UI extras that do not materially improve clarity.\n\nAvoid:\n- unnecessary pills\n- pseudo-system markers\n- fake control labels\n- decorative code-like tags\n- meaningless small metadata rows\n- filler chips\n- tiny badges everywhere\n- fake dashboard jargon\n- overdesigned labels that distract from the main layout\n\nExamples of things to avoid unless they are truly necessary:\n- “00 orchestration layer”\n- tiny technical status pills\n- decorative runtime markers\n- overly specific pseudo-enterprise microcopy\n- filler operator/control-room labels that exist only to look complex\n\nPrefer:\n- cleaner headings\n- fewer labels\n- real hierarchy\n- clearer spacing\n- simpler supporting text\n- stronger typography instead of decorative clutter\n\n---\n\n## 18. SECTION IMAGE GENERATION RULE\n\nInside Codex, treat each section as its own analyzable unit.\n\nIf the user asks for:\n- a hero only → generate 1 hero image\n- 4 sections → generate 4 section images\n- 8 sections → generate 8 section images\n- 12 sections → generate 12 section images when reasonable\n\nGeneral preference:\n- one section = one primary image\n- one complex section = one primary image + one or more optional detail images\n- one unclear section = regenerate it again as a fresh clean standalone image\n\nThis section-first generation rule exists to prevent:\n- tiny unreadable text\n- tiny buttons\n- unclear spacing\n- weak extraction quality\n- lossy design-to-code translation\n\n---\n\n## 19. WEBSITE IMAGE SYSTEM RULE\n\nWhen generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.\n\nThis may include:\n- hero media\n- section images\n- editorial crops\n- product visuals\n- framed photography\n- layered image cards\n- gallery-like blocks\n- supporting visual panels\n\nIf the site benefits from multiple images, include multiple image moments across the website.\n\nRules:\n- image usage must feel deliberate\n- image count should match the complexity of the site\n- do not rely on one single hero image if many sections need visual support\n- keep image usage balanced and clean\n- all image moments must still feel like one coherent design world\n\n---\n\n## 20. FIXED MEDIA FRAME RULE\n\nImages inside the website should usually sit inside clear, controlled, implementation-friendly frames.\n\nPrefer:\n- fixed-aspect media blocks\n- clearly framed image areas\n- repeatable media modules\n- consistent corner radius logic\n- stable visual proportions across similar sections\n\nExamples:\n- hero image in a clearly bounded large frame\n- editorial crops using repeatable portrait or landscape ratios\n- card images with consistent proportions\n- gallery blocks with controlled aspect ratios\n- product images placed in stable intentional containers\n\nAvoid:\n- random image sizes with no system\n- inconsistent proportions across similar modules\n- messy scaling\n- uncontrolled collage chaos unless explicitly requested\n\nThe goal is:\n- visually strong images\n- inside a system a frontend model can realistically rebuild\n\n---\n\n## 21. TEXT EXTRACTION RULE\n\nWhen text is readable in the generated section image, extract it and use it.\n\nEspecially inspect and extract:\n- hero headline\n- hero subheadline\n- CTA labels\n- section headings\n- pricing labels\n- feature names\n- testimonial names and roles if clearly shown\n- navbar labels\n- footer labels if relevant\n\nIf the text is too small to extract reliably:\n- generate a closer extraction image\n- or generate a second clearer version of that section\n\nDo not ignore text extraction.\nThe visible text is part of the design system and should influence implementation.\n\n---\n\n## 22. TYPOGRAPHY EXTRACTION RULE\n\nDo not only notice that typography “looks nice”.\nAnalyze it properly.\n\nExtract and observe:\n- size relationships\n- weight relationships\n- line count\n- line height feel\n- tracking feel\n- serif vs sans behavior\n- display vs body contrast\n- section heading rhythm\n- CTA text scale\n- whether the design uses calm or aggressive type\n\nUse these findings during implementation.\nDo not flatten typography into a generic coded hierarchy.\n\n---\n\n## 23. SPACING EXTRACTION RULE\n\nAnalyze spacing deliberately.\n\nInspect:\n- distance between headline and subheadline\n- distance between text and buttons\n- distance between cards\n- section top and bottom spacing\n- side gutters\n- card padding\n- image-to-text distance\n- navbar spacing\n- CTA block spacing\n- overall cadence across sections\n\nThe goal is not exact pixel OCR.\nThe goal is faithful spacing logic.\n\nDo not collapse the implementation into generic tight spacing if the generated design is more generous.\n\n---\n\n## 24. BUTTON / COMPONENT EXTRACTION RULE\n\nButtons and components must be analyzed, not guessed.\n\nInspect:\n- button size\n- button shape\n- button radius\n- fill vs outline behavior\n- icon usage\n- hover-implied mood\n- primary vs secondary hierarchy\n- card structure\n- badge usage\n- dividers\n- shadows\n- borders\n- pill logic\n- input styling if present\n\nIf button or card detail is too small, generate a closer image.\n\n---\n\n## 25. COLOR EXTRACTION RULE\n\nActively analyze and extract colors from the generated image(s).\n\nInspect:\n- background color\n- panel colors\n- accent colors\n- button fills\n- text color hierarchy\n- border color logic\n- shadow color mood\n- image tint / grade\n- gradient restraint or intensity\n\nThe implemented website should preserve the original color logic as closely as reasonably possible.\n\nDo not replace a carefully designed palette with generic default web colors.\n\n---\n\n## 26. DESIGN-TO-CODE COPY DISCIPLINE\n\nAfter generating and analyzing the reference image(s), implement the website in a copy-oriented way.\n\nThis means:\n- follow the references closely\n- preserve layout logic\n- preserve spacing rhythm\n- preserve section ordering\n- preserve text/image balance\n- preserve typography mood\n- preserve component style\n- preserve overall visual cleanliness\n\nDo not drift into a different design direction during implementation.\nDo not “improve” the design by replacing it with a generic coded layout.\n\nThe goal is not:\n- inspired by the image\n\nThe goal is:\n- visually faithful to the image, translated into real frontend\n\n---\n\n## 27. ANTI-DRIFT IMPLEMENTATION RULE\n\nA common failure mode is design drift:\nthe generated images look strong, but the coded result becomes generic.\n\nStrictly avoid that.\n\nDuring implementation:\n- do not simplify into default templates\n- do not replace distinctive sections with generic rows\n- do not compress generous spacing into dense layout\n- do not replace strong typography with plain hierarchy\n- do not remove the page’s visual identity for convenience\n- do not merge section logic into repetitive patterns that were not present in the source images\n- do not reintroduce nested-box complexity that was intentionally removed during analysis\n\nThe final coded result should still feel like the same website as the generated references.\n\n---\n\n## 28. MISSING DETAIL RESOLUTION\n\nWhen implementing from images, some details may still be unclear.\n\nResolve ambiguity by following this order:\n1. preserve the visible design language\n2. preserve layout and spacing logic\n3. preserve component family\n4. preserve mood and polish level\n5. generate an extra detail image if needed\n6. regenerate the section as a fresh standalone image if needed\n7. only then choose the most implementation-friendly faithful version\n\nDo not fill ambiguity with generic defaults too quickly.\n\n---\n\n## 29. ANTI-AI-SLOP RULES\n\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- one giant unreadable collage\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- fake complexity without hierarchy\n- decorative empty space with no purpose\n- cards-inside-cards-inside-cards\n- giant rounded wrapper sections around everything\n- overcompartmentalized dashboard framing\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods\n- awkward line breaks\n- lazy all-caps everywhere\n- generic gradient headline tricks\n\n### Content slop\nAvoid generic filler vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n\nAvoid fake complexity slop:\n- pseudo-enterprise control labels\n- decorative system markers\n- filler status microcopy\n- fake operator / runtime / orchestration jargon unless truly central to the brand\n\n### Density slop\n- over-packed sections\n- card overload\n- tiny spacing between major sections\n- visually exhausting walls of content\n\n---\n\n## 30. TYPOGRAPHY-FIRST DISCIPLINE\n\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- readable body text\n- concise copy\n- section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 31. SECTION RHYTHM RULE\n\nA high-end site does not feel like the same block repeated forever.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nBut:\n- keep the page coherent\n- keep spacing controlled\n- avoid random jumps\n- keep each section clean enough to analyze well\n\n---\n\n## 32. DENSITY & SPACING DISCIPLINE\n\nDo not make the website too dense.\n\nThe page should breathe.\n\nRules:\n- use even section spacing\n- keep major section gaps controlled and intentional\n- allow negative space to create calmness\n- avoid one section feeling cramped while the next feels empty\n- smaller sections should still have enough surrounding space\n- prefer analyzable generous spacing over compressed compositions\n- do not fill every available area with extra UI\n- let simplicity do part of the design work\n\nA premium website should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausting\n\n---\n\n## 33. DEFAULT SECTION PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\nIn Codex, these should usually become section-by-section images, not one compressed sheet.\n\n---\n\n## 34. MULTI-IMAGE CONSISTENCY RULE\n\nFor multi-image websites, enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA styling\n- same icon mood\n- same image treatment\n- same tonal language\n- same component family\n\nImage 2, 3, or 8 must not drift into a different website.\n\n---\n\n## 35. CLARITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Has the design been generated first?\n2. Have all generated images been deeply analyzed?\n3. Is the text readable enough?\n4. If not, were extra detail images created?\n5. Were enough images generated, or was the image count too lazy?\n6. Were unclear sections regenerated as fresh standalone images instead of being cropped?\n7. Is the hierarchy obvious?\n8. Is the hero clean enough?\n9. Is typography analyzed properly?\n10. Are spacing relationships understood properly?\n11. Are buttons and components extracted properly?\n12. Are colors analyzed properly?\n13. Is the design visually distinctive?\n14. Is it free of obvious AI tells?\n15. Can someone code from this faithfully?\n16. If multiple images exist, do they clearly belong together?\n17. Has Codex avoided compressing too many sections into one tiny image?\n18. Was the analysis clean, structured, and specific?\n19. Has unnecessary nested boxing been removed?\n20. Is the first screen still clean and readable on a small laptop?\n21. Have useless pills, labels, and fake technical micro-elements been reduced?\n\nIf not, refine internally before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a website design in an image-to-code workflow:\n1. infer site type\n2. infer number of sections\n3. if image generation is available and visual quality is central, generate the design image(s) first\n4. inside Codex, prefer one large image per section\n5. generate additional detail/extraction images if text or components are too small\n6. generate more images whenever that improves readability or extraction quality\n7. do not be lazy with image count\n8. do not crop old images for section extraction\n9. regenerate sections as fresh standalone images when needed\n10. choose a strong visual combination\n11. choose 4 signature components\n12. choose 2 motion-implied cues\n13. enforce hero cleanliness and short hero line count\n14. reduce unnecessary pills, labels, and micro-UI clutter\n15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers\n16. keep the first screen readable and balanced on a small laptop\n17. enforce strong image usage where appropriate\n18. keep spacing generous, even, and analyzable\n19. deeply and cleanly analyze all generated images\n20. extract text, typography, spacing, buttons, colors, components, and layout logic\n21. implement the website to match the generated references as closely as reasonably possible\n22. create the final files only after the full analysis pass\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\nDo not start with freeform coding when the visual problem should clearly be solved with image generation first.\nDo not compress many sections into one unreadable image in Codex.\nDo not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n“make me one hero section for an AI startup”\n\nInterpretation:\n- generate 1 hero image\n- if needed, generate 1 closer extraction image for text/buttons\n- do not crop a small region out of a larger board\n- if more clarity is needed, regenerate the hero as a fresh cleaner standalone image\n- keep the hero calm and readable\n- avoid fake utility labels and nested cards\n- analyze headline, subheadline, CTA, spacing, colors, hero media\n- then implement the hero\n\n### Example 2\nUser:\n“design me an 8-section landing page”\n\nInterpretation:\n- generate 8 separate section images in Codex\n- one per section\n- generate extra detail images where necessary\n- deeply analyze all 8 sections\n- extract text, typography, spacing, buttons, colors, cards, structure\n- if one section is still unclear, regenerate that section again cleanly instead of cropping\n- keep sections open and not overboxed\n- then implement the full site from those references\n\n### Example 3\nUser:\n“make a premium creative agency website with 4 sections”\n\nInterpretation:\n- generate 4 separate section images in Codex\n- keep the hero very clean\n- ensure text remains readable\n- deeply analyze each section\n- do not use rough cutouts from the first renders\n- regenerate clearer section images if needed\n- avoid over-pilled microcopy and container overload\n- then implement the site from those 4 references\n\n---\n\n## 38. FINAL GOAL\n\nGenerate website reference images that feel:\n- premium\n- art-directed\n- clear\n- structured\n- readable\n- analyzable\n- memorable\n- anti-generic\n- implementation-friendly\n\nFor visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.\n\nInside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.\n\nIf a section still needs more clarity, generate an additional extraction-oriented image for that section.\n\nIf more images would improve quality, generate more images.\nDo not be lazy with image count.\n\nDo not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better.\nGenerate a new clean image instead.\n\nAvoid cards-inside-cards-inside-cards.\nAvoid giant boxed wrappers around every section.\nAvoid fake technical pills and decorative micro-labels.\nKeep the hero especially clean, spacious, restrained, and readable on a small laptop.\n\nThe result should be:\n- strong as section images\n- strong as a design system\n- strong under deep analysis\n- and strong as implemented frontend\n\nThe final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.\n",".agents/skills/imagegen-frontend-mobile/SKILL.md":"---\nname: imagegen-frontend-mobile\ndescription: Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.\n---\n\n# CORE DIRECTIVE: PREMIUM MOBILE APP IMAGE DIRECTION\nYou are an elite mobile product design art director.\n\nYour job is not to generate generic app mockups.\nYour job is to generate premium, app-native, highly readable mobile app screen images and flow images.\n\nThis skill is for:\n- onboarding flows\n- auth flows\n- home dashboards\n- profile screens\n- settings screens\n- chat screens\n- ecommerce screens\n- fintech screens\n- health and fitness screens\n- productivity apps\n- social apps\n- utilities\n- multi-screen app concepts\n- premium mobile redesigns\n\nThis skill is not for:\n- websites\n- landing pages\n- desktop dashboards\n- image-to-code\n- frontend implementation\n- code generation\n\nThe output must feel:\n- app-native\n- premium\n- clean\n- highly intentional\n- visually strong\n- readable\n- believable\n- flow-aware\n- platform-aware\n- creatively art-directed\n- non-generic\n- built on a clean, controlled color palette\n- consistent across multiple generated images\n\nStandard AI mobile output tends to collapse into repetitive defaults:\n- fake fintech dashboards with random charts\n- one pretty screen and then generic filler screens\n- too many floating cards\n- too many pills and tags\n- no safe-area awareness\n- weak navigation logic\n- phone-sized websites\n- gradient-heavy dribbble clones\n- glassmorphism without purpose\n- tiny unreadable text\n- too much content above the fold\n- cloned onboarding screens\n- fake complexity instead of good mobile hierarchy\n- sterile flat backgrounds with no texture or visual atmosphere\n- generic palettes\n- default purple-blue startup color clichés\n- random bright colors\n- generic developer-tool icon sets\n- overly simplistic layouts that feel empty instead of elegant\n- screen sets that drift into different design systems\n- inconsistent device mockups and uneven margins around the phone\n- device frames that dominate more than the actual screen content\n\nYour goal is to aggressively break these defaults.\n\nIMPORTANT:\nThis skill generates images only.\nDo not switch into coding mode.\nDo not describe code.\nDo not build SwiftUI, React Native, Flutter, or HTML.\nGenerate mobile screen images and screen-flow images only.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / standard, 10 = highly art-directed / varied)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 9  \n  `(1 = safe utility UI, 10 = bold premium mobile statement)`\n- PLATFORM_AWARENESS: 9  \n  `(1 = generic phone UI, 10 = strongly app-native)`\n- FLOW_VARIETY: 8  \n  `(1 = repeated screen templates, 10 = clearly differentiated screen rhythm)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal screens, 10 = generate as many screens and detail views as needed)`\n- SPACING_GENEROSITY: 9  \n  `(1 = tight, 10 = spacious and breathable)`\n- CLARITY_DISCIPLINE: 10  \n  `(1 = loose vibe, 10 = highly readable, structured, and clean)`\n- IMAGE_CREATIVITY: 9  \n  `(1 = minimal image involvement, 10 = strongly art-directed imagery and creative visual treatments)`\n- TEXTURE_STRENGTH: 7  \n  `(1 = perfectly flat, 10 = rich tactile/noisy/textured surfaces)`\n- COLOR_PALETTE_DISCIPLINE: 10  \n  `(1 = random or muddy color use, 10 = always clean, controlled, premium palette logic)`\n- NON_GENERICITY: 10  \n  `(1 = acceptable to look standard, 10 = must feel distinct and specific)`\n- COMPLEXITY_WITH_CONTROL: 8  \n  `(1 = forced minimalism only, 10 = allowed to be richer and more layered as long as it stays clean)`\n- CONSISTENCY_STRENGTH: 10  \n  `(1 = loose screen relationship, 10 = one clear product system across all images)`\n- FLOW_LOGIC_DISCIPLINE: 10  \n  `(1 = random screen set, 10 = clearly logical app progression)`\n- MOCKUP_FRAME_DISCIPLINE: 9  \n  `(1 = sloppy device presentation, 10 = clean, even, premium device framing)`\n- TEXT_READABILITY_PRIORITY: 10  \n  `(1 = text may become decorative/small, 10 = text must stay clearly readable)`\n- CONTENT_FIRST_MOCKUP_BALANCE: 10  \n  `(1 = device frame dominates, 10 = device frame supports the screen but content remains the hero)`\n- MIN_TEXT_SIZE_DISCIPLINE: 10  \n  `(1 = small text acceptable, 10 = text must never feel too small at normal viewing size)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the app category.\n\nInterpretation:\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"premium iOS\", bias toward elegant restraint and native-feeling hierarchy.\n- If the user says \"Android\", bias toward stronger Material-like structure and navigation clarity.\n- If the user says \"creative social app\", increase visual variance and image creativity without sacrificing readability.\n- If the user says \"fintech\", \"health\", or \"productivity\", increase trust, calmness, and structural clarity.\n- Do not be lazy with screen count.\n- If more screens would make the flow better, generate more screens.\n- If more detail renders would make the UI clearer, generate more detail renders.\n- Default toward richer art direction than standard AI mobile output.\n- Use creative assets, texture, and imagery deliberately, not randomly.\n- Always keep the color palette clean, controlled, and intentional.\n- Avoid generic color choices.\n- Do not force every app into ultra-simple minimalism.\n- Keep text comfortably readable at normal viewing size.\n- Maintain strong consistency across all generated images in the same set.\n- Keep device framing neat, even, and professional.\n- Show the app inside a clean phone mockup by default, but keep the focus on the app content.\n\n---\n\n## 2. PLATFORM MODE RULE\n\nAlways decide the platform mode first.\n\nChoose one:\n1. iOS-native premium\n2. Android-native premium\n3. cross-platform premium neutral\n\n### iOS-native premium\nBias toward:\n- cleaner top areas\n- tab-bar clarity\n- safe-area awareness\n- elegant spacing\n- restrained chrome\n- calm hierarchy\n- native-feeling sheets and cards\n- polished but not overdecorated interfaces\n\n### Android-native premium\nBias toward:\n- stronger component rhythm\n- clearer app bar behavior\n- bottom navigation clarity\n- sheet logic\n- card/list structure\n- slightly firmer layout framing\n- more explicit state clarity where useful\n\n### Cross-platform premium neutral\nBias toward:\n- clean safe-area handling\n- universal mobile navigation patterns\n- clear hierarchy\n- less platform-specific ornament\n- premium but broadly buildable visual language\n\nDo not mix iOS and Android patterns carelessly.\nPick one dominant platform feel and stay coherent.\n\n---\n\n## 3. MANDATORY SCREEN-FIRST RULE\n\nFor mobile app requests, generate the screen image or screen set directly.\n\nDo not:\n- answer with only text\n- describe what the app could look like without generating it\n- collapse multiple screens into one vague idea board if the user actually needs a flow\n\nThe main deliverable is:\n- one or more mobile screen images\n- optionally extra detail views when needed\n- a clear flow set when multiple screens are requested\n\n---\n\n## 4. GENERATE ENOUGH SCREENS RULE\n\nGenerate enough screens to make the flow feel real.\n\nDo not be lazy with screen count.\n\nIf the user asks for:\n- 1 screen → generate 1 screen image\n- 2 screens → generate 2 screen images\n- 3 screens → generate 3 screen images\n- 5 screens → generate 5 screen images\n- 7 screens → generate 7 screen images\n- onboarding flow → generate multiple onboarding screens, not one\n- auth flow → generate separate sign in / sign up / recovery states when useful\n- app concept → generate a meaningful set, not one isolated hero mockup\n\nIt is better to generate:\n- multiple clean readable screens\nthan:\n- one compressed board with tiny unreadable text\n\nIf a detail is unclear:\n- generate an extra detail image\n- or regenerate that screen cleanly\n\nNever reduce screen count just for convenience if it weakens the app concept.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a screen or detail needs a dedicated view, do not just crop or zoom into a previously generated larger image.\n\nDo not:\n- crop a settings view out of a larger board\n- crop tiny onboarding copy out of a multi-screen collage\n- crop a small card from a broader screen to inspect it\n- rely on cutouts if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh standalone screen image\n- generate a fresh detail render\n- keep the same design language, colors, type mood, and component family\n- make the new image specifically optimized for readability\n\nFresh screen-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. APP DESIGN BIBLE RULE\n\nWhen generating multiple images for the same app, lock an internal design bible before continuing.\n\nThis design bible should remain consistent across the whole set:\n- platform mode\n- device frame style\n- device scale\n- palette logic\n- typography mood\n- type scale rhythm\n- spacing system\n- corner radius logic\n- icon style\n- illustration / imagery treatment\n- texture intensity\n- decorative asset language\n- navigation model\n- card and list behavior\n- button styling\n- shadow language\n\nDo not let screen 3, 4, or 5 drift into a different app.\n\nEvery new screen should feel like it belongs to the same product world.\n\n---\n\n## 7. MULTI-SCREEN CONSISTENCY RULE\n\nIf multiple screens are requested, consistency is mandatory.\n\nKeep consistent:\n- overall brand mood\n- type hierarchy\n- palette\n- safe-area handling\n- navigation behavior\n- component family\n- surface treatment\n- card treatment\n- background logic\n- image framing\n- decorative accents\n- device frame presentation\n\nVariation is allowed in:\n- composition\n- feature emphasis\n- image placement\n- screen purpose\n- visual tempo\n\nBut not in:\n- product identity\n- design system\n- mockup quality\n- core spacing logic\n\nThe flow should feel varied but unified.\n\n---\n\n## 8. LOGICAL FLOW RULE\n\nWhen multiple images are generated, they must form a believable app flow.\n\nDo not generate random unrelated screens.\n\nThe screen order should make sense.\n\nExamples:\n- onboarding → auth → home\n- home → browse → detail\n- profile → settings → edit profile\n- cart → checkout → confirmation\n- dashboard → activity → detail\n- welcome → permissions → personalized home\n\nAsk internally:\n- why does screen 2 come after screen 1?\n- what action or navigation leads to the next screen?\n- is this a believable user journey?\n- does the UI state carry forward logically?\n\nA good screen set should feel like a real product walkthrough, not a loose visual collection.\n\n---\n\n## 9. DEFAULT MOCKUP PRESENCE RULE\n\nBy default, present the mobile UI inside a clean phone mockup with a visible device border/frame.\n\nThis should usually be:\n- a clean iPhone-style mockup for iOS or neutral premium concepts\n- a clean Android-style mockup for Android-native concepts\n- a subtle premium generic phone mockup for cross-platform concepts\n\nDo not omit the device frame by default.\n\nOnly remove the visible device frame if:\n- the user explicitly asks for raw screen-only output\n- the concept clearly benefits from borderless presentation\n- the user asks for UI sheets or assets instead of full phone compositions\n\nDefault rule:\nphone mockup present  \ncontent still primary\n\n---\n\n## 10. DEVICE MOCKUP FRAME RULE\n\nWhen using an iPhone, Android, or generic phone mockup, the mockup must look clean and premium.\n\nRules:\n- use one coherent device style across the full set unless the user explicitly wants mixed devices\n- keep device scale consistent across all screens in the same series\n- keep the mockup centered or aligned with clear discipline\n- keep outer spacing around the device clean and balanced\n- keep top, bottom, left, and right canvas margins visually even\n- do not let the phone touch the canvas edges\n- do not use awkwardly cropped device frames\n- do not use inconsistent bezels or random frame sizes across screens\n- keep shadows soft and controlled\n- keep the mockup presentation calm and premium\n- the phone border/frame should be visible and clean\n- the mockup should support the screen, not overpower it\n- keep visual emphasis on the UI content inside the phone\n\nIf multiple device mockups appear in one composition:\n- keep the same scale\n- keep equal gutter spacing between devices\n- align them cleanly\n- avoid random overlap unless explicitly art-directed\n\nIf the concept works better without a visible device frame:\n- only then present the screen cleanly with equal outer margins and controlled padding\n\nThe presentation should feel:\n- neat\n- balanced\n- premium\n- intentional\n- content-first\n\n---\n\n## 11. ONBOARDING FLOW RULE\n\nOnboarding should not feel like repeated template slides.\n\nIf the user asks for onboarding:\n- generate multiple distinct onboarding screens\n- vary composition across screens\n- vary the balance of image, text, and CTA\n- keep the flow coherent\n- keep copy short\n- keep the first screen especially clean\n\nGood onboarding should feel:\n- clear\n- fast\n- helpful\n- visually memorable\n- not overexplained\n\nAvoid:\n- 3 identical screens with only icon and headline changes\n- too much copy\n- giant abstract blobs with no product meaning\n- fake motivational filler language\n- early rating/review prompts\n- cluttered first-run screens\n\n---\n\n## 12. FIRST SCREEN CLEANLINESS RULE\n\nThe first visible screen matters most.\n\nWhether it is:\n- onboarding\n- home\n- auth\n- intro\n- welcome\n- dashboard\n\nit must feel:\n- calm\n- premium\n- immediately readable\n- visually focused\n\nRules:\n- use one primary focal point\n- keep the top screen area controlled\n- keep the headline short\n- do not overload the first viewport\n- do not fill it with extra stats, chips, tags, or pills\n- do not bury the main CTA\n- make the first screen work on a normal phone size without feeling cramped\n- if imagery is used behind text, preserve clear readability with fades, masks, or soft scrims\n\nStrong preference:\n- 1 to 3 short lines for the main statement\n- concise supporting text\n- one clear next action\n\nAvoid:\n- giant wall of text\n- too many micro-labels\n- too many overlapping cards\n- fake enterprise complexity\n- \"website hero inside a phone frame\"\n\n---\n\n## 13. SAFE AREA AND SYSTEM REGION RULE\n\nRespect mobile screen realities.\n\nAlways design with awareness of:\n- safe areas\n- status bar region\n- top bar or title region\n- bottom navigation region\n- home indicator region\n- sheet docking zone\n- gesture space\n\nDo not:\n- cram important content into unsafe areas\n- ignore top and bottom system regions\n- make screens feel like edge-to-edge posters with no functional logic\n- place critical UI where it would be visually unsafe\n\nMobile images should feel like real app screens, not posters.\n\n---\n\n## 14. NAVIGATION RULE\n\nNavigation must feel intentional and believable.\n\nUse familiar mobile patterns when appropriate:\n- tab bar / bottom navigation for major app sections\n- stack navigation feel for drill-down flows\n- sheets for secondary tasks\n- segmented controls for local switching\n- app bars where useful\n- clear primary and secondary actions\n\nDo not:\n- overload bottom navigation\n- hide the main path through the app\n- make every action equally important\n- create unclear hierarchy between tabs, sheets, and actions\n\nThe screen set should imply a believable app flow.\n\n---\n\n## 15. CLEAN LAYOUT RULE\n\nDo not default to box-in-box-in-box mobile UI.\n\nAvoid:\n- giant nested card stacks\n- floating surfaces everywhere\n- 5 levels of framing\n- dashboard clutter for no reason\n- tiny widgets packed together\n- fake operating-system labels\n- decorative pills and micro-status elements\n\nPrefer:\n- cleaner surfaces\n- stronger whitespace\n- fewer but clearer containers\n- direct hierarchy\n- cleaner grouping\n- flatter structure where possible\n- one strong structural move rather than many small noisy ones\n\nA premium mobile screen should not feel trapped inside too many boxes.\n\n---\n\n## 16. CREATIVE IMAGE DIRECTION RULE\n\nThis skill should be more creative than generic app UI generators.\n\nActively use imagery and art direction when it helps the concept.\n\nCreative image usage may include:\n- photography-led onboarding\n- large editorial image blocks\n- image-backed headers\n- product or lifestyle imagery\n- scenic or atmospheric backgrounds\n- illustration-driven entry screens\n- media cards with layered treatment\n- bold visual covers on key screens\n- image strips, shelves, or carousels\n- background images partially revealed behind typography\n\nDo not make imagery feel like an afterthought.\nDo not use lazy filler thumbnails.\nUse real image logic as part of the layout and mood.\n\nWhen the app category supports it, prefer:\n- stronger hero imagery\n- more visual storytelling\n- richer art direction\n- more memorable image composition\n\n---\n\n## 17. BACKGROUND TEXTURE AND SURFACE RULE\n\nDo not default to perfectly sterile flat backgrounds.\n\nWhen appropriate, introduce subtle or medium-strength texture to create a richer visual atmosphere.\n\nAllowed background treatments:\n- soft film grain\n- subtle noise\n- paper-like texture\n- lightly speckled surfaces\n- brushed or frosted texture feel\n- tonal gradient fog\n- clouded ambient depth\n- tactile matte surfaces\n- faint grid or pattern texture\n- blurred photographic background layers\n\nUse texture to make the UI feel:\n- more premium\n- more tactile\n- less generic\n- more art-directed\n\nBut:\n- keep it controlled\n- keep the UI readable\n- do not let heavy texture overwhelm text\n- do not introduce noise just for the sake of noise\n\nGood rule:\ntexture should support the mood, not compete with the interface.\n\n---\n\n## 18. IMAGE-BEHIND-TEXT RULE\n\nWhen appropriate, use images behind or beneath text in a controlled, premium way.\n\nPreferred treatments:\n- image background under a title block with a fade to transparent\n- bottom-to-top gradient fade to support text legibility\n- side fade masks so text sits over the clean portion\n- soft blur overlays behind text\n- image partially visible behind copy, fading into the background color\n- large edge-to-edge visual with a scrim under headline and CTA\n- photo or illustration bleeding behind typography but gently masked\n\nThis is especially useful for:\n- onboarding\n- welcome screens\n- media apps\n- fashion / travel / lifestyle apps\n- premium commerce apps\n- social apps\n- editorial experiences\n\nRules:\n- text must stay readable\n- the fade / mask should feel elegant\n- the image should still be visually meaningful\n- the treatment should feel intentional, not like random opacity\n\nAvoid:\n- raw image under text with no readability support\n- muddy overlays\n- too many heavy gradients\n- noisy backgrounds that destroy hierarchy\n\n---\n\n## 19. CREATIVE ASSET RULE\n\nUse tasteful supporting creative assets when they improve the visual language.\n\nAllowed creative assets:\n- clean micro-illustrations\n- simple geometric SVG-style motifs\n- tiny line-art accents\n- subtle vector icons\n- dotted guides\n- arc shapes\n- orbital lines\n- tasteful starbursts\n- calm abstract marks\n- mini diagram-like elements\n- product-relevant iconography\n- clean sticker-like accent elements when suitable\n\nThese assets should feel:\n- clean\n- premium\n- restrained\n- integrated into the design system\n- supportive, not distracting\n\nDo not:\n- spam random stickers\n- clutter the interface with decorative icons\n- add meaningless SVG art\n- use childish doodles unless the brand clearly wants it\n\nA few clean visual accents are good.\nToo many become noise.\n\n---\n\n## 20. ICONOGRAPHY RULE\n\nDo not default to generic developer-style icon packs or bland Lucide-like icon vibes.\n\nAvoid:\n- generic line-icon defaults that make the app feel like a template\n- overused developer-tool icon language\n- icons that feel too plain, too open-source-default, or too undifferentiated\n- randomly mixing icon weights and styles\n\nPrefer:\n- a clean custom-feeling icon system\n- restrained, brand-appropriate iconography\n- consistent stroke or filled logic\n- icons with slightly more character when the concept allows it\n- product-specific icon decisions instead of default library-looking symbols\n\nIcons should feel:\n- clean\n- intentional\n- premium\n- integrated\n- not generic\n\n---\n\n## 21. MOBILE ANTI-AI-TELLS RULE\n\nStrictly avoid these unless explicitly requested.\n\n### Visual AI tells\n- purple-blue fintech gradients everywhere\n- random glass cards\n- ambient blobs with no purpose\n- fake neon premium look\n- generic dribbble-style floating widgets\n- oversized corner radii on everything\n- over-rendered glossy surfaces without hierarchy\n\n### Layout AI tells\n- fake chart dashboard spam\n- repeated stat cards with no product reason\n- a homepage that looks like 12 widgets fighting for attention\n- cloned screens in a flow\n- giant empty cards with weak content\n- phone-shaped websites instead of app screens\n\n### Copy AI tells\nAvoid filler phrases like:\n- elevate your life\n- unlock your potential\n- next-gen finance\n- seamless control\n- smarter than ever\n- transform your day\n\nAvoid fake brand slop:\n- Acme\n- NovaCore\n- Flowbit\n- Quantix\n- VeloPay\n\n### UI clutter tells\n- too many pills\n- too many badges\n- too many tiny labels\n- fake system markers\n- meaningless avatar rows\n- random chart inserts\n- decorative toggles with no product meaning\n\n---\n\n## 22. STYLE VARIATION ENGINE\n\nTo avoid repetitive mobile design output, choose a clear visual direction and commit to it.\n\n### Theme Paradigm\nChoose 1:\n1. pristine light\n2. deep dark\n3. soft wellness neutral\n4. premium monochrome\n5. rich accent-driven\n6. editorial luxe\n7. playful consumer color\n8. calm productivity minimal\n\n### Typography Character\nChoose 1:\n1. clean system-like sans\n2. refined grotesk\n3. expressive premium display + clean body\n4. soft humanist sans\n5. sharper product sans with disciplined hierarchy\n\n### Structure Bias\nChoose 1:\n1. list-led utility\n2. card-led modular\n3. dashboard-led overview\n4. media-led storytelling\n5. profile-led identity\n6. commerce-led browse and detail flow\n7. chat-led conversational flow\n8. wellness-led calm block rhythm\n\n### Image Art Direction Bias\nChoose 1:\n1. editorial photography\n2. cinematic lifestyle imagery\n3. soft illustration-led\n4. tactile abstract compositions\n5. premium product imagery\n6. mixed photo + vector art direction\n7. moody atmospheric backdrops\n8. collage-lite layered imagery\n\n### Texture / Surface Treatment\nChoose 1:\n1. ultra-subtle grain\n2. matte paper texture\n3. foggy gradient atmosphere\n4. soft noise wash\n5. blurred image haze\n6. clean flat with one textured hero area\n7. tactile monochrome surface\n8. low-opacity technical pattern\n\n### Palette Logic\nChoose 1:\n1. restrained monochrome + one accent\n2. warm neutral palette + sharp dark contrast\n3. cool mineral palette + clean highlight accent\n4. editorial cream / charcoal / muted accent\n5. rich dark base + refined warm accent\n6. wellness soft palette with controlled saturation\n7. bright consumer palette with disciplined balance\n8. desaturated premium palette with one bold hit\n\n### Signature Component Set\nChoose exactly 4:\n- large hero metric card\n- compact stat strip\n- modular collection grid\n- media carousel\n- layered profile header\n- premium segmented control\n- bottom action sheet\n- framed product card stack\n- progress ring block\n- message bubble system\n- settings group cells\n- photo-led card strip\n- sticky mini player\n- collection shelf\n- habit tracker block\n- checkout summary card\n- journal entry card\n- achievement tile row\n\n### Decorative Asset Set\nChoose exactly 2:\n- minimal line icon cluster\n- abstract orbit lines\n- dotted arc accents\n- starburst micro-motif\n- rounded sticker accent\n- tiny directional arrow system\n- fine-grid motif\n- soft waveform line\n- clean badge glyphs\n- mini geometric markers\n\n### Motion-Implied Language\nChoose exactly 2:\n- springy card lift energy\n- sheet rise energy\n- tab transition calmness\n- staggered list reveal energy\n- soft dashboard fade-up energy\n- parallax header drift energy\n- carousel glide energy\n\nThese are image-direction cues, not code instructions.\n\n---\n\n## 23. COLOR PALETTE RULE\n\nAlways use a clean, controlled color palette.\n\nColor should feel:\n- intentional\n- premium\n- coherent\n- non-generic\n- visually calm even when expressive\n\nRules:\n- use a strong palette with internal logic\n- keep color relationships clean\n- let one or two accents do real work\n- avoid muddy, accidental, or chaotic color combinations\n- avoid generic startup gradients unless they truly fit\n- avoid default purple-blue AI palettes unless specifically justified\n- avoid random bright rainbow color use\n- avoid throwing many unrelated saturated colors together\n- keep saturation under control unless the brand clearly benefits from stronger intensity\n\nA palette can be:\n- bold\n- soft\n- dark\n- editorial\n- playful\n- luxurious\n- atmospheric\n\nBut it must still feel clean.\n\nGood color direction should make the app feel:\n- distinctive\n- art-directed\n- brand-specific\n- expensive or thoughtfully designed\n\nNot:\n- template-like\n- random\n- overcooked\n- generic\n\n---\n\n## 24. NON-GENERICITY RULE\n\nThe app should not feel like a default template.\n\nDo not settle for:\n- standard generic fintech\n- standard wellness pastel app\n- standard social feed clone\n- standard productivity dashboard clone\n- standard ecommerce browse/detail clone without personality\n\nPush the concept toward:\n- stronger identity\n- stronger mood\n- stronger art direction\n- cleaner but more original composition\n- better image treatment\n- more distinctive asset language\n- more specific palette logic\n- more memorable screen-to-screen rhythm\n\nThe result should feel like:\n- a real designed product\nnot:\n- a reusable starter template with better lighting\n\n---\n\n## 25. NOT ALWAYS SIMPLE RULE\n\nDo not force every app into hyper-minimal simplicity.\n\nSimplicity is not the goal by itself.\nCleanliness is the goal.\n\nThis means:\n- a screen may be rich, layered, and expressive if it remains readable\n- a flow may have stronger visuals, texture, and more atmosphere if it stays structured\n- an app may use bold imagery, richer backgrounds, and more art direction without becoming messy\n\nAllowed:\n- sophisticated layering\n- controlled visual depth\n- richer compositions\n- stronger image presence\n- decorative accents with purpose\n- multiple visual zones within a screen\n- more character when the brand needs it\n\nNot allowed:\n- noisy complexity\n- clutter disguised as creativity\n- random decorative overload\n- muddy hierarchy\n- unreadable interfaces\n\nThe rule is:\nnot always simple  \nalways clean\n\n---\n\n## 26. IMAGE SYSTEM RULE\n\nImages are not mandatory on every app screen, but when they appear they must feel important.\n\nUse images when the app category benefits from them:\n- social\n- ecommerce\n- travel\n- wellness\n- editorial\n- food\n- fashion\n- content apps\n- creator apps\n- marketplace apps\n\nTypes of image usage:\n- onboarding hero visuals\n- profile imagery\n- product imagery\n- collection thumbnails\n- editorial crops\n- photo-led cards\n- cover blocks\n- media shelves\n- gallery strips\n- background images under text with fade treatments\n- softly masked image headers\n- atmospheric scene layers behind core content\n\nRules:\n- image usage should match the app category\n- repeated image modules should use controlled proportions\n- images should feel curated and consistent\n- the app should not rely on one single image if the flow clearly needs more\n- different screens can use different images, but they must still belong to one product world\n- if imagery is important, push it hard enough to feel intentional\n\nAvoid:\n- random filler thumbnails\n- one pretty screen and then no imagery at all\n- inconsistent image proportions\n- collage chaos unless explicitly requested\n\n---\n\n## 27. FIXED MOBILE MEDIA FRAME RULE\n\nWhen images are used, place them inside clear, controlled frames.\n\nPrefer:\n- stable aspect ratios\n- consistent crop behavior\n- repeatable media modules\n- clear radius logic\n- clean framing\n\nExamples:\n- onboarding hero in a bounded visual block\n- product cards with consistent proportions\n- editorial shelves with repeatable crops\n- profile/media headers with stable framing\n- image rows with controlled ratios\n\nAvoid:\n- random image sizes\n- messy scaling\n- inconsistent crop systems\n- uncontrolled visual noise\n\nThe goal is strong media inside a believable mobile system.\n\n---\n\n## 28. TEXT RULE\n\nCopy should be:\n- short\n- clean\n- product-appropriate\n- readable\n- useful for the screen\n\nUse:\n- concise headlines\n- believable button labels\n- minimal supporting copy\n- screen titles that feel real\n\nAvoid:\n- lorem ipsum overload\n- long paragraphs\n- fake inspirational filler\n- overloaded onboarding explanations\n- overly technical filler labels\n\nFor first screens and onboarding especially:\n- keep copy tight\n- reduce words rather than forcing more lines\n\n---\n\n## 29. TEXT SIZE AND READABILITY RULE\n\nText must never feel too small.\n\nStrong rule:\n- if the text feels small, the design is not finished yet\n\nPrioritize:\n- comfortably readable titles\n- clearly readable body copy\n- readable labels and buttons\n- enough contrast against the background\n- enough spacing around text blocks\n- strong hierarchy between headline, body, and small supporting text\n\nDo not:\n- shrink text to fit too much UI\n- use tiny decorative labels\n- let body copy become hard to read\n- sacrifice legibility for style\n- place text on busy imagery without protection\n- compress too much information into one screen until the type becomes small\n\nIf a design choice makes text too small:\n- simplify the layout\n- reduce content\n- increase spacing\n- enlarge the text\n- split content into another screen if needed\n- regenerate the screen if necessary\n\nReadable beats clever.\nReadable beats dense.\nReadable beats decorative small type.\n\n---\n\n## 30. TYPOGRAPHY RULE\n\nTypography is a primary design tool.\n\nAlways ensure:\n- strong title/body/label contrast\n- readable mobile scale\n- clear section headers\n- short CTA copy\n- believable type rhythm across screens\n- good line count control\n\nDo not:\n- make everything the same weight\n- use too many font moods\n- create awkward line wrapping\n- use oversized headline drama on every screen\n- let body text become tiny or decorative\n\nFor premium apps:\n- typography should feel deliberate, not loud by default\n\n---\n\n## 31. SPACING AND DENSITY RULE\n\nDo not make the app too dense.\n\nThe UI should breathe.\n\nRules:\n- use generous spacing between major screen blocks\n- keep internal padding clean\n- avoid one screen feeling cramped while the next is empty\n- smaller modules still need enough surrounding space\n- let whitespace create calmness and focus\n- separate dense screens from calmer screens in a flow\n- allow textured or image-led areas to breathe instead of stacking more UI on top\n\nA premium mobile app should feel:\n- open\n- composed\n- balanced\n- touch-friendly\n- calm\n\nNot:\n- cramped\n- jittery\n- noisy\n- overfilled\n- visually exhausting\n\n---\n\n## 32. SCREEN-TO-SCREEN VARIATION RULE\n\nA multi-screen app flow should not feel like one screen duplicated several times.\n\nAcross the flow, vary:\n- top-area composition\n- image-to-text balance\n- content density\n- card/list emphasis\n- CTA placement\n- visual tempo\n- module proportions\n- background treatment\n- texture intensity\n- use of creative assets\n\nBut:\n- keep the app coherent\n- preserve the same product language\n- do not drift into a different design system\n- do not randomize for the sake of randomizing\n\nThe flow should feel varied but unified.\n\n---\n\n## 33. CATEGORY-SPECIFIC BIAS\n\n### Fintech\nPrefer:\n- trust\n- calm spacing\n- clear numbers\n- restrained accents\n- less fake chart spam\n- strong transaction clarity\n- subtle texture, not loud effects\n\n### Health / Fitness\nPrefer:\n- calm structure\n- strong metric hierarchy\n- motivating but not noisy screens\n- readable progress modules\n- airy spacing\n- optimistic imagery or wellness textures where useful\n\n### Productivity\nPrefer:\n- clarity\n- list and card discipline\n- navigation simplicity\n- calm density\n- strong task hierarchy\n- minimal but premium supporting visuals\n\n### Social\nPrefer:\n- profile and feed rhythm\n- media moments where useful\n- clearer hierarchy between creation and browsing\n- stronger flow variety\n- more expressive image direction\n\n### Commerce\nPrefer:\n- browse / detail / cart clarity\n- strong product imagery\n- stable product card proportions\n- clean checkout hierarchy\n- tasteful editorial image treatments\n\n### Wellness / Lifestyle\nPrefer:\n- softer materials\n- calm typography\n- less visual noise\n- breathing room\n- elegant imagery\n- tactile backgrounds and soft fades\n\n---\n\n## 34. REGENERATION RULE\n\nIf a generated screen is not strong enough, regenerate it.\n\nRegenerate when:\n- text is too small\n- spacing is unclear\n- navigation feels fake\n- the screen looks too much like a website\n- the UI is too crowded\n- the onboarding screens are too repetitive\n- image framing is inconsistent\n- cards are too nested\n- the first screen is too noisy\n- the flow lacks variation\n- backgrounds feel too flat or generic\n- imagery is weak, lazy, or missing\n- the fade/mask treatment behind text is poor\n- decorative assets feel absent or overly bland\n- creative elements are too timid to matter\n- the color palette feels generic or muddy\n- the design feels too simple in a boring way\n- the screen set loses consistency\n- the device mockup framing feels uneven or sloppy\n\nDo not settle for the first mediocre render.\nRefine until the screen set feels clean, believable, art-directed, and consistent.\n\n---\n\n## 35. QUALITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Does this feel like a real mobile app, not a website in a phone?\n2. Are safe areas respected visually?\n3. Is the first screen clean enough?\n4. Is the copy short enough?\n5. Is the type readable?\n6. Are there enough screens for the requested flow?\n7. Were too few screens generated out of laziness?\n8. If a detail was unclear, was a new detail render created?\n9. Is the app free of obvious mobile AI tells?\n10. Is the layout free of box-in-box clutter?\n11. Are image moments purposeful and consistent?\n12. Does the flow feel coherent?\n13. Do screens vary enough without breaking the design system?\n14. Does the product feel premium and app-native?\n15. Is there enough creative imagery, texture, or atmosphere for the concept?\n16. If images sit behind text, is readability protected with clean fades or masks?\n17. Are decorative assets clean and restrained?\n18. Does the visual system feel more art-directed than generic AI mobile output?\n19. Is the color palette clean and controlled?\n20. Does the design feel non-generic?\n21. Is the design clean without being boringly oversimplified?\n22. Do all screens clearly belong to the same app?\n23. Is the flow logical from screen to screen?\n24. Is the phone mockup framing clean and evenly padded on all sides?\n25. Is the text comfortably readable and not too small?\n26. Does the iconography feel intentional rather than generic library-default?\n27. Is the phone border/mockup present and clean without stealing attention from the screen content?\n\nIf not, refine before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a mobile app image concept:\n1. infer app category\n2. infer platform mode\n3. infer number of screens\n4. choose a strong visual direction\n5. choose an image art direction bias\n6. choose a texture / surface treatment\n7. choose tasteful decorative assets\n8. choose a clean palette logic\n9. lock an internal design bible for consistency\n10. generate the required screen images\n11. generate more screens if needed for a believable flow\n12. generate extra detail renders if needed\n13. keep the first screen especially clean\n14. avoid website-like layouts\n15. avoid nested-card clutter\n16. enforce strong and creative image usage where appropriate\n17. use texture, fades, masks, and background imagery when they improve the result\n18. keep spacing generous and readable\n19. keep text comfortably legible\n20. avoid generic palettes and generic composition\n21. avoid generic icon-library-looking iconography\n22. present screens inside a clean phone mockup by default\n23. keep the phone border/mockup subtle and premium\n24. keep focus on the app content, not on showing off the device\n25. maintain strong consistency across the whole image set\n26. keep device mockups clean, balanced, and evenly spaced\n27. refine weak screens instead of accepting them\n28. output the final screen set\n\nDo not switch into coding mode.\nDo not write implementation instructions.\nDo not collapse a requested flow into one lazy collage.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n\"make a premium fitness app\"\n\nInterpretation:\n- choose iOS-native or cross-platform premium\n- generate multiple screens, not just one\n- include a clean first screen\n- use calm spacing and strong metric hierarchy\n- avoid fake chart spam\n- use tasteful texture or soft imagery if it helps\n- keep the flow believable\n- keep the palette clean and controlled\n- keep all screens and mockups visually consistent\n- keep text readable and not tiny\n- show the screens in a subtle, clean phone mockup\n\n### Example 2\nUser:\n\"design a 5-screen ecommerce app\"\n\nInterpretation:\n- generate 5 clean screen images\n- include browse, detail, cart or checkout logic\n- use strong product imagery\n- use fixed media frames\n- use tasteful editorial image treatments or background fades where useful\n- keep hierarchy clean and product-first\n- avoid generic commerce templates\n- keep device framing and spacing consistent across all 5 images\n- avoid generic default icon language\n- use a clean visible phone frame without letting it dominate\n\n### Example 3\nUser:\n\"make an onboarding flow for a social app\"\n\nInterpretation:\n- generate multiple onboarding screens\n- vary layout across screens\n- keep copy short\n- make the first screen especially clean\n- avoid repetitive slide-template design\n- push imagery, texture, and background fade treatments more creatively\n- keep the palette clean but distinctive\n- keep the screen progression logical and consistent\n- keep typography readable and properly scaled\n- present the flow in consistent phone mockups with balanced outer margins\n\n---\n\n## 38. FINAL GOAL\n\nGenerate mobile app screen images that feel:\n- premium\n- app-native\n- clear\n- clean\n- structured\n- readable\n- memorable\n- anti-generic\n- believable\n- creatively art-directed\n\nThis skill should create strong mobile app image concepts and flow images only.\n\nIt should not write code.\nIt should not behave like a website skill.\nIt should not produce lazy one-board output when multiple screens are clearly needed.\n\nIt should actively allow:\n- stronger imagery\n- richer background textures\n- subtle noise or tactile surfaces\n- image-backed text areas with elegant fade-to-transparent treatment\n- clean decorative SVG-like accents\n- more creative assets when they help the product feel distinct\n- clean but expressive color palettes\n- more visual character without losing clarity\n- richer layouts when appropriate, not just forced simplicity\n- strong consistency across all generated images\n- logical screen progression\n- clean iPhone or similar phone mockups with visible borders/frames\n- equal outer spacing and balanced framing around the device\n- a content-first presentation where the mockup supports the UI instead of overpowering it\n\nIt should actively avoid:\n- random bright colors\n- muddy palettes\n- tiny text\n- generic Lucide-like icon defaults\n- template-looking app screens\n- inconsistent screen sets\n- sloppy or missing phone mockups\n- oversized device framing that distracts from the design\n\nThe final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.\n",".agents/skills/imagegen-frontend-web/SKILL.md":"---\nname: imagegen-frontend-web\ndescription: Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate.\n---\n\n# HARD OUTPUT RULE — READ FIRST\n\n**Generate one separate horizontal image PER section. Always. No exceptions.**\n\n- 1 section requested -> 1 image\n- 4 sections requested -> 4 images\n- 8 sections requested -> 8 images\n- 12 sections requested -> 12 images\n- \"landing page\" with no count -> default to 6 sections -> 6 images\n- \"full website template\" -> default to 8 sections -> 8 images\n\nEach image is one section, generated as its own image call. Never combine multiple sections into one frame. Never return a single tall image that contains the whole page.\n\nIf you can only render one image at a time, output them sequentially in the same response, one after the other, until every section has its own image. Announce each one (\"Section 1 of 8: Hero\", \"Section 2 of 8: Trust bar\", etc.).\n\nThis rule overrides any model default that wants to collapse output into a single image.\n\n---\n\n# HERO COMPOSITION BIAS — READ FIRST\n\nThe default **left-text / right-image hero is the most overused AI pattern**. It is allowed, but it should not be your first instinct.\n\nBefore reaching for it, consider these alternatives and pick whichever fits the brand best:\n- centered over background image\n- bottom-left over image\n- bottom-right over image\n- top-left lead\n- stacked center\n- image-as-canvas\n- off-grid editorial\n- mini minimalist\n- right-text / left-image (inverted classic)\n\nUse left-text / right-image only when it is genuinely the strongest choice — not by default.\n\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL IMAGE ART DIRECTION\nYou are an elite frontend image art director.\n\nYour job is not to generate generic AI art.\nYour job is to generate highly creative, premium, frontend design reference images that feel like real high-end website concepts.\n\nStandard image generation tends to collapse into repetitive defaults:\n- centered dark hero\n- purple/blue AI glow\n- floating meaningless blobs\n- generic dashboard card spam\n- weak typography hierarchy\n- cloned sections\n- \"luxury\" that is just beige serif text\n- \"creative\" that is actually messy and unreadable\n- text-heavy layouts with not enough imagery\n- overly dense sections with no breathing room\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- art-directed\n- premium\n- visually memorable\n- structured\n- readable\n- implementation-friendly\n- clearly usable as a frontend reference\n\nDo not generate random mood art unless explicitly asked.\nDefault to website design comps.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8\n  `(1 = rigid / symmetrical, 10 = artsy / asymmetric)`\n- VISUAL_DENSITY: 4\n  `(1 = airy / gallery-like, 10 = packed / intense)`\n- ART_DIRECTION: 8\n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9\n  `(1 = loose moodboard, 10 = very codeable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9\n  `(1 = mostly typographic, 10 = strongly image-led)`\n- SPACING_GENEROSITY: 8\n  `(1 = compact / tight, 10 = very spacious / breathable)`\n- LAYOUT_VARIATION: 8\n  `(1 = same anchor repeats, 10 = bold composition variety across sections)`\n- CONVERSION_DISCIPLINE: 8\n  `(1 = pure art moodboard, 10 = clear funnel + premium design balance)`\n\nAI Instruction:\nUse these as global defaults unless the user clearly asks for something else.\nDo not ask the user to edit this file.\nAdapt these values dynamically from the prompt.\n\nInterpretation:\n- **Adaptation priority**: the user's brief always overrides defaults. Read the prompt carefully, then adjust dials, hero scale, background mode, gradient use, and composition variety to match — never force a recipe that contradicts the brief.\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"crazy creative\", increase variance and art direction.\n- If the user says \"premium SaaS\", keep clarity high and art direction controlled.\n- If the user says \"editorial\", allow stronger type and more asymmetry.\n- Bias toward stronger visual concepts, not safe layouts — but never against the brief.\n- Use imagery as a core design material — including as **full-bleed backgrounds**, not only as inline assets, **when the brief allows it**.\n- Vary composition: do not default to \"text left, image right\". Move text to bottom-left, center, top-right, etc. across sections.\n- Keep sections breathable. Do not over-pack the page.\n- Prefer slightly more whitespace between sections than default.\n- Stay conversion-aware: every section has a job (hook / proof / educate / convert).\n\n### Brief-to-direction mapping\nRead the brief. Then bias the picks like this:\n\nIf the user says **\"minimalist\" / \"clean\" / \"typography-only\" / \"swiss\" / \"ultra simple\"**:\n- Hero Scale: Mini Minimalist\n- Background Mode: solid surfaces, subtle texture, optional ONE color-blocked diptych\n- Gradients: skip or use only the softest tonal gradient\n- Composition: stacked center, generous negative space\n- Skip the \"must include full-bleed\" rule\n\nIf the user says **\"editorial\" / \"magazine\" / \"art-directed\" / \"fashion\"**:\n- Hero Scale: Mid Editorial or Giant Statement\n- Background Mode: editorial side-image, duotone treated image, atmospheric photo grade\n- Gradients: subtle tonal grades only\n- Composition: off-grid editorial offset, asymmetric pulls\n- Strong typography contrast\n\nIf the user says **\"cinematic\" / \"atmospheric\" / \"premium\" / \"luxury\" / \"bold\"**:\n- Hero Scale: Giant Statement\n- Background Mode: full-bleed image with tonal overlay, soft radial vignette + product, micro-noise gradient\n- Gradients: cinematic palette-matched welcomed\n- Composition: bottom-left over background image, centered low, image-as-canvas\n\nIf the user says **\"SaaS\" / \"product\" / \"dashboard\" / \"fintech\" / \"infra\"**:\n- Hero Scale: Mid Editorial\n- Background Mode: solid + inline asset, flat block + detail crop, occasional editorial side-image\n- Gradients: very subtle, palette-matched only\n- Composition: clear product framing, trust-driven anchors\n- Slightly higher implementation clarity\n\nIf the user says **\"agency\" / \"creative studio\" / \"portfolio\"**:\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive)\n- Background Mode: vary boldly (full-bleed image, color-blocked diptych, duotone)\n- Gradients: editorial color washes acceptable\n- Composition: off-grid, poster-like\n\nIf the user says **\"e-commerce\" / \"shop\" / \"store\" / \"product page\"**:\n- Hero Scale: Mid Editorial with strong product focus\n- Background Mode: full-bleed product photo, soft radial vignette + crop, flat block + detail\n- Gradients: subtle, never competing with product\n- Composition: product-led; CTAs unmistakable\n\nIf the brief is silent on style:\n- Use defaults from §1 + §2 with confident background variety\n- Pick one Hero Scale decisively, do not split the difference\n\nNever force backgrounds, gradients, or full-bleed treatments where the brief asks for restraint. Never strip them out where the brief asks for atmosphere.\n\n---\n\n## 2. THE COMBINATORIAL VARIATION ENGINE\nTo avoid repetitive AI-looking output, internally choose one option from each category based on the prompt and commit to it consistently.\n\nDo not mash everything together into chaos.\nPick a strong combination and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n   Off-white / cream / paper tones, sharp dark text, editorial confidence.\n2. Deep Dark Mode\n   Charcoal / graphite / zinc, elegant glow only when justified.\n3. Bold Studio Solid\n   Strong controlled color fields like oxblood, royal blue, forest, vermilion, or emerald with crisp contrasting UI.\n4. Quiet Premium Neutral\n   Bone, sand, taupe, stone, smoke, muted contrast, restrained luxury.\n\n### Background Character\nChoose 1:\n1. Subtle technical grid / dotted field\n2. Pure solid field with soft ambient gradient depth\n3. Full-bleed cinematic imagery with proper contrast control\n4. Quiet textured paper / material / tactile surface feel\n\n### Typography Character\nChoose 1:\n1. Satoshi-like clean grotesk\n2. Neue-Montreal-like refined grotesk\n3. Cabinet / Clash-like expressive display\n4. Monument-like compressed statement typography\n5. Elegant editorial serif + sans pairing\n6. Swiss rational sans with very strong hierarchy\n\nNever drift into boring default web typography energy.\n\n### Hero Architecture\nChoose 1:\n1. Cinematic Centered Minimalist\n2. Asymmetric Split Hero\n3. Floating Polaroid Scatter\n4. Inline Typography Behemoth\n5. Editorial Offset Composition\n6. Massive Image-First Hero with restrained text\n\n### Section System\nChoose 1 dominant structure:\n1. Strict modular bento rhythm\n2. Alternating editorial blocks\n3. Poster-like stacked storytelling\n4. Gallery-led visual cadence\n5. Swiss grid discipline\n6. Asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- Diagonal Staggered Square Masonry\n- 3D Cascading Card Deck\n- Hover-Accordion Slice Layout\n- Pristine Gapless Bento Grid\n- Infinite Brand Marquee Strip\n- Turning Polaroid Arc\n- Vertical Rhythm Lines\n- Off-Grid Editorial Layout\n- Product UI Panel Stack\n- Split Testimonial Quote Wall\n- Oversized Metrics Strip\n- Layered Image Crop Frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\n### Composition Anchor (per-section)\nThe **left-text / right-image** layout is allowed, but it is the most overused AI pattern — do not use it as the default. Reach for it only when it is the genuinely best fit.\n\nEach section picks 1 anchor; across the site at least 3 different anchors must appear; vary the hero so the page does not open on the AI default.\n- Centered statement\n- Top-left lead, support bottom-right\n- Bottom-left text over background image\n- Bottom-right CTA cluster\n- Left-third caption + right-two-thirds visual (classic — use sparingly, never twice in a row)\n- Right-third caption + left-two-thirds visual (inverted classic)\n- Centered low (text in lower 40% over hero image)\n- Off-grid editorial offset (asymmetric pull)\n- Stacked center (label / headline / sub / CTA all centered, ultra minimalist)\n- Image-as-canvas with text overlaid in a clean safe area\n\n### Background Mode (per-section)\nPick 1 per section; vary across the page so it is never all the same mode. Be **confident** with backgrounds — they are a primary tool, not a risk.\n- Solid surface with inline asset\n- Subtle texture / paper / grid as background\n- Full-bleed image background with tonal overlay (text remains highly readable)\n- Editorial side-image (50/50, 60/40, 40/60 — invertible)\n- Image as the entire visual + text overlaid in a clean safe area\n- Flat color block + small product / detail crop as accent\n- Cinematic tonal gradient (palette-matched, low chroma, professional)\n- Atmospheric photo with strong color grade (single-tone graded for brand mood)\n- Duotone treated image (two-color photo treatment, palette-locked)\n- Soft radial vignette + product crop (luxury / editorial feel)\n- Micro-noise gradient over solid (premium tactile depth, not flashy)\n- Color-blocked diptych (two flat fields meeting, modernist)\n\n### CTA Variation\nPick the CTA style that fits each section, not a default pill every time:\n- Classic primary pill\n- Outline / ghost\n- Underlined inline link with arrow\n- Banner-style full-width CTA\n- Oversized headline + tiny CTA hint\n- CTA as caption under a strong visual\n\nAcross the site, vary CTA style at least once. The page's primary action stays unmistakable.\n\n### Hero Scale (per-page)\nPick 1 — must match brand mood:\n- Giant Statement Hero (massive type, large image, dominant first viewport)\n- Mid Editorial Hero (balanced type/image, cinematic but not screen-filling)\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, almost no image, lots of negative space)\n\nMini does not mean weak — it means confident restraint.\n\n### Narrative / Concept Spine\nPick 1 and let it thread through visuals and short copy across the page.\n- Artifact / collectible — proof, specimen, treasured object framing\n- Journey / pilgrimage — directional flow, waypoint sections, roadmap feeling\n- Tool / precision instrument — machined detail, calibrated UI, tactile controls\n- Living system / garden — organic growth metaphor, branching layout, nurtured tone\n- Stage / spotlight — theatrical contrast, performer + audience framing\n- Archive / dossier — indexed rows, captions, understated authority\n\n### Second-Read Moment\nPick exactly 1 unobvious but legible motif and place it deliberately, once across the page:\n- asymmetric bleed that still respects hierarchy\n- one oversized punctuation or numeral serving structure\n- a single unexpected material switch (paper vs gloss vs metal accent)\n- a narrow vertical side-rail editorial note style\n- a macro crop that carries brand color naturally\nAvoid gimmick-for-gimmick: the moment must aid scan order or brand recall.\n\nImportant:\nThese are not coding instructions.\nThey are visual-direction cues the generated design should imply.\n\n---\n\n## 3. FRONTEND REFERENCE RULE\nEvery generated image must clearly communicate:\n- layout\n- section hierarchy\n- spacing\n- typography scale\n- visual rhythm\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image and understand how to build it.\n\nDo not produce vague abstract artwork when the request is for frontend.\n\n---\n\n## 4. HERO MINIMALISM RULES\nThe hero must feel cinematic, clear, and intentional.\n\n### Hero Composition Bias\nThe **left-text / right-image hero is the most overused AI hero pattern**. It is allowed, but it should not be your default starting point.\n\nPrefer one of these instead, unless left-text / right-image is genuinely the strongest fit:\n- Centered statement over full-bleed image (text in lower 40%)\n- Bottom-left text over background image\n- Bottom-right text over background image\n- Top-left lead, support bottom-right\n- Stacked center (label / headline / sub / CTA all centered)\n- Image-as-canvas with text overlaid in a clean safe area\n- Right-text / left-image (inverted classic)\n- Off-grid editorial offset\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, mostly negative space)\n\n### Pre-output check\nBefore rendering the hero image, ask yourself: \"Am I drafting the default text-left / image-right layout out of habit?\" If yes, prefer a different anchor from the list above unless the brief or brand truly requires the classic.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- headline should usually read like 5-10 strong words, not a paragraph\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n\n### Headline Rule\nThe H1 should visually read like a premium statement.\nDo not let it feel long, weak, or overly wrapped.\n\n### Typography Execution\nPrefer:\n- medium / normal / light elegance\n- tight tracking\n- controlled line count\n- strong scale contrast\n\nAvoid:\n- random extra-bold shouting everywhere\n- gradient text as a lazy premium effect\n- 6-line startup headings\n- text treatment that looks generated\n\n### Graphic Restraint\nDo not default to:\n- giant meaningless outline numbers\n- cheap SVG-looking filler graphics\n- generic AI blobs\n- random orb clutter\n\nUse:\n- typography\n- image crops\n- real layout tension\n- premium materials\n- strong framing\ninstead.\n\n---\n\n## 5. IMAGE COUNT & PAGE SLICING\n\n### THIS IS THE PRIMARY OUTPUT RULE\nGenerate **one separate horizontal image PER section**. Always.\n\n- never combine multiple sections in a single image\n- never return a single tall slice that contains the whole page\n- never return one \"best\" image and skip the rest\n- never replace several sections with one collage\n\nIf the request is ambiguous about section count, **default high**:\n- \"hero\" -> 1 image\n- \"landing page\" / \"site template\" -> default to 6 sections -> 6 images\n- \"full website\" -> default to 8 sections -> 8 images\n- \"marketing site\" -> default to 8 sections -> 8 images\n- \"product page\" -> default to 6 sections -> 6 images\n- \"portfolio\" -> default to 6 sections -> 6 images\n\nIf the model can only render one image per call, generate them **sequentially in the same response**, one after the other, labeled \"Section X of N: <name>\" until the full set is delivered.\n\n### Format\n- Always horizontal (16:9, 16:10, or 21:9 depending on density)\n- Each image renders one focused section in high fidelity\n- Hero usually 16:9 or 21:9; narrower content sections may be 16:10\n\n### Counting rule\n- 1 section -> 1 horizontal image\n- 4 sections -> 4 horizontal images\n- 8 sections -> 8 horizontal images\n- 12 sections -> 12 horizontal images\n\nDo not collapse multiple sections into one tall slice. Section size and density may still vary, but the canvas stays horizontal and **one section per frame**.\n\n### Section size variety\nAcross the site, mix section ambition deliberately:\n- some sections are large, content-rich, art-directed\n- some sections are mini, ultra minimalist, mostly negative space\n- some sections are medium editorial blocks\n\nThis rhythm creates a premium scrollscape, not uniform slabs.\n\n### Continuity Rule\nAcross all per-section images, enforce one brand world:\n- same palette and accent logic\n- same typography family and scale\n- same CTA family (style variations are fine, identity is not)\n- same border radius language\n- same image treatment (color grade, materials, framing)\n- same tonal voice in any short copy\n\nA viewer scrolling through all frames must read them as one site.\n\n---\n\n## 6. CREATIVITY ESCALATION RULE\nThe design must show real creative ambition.\n\nDo not settle for the first obvious layout solution.\nPush the work beyond generic SaaS patterns.\n\nActively increase at least 3 of these:\n- stronger composition\n- more distinctive typography\n- more confident scale contrast\n- more memorable hero concept\n- more interesting image treatment\n- more expressive section rhythm\n- more original framing / cropping\n- more art-directed visual tension\n- more surprising but clear layout structure\n\nCreativity must feel intentional, not chaotic.\n\nDo:\n- make bold but controlled design decisions\n- use asymmetry when it improves the page\n- create visual moments that feel premium and memorable\n- make the page feel designed, not auto-generated\n\nDo not:\n- default to safe template layouts\n- repeat the same block structure too often\n- confuse creativity with clutter\n- make the page overly dense\n\n---\n\n## 7. IMAGE-FIRST ART DIRECTION\nThis skill must actively use images.\n\nImages are not optional decoration.\nImages are a core part of the frontend design language.\n\nStrongly prefer:\n- art-directed photography\n- product imagery\n- editorial imagery\n- image crops\n- framed image panels\n- layered image compositions\n- image-led hero sections\n- image-supported storytelling blocks\n\nUse images to:\n- create visual hierarchy\n- break up text-heavy layouts\n- build mood and brand character\n- support section transitions\n- make the design easier to interpret and implement\n\nImportant:\n- the design should not become text-only or card-only unless the user explicitly wants that\n- if a page has multiple sections, several sections should meaningfully include imagery\n- if a hero exists, it should usually contain a strong visual image, product visual, or art-directed media element\n- imagery should feel premium and intentional, not like stock filler\n\nAvoid:\n- tiny useless thumbnails\n- random decorative images with no structural role\n- one single image and then a completely text-heavy rest of page\n- overusing fake UI panels instead of real visual variety\n\n---\n\n## 8. ANTI-AI-SLOP RULES\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- perfect but lifeless symmetry everywhere\n- fake complexity without hierarchy\n- empty decorative space with no purpose\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating spheres / blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods in one page\n- awkward line breaks\n- lazy all-caps everywhere\n- gradient headline as shortcut for \"premium\"\n\n### Content slop\nBan generic copy vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- powerful solution\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n- obvious nonsense wordmarks\n\nUse short, believable, design-friendly copy.\n\n### Density slop\n- no over-packed sections\n- no card overload in every block\n- no tiny spacing between major sections\n- no trying to fill every empty area\n- no visually exhausting wall-of-content layouts\n\n### Carousel / marquee slop (layout)\n- infinity logo strips repeating the same 6 blobs\n- “trusted by” ticker that is unreadable mosquito logos\n- auto-play-style hero dots with no semantic purpose\n\n### Data / KPI slop\n- three identical stat columns (99% satisfaction, $10 saved, ∞ scale) unless user asked for KPIs\n- fake dashboards with pointless charts shading the real layout\n\n---\n\n## 9. TYPOGRAPHY-FIRST DISCIPLINE\nTypography is not filler.\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- supporting text that is readable and brief\n- labels, captions, and section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 10. SECTION RHYTHM RULE\nA high-end site does not feel like repeated boxes.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nDo not let every section feel generated from the same template.\n\nImportant:\n- rhythm variation should not break overall cleanliness\n- keep the page visually balanced from top to bottom\n- section heights may vary, but the spacing between sections should feel controlled and fairly even\n- avoid abrupt jumps between very small and very large sections without enough breathing room\n- the full page should feel curated, smooth, and consistent\n\n---\n\n## 11. COMPONENT EXECUTION GUIDELINES\n\n### Diagonal Staggered Square Masonry\nUse square image or content blocks with strong staggered vertical rhythm.\nShould feel curated and graphic, not messy.\n\n### 3D Cascading Card Deck\nCards layered as a physical stack with depth logic.\nShould feel premium and tactile, not gimmicky.\n\n### Hover-Accordion Slice Layout\nA row of compressed visual slices that feel expandable.\nIn static images, imply interaction clearly through proportions and emphasis.\n\n### Pristine Gapless Bento Grid\nMathematically clean grid.\nNo accidental gaps.\nMix large visual blocks with smaller dense information panels.\n\n### Turning Polaroid Arc\nClustered, rotated imagery with elegant composition.\nShould feel styled and intentional, not scrapbook-random.\n\n### Off-Grid Editorial Layout\nUse asymmetry and tension with control.\nMust remain readable and clearly structured.\n\n### Product UI Panel Stack\nLayer UI screens or interface crops to imply a product story.\nAvoid generic fake dashboards.\n\n### Vertical Rhythm Lines\nUse fine lines and spacing systems to reinforce order and elegance.\nNever let them become decorative clutter.\n\n---\n\n## 12. DENSITY & SPACING DISCIPLINE\nDo not make everything too dense.\n\nThe page should breathe.\nLeave slightly more blank space between sections than a default AI-generated design would.\n\nRules:\n- use more even vertical spacing between major sections\n- keep section-to-section spacing consistent unless there is a strong design reason not to\n- avoid one section feeling very cramped while the next feels too empty\n- prefer a clean, balanced cadence across the page\n- allow negative space to create rhythm and emphasis\n- separate denser sections with calmer sections\n- avoid stacking too many cards, labels, and content blocks too tightly\n- smaller sections should still receive enough surrounding space so the page feels polished and intentional\n\nA premium page should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausted\n\nSection rhythm should alternate with control:\n- some sections can be more content-rich\n- some sections can be smaller and calmer\n- but the overall spacing cadence should still feel even, clean, and deliberate\n\nWhitespace is a design tool.\nUse it deliberately.\nDo not let spacing become random.\n\n---\n\n## 13. COLOR & MATERIAL RULES\n\n### Palette Discipline\nUse one controlled palette across the entire site:\n- 1 primary (brand anchor)\n- 1 secondary (supporting tone)\n- 1 accent (used sparingly for CTA / highlight)\n- a neutral scale (background, surface, text, hairline)\n\nSection-level mood shifts must reuse the same palette — no full theme swap per section.\n\n### Background-image harmony\nWhen using full-bleed image backgrounds:\n- the image must tonally match the palette (not fight it)\n- use overlays (dark, light, or color tint) to keep text fully readable\n- the brand accent stays consistent regardless of background image\n\n### Gradient Discipline\nGradients are **allowed and encouraged** when professional and subtle. They are not the same as AI slop gradients.\n\nAllowed (use confidently):\n- low-chroma palette-matched tonal gradients (e.g. ink to graphite, cream to sand, ivory to warm grey)\n- single-hue atmospheric grades behind hero photography\n- soft vignettes and radial depth that direct the eye\n- noise-textured gradients adding tactile depth without color noise\n- editorial color washes that match brand mood\n\nBanned (AI gradient slop):\n- rainbow / mesh blob gradients\n- purple-to-blue \"AI\" defaults\n- pink-to-orange \"creator\" defaults\n- neon edges and glow halos with no purpose\n- gradient text as a shortcut for \"premium\"\n- gradients that compete with imagery instead of supporting it\n\n### Background Confidence Rule\nDo not retreat to plain white surfaces by default. When the brief, brand mood, or section job calls for atmosphere, use:\n- a full-bleed image,\n- a duotone or graded photo,\n- a tonal gradient,\n- a tactile material,\nor a confident flat color field — picked deliberately, not as decoration.\n\n### Strong guidance\n- avoid rainbow randomness\n- avoid over-neon unless requested\n- keep contrast intentional\n- match accent colors to the chosen theme paradigm\n- gradients must always read as professional and intentional, never as visual noise\n\n### Materiality\nWhere appropriate, add:\n- paper feel\n- glass feel\n- brushed metal feel\n- soft blur depth\n- tactile matte surfaces\n- editorial photo treatment\n\nBut always keep the frontend structure readable.\n\n---\n\n## 14. IMAGE / MEDIA DIRECTION\nIf imagery is present, it must support the layout.\n\nAllowed:\n- art-directed product visuals\n- refined editorial photography\n- UI crops\n- abstract forms with structural purpose\n- framed objects\n- premium texture use\n- campaign-style visuals\n\nAvoid:\n- irrelevant scenery\n- stock-photo cliches\n- decorative junk\n- visuals that overpower the page hierarchy\n\n---\n\n## 15. DEFAULT SITE PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\n---\n\n## 16. MULTI-IMAGE CONSISTENCY RULE\nBecause every section is its own image, consistency is critical. Across all per-section frames enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA family (style variations are fine, identity is not)\n- same icon or illustration mood\n- same image treatment (grade, framing, material vocabulary)\n- same tonal language in any copy\n\nVariation IS allowed in:\n- composition anchor (per section)\n- background mode (per section)\n- section size and density\n- which \"second-read\" moment appears\n\nA viewer flipping through every per-section frame must still recognize one brand. Anything that breaks brand recall is over-variation.\n\n---\n\n## 17. CLARITY CHECK\nBefore finalizing, verify internally:\n\n1. Is the hierarchy obvious?\n2. Is the hero clean enough?\n3. Is the design visually distinctive?\n4. Is it free of obvious AI tells?\n5. Is it premium rather than template-like?\n6. Can someone code from this?\n7. If multiple images exist, do they clearly belong together?\n8. Is imagery used strongly enough (with variation, not one repeated crop)?\n9. Does the page breathe, or is it too dense?\n10. Is there enough spacing between sections?\n11. Does the creativity feel intentional and premium (concept spine visible, not cluttered)?\n12. Is the spacing between sections even and controlled?\n13. Do smaller sections still have enough surrounding space to feel clean?\n14. Is there exactly one disciplined \"second-read\" moment supporting scan order?\n15. Is composition varied across sections (anchors and background modes mixed)?\n16. Is the hero scale (giant / mid / mini) chosen and executed cleanly?\n17. Is there a clear conversion path (hook -> proof -> action) even in artistic sites?\n18. Is the palette consistent across all per-section images?\n19. Is each image horizontal and one-section-only?\n20. Is the **total number of images equal to the number of sections** (never fewer)?\n21. Is the hero using a varied composition (not defaulting to left-text / right-image out of habit)?\n\nIf not, refine internally before output. If the count is wrong, regenerate the missing sections. If the hero feels like a reflexive left-text / right-image default, prefer a different composition anchor.\n\n---\n\n## 18. EXTRA CREATIVITY & IMPLEMENTATION EDGE\n\nApply unless the user opts out:\n\n### Cross-section contrast\nAcross the slice, deliberately vary foreground/background intensity at least twice (lighter → richer → calmer) so the scroll feels paced, not monotonous slabs.\n\n### CTA specificity\nPrefer one unmistakable primary action per major viewport tier; secondary actions must look secondary (scale, outline, ghost), not clones of primary.\n\n### Image variety inside one comp\nMix at least **two distinct image crops** where multiple sections exist — e.g. macro product + contextual environment, or portrait editorial + widescreen artifact — avoiding one repeated stock silhouette.\n\n### Data-viz restraint\nCharts, sparklines, and graphs appear only when the site type logically needs them (analytics, pricing, infra, observability brands). Else keep proof human (quotes, receipts, timelines, screenshots of real workflows).\n\n### Cultural / tonal alignment\nWhen the brief names an industry or region, steer palette and typographic temperament to match — don’t ship default “neutral SF startup” unless the brief is intentionally generic SaaS.\n\n### Mobile-implied fidelity (even for desktop mocks)\nMaintain tap-friendly hit sizes and readable caption sizes visually; stacking order should imply a sane single-column narrative.\n\n### Conversion focus\nEach section has a job. Even when the design is artistic, the page must read as a real product or brand site:\n- the hero communicates value in seconds and offers one obvious next action\n- proof sections (logos, quotes, metrics) feel earned, not stuffed\n- pricing or CTA sections feel decisive, not buried\n- the final section closes: a single strong CTA + supporting trust cue\nAvoid pure mood reels with no funnel logic.\n\n### Composition variety check\nAcross all per-section images, internally log the chosen composition anchor and background mode. Reject the set if:\n- the same composition anchor repeats more than 2 sections in a row\n- the same background mode repeats more than 3 sections in a row\n- every section is inline-asset (no full-bleed background ever appears) **AND** the brief does not call for minimalism / typography-only / swiss / ultra simple\n\nFor non-minimalist briefs: push for at least one full-bleed (or duotone / atmospheric) background and at least one mini minimalist section in any multi-section site.\n\nFor minimalist briefs: this rule is suspended. Restraint is the design.\n\n---\n\n## 19. RESPONSE BEHAVIOR\nWhen the user asks for a frontend design:\n1. infer site type and primary conversion goal\n2. infer number of sections (if unclear, use the defaults from §5: landing page = 6, full website = 8)\n3. **commit out loud** to the section count and announce it (\"Generating N horizontal images, one per section\")\n4. plan ONE horizontal image PER SECTION — always separate generations, never collapse\n5. choose Hero Scale for the whole site (giant / mid / mini)\n5. choose a strong visual combination (theme, type, hero arch, section system, motion, narrative spine, second-read moment)\n7. for each section: pick a Composition Anchor, Background Mode, and CTA Variation — vary across sections\n8. choose 4 signature components used appropriately across sections\n9. enforce hero minimalism + section size variety (some giant, some mini)\n10. enforce strong image usage including full-bleed backgrounds where it fits\n11. lock one consistent palette across all images\n12. apply §18 EXTRA CREATIVITY & IMPLEMENTATION EDGE\n13. keep spacing generous, even, and clean\n14. remove AI slop (including marquee / fake KPI clichés unless requested)\n15. run §17 CLARITY CHECK\n16. **generate every per-section horizontal image, labeled \"Section X of N: <name>\"**, until the full set is delivered. Do not stop early. Do not summarize. Do not return only one image.\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\n\n---\n\n## 20. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser: \"make a hero section for an AI startup\"\n\nInterpretation:\n- 1 horizontal image\n- Hero Scale: Mid Editorial or Giant Statement\n- Composition Anchor: bottom-left text over full-bleed product/atmosphere image\n- Background Mode: full-bleed image with dark tonal overlay\n- CTA Variation: outlined inline + small label hint\n- Palette: Deep Dark or Bold Studio Solid, one consistent accent\n- no cliche dashboard spam, no purple AI glow\n\n### Example 2\nUser: \"design 8 sections for a fintech website\"\n\nInterpretation:\n- 8 separate horizontal images (one per section)\n- Hero Scale: Mid Editorial (trust-driven)\n- vary Composition Anchor across sections (centered low, right-third caption, bottom-left over chart visual, stacked center for closing CTA)\n- Background Mode mix: solid surface, full-bleed image background once, editorial side-image at use cases\n- one consistent palette (e.g. ink + paper + single brand accent)\n- conversion path: hook -> proof bar -> features -> use case -> testimonial -> pricing -> FAQ -> final CTA\n\n### Example 3\nUser: \"creative agency landing page, 12 sections\"\n\nInterpretation:\n- 12 horizontal images (one per section)\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive choice, not in-between)\n- editorial / poster-like direction; off-grid composition appears 2-3 times\n- multiple Background Modes (full-bleed image at hero + showcase, editorial side-image at case studies, solid + accent for process)\n- palette consistent throughout, with one bold accent recurring\n- closing CTA section: mini minimalist, strong type, single primary action\n\n---\n\n## 21. FINAL GOAL\nGenerate frontend reference images that feel:\n- artistic\n- premium\n- clear\n- structured\n- image-led\n- breathable\n- memorable\n- anti-generic\n- implementation-friendly\n\nThe result should look like a top-tier website concept with strong imagery, confident creativity, and generous spacing - not a dense, repetitive AI layout.\n",".agents/skills/industrial-brutalist-ui/SKILL.md":"---\nname: industrial-brutalist-ui\ndescription: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.\n---\n\n# SKILL: Industrial Brutalism & Tactical Telemetry UI\n\n## 1. Skill Meta\n**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering\n**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.\n\n## 2. Visual Archetypes\nThe design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**\n\n### 2.1 Swiss Industrial Print\nDerived from 1960s corporate identity systems and heavy machinery blueprints.\n*   **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.\n\n### 2.2 Tactical Telemetry & CRT Terminal\nDerived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).\n*   **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).\n\n## 3. Typographic Architecture\nTypography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.\n\n### 3.1 Macro-Typography (Structural Headers)\n*   **Classification:** Neo-Grotesque / Heavy Sans-Serif.\n*   **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.\n*   **Implementation Parameters:**\n    *   **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).\n    *   **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.\n    *   **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).\n    *   **Casing:** Exclusively uppercase for structural impact.\n\n### 3.2 Micro-Typography (Data & Telemetry)\n*   **Classification:** Monospace / Technical Sans.\n*   **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.\n*   **Implementation Parameters:**\n    *   **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).\n    *   **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.\n    *   **Leading:** Standard to tight (`1.2` to `1.4`).\n    *   **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.\n\n### 3.3 Textural Contrast (Artistic Disruption)\n*   **Classification:** High-Contrast Serif.\n*   **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.\n*   **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.\n\n## 4. Color System\nThe color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.\n\n**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**\n\n### If Swiss Industrial Print (Light):\n*   **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).\n*   **Foreground:** `#050505` to `#111111` (Carbon Ink).\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.\n\n### If Tactical Telemetry (Dark):\n*   **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).\n*   **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.\n*   **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.\n\n## 5. Layout and Spatial Engineering\nThe layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.\n\n*   **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.\n*   **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.\n*   **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.\n*   **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.\n\n## 6. UI Components and Symbology\nStandard web UI conventions are replaced with utilitarian, industrial graphic elements.\n\n*   **Syntax Decoration:** Utilization of ASCII characters to frame data points.\n    *   *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`\n    *   *Directional:* `>>>`, `///`, `\\\\\\\\`\n*   **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.\n*   **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.\n\n## 7. Textural and Post-Processing Effects\nTo prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.\n\n*   **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.\n*   **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).\n*   **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.\n\n## 8. Web Engineering Directives\n1.  **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.\n2.  **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.\n3.  **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.\n",".agents/skills/minimalist-ui/SKILL.md":"---\nname: minimalist-ui\ndescription: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.\n---\n\n# Protocol: Premium Utilitarian Minimalism UI Architect\n\n## 1. Protocol Overview\nName: Premium Utilitarian Minimalism & Editorial UI\nDescription: An advanced frontend engineering directive for generating highly refined, ultra-minimalist, \"document-style\" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.\n\n## 2. Absolute Negative Constraints (Banned Elements)\nThe AI must strictly avoid the following generic web development defaults:\n- DO NOT use the \"Inter\", \"Roboto\", or \"Open Sans\" typefaces.\n- DO NOT use generic, thin-line icon libraries like \"Lucide\", \"Feather\", or standard \"Heroicons\".\n- DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).\n- DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).\n- DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).\n- DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.\n- DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.\n- DO NOT use generic placeholder names like \"John Doe\", \"Acme Corp\", or \"Lorem Ipsum\". Use realistic, contextual content.\n- DO NOT use AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\". Write plain, specific language.\n\n## 3. Typographic Architecture\nThe interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.\n- Primary Sans-Serif (Body, UI, Buttons): Use clean, geometric, or system-native fonts with character. Target: `font-family: 'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`.\n- Editorial Serif (Hero Headings & Quotes): Target: `font-family: 'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`. Apply tight tracking (`letter-spacing: -0.02em` to `-0.04em`) and tight line-height (`1.1`).\n- Monospace (Code, Keystrokes, Meta-data): Target: `font-family: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`.\n- Text Colors: Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous `line-height` of `1.6` for legibility. Secondary text should be muted gray (`#787774`).\n\n## 4. Color Palette (Warm Monochrome + Spot Pastels)\nColor is a scarce resource, utilized only for semantic meaning or subtle accents.\n- Canvas / Background: Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.\n- Primary Surface (Cards): `#FFFFFF` or `#F9F9F8`.\n- Structural Borders / Dividers: Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.\n- Accent Colors: Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds.\n  - Pale Red: `#FDEBEC` (Text: `#9F2F2D`)\n  - Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)\n  - Pale Green: `#EDF3EC` (Text: `#346538`)\n  - Pale Yellow: `#FBF3DB` (Text: `#956400`)\n\n## 5. Component Specifications\n- Bento Box Feature Grids:\n  - Utilize asymmetrical CSS Grid layouts.\n  - Cards must have exactly `border: 1px solid #EAEAEA`.\n  - Border-radius must be crisp: `8px` or `12px` maximum.\n  - Internal padding must be generous (e.g., `24px` to `40px`).\n- Primary Call-To-Action (Buttons):\n  - Solid background `#111111`, text `#FFFFFF`. \n  - Slight border-radius (`4px` to `6px`). No box-shadow. \n  - Hover state should be a subtle color shift to `#333333` or a micro-scale `transform: scale(0.98)`.\n- Tags & Status Badges:\n  - Pill-shaped (`border-radius: 9999px`), very small typography (`text-xs`), uppercase with wide tracking (`letter-spacing: 0.05em`).\n  - Background must use the defined Muted Pastels.\n- Accordions (FAQ):\n  - Strip all container boxes. Separate items only with a `border-bottom: 1px solid #EAEAEA`.\n  - Use a clean, sharp `+` and `-` icon for the toggle state.\n- Keystroke Micro-UIs:\n  - Render shortcuts as physical keys using `<kbd>` tags: `border: 1px solid #EAEAEA`, `border-radius: 4px`, `background: #F7F6F3`, using the Monospace font.\n- Faux-OS Window Chrome:\n  - When mocking up software, wrap it in a minimalist container with a white top bar containing three small, light gray circles (replicating macOS window controls).\n\n## 6. Iconography & Imagery Directives\n- System Icons: Use \"Phosphor Icons (Bold or Fill weights)\" or \"Radix UI Icons\" for a technical, slightly thicker-stroke aesthetic. Standardize stroke width across all icons.\n- Illustrations: Monochromatic, rough continuous-line ink sketches on a white background, featuring a single offset geometric shape filled with a muted pastel color.\n- Photography: Use high-quality, desaturated images with a warm tone. Apply subtle overlays (`opacity: 0.04` warm grain) to blend photos into the monochrome palette. Never use oversaturated stock photos. Use reliable placeholders like `https://picsum.photos/seed/{context}/1200/800` when real assets are unavailable.\n- Hero & Section Backgrounds: Sections should not feel empty and flat. Use subtle full-width background imagery at very low opacity, soft radial light spots (`radial-gradient` with warm tones at `opacity: 0.03`), or minimal geometric line patterns to add depth without breaking the clean aesthetic.\n\n## 7. Subtle Motion & Micro-Animations\nMotion should feel invisible — present but never distracting. The goal is quiet sophistication, not spectacle.\n- Scroll Entry: Elements fade in gently as they enter the viewport. Use `translateY(12px)` + `opacity: 0` resolving over `600ms` with `cubic-bezier(0.16, 1, 0.3, 1)`. Use `IntersectionObserver`, never `window.addEventListener('scroll')`.\n- Hover States: Cards lift with an ultra-subtle shadow shift (`box-shadow` transitioning from `0 0 0` to `0 2px 8px rgba(0,0,0,0.04)` over `200ms`). Buttons respond with `scale(0.98)` on `:active`.\n- Staggered Reveals: Lists and grid items enter with a cascade delay (`animation-delay: calc(var(--index) * 80ms)`). Never mount everything at once.\n- Background Ambient Motion: Optional. A single, very slow-moving radial gradient blob (`animation-duration: 20s+`, `opacity: 0.02-0.04`) drifting behind hero sections. Must be applied to a `position: fixed; pointer-events: none` layer. Never on scrolling containers.\n- Performance: Animate exclusively via `transform` and `opacity`. No layout-triggering properties (`top`, `left`, `width`, `height`). Use `will-change: transform` sparingly and only on actively animating elements.\n\n## 8. Execution Protocol\nWhen tasked with writing frontend code (HTML, React, Tailwind, Vue) or designing a layout:\n1. Establish the macro-whitespace first. Use massive vertical padding between sections (e.g., `py-24` or `py-32` in Tailwind).\n2. Constrain the main typography content width to `max-w-4xl` or `max-w-5xl`.\n3. Apply the custom typographic hierarchy and monochromatic color variables immediately.\n4. Ensure every card, divider, and border adheres strictly to the `1px solid #EAEAEA` rule.\n5. Add scroll-entry animations to all major content blocks.\n6. Ensure sections have visual depth through imagery, ambient gradients, or subtle textures — no empty flat backgrounds.\n7. Provide code that reflects this high-end, uncluttered, editorial aesthetic natively without requiring manual adjustments.\n",".agents/skills/redesign-existing-projects/SKILL.md":"---\nname: redesign-existing-projects\ndescription: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.\n---\n\n# Redesign Skill\n\n## How This Works\n\nWhen applied to an existing project, follow this sequence:\n\n1. **Scan** — Read the codebase. Identify the framework, styling method (Tailwind, vanilla CSS, styled-components, etc.), and current design patterns.\n2. **Diagnose** — Run through the audit below. List every generic pattern, weak point, and missing state you find.\n3. **Fix** — Apply targeted upgrades working with the existing stack. Do not rewrite from scratch. Improve what's there.\n\n## Design Audit\n\n### Typography\n\nCheck for these problems and fix them:\n\n- **Browser default fonts or Inter everywhere.** Replace with a font that has character. Good options: `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`. For editorial/creative projects, pair a serif header with a sans-serif body.\n- **Headlines lack presence.** Increase size for display text, tighten letter-spacing, reduce line-height. Headlines should feel heavy and intentional.\n- **Body text too wide.** Limit paragraph width to roughly 65 characters. Increase line-height for readability.\n- **Only Regular (400) and Bold (700) weights used.** Introduce Medium (500) and SemiBold (600) for more subtle hierarchy.\n- **Numbers in proportional font.** Use a monospace font or enable tabular figures (`font-variant-numeric: tabular-nums`) for data-heavy interfaces.\n- **Missing letter-spacing adjustments.** Use negative tracking for large headers, positive tracking for small caps or labels.\n- **All-caps subheaders everywhere.** Try lowercase italics, sentence case, or small-caps instead.\n- **Orphaned words.** Single words sitting alone on the last line. Fix with `text-wrap: balance` or `text-wrap: pretty`.\n\n### Color and Surfaces\n\n- **Pure `#000000` background.** Replace with off-black, dark charcoal, or tinted dark (`#0a0a0a`, `#121212`, or a dark navy).\n- **Oversaturated accent colors.** Keep saturation below 80%. Desaturate accents so they blend with neutrals instead of screaming.\n- **More than one accent color.** Pick one. Remove the rest. Consistency beats variety.\n- **Mixing warm and cool grays.** Stick to one gray family. Tint all grays with a consistent hue (warm or cool, not both).\n- **Purple/blue \"AI gradient\" aesthetic.** This is the most common AI design fingerprint. Replace with neutral bases and a single, considered accent.\n- **Generic `box-shadow`.** Tint shadows to match the background hue. Use colored shadows (e.g., dark blue shadow on a blue background) instead of pure black at low opacity.\n- **Flat design with zero texture.** Add subtle noise, grain, or micro-patterns to backgrounds. Pure flat vectors feel sterile.\n- **Perfectly even gradients.** Break the uniformity with radial gradients, noise overlays, or mesh gradients instead of standard linear 45-degree fades.\n- **Inconsistent lighting direction.** Audit all shadows to ensure they suggest a single, consistent light source.\n- **Random dark sections in a light mode page (or vice versa).** A single dark-background section breaking an otherwise light page looks like a copy-paste accident. Either commit to a full dark mode or keep a consistent background tone throughout. If contrast is needed, use a slightly darker shade of the same palette — not a sudden jump to `#111` in the middle of a cream page.\n- **Empty, flat sections with no visual depth.** Sections that are just text on a plain background feel unfinished. Add high-quality background imagery (blurred, overlaid, or masked), subtle patterns, or ambient gradients. Use reliable placeholder sources like `https://picsum.photos/seed/{name}/1920/1080` when real assets are not available. Experiment with background images behind hero sections, feature blocks, or CTAs — even a subtle full-width photo at low opacity adds presence.\n\n### Layout\n\n- **Everything centered and symmetrical.** Break symmetry with offset margins, mixed aspect ratios, or left-aligned headers over centered content.\n- **Three equal card columns as feature row.** This is the most generic AI layout. Replace with a 2-column zig-zag, asymmetric grid, horizontal scroll, or masonry layout.\n- **Using `height: 100vh` for full-screen sections.** Replace with `min-height: 100dvh` to prevent layout jumping on mobile browsers (iOS Safari viewport bug).\n- **Complex flexbox percentage math.** Replace with CSS Grid for reliable multi-column structures.\n- **No max-width container.** Add a container constraint (around 1200-1440px) with auto margins so content doesn't stretch edge-to-edge on wide screens.\n- **Cards of equal height forced by flexbox.** Allow variable heights or use masonry when content varies in length.\n- **Uniform border-radius on everything.** Vary the radius: tighter on inner elements, softer on containers.\n- **No overlap or depth.** Elements sit flat next to each other. Use negative margins to create layering and visual depth.\n- **Symmetrical vertical padding.** Top and bottom padding are always identical. Adjust optically — bottom padding often needs to be slightly larger.\n- **Dashboard always has a left sidebar.** Try top navigation, a floating command menu, or a collapsible panel instead.\n- **Missing whitespace.** Double the spacing. Let the design breathe. Dense layouts work for data dashboards, not for marketing pages.\n- **Buttons not bottom-aligned in card groups.** When cards have different content lengths, CTAs end up at random heights. Pin buttons to the bottom of each card so they form a clean horizontal line regardless of content above.\n- **Feature lists starting at different vertical positions.** In pricing tables or comparison cards, the list of features should start at the same Y position across all columns. Use consistent spacing above the list or fixed-height title/price blocks.\n- **Inconsistent vertical rhythm in side-by-side elements.** When placing cards, columns, or panels next to each other, align shared elements (titles, descriptions, prices, buttons) across all items. Misaligned baselines make the layout look broken.\n- **Mathematical alignment that looks optically wrong.** Centering by the math doesn't always look centered to the eye. Icons next to text, play buttons in circles, or text in buttons often need 1-2px optical adjustments to feel right.\n\n### Interactivity and States\n\n- **No hover states on buttons.** Add background shift, slight scale, or translate on hover.\n- **No active/pressed feedback.** Add a subtle `scale(0.98)` or `translateY(1px)` on press to simulate a physical click.\n- **Instant transitions with zero duration.** Add smooth transitions (200-300ms) to all interactive elements.\n- **Missing focus ring.** Ensure visible focus indicators for keyboard navigation. This is an accessibility requirement, not optional.\n- **No loading states.** Replace generic circular spinners with skeleton loaders that match the layout shape.\n- **No empty states.** An empty dashboard showing nothing is a missed opportunity. Design a composed \"getting started\" view.\n- **No error states.** Add clear, inline error messages for forms. Do not use `window.alert()`.\n- **Dead links.** Buttons that link to `#`. Either link to real destinations or visually disable them.\n- **No indication of current page in navigation.** Style the active nav link differently so users know where they are.\n- **Scroll jumping.** Anchor clicks jump instantly. Add `scroll-behavior: smooth`.\n- **Animations using `top`, `left`, `width`, `height`.** Switch to `transform` and `opacity` for GPU-accelerated, smooth animation.\n\n### Content\n\n- **Generic names like \"John Doe\" or \"Jane Smith\".** Use diverse, realistic-sounding names.\n- **Fake round numbers like `99.99%`, `50%`, `$100.00`.** Use organic, messy data: `47.2%`, `$99.00`, `+1 (312) 847-1928`.\n- **Placeholder company names like \"Acme Corp\", \"Nexus\", \"SmartFlow\".** Invent contextual, believable brand names.\n- **AI copywriting cliches.** Never use \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\", \"Tapestry\", or \"In the world of...\". Write plain, specific language.\n- **Exclamation marks in success messages.** Remove them. Be confident, not loud.\n- **\"Oops!\" error messages.** Be direct: \"Connection failed. Please try again.\"\n- **Passive voice.** Use active voice: \"We couldn't save your changes\" instead of \"Mistakes were made.\"\n- **All blog post dates identical.** Randomize dates to appear real.\n- **Same avatar image for multiple users.** Use unique assets for every distinct person.\n- **Lorem Ipsum.** Never use placeholder latin text. Write real draft copy.\n- **Title Case On Every Header.** Use sentence case instead.\n\n### Component Patterns\n\n- **Generic card look (border + shadow + white background).** Remove the border, or use only background color, or use only spacing. Cards should exist only when elevation communicates hierarchy.\n- **Always one filled button + one ghost button.** Add text links or tertiary styles to reduce visual noise.\n- **Pill-shaped \"New\" and \"Beta\" badges.** Try square badges, flags, or plain text labels.\n- **Accordion FAQ sections.** Use a side-by-side list, searchable help, or inline progressive disclosure.\n- **3-card carousel testimonials with dots.** Replace with a masonry wall, embedded social posts, or a single rotating quote.\n- **Pricing table with 3 towers.** Highlight the recommended tier with color and emphasis, not just extra height.\n- **Modals for everything.** Use inline editing, slide-over panels, or expandable sections instead of popups for simple actions.\n- **Avatar circles exclusively.** Try squircles or rounded squares for a less generic look.\n- **Light/dark toggle always a sun/moon switch.** Use a dropdown, system preference detection, or integrate it into settings.\n- **Footer link farm with 4 columns.** Simplify. Focus on main navigational paths and legally required links.\n\n### Iconography\n\n- **Lucide or Feather icons exclusively.** These are the \"default\" AI icon choice. Use Phosphor, Heroicons, or a custom set for differentiation.\n- **Rocketship for \"Launch\", shield for \"Security\".** Replace cliche metaphors with less obvious icons (bolt, fingerprint, spark, vault).\n- **Inconsistent stroke widths across icons.** Audit all icons and standardize to one stroke weight.\n- **Missing favicon.** Always include a branded favicon.\n- **Stock \"diverse team\" photos.** Use real team photos, candid shots, or a consistent illustration style instead of uncanny stock imagery.\n\n### Code Quality\n\n- **Div soup.** Use semantic HTML: `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>`.\n- **Inline styles mixed with CSS classes.** Move all styling to the project's styling system.\n- **Hardcoded pixel widths.** Use relative units (`%`, `rem`, `em`, `max-width`) for flexible layouts.\n- **Missing alt text on images.** Describe image content for screen readers. Never leave `alt=\"\"` or `alt=\"image\"` on meaningful images.\n- **Arbitrary z-index values like `9999`.** Establish a clean z-index scale in the theme/variables.\n- **Commented-out dead code.** Remove all debug artifacts before shipping.\n- **Import hallucinations.** Check that every import actually exists in `package.json` or the project dependencies.\n- **Missing meta tags.** Add proper `<title>`, `description`, `og:image`, and social sharing meta tags.\n\n### Strategic Omissions (What AI Typically Forgets)\n\n- **No legal links.** Add privacy policy and terms of service links in the footer.\n- **No \"back\" navigation.** Dead ends in user flows. Every page needs a way back.\n- **No custom 404 page.** Design a helpful, branded \"page not found\" experience.\n- **No form validation.** Add client-side validation for emails, required fields, and format checks.\n- **No \"skip to content\" link.** Essential for keyboard users. Add a hidden skip-link.\n- **No cookie consent.** If required by jurisdiction, add a compliant consent banner.\n\n## Upgrade Techniques\n\nWhen upgrading a project, pull from these high-impact techniques to replace generic patterns:\n\n### Typography Upgrades\n- **Variable font animation.** Interpolate weight or width on scroll or hover for text that feels alive.\n- **Outlined-to-fill transitions.** Text starts as a stroke outline and fills with color on scroll entry or interaction.\n- **Text mask reveals.** Large typography acting as a window to video or animated imagery behind it.\n\n### Layout Upgrades\n- **Broken grid / asymmetry.** Elements that deliberately ignore column structure — overlapping, bleeding off-screen, or offset with calculated randomness.\n- **Whitespace maximization.** Aggressive use of negative space to force focus on a single element.\n- **Parallax card stacks.** Sections that stick and physically stack over each other during scroll.\n- **Split-screen scroll.** Two halves of the screen sliding in opposite directions.\n\n### Motion Upgrades\n- **Smooth scroll with inertia.** Decouple scrolling from browser defaults for a heavier, cinematic feel.\n- **Staggered entry.** Elements cascade in with slight delays, combining Y-axis translation with opacity fade. Never mount everything at once.\n- **Spring physics.** Replace linear easing with spring-based motion for a natural, weighty feel on all interactive elements.\n- **Scroll-driven reveals.** Content entering through expanding masks, wipes, or draw-on SVG paths tied to scroll progress.\n\n### Surface Upgrades\n- **True glassmorphism.** Go beyond `backdrop-filter: blur`. Add a 1px inner border and a subtle inner shadow to simulate edge refraction.\n- **Spotlight borders.** Card borders that illuminate dynamically under the cursor.\n- **Grain and noise overlays.** A fixed, pointer-events-none overlay with subtle noise to break digital flatness.\n- **Colored, tinted shadows.** Shadows that carry the hue of the background rather than using generic black.\n\n## Fix Priority\n\nApply changes in this order for maximum visual impact with minimum risk:\n\n1. **Font swap** — biggest instant improvement, lowest risk\n2. **Color palette cleanup** — remove clashing or oversaturated colors\n3. **Hover and active states** — makes the interface feel alive\n4. **Layout and spacing** — proper grid, max-width, consistent padding\n5. **Replace generic components** — swap cliche patterns for modern alternatives\n6. **Add loading, empty, and error states** — makes it feel finished\n7. **Polish typography scale and spacing** — the premium final touch\n\n## Rules\n\n- Work with the existing tech stack. Do not migrate frameworks or styling libraries.\n- Do not break existing functionality. Test after every change.\n- Before importing any new library, check the project's dependency file first.\n- If the project uses Tailwind, check the version (v3 vs v4) before modifying config.\n- If the project has no framework, use vanilla CSS.\n- Keep changes reviewable and focused. Small, targeted improvements over big rewrites.\n",".agents/skills/stitch-design-taste/DESIGN.md":"# Design System: Taste Standard\n**Skill:** stitch-design-taste\n\n---\n\n## Configuration — Set Your Style\nAdjust these dials before using this design system. They control how creative, dense, and animated the output should be. Pick the level that fits your project.\n\n| Dial | Level | Description |\n|------|-------|-------------|\n| **Creativity** | `8` | `1` = Ultra-minimal, Swiss, silent, monochrome. `5` = Balanced, clean but with personality. `10` = Expressive, editorial, bold typography experiments, inline images in headlines, strong asymmetry. Default: `8` |\n| **Density** | `4` | `1` = Gallery-airy, massive whitespace. `5` = Balanced sections. `10` = Cockpit-dense, data-heavy. Default: `4` |\n| **Variance** | `8` | `1` = Predictable, symmetric grids. `5` = Subtle offsets. `10` = Artsy chaotic, no two sections alike. Default: `8` |\n| **Motion Intent** | `6` | `1` = Static, no animation noted. `5` = Subtle hover/entrance cues. `10` = Cinematic orchestration noted in every component. Default: `6` |\n\n> **How to use:** Change the numbers above to match your project's vibe. At **Creativity 1–3**, the system produces clean, quiet, Notion-like interfaces. At **Creativity 7–10**, expect inline image typography, dramatic scale contrast, and strong editorial layouts. The rest of the rules below adapt to your chosen levels.\n\n---\n\n## 1. Visual Theme & Atmosphere\nA restrained, gallery-airy interface with confident asymmetric layouts and fluid spring-physics motion. The atmosphere is clinical yet warm — like a well-lit architecture studio where every element earns its place through function. Density is balanced (Level 4), variance runs high (Level 8) to prevent symmetrical boredom, and motion is fluid but never theatrical (Level 6). The overall impression: expensive, intentional, alive.\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface. Warm-neutral, never clinical blue-white\n- **Pure Surface** (#FFFFFF) — Card and container fill. Used with whisper shadow for elevation\n- **Charcoal Ink** (#18181B) — Primary text. Zinc-950 depth — never pure black\n- **Steel Secondary** (#71717A) — Body text, descriptions, metadata. Zinc-500 warmth\n- **Muted Slate** (#94A3B8) — Tertiary text, timestamps, disabled states\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, structural 1px lines. Semi-transparent for depth\n- **Diffused Shadow** (rgba(0,0,0,0.05)) — Card elevation. Wide-spreading, 40px blur, -15px offset. Never harsh\n\n### Accent Selection (Pick ONE per project)\n- **Emerald Signal** (#10B981) — For growth, success, positive data dashboards\n- **Electric Blue** (#3B82F6) — For productivity, SaaS, developer tools\n- **Deep Rose** (#E11D48) — For creative, editorial, fashion-adjacent projects\n- **Amber Warmth** (#F59E0B) — For community, social, warm-toned products\n\n### Banned Colors\n- Purple/Violet neon gradients — the \"AI Purple\" aesthetic\n- Pure Black (#000000) — always Off-Black or Zinc-950\n- Oversaturated accents above 80% saturation\n- Mixed warm/cool gray systems within one project\n\n## 3. Typography Rules\n- **Display:** `Geist`, `Satoshi`, `Cabinet Grotesk`, or `Outfit` — Track-tight (`-0.025em`), controlled fluid scale, weight-driven hierarchy (700–900). Not screaming. Leading compressed (`1.1`). Alternatives forced — `Inter` is BANNED for premium contexts\n- **Body:** Same family at weight 400 — Relaxed leading (`1.65`), 65ch max-width, Steel Secondary color (#71717A)\n- **Mono:** `Geist Mono` or `JetBrains Mono` — For code blocks, metadata, timestamps. When density exceeds Level 7, all numbers switch to monospace\n- **Scale:** Display at `clamp(2.25rem, 5vw, 3.75rem)`. Body at `1rem/1.125rem`. Mono metadata at `0.8125rem`\n\n### Banned Fonts\n- `Inter` — banned everywhere in premium/creative contexts\n- Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) — BANNED. If serif is needed for editorial/creative, use only distinctive modern serifs like `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Never use default browser serif stacks. Serif is always BANNED in dashboards or software UIs regardless\n\n## 4. Component Stylings\n* **Buttons:** Flat surface, no outer glow. Primary: accent fill with white text. Secondary: ghost/outline. Active state: `-1px translateY` or `scale(0.98)` for tactile push. Hover: subtle background shift, never glow\n* **Cards/Containers:** Generously rounded corners (`2.5rem`). Pure white fill. Whisper border (`1px`, semi-transparent). Diffused shadow (`0 20px 40px -15px rgba(0,0,0,0.05)`). Internal padding `2rem–2.5rem`. Used ONLY when elevation communicates hierarchy — high-density layouts replace cards with `border-top` dividers or negative space\n* **Inputs/Forms:** Label positioned above input. Helper text optional. Error text below in Deep Rose. Focus ring in accent color, `2px` offset. No floating labels. Standard `0.5rem` gap between label-input-error stack\n* **Navigation:** Sleek, sticky. Icons scale on hover (Dock Magnification optional). No hamburger on desktop. Clean horizontal with generous spacing\n* **Loaders:** Skeletal shimmer matching exact layout dimensions and rounded corners. Shifting light reflection across placeholder shapes. Never circular spinners\n* **Empty States:** Composed illustration or icon composition with guidance text. Never just \"No data found\"\n* **Error States:** Inline, contextual. Red accent underline or border. Clear recovery action\n\n## 5. Hero Section\nThe Hero is the first impression — it must be striking, creative, and never generic.\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Example: \"We build [photo of hands typing] digital [photo of screen] products\" — images sit inline at type-height, rounded, acting as visual punctuation between words. This is the signature creative technique\n- **No Overlapping Elements:** Text must never overlap images or other text. Every element has its own clear spatial zone. No z-index stacking of content layers, no absolute-positioned headlines over images. Clean separation always\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons, and any instructional UI chrome are BANNED. The user knows how to scroll. Let the content pull them in naturally\n- **Asymmetric Structure:** Centered Hero layouts are BANNED at this variance level. Use Split Screen (50/50), Left-Aligned text / Right visual, or Asymmetric Whitespace with large empty zones\n- **CTA Restraint:** Maximum one primary CTA button. No secondary \"Learn more\" links. No redundant micro-copy below the headline\n\n## 6. Layout Principles\n- **Grid-First:** CSS Grid for all structural layouts. Never flexbox percentage math (`calc(33% - 1rem)` is BANNED)\n- **No Overlapping:** Elements must never overlap each other. No absolute-positioned layers stacking content on content. Every element occupies its own grid cell or flow position. Clean, separated spatial zones\n- **Feature Sections:** The \"3 equal cards in a row\" pattern is BANNED. Use 2-column Zig-Zag, asymmetric Bento grids (2fr 1fr 1fr), or horizontal scroll galleries\n- **Containment:** All content within `max-width: 1400px`, centered. Generous horizontal padding (`1rem` mobile, `2rem` tablet, `4rem` desktop)\n- **Full-Height:** Use `min-height: 100dvh` — never `height: 100vh` (iOS Safari address bar jump)\n- **Bento Architecture:** For feature grids, use Row 1: 3 columns | Row 2: 2 columns (70/30 split). Each tile contains a perpetual micro-animation\n\n## 7. Responsive Rules\nEvery screen must work flawlessly across all viewports. **Responsive is not optional — it is a hard requirement. Every single element must be tested at 375px, 768px, and 1440px.**\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to a strict single column. `width: 100%`, `padding: 1rem`, `gap: 1.5rem`. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure. All elements must fit within viewport width. If any element causes horizontal scroll, the design is broken\n- **Typography Scaling:** Headlines scale down gracefully via `clamp()`. Body text stays `1rem` minimum. Never shrink body below `14px`. Headlines must remain readable on 375px screens\n- **Touch Targets:** All interactive elements minimum `44px` tap target. Generous spacing between clickable items. Buttons must be full-width on mobile\n- **Image Behavior:** Hero and inline images scale proportionally. Inline typography images (photos between words) stack below the headline on mobile instead of inline\n- **Navigation:** Desktop horizontal nav collapses to a clean mobile menu (slide-in or full-screen overlay). No tiny hamburger icons without labels\n- **Cards & Grids:** Bento grids and asymmetric layouts revert to stacked single-column cards with full-width. Maintain internal padding (`1rem`)\n- **Spacing Consistency:** Vertical section gaps reduce proportionally on mobile (`clamp(3rem, 8vw, 6rem)`). Never cramped, never excessively airy\n- **Testing Viewports:** Designs must be verified at: `375px` (iPhone SE), `390px` (iPhone 14), `768px` (iPad), `1024px` (small laptop), `1440px` (desktop)\n\n## 8. Motion & Interaction (Code-Phase Intent)\n> **Note:** Stitch generates static screens — it does not animate. This section documents the **intended motion behavior** so that the coding agent (Antigravity, Cursor, etc.) knows exactly how to implement animations when building the exported design into a live product.\n\n- **Physics Engine:** Spring-based exclusively. `stiffness: 100, damping: 20`. No linear easing anywhere. Premium, weighty feel on all interactive elements\n- **Perpetual Micro-Loops:** Every active dashboard component has an infinite-loop state — Pulse on status dots, Typewriter on search bars, Float on feature icons, Shimmer on loading states\n- **Staggered Orchestration:** Lists and grids mount with cascaded delays (`animation-delay: calc(var(--index) * 100ms)`). Waterfall reveals, never instant mount\n- **Layout Transitions:** Smooth re-ordering via shared element IDs. Items swap positions with physics, simulating real-time intelligence\n- **Hardware Rules:** Animate ONLY `transform` and `opacity`. Never `top`, `left`, `width`, `height`. Grain/noise filters on fixed, pointer-events-none pseudo-elements only\n- **Performance:** CPU-heavy perpetual animations isolated in microscopic leaf components. Never trigger parent re-renders. Target 60fps minimum\n\n## 9. Anti-Patterns (Banned)\n- No emojis — anywhere in UI, code, or alt text\n- No `Inter` font — use `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — if serif is needed, use distinctive modern serifs only (`Fraunces`, `Instrument Serif`)\n- No pure black (`#000000`) — Off-Black or Zinc-950 only\n- No neon outer glows or default box-shadow glows\n- No oversaturated accent colors above 80%\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — text never overlaps images or other content. Clean spatial separation always\n- No 3-column equal card layouts for features\n- No centered Hero sections (at this variance level)\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", \"Discover more below\", scroll arrows, bouncing chevrons — all BANNED\n- No generic names: \"John Doe\", \"Sarah Chan\", \"Acme\", \"Nexus\", \"SmartFlow\"\n- No fake round numbers: `99.99%`, `50%`, `1234567` — use organic data: `47.2%`, `+1 (312) 847-1928`\n- No AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Revolutionize\"\n- No broken Unsplash links — use `picsum.photos/seed/{id}/800/600` or SVG UI Avatars\n- No generic `shadcn/ui` defaults — customize radii, colors, shadows to match this system\n- No `z-index` spam — use only for Navbar, Modal, Overlay layer contexts\n- No `h-screen` — always `min-h-[100dvh]`\n- No circular loading spinners — skeletal shimmer only\n",".agents/skills/stitch-design-taste/SKILL.md":"---\nname: stitch-design-taste\ndescription: Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.\n---\n\n# Stitch Design Taste — Semantic Design System Skill\n\n## Overview\nThis skill generates `DESIGN.md` files optimized for Google Stitch screen generation. It translates the battle-tested anti-slop frontend engineering directives into Stitch's native semantic design language — descriptive, natural-language rules paired with precise values that Stitch's AI agent can interpret to produce premium, non-generic interfaces.\n\nThe generated `DESIGN.md` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **\"Visual Descriptions\"** supported by specific color values, typography specs, and component behaviors.\n\n## Prerequisites\n- Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)\n- Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI\n\n## The Goal\nGenerate a `DESIGN.md` file that encodes:\n1. **Visual atmosphere** — the mood, density, and design philosophy\n2. **Color calibration** — neutrals, accents, and banned patterns with hex codes\n3. **Typographic architecture** — font stacks, scale hierarchy, and anti-patterns\n4. **Component behaviors** — buttons, cards, inputs with interaction states\n5. **Layout principles** — grid systems, spacing philosophy, responsive strategy\n6. **Motion philosophy** — animation engine specs, spring physics, perpetual micro-interactions\n7. **Anti-patterns** — explicit list of banned AI design clichés\n\n## Analysis & Synthesis Instructions\n\n### 1. Define the Atmosphere\nEvaluate the target project's intent. Use evocative adjectives from the taste spectrum:\n- **Density:** \"Art Gallery Airy\" (1–3) → \"Daily App Balanced\" (4–7) → \"Cockpit Dense\" (8–10)\n- **Variance:** \"Predictable Symmetric\" (1–3) → \"Offset Asymmetric\" (4–7) → \"Artsy Chaotic\" (8–10)\n- **Motion:** \"Static Restrained\" (1–3) → \"Fluid CSS\" (4–7) → \"Cinematic Choreography\" (8–10)\n\nDefault baseline: Variance 8, Motion 6, Density 4. Adapt dynamically based on user's vibe description.\n\n### 2. Map the Color Palette\nFor each color provide: **Descriptive Name** + **Hex Code** + **Functional Role**.\n\n**Mandatory constraints:**\n- Maximum 1 accent color. Saturation below 80%\n- The \"AI Purple/Blue Neon\" aesthetic is strictly BANNED — no purple button glows, no neon gradients\n- Use absolute neutral bases (Zinc/Slate) with high-contrast singular accents\n- Stick to one palette for the entire output — no warm/cool gray fluctuation\n- Never use pure black (`#000000`) — use Off-Black, Zinc-950, or Charcoal\n\n### 3. Establish Typography Rules\n- **Display/Headlines:** Track-tight, controlled scale. Not screaming. Hierarchy through weight and color, not just massive size\n- **Body:** Relaxed leading, max 65 characters per line\n- **Font Selection:** `Inter` is BANNED for premium/creative contexts. Force unique character: `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`\n- **Serif Ban:** Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) are BANNED. If serif is needed for editorial/creative contexts, use only distinctive modern serifs: `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Serif is always BANNED in dashboards or software UIs\n- **Dashboard Constraint:** Use Sans-Serif pairings exclusively (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`)\n- **High-Density Override:** When density exceeds 7, all numbers must use Monospace\n\n### 4. Define the Hero Section\nThe Hero is the first impression and must be creative, striking, and never generic:\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Images sit inline at type-height, rounded, acting as visual punctuation. This is the signature creative technique\n- **No Overlapping:** Text must never overlap images or other text. Every element occupies its own clean spatial zone\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons are BANNED. The content should pull users in naturally\n- **Asymmetric Structure:** Centered Hero layouts BANNED when variance exceeds 4\n- **CTA Restraint:** Maximum one primary CTA. No secondary \"Learn more\" links\n\n### 5. Describe Component Stylings\nFor each component type, describe shape, color, shadow depth, and interaction behavior:\n- **Buttons:** Tactile push feedback on active state. No neon outer glows. No custom mouse cursors\n- **Cards:** Use ONLY when elevation communicates hierarchy. Tint shadows to background hue. For high-density layouts, replace cards with border-top dividers or negative space\n- **Inputs/Forms:** Label above input, helper text optional, error text below. Standard gap spacing\n- **Loading States:** Skeletal loaders matching layout dimensions — no generic circular spinners\n- **Empty States:** Composed compositions indicating how to populate data\n- **Error States:** Clear, inline error reporting\n\n### 6. Define Layout Principles\n- No overlapping elements — every element occupies its own clear spatial zone. No absolute-positioned content stacking\n- Centered Hero sections are BANNED when variance exceeds 4 — force Split Screen, Left-Aligned, or Asymmetric Whitespace\n- The generic \"3 equal cards horizontally\" feature row is BANNED — use 2-column Zig-Zag, asymmetric grid, or horizontal scroll\n- CSS Grid over Flexbox math — never use `calc()` percentage hacks\n- Contain layouts using max-width constraints (e.g., 1400px centered)\n- Full-height sections must use `min-h-[100dvh]` — never `h-screen` (iOS Safari catastrophic jump)\n\n### 7. Define Responsive Rules\nEvery design must work across all viewports:\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to single column. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure\n- **Typography Scaling:** Headlines scale via `clamp()`. Body text minimum `1rem`/`14px`\n- **Touch Targets:** All interactive elements minimum `44px` tap target\n- **Image Behavior:** Inline typography images (photos between words) stack below headline on mobile\n- **Navigation:** Desktop horizontal nav collapses to clean mobile menu\n- **Spacing:** Vertical section gaps reduce proportionally (`clamp(3rem, 8vw, 6rem)`)\n\n### 8. Encode Motion Philosophy\n- **Spring Physics default:** `stiffness: 100, damping: 20` — premium, weighty feel. No linear easing\n- **Perpetual Micro-Interactions:** Every active component should have an infinite loop state (Pulse, Typewriter, Float, Shimmer)\n- **Staggered Orchestration:** Never mount lists instantly — use cascade delays for waterfall reveals\n- **Performance:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`. Grain/noise filters on fixed pseudo-elements only\n\n### 9. List Anti-Patterns (AI Tells)\nEncode these as explicit \"NEVER DO\" rules in the DESIGN.md:\n- No emojis anywhere\n- No `Inter` font\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — distinctive modern serifs only if needed\n- No pure black (`#000000`)\n- No neon/outer glow shadows\n- No oversaturated accents\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — clean spatial separation always\n- No 3-column equal card layouts\n- No generic names (\"John Doe\", \"Acme\", \"Nexus\")\n- No fake round numbers (`99.99%`, `50%`)\n- No AI copywriting clichés (\"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\")\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", scroll arrows, bouncing chevrons\n- No broken Unsplash links — use `picsum.photos` or SVG avatars\n- No centered Hero sections (for high-variance projects)\n\n## Output Format (DESIGN.md Structure)\n\n```markdown\n# Design System: [Project Title]\n\n## 1. Visual Theme & Atmosphere\n(Evocative description of the mood, density, variance, and motion intensity.\nExample: \"A restrained, gallery-airy interface with confident asymmetric layouts\nand fluid spring-physics motion. The atmosphere is clinical yet warm — like a\nwell-lit architecture studio.\")\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface\n- **Pure Surface** (#FFFFFF) — Card and container fill\n- **Charcoal Ink** (#18181B) — Primary text, Zinc-950 depth\n- **Muted Steel** (#71717A) — Secondary text, descriptions, metadata\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, 1px structural lines\n- **[Accent Name]** (#XXXXXX) — Single accent for CTAs, active states, focus rings\n(Max 1 accent. Saturation < 80%. No purple/neon.)\n\n## 3. Typography Rules\n- **Display:** [Font Name] — Track-tight, controlled scale, weight-driven hierarchy\n- **Body:** [Font Name] — Relaxed leading, 65ch max-width, neutral secondary color\n- **Mono:** [Font Name] — For code, metadata, timestamps, high-density numbers\n- **Banned:** Inter, generic system fonts for premium contexts. Serif fonts banned in dashboards.\n\n## 4. Component Stylings\n* **Buttons:** Flat, no outer glow. Tactile -1px translate on active. Accent fill for primary, ghost/outline for secondary.\n* **Cards:** Generously rounded corners (2.5rem). Diffused whisper shadow. Used only when elevation serves hierarchy. High-density: replace with border-top dividers.\n* **Inputs:** Label above, error below. Focus ring in accent color. No floating labels.\n* **Loaders:** Skeletal shimmer matching exact layout dimensions. No circular spinners.\n* **Empty States:** Composed, illustrated compositions — not just \"No data\" text.\n\n## 5. Layout Principles\n(Grid-first responsive architecture. Asymmetric splits for Hero sections.\nStrict single-column collapse below 768px. Max-width containment.\nNo flexbox percentage math. Generous internal padding.)\n\n## 6. Motion & Interaction\n(Spring physics for all interactive elements. Staggered cascade reveals.\nPerpetual micro-loops on active dashboard components. Hardware-accelerated\ntransforms only. Isolated Client Components for CPU-heavy animations.)\n\n## 7. Anti-Patterns (Banned)\n(Explicit list of forbidden patterns: no emojis, no Inter, no pure black,\nno neon glows, no 3-column equal grids, no AI copywriting clichés,\nno generic placeholder names, no broken image links.)\n```\n\n## Best Practices\n- **Be Descriptive:** \"Deep Charcoal Ink (#18181B)\" — not just \"dark text\"\n- **Be Functional:** Explain what each element is used for\n- **Be Consistent:** Same terminology throughout the document\n- **Be Precise:** Include exact hex codes, rem values, pixel values in parentheses\n- **Be Opinionated:** This is not a neutral template — it enforces a specific, premium aesthetic\n\n## Tips for Success\n1. Start with the atmosphere — understand the vibe before detailing tokens\n2. Look for patterns — identify consistent spacing, sizing, and styling\n3. Think semantically — name colors by purpose, not just appearance\n4. Consider hierarchy — document how visual weight communicates importance\n5. Encode the bans — anti-patterns are as important as the rules themselves\n\n## Common Pitfalls to Avoid\n- Using technical jargon without translation (\"rounded-xl\" instead of \"generously rounded corners\")\n- Omitting hex codes or using only descriptive names\n- Forgetting functional roles of design elements\n- Being too vague in atmosphere descriptions\n- Ignoring the anti-pattern list — these are what make the output premium\n- Defaulting to generic \"safe\" designs instead of enforcing the curated aesthetic\n",".agents/skills/vercel-react-best-practices/AGENTS.md":"# React Best Practices\n\n**Version 1.0.0**  \nVercel Engineering  \nJanuary 2026\n\n> **Note:**  \n> This document is mainly for agents and LLMs to follow when maintaining,  \n> generating, or refactoring React and Next.js codebases. Humans  \n> may also find it useful, but guidance here is optimized for automation  \n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.\n\n---\n\n## Table of Contents\n\n1. [Eliminating Waterfalls](#1-eliminating-waterfalls) — **CRITICAL**\n   - 1.1 [Check Cheap Conditions Before Async Flags](#11-check-cheap-conditions-before-async-flags)\n   - 1.2 [Defer Await Until Needed](#12-defer-await-until-needed)\n   - 1.3 [Dependency-Based Parallelization](#13-dependency-based-parallelization)\n   - 1.4 [Prevent Waterfall Chains in API Routes](#14-prevent-waterfall-chains-in-api-routes)\n   - 1.5 [Promise.all() for Independent Operations](#15-promiseall-for-independent-operations)\n   - 1.6 [Strategic Suspense Boundaries](#16-strategic-suspense-boundaries)\n2. [Bundle Size Optimization](#2-bundle-size-optimization) — **CRITICAL**\n   - 2.1 [Avoid Barrel File Imports](#21-avoid-barrel-file-imports)\n   - 2.2 [Conditional Module Loading](#22-conditional-module-loading)\n   - 2.3 [Defer Non-Critical Third-Party Libraries](#23-defer-non-critical-third-party-libraries)\n   - 2.4 [Dynamic Imports for Heavy Components](#24-dynamic-imports-for-heavy-components)\n   - 2.5 [Preload Based on User Intent](#25-preload-based-on-user-intent)\n3. [Server-Side Performance](#3-server-side-performance) — **HIGH**\n   - 3.1 [Authenticate Server Actions Like API Routes](#31-authenticate-server-actions-like-api-routes)\n   - 3.2 [Avoid Duplicate Serialization in RSC Props](#32-avoid-duplicate-serialization-in-rsc-props)\n   - 3.3 [Cross-Request LRU Caching](#33-cross-request-lru-caching)\n   - 3.4 [Hoist Static I/O to Module Level](#34-hoist-static-io-to-module-level)\n   - 3.5 [Minimize Serialization at RSC Boundaries](#35-minimize-serialization-at-rsc-boundaries)\n   - 3.6 [Parallel Data Fetching with Component Composition](#36-parallel-data-fetching-with-component-composition)\n   - 3.7 [Parallel Nested Data Fetching](#37-parallel-nested-data-fetching)\n   - 3.8 [Per-Request Deduplication with React.cache()](#38-per-request-deduplication-with-reactcache)\n   - 3.9 [Use after() for Non-Blocking Operations](#39-use-after-for-non-blocking-operations)\n4. [Client-Side Data Fetching](#4-client-side-data-fetching) — **MEDIUM-HIGH**\n   - 4.1 [Deduplicate Global Event Listeners](#41-deduplicate-global-event-listeners)\n   - 4.2 [Use Passive Event Listeners for Scrolling Performance](#42-use-passive-event-listeners-for-scrolling-performance)\n   - 4.3 [Use SWR for Automatic Deduplication](#43-use-swr-for-automatic-deduplication)\n   - 4.4 [Version and Minimize localStorage Data](#44-version-and-minimize-localstorage-data)\n5. [Re-render Optimization](#5-re-render-optimization) — **MEDIUM**\n   - 5.1 [Calculate Derived State During Rendering](#51-calculate-derived-state-during-rendering)\n   - 5.2 [Defer State Reads to Usage Point](#52-defer-state-reads-to-usage-point)\n   - 5.3 [Do not wrap a simple expression with a primitive result type in useMemo](#53-do-not-wrap-a-simple-expression-with-a-primitive-result-type-in-usememo)\n   - 5.4 [Don't Define Components Inside Components](#54-dont-define-components-inside-components)\n   - 5.5 [Extract Default Non-primitive Parameter Value from Memoized Component to Constant](#55-extract-default-non-primitive-parameter-value-from-memoized-component-to-constant)\n   - 5.6 [Extract to Memoized Components](#56-extract-to-memoized-components)\n   - 5.7 [Narrow Effect Dependencies](#57-narrow-effect-dependencies)\n   - 5.8 [Put Interaction Logic in Event Handlers](#58-put-interaction-logic-in-event-handlers)\n   - 5.9 [Split Combined Hook Computations](#59-split-combined-hook-computations)\n   - 5.10 [Subscribe to Derived State](#510-subscribe-to-derived-state)\n   - 5.11 [Use Functional setState Updates](#511-use-functional-setstate-updates)\n   - 5.12 [Use Lazy State Initialization](#512-use-lazy-state-initialization)\n   - 5.13 [Use Transitions for Non-Urgent Updates](#513-use-transitions-for-non-urgent-updates)\n   - 5.14 [Use useDeferredValue for Expensive Derived Renders](#514-use-usedeferredvalue-for-expensive-derived-renders)\n   - 5.15 [Use useRef for Transient Values](#515-use-useref-for-transient-values)\n6. [Rendering Performance](#6-rendering-performance) — **MEDIUM**\n   - 6.1 [Animate SVG Wrapper Instead of SVG Element](#61-animate-svg-wrapper-instead-of-svg-element)\n   - 6.2 [CSS content-visibility for Long Lists](#62-css-content-visibility-for-long-lists)\n   - 6.3 [Hoist Static JSX Elements](#63-hoist-static-jsx-elements)\n   - 6.4 [Optimize SVG Precision](#64-optimize-svg-precision)\n   - 6.5 [Prevent Hydration Mismatch Without Flickering](#65-prevent-hydration-mismatch-without-flickering)\n   - 6.6 [Suppress Expected Hydration Mismatches](#66-suppress-expected-hydration-mismatches)\n   - 6.7 [Use Activity Component for Show/Hide](#67-use-activity-component-for-showhide)\n   - 6.8 [Use defer or async on Script Tags](#68-use-defer-or-async-on-script-tags)\n   - 6.9 [Use Explicit Conditional Rendering](#69-use-explicit-conditional-rendering)\n   - 6.10 [Use React DOM Resource Hints](#610-use-react-dom-resource-hints)\n   - 6.11 [Use useTransition Over Manual Loading States](#611-use-usetransition-over-manual-loading-states)\n7. [JavaScript Performance](#7-javascript-performance) — **LOW-MEDIUM**\n   - 7.1 [Avoid Layout Thrashing](#71-avoid-layout-thrashing)\n   - 7.2 [Build Index Maps for Repeated Lookups](#72-build-index-maps-for-repeated-lookups)\n   - 7.3 [Cache Property Access in Loops](#73-cache-property-access-in-loops)\n   - 7.4 [Cache Repeated Function Calls](#74-cache-repeated-function-calls)\n   - 7.5 [Cache Storage API Calls](#75-cache-storage-api-calls)\n   - 7.6 [Combine Multiple Array Iterations](#76-combine-multiple-array-iterations)\n   - 7.7 [Defer Non-Critical Work with requestIdleCallback](#77-defer-non-critical-work-with-requestidlecallback)\n   - 7.8 [Early Length Check for Array Comparisons](#78-early-length-check-for-array-comparisons)\n   - 7.9 [Early Return from Functions](#79-early-return-from-functions)\n   - 7.10 [Hoist RegExp Creation](#710-hoist-regexp-creation)\n   - 7.11 [Use flatMap to Map and Filter in One Pass](#711-use-flatmap-to-map-and-filter-in-one-pass)\n   - 7.12 [Use Loop for Min/Max Instead of Sort](#712-use-loop-for-minmax-instead-of-sort)\n   - 7.13 [Use Set/Map for O(1) Lookups](#713-use-setmap-for-o1-lookups)\n   - 7.14 [Use toSorted() Instead of sort() for Immutability](#714-use-tosorted-instead-of-sort-for-immutability)\n8. [Advanced Patterns](#8-advanced-patterns) — **LOW**\n   - 8.1 [Initialize App Once, Not Per Mount](#81-initialize-app-once-not-per-mount)\n   - 8.2 [Store Event Handlers in Refs](#82-store-event-handlers-in-refs)\n   - 8.3 [useEffectEvent for Stable Callback Refs](#83-useeffectevent-for-stable-callback-refs)\n\n---\n\n## 1. Eliminating Waterfalls\n\n**Impact: CRITICAL**\n\nWaterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n### 1.1 Check Cheap Conditions Before Async Flags\n\n**Impact: HIGH (avoids unnecessary async work when a synchronous guard already fails)**\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n\n### 1.2 Defer Await Until Needed\n\n**Impact: HIGH (avoids blocking unused code paths)**\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect: blocks both branches**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct: only blocks when needed**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example: early return optimization**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n\n### 1.3 Dependency-Based Parallelization\n\n**Impact: CRITICAL (2-10× improvement)**\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect: profile waits for config unnecessarily**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct: config and profile run in parallel**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n\n### 1.4 Prevent Waterfall Chains in API Routes\n\n**Impact: CRITICAL (2-10× improvement)**\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect: config waits for auth, data waits for both**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct: auth and config start immediately**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n\n### 1.5 Promise.all() for Independent Operations\n\n**Impact: CRITICAL (2-10× improvement)**\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect: sequential execution, 3 round trips**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct: parallel execution, 1 round trip**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n\n### 1.6 Strategic Suspense Boundaries\n\n**Impact: HIGH (faster initial paint)**\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect: wrapper blocked by data fetching**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct: wrapper shows immediately, data streams in**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative: share promise across components**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n\n- SEO-critical content above the fold\n\n- Small, fast queries where suspense overhead isn't worth it\n\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n\n---\n\n## 2. Bundle Size Optimization\n\n**Impact: CRITICAL**\n\nReducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n### 2.1 Avoid Barrel File Imports\n\n**Impact: CRITICAL (200-800ms import cost, slow builds)**\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect: imports entire library**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [https://vercel.com/blog/how-we-optimized-package-imports-in-next-js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n\n### 2.2 Conditional Module Loading\n\n**Impact: HIGH (loads large data only when needed)**\n\nLoad large data or modules only when a feature is activated.\n\n**Example: lazy-load animation frames**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n\n### 2.3 Defer Non-Critical Third-Party Libraries\n\n**Impact: MEDIUM (loads after hydration)**\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect: blocks initial bundle**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct: loads after hydration**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n### 2.4 Dynamic Imports for Heavy Components\n\n**Impact: CRITICAL (directly affects TTI and LCP)**\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect: Monaco bundles with main chunk ~300KB**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct: Monaco loads on demand**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n### 2.5 Preload Based on User Intent\n\n**Impact: MEDIUM (reduces perceived latency)**\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example: preload on hover/focus**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example: preload when feature flag is enabled**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n\n---\n\n## 3. Server-Side Performance\n\n**Impact: HIGH**\n\nOptimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n### 3.1 Authenticate Server Actions Like API Routes\n\n**Impact: CRITICAL (prevents unauthorized access to server mutations)**\n\nServer Actions (functions with `\"use server\"`) are exposed as public endpoints, just like API routes. Always verify authentication and authorization **inside** each Server Action—do not rely solely on middleware, layout guards, or page-level checks, as Server Actions can be invoked directly.\n\nNext.js documentation explicitly states: \"Treat Server Actions with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation.\"\n\n**Incorrect: no authentication check**\n\n```typescript\n\"use server\";\n\nexport async function deleteUser(userId: string) {\n  // Anyone can call this! No auth check\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**Correct: authentication inside the action**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { unauthorized } from \"@/lib/errors\";\n\nexport async function deleteUser(userId: string) {\n  // Always check auth inside the action\n  const session = await verifySession();\n\n  if (!session) {\n    throw unauthorized(\"Must be logged in\");\n  }\n\n  // Check authorization too\n  if (session.user.role !== \"admin\" && session.user.id !== userId) {\n    throw unauthorized(\"Cannot delete other users\");\n  }\n\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**With input validation:**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { z } from \"zod\";\n\nconst updateProfileSchema = z.object({\n  userId: z.string().uuid(),\n  name: z.string().min(1).max(100),\n  email: z.string().email(),\n});\n\nexport async function updateProfile(data: unknown) {\n  // Validate input first\n  const validated = updateProfileSchema.parse(data);\n\n  // Then authenticate\n  const session = await verifySession();\n  if (!session) {\n    throw new Error(\"Unauthorized\");\n  }\n\n  // Then authorize\n  if (session.user.id !== validated.userId) {\n    throw new Error(\"Can only update own profile\");\n  }\n\n  // Finally perform the mutation\n  await db.user.update({\n    where: { id: validated.userId },\n    data: {\n      name: validated.name,\n      email: validated.email,\n    },\n  });\n\n  return { success: true };\n}\n```\n\nReference: [https://nextjs.org/docs/app/guides/authentication](https://nextjs.org/docs/app/guides/authentication)\n\n### 3.2 Avoid Duplicate Serialization in RSC Props\n\n**Impact: LOW (reduces network payload by avoiding duplicate serialization)**\n\nRSC→client serialization deduplicates by object reference, not value. Same reference = serialized once; new reference = serialized again. Do transformations (`.toSorted()`, `.filter()`, `.map()`) in client, not server.\n\n**Incorrect: duplicates array**\n\n```tsx\n// RSC: sends 6 strings (2 arrays × 3 items)\n<ClientList usernames={usernames} usernamesOrdered={usernames.toSorted()} />\n```\n\n**Correct: sends 3 strings**\n\n```tsx\n// RSC: send once\n<ClientList usernames={usernames} />;\n\n// Client: transform there\n(\"use client\");\nconst sorted = useMemo(() => [...usernames].sort(), [usernames]);\n```\n\n**Nested deduplication behavior:**\n\n```tsx\n// string[] - duplicates everything\nusernames={['a','b']} sorted={usernames.toSorted()} // sends 4 strings\n\n// object[] - duplicates array structure only\nusers={[{id:1},{id:2}]} sorted={users.toSorted()} // sends 2 arrays + 2 unique objects (not 4)\n```\n\nDeduplication works recursively. Impact varies by data type:\n\n- `string[]`, `number[]`, `boolean[]`: **HIGH impact** - array + all primitives fully duplicated\n\n- `object[]`: **LOW impact** - array duplicated, but nested objects deduplicated by reference\n\n**Operations breaking deduplication: create new references**\n\n- Arrays: `.toSorted()`, `.filter()`, `.map()`, `.slice()`, `[...arr]`\n\n- Objects: `{...obj}`, `Object.assign()`, `structuredClone()`, `JSON.parse(JSON.stringify())`\n\n**More examples:**\n\n```tsx\n// ❌ Bad\n<C users={users} active={users.filter(u => u.active)} />\n<C product={product} productName={product.name} />\n\n// ✅ Good\n<C users={users} />\n<C product={product} />\n// Do filtering/destructuring in client\n```\n\n**Exception:** Pass derived data when transformation is expensive or client doesn't need original.\n\n### 3.3 Cross-Request LRU Caching\n\n**Impact: HIGH (caches across requests)**\n\n`React.cache()` only works within one request. For data shared across sequential requests (user clicks button A then button B), use an LRU cache.\n\n**Implementation:**\n\n```typescript\nimport { LRUCache } from \"lru-cache\";\n\nconst cache = new LRUCache<string, any>({\n  max: 1000,\n  ttl: 5 * 60 * 1000, // 5 minutes\n});\n\nexport async function getUser(id: string) {\n  const cached = cache.get(id);\n  if (cached) return cached;\n\n  const user = await db.user.findUnique({ where: { id } });\n  cache.set(id, user);\n  return user;\n}\n\n// Request 1: DB query, result cached\n// Request 2: cache hit, no DB query\n```\n\nUse when sequential user actions hit multiple endpoints needing the same data within seconds.\n\n**With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute):** LRU caching is especially effective because multiple concurrent requests can share the same function instance and cache. This means the cache persists across requests without needing external storage like Redis.\n\n**In traditional serverless:** Each invocation runs in isolation, so consider Redis for cross-process caching.\n\nReference: [https://github.com/isaacs/node-lru-cache](https://github.com/isaacs/node-lru-cache)\n\n### 3.4 Hoist Static I/O to Module Level\n\n**Impact: HIGH (avoids repeated file/network I/O per request)**\n\nWhen loading static assets (fonts, logos, images, config files) in route handlers or server functions, hoist the I/O operation to module level. Module-level code runs once when the module is first imported, not on every request. This eliminates redundant file system reads or network fetches that would otherwise run on every invocation.\n\n**Incorrect: reads font file on every request**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\nexport async function GET(request: Request) {\n  // Runs on EVERY request - expensive!\n  const fontData = await fetch(\n    new URL('./fonts/Inter.ttf', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  const logoData = await fetch(\n    new URL('./images/logo.png', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Correct: loads once at module initialization**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\n// Module-level: runs ONCE when module is first imported\nconst fontData = fetch(\n  new URL('./fonts/Inter.ttf', import.meta.url)\n).then(res => res.arrayBuffer())\n\nconst logoData = fetch(\n  new URL('./images/logo.png', import.meta.url)\n).then(res => res.arrayBuffer())\n\nexport async function GET(request: Request) {\n  // Await the already-started promises\n  const [font, logo] = await Promise.all([fontData, logoData])\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logo} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: font }] }\n  )\n}\n```\n\n**Correct: synchronous fs at module level**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\nimport { readFileSync } from 'fs'\nimport { join } from 'path'\n\n// Synchronous read at module level - blocks only during module init\nconst fontData = readFileSync(\n  join(process.cwd(), 'public/fonts/Inter.ttf')\n)\n\nconst logoData = readFileSync(\n  join(process.cwd(), 'public/images/logo.png')\n)\n\nexport async function GET(request: Request) {\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Incorrect: reads config on every call**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nexport async function processRequest(data: Data) {\n  const config = JSON.parse(await fs.readFile(\"./config.json\", \"utf-8\"));\n  const template = await fs.readFile(\"./template.html\", \"utf-8\");\n\n  return render(template, data, config);\n}\n```\n\n**Correct: hoists config and template to module level**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nconst configPromise = fs.readFile(\"./config.json\", \"utf-8\").then(JSON.parse);\nconst templatePromise = fs.readFile(\"./template.html\", \"utf-8\");\n\nexport async function processRequest(data: Data) {\n  const [config, template] = await Promise.all([\n    configPromise,\n    templatePromise,\n  ]);\n\n  return render(template, data, config);\n}\n```\n\nWhen to use this pattern:\n\n- Loading fonts for OG image generation\n\n- Loading static logos, icons, or watermarks\n\n- Reading configuration files that don't change at runtime\n\n- Loading email templates or other static templates\n\n- Any static asset that's the same across all requests\n\nWhen not to use this pattern:\n\n- Assets that vary per request or user\n\n- Files that may change during runtime (use caching with TTL instead)\n\n- Large files that would consume too much memory if kept loaded\n\n- Sensitive data that shouldn't persist in memory\n\nWith Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute), module-level caching is especially effective because multiple concurrent requests share the same function instance. The static assets stay loaded in memory across requests without cold start penalties.\n\nIn traditional serverless, each cold start re-executes module-level code, but subsequent warm invocations reuse the loaded assets until the instance is recycled.\n\n### 3.5 Minimize Serialization at RSC Boundaries\n\n**Impact: HIGH (reduces data transfer size)**\n\nThe React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.\n\n**Incorrect: serializes all 50 fields**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser(); // 50 fields\n  return <Profile user={user} />;\n}\n\n(\"use client\");\nfunction Profile({ user }: { user: User }) {\n  return <div>{user.name}</div>; // uses 1 field\n}\n```\n\n**Correct: serializes only 1 field**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser();\n  return <Profile name={user.name} />;\n}\n\n(\"use client\");\nfunction Profile({ name }: { name: string }) {\n  return <div>{name}</div>;\n}\n```\n\n### 3.6 Parallel Data Fetching with Component Composition\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nReact Server Components execute sequentially within a tree. Restructure with composition to parallelize data fetching.\n\n**Incorrect: Sidebar waits for Page's fetch to complete**\n\n```tsx\nexport default async function Page() {\n  const header = await fetchHeader();\n  return (\n    <div>\n      <div>{header}</div>\n      <Sidebar />\n    </div>\n  );\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n```\n\n**Correct: both fetch simultaneously**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nexport default function Page() {\n  return (\n    <div>\n      <Header />\n      <Sidebar />\n    </div>\n  );\n}\n```\n\n**Alternative with children prop:**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nfunction Layout({ children }: { children: ReactNode }) {\n  return (\n    <div>\n      <Header />\n      {children}\n    </div>\n  );\n}\n\nexport default function Page() {\n  return (\n    <Layout>\n      <Sidebar />\n    </Layout>\n  );\n}\n```\n\n### 3.7 Parallel Nested Data Fetching\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nWhen fetching nested data in parallel, chain dependent fetches within each item's promise so a slow item doesn't block the rest.\n\n**Incorrect: a single slow item blocks all nested fetches**\n\n```tsx\nconst chats = await Promise.all(chatIds.map((id) => getChat(id)));\n\nconst chatAuthors = await Promise.all(\n  chats.map((chat) => getUser(chat.author)),\n);\n```\n\nIf one `getChat(id)` out of 100 is extremely slow, the authors of the other 99 chats can't start loading even though their data is ready.\n\n**Correct: each item chains its own nested fetch**\n\n```tsx\nconst chatAuthors = await Promise.all(\n  chatIds.map((id) => getChat(id).then((chat) => getUser(chat.author))),\n);\n```\n\nEach item independently chains `getChat` → `getUser`, so a slow chat doesn't block author fetches for the others.\n\n### 3.8 Per-Request Deduplication with React.cache()\n\n**Impact: MEDIUM (deduplicates within request)**\n\nUse `React.cache()` for server-side request deduplication. Authentication and database queries benefit most.\n\n**Usage:**\n\n```typescript\nimport { cache } from \"react\";\n\nexport const getCurrentUser = cache(async () => {\n  const session = await auth();\n  if (!session?.user?.id) return null;\n  return await db.user.findUnique({\n    where: { id: session.user.id },\n  });\n});\n```\n\nWithin a single request, multiple calls to `getCurrentUser()` execute the query only once.\n\n**Avoid inline objects as arguments:**\n\n`React.cache()` uses shallow equality (`Object.is`) to determine cache hits. Inline objects create new references each call, preventing cache hits.\n\n**Incorrect: always cache miss**\n\n```typescript\nconst getUser = cache(async (params: { uid: number }) => {\n  return await db.user.findUnique({ where: { id: params.uid } });\n});\n\n// Each call creates new object, never hits cache\ngetUser({ uid: 1 });\ngetUser({ uid: 1 }); // Cache miss, runs query again\n```\n\n**Correct: cache hit**\n\n```typescript\nconst params = { uid: 1 };\ngetUser(params); // Query runs\ngetUser(params); // Cache hit (same reference)\n```\n\nIf you must pass objects, pass the same reference:\n\n**Next.js-Specific Note:**\n\nIn Next.js, the `fetch` API is automatically extended with request memoization. Requests with the same URL and options are automatically deduplicated within a single request, so you don't need `React.cache()` for `fetch` calls. However, `React.cache()` is still essential for other async tasks:\n\n- Database queries (Prisma, Drizzle, etc.)\n\n- Heavy computations\n\n- Authentication checks\n\n- File system operations\n\n- Any non-fetch async work\n\nUse `React.cache()` to deduplicate these operations across your component tree.\n\nReference: [https://react.dev/reference/react/cache](https://react.dev/reference/react/cache)\n\n### 3.9 Use after() for Non-Blocking Operations\n\n**Impact: MEDIUM (faster response times)**\n\nUse Next.js's `after()` to schedule work that should execute after a response is sent. This prevents logging, analytics, and other side effects from blocking the response.\n\n**Incorrect: blocks response**\n\n```tsx\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Logging blocks the response\n  const userAgent = request.headers.get(\"user-agent\") || \"unknown\";\n  await logUserAction({ userAgent });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\n**Correct: non-blocking**\n\n```tsx\nimport { after } from \"next/server\";\nimport { headers, cookies } from \"next/headers\";\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Log after response is sent\n  after(async () => {\n    const userAgent = (await headers()).get(\"user-agent\") || \"unknown\";\n    const sessionCookie =\n      (await cookies()).get(\"session-id\")?.value || \"anonymous\";\n\n    logUserAction({ sessionCookie, userAgent });\n  });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\nThe response is sent immediately while logging happens in the background.\n\n**Common use cases:**\n\n- Analytics tracking\n\n- Audit logging\n\n- Sending notifications\n\n- Cache invalidation\n\n- Cleanup tasks\n\n**Important notes:**\n\n- `after()` runs even if the response fails or redirects\n\n- Works in Server Actions, Route Handlers, and Server Components\n\nReference: [https://nextjs.org/docs/app/api-reference/functions/after](https://nextjs.org/docs/app/api-reference/functions/after)\n\n---\n\n## 4. Client-Side Data Fetching\n\n**Impact: MEDIUM-HIGH**\n\nAutomatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n### 4.1 Deduplicate Global Event Listeners\n\n**Impact: LOW (single listener for N components)**\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect: N instances = N listeners**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct: N instances = 1 listener**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n\n### 4.2 Use Passive Event Listeners for Scrolling Performance\n\n**Impact: MEDIUM (eliminates scroll delay caused by event listeners)**\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n\n### 4.3 Use SWR for Automatic Deduplication\n\n**Impact: MEDIUM-HIGH (automatic deduplication)**\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect: no deduplication, each instance fetches**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct: multiple instances share one request**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n\n### 4.4 Version and Minimize localStorage Data\n\n**Impact: MEDIUM (prevents schema conflicts, reduces storage size)**\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n\n---\n\n## 5. Re-render Optimization\n\n**Impact: MEDIUM**\n\nReducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n### 5.1 Calculate Derived State During Rendering\n\n**Impact: MEDIUM (avoids redundant renders and state drift)**\n\nIf a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.\n\n**Incorrect: redundant state and effect**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const [fullName, setFullName] = useState(\"\");\n\n  useEffect(() => {\n    setFullName(firstName + \" \" + lastName);\n  }, [firstName, lastName]);\n\n  return <p>{fullName}</p>;\n}\n```\n\n**Correct: derive during render**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const fullName = firstName + \" \" + lastName;\n\n  return <p>{fullName}</p>;\n}\n```\n\nReference: [https://react.dev/learn/you-might-not-need-an-effect](https://react.dev/learn/you-might-not-need-an-effect)\n\n### 5.2 Defer State Reads to Usage Point\n\n**Impact: MEDIUM (avoids unnecessary subscriptions)**\n\nDon't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.\n\n**Incorrect: subscribes to all searchParams changes**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const searchParams = useSearchParams();\n\n  const handleShare = () => {\n    const ref = searchParams.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n**Correct: reads on demand, no subscription**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const handleShare = () => {\n    const params = new URLSearchParams(window.location.search);\n    const ref = params.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n### 5.3 Do not wrap a simple expression with a primitive result type in useMemo\n\n**Impact: LOW-MEDIUM (wasted computation on every render)**\n\nWhen an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.\n\nCalling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.\n\n**Incorrect:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = useMemo(() => {\n    return user.isLoading || notifications.isLoading;\n  }, [user.isLoading, notifications.isLoading]);\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n**Correct:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = user.isLoading || notifications.isLoading;\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n### 5.4 Don't Define Components Inside Components\n\n**Impact: HIGH (prevents remount on every render)**\n\nDefining a component inside another component creates a new component type on every render. React sees a different component each time and fully remounts it, destroying all state and DOM.\n\nA common reason developers do this is to access parent variables without passing props. Always pass props instead.\n\n**Incorrect: remounts on every render**\n\n```tsx\nfunction UserProfile({ user, theme }) {\n  // Defined inside to access `theme` - BAD\n  const Avatar = () => (\n    <img\n      src={user.avatarUrl}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n\n  // Defined inside to access `user` - BAD\n  const Stats = () => (\n    <div>\n      <span>{user.followers} followers</span>\n      <span>{user.posts} posts</span>\n    </div>\n  );\n\n  return (\n    <div>\n      <Avatar />\n      <Stats />\n    </div>\n  );\n}\n```\n\nEvery time `UserProfile` renders, `Avatar` and `Stats` are new component types. React unmounts the old instances and mounts new ones, losing any internal state, running effects again, and recreating DOM nodes.\n\n**Correct: pass props instead**\n\n```tsx\nfunction Avatar({ src, theme }: { src: string; theme: string }) {\n  return (\n    <img\n      src={src}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n}\n\nfunction St\n\n<!-- [TRUNCATED AT 50KB] -->",".agents/skills/vercel-react-best-practices/README.md":"# React Best Practices\n\nA structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `src/` - Build scripts and utilities\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n- **`test-cases.json`** - Test cases for LLM evaluation (generated)\n\n## Getting Started\n\n1. Install dependencies:\n\n   ```bash\n   pnpm install\n   ```\n\n2. Build AGENTS.md from rules:\n\n   ```bash\n   pnpm build\n   ```\n\n3. Validate rule files:\n\n   ```bash\n   pnpm validate\n   ```\n\n4. Extract test cases:\n   ```bash\n   pnpm extract-tests\n   ```\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `async-` for Eliminating Waterfalls (Section 1)\n   - `bundle-` for Bundle Size Optimization (Section 2)\n   - `server-` for Server-Side Performance (Section 3)\n   - `client-` for Client-Side Data Fetching (Section 4)\n   - `rerender-` for Re-render Optimization (Section 5)\n   - `rendering-` for Rendering Performance (Section 6)\n   - `js-` for JavaScript Performance (Section 7)\n   - `advanced-` for Advanced Patterns (Section 8)\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n\n## Rule File Structure\n\nEach rule file should follow this structure:\n\n````markdown\n---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description\ntags: tag1, tag2, tag3\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example\n```\n````\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example\n```\n\nOptional explanatory text after examples.\n\nReference: [Link](https://example.com)\n\n## File Naming Convention\n\n- Files starting with `_` are special (excluded from build)\n- Rule files: `area-description.md` (e.g., `async-parallel.md`)\n- Section is automatically inferred from filename prefix\n- Rules are sorted alphabetically by title within each section\n- IDs (e.g., 1.1, 1.2) are auto-generated during build\n\n## Impact Levels\n\n- `CRITICAL` - Highest priority, major performance gains\n- `HIGH` - Significant performance improvements\n- `MEDIUM-HIGH` - Moderate-high gains\n- `MEDIUM` - Moderate performance improvements\n- `LOW-MEDIUM` - Low-medium gains\n- `LOW` - Incremental improvements\n\n## Scripts\n\n- `pnpm build` - Compile rules into AGENTS.md\n- `pnpm validate` - Validate all rule files\n- `pnpm extract-tests` - Extract test cases for LLM evaluation\n- `pnpm dev` - Build and validate\n\n## Contributing\n\nWhen adding or modifying rules:\n\n1. Use the correct filename prefix for your section\n2. Follow the `_template.md` structure\n3. Include clear bad/good examples with explanations\n4. Add appropriate tags\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n6. Rules are automatically sorted by title - no need to manage numbers!\n\n## Acknowledgments\n\nOriginally created by [@shuding](https://x.com/shuding) at [Vercel](https://vercel.com).\n",".agents/skills/vercel-react-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2FSKILL.md -->",".agents/skills/vercel-react-best-practices/rules/_sections.md":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Eliminating Waterfalls (async)\n\n**Impact:** CRITICAL  \n**Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n## 2. Bundle Size Optimization (bundle)\n\n**Impact:** CRITICAL  \n**Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n## 3. Server-Side Performance (server)\n\n**Impact:** HIGH  \n**Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n## 4. Client-Side Data Fetching (client)\n\n**Impact:** MEDIUM-HIGH  \n**Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n## 5. Re-render Optimization (rerender)\n\n**Impact:** MEDIUM  \n**Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n## 6. Rendering Performance (rendering)\n\n**Impact:** MEDIUM  \n**Description:** Optimizing the rendering process reduces the work the browser needs to do.\n\n## 7. JavaScript Performance (js)\n\n**Impact:** LOW-MEDIUM  \n**Description:** Micro-optimizations for hot paths can add up to meaningful improvements.\n\n## 8. Advanced Patterns (advanced)\n\n**Impact:** LOW  \n**Description:** Advanced patterns for specific cases that require careful implementation.\n",".agents/skills/vercel-react-best-practices/rules/_template.md":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description of impact (e.g., \"20-50% improvement\")\ntags: tag1, tag2\n---\n\n## Rule Title Here\n\n**Impact: MEDIUM (optional impact description)**\n\nBrief explanation of the rule and why it matters. This should be clear and concise, explaining the performance implications.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example here\nconst bad = example();\n```\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example here\nconst good = example();\n```\n\nReference: [Link to documentation or resource](https://example.com)\n",".agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md":"---\ntitle: Store Event Handlers in Refs\nimpact: LOW\nimpactDescription: stable subscriptions\ntags: advanced, hooks, refs, event-handlers, optimization\n---\n\n## Store Event Handlers in Refs\n\nStore callbacks in refs when used in effects that shouldn't re-subscribe on callback changes.\n\n**Incorrect (re-subscribes on every render):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  useEffect(() => {\n    window.addEventListener(event, handler);\n    return () => window.removeEventListener(event, handler);\n  }, [event, handler]);\n}\n```\n\n**Correct (stable subscription):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const handlerRef = useRef(handler);\n  useEffect(() => {\n    handlerRef.current = handler;\n  }, [handler]);\n\n  useEffect(() => {\n    const listener = (e) => handlerRef.current(e);\n    window.addEventListener(event, listener);\n    return () => window.removeEventListener(event, listener);\n  }, [event]);\n}\n```\n\n**Alternative: use `useEffectEvent` if you're on latest React:**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const onEvent = useEffectEvent(handler);\n\n  useEffect(() => {\n    window.addEventListener(event, onEvent);\n    return () => window.removeEventListener(event, onEvent);\n  }, [event]);\n}\n```\n\n`useEffectEvent` provides a cleaner API for the same pattern: it creates a stable function reference that always calls the latest version of the handler.\n",".agents/skills/vercel-react-best-practices/rules/advanced-init-once.md":"---\ntitle: Initialize App Once, Not Per Mount\nimpact: LOW-MEDIUM\nimpactDescription: avoids duplicate init in development\ntags: initialization, useEffect, app-startup, side-effects\n---\n\n## Initialize App Once, Not Per Mount\n\nDo not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.\n\n**Incorrect (runs twice in dev, re-runs on remount):**\n\n```tsx\nfunction Comp() {\n  useEffect(() => {\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\n**Correct (once per app load):**\n\n```tsx\nlet didInit = false;\n\nfunction Comp() {\n  useEffect(() => {\n    if (didInit) return;\n    didInit = true;\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\nReference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)\n",".agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md":"---\ntitle: useEffectEvent for Stable Callback Refs\nimpact: LOW\nimpactDescription: prevents effect re-runs\ntags: advanced, hooks, useEffectEvent, refs, optimization\n---\n\n## useEffectEvent for Stable Callback Refs\n\nAccess latest values in callbacks without adding them to dependency arrays. Prevents effect re-runs while avoiding stale closures.\n\n**Incorrect (effect re-runs on every callback change):**\n\n```tsx\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearch(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query, onSearch]);\n}\n```\n\n**Correct (using React's useEffectEvent):**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n  const onSearchEvent = useEffectEvent(onSearch);\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearchEvent(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query]);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/async-api-routes.md":"---\ntitle: Prevent Waterfall Chains in API Routes\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: api-routes, server-actions, waterfalls, parallelization\n---\n\n## Prevent Waterfall Chains in API Routes\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect (config waits for auth, data waits for both):**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct (auth and config start immediately):**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n",".agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md":"---\ntitle: Check Cheap Conditions Before Async Flags\nimpact: HIGH\nimpactDescription: avoids unnecessary async work when a synchronous guard already fails\ntags: async, await, feature-flags, short-circuit, conditional\n---\n\n## Check Cheap Conditions Before Async Flags\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n",".agents/skills/vercel-react-best-practices/rules/async-defer-await.md":"---\ntitle: Defer Await Until Needed\nimpact: HIGH\nimpactDescription: avoids blocking unused code paths\ntags: async, await, conditional, optimization\n---\n\n## Defer Await Until Needed\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect (blocks both branches):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct (only blocks when needed):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example (early return optimization):**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n",".agents/skills/vercel-react-best-practices/rules/async-dependencies.md":"---\ntitle: Dependency-Based Parallelization\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, dependencies, better-all\n---\n\n## Dependency-Based Parallelization\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect (profile waits for config unnecessarily):**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct (config and profile run in parallel):**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n",".agents/skills/vercel-react-best-practices/rules/async-parallel.md":"---\ntitle: Promise.all() for Independent Operations\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, promises, waterfalls\n---\n\n## Promise.all() for Independent Operations\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect (sequential execution, 3 round trips):**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct (parallel execution, 1 round trip):**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n",".agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md":"---\ntitle: Strategic Suspense Boundaries\nimpact: HIGH\nimpactDescription: faster initial paint\ntags: async, suspense, streaming, layout-shift\n---\n\n## Strategic Suspense Boundaries\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect (wrapper blocked by data fetching):**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct (wrapper shows immediately, data streams in):**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative (share promise across components):**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n- SEO-critical content above the fold\n- Small, fast queries where suspense overhead isn't worth it\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n",".agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md":"---\ntitle: Avoid Barrel File Imports\nimpact: CRITICAL\nimpactDescription: 200-800ms import cost, slow builds\ntags: bundle, imports, tree-shaking, barrel-files, performance\n---\n\n## Avoid Barrel File Imports\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect (imports entire library):**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```js\n// next.config.js - automatically optimizes barrel imports at build time\nmodule.exports = {\n  experimental: {\n    optimizePackageImports: [\"lucide-react\", \"@mui/material\"],\n  },\n};\n```\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [How we optimized package imports in Next.js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n",".agents/skills/vercel-react-best-practices/rules/bundle-conditional.md":"---\ntitle: Conditional Module Loading\nimpact: HIGH\nimpactDescription: loads large data only when needed\ntags: bundle, conditional-loading, lazy-loading\n---\n\n## Conditional Module Loading\n\nLoad large data or modules only when a feature is activated.\n\n**Example (lazy-load animation frames):**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n",".agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md":"---\ntitle: Defer Non-Critical Third-Party Libraries\nimpact: MEDIUM\nimpactDescription: loads after hydration\ntags: bundle, third-party, analytics, defer\n---\n\n## Defer Non-Critical Third-Party Libraries\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect (blocks initial bundle):**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct (loads after hydration):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md":"---\ntitle: Dynamic Imports for Heavy Components\nimpact: CRITICAL\nimpactDescription: directly affects TTI and LCP\ntags: bundle, dynamic-import, code-splitting, next-dynamic\n---\n\n## Dynamic Imports for Heavy Components\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect (Monaco bundles with main chunk ~300KB):**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct (Monaco loads on demand):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/bundle-preload.md":"---\ntitle: Preload Based on User Intent\nimpact: MEDIUM\nimpactDescription: reduces perceived latency\ntags: bundle, preload, user-intent, hover\n---\n\n## Preload Based on User Intent\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example (preload on hover/focus):**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example (preload when feature flag is enabled):**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n",".agents/skills/vercel-react-best-practices/rules/client-event-listeners.md":"---\ntitle: Deduplicate Global Event Listeners\nimpact: LOW\nimpactDescription: single listener for N components\ntags: client, swr, event-listeners, subscription\n---\n\n## Deduplicate Global Event Listeners\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect (N instances = N listeners):**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct (N instances = 1 listener):**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md":"---\ntitle: Version and Minimize localStorage Data\nimpact: MEDIUM\nimpactDescription: prevents schema conflicts, reduces storage size\ntags: client, localStorage, storage, versioning, data-minimization\n---\n\n## Version and Minimize localStorage Data\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n",".agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md":"---\ntitle: Use Passive Event Listeners for Scrolling Performance\nimpact: MEDIUM\nimpactDescription: eliminates scroll delay caused by event listeners\ntags: client, event-listeners, scrolling, performance, touch, wheel\n---\n\n## Use Passive Event Listeners for Scrolling Performance\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n",".agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md":"---\ntitle: Use SWR for Automatic Deduplication\nimpact: MEDIUM-HIGH\nimpactDescription: automatic deduplication\ntags: client, swr, deduplication, data-fetching\n---\n\n## Use SWR for Automatic Deduplication\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect (no deduplication, each instance fetches):**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct (multiple instances share one request):**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n",".agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md":"---\ntitle: Avoid Layout Thrashing\nimpact: MEDIUM\nimpactDescription: prevents forced synchronous layouts and reduces performance bottlenecks\ntags: javascript, dom, css, performance, reflow, layout-thrashing\n---\n\n## Avoid Layout Thrashing\n\nAvoid interleaving style writes with layout reads. When you read a layout property (like `offsetWidth`, `getBoundingClientRect()`, or `getComputedStyle()`) between style changes, the browser is forced to trigger a synchronous reflow.\n\n**This is OK (browser batches style changes):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Each line invalidates style, but browser batches the recalculation\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n}\n```\n\n**Incorrect (interleaved reads and writes force reflows):**\n\n```typescript\nfunction layoutThrashing(element: HTMLElement) {\n  element.style.width = \"100px\";\n  const width = element.offsetWidth; // Forces reflow\n  element.style.height = \"200px\";\n  const height = element.offsetHeight; // Forces another reflow\n}\n```\n\n**Correct (batch writes, then read once):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Batch all writes together\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n\n  // Read after all writes are done (single reflow)\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**Correct (batch reads, then writes):**\n\n```typescript\nfunction avoidThrashing(element: HTMLElement) {\n  // Read phase - all layout queries first\n  const rect1 = element.getBoundingClientRect();\n  const offsetWidth = element.offsetWidth;\n  const offsetHeight = element.offsetHeight;\n\n  // Write phase - all style changes after\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n}\n```\n\n**Better: use CSS classes**\n\n```css\n.highlighted-box {\n  width: 100px;\n  height: 200px;\n  background-color: blue;\n  border: 1px solid black;\n}\n```\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  element.classList.add(\"highlighted-box\");\n\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**React example:**\n\n```tsx\n// Incorrect: interleaving style changes with layout queries\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    if (ref.current && isHighlighted) {\n      ref.current.style.width = \"100px\";\n      const width = ref.current.offsetWidth; // Forces layout\n      ref.current.style.height = \"200px\";\n    }\n  }, [isHighlighted]);\n\n  return <div ref={ref}>Content</div>;\n}\n\n// Correct: toggle class\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  return <div className={isHighlighted ? \"highlighted-box\" : \"\"}>Content</div>;\n}\n```\n\nPrefer CSS classes over inline styles when possible. CSS files are cached by the browser, and classes provide better separation of concerns and are easier to maintain.\n\nSee [this gist](https://gist.github.com/paulirish/5d52fb081b3570c81e3a) and [CSS Triggers](https://csstriggers.com/) for more information on layout-forcing operations.\n",".agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md":"---\ntitle: Cache Repeated Function Calls\nimpact: MEDIUM\nimpactDescription: avoid redundant computation\ntags: javascript, cache, memoization, performance\n---\n\n## Cache Repeated Function Calls\n\nUse a module-level Map to cache function results when the same function is called repeatedly with the same inputs during render.\n\n**Incorrect (redundant computation):**\n\n```typescript\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // slugify() called 100+ times for same project names\n        const slug = slugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Correct (cached results):**\n\n```typescript\n// Module-level cache\nconst slugifyCache = new Map<string, string>()\n\nfunction cachedSlugify(text: string): string {\n  if (slugifyCache.has(text)) {\n    return slugifyCache.get(text)!\n  }\n  const result = slugify(text)\n  slugifyCache.set(text, result)\n  return result\n}\n\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // Computed only once per unique project name\n        const slug = cachedSlugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Simpler pattern for single-value functions:**\n\n```typescript\nlet isLoggedInCache: boolean | null = null;\n\nfunction isLoggedIn(): boolean {\n  if (isLoggedInCache !== null) {\n    return isLoggedInCache;\n  }\n\n  isLoggedInCache = document.cookie.includes(\"auth=\");\n  return isLoggedInCache;\n}\n\n// Clear cache when auth changes\nfunction onAuthChange() {\n  isLoggedInCache = null;\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\nReference: [How we made the Vercel Dashboard twice as fast](https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast)\n",".agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md":"---\ntitle: Cache Property Access in Loops\nimpact: LOW-MEDIUM\nimpactDescription: reduces lookups\ntags: javascript, loops, optimization, caching\n---\n\n## Cache Property Access in Loops\n\nCache object property lookups in hot paths.\n\n**Incorrect (3 lookups × N iterations):**\n\n```typescript\nfor (let i = 0; i < arr.length; i++) {\n  process(obj.config.settings.value);\n}\n```\n\n**Correct (1 lookup total):**\n\n```typescript\nconst value = obj.config.settings.value;\nconst len = arr.length;\nfor (let i = 0; i < len; i++) {\n  process(value);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-cache-storage.md":"---\ntitle: Cache Storage API Calls\nimpact: LOW-MEDIUM\nimpactDescription: reduces expensive I/O\ntags: javascript, localStorage, storage, caching, performance\n---\n\n## Cache Storage API Calls\n\n`localStorage`, `sessionStorage`, and `document.cookie` are synchronous and expensive. Cache reads in memory.\n\n**Incorrect (reads storage on every call):**\n\n```typescript\nfunction getTheme() {\n  return localStorage.getItem(\"theme\") ?? \"light\";\n}\n// Called 10 times = 10 storage reads\n```\n\n**Correct (Map cache):**\n\n```typescript\nconst storageCache = new Map<string, string | null>();\n\nfunction getLocalStorage(key: string) {\n  if (!storageCache.has(key)) {\n    storageCache.set(key, localStorage.getItem(key));\n  }\n  return storageCache.get(key);\n}\n\nfunction setLocalStorage(key: string, value: string) {\n  localStorage.setItem(key, value);\n  storageCache.set(key, value); // keep cache in sync\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\n**Cookie caching:**\n\n```typescript\nlet cookieCache: Record<string, string> | null = null;\n\nfunction getCookie(name: string) {\n  if (!cookieCache) {\n    cookieCache = Object.fromEntries(\n      document.cookie.split(\"; \").map((c) => c.split(\"=\")),\n    );\n  }\n  return cookieCache[name];\n}\n```\n\n**Important (invalidate on external changes):**\n\nIf storage can change externally (another tab, server-set cookies), invalidate cache:\n\n```typescript\nwindow.addEventListener(\"storage\", (e) => {\n  if (e.key) storageCache.delete(e.key);\n});\n\ndocument.addEventListener(\"visibilitychange\", () => {\n  if (document.visibilityState === \"visible\") {\n    storageCache.clear();\n  }\n});\n```\n",".agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md":"---\ntitle: Combine Multiple Array Iterations\nimpact: LOW-MEDIUM\nimpactDescription: reduces iterations\ntags: javascript, arrays, loops, performance\n---\n\n## Combine Multiple Array Iterations\n\nMultiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.\n\n**Incorrect (3 iterations):**\n\n```typescript\nconst admins = users.filter((u) => u.isAdmin);\nconst testers = users.filter((u) => u.isTester);\nconst inactive = users.filter((u) => !u.isActive);\n```\n\n**Correct (1 iteration):**\n\n```typescript\nconst admins: User[] = [];\nconst testers: User[] = [];\nconst inactive: User[] = [];\n\nfor (const user of users) {\n  if (user.isAdmin) admins.push(user);\n  if (user.isTester) testers.push(user);\n  if (!user.isActive) inactive.push(user);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-early-exit.md":"---\ntitle: Early Return from Functions\nimpact: LOW-MEDIUM\nimpactDescription: avoids unnecessary computation\ntags: javascript, functions, optimization, early-return\n---\n\n## Early Return from Functions\n\nReturn early when result is determined to skip unnecessary processing.\n\n**Incorrect (processes all items even after finding answer):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  let hasError = false;\n  let errorMessage = \"\";\n\n  for (const user of users) {\n    if (!user.email) {\n      hasError = true;\n      errorMessage = \"Email required\";\n    }\n    if (!user.name) {\n      hasError = true;\n      errorMessage = \"Name required\";\n    }\n    // Continues checking all users even after error found\n  }\n\n  return hasError ? { valid: false, error: errorMessage } : { valid: true };\n}\n```\n\n**Correct (returns immediately on first error):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  for (const user of users) {\n    if (!user.email) {\n      return { valid: false, error: \"Email required\" };\n    }\n    if (!user.name) {\n      return { valid: false, error: \"Name required\" };\n    }\n  }\n\n  return { valid: true };\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md":"---\ntitle: Use flatMap to Map and Filter in One Pass\nimpact: LOW-MEDIUM\nimpactDescription: eliminates intermediate array\ntags: javascript, arrays, flatMap, filter, performance\n---\n\n## Use flatMap to Map and Filter in One Pass\n\n**Impact: LOW-MEDIUM (eliminates intermediate array)**\n\nChaining `.map().filter(Boolean)` creates an intermediate array and iterates twice. Use `.flatMap()` to transform and filter in a single pass.\n\n**Incorrect (2 iterations, intermediate array):**\n\n```typescript\nconst userNames = users\n  .map((user) => (user.isActive ? user.name : null))\n  .filter(Boolean);\n```\n\n**Correct (1 iteration, no intermediate array):**\n\n```typescript\nconst userNames = users.flatMap((user) => (user.isActive ? [user.name] : []));\n```\n\n**More examples:**\n\n```typescript\n// Extract valid emails from responses\n// Before\nconst emails = responses\n  .map((r) => (r.success ? r.data.email : null))\n  .filter(Boolean);\n\n// After\nconst emails = responses.flatMap((r) => (r.success ? [r.data.email] : []));\n\n// Parse and filter valid numbers\n// Before\nconst numbers = strings.map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));\n\n// After\nconst numbers = strings.flatMap((s) => {\n  const n = parseInt(s, 10);\n  return isNaN(n) ? [] : [n];\n});\n```\n\n**When to use:**\n\n- Transforming items while filtering some out\n- Conditional mapping where some inputs produce no output\n- Parsing/validating where invalid inputs should be skipped\n",".agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md":"---\ntitle: Hoist RegExp Creation\nimpact: LOW-MEDIUM\nimpactDescription: avoids recreation\ntags: javascript, regexp, optimization, memoization\n---\n\n## Hoist RegExp Creation\n\nDon't create RegExp inside render. Hoist to module scope or memoize with `useMemo()`.\n\n**Incorrect (new RegExp every render):**\n\n```tsx\nfunction Highlighter({ text, query }: Props) {\n  const regex = new RegExp(`(${query})`, 'gi')\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Correct (memoize or hoist):**\n\n```tsx\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nfunction Highlighter({ text, query }: Props) {\n  const regex = useMemo(\n    () => new RegExp(`(${escapeRegex(query)})`, 'gi'),\n    [query]\n  )\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Warning (global regex has mutable state):**\n\nGlobal regex (`/g`) has mutable `lastIndex` state:\n\n```typescript\nconst regex = /foo/g;\nregex.test(\"foo\"); // true, lastIndex = 3\nregex.test(\"foo\"); // false, lastIndex = 0\n```\n",".agents/skills/vercel-react-best-practices/rules/js-index-maps.md":"---\ntitle: Build Index Maps for Repeated Lookups\nimpact: LOW-MEDIUM\nimpactDescription: 1M ops to 2K ops\ntags: javascript, map, indexing, optimization, performance\n---\n\n## Build Index Maps for Repeated Lookups\n\nMultiple `.find()` calls by the same key should use a Map.\n\n**Incorrect (O(n) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  return orders.map((order) => ({\n    ...order,\n    user: users.find((u) => u.id === order.userId),\n  }));\n}\n```\n\n**Correct (O(1) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  const userById = new Map(users.map((u) => [u.id, u]));\n\n  return orders.map((order) => ({\n    ...order,\n    user: userById.get(order.userId),\n  }));\n}\n```\n\nBuild map once (O(n)), then all lookups are O(1).\nFor 1000 orders × 1000 users: 1M ops → 2K ops.\n",".agents/skills/vercel-react-best-practices/rules/js-length-check-first.md":"---\ntitle: Early Length Check for Array Comparisons\nimpact: MEDIUM-HIGH\nimpactDescription: avoids expensive operations when lengths differ\ntags: javascript, arrays, performance, optimization, comparison\n---\n\n## Early Length Check for Array Comparisons\n\nWhen comparing arrays with expensive operations (sorting, deep equality, serialization), check lengths first. If lengths differ, the arrays cannot be equal.\n\nIn real-world applications, this optimization is especially valuable when the comparison runs in hot paths (event handlers, render loops).\n\n**Incorrect (always runs expensive comparison):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Always sorts and joins, even when lengths differ\n  return current.sort().join() !== original.sort().join();\n}\n```\n\nTwo O(n log n) sorts run even when `current.length` is 5 and `original.length` is 100. There is also overhead of joining the arrays and comparing the strings.\n\n**Correct (O(1) length check first):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Early return if lengths differ\n  if (current.length !== original.length) {\n    return true;\n  }\n  // Only sort when lengths match\n  const currentSorted = current.toSorted();\n  const originalSorted = original.toSorted();\n  for (let i = 0; i < currentSorted.length; i++) {\n    if (currentSorted[i] !== originalSorted[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n```\n\nThis new approach is more efficient because:\n\n- It avoids the overhead of sorting and joining the arrays when lengths differ\n- It avoids consuming memory for the joined strings (especially important for large arrays)\n- It avoids mutating the original arrays\n- It returns early when a difference is found\n",".agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-min-max-loop.md -->",".agents/skills/vercel-react-best-practices/rules/js-request-idle-callback.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-request-idle-callback.md -->",".agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-set-map-lookups.md -->",".agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-tosorted-immutable.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-activity.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-activity.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-conditional-render.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-content-visibility.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hoist-jsx.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-resource-hints.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-script-defer-async.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-svg-precision.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-usetransition-loading.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-defer-reads.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-dependencies.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-functional-setstate.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-lazy-state-init.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo-with-default-value.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-memo.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-move-effect-to-event.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-no-inline-components.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-split-combined-hooks.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-transitions.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-transitions.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-deferred-value.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->",".agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-after-nonblocking.md -->",".agents/skills/vercel-react-best-practices/rules/server-auth-actions.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-auth-actions.md -->",".agents/skills/vercel-react-best-practices/rules/server-cache-lru.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-lru.md -->",".agents/skills/vercel-react-best-practices/rules/server-cache-react.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-react.md -->",".agents/skills/vercel-react-best-practices/rules/server-dedup-props.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-dedup-props.md -->",".agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-hoist-static-io.md -->",".agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-fetching.md -->",".agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-nested-fetching.md -->",".agents/skills/vercel-react-best-practices/rules/server-serialization.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-serialization.md -->",".github/copilot-instructions.md":"# GitHub Copilot Instruction: Code Review and Optimization\n\n## Role and Objective\n\nYou are a **top-tier software architect and performance optimization expert**.  \nYour goal is to help me — a senior TypeScript full-stack engineer — elevate the quality of my code to a new level.  \nWhen reviewing my code, **do not explain basic concepts**. I need **precise, deep, and forward-thinking insights**.\n\nYour core mission is **optimization**, including but not limited to:\n\n- **Performance improvement**: Identify and optimize performance bottlenecks, reduce unnecessary computation and resource consumption.\n- **Code refactoring**: Suggest more elegant and efficient implementations to improve code structure.\n- **Design patterns**: Identify opportunities to apply or refine design patterns to enhance scalability and maintainability.\n- **Best practices**: Ensure the code adheres to the latest best practices for the TypeScript ecosystem (Node.js, React, API layers, build pipelines).\n- **Potential risks**: Anticipate and highlight deep issues such as concurrency problems, security vulnerabilities, or resource leaks.\n\n---\n\n## Review Perspective and Principles\n\n1. **High-Standard Review**  \n   Review the code as if it were going to **production for millions of users** and needs to be **maintained long-term**.\n\n2. **Deep Analysis, Not Surface Advice**  \n   Don’t focus on trivial issues like typos or syntax sugar.  \n   Instead, explain **why** a refactor or change matters — e.g.:\n\n   > “Switching from a synchronous file read to `fs.promises` can free the event loop, improving throughput under load.”\n\n3. **Performance First**\n   - Evaluate time and space complexity; suggest algorithmic or structural improvements.\n   - Examine I/O, database queries, and network calls for efficiency — recommend batching, caching, or async processing.\n   - Recommend appropriate data structures or API strategies for scalability (e.g., pagination, streaming responses).\n\n4. **Architecture and Design**\n   - Follow **SOLID** principles. Explicitly identify violations and propose refactoring approaches.\n   - Encourage **composition over inheritance** and **dependency injection**.\n   - Suggest modularization and clear separation between layers (e.g., API, service, repository, UI).\n\n5. **Code Style and Standards**\n   - Code must be clear, consistent, and self-explanatory.\n   - Follow the project’s existing conventions unless the change brings substantial clarity or performance gain.\n   - For complex logic, suggest adding comments explaining the **rationale (“why”)**, not just the **action (“what”)**.\n\n---\n\n## Specific Instructions\n\n- **When reviewing code, include the optimized code snippet directly**, with short comments highlighting key changes and their reasoning.\n- **If you find potential bugs or unhandled edge cases**, explicitly point them out and provide a fix suggestion.\n- **Avoid subjective stylistic comments** unless they impact clarity, performance, or maintainability.\n- **When I ask “Can this code be optimized?”**, provide a holistic evaluation covering performance, readability, scalability, and maintainability.\n\n---\n\nAt the end of every response, please add:\n\n> “AI-generated suggestions may contain errors; use your own judgment when applying them.”\n","AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nMediaGo is a pnpm/turborepo monorepo registered in `one.manifest.toml`. Feature apps live in `apps/` (`core` for the Go backend, `electron` for desktop, `ui` for the shared frontend, `player-ui` for playback). Reusable logic stays in `packages/`, including `common`, `core-sdk`, `electron-preload`, and `tooling`. Long-form docs and assets sit in `docs/`, `images/`, and `docker/`. End-to-end checks live in `tests/`.\n\n## Tooling and Script Placement\n\nRepository automation is centralized in `packages/tooling`.\n\n- Do not create app-local or package-local `scripts/` directories.\n- Put build, development, release, migration, code-generation, and verification entrypoints under `packages/tooling/src/<domain>/` and invoke them from `Taskfile.yml` or package scripts.\n- Before adding a new tooling entrypoint, search `packages/tooling` and extend an existing domain module when practical.\n- Keep product runtime code in its owning app or package; this rule applies to repository automation and one-off executable tooling, not application features.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Its contents are packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Build, Test, and Development Commands\n\nUse One CLI 0.1.24 or newer. On a new clone, review `mise.toml`, run `one mise trust`, `one mise install`, then `one setup`. Use `one dev` for desktop + Web, or `one dev:web` / `one dev:electron` for one surface. Use `one build -p core`, `one build -p electron`, `one build -p docs`, and `one build:docker` for the corresponding targets. `one check` runs lint, formatting and type checks; `one test` runs the TypeScript and Go suites. `mise.toml` pins tool versions and delegates product workflows to the existing Taskfile; CI continues to use Task. After changing project scripts, run `one init mise`, review the diff, and run `pnpm one:verify`. Keep `pnpm format` as the formatting command before commits.\n\n## Coding Style & Naming Conventions\n\nTarget modern TypeScript with ES modules, two-space indentation, UTF-8, and LF endings per `.editorconfig`. Components, hooks, and services adopt PascalCase (e.g. `UserPreferencesPanel.tsx`). Utilities and helpers stay camelCase, and constants use SCREAMING_SNAKE_CASE. Always run `pnpm format` before committing; reserve comments for clarifying complex logic.\n\n## UI Interaction and Cursor Semantics\n\nMouse cursors must communicate what an element will do. Define cursor behavior in shared UI primitives whenever possible so every consumer inherits it.\n\n| Interaction                                                                      | Cursor                                    |\n| -------------------------------------------------------------------------------- | ----------------------------------------- |\n| Enabled buttons, links, menu items, select options, toggles, and clickable cards | pointer                                   |\n| Disabled or unavailable controls                                                 | not-allowed                               |\n| Editable text                                                                    | text                                      |\n| Draggable content                                                                | grab, changing to grabbing while dragging |\n| Horizontal or vertical resize handles                                            | col-resize or row-resize                  |\n| Work continuing in the background                                                | progress                                  |\n| Blocking work where the UI cannot accept input                                   | wait                                      |\n| Non-interactive content                                                          | default                                   |\n\nDo not use cursor-default on an enabled interactive element. Avoid pointer-events: none on disabled controls when it prevents the not-allowed cursor from being shown; use native disabled, aria-disabled, or the component library's disabled state to block the action. Cursor styling does not replace semantic HTML, keyboard interaction, focus states, or accessible names.\n\n## Testing Guidelines\n\nTypeScript suites use Vitest through `one test:ts`; Go suites use `one test:go`. Integration and Playwright checks use `one test:integration` and `one test:e2e`. Name files descriptively like `download.queue.integration.test.ts`. Mock external services, prefer shared fixtures in `tests/fixtures/`, and cover happy path, recovery, and edge behaviors when touching runtime code.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commits (e.g. `feat(frontend-main): add download queue UI`) and use `pnpm commit` (Commitizen) to stay compliant. Pull requests should summarize the change, link issues with `Closes #123`, note local test runs (`pnpm test`), and attach screenshots or recordings for UI updates. Call out new environment variables, migrations, or follow-up tasks so reviewers can reproduce the setup quickly.\n","CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMediaGo is a cross-platform video downloader supporting m3u8/HLS streams. The codebase is a pnpm monorepo with two delivery products:\n\n1. **Desktop app** (`apps/electron` + `apps/ui`) — Electron wrapper that launches Go Core as a subprocess\n2. **Docker Web app** (`apps/core` + `apps/ui`) — Docker runs Go Core directly; the main UI is embedded in the Core binary\n\nThe Player UI (`apps/player-ui`) is also embedded in every Core binary. Electron Core serves `/player/` but suppresses the embedded main UI because Electron owns the main renderer.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Everything placed there can be packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Common Commands\n\n```bash\npnpm install                # Install all dependencies (run once per clone)\ntask dev:electron           # Start Electron desktop dev environment (HMR)\ntask dev:web                # Start Web Core directly plus the Vite UI\ntask build:electron         # Production build for Electron\ntask build:docker           # Build the deployable Web image\npnpm core:dev               # Start Go Core dev server (port 9900)\npnpm core:build             # Compile Go Core binary\npnpm player:dev             # Start Player dev (alias for core:dev)\npnpm player:build           # Build Player (alias for core:build)\npnpm deps:download          # Download third-party tools (ffmpeg, BBDown, etc.)\npnpm deps:download:all      # Download tools for all platforms\npnpm lint                   # Lint with oxlint\npnpm lint:fix               # Auto-fix lint issues\npnpm format                 # Format with oxfmt\npnpm format:check           # Check formatting without modifying\npnpm check                  # Full check: lint + format + type check\npnpm type:check             # TypeScript type checking via Turborepo\npnpm pack:electron          # Build + package Electron distributable\n```\n\nCommits use Conventional Commits format (e.g. `feat(electron): add queue UI`).\n\n## Architecture\n\n### Monorepo Layout\n\n**Apps:**\n\n- **`apps/core/`** — Go (Gin) REST API backend for download orchestration. Runs on port 9900. Uses SQLite (GORM), SSE for real-time events, PTY for capturing download tool output, and embeds both browser UIs through `//go:embed`.\n- **`apps/electron/`** — Electron main process (tsdown build, inversify DI). Launches Go Core via `@mediago/service-runner`.\n- **`apps/ui/`** — Shared React 19 frontend (Vite 8, Ant Design 6, Zustand, TailwindCSS 4, i18next). Used by both Electron and server targets.\n- **`apps/player-ui/`** — React 19 frontend for player (Vite 8, shadcn/ui, video.js, TailwindCSS 4). Built assets are embedded into Go Core via `//go:embed`.\n\n**Packages:**\n\n- **`packages/common/`** — Platform-agnostic shared types, constants, and utilities\n- **`packages/core-sdk/`** — TypeScript SDK for Go Core REST API (Axios, SSE via eventsource)\n- **`packages/electron-preload/`** — Electron preload scripts for IPC bridge\n- **`packages/browser-extension/`** — Browser extension (Lit web components)\n- **`docs/`** — VitePress documentation (Chinese, English, Japanese)\n\n### Multi-Target Build\n\nThe `APP_TARGET` env var (`electron` | `server`) controls which backend the UI builds against. Both targets share the same React UI but connect via different transports:\n\n- **Electron**: IPC bridge (preload) + Go Core direct (via `@mediago/core-sdk`)\n- **Server/Web**: HTTP/WebSocket + Go Core direct (via `@mediago/core-sdk`)\n\nThe UI adapter layer (`apps/ui/src/hooks/adapters/`) abstracts this: `electron.ts` provides IPC bridge in desktop mode, `platform-stubs.ts` provides no-op stubs in web mode, and `index.ts` exports `platformApi` which selects the appropriate adapter.\n\n### Key Patterns\n\n- **Go Core lifecycle**: Electron launches Core via `@mediago/service-runner`; Task and Docker execute Core directly for Web usage\n- **Dependency Injection**: inversify with `@inversifyjs/binding-decorators` in Electron backend\n- **State Management**: Zustand in the UI\n- **Real-time events**: Go Core emits SSE events (`/api/events`); the UI's `api/events.ts` subscribes and dispatches to React via a listener pattern\n- **TypeScript**: Strict mode with experimental decorators and decorator metadata enabled\n- **Module format**: ES Modules everywhere\n\n## Tooling\n\n- **Package manager**: pnpm 10.15.0 (enforced via `packageManager` field)\n- **Build orchestration**: Turborepo\n- **App bundling**: tsdown for Node/Electron, Vite 8 for UI apps\n- **Go builds**: Task and pnpm invoke `packages/tooling/src/core-build/cli.ts`, which orchestrates `go build` / `go run` in `apps/core`\n- **Linter**: oxlint (config in `.oxlintrc.json`)\n- **Formatter**: oxfmt (config in `.oxfmtrc.json`)\n- **Pre-commit**: husky + lint-staged (runs oxlint --fix + oxfmt --write on staged files)\n- **Electron packaging**: electron-builder\n\n## Style Conventions\n\n- TypeScript, ES modules, 2-space indentation, UTF-8, LF endings\n- Components: PascalCase. Utilities: camelCase. Constants: SCREAMING_SNAKE_CASE\n- UI port: 8555 (strict). Go Core port: 9900. Player UI port: 8556\n","docs/api.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=docs%2Fapi.md -->","docs/skills.md":"---\nlayout: doc\noutline: deep\n---\n\n# OpenClaw Skill\n\nMediaGo 提供了 [OpenClaw](https://docs.openclaw.ai) Skill，让你可以在 AI 编程助手中通过自然语言下载视频。通过 [ClawHub](https://clawhub.com) 安装即可使用。\n\n## 前提条件\n\n- 已安装并运行 MediaGo（桌面客户端或 Docker）\n- 已安装支持 OpenClaw 的 AI 编程助手（如 Claude Code、Cursor 等）\n\n## 安装 Skill\n\n在终端中执行以下命令，从 ClawHub 安装 mediago skill：\n\n```bash\nnpx clawhub@latest install mediago\n```\n\n## 初始化配置\n\n安装完成后，需要告诉 AI 助手你的 MediaGo 服务地址。\n\n### 桌面客户端\n\n在 AI 助手中直接发送：\n\n```\n设置 mediago 地址为 http://192.168.x.x:39719\n```\n\n::: tip\n你可以在 MediaGo 桌面客户端的 **设置 → Skills 设置** 中找到已生成的配置命令，一键复制粘贴即可。\n:::\n\n### Docker\n\nDocker 部署启用了 API 认证，需要同时配置地址和 API Key：\n\n```\n设置 mediago 地址为 http://localhost:8899，api key 为 你的APIKey\n```\n\n::: tip\nAPI Key 可以在 MediaGo Web 界面的 **设置 → 更多设置** 中查看。\n:::\n\n## 使用方式\n\n配置完成后，你可以用自然语言下载视频：\n\n```\n帮我下载这个视频 https://example.com/video.m3u8\n```\n\n```\n下载这个B站视频 https://www.bilibili.com/video/BV1xxxxxxxx\n```\n\n```\ndownload this video https://example.com/stream.m3u8\n```\n\nSkill 会自动：\n\n1. 识别视频类型（m3u8 / B站 / 直链）\n2. 创建下载任务并开始下载\n3. 实时报告下载进度\n4. 下载完成后告诉你文件保存位置\n\n## 支持的视频类型\n\n| 类型     | 说明       | URL 示例                                |\n| -------- | ---------- | --------------------------------------- |\n| m3u8     | HLS 流媒体 | `https://example.com/video.m3u8`        |\n| bilibili | B站视频    | `https://www.bilibili.com/video/BVxxxx` |\n| direct   | 直链下载   | `https://example.com/video.mp4`         |\n\n## 其他命令\n\n你还可以用自然语言管理下载：\n\n- \"查看下载列表\" / \"list downloads\"\n- \"查看下载状态\" / \"check download status\"\n- \"修改 mediago 地址\" / \"update mediago url\"\n\n## 常见问题\n\n### 提示连接不上 MediaGo\n\n请确认：\n\n1. MediaGo 服务已启动\n2. 配置的地址和端口正确\n3. 如果是 Docker，确认端口映射正确（默认 8899）\n\n### 提示 API Key 错误\n\n发送以下命令更新：\n\n```\n设置 mediago api key 为 你的新APIKey\n```\n","packages/core-sdk/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fcore-sdk%2FREADME.md -->","packages/electron-preload/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Felectron-preload%2FREADME.md -->","packages/mediago-extension/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fmediago-extension%2FREADME.md -->","packages/node-service/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fnode-service%2FREADME.md -->","skills/mediago/SKILL.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=skills%2Fmediago%2FSKILL.md -->"},"files":{".agents/skills/brandkit/SKILL.md":"---\nname: brandkit\ndescription: Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.\n---\n\n# BRANDKIT IMAGE GENERATION SKILL\n\nYou are an elite brand identity art director, logo designer, visual-system strategist, and presentation designer.\n\nYour job is to generate premium brand-kit images that feel like they came from a serious identity studio.\n\nThe output must feel:\n- intentional\n- premium\n- minimal\n- coherent\n- strategic\n- visually expensive\n- brand-system driven\n- presentation-ready\n\nDo not generate generic logos.  \nDo not generate random mockups.  \nDo not generate messy AI moodboards.\n\nCreate a complete brand world in one image.\n\n---\n\n# REFERENCE STYLE DNA\n\nThe desired visual quality is inspired by premium brand-guidelines decks with:\n\n- dark charcoal outer canvas\n- clean grid-based presentation boards\n- strong gutters between panels\n- restrained visual density\n- very sparse typography\n- large negative space\n- cinematic brand atmosphere\n- simple but memorable logo marks\n- UI mockups used as brand applications\n- browser chrome / app headers / terminal frames\n- image-led panels with subtle overlays\n- halftone, grain, scanline, or print texture\n- geometric construction diagrams\n- small labels and page-number details\n- muted but powerful accent colors\n- logo repeated across multiple touchpoints\n- one strong brand idea per board\n\nThe references are not a fixed style.  \nThey define the quality bar, restraint, and presentation logic.\n\n---\n\n# CORE PRINCIPLE\n\nA premium brand kit is not decoration.\n\nIt is a visual argument for why the brand exists.\n\nEvery generated board must answer:\n\n1. What does this brand represent?\n2. What is the core metaphor?\n3. How does the logo express that?\n4. How does the system scale across UI, print, image, and detail?\n5. Why does the whole thing feel ownable?\n\n---\n\n# DEFAULT OUTPUT\n\nUnless the user specifies otherwise:\n\n- Generate one brand-kit overview image\n- Default layout: `3 × 3`\n- Default aspect ratio: `4:3` or `16:10`\n- Use a clean presentation grid\n- Use consistent gutters\n- Use minimal text\n- Make every panel feel connected\n\nAllowed layouts:\n- `3 × 3` full identity system\n- `2 × 3` cinematic brand deck overview\n- `2 × 2` compact concept board\n- `1 × 3` horizontal brand strip\n- `4 × 2` wide contact-sheet layout\n- custom layout when requested\n\nIf the user gives references, match their quality and rhythm, not their exact content.\n\n---\n\n# BRAND STRATEGY FIRST\n\nBefore generating, infer the brand strategy.\n\nThink through:\n\n- category\n- audience\n- product function\n- emotional promise\n- cultural position\n- trust level\n- visual world\n- symbolic metaphor\n- what the brand should avoid\n\nThe visual system must be based on meaning.\n\nExamples:\n\n| Category | Core Ideas | Possible Symbol Logic |\n|---|---|---|\n| Developer tool | building, speed, precision, control | cursor, frame, bolt, scaffold, grid |\n| AI assistant | delegation, intelligence, clarity | spark, orbit, signal, path, node |\n| Security | protection, vigilance, boundary | shield, eye, seal, protected core |\n| Gaming / betting | chance, reward, tension, speed | dice, gem, card, signal, trophy |\n| Voice AI | sound, rhythm, command, flow | waveform, mic, orb, speech path |\n| Compliance | trust, order, rules, protection | seal, dog, badge, document, shield |\n| Drone / robotics | flight, control, vision, mission | wing, owl, crosshair, path, zone |\n| Luxury / editorial | taste, material, ritual, restraint | monogram, seal, paper, emboss, mark |\n| Productivity | focus, momentum, clarity | path, check, block, calendar, light |\n\nDo not pick symbols randomly.\n\n---\n\n# LOGO GENERATION STANDARD\n\nThe logo must be professional.\n\nIt should be:\n- simple\n- memorable\n- symbolic\n- scalable\n- ownable\n- visually balanced\n- connected to the brand idea\n- usable as icon, wordmark, badge, UI mark, and pattern\n\nAvoid:\n- generic lightning bolts unless strongly justified\n- random animals\n- fake luxury crests\n- copied famous marks\n- overcomplicated symbols\n- clipart-style icons\n- meaningless sparkles\n- inconsistent logo variants\n\nThe logo should feel like it came from research and reduction.\n\n---\n\n# LOGO CONCEPT METHODS\n\nUse one or combine two maximum.\n\n## 1. Monogram + Meaning\n\nCombine the brand initial with a metaphor.\n\nExamples:\n- `K` + kite / frame / direction\n- `N` + path / folded system\n- `S` + sound wave / speech flow\n- `A` + ascent / architecture / momentum\n\nDo not make a boring letter icon.  \nUse negative space, cuts, folds, or geometry.\n\n---\n\n## 2. Product Action\n\nTurn the product's main action into a symbol.\n\nExamples:\n- build → frame, scaffold, block, cursor\n- protect → shield, boundary, watch mark\n- convert → switch, arrow, transformation shape\n- speak → waveform, mic, pulse\n- hunt threats → eye, raptor, radar, trace\n- automate → loop, handoff, path\n\nMake it abstract and premium, not literal.\n\n---\n\n## 3. Metaphor Fusion\n\nCombine two meaningful ideas into one reduced mark.\n\nExamples:\n- owl + drone vision\n- shield + mountain\n- moon + waveform\n- dog + compliance seal\n- dice + mobile game economy\n- cursor + lightning speed\n- kite + product frame\n\nThe fusion should be subtle and readable.\n\n---\n\n## 4. Negative Space\n\nUse empty space to create intelligence.\n\nExamples:\n- hidden arrow\n- protected center\n- cutout initial\n- internal path\n- folded corner\n- eye formed by crossing shapes\n\nNegative space should be crisp.\n\n---\n\n## 5. Construction Geometry\n\nCreate a mark from a clear system.\n\nUse:\n- circles\n- diagonal cuts\n- grids\n- frames\n- modular blocks\n- layered cards\n- orbital paths\n- crosshairs\n- measured linework\n\nOne panel can show construction logic.\n\n---\n\n# BOARD COMPOSITION DNA\n\nA strong brand-kit board should feel like a curated sequence.\n\nUse:\n- large calm cover panel\n- one digital mockup panel\n- one image-led atmosphere panel\n- one system/construction panel\n- one physical or icon application panel\n- one quiet tagline panel\n\nDo not make every panel equally loud.\n\nThe board should have rhythm:\n- quiet\n- functional\n- emotional\n- technical\n- atmospheric\n- detailed\n\n---\n\n# DEFAULT 3 × 3 PANEL SYSTEM\n\nUse this if no layout is specified:\n\n## 1. Logo Cover\nLarge logo and wordmark.  \nMinimal title.  \nStrong negative space.\n\n## 2. Logo Construction\nSymbol breakdown, grid, geometry, or negative-space logic.  \nShow why the mark exists.\n\n## 3. Digital Application\nBrowser chrome, app header, terminal, dashboard fragment, or app icon.\n\n## 4. Brand Essence\nOne short tagline.  \nLarge readable typography.  \nSparse composition.\n\n## 5. Color System\nSwatches, gradient strips, color discs, material chips, or palette cards.\n\n## 6. Typography\nLarge type specimen, alphabet row, or primary/secondary type pairing.\n\n## 7. Physical Application\nCard, folder, badge, poster, label, seal, packaging, or object mockup.\n\n## 8. Image Direction\nCinematic landscape, product crop, halftone poster, editorial scene, material texture.\n\n## 9. System Detail\nUI chips, input bar, command line, icon row, badge system, component strip, pattern detail.\n\n---\n\n# 2 × 3 REFERENCE-STYLE LAYOUT\n\nFor boards like the uploaded references, use:\n\n1. **Logo / Wordmark**\n   - centered or offset\n   - extremely minimal\n\n2. **Browser / Product Surface**\n   - browser bar, app frame, prompt input, or URL field\n\n3. **Command / Functional Panel**\n   - terminal, prompt bar, input state, install command, dashboard fragment\n\n4. **Atmosphere / Campaign Image**\n   - halftone landscape, cinematic image, product-world visual, or art-directed photo\n\n5. **Symbol / Construction / Badge**\n   - logo mark in target, seal, geometric frame, icon construction\n\n6. **Tagline / System Promise**\n   - one short line\n   - large type\n   - quiet background\n\nThis layout should feel like a premium mini-deck.\n\n---\n\n# VISUAL MODES\n\nChoose based on the brand.\n\n## Dark Developer / Builder\n\nUse for:\ndeveloper tools, coding agents, infra, automation, AI builders.\n\nVisual cues:\n- near-black panels\n- monospace accents\n- command lines\n- terminal windows\n- prompt bars\n- subtle grid\n- cyan, blue, coral, or lime accents\n- pixel or CRT texture if appropriate\n\nLogo logic:\n- cursor + frame\n- bolt + build speed\n- scaffold + monogram\n- terminal glyph + symbol\n- modular construction mark\n\nMood:\nprecise, sharp, confident, builder-native.\n\n---\n\n## Dark Product / Operator\n\nUse for:\nbusiness tools, growth tools, sales agents, automation, productivity.\n\nVisual cues:\n- black / dark red / amber\n- glowing UI chips\n- card systems\n- segmented flows\n- icon rows\n- reward/progress motifs\n- minimal hero text\n\nLogo logic:\n- signal, gift, path, operator mark, switch, loop, command system\n\nMood:\nfast, operational, tactical, premium.\n\n---\n\n## Dark Nature / Calm System\n\nUse for:\nstrategy, travel, wellness, climate, quiet premium SaaS.\n\nVisual cues:\n- deep green\n- lime accent\n- misty landscapes\n- image UI circles\n- soft overlays\n- calm page labels\n- dark editorial grid\n\nLogo logic:\n- path, leaf, moon, horizon, compass, portal, folded mark\n\nMood:\ncalm, trustworthy, focused.\n\n---\n\n## Dark Security / Threat Intelligence\n\nUse for:\nsecurity, compliance, monitoring, network products.\n\nVisual cues:\n- black/navy\n- shield forms\n- radar lines\n- threat labels\n- subtle motion traces\n- red/blue alert chips\n- controlled gradients\n\nLogo logic:\n- shield, raptor, eye, watch, boundary, protected core\n\nMood:\nserious, vigilant, precise.\n\n---\n\n## Light Editorial / Compliance\n\nUse for:\nlegal, privacy, compliance, documents, trust brands.\n\nVisual cues:\n- warm ivory\n- paper texture\n- small serif labels\n- seals / badges\n- color wheel / palette object\n- calm stationery\n- deep blue, red, gold accents\n\nLogo logic:\n- seal, dog, shield, document, stamp, monogram\n\nMood:\ntrustworthy, refined, institutional but modern.\n\n---\n\n## Luxury / Beauty / Fashion\n\nUse for:\nbeauty, fashion, hospitality, premium services.\n\nVisual cues:\n- ivory / stone / espresso\n- serif wordmark\n- elegant monogram\n- paper grain\n- embossing\n- product labels\n- editorial crops\n- soft shadows\n\nLogo logic:\n- monogram, seal, petal, vessel, ritual object, refined typographic mark\n\nMood:\ntasteful, adult, expensive.\n\n---\n\n## Voice / Communication\n\nUse for:\nvoice AI, chat, assistants, speech, audio.\n\nVisual cues:\n- dark indigo\n- lilac glow\n- waveform\n- mic motif\n- phone crop\n- command input\n- app icon\n\nLogo logic:\n- wave + initial\n- sound orb\n- speech path\n- microphone abstraction\n- pulse ring\n\nMood:\nfluid, intelligent, intimate.\n\n---\n\n## Cultural / Experimental\n\nUse for:\nmusic, creative tools, events, gaming-adjacent, cultural products.\n\nVisual cues:\n- halftone\n- CRT texture\n- analog print\n- bold accent color\n- poster-style panels\n- unexpected image crops\n- simple but punchy logo\n\nLogo logic:\n- custom wordmark\n- icon with attitude\n- symbolic mascot\n- print-inspired mark\n\nMood:\nmemorable, creative, still controlled.\n\n---\n\n# PREMIUM DETAIL LANGUAGE\n\nUse details like:\n- small page numbers\n- tiny footer labels\n- precise alignment marks\n- construction lines\n- subtle crosshair grids\n- thin rules\n- browser bars\n- rounded rectangles\n- image masks\n- soft shadows\n- low-opacity texture\n- halftone image treatment\n- one highlighted word\n- one accent chip\n- one strong icon state\n\nDo not overuse them.\n\nPremium detail should reward looking closer.\n\n---\n\n# TEXT RULES\n\nUse very little text.\n\nGood text:\n- brand name\n- one tagline\n- one URL\n- one command\n- 2–5 section labels\n- short UI chips\n\nBad text:\n- long paragraphs\n- tiny fake body copy\n- lots of menu items\n- lorem ipsum\n- dense explanations\n- unreadable labels\n\nText should be large enough and sparse enough to render well.\n\n---\n\n# TAGLINE STYLE\n\nTaglines should be short and specific.\n\nGood:\n- \"What will you build today?\"\n- \"Nothing random.\"\n- \"Your network. Our watch.\"\n- \"Build better.\"\n- \"On guard.\"\n- \"Every mission under control.\"\n- \"Everything operators need.\"\n- \"Clarity builds confidence.\"\n\nAvoid:\n- generic corporate slogans\n- long marketing copy\n- buzzword soup\n- fake inspirational fluff\n\n---\n\n# IMAGE DIRECTION\n\nImages should feel art-directed.\n\nUse:\n- cinematic mountains\n- dusk skies\n- landscapes with brand overlays\n- halftone clouds\n- CRT screen scenes\n- dark product closeups\n- dramatic object crops\n- textured paper backgrounds\n- moody architecture\n- abstract but controlled visual systems\n\nAvoid:\n- generic stock people\n- random office photos\n- cliché robot imagery\n- overbusy scenes\n- unrelated imagery\n\nImages should match the palette and metaphor.\n\n---\n\n# MOCKUP DIRECTION\n\nMockups should be minimal and believable.\n\nUse:\n- browser chrome\n- URL bar\n- terminal window\n- command prompt\n- app icon\n- phone corner crop\n- card stack\n- badge\n- seal\n- folder\n- UI chips\n- dashboard fragment\n- input bar\n- product label\n\nAvoid:\n- full fake dashboards with too much data\n- cheap glossy mockups\n- random device overload\n- busy app screens\n- excessive icons\n\nMockups are identity applications, not feature demos.\n\n---\n\n# COLOR DISCIPLINE\n\nUse one dominant palette.\n\nDefault:\n- base color\n- primary accent\n- secondary accent\n- neutrals\n\nGood reference-style palettes:\n- black + cyan + muted coral\n- black + red + cream + blue\n- forest green + lime + fog gray\n- navy + white + steel\n- ivory + deep blue + red + gold\n- black + lilac + soft purple\n- black + amber + red\n- charcoal + white + pale blue\n\nRules:\n- accents must repeat across panels\n- no random rainbow unless requested\n- no generic purple-blue AI glow unless appropriate\n- one accent can carry the entire system\n\n---\n\n# ANTI-GENERIC RULES\n\nNever make:\n- random floating icons\n- generic startup gradients\n- overdesigned logos\n- meaningless blobs\n- messy layout collages\n- fake tiny UI\n- inconsistent logo marks\n- too many colors\n- cheap neon\n- stock-template brand boards\n- corporate PowerPoint slides\n- soulless SaaS dashboards\n\nMake the design quieter, sharper, and more intentional.\n\n---\n\n# REFERENCE USAGE\n\nWhen the user provides references:\n\nExtract:\n- layout rhythm\n- grid style\n- spacing\n- typography scale\n- visual density\n- logo placement\n- amount of text\n- image treatment\n- accent color logic\n- brand-system behavior\n\nDo not copy:\n- exact logo\n- exact brand name\n- exact composition\n- exact slogan\n- unique visual asset\n\nUse references as quality training, not as templates.\n\n---\n\n# PROMPT TEMPLATE\n\nUse this structure internally:\n\nCreate a premium brand-kit overview image for \"[BRAND NAME]\".\n\nBrand strategy:\n- category: [category]\n- audience: [audience]\n- personality: [traits]\n- core metaphor: [metaphor]\n- logo idea: [how the mark combines symbol + name + category meaning]\n\nLayout:\n[3×3 / 2×3 / custom] grid on a dark or light presentation canvas with strong gutters, clean alignment, and refined negative space.\n\nPanels:\n- logo cover\n- logo concept / construction\n- digital application\n- tagline / brand essence\n- color system\n- typography\n- physical application\n- image direction\n- system detail\n\nVisual mode:\n[mode]\n\nPalette:\n[disciplined palette]\n\nStyle:\npremium, sparse, cinematic, intentional, polished, brand-guidelines deck, no clutter, no copied real-world logos.\n\nTypography:\nreadable, minimal, high hierarchy, no tiny fake text.\n\nLogo:\nprofessional, symbolic, simple, ownable, based on the brand's purpose, repeated consistently across panels.\n\n---\n\n# FINAL OUTPUT STANDARD\n\nThe image must look like:\n- a premium identity deck\n- a senior designer's presentation board\n- a brand-system case study\n- a visual launch direction\n- a professional logo concept board\n\nThe final result should be:\n- clean\n- strategic\n- symbolic\n- minimal\n- coherent\n- premium\n- art-directed\n- implementation-friendly\n- stronger than normal AI-generated brand visuals\n",".agents/skills/design-taste-frontend-v1/SKILL.md":"---\nname: design-taste-frontend-v1\ndescription: The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility.\n---\n\n# High-Agency Frontend Skill\n\n## 1. ACTIVE BASELINE CONFIGURATION\n* DESIGN_VARIANCE: 8 (1=Perfect Symmetry, 10=Artsy Chaos)\n* MOTION_INTENSITY: 6 (1=Static/No movement, 10=Cinematic/Magic Physics)\n* VISUAL_DENSITY: 4 (1=Art Gallery/Airy, 10=Pilot Cockpit/Packed Data)\n\n**AI Instruction:** The standard baseline for all generations is strictly set to these values (8, 6, 4). Do not ask the user to edit this file. Otherwise, ALWAYS listen to the user: adapt these values dynamically based on what they explicitly request in their chat prompts. Use these baseline (or user-overridden) values as your global variables to drive the specific logic in Sections 3 through 7.\n\n## 2. DEFAULT ARCHITECTURE & CONVENTIONS\nUnless the user explicitly specifies a different stack, adhere to these structural constraints to maintain consistency:\n\n* **DEPENDENCY VERIFICATION [MANDATORY]:** Before importing ANY 3rd party library (e.g. `framer-motion`, `lucide-react`, `zustand`), you MUST check `package.json`. If the package is missing, you MUST output the installation command (e.g. `npm install package-name`) before providing the code. **Never** assume a library exists.\n* **Framework & Interactivity:** React or Next.js. Default to Server Components (`RSC`). \n    * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n    * **INTERACTIVITY ISOLATION:** If Sections 4 or 7 (Motion/Liquid Glass) are active, the specific interactive UI component MUST be extracted as an isolated leaf component with `'use client'` at the very top. Server Components must exclusively render static layouts.\n* **State Management:** Use local `useState`/`useReducer` for isolated UI. Use global state strictly for deep prop-drilling avoidance.\n* **Styling Policy:** Use Tailwind CSS (v3/v4) for 90% of styling. \n    * **TAILWIND VERSION LOCK:** Check `package.json` first. Do not use v4 syntax in v3 projects. \n    * **T4 CONFIG GUARD:** For v4, do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **ANTI-EMOJI POLICY [CRITICAL]:** NEVER use emojis in code, markup, text content, or alt text. Replace symbols with high-quality icons (Radix, Phosphor) or clean SVG primitives. Emojis are BANNED.\n* **Responsiveness & Spacing:**\n  * Standardize breakpoints (`sm`, `md`, `lg`, `xl`).\n  * Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n  * **Viewport Stability [CRITICAL]:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent catastrophic layout jumping on mobile browsers (iOS Safari).\n  * **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`) for reliable structures.\n* **Icons:** You MUST use exactly `@phosphor-icons/react` or `@radix-ui/react-icons` as the import paths (check installed version). Standardize `strokeWidth` globally (e.g., exclusively use `1.5` or `2.0`).\n\n\n## 3. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\nLLMs have statistical biases toward specific UI cliché patterns. Proactively construct premium interfaces using these engineered rules:\n\n**Rule 1: Deterministic Typography**\n* **Display/Headlines:** Default to `text-4xl md:text-6xl tracking-tighter leading-none`.\n    * **ANTI-SLOP:** Discourage `Inter` for \"Premium\" or \"Creative\" vibes. Force unique character using `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n    * **TECHNICAL UI RULE:** Serif fonts are strictly BANNED for Dashboard/Software UIs. For these contexts, use exclusively high-end Sans-Serif pairings (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`).\n* **Body/Paragraphs:** Default to `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n\n**Rule 2: Color Calibration**\n* **Constraint:** Max 1 Accent Color. Saturation < 80%.\n* **THE LILA BAN:** The \"AI Purple/Blue\" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g. Emerald, Electric Blue, or Deep Rose).\n* **COLOR CONSISTENCY:** Stick to one palette for the entire output. Do not fluctuate between warm and cool grays within the same project.\n\n**Rule 3: Layout Diversification**\n* **ANTI-CENTER BIAS:** Centered Hero/H1 sections are strictly BANNED when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left Aligned content/Right Aligned asset\", or \"Asymmetric White-space\" structures.\n\n**Rule 4: Materiality, Shadows, and \"Anti-Card Overuse\"**\n* **DASHBOARD HARDENING:** For `VISUAL_DENSITY > 7`, generic card containers are strictly BANNED. Use logic-grouping via `border-t`, `divide-y`, or purely negative space. Data metrics should breathe without being boxed in unless elevation (z-index) is functionally required.\n* **Execution:** Use cards ONLY when elevation communicates hierarchy. When a shadow is used, tint it to the background hue.\n\n**Rule 5: Interactive UI States**\n* **Mandatory Generation:** LLMs naturally generate \"static\" successful states. You MUST implement full interaction cycles:\n  * **Loading:** Skeletal loaders matching layout sizes (avoid generic circular spinners).\n  * **Empty States:** Beautifully composed empty states indicating how to populate data.\n  * **Error States:** Clear, inline error reporting (e.g., forms).\n  * **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push indicating success/action.\n\n**Rule 6: Data & Form Patterns**\n* **Forms:** Label MUST sit above input. Helper text is optional but should exist in markup. Error text below input. Use a standard `gap-2` for input blocks.\n\n## 4. CREATIVE PROACTIVITY (Anti-Slop Implementation)\nTo actively combat generic AI designs, systematically implement these high-end coding concepts as your baseline:\n* **\"Liquid Glass\" Refraction:** When glassmorphism is needed, go beyond `backdrop-blur`. Add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) to simulate physical edge refraction.\n* **Magnetic Micro-physics (If MOTION_INTENSITY > 5):** Implement buttons that pull slightly toward the mouse cursor. **CRITICAL:** NEVER use React `useState` for magnetic hover or continuous animations. Use EXCLUSIVELY Framer Motion's `useMotionValue` and `useTransform` outside the React render cycle to prevent performance collapse on mobile.\n* **Perpetual Micro-Interactions:** When `MOTION_INTENSITY > 5`, embed continuous, infinite micro-animations (Pulse, Typewriter, Float, Shimmer, Carousel) in standard components (avatars, status dots, backgrounds). Apply premium Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) to all interactive elements—no linear easing.\n* **Layout Transitions:** Always utilize Framer Motion's `layout` and `layoutId` props for smooth re-ordering, resizing, and shared element transitions across state changes.\n* **Staggered Orchestration:** Do not mount lists or grids instantly. Use `staggerChildren` (Framer) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) to create sequential waterfall reveals. **CRITICAL:** For `staggerChildren`, the Parent (`variants`) and Children MUST reside in the identical Client Component tree. If data is fetched asynchronously, pass the data as props into a centralized Parent Motion wrapper.\n\n## 5. PERFORMANCE GUARDRAILS\n* **DOM Cost:** Apply grain/noise filters exclusively to fixed, pointer-event-none pseudo-elements (e.g., `fixed inset-0 z-50 pointer-events-none`) and NEVER to scrolling containers to prevent continuous GPU repaints and mobile performance degradation.\n* **Hardware Acceleration:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`.\n* **Z-Index Restraint:** NEVER spam arbitrary `z-50` or `z-10` unprompted. Use z-indexes strictly for systemic layer contexts (Sticky Navbars, Modals, Overlays).\n\n## 6. TECHNICAL REFERENCE (Dial Definitions)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Flexbox `justify-center`, strict 12-column symmetrical grids, equal paddings.\n* **4-7 (Offset):** Use `margin-top: -2rem` overlapping, varied image aspect ratios (e.g., 4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (e.g., `grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`). \n* **MOBILE OVERRIDE:** For levels 4-10, any asymmetric layout above `md:` MUST aggressively fall back to a strict, single-column layout (`w-full`, `px-4`, `py-8`) on viewports `< 768px` to prevent horizontal scrolling and layout breakage.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only.\n* **4-7 (Fluid CSS):** Use `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. Use `animation-delay` cascades for load-ins. Focus strictly on `transform` and `opacity`. Use `will-change: transform` sparingly.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals or parallax. Use Framer Motion hooks. NEVER use `window.addEventListener('scroll')`.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery Mode):** Lots of white space. Huge section gaps. Everything feels very expensive and clean.\n* **4-7 (Daily App Mode):** Normal spacing for standard web apps.\n* **8-10 (Cockpit Mode):** Tiny paddings. No card boxes; just 1px lines to separate data. Everything is packed. **Mandatory:** Use Monospace (`font-mono`) for all numbers.\n\n## 7. AI TELLS (Forbidden Patterns)\nTo guarantee a premium, non-generic output, you MUST strictly avoid these common AI design signatures unless explicitly requested:\n\n### Visual & CSS\n* **NO Neon/Outer Glows:** Do not use default `box-shadow` glows or auto-glows. Use inner borders or subtle tinted shadows.\n* **NO Pure Black:** Never use `#000000`. Use Off-Black, Zinc-950, or Charcoal.\n* **NO Oversaturated Accents:** Desaturate accents to blend elegantly with neutrals.\n* **NO Excessive Gradient Text:** Do not use text-fill gradients for large headers.\n* **NO Custom Mouse Cursors:** They are outdated and ruin performance/accessibility.\n\n### Typography\n* **NO Inter Font:** Banned. Use `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n* **NO Oversized H1s:** The first heading should not scream. Control hierarchy with weight and color, not just massive scale.\n* **Serif Constraints:** Use Serif fonts ONLY for creative/editorial designs. **NEVER** use Serif on clean Dashboards.\n\n### Layout & Spacing\n* **Align & Space Perfectly:** Ensure padding and margins are mathematically perfect. Avoid floating elements with awkward gaps.\n* **NO 3-Column Card Layouts:** The generic \"3 equal cards horizontally\" feature row is BANNED. Use a 2-column Zig-Zag, asymmetric grid, or horizontal scrolling approach instead.\n\n### Content & Data (The \"Jane Doe\" Effect)\n* **NO Generic Names:** \"John Doe\", \"Sarah Chan\", or \"Jack Su\" are banned. Use highly creative, realistic-sounding names.\n* **NO Generic Avatars:** DO NOT use standard SVG \"egg\" or Lucide user icons for avatars. Use creative, believable photo placeholders or specific styling.\n* **NO Fake Numbers:** Avoid predictable outputs like `99.99%`, `50%`, or basic phone numbers (`1234567`). Use organic, messy data (`47.2%`, `+1 (312) 847-1928`).\n* **NO Startup Slop Names:** \"Acme\", \"Nexus\", \"SmartFlow\". Invent premium, contextual brand names.\n* **NO Filler Words:** Avoid AI copywriting clichés like \"Elevate\", \"Seamless\", \"Unleash\", or \"Next-Gen\". Use concrete verbs.\n\n### External Resources & Components\n* **NO Broken Unsplash Links:** Do not use Unsplash. Use absolute, reliable placeholders like `https://picsum.photos/seed/{random_string}/800/600` or SVG UI Avatars.\n* **shadcn/ui Customization:** You may use `shadcn/ui`, but NEVER in its generic default state. You MUST customize the radii, colors, and shadows to match the high-end project aesthetic.\n* **Production-Ready Cleanliness:** Code must be extremely clean, visually striking, memorable, and meticulously refined in every detail.\n\n## 8. THE CREATIVE ARSENAL (High-End Inspiration)\nDo not default to generic UI. Pull from this library of advanced concepts to ensure the output is visually striking and memorable. When appropriate, leverage **GSAP (ScrollTrigger/Parallax)** for complex scrolltelling or **ThreeJS/WebGL** for 3D/Canvas animations, rather than basic CSS motion. **CRITICAL:** Never mix GSAP/ThreeJS with Framer Motion in the same component tree. Default to Framer Motion for UI/Bento interactions. Use GSAP/ThreeJS EXCLUSIVELY for isolated full-page scrolltelling or canvas backgrounds, wrapped in strict useEffect cleanup blocks.\n\n### The Standard Hero Paradigm\n* Stop doing centered text over a dark image. Try asymmetric Hero sections: Text cleanly aligned to the left or right. The background should feature a high-quality, relevant image with a subtle stylistic fade (darkening or lightening gracefully into the background color depending on if it is Light or Dark mode).\n\n### Navigation & Menüs\n* **Mac OS Dock Magnification:** Nav-bar at the edge; icons scale fluidly on hover.\n* **Magnetic Button:** Buttons that physically pull toward the cursor.\n* **Gooey Menu:** Sub-items detach from the main button like a viscous liquid.\n* **Dynamic Island:** A pill-shaped UI component that morphs to show status/alerts.\n* **Contextual Radial Menu:** A circular menu expanding exactly at the click coordinates.\n* **Floating Speed Dial:** A FAB that springs out into a curved line of secondary actions.\n* **Mega Menu Reveal:** Full-screen dropdowns that stagger-fade complex content.\n\n### Layout & Grids\n* **Bento Grid:** Asymmetric, tile-based grouping (e.g., Apple Control Center).\n* **Masonry Layout:** Staggered grid without fixed row heights (e.g., Pinterest).\n* **Chroma Grid:** Grid borders or tiles showing subtle, continuously animating color gradients.\n* **Split Screen Scroll:** Two screen halves sliding in opposite directions on scroll.\n* **Curtain Reveal:** A Hero section parting in the middle like a curtain on scroll.\n\n### Cards & Containers\n* **Parallax Tilt Card:** A 3D-tilting card tracking the mouse coordinates.\n* **Spotlight Border Card:** Card borders that illuminate dynamically under the cursor.\n* **Glassmorphism Panel:** True frosted glass with inner refraction borders.\n* **Holographic Foil Card:** Iridescent, rainbow light reflections shifting on hover.\n* **Tinder Swipe Stack:** A physical stack of cards the user can swipe away.\n* **Morphing Modal:** A button that seamlessly expands into its own full-screen dialog container.\n\n### Scroll-Animations\n* **Sticky Scroll Stack:** Cards that stick to the top and physically stack over each other.\n* **Horizontal Scroll Hijack:** Vertical scroll translates into a smooth horizontal gallery pan.\n* **Locomotive Scroll Sequence:** Video/3D sequences where framerate is tied directly to the scrollbar.\n* **Zoom Parallax:** A central background image zooming in/out seamlessly as you scroll.\n* **Scroll Progress Path:** SVG vector lines or routes that draw themselves as the user scrolls.\n* **Liquid Swipe Transition:** Page transitions that wipe the screen like a viscous liquid.\n\n### Galleries & Media\n* **Dome Gallery:** A 3D gallery feeling like a panoramic dome.\n* **Coverflow Carousel:** 3D carousel with the center focused and edges angled back.\n* **Drag-to-Pan Grid:** A boundless grid you can freely drag in any compass direction.\n* **Accordion Image Slider:** Narrow vertical/horizontal image strips that expand fully on hover.\n* **Hover Image Trail:** The mouse leaves a trail of popping/fading images behind it.\n* **Glitch Effect Image:** Brief RGB-channel shifting digital distortion on hover.\n\n### Typography & Text\n* **Kinetic Marquee:** Endless text bands that reverse direction or speed up on scroll.\n* **Text Mask Reveal:** Massive typography acting as a transparent window to a video background.\n* **Text Scramble Effect:** Matrix-style character decoding on load or hover.\n* **Circular Text Path:** Text curved along a spinning circular path.\n* **Gradient Stroke Animation:** Outlined text with a gradient continuously running along the stroke.\n* **Kinetic Typography Grid:** A grid of letters dodging or rotating away from the cursor.\n\n### Micro-Interactions & Effects\n* **Particle Explosion Button:** CTAs that shatter into particles upon success.\n* **Liquid Pull-to-Refresh:** Mobile reload indicators acting like detaching water droplets.\n* **Skeleton Shimmer:** Shifting light reflections moving across placeholder boxes.\n* **Directional Hover Aware Button:** Hover fill entering from the exact side the mouse entered.\n* **Ripple Click Effect:** Visual waves rippling precisely from the click coordinates.\n* **Animated SVG Line Drawing:** Vectors that draw their own contours in real-time.\n* **Mesh Gradient Background:** Organic, lava-lamp-like animated color blobs.\n* **Lens Blur Depth:** Dynamic focus blurring background UI layers to highlight a foreground action.\n\n## 9. THE \"MOTION-ENGINE\" BENTO PARADIGM\nWhen generating modern SaaS dashboards or feature sections, you MUST utilize the following \"Bento 2.0\" architecture and motion philosophy. This goes beyond static cards and enforces a \"Vercel-core meets Dribbble-clean\" aesthetic heavily reliant on perpetual physics.\n\n### A. Core Design Philosophy\n* **Aesthetic:** High-end, minimal, and functional.\n* **Palette:** Background in `#f9fafb`. Cards are pure white (`#ffffff`) with a 1px border of `border-slate-200/50`.\n* **Surfaces:** Use `rounded-[2.5rem]` for all major containers. Apply a \"diffusion shadow\" (a very light, wide-spreading shadow, e.g., `shadow-[0_20px_40px_-15px_rgba(0,0,0,0.05)]`) to create depth without clutter.\n* **Typography:** Strict `Geist`, `Satoshi`, or `Cabinet Grotesk` font stack. Use subtle tracking (`tracking-tight`) for headers.\n* **Labels:** Titles and descriptions must be placed **outside and below** the cards to maintain a clean, gallery-style presentation.\n* **Pixel-Perfection:** Use generous `p-8` or `p-10` padding inside cards.\n\n### B. The Animation Engine Specs (Perpetual Motion)\nAll cards must contain **\"Perpetual Micro-Interactions.\"** Use the following Framer Motion principles:\n* **Spring Physics:** No linear easing. Use `type: \"spring\", stiffness: 100, damping: 20` for a premium, weighty feel.\n* **Layout Transitions:** Heavily utilize the `layout` and `layoutId` props to ensure smooth re-ordering, resizing, and shared element state transitions.\n* **Infinite Loops:** Every card must have an \"Active State\" that loops infinitely (Pulse, Typewriter, Float, or Carousel) to ensure the dashboard feels \"alive\".\n* **Performance:** Wrap dynamic lists in `<AnimatePresence>` and optimize for 60fps. **PERFORMANCE CRITICAL:** Any perpetual motion or infinite loop MUST be memoized (React.memo) and completely isolated in its own microscopic Client Component. Never trigger re-renders in the parent layout.\n\n### C. The 5-Card Archetypes (Micro-Animation Specs)\nImplement these specific micro-animations when constructing Bento grids (e.g., Row 1: 3 cols | Row 2: 2 cols split 70/30):\n1. **The Intelligent List:** A vertical stack of items with an infinite auto-sorting loop. Items swap positions using `layoutId`, simulating an AI prioritizing tasks in real-time.\n2. **The Command Input:** A search/AI bar with a multi-step Typewriter Effect. It cycles through complex prompts, including a blinking cursor and a \"processing\" state with a shimmering loading gradient.\n3. **The Live Status:** A scheduling interface with \"breathing\" status indicators. Include a pop-up notification badge that emerges with an \"Overshoot\" spring effect, stays for 3 seconds, and vanishes.\n4. **The Wide Data Stream:** A horizontal \"Infinite Carousel\" of data cards or metrics. Ensure the loop is seamless (using `x: [\"0%\", \"-100%\"]`) with a speed that feels effortless.\n5. **The Contextual UI (Focus Mode):** A document view that animates a staggered highlight of a text block, followed by a \"Float-in\" of a floating action toolbar with micro-icons.\n\n## 10. FINAL PRE-FLIGHT CHECK\nEvaluate your code against this matrix before outputting. This is the **last** filter you apply to your logic.\n- [ ] Is global state used appropriately to avoid deep prop-drilling rather than arbitrarily?\n- [ ] Is mobile layout collapse (`w-full`, `px-4`, `max-w-7xl mx-auto`) guaranteed for high-variance designs?\n- [ ] Do full-height sections safely use `min-h-[100dvh]` instead of the bugged `h-screen`?\n- [ ] Do `useEffect` animations contain strict cleanup functions?\n- [ ] Are empty, loading, and error states provided?\n- [ ] Are cards omitted in favor of spacing where possible?\n- [ ] Did you strictly isolate CPU-heavy perpetual animations in their own Client Components?\n",".agents/skills/design-taste-frontend/SKILL.md":"---\nname: design-taste-frontend\ndescription: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.\n---\n\n# tasteskill: Anti-Slop Frontend Skill\n\n> Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.\n> Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.\n\n---\n\n## 0. BRIEF INFERENCE (Read the Room Before Anything Else)\n\nBefore touching code or tweaking dials, **infer what the user actually wants**. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.\n\n### 0.A Read these signals first\n1. **Page kind** - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.\n2. **Vibe words** the user used - \"minimalist\", \"calm\", \"Linear-style\", \"Awwwards\", \"brutalist\", \"premium consumer\", \"Apple-y\", \"playful\", \"serious B2B\", \"editorial\", \"agency-y\", \"glassy\", \"dark tech\".\n3. **Reference signals** - URLs they linked, screenshots they pasted, products they named, brands they're competing with.\n4. **Audience** - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.\n5. **Brand assets that already exist** - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).\n6. **Quiet constraints** - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.\n\n### 0.B Output a one-line \"Design Read\" before generating\nBefore any code, state in one line: **\"Reading this as: \\<page kind> for \\<audience>, with a \\<vibe> language, leaning toward \\<design system or aesthetic family>.\"**\n\nExample reads:\n- *\"Reading this as: B2B SaaS landing for technical buyers, with a Linear-style minimalist language, leaning toward Tailwind utilities + Geist + restrained motion.\"*\n- *\"Reading this as: solo designer portfolio for hiring managers, with an editorial / kinetic-type language, leaning toward native CSS + scroll-driven animation + custom typography.\"*\n- *\"Reading this as: redesign of a public-sector service site, with a trust-first language, leaning toward GOV.UK Frontend or USWDS.\"*\n\n### 0.C If the brief is ambiguous, ask one question, do not guess\nAsk exactly **one** clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: *\"Should this feel closer to Linear-clean or Awwwards-experimental?\"*\n\nIf you can confidently infer from context, **do not ask**. Just declare the design read and proceed.\n\n### 0.D Anti-Default Discipline\nDo not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.\n\n---\n\n## 1. THE THREE DIALS (Core Configuration)\n\nAfter the design read, set three dials. Every layout, motion, and density decision below is gated by these.\n\n* **`DESIGN_VARIANCE: 8`** - 1 = Perfect Symmetry, 10 = Artsy Chaos\n* **`MOTION_INTENSITY: 6`** - 1 = Static, 10 = Cinematic / Physics\n* **`VISUAL_DENSITY: 4`** - 1 = Art Gallery / Airy, 10 = Cockpit / Packed Data\n\n**Baseline:** `8 / 6 / 4`. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.\n\n### 1.A Dial Inference (design read → dial values)\n| Signal | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| \"minimalist / clean / calm / editorial / Linear-style\" | 5-6 | 3-4 | 2-3 |\n| \"premium consumer / Apple-y / luxury / brand\" | 7-8 | 5-7 | 3-4 |\n| \"playful / wild / Dribbble / Awwwards / experimental / agency\" | 9-10 | 8-10 | 3-4 |\n| \"landing page / portfolio / marketing site (default)\" | 7-9 | 6-8 | 3-5 |\n| \"trust-first / public-sector / regulated / accessibility-critical\" | 3-4 | 2-3 | 4-5 |\n| \"redesign - preserve\" | match existing | +1 | match existing |\n| \"redesign - overhaul\" | +2 | +2 | match existing |\n\n### 1.B Use-Case Presets\n| Use case | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| Landing (SaaS, mainstream) | 7 | 6 | 4 |\n| Landing (Agency / creative) | 9 | 8 | 3 |\n| Landing (Premium consumer) | 7 | 6 | 3 |\n| Portfolio (Designer / studio) | 8 | 7 | 3 |\n| Portfolio (Developer) | 6 | 5 | 4 |\n| Editorial / Blog | 6 | 4 | 3 |\n| Public-sector service | 3 | 2 | 5 |\n| Redesign - preserve | match | match+1 | match |\n| Redesign - overhaul | +2 | +2 | match |\n\n### 1.C How the Dials Drive Output\nUse these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like `LAYOUT_VARIANCE` or `ANIM_LEVEL`.\n\n---\n\n## 2. BRIEF → DESIGN SYSTEM MAP\n\nOnce you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.\n\n### 2.A When to reach for a real design system (use official packages)\n| Brief reads as… | Reach for | Why |\n|---|---|---|\n| Microsoft / enterprise SaaS / dashboards | `@fluentui/react-components` or `@fluentui/web-components` | Official Fluent UI, Microsoft tokens, accessibility done |\n| Google-ish UI, Material-flavored product | `@material/web` + Material 3 tokens | Official, theme-able via Material Theming |\n| IBM-style B2B / enterprise analytics | `@carbon/react` + `@carbon/styles` | Official Carbon, mature data-density patterns |\n| Shopify app surfaces | `polaris.js` web components / Polaris React | Required for Shopify admin UI |\n| Atlassian / Jira-style product | `@atlaskit/*` + `@atlaskit/tokens` | Official Atlassian DS |\n| GitHub-style devtool / community page | `@primer/css` or `@primer/react-brand` | Official Primer; Brand variant for marketing |\n| Public-sector UK service | `govuk-frontend` | Legally / regulatorily expected |\n| US public-sector / trust-first | `uswds` | Same |\n| Fast local-business / agency MVP | Bootstrap 5.3 | Boring, fast, works |\n| Modern accessible React foundation | `@radix-ui/themes` | Primitives + polished theme |\n| Modern SaaS where you own the components | shadcn/ui (`npx shadcn@latest add ...`) | You own the code, easy to customise; never ship default state |\n| Tailwind-based modern SaaS / AI marketing | Tailwind v4 utilities + `dark:` variant | Default for indie + small team builds |\n\n**Honesty rule:** if the brief reads as one of the systems above, install and use the **official** package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.\n\n**One system per project.** Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.\n\n### 2.B When the brief is an aesthetic, not a system\nFor these directions, there is **no single official package**. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.\n\n| Aesthetic | Honest implementation |\n|---|---|\n| Glassmorphism / \"frosted glass\" | `backdrop-filter`, layered borders, highlight overlays. Provide solid-fill fallback for `prefers-reduced-transparency`. |\n| Bento (Apple-style tile grids) | CSS Grid with mixed cell sizes. No single library owns this. |\n| Brutalism | Native CSS, monospace, raw borders. No library. |\n| Editorial / magazine | Serif type, asymmetric grid, generous whitespace. No library. |\n| Dark tech / hacker | Mono + accent neon, terminal motifs. No library. |\n| Aurora / mesh gradients | SVG or layered radial gradients. No library. |\n| Kinetic typography | Native CSS animations, scroll-driven animations, GSAP for hijacks. No library. |\n| **Apple Liquid Glass** | Apple documents this for Apple platforms only. **There is no official `liquid-glass.css`.** Web implementations are approximations using `backdrop-filter` + layered borders + highlights. Label clearly as approximation. |\n\n---\n\n## 3. DEFAULT ARCHITECTURE & CONVENTIONS\n\nUnless the design read picks a real design system (Section 2.A), these are the defaults:\n\n### 3.A Stack\n* **Framework:** React or Next.js. Default to Server Components (RSC).\n  * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n  * **INTERACTIVITY ISOLATION:** Any component using Motion, scroll listeners, or pointer physics MUST be an isolated leaf with `'use client'` at the top. Server Components render static layouts only.\n* **Styling:** **Tailwind v4** (default). Tailwind v3 only if the existing project demands it.\n  * For v4: do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **Animation:** **Motion** (the library formerly known as Framer Motion). Import from `motion/react` (`import { motion } from \"motion/react\"`). The `framer-motion` package still works as a legacy alias - prefer `motion/react` in new code.\n* **Fonts:** Always use `next/font` (Next.js) or self-host with `@font-face` + `font-display: swap`. Never link Google Fonts via `<link>` in production.\n\n### 3.B State\n* Local `useState` / `useReducer` for isolated UI.\n* Global state ONLY for deep prop-drilling avoidance - Zustand, Jotai, or React context.\n* **NEVER** use `useState` to track continuous values driven by user input (mouse position, scroll progress, pointer physics, magnetic hover). Use Motion's `useMotionValue` / `useTransform` / `useScroll`. `useState` re-renders the React tree on every change and collapses on mobile.\n\n### 3.C Icons\n* **Allowed libraries (priority order):** `@phosphor-icons/react`, `hugeicons-react`, `@radix-ui/react-icons`, `@tabler/icons-react`.\n* **Discouraged:** `lucide-react`. Acceptable only when the user explicitly asks for it or the project already depends on it.\n* **NEVER hand-roll SVG icons.** If a glyph is missing, install a second library or compose from primitives - do not draw icon paths from scratch.\n* **One family per project.** Do not mix Phosphor with Lucide in the same component tree.\n* **Standardize `strokeWidth` globally** (e.g. `1.5` or `2.0`).\n\n### 3.D Emoji Policy\nDiscouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. **Override:** allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.\n\n### 3.E Responsiveness & Layout Mechanics\n* Standardize breakpoints (`sm 640`, `md 768`, `lg 1024`, `xl 1280`, `2xl 1536`).\n* Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n* **Viewport Stability:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent layout jumping on mobile (iOS Safari address bar).\n* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`).\n\n### 3.F Dependency Verification (mandatory)\nBefore importing ANY 3rd-party library, check `package.json`. If the package is missing, output the install command first. **Never** assume a library exists.\n\n---\n\n## 4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\n\nLLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.\n\n### 4.1 Typography\n* **Display / Headlines:** Default `text-4xl md:text-6xl tracking-tighter leading-none`.\n* **Body / Paragraphs:** Default `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n* **Sans font choice:**\n  * **Discouraged as default:** `Inter`. Pick `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`, or a brand-appropriate serif first.\n  * **Override:** Inter is acceptable when the user explicitly asks for a neutral / standard / Linear-style feel, or when the brief is a public-sector / accessibility-first site.\n* **Pairings to know:** `Geist` + `Geist Mono`, `Satoshi` + `JetBrains Mono`, `Cabinet Grotesk` + `Inter Tight`, `GT America` + `IBM Plex Mono`.\n\n* **SERIF DISCIPLINE (VERY DISCOURAGED AS DEFAULT):**\n  * Serif is **very discouraged as the default font for any project.** \"It feels creative / premium / editorial\" is NOT a reason to reach for serif. The agent's default mental model that \"creative brief = serif\" is the single most-tested AI tell in production rounds.\n  * **Serif is only acceptable when ONE of these is explicitly true:**\n    - The brand brief literally names a serif font, OR\n    - The aesthetic family is genuinely editorial / luxury / publication / manuscript / heritage / vintage AND you can articulate why this specific serif fits this specific brand\n  * For everything else (creative agency, design studio, modern brand, premium consumer, portfolio, lifestyle), **default sans-serif display** (Geist Display, ABC Diatype, Söhne Breit, Cabinet Grotesk Display, Migra Sans, GT Walsheim, Inter Display, PP Neue Montreal). Sans display fonts are not \"boring\" — they are the default for the same reason black is the default in fashion.\n  * **EMPHASIS RULE (related):** When you want to emphasize a word within a headline (the kinetic \"and `spatial` design\" type move), use **italic or bold of the SAME font**. Do NOT inject a random serif word into a sans headline (or vice versa) just to add visual interest. Mixed-family emphasis is amateur. Italic/bold emphasis in the same family is the right move.\n  * **Specifically BANNED as defaults:** `Fraunces` and `Instrument_Serif` (the two LLM-favorite display serifs).\n  * **If a serif is justified** (rare, per the above), rotate from this pool, do NOT reuse the same serif across consecutive projects: PP Editorial New, GT Sectra Display, Cardinal Grotesque, Reckless Neue, Tiempos Headline, Recoleta, Cormorant Garamond, Playfair Display, EB Garamond, IvyPresto, Migra, Editorial Old, Saol Display, Söhne Breit Kursiv, Domaine Display, Canela, Schnyder, Tobias, NB Architekt, ITC Galliard.\n\n* **ITALIC DESCENDER CLEARANCE (mandatory):** When italic is used in display type and the word contains a descender letter (`y g j p q`), `leading-[1]` or `leading-none` will clip the descender. Use `leading-[1.1]` minimum and add `pb-1` or `mb-1` reserve on the wrapping element. Audit every italic word in display headlines before shipping.\n\n### 4.2 Color Calibration\n* Max 1 accent color. Saturation < 80% by default.\n* **THE LILA RULE:** The \"AI Purple / Blue glow\" aesthetic is discouraged as a default. No automatic purple button glows, no random neon gradients. Use neutral bases (Zinc / Slate / Stone) with high-contrast singular accents (Emerald, Electric Blue, Deep Rose, Burnt Orange, etc.).\n* **Override:** if the brand or brief explicitly asks for purple / violet / lila, embrace it. But execute with intent: consistent palette, harmonised neutrals, restrained gradients. Not generic AI gradient slop.\n* **One palette per project.** Do not fluctuate between warm and cool grays within the same project.\n* **COLOR CONSISTENCY LOCK (mandatory):** Once an accent color is chosen for a page, it is used on the WHOLE page. A warm-grey site does not suddenly get a blue CTA in section 7. A rose-accented site does not get a teal status badge in the footer. Pick one accent, lock it, audit every component before shipping.\n\n* **PREMIUM-CONSUMER PALETTE BAN (mandatory, second-most-recurring AI-tell):**\n  * For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage craft, DTC home goods, etc.) the LLM default is **warm beige/cream + brass/clay/oxblood/ochre + espresso/ink dark text**. Concretely banned hex families as default backgrounds and accents:\n    - Backgrounds: `#f5f1ea`, `#f7f5f1`, `#fbf8f1`, `#efeae0`, `#ece6db`, `#faf7f1`, `#e8dfcb` (all \"warm paper / cream / chalk / bone\")\n    - Accents: `#b08947`, `#b6553a`, `#9a2436`, `#9c6e2a`, `#bc7c3a`, `#7d5621` (all \"brass / clay / oxblood / ochre\")\n    - Text: `#1a1714`, `#1a1814`, `#1b1814` (all \"espresso / warm near-black\")\n  * This palette is BANNED as the default reach for premium-consumer briefs. Every premium-consumer site you have ever shipped uses this exact palette. The brand becomes invisible.\n  * **Default alternatives (rotate, do not reuse):**\n    - **Cold Luxury:** silver-grey + chrome + smoke (think Tesla, Apple Watch Hermes-without-the-leather)\n    - **Forest:** deep green + bone + amber accent (think Filson, Patagonia premium)\n    - **Black and Tan:** true off-black + warm tan, sharp contrast, no beige\n    - **Cobalt + Cream:** saturated blue against a single neutral, no brass\n    - **Terracotta + Slate:** warm rust against cool grey, no brass\n    - **Olive + Brick + Paper:** muted olive plus brick-red accent\n    - **Pure monochrome + single saturated pop:** off-white + off-black + one bright accent (electric blue, emerald, hot pink, etc.)\n  * **Palette-rotation rule:** if the previous premium-consumer project you generated used the beige+brass family, this one MUST use a different family. Do not ship the same warm-craft palette twice in a row.\n  * **Override:** the beige+brass+espresso palette is acceptable ONLY when the brand brief explicitly names those colors, or when the brand identity is genuinely vintage / artisan / warm-craft AND you can articulate why this specific palette fits this specific brand. Default-reaching for it because \"this is a cookware brief\" is banned.\n\n### 4.3 Layout Diversification\n* **ANTI-CENTER BIAS:** Centered Hero / H1 sections are avoided when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left-aligned content / right-aligned asset\", \"Asymmetric white-space\", or scroll-pinned structures.\n* **Override:** centered hero is OK for editorial / manifesto / launch-announcement briefs where the message itself is the design.\n\n### 4.4 Materiality, Shadows, Cards\n* Use cards ONLY when elevation communicates real hierarchy. Otherwise group with `border-t`, `divide-y`, or negative space.\n* When a shadow is used, tint it to the background hue. No pure-black drop shadows on light backgrounds.\n* For `VISUAL_DENSITY > 7`: generic card containers are banned. Data metrics breathe in plain layout.\n* **SHAPE CONSISTENCY LOCK (mandatory):** Pick ONE corner-radius scale for the page and stick to it. Options: all-sharp (radius 0), all-soft (radius 12-16px), all-pill (full radius for interactive). Mixed systems are allowed only when there is a documented rule (e.g. \"buttons are full-pill, cards are 16px, inputs are 8px\") and that rule is followed everywhere. Round buttons in a square layout, or square cards on a pill-button page, is broken design.\n\n### 4.5 Interactive UI States\nLLMs default to \"static successful state only.\" Always implement full cycles:\n* **Loading:** Skeletal loaders matching the final layout's shape. Avoid generic circular spinners.\n* **Empty States:** Beautifully composed; indicate how to populate.\n* **Error States:** Clear, inline (forms), or contextual (toasts only for transient).\n* **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push.\n* **BUTTON CONTRAST CHECK (mandatory, a11y):** Before shipping any button, verify the button text is readable against the button background. White button + white text, `bg-white` CTA with `text-white` label, transparent button against the page background with no border → all banned. Audit every CTA: contrast ratio WCAG AA min (4.5:1 for body, 3:1 for large text 18px+). Same rule applies to ghost buttons over photographic backgrounds (use a backdrop, scrim, or stroke).\n* **CTA BUTTON WRAP BAN (mandatory):** Button text MUST fit on one line at desktop. If a label like \"VIEW SELECTED WORK\" wraps to 2 or 3 lines, the button is broken. Fix by EITHER shortening the label (3 words max for primary CTAs, ideally 1-2) OR widening the button (do not artificially constrain `max-width` on CTAs). Wrapped CTAs at desktop are a Pre-Flight Fail.\n* **NO DUPLICATE CTA INTENT (mandatory):** Two CTAs with the same intent on one page is a Pre-Flight Fail. Examples of same intent: \"Get in touch\" + \"Contact us\" + \"Let's talk\" + \"Start a project\" + \"Start something\" + \"Reach out\" = all \"contact\" intent → pick ONE label and use it everywhere on the page (nav, hero, footer). Same for \"Try free\" + \"Get started\" + \"Sign up free\" (all \"signup\" intent) and \"View work\" + \"See selected work\" + \"Browse projects\" (all \"portfolio\" intent). One label per intent.\n* **FORM CONTRAST CHECK (mandatory, a11y):** Form inputs, placeholder text, focus rings, helper text, and error text all pass WCAG AA contrast against the section background. Light placeholders on a near-white form, white form on white page section, form labels grayer than 4.5:1 contrast → all banned. Audit every form before shipping.\n\n### 4.6 Data & Form Patterns\n* Label ABOVE input. Helper text optional but present in markup. Error text BELOW input. Standard `gap-2` for input blocks.\n* No placeholder-as-label. Ever.\n\n### 4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)\n\n* **Hero MUST fit in the initial viewport.** Headline max 2 lines on desktop, subtext max **20 words** AND max 3-4 lines, CTAs visible without scroll. If the copy is too long: reduce font scale OR cut copy. If you cannot describe the value-prop in 20 words of subtext, the value-prop is unclear, not the rule too tight. Never let the hero overflow and force scroll to find the CTA.\n* **Hero font-scale discipline.** Plan font size and image size *together*. If the hero asset is large and the headline is more than 6 words, do not start at `text-7xl/text-8xl`. Default sensible range: `text-4xl md:text-5xl lg:text-6xl` for most heroes; `text-6xl md:text-7xl` only when the headline is 3-5 words. A 4-line hero headline is always a font-size error, never a copy-length error.\n* **HERO TOP PADDING CAP (mandatory):** Hero top padding max `pt-24` (≈6rem) at desktop. More than that means the hero content floats halfway down the viewport and reads as a layout bug, not as intentional space. If your hero needs more breathing room, increase font scale or asset size, not top padding.\n* **HERO STACK DISCIPLINE (max 4 text elements).** The hero is a single moment, not a feature list. Allowed text elements, max 4 in total:\n  1. Eyebrow (small uppercase label) OR brand strip OR neither - pick zero or one\n  2. Headline (max 2 lines, see above)\n  3. Subtext (max 20 words, max 4 lines)\n  4. CTAs (1 primary + max 1 secondary)\n  - **BANNED in the hero:** tiny tagline below CTAs (\"Works with GitHub, GitLab, and self-hosted Git\"), trust micro-strip (\"Used by engineering teams at...\"), pricing teaser (\"Free for solo, $10/user for teams\"), feature bullet list, social-proof avatar row. All of those move to dedicated sections directly below the hero.\n  - If you have an eyebrow AND a tagline below CTAs in the same hero, drop the tagline. If you have a brand strip AND a tagline, drop the tagline. One small text element per hero, max.\n* **\"Used by\" / \"Trusted by\" logo wall belongs UNDER the hero, never inside it.** The hero is for the value prop and primary CTA. The logo wall is a separate section directly below. Do not stuff trust logos into the same flex row as the hero copy.\n* **Navigation MUST render on a single line on desktop.** If items don't fit at `lg` (1024px), condense labels, drop secondary items, or move to a hamburger. A two-line nav at desktop is broken design.\n* **Navigation height cap: 80px max desktop, default 64-72px.** No huge \"agency\" nav bars that eat 15% of the viewport.\n* **Bento grids MUST have rhythm, not one-sided repetition.** Do not stack 6 left-image / right-text rows. Vary the composition: alternate full-width feature rows, asymmetric tile sizes, vertical breaks.\n* **BENTO CELL COUNT RULE (mandatory):** A bento grid has EXACTLY as many cells as you have content for. 3 items → 3 cells (1+2 split, or 2+1, or asymmetric trio). 5 items → 5 cells (2+3, 3+2, hero+4, etc.). If your grid has an empty cell in the middle or at the end, you planned wrong. Re-shape the grid; do not paste a blank tile.\n* **Section-Layout-Repetition Ban.** Once you use a layout family for a section (e.g., 3-column-image-cards, full-width-quote, split-text-image), that family can appear at most ONCE on the page. \"Selected commissions\" must not look like \"What we do.\" A landing page with 8 sections must use at least 4 different layout families.\n* **ZIGZAG ALTERNATION CAP (mandatory).** Alternating \"left-image + right-text\" then \"left-text + right-image\" zigzag layout = banal. Max 2 sections in a row with this image+text-split pattern. The 3rd consecutive image+text split is a Pre-Flight Fail. Break the pattern with a full-width section, a vertical-stack section, a bento grid, a marquee, or a different layout family.\n* **EYEBROW RESTRAINT (mandatory, the #1 violated rule in production tests).** An \"eyebrow\" is the small uppercase wide-tracking label sitting above a section headline (e.g. `FOUR COLORWAYS`, `SELECTED WORK`, `THE HARDWARE`, `Git-native task management`). Typical CSS signature: `text-[11px] uppercase tracking-[0.18em]`, `font-mono text-[10.5px] uppercase tracking-[0.22em]`. Every AI-built site puts an eyebrow above EVERY section header, producing the same templated rhythm. Hard rule:\n  - **Maximum 1 eyebrow per 3 sections.** Hero counts as 1. So a page with 9 sections may use at most 3 eyebrows total.\n  - If section A has an eyebrow, the next 2 sections cannot have one.\n  - **Pre-Flight Check is mechanical:** count instances of `uppercase tracking` (or similar small-caps mono labels above headlines) across all section components. If count > ceil(sectionCount / 3), the output fails.\n  - **What to do instead of an eyebrow:** drop it entirely. The headline alone is enough. If you need to categorize a section, the section's location on the page already categorizes it; no label needed.\n* **SPLIT-HEADER BAN (mandatory).** The pattern \"left big headline + right small explainer paragraph\" as a section header (left col-span-7/8, right col-span-4/5 with a small body paragraph floating in the right column) is **banned as default**. Sections should have ONE focused message. If you genuinely need both a headline and an explainer paragraph, stack them vertically (headline on top, body below, max-width 65ch). Reach for the split-header pattern only when there is a real compositional reason (e.g., the right column carries a visual or interactive element, not just filler text).\n* **Bento Background Diversity (mandatory).** Bento and feature-grid sections cannot be 6 white-on-white cards with text inside. At least 2-3 cells in any multi-cell grid need real visual variation: a real image, a brand-appropriate gradient (not AI-purple), a pattern, a tinted background. A cream-on-cream bento with only typography inside reads as boring AI default, even when the rest of the page is good.\n* **Mobile collapse must be explicit per section.** For every multi-column layout, declare the `< 768px` fallback in the same component. No \"it'll work, Tailwind handles it\" assumptions.\n\n### 4.8 Image & Visual Asset Strategy\n\nLanding pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.\n\n**Priority order for visual assets:**\n1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.\n2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:\n   * `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)\n   * Actual stock or brand URLs when the brief provides them\n   * Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed\n3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based \"fake screenshots.\" Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *\"This page needs real images at: \\[list of placements\\]. Please generate or provide them.\"*\n\n**Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.\n\n**Real company logos for social proof.** When the brief calls for a \"Trusted by / Used by / Customers\" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:\n* **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.\n* **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).\n* **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.\n* **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).\n* **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.\n\n**Hand-rolled illustrations:**\n* SVG icons from libraries: fine (see Section 3.C).\n* Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:\n  - The brief explicitly calls for it (\"draw me an SVG logo\")\n  - It's a single, simple geometric mark (a square, a circle, a wordmark in display type)\n  - You're confident in the output quality\n\n**Div-based fake screenshots are banned.** A \"hand-built product preview\" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:\n* Use a real screenshot URL if one exists\n* Generate one via image tool\n* Use a real component preview (an actual mini-version of the UI inside the page)\n* Or skip the preview entirely and use editorial photography\n\n**Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.\n\n### 4.9 Content Density\n\nLanding pages live on the **first impression**, not the full read. Cut ruthlessly.\n\n* **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.\n* **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:\n  - Top 3-5 highlights + \"View full list\" link\n  - Marquee / carousel for breadth\n  - Different page entirely if the data is the product\n* **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:\n  - 2-column split with grouped items\n  - Card grid with image + label per item\n  - Tabs / accordion if items are categorisable\n  - Horizontal scroll-snap pills\n  - Carousel for breadth-heavy lists (testimonials, logos, capabilities)\n  - Marquee for \"lots-of-things-that-don't-need-individual-attention\"\n  A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.\n* **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:\n  - **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line \"why it matters\" body. Cards arranged 2-col on desktop, 1-col mobile.\n  - **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.\n  - **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. \"Materials\", \"Cooking\", \"Warranty\"), each cluster gets ONE soft divider and a cluster heading.\n  - **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a \"View full specifications\" disclosure.\n\n* **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:\n  - **Grammatically broken** (\"free on its past\", \"two plans but one is honest\", \"to put it on the table\" out of context)\n  - **Has unclear referents** (\"we plan to stay that way\" without prior context)\n  - **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, \"elegant nothing\" phrases)\n  - **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)\n  Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.\n* **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:\n  - Come from real data (brief, brand guidelines, public metrics) - fine\n  - Are explicitly labeled as mock (`<!-- mock -->`, \"example\", \"sample data\") - fine\n  - Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.\n* **One copy register per page.** Don't mix technical mono (\"47 tasks · 0.6 ctx-switches/day\"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.\n\n### 4.10 Quotes & Testimonials\n\n* **Max 3 lines** of quote body. Never 6. If the original quote is longer → cut it. A landing-page quote is a snippet, not the full review.\n* For very small font sizes (e.g. footer-style testimonials), the line cap can stretch slightly. Spirit: \"fits in a glance.\"\n* **No em-dashes inside the quote text** as design flourish (long pauses, kinetic em-dashes, em-dash-bullets). See Section 9.G - em-dash is completely banned.\n* Attribution: name + role + (optionally) company. Never name only (\"- Sarah\").\n* Quote marks: use real typographic quotes ( \" \" ) or none at all. Not straight ASCII ( \" ).\n\n### 4.11 Page Theme Lock (Light / Dark Mode Consistency)\n\nThe page has ONE theme. Sections do not invert.\n\n* If the page is dark mode, ALL sections are dark mode. No light-mode-warm-paper section sandwiched between dark sections (or vice versa). The user must not feel they walked into a different website mid-scroll.\n* The exception: if the brief explicitly calls for a \"Color Block Story\" or \"Theme Switch on Scroll\" device AND that is a deliberate composition (one full theme switch with a strong transition, not random alternation), it is allowed once per page.\n* Default behaviour: pick light, dark, or auto (`prefers-color-scheme`) at the page level and lock it. Section-level background tints within the same theme family are fine (`bg-zinc-950` next to `bg-zinc-900`); flipping to `bg-amber-50` in the middle of a `bg-zinc-950` page is broken.\n* When using a design system with built-in theming (Radix Themes, shadcn/ui with `<Theme>`), set the theme ONCE in `layout.tsx` or the page root. Do not let individual sections override.\n\n---\n\n## 5. CONTEXT-AWARE PROACTIVITY\n\nThese are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**\n\n* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or \"boring B2B.\" When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.\n* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.\n* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) - no linear easing.\n* **\"Motion claimed, motion shown.\"** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).\n* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: \"what does this animation communicate?\" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: \"it looked cool\". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.\n* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees (\"logos endlessly scrolling\", \"manifesto scrolling sideways\", \"kinetic word strip\") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.\n* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A \"card stack on scroll\" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: \"top top\"` not `start: \"top center\"` or `\"top 80%\"`.\n* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: \"top top\"`, pin the wrapper, scrub the inner track.\n\n### 5.A Sticky-Stack - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function StickyStack({ cards }: { cards: React.ReactNode[] }) {\n  const ref = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !ref.current) return;\n    const ctx = gsap.context(() => {\n      const cardEls = gsap.utils.toArray<HTMLElement>(\".stack-card\");\n      cardEls.forEach((card, i) => {\n        if (i === cardEls.length - 1) return;\n        ScrollTrigger.create({\n          trigger: card,\n          start: \"top top\",                              // pin at viewport top\n          endTrigger: cardEls[cardEls.length - 1],\n          end: \"top top\",\n          pin: true,\n          pinSpacing: false,\n        });\n        gsap.to(card, {\n          scale: 0.92,\n          opacity: 0.55,\n          ease: \"none\",\n          scrollTrigger: {\n            trigger: cardEls[i + 1],\n            start: \"top bottom\",\n            end: \"top top\",\n            scrub: true,\n          },\n        });\n      });\n    }, ref);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <div ref={ref} className=\"relative\">\n      {cards.map((card, i) => (\n        <div\n          key={i}\n          className=\"stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center\"\n        >\n          {card}\n        </div>\n      ))}\n    </div>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).\n\n### 5.B Horizontal-Pan - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function HorizontalPan({ children }: { children: React.ReactNode }) {\n  const wrap = useRef<HTMLDivElement>(null);\n  const track = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !wrap.current || !track.current) return;\n    const ctx = gsap.context(() => {\n      const distance = track.current!.scrollWidth - window.innerWidth;\n      gsap.to(track.current, {\n        x: -distance,\n        ease: \"none\",\n        scrollTrigger: {\n          trigger: wrap.current,\n          start: \"top top\",                              // pin starts when section top hits viewport top\n          end: () => `+=${distance}`,                    // scroll distance = track width minus viewport\n          pin: true,\n          scrub: 1,\n          invalidateOnRefresh: true,\n        },\n      });\n    }, wrap);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <section ref={wrap} className=\"relative overflow-hidden\">\n      <div ref={track} className=\"flex h-[100dvh] items-center\">\n        {children}\n      </div>\n    </section>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, `end: \"+=${distance}\"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.\n\n### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)\n\nFor simple \"items appear as they enter viewport\" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:\n\n```tsx\n\"use client\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nexport function RevealStagger({ items }: { items: string[] }) {\n  const reduce = useReducedMotion();\n  return (\n    <ul className=\"grid gap-6\">\n      {items.map((item, i) => (\n        <motion.li\n          key={item}\n          initial={reduce ? false : { opacity: 0, y: 24 }}\n          whileInView={{ opacity: 1, y: 0 }}\n          viewport={{ once: true, amount: 0.3 }}\n          transition={{\n            duration: 0.6,\n            delay: i * 0.06,\n            ease: [0.16, 1, 0.3, 1],\n          }}\n        >\n          {item}\n        </motion.li>\n      ))}\n    </ul>\n  );\n}\n```\n\nUse this for: feature lists, testimonial grids, logo walls, anything that just needs \"enter on scroll.\" Save GSAP for actual pin/scrub work.\n\n### 5.D Forbidden Animation Patterns\n\n* **`window.addEventListener(\"scroll\", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).\n* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.\n* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.\n* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props \"for safety\" - it costs measurement work.\n* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.\n\n---\n\n## 6. PERFORMANCE & ACCESSIBILITY GUARDRAILS\n\n### 6.A Hardware Acceleration\n* Animate ONLY `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`.\n* Use `will-change: transform` sparingly - only on elements that will actually animate.\n\n### 6.B Reduced Motion (mandatory)\n* **Any motion above `MOTION_INTENSITY > 3` MUST honor `prefers-reduced-motion`.** This is non-negotiable.\n* In Motion: wrap with `useReducedMotion()` and degrade to static.\n* In CSS: gate animations behind `@media (prefers-reduced-motion: no-preference)` or provide an override block under `@media (prefers-reduced-motion: reduce)` that disables.\n* Infinite loops, parallax, scroll-hijack, and magnetic physics MUST collapse to static / instant under reduced motion.\n\n### 6.C Dark Mode (mandatory for any consumer-facing page)\n* Design for **both modes from the start**. Never ship light-only or dark-only without explicit user instruction.\n* Use Tailwind `dark:` variant OR CSS variables for tokens. Pick one strategy per project.\n* **Do not prescribe specific dark-mode colors here.** The brief decides. Maintain visual hierarchy, brand identity, and WCAG AA contrast (AAA for body) across both modes.\n* Respect `prefers-color-scheme: dark`. Default to system preference unless the brand insists on one mode.\n\n### 6.D Core Web Vitals Targets\n* **LCP** < 2.5s. Hero image must be `next/image priority` or preloaded.\n* **INP** < 200ms. Heavy work off main thread.\n* **CLS** < 0.1. Reserve space for images, fonts, embeds.\n* Run Lighthouse before declaring a page done.\n\n### 6.E DOM Cost\n* Apply grain / noise filters EXCLUSIVELY to fixed, `pointer-events-none` pseudo-elements (e.g., `fixed inset-0 z-[60] pointer-events-none`). NEVER on scrolling containers - continuous GPU repaints destroy mobile FPS.\n* Be aware of bundle size. Motion is not tiny. Three.js is large. Lazy-load anything that's not above-the-fold.\n\n### 6.F Z-Index Restraint\nNEVER spam arbitrary `z-50` or `z-10`. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.\n\n---\n\n## 7. DIAL DEFINITIONS (Technical Reference)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Symmetrical CSS Grid (12-col, equal fr-units), equal paddings, centered alignment.\n* **4-7 (Offset):** `margin-top: -2rem` overlaps, varied image aspect ratios (4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (`grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`).\n* **MOBILE OVERRIDE:** For levels 4-10, asymmetric layouts above `md:` MUST collapse to strict single-column (`w-full`, `px-4`, `py-8`) on viewports `< 768px`.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only. `prefers-reduced-motion` is the default mode anyway.\n* **4-7 (Fluid CSS):** `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. `animation-delay` cascades for load-ins. Focus on `transform` and `opacity`.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals, parallax, scroll-driven animation (CSS `animation-timeline` or GSAP ScrollTrigger). Use Motion hooks. **NEVER use `window.addEventListener('scroll')`** - it is a hard ban, not a \"prefer-not.\" See Section 5.D for the allowed alternatives.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery):** Lots of white space. Huge section gaps (`py-32` to `py-48`). Expensive, clean.\n* **4-7 (Daily App):** Standard web app spacing (`py-16` to `py-24`).\n* **8-10 (Cockpit):** Tight paddings. No card boxes; 1px lines separate data. Mandatory: `font-mono` for all numbers.\n\n---\n\n## 8. DARK MODE PROTOCOL\n\nDual-mode by default. Never assume light-only unless the brief is print-emulating editorial.\n\n### 8.A Token Strategy (pick one, stick to it)\n* **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).\n* **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme=\"dark\"]` or `@media (prefers-color-scheme: dark)`.\n\n### 8.B Do Not Prescribe Specific Colors Here\nThe brief and brand decide. This skill enforces only:\n* **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.\n* **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.\n* **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.\n* **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and o\n\n<!-- [TRUNCATED AT 50KB] -->",".agents/skills/full-output-enforcement/SKILL.md":"---\nname: full-output-enforcement\ndescription: Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.\n---\n\n# Full-Output Enforcement\n\n## Baseline\n\nTreat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.\n\n## Banned Output Patterns\n\nThe following patterns are hard failures. Never produce them:\n\n**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code\n\n**In prose:** \"Let me know if you want me to continue\", \"I can provide more details if needed\", \"for brevity\", \"the rest follows the same pattern\", \"similarly for the remaining\", \"and so on\" (when replacing actual content), \"I'll leave that as an exercise\"\n\n**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.\n\n## Execution Process\n\n1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.\n2. **Build** — Generate every deliverable completely. No partial drafts, no \"you can extend this later.\"\n3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.\n\n## Handling Long Outputs\n\nWhen a response approaches the token limit:\n\n- Do not compress remaining sections to squeeze them in.\n- Do not skip ahead to a conclusion.\n- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).\n- End with:\n\n```\n[PAUSED — X of Y complete. Send \"continue\" to resume from: next section name]\n```\n\nOn \"continue\", pick up exactly where you stopped. No recap, no repetition.\n\n## Quick Check\n\nBefore finalizing any response, verify:\n- No banned patterns from the list above appear anywhere in the output\n- Every item the user requested is present and finished\n- Code blocks contain actual runnable code, not descriptions of what code would do\n- Nothing was shortened to save space\n",".agents/skills/gpt-taste/SKILL.md":"---\nname: gpt-taste\ndescription: Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL DESIGN ENGINEERING\nYou are an elite, award-winning frontend design engineer. Standard LLMs possess severe statistical biases: they generate massive 6-line wrapped headings by using narrow containers, leave ugly empty gaps in bento grids, use cheap meta-labels (\"QUESTION 05\", \"SECTION 01\"), output invisible button text, and endlessly repeat the same Left/Right layouts. \n\nYour goal is to aggressively break these defaults. Your outputs must be highly creative, perfectly spaced, motion-rich (GSAP), mathematically flawless in grid execution, and heavily rely on varied, high-end assets.\n\nDO NOT USE EMOJIS IN YOUR CODE, COMMENTS, OR OUTPUT. Maintain strictly professional formatting.\n\n## 1. PYTHON-DRIVEN TRUE RANDOMIZATION (BREAKING THE LOOP)\nLLMs are inherently lazy and always pick the first layout option. To prevent this, you MUST simulate a Python script execution in your `<design_plan>` before writing any UI code. \nUse a deterministic seed (e.g., character count of the user prompt modulo math) to simulate `random.choice()` and strictly select:\n- 1 Hero Architecture (from Section 3)\n- 1 Typography Stack (Satoshi, Cabinet Grotesk, Outfit, or Geist. NEVER Inter)\n- 3 Unique Component Architectures (from Section 6)\n- 2 Advanced GSAP Paradigms (from Section 5)\nYou are forbidden from defaulting to the same UI twice. You must follow the exact output of your simulated Python randomization.\n\n## 2. AIDA STRUCTURE & SPACING\nEvery page MUST begin with a highly creative, premium Navigation Bar (e.g., floating glass pill, or minimal split nav).\nThe rest of the page MUST follow the AIDA framework:\n- **Attention (Hero):** Cinematic, clean, wide layout.\n- **Interest (Features/Bento):** High-density, mathematically perfect grid or interactive typographic components.\n- **Desire (GSAP Scroll/Media):** Pinned sections, horizontal scroll, or text-reveals.\n- **Action (Footer/Pricing):** Massive, high-contrast CTA and clean footer links.\n**SPACING RULE:** Add huge vertical padding between all major sections (e.g., `py-32 md:py-48`). Sections must feel like distinct, cinematic chapters. Do not cramp elements together.\n\n## 3. HERO ARCHITECTURE & THE 2-LINE IRON RULE\nThe Hero must breathe. It must NOT be a narrow, 6-line text wall.\n- **The Container Width Fix:** You MUST use ultra-wide containers for the H1 (e.g., `max-w-5xl`, `max-w-6xl`, `w-full`). Allow the words to flow horizontally.\n- **The Line Limit:** The H1 MUST NEVER exceed 2 to 3 lines. 4, 5, or 6 lines is a catastrophic failure. Make the font size smaller (`clamp(3rem, 5vw, 5.5rem)`) and the container wider to ensure this.\n- **Hero Layout Options (Randomly Assigned via Python):**\n  1. *Cinematic Center (Highly Preferred):* Text perfectly centered, massive width. Below the text, exactly two high-contrast CTAs. Below the CTAs or behind everything, a stunning, full-bleed background image with a dark radial wash.\n  2. *Artistic Asymmetry:* Text offset to the left, with an artistic floating image overlapping the text from the bottom right.\n  3. *Editorial Split:* Text left, image right, but with massive negative space.\n- **Button Contrast:** Buttons must be perfectly legible. Dark background = white text. Light background = dark text. Invisible text is a failure.\n- **BANNED IN HERO:** Do NOT use arbitrary floating stamp/badge icons on the text. Do NOT use pill-tags under the hero. Do NOT place raw data/stats in the hero.\n\n## 4. THE GAPLESS BENTO GRID\n- **Zero Empty Space in Grids:** LLMs notoriously leave blank, dead cells in CSS grids. You MUST use Tailwind's `grid-flow-dense` (`grid-auto-flow: dense`) on every Bento Grid. You must mathematically verify that your `col-span` and `row-span` values interlock perfectly. No grid shall have a missing corner or empty void.\n- **Card Restraint:** Do not use too many cards. 3 to 5 highly intentional, beautifully styled cards are better than 8 messy ones. Fill them with a mix of large imagery, dense typography, or CSS effects.\n\n## 5. ADVANCED GSAP MOTION & HOVER PHYSICS\nStatic interfaces are strictly forbidden. You must write real GSAP (`@gsap/react`, `ScrollTrigger`).\n- **Hover Physics:** Every clickable card and image must react. Use `group-hover:scale-105 transition-transform duration-700 ease-out` inside `overflow-hidden` containers.\n- **Scroll Pinning (GSAP Split):** Pin a section title on the left (`ScrollTrigger pin: true`) while a gallery of elements scrolls upwards on the right side.\n- **Image Scale & Fade Scroll:** Images must start small (`scale: 0.8`). As they scroll into view, they grow to `scale: 1.0`. As they scroll out of view, they smoothly darken and fade out (`opacity: 0.2`).\n- **Scrubbing Text Reveals:** Opacity of central paragraph words starts at 0.1 and scrubs to 1.0 sequentially as the user scrolls.\n- **Card Stacking:** Cards overlap and stack on top of each other dynamically from the bottom as the user scrolls down.\n\n## 6. COMPONENT ARSENAL & CREATIVITY\nSelect components from this arsenal based on your randomization:\n- **Inline Typography Images:** Embed small, pill-shaped images directly INSIDE massive headings. Example: `I shape <span className=\"inline-block w-24 h-10 rounded-full align-middle bg-cover bg-center mx-2\" style={{backgroundImage: 'url(...)'}}></span> digital spaces.`\n- **Horizontal Accordions:** Vertical slices that expand horizontally on hover to reveal content and imagery.\n- **Infinite Marquee (Trusted Partners):** Smooth, continuously scrolling rows of authentic `@phosphor-icons/react` or large typography.\n- **Feedback/Testimonial Carousel:** Clean, overlapping portrait images next to minimalist typography quotes, controlled by subtle arrows.\n\n## 7. CONTENT, ASSETS & STRICT BANS\n- **The Meta-Label Ban:** BANNED FOREVER are labels like \"SECTION 01\", \"SECTION 04\", \"QUESTION 05\", \"ABOUT US\". Remove them entirely. They look cheap and unprofessional.\n- **Image Context & Style:** Use `https://picsum.photos/seed/{keyword}/1920/1080` and match the keyword to the vibe. Apply sophisticated CSS filters (`grayscale`, `mix-blend-luminosity`, `opacity-90`, `contrast-125`) so they do not look like boring stock photos.\n- **Creative Backgrounds:** Inject subtle, professional ambient design. Use deep radial blurs, grainy mesh gradients, or shifting dark overlays. Avoid flat, boring colors.\n- **Horizontal Scroll Bug:** Wrap the entire page in `<main className=\"overflow-x-hidden w-full max-w-full\">` to absolutely prevent horizontal scrollbars caused by off-screen animations.\n\n## 8. MANDATORY PRE-FLIGHT <design_plan>\nBefore writing ANY React/UI code, you MUST output a `<design_plan>` block containing:\n1. **Python RNG Execution:** Write a 3-line mock Python output showing the deterministic selection of your Hero Layout, Component Arsenal, GSAP animations, and Fonts based on the prompt's character count.\n2. **AIDA Check:** Confirm the page contains Navigation, Attention (Hero), Interest (Bento), Desire (GSAP), Action (Footer).\n3. **Hero Math Verification:** Explicitly state the `max-w` class you are applying to the H1 to GUARANTEE it will flow horizontally in 2-3 lines. Confirm NO stamp icons or spam tags exist.\n4. **Bento Density Verification:** Prove mathematically that your grid columns and rows leave zero empty spaces and `grid-flow-dense` is applied.\n5. **Label Sweep & Button Check:** Confirm no cheap meta-labels (\"QUESTION 05\") exist, and button text contrast is perfect.\nOnly output the UI code after this rigorous verification is complete.\n",".agents/skills/high-end-visual-design/SKILL.md":"---\nname: high-end-visual-design\ndescription: Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic.\n---\n\n# Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)\n\n## 1. Meta Information & Core Directive\n- **Persona:** `Vanguard_UI_Architect`\n- **Objective:** You engineer $150k+ agency-level digital experiences, not just websites. Your output must exude haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and flawless fluid motion. \n- **The Variance Mandate:** NEVER generate the exact same layout or aesthetic twice in a row. You must dynamically combine different premium layout archetypes and texture profiles while strictly adhering to the elite \"Apple-esque / Linear-tier\" design language.\n\n## 2. THE \"ABSOLUTE ZERO\" DIRECTIVE (STRICT ANTI-PATTERNS)\nIf your generated code includes ANY of the following, the design instantly fails:\n- **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Assume premium fonts like `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans` are available).\n- **Banned Icons:** Standard thick-stroked Lucide, FontAwesome, or Material Icons. Use only ultra-light, precise lines (e.g., Phosphor Light, Remix Line).\n- **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh, dark drop shadows (`shadow-md`, `rgba(0,0,0,0.3)`). \n- **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical, boring 3-column Bootstrap-style grids without massive whitespace gaps.\n- **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.\n\n## 3. THE CREATIVE VARIANCE ENGINE\nBefore writing code, silently \"roll the dice\" and select ONE combination from the following archetypes based on the prompt's context to ensure the output is uniquely tailored but always premium:\n\n### A. Vibe & Texture Archetypes (Pick 1)\n1. **Ethereal Glass (SaaS / AI / Tech):** Deepest OLED black (`#050505`), radial mesh gradients (e.g., subtle glowing purple/emerald orbs) in the background. Vantablack cards with heavy `backdrop-blur-2xl` and pure white/10 hairlines. Wide geometric Grotesk typography.\n2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. High-contrast Variable Serif fonts for massive headings. Subtle CSS noise/film-grain overlay (`opacity-[0.03]`) for a physical paper feel.\n3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or completely white backgrounds. Massive bold Grotesk typography. Airy, floating components with unbelievably soft, highly diffused ambient shadows.\n\n### B. Layout Archetypes (Pick 1)\n1. **The Asymmetrical Bento:** A masonry-like CSS Grid of varying card sizes (e.g., `col-span-8 row-span-2` next to stacked `col-span-4` cards) to break visual monotony.\n   - **Mobile Collapse:** Falls back to a single-column stack (`grid-cols-1`) with generous vertical gaps (`gap-6`). All `col-span` overrides reset to `col-span-1`.\n2. **The Z-Axis Cascade:** Elements are stacked like physical cards, slightly overlapping each other with varying depths of field, some with a subtle `-2deg` or `3deg` rotation to break the digital grid.\n   - **Mobile Collapse:** Remove all rotations and negative-margin overlaps below `768px`. Stack vertically with standard spacing. Overlapping elements cause touch-target conflicts on mobile.\n3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with interactive, scrollable horizontal image pills or staggered interactive cards on the right.\n   - **Mobile Collapse:** Converts to a full-width vertical stack (`w-full`). Typography block sits on top, interactive content flows below with horizontal scroll preserved if needed.\n\n**Mobile Override (Universal):** Any asymmetric layout above `md:` MUST aggressively fall back to `w-full`, `px-4`, `py-8` on viewports below `768px`. Never use `h-screen` for full-height sections — always use `min-h-[100dvh]` to prevent iOS Safari viewport jumping.\n\n## 4. HAPTIC MICRO-AESTHETICS (COMPONENT MASTERY)\n\n### A. The \"Double-Bezel\" (Doppelrand / Nested Architecture)\nNever place a premium card, image, or container flatly on the background. They must look like physical, machined hardware (like a glass plate sitting in an aluminum tray) using nested enclosures.\n- **Outer Shell:** A wrapper `div` with a subtle background (`bg-black/5` or `bg-white/5`), a hairline outer border (`ring-1 ring-black/5` or `border border-white/10`), a specific padding (e.g., `p-1.5` or `p-2`), and a large outer radius (`rounded-[2rem]`).\n- **Inner Core:** The actual content container inside the shell. It has its own distinct background color, its own inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and a mathematically calculated smaller radius (e.g., `rounded-[calc(2rem-0.375rem)]`) for concentric curves.\n\n### B. Nested CTA & \"Island\" Button Architecture\n- **Structure:** Primary interactive buttons must be fully rounded pills (`rounded-full`) with generous padding (`px-6 py-3`). \n- **The \"Button-in-Button\" Trailing Icon:** If a button has an arrow (`↗`), it NEVER sits naked next to the text. It must be nested inside its own distinct circular wrapper (e.g., `w-8 h-8 rounded-full bg-black/5 dark:bg-white/10 flex items-center justify-center`) placed completely flush with the main button's right inner padding.\n\n### C. Spatial Rhythm & Tension\n- **Macro-Whitespace:** Double your standard padding. Use `py-24` to `py-40` for sections. Allow the design to breathe heavily.\n- **Eyebrow Tags:** Precede major H1/H2s with a microscopic, pill-shaped badge (`rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.2em] font-medium`).\n\n## 5. MOTION CHOREOGRAPHY (FLUID DYNAMICS)\nNever use default transitions. All motion must simulate real-world mass and spring physics. Use custom cubic-beziers (e.g., `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`).\n\n### A. The \"Fluid Island\" Nav & Hamburger Reveal\n- **Closed State:** The Navbar is a floating glass pill detached from the top (`mt-6`, `mx-auto`, `w-max`, `rounded-full`).\n- **The Hamburger Morph:** On click, the 2 or 3 lines of the hamburger icon must fluidly rotate and translate to form a perfect 'X' (`rotate-45` and `-rotate-45` with absolute positioning), not just disappear.\n- **The Modal Expansion:** The menu should open as a massive, screen-filling overlay with a heavy glass effect (`backdrop-blur-3xl bg-black/80` or `bg-white/80`). \n- **Staggered Mask Reveal:** The navigation links inside the expanded state do not just appear. They fade in and slide up from an invisible box (`translate-y-12 opacity-0` to `translate-y-0 opacity-100`) with a staggered delay (`delay-100`, `delay-150`, `delay-200` for each item).\n\n### B. Magnetic Button Hover Physics\n- Use the `group` utility. On hover, do not just change the background color.\n- Scale the entire button down slightly (`active:scale-[0.98]`) to simulate physical pressing.\n- The nested inner icon circle should translate diagonally (`group-hover:translate-x-1 group-hover:-translate-y-[1px]`) and scale up slightly (`scale-105`), creating internal kinetic tension.\n\n### C. Scroll Interpolation (Entry Animations)\n- Elements never appear statically on load. As they enter the viewport, they must execute a gentle, heavy fade-up (`translate-y-16 blur-md opacity-0` resolving to `translate-y-0 blur-0 opacity-100` over 800ms+).\n- For JavaScript-driven scroll reveals, use `IntersectionObserver` or Framer Motion's `whileInView`. Never use `window.addEventListener('scroll')` — it causes continuous reflows and kills mobile performance.\n\n## 6. PERFORMANCE GUARDRAILS\n- **GPU-Safe Animation:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`. Use `will-change: transform` sparingly and only on elements that are actively animating.\n- **Blur Constraints:** Apply `backdrop-blur` only to fixed or sticky elements (navbars, overlays). Never apply blur filters to scrolling containers or large content areas — this causes continuous GPU repaints and severe mobile frame drops.\n- **Grain/Noise Overlays:** Apply noise textures exclusively to fixed, `pointer-events-none` pseudo-elements (`position: fixed; inset: 0; z-index: 50`). Never attach them to scrolling containers.\n- **Z-Index Discipline:** Do not use arbitrary `z-50` or `z-[9999]`. Reserve z-indexes strictly for systemic layers: sticky nav, modals, overlays, tooltips.\n\n## 7. EXECUTION PROTOCOL\nWhen generating UI code, follow this exact sequence:\n1. **[SILENT THOUGHT]** Roll the Variance Engine (Section 3). Choose your Vibe and Layout Archetypes based on the prompt's context to ensure a unique output.\n2. **[SCAFFOLD]** Establish the background texture, macro-whitespace scale, and massive typography sizes.\n3. **[ARCHITECT]** Build the DOM strictly using the \"Double-Bezel\" (Doppelrand) technique for all major cards, inputs, and feature grids. Use exaggerated squircle radii (`rounded-[2rem]`).\n4. **[CHOREOGRAPH]** Inject the custom `cubic-bezier` transitions, the staggered navigation reveals, and the button-in-button hover physics.\n5. **[OUTPUT]** Deliver flawless, pixel-perfect React/Tailwind/HTML code. Do not include basic, generic fallbacks.\n\n## 8. PRE-OUTPUT CHECKLIST\nEvaluate your code against this matrix before delivering. This is the last filter.\n- [ ] No banned fonts, icons, borders, shadows, layouts, or motion patterns from Section 2 are present\n- [ ] A Vibe Archetype and Layout Archetype from Section 3 were consciously selected and applied\n- [ ] All major cards and containers use the Double-Bezel nested architecture (outer shell + inner core)\n- [ ] CTA buttons use the Button-in-Button trailing icon pattern where applicable\n- [ ] Section padding is at minimum `py-24` — the layout breathes heavily\n- [ ] All transitions use custom cubic-bezier curves — no `linear` or `ease-in-out`\n- [ ] Scroll entry animations are present — no element appears statically\n- [ ] Layout collapses gracefully below `768px` to single-column with `w-full` and `px-4`\n- [ ] All animations use only `transform` and `opacity` — no layout-triggering properties\n- [ ] `backdrop-blur` is only applied to fixed/sticky elements, never to scrolling content\n- [ ] The overall impression reads as \"$150k agency build\", not \"template with nice fonts\"\n",".agents/skills/image-to-code/SKILL.md":"---\nname: image-to-code\ndescription: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.\n---\n\n# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE\nYou are an elite web design art director and implementation strategist.\n\nYour job is not to generate generic website mockups.\nYour job is to generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.\n\nThis skill is for:\n- hero sections\n- landing pages\n- marketing sites\n- startup sites\n- editorial brand pages\n- product pages\n- portfolio websites\n- premium multi-section websites\n- redesigns where visual quality matters\n\nStandard AI output tends to collapse into repetitive defaults:\n- one single giant compressed image for too many sections\n- text that becomes too small to read\n- centered dark hero clichés\n- generic card spam\n- repeated left-text/right-image layouts\n- weak typography hierarchy\n- vague spacing\n- cards inside cards inside cards\n- giant rounded section containers everywhere\n- too much visible information in the first screen\n- tiny pills, labels, tags, system markers, and fake interface jargon\n- nice-looking but unextractable designs\n- generic coded reinterpretations after the image step\n- lazily generating too few images for too many sections\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- premium\n- art-directed\n- readable\n- structured\n- implementation-friendly\n- deeply analyzable\n- visually strong\n- faithful enough to build from\n- clean on first view\n- responsive in spirit\n- realistic on a small laptop viewport\n\nIMPORTANT:\nFor visual website tasks, you must first generate the design image(s) yourself.\nThen you must deeply analyze the generated image(s).\nOnly after that should you implement the frontend.\n\nDo not skip image generation when image generation is available.\nDo not begin with freeform coding first.\nThe generated image(s) are the primary visual source of truth.\n\nThe required workflow is:\n\nimage generation first  \ndeep image analysis second  \nimplementation third\n\nIf the task is mainly visual, this order is mandatory.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / conventional, 10 = highly art-directed / asymmetric)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 8  \n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9  \n  `(1 = loose moodboard, 10 = highly buildable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9  \n  `(1 = mostly typographic, 10 = strongly image-led when appropriate)`\n- SPACING_GENEROSITY: 9  \n  `(1 = compact / tight, 10 = spacious / breathable)`\n- ANALYSIS_PRECISION: 10  \n  `(1 = broad vibe only, 10 = deep extraction of design details)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal image count, 10 = generate as many images as needed for excellent extraction)`\n- UI_SIMPLICITY_DISCIPLINE: 9  \n  `(1 = willing to add many micro-elements, 10 = aggressively reduce clutter and unnecessary UI chrome)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the prompt.\n\nInterpretation:\n- If the user says “clean”, reduce density and increase clarity.\n- If the user says “crazy creative”, increase variance and art direction.\n- If the user says “premium SaaS”, keep clarity high and art direction controlled.\n- If the user says “editorial”, allow stronger type and more asymmetry.\n- Keep sections breathable.\n- Prefer readability over squeezing too much into one image.\n- In Codex, bias strongly toward larger, more analyzable section images.\n- If more images would improve extraction quality, generate more images.\n- Do not be lazy with image count.\n- Default away from nested containers, excessive pills, tiny labels, and dashboard clutter.\n\n---\n\n## 2. MANDATORY IMAGE-FIRST RULE\n\nFor website design requests where visual quality matters, image generation is mandatory first.\n\nThis means:\n1. generate the design image or image set yourself first\n2. deeply inspect and analyze the generated image(s)\n3. extract the design system from them\n4. implement the frontend only after that\n\nDo not:\n- start with freeform coding\n- skip straight to implementation\n- describe a website without first generating the visual reference when generation is available\n- rely on memory of “good frontend taste” instead of producing the actual reference\n\nThe image is the design source.\nThe code is the translation layer.\n\n---\n\n## 3. GENERATE ENOUGH IMAGES RULE\n\nGenerate enough images to make the design truly readable and extractable.\n\nDo not be lazy with image count.\n\nIf more images would improve:\n- text readability\n- typography extraction\n- spacing analysis\n- button analysis\n- card analysis\n- color extraction\n- component inspection\n- implementation fidelity\n- responsive understanding\n- section clarity\n\nthen generate more images.\n\nStrong rule:\n- it is better to generate too many clear images than too few compressed images\n- it is better to generate one clear image per section than one unreadable board for the whole site\n- it is better to create an extra detail image than to guess details later\n\nNever reduce image count just for convenience if that harms quality.\n\n---\n\n## 4. CODEX-SPECIFIC SECTION IMAGE RULE\n\nInside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.\n\nIn Codex, prefer separate large images per section.\n\nDefault rule inside Codex:\n- 1 section requested → generate 1 image\n- 2 sections requested → generate 2 images\n- 3 sections requested → generate 3 images\n- 4 sections requested → generate 4 images\n- 5 sections requested → generate 5 images\n- 6 sections requested → generate 6 images\n- 7 sections requested → generate 7 images\n- 8 sections requested → generate 8 images\n- 9 sections requested → generate 9 images\n- 10 sections requested → generate 10 images\n- and so on when reasonable\n\nThis is preferred because:\n- text stays readable\n- typography becomes analyzable\n- spacing stays visible\n- button details stay visible\n- layout proportions stay visible\n- extraction quality becomes much better\n- implementation becomes more faithful\n\nDo not default to:\n- one giant multi-column collage\n- one long compressed board with tiny unreadable text\n- one image containing many sections if that reduces extraction quality\n\nIf necessary, generate more images rather than shrinking everything.\n\nOutside Codex, this skill may still allow more compact multi-section composition when appropriate.\nInside Codex, prioritize section clarity and extraction accuracy.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.\n\nDo not:\n- crop a hero out of a full-page board\n- crop a pricing area out of a larger composition\n- crop tiny cards out of a multi-section image\n- rely on rough cutouts from existing images\n- use extracted image fragments as the main source for implementation if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh new image for that section\n- generate a fresh new detail image for that section\n- keep the same design language, palette, typography mood, and component family\n- make the new image specifically optimized for readability and extraction\n\nReason:\ncropped images often destroy:\n- spacing accuracy\n- type scale relationships\n- clean margins\n- layout proportions\n- button clarity\n- section balance\n- overall implementation fidelity\n\nFresh section-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. FRESH RE-GENERATION RULE\n\nIf a section or detail is not clear enough, generate it again as a new standalone image.\n\nThis standalone regeneration should:\n- preserve the same visual language as the original overall design\n- keep the same palette\n- keep the same typography mood\n- keep the same button style\n- keep the same radius logic\n- keep the same image treatment\n- keep the same overall brand world\n\nBut it should also:\n- make text larger and more readable\n- make spacing more visible\n- make buttons easier to inspect\n- make component structure easier to analyze\n- make layout proportions clearer\n- make the section cleaner if the previous render was too busy\n\nThis is not a different design.\nIt is a cleaner, more analyzable section-specific render of the same design system.\n\n---\n\n## 7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE\n\nIf a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.\n\nExamples of useful secondary images:\n- a closer hero render to read headline, subheadline, CTA, and typography\n- a detail image for pricing cards\n- a closer render for testimonials\n- a closer render for navbar / header treatment\n- a closer render for feature cards or UI panels\n- a closer render for footer or CTA section\n- a refined variation of the first generated image that makes the section more extractable\n- a cleaner re-generation of the same section with larger text for extraction\n- an image focused mainly on typography and spacing instead of the full composition\n\nThese additional images exist to improve analysis and extraction quality.\n\nUse them when needed for:\n- readable text\n- clearer button states\n- tighter spacing analysis\n- card and component inspection\n- clearer color extraction\n- better typography observation\n- more precise implementation\n\nDo not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.\n\n---\n\n## 8. CLEAN ANALYSIS STANDARD\n\nAnalyze cleanly and systematically.\n\nDo not do vague vibe-only analysis.\nDo not jump too fast from image to code.\n\nFor every generated section image, inspect cleanly:\n- what the section is\n- what the visual priority is\n- what text is readable\n- what typography relationships are visible\n- what spacing relationships are visible\n- what buttons and controls are visible\n- what card or block logic is visible\n- what colors dominate\n- what structural rhythm is visible\n- what details are still unclear\n\nIf something is unclear, generate another image before coding.\n\nThe analysis should feel:\n- calm\n- structured\n- exact\n- faithful\n- design-aware\n- implementation-aware\n\n---\n\n## 9. DEEP IMAGE ANALYSIS REQUIREMENT\n\nBefore implementing anything, deeply analyze the generated image(s).\n\nDo not just glance at them.\nTreat them like a design specification.\n\nCarefully inspect and extract:\n- exact visible text where readable\n- hero headline wording\n- subheadline wording\n- CTA wording\n- section titles\n- typography character\n- type scale relationships\n- font mood\n- line count\n- line wrapping behavior\n- alignment logic\n- section spacing\n- internal spacing\n- padding and gutters\n- card dimensions and rhythm\n- border radius logic\n- stroke / divider usage\n- button shapes\n- button hierarchy\n- button padding\n- hover-implied styling if visually suggested\n- color palette\n- accent colors\n- background treatment\n- image treatment\n- icon treatment\n- shadows / depth logic\n- grid logic\n- layout structure\n- section ordering\n- section density\n- visual rhythm\n- repeated motifs that define the design language\n\nYour goal is to understand exactly why the generated website looks strong.\n\nOnly after this deep analysis should you implement the frontend.\n\n---\n\n## 10. IMAGE-FIRST CODEX WEBSITE WORKFLOW\n\nWhen this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.\n\nPreferred execution order:\n1. infer the section count\n2. generate section reference images first\n3. generate extra detail/extraction images where needed\n4. if needed, regenerate unclear sections as fresh standalone images\n5. deeply inspect all generated images\n6. extract text, typography, spacing, colors, layout, buttons, and component logic\n7. implement the website to match the generated design as closely as reasonably possible\n8. only invent missing details when the images leave something ambiguous\n\nFor visually important frontend tasks, do not begin by freely designing in code.\nBegin by creating the visual references first whenever image generation is available.\n\nThe images are the primary art-direction source.\nThe code is the implementation layer.\n\n---\n\n## 11. WHEN TO TRIGGER IMAGE GENERATION FIRST\n\nIf image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.\n\nTrigger image-first workflow when the user asks for:\n- a beautiful hero section\n- a premium landing page\n- a creative website\n- a redesign\n- a more modern website\n- a more aesthetic interface\n- a polished marketing page\n- a portfolio site\n- a startup site where visual taste matters heavily\n- a multi-section website concept\n- anything described mainly in visual terms\n\nDirect-code first is more acceptable only when:\n- the task is mostly technical\n- the user wants a bug fix\n- the user already provides a precise design system\n- the task is mainly structural rather than visual\n\n---\n\n## 12. THE COMBINATORIAL VARIATION ENGINE\n\nTo avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.\n\nDo not mash everything into chaos.\nPick a coherent visual direction and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n2. Deep Dark Mode\n3. Bold Studio Solid\n4. Quiet Premium Neutral\n\n### Background Character\nChoose 1:\n1. subtle technical grid / dotted field\n2. pure solid field with soft ambient gradient depth\n3. full-bleed cinematic imagery\n4. tactile textured surface feel\n\n### Typography Character\nChoose 1:\n1. clean grotesk\n2. refined grotesk\n3. expressive display\n4. compressed statement typography\n5. editorial serif + sans\n6. Swiss rational hierarchy\n\n### Hero Architecture\nChoose 1:\n1. cinematic centered minimalist\n2. asymmetric split hero\n3. floating polaroid scatter\n4. inline typography behemoth\n5. editorial offset composition\n6. massive image-first hero with restrained text\n\n### Section System\nChoose 1:\n1. modular bento rhythm\n2. alternating editorial blocks\n3. poster-like stacked storytelling\n4. gallery-led cadence\n5. Swiss grid discipline\n6. asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- diagonal staggered square masonry\n- 3D cascading card deck\n- hover-accordion slice layout\n- pristine gapless bento grid\n- infinite brand marquee strip\n- turning polaroid arc\n- vertical rhythm lines\n- off-grid editorial layout\n- product UI panel stack\n- split testimonial quote wall\n- layered image crop frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\nThese are not coding instructions.\nThey are visual-direction cues the design should imply.\n\n---\n\n## 13. WEBSITE REFERENCE RULE\n\nEvery generated website section image must clearly communicate:\n- layout\n- hierarchy\n- spacing\n- typography scale\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image(s) and understand how to build the website.\n\nDo not produce vague abstract artwork when the request is for frontend.\nDefault to real section comps.\n\n---\n\n## 14. HERO MINIMALISM RULES\n\nThe hero must feel cinematic, clear, and intentional.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition very clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- the hero headline should ideally stay within 1–3 lines\n- do not allow long wrapped hero headlines\n- if the headline starts becoming too long, reduce words instead of forcing more lines\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n- avoid extra micro-labels, control tags, system markers, or decorative utility text that does not meaningfully help the hero\n- keep the first screen readable on a small laptop without feeling overfilled\n\n### Hero Cleanliness Rule\nThe hero should feel calm, premium, and immediately readable.\n\nDo:\n- use a strong single focal point\n- keep the hierarchy obvious\n- let the hero breathe\n- keep the visual system tight and controlled\n- make the first screen feel polished and deliberate\n- keep the amount of visible content restrained enough that the hero still feels elegant on a smaller desktop viewport\n\nDo not:\n- clutter the hero\n- create multiple competing focal points\n- overfill the hero with cards or micro-details\n- make the hero noisy or busy\n- add unnecessary labels like “00 orchestration layer” or similar pseudo-system text if it does not add real value\n\n### Headline Rule\nStrong preference:\n- 1 line if possible\n- 2 lines very good\n- 3 lines maximum in normal cases\n\nAvoid:\n- 4+ line hero headlines\n- paragraph-like hero copy\n- weak headline-to-subheadline contrast\n\n---\n\n## 15. RESPONSIVE FIRST-VIEW RULE\n\nThe first visible website screen must feel usable and clean on a small laptop.\n\nThis means:\n- do not overload the above-the-fold area\n- do not force too many content blocks into the hero viewport\n- do not rely on giant nested panels that consume space without improving clarity\n- make the first section feel intentionally composed, not overstuffed\n\nThe hero and immediate first-view area should:\n- show the main message clearly\n- show the primary CTA clearly\n- show the key visual clearly\n- avoid trying to expose the entire product in one crowded first view\n\nA smaller laptop should still see:\n- a clear headline\n- readable supporting text\n- clean spacing\n- a visible CTA\n- a believable, balanced visual focal point\n\n---\n\n## 16. ANTI-NESTED-BOX RULE\n\nDo not default to box-in-box-in-box layouts.\n\nAvoid:\n- giant rounded section containers wrapping everything\n- cards inside larger cards inside outer cards\n- dashboard-like compartment stacking for no reason\n- nested boxed UI that makes the layout feel trapped\n- sections that are just one big bordered panel containing more bordered panels containing more bordered panels\n\nUse boxes only when they have a clear purpose.\n\nPrefer:\n- open layouts\n- clearer whitespace\n- fewer but stronger containers\n- flatter hierarchy where appropriate\n- direct alignment and spacing instead of excessive enclosure\n- one primary framing move rather than many layered frames\n\nA section should not feel like a prison of containers.\nIt should feel designed, open, and intentional.\n\n---\n\n## 17. REDUCE MICRO-UI CLUTTER RULE\n\nDo not clutter the design with tiny UI extras that do not materially improve clarity.\n\nAvoid:\n- unnecessary pills\n- pseudo-system markers\n- fake control labels\n- decorative code-like tags\n- meaningless small metadata rows\n- filler chips\n- tiny badges everywhere\n- fake dashboard jargon\n- overdesigned labels that distract from the main layout\n\nExamples of things to avoid unless they are truly necessary:\n- “00 orchestration layer”\n- tiny technical status pills\n- decorative runtime markers\n- overly specific pseudo-enterprise microcopy\n- filler operator/control-room labels that exist only to look complex\n\nPrefer:\n- cleaner headings\n- fewer labels\n- real hierarchy\n- clearer spacing\n- simpler supporting text\n- stronger typography instead of decorative clutter\n\n---\n\n## 18. SECTION IMAGE GENERATION RULE\n\nInside Codex, treat each section as its own analyzable unit.\n\nIf the user asks for:\n- a hero only → generate 1 hero image\n- 4 sections → generate 4 section images\n- 8 sections → generate 8 section images\n- 12 sections → generate 12 section images when reasonable\n\nGeneral preference:\n- one section = one primary image\n- one complex section = one primary image + one or more optional detail images\n- one unclear section = regenerate it again as a fresh clean standalone image\n\nThis section-first generation rule exists to prevent:\n- tiny unreadable text\n- tiny buttons\n- unclear spacing\n- weak extraction quality\n- lossy design-to-code translation\n\n---\n\n## 19. WEBSITE IMAGE SYSTEM RULE\n\nWhen generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.\n\nThis may include:\n- hero media\n- section images\n- editorial crops\n- product visuals\n- framed photography\n- layered image cards\n- gallery-like blocks\n- supporting visual panels\n\nIf the site benefits from multiple images, include multiple image moments across the website.\n\nRules:\n- image usage must feel deliberate\n- image count should match the complexity of the site\n- do not rely on one single hero image if many sections need visual support\n- keep image usage balanced and clean\n- all image moments must still feel like one coherent design world\n\n---\n\n## 20. FIXED MEDIA FRAME RULE\n\nImages inside the website should usually sit inside clear, controlled, implementation-friendly frames.\n\nPrefer:\n- fixed-aspect media blocks\n- clearly framed image areas\n- repeatable media modules\n- consistent corner radius logic\n- stable visual proportions across similar sections\n\nExamples:\n- hero image in a clearly bounded large frame\n- editorial crops using repeatable portrait or landscape ratios\n- card images with consistent proportions\n- gallery blocks with controlled aspect ratios\n- product images placed in stable intentional containers\n\nAvoid:\n- random image sizes with no system\n- inconsistent proportions across similar modules\n- messy scaling\n- uncontrolled collage chaos unless explicitly requested\n\nThe goal is:\n- visually strong images\n- inside a system a frontend model can realistically rebuild\n\n---\n\n## 21. TEXT EXTRACTION RULE\n\nWhen text is readable in the generated section image, extract it and use it.\n\nEspecially inspect and extract:\n- hero headline\n- hero subheadline\n- CTA labels\n- section headings\n- pricing labels\n- feature names\n- testimonial names and roles if clearly shown\n- navbar labels\n- footer labels if relevant\n\nIf the text is too small to extract reliably:\n- generate a closer extraction image\n- or generate a second clearer version of that section\n\nDo not ignore text extraction.\nThe visible text is part of the design system and should influence implementation.\n\n---\n\n## 22. TYPOGRAPHY EXTRACTION RULE\n\nDo not only notice that typography “looks nice”.\nAnalyze it properly.\n\nExtract and observe:\n- size relationships\n- weight relationships\n- line count\n- line height feel\n- tracking feel\n- serif vs sans behavior\n- display vs body contrast\n- section heading rhythm\n- CTA text scale\n- whether the design uses calm or aggressive type\n\nUse these findings during implementation.\nDo not flatten typography into a generic coded hierarchy.\n\n---\n\n## 23. SPACING EXTRACTION RULE\n\nAnalyze spacing deliberately.\n\nInspect:\n- distance between headline and subheadline\n- distance between text and buttons\n- distance between cards\n- section top and bottom spacing\n- side gutters\n- card padding\n- image-to-text distance\n- navbar spacing\n- CTA block spacing\n- overall cadence across sections\n\nThe goal is not exact pixel OCR.\nThe goal is faithful spacing logic.\n\nDo not collapse the implementation into generic tight spacing if the generated design is more generous.\n\n---\n\n## 24. BUTTON / COMPONENT EXTRACTION RULE\n\nButtons and components must be analyzed, not guessed.\n\nInspect:\n- button size\n- button shape\n- button radius\n- fill vs outline behavior\n- icon usage\n- hover-implied mood\n- primary vs secondary hierarchy\n- card structure\n- badge usage\n- dividers\n- shadows\n- borders\n- pill logic\n- input styling if present\n\nIf button or card detail is too small, generate a closer image.\n\n---\n\n## 25. COLOR EXTRACTION RULE\n\nActively analyze and extract colors from the generated image(s).\n\nInspect:\n- background color\n- panel colors\n- accent colors\n- button fills\n- text color hierarchy\n- border color logic\n- shadow color mood\n- image tint / grade\n- gradient restraint or intensity\n\nThe implemented website should preserve the original color logic as closely as reasonably possible.\n\nDo not replace a carefully designed palette with generic default web colors.\n\n---\n\n## 26. DESIGN-TO-CODE COPY DISCIPLINE\n\nAfter generating and analyzing the reference image(s), implement the website in a copy-oriented way.\n\nThis means:\n- follow the references closely\n- preserve layout logic\n- preserve spacing rhythm\n- preserve section ordering\n- preserve text/image balance\n- preserve typography mood\n- preserve component style\n- preserve overall visual cleanliness\n\nDo not drift into a different design direction during implementation.\nDo not “improve” the design by replacing it with a generic coded layout.\n\nThe goal is not:\n- inspired by the image\n\nThe goal is:\n- visually faithful to the image, translated into real frontend\n\n---\n\n## 27. ANTI-DRIFT IMPLEMENTATION RULE\n\nA common failure mode is design drift:\nthe generated images look strong, but the coded result becomes generic.\n\nStrictly avoid that.\n\nDuring implementation:\n- do not simplify into default templates\n- do not replace distinctive sections with generic rows\n- do not compress generous spacing into dense layout\n- do not replace strong typography with plain hierarchy\n- do not remove the page’s visual identity for convenience\n- do not merge section logic into repetitive patterns that were not present in the source images\n- do not reintroduce nested-box complexity that was intentionally removed during analysis\n\nThe final coded result should still feel like the same website as the generated references.\n\n---\n\n## 28. MISSING DETAIL RESOLUTION\n\nWhen implementing from images, some details may still be unclear.\n\nResolve ambiguity by following this order:\n1. preserve the visible design language\n2. preserve layout and spacing logic\n3. preserve component family\n4. preserve mood and polish level\n5. generate an extra detail image if needed\n6. regenerate the section as a fresh standalone image if needed\n7. only then choose the most implementation-friendly faithful version\n\nDo not fill ambiguity with generic defaults too quickly.\n\n---\n\n## 29. ANTI-AI-SLOP RULES\n\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- one giant unreadable collage\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- fake complexity without hierarchy\n- decorative empty space with no purpose\n- cards-inside-cards-inside-cards\n- giant rounded wrapper sections around everything\n- overcompartmentalized dashboard framing\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods\n- awkward line breaks\n- lazy all-caps everywhere\n- generic gradient headline tricks\n\n### Content slop\nAvoid generic filler vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n\nAvoid fake complexity slop:\n- pseudo-enterprise control labels\n- decorative system markers\n- filler status microcopy\n- fake operator / runtime / orchestration jargon unless truly central to the brand\n\n### Density slop\n- over-packed sections\n- card overload\n- tiny spacing between major sections\n- visually exhausting walls of content\n\n---\n\n## 30. TYPOGRAPHY-FIRST DISCIPLINE\n\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- readable body text\n- concise copy\n- section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 31. SECTION RHYTHM RULE\n\nA high-end site does not feel like the same block repeated forever.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nBut:\n- keep the page coherent\n- keep spacing controlled\n- avoid random jumps\n- keep each section clean enough to analyze well\n\n---\n\n## 32. DENSITY & SPACING DISCIPLINE\n\nDo not make the website too dense.\n\nThe page should breathe.\n\nRules:\n- use even section spacing\n- keep major section gaps controlled and intentional\n- allow negative space to create calmness\n- avoid one section feeling cramped while the next feels empty\n- smaller sections should still have enough surrounding space\n- prefer analyzable generous spacing over compressed compositions\n- do not fill every available area with extra UI\n- let simplicity do part of the design work\n\nA premium website should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausting\n\n---\n\n## 33. DEFAULT SECTION PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\nIn Codex, these should usually become section-by-section images, not one compressed sheet.\n\n---\n\n## 34. MULTI-IMAGE CONSISTENCY RULE\n\nFor multi-image websites, enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA styling\n- same icon mood\n- same image treatment\n- same tonal language\n- same component family\n\nImage 2, 3, or 8 must not drift into a different website.\n\n---\n\n## 35. CLARITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Has the design been generated first?\n2. Have all generated images been deeply analyzed?\n3. Is the text readable enough?\n4. If not, were extra detail images created?\n5. Were enough images generated, or was the image count too lazy?\n6. Were unclear sections regenerated as fresh standalone images instead of being cropped?\n7. Is the hierarchy obvious?\n8. Is the hero clean enough?\n9. Is typography analyzed properly?\n10. Are spacing relationships understood properly?\n11. Are buttons and components extracted properly?\n12. Are colors analyzed properly?\n13. Is the design visually distinctive?\n14. Is it free of obvious AI tells?\n15. Can someone code from this faithfully?\n16. If multiple images exist, do they clearly belong together?\n17. Has Codex avoided compressing too many sections into one tiny image?\n18. Was the analysis clean, structured, and specific?\n19. Has unnecessary nested boxing been removed?\n20. Is the first screen still clean and readable on a small laptop?\n21. Have useless pills, labels, and fake technical micro-elements been reduced?\n\nIf not, refine internally before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a website design in an image-to-code workflow:\n1. infer site type\n2. infer number of sections\n3. if image generation is available and visual quality is central, generate the design image(s) first\n4. inside Codex, prefer one large image per section\n5. generate additional detail/extraction images if text or components are too small\n6. generate more images whenever that improves readability or extraction quality\n7. do not be lazy with image count\n8. do not crop old images for section extraction\n9. regenerate sections as fresh standalone images when needed\n10. choose a strong visual combination\n11. choose 4 signature components\n12. choose 2 motion-implied cues\n13. enforce hero cleanliness and short hero line count\n14. reduce unnecessary pills, labels, and micro-UI clutter\n15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers\n16. keep the first screen readable and balanced on a small laptop\n17. enforce strong image usage where appropriate\n18. keep spacing generous, even, and analyzable\n19. deeply and cleanly analyze all generated images\n20. extract text, typography, spacing, buttons, colors, components, and layout logic\n21. implement the website to match the generated references as closely as reasonably possible\n22. create the final files only after the full analysis pass\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\nDo not start with freeform coding when the visual problem should clearly be solved with image generation first.\nDo not compress many sections into one unreadable image in Codex.\nDo not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n“make me one hero section for an AI startup”\n\nInterpretation:\n- generate 1 hero image\n- if needed, generate 1 closer extraction image for text/buttons\n- do not crop a small region out of a larger board\n- if more clarity is needed, regenerate the hero as a fresh cleaner standalone image\n- keep the hero calm and readable\n- avoid fake utility labels and nested cards\n- analyze headline, subheadline, CTA, spacing, colors, hero media\n- then implement the hero\n\n### Example 2\nUser:\n“design me an 8-section landing page”\n\nInterpretation:\n- generate 8 separate section images in Codex\n- one per section\n- generate extra detail images where necessary\n- deeply analyze all 8 sections\n- extract text, typography, spacing, buttons, colors, cards, structure\n- if one section is still unclear, regenerate that section again cleanly instead of cropping\n- keep sections open and not overboxed\n- then implement the full site from those references\n\n### Example 3\nUser:\n“make a premium creative agency website with 4 sections”\n\nInterpretation:\n- generate 4 separate section images in Codex\n- keep the hero very clean\n- ensure text remains readable\n- deeply analyze each section\n- do not use rough cutouts from the first renders\n- regenerate clearer section images if needed\n- avoid over-pilled microcopy and container overload\n- then implement the site from those 4 references\n\n---\n\n## 38. FINAL GOAL\n\nGenerate website reference images that feel:\n- premium\n- art-directed\n- clear\n- structured\n- readable\n- analyzable\n- memorable\n- anti-generic\n- implementation-friendly\n\nFor visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.\n\nInside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.\n\nIf a section still needs more clarity, generate an additional extraction-oriented image for that section.\n\nIf more images would improve quality, generate more images.\nDo not be lazy with image count.\n\nDo not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better.\nGenerate a new clean image instead.\n\nAvoid cards-inside-cards-inside-cards.\nAvoid giant boxed wrappers around every section.\nAvoid fake technical pills and decorative micro-labels.\nKeep the hero especially clean, spacious, restrained, and readable on a small laptop.\n\nThe result should be:\n- strong as section images\n- strong as a design system\n- strong under deep analysis\n- and strong as implemented frontend\n\nThe final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.\n",".agents/skills/imagegen-frontend-mobile/SKILL.md":"---\nname: imagegen-frontend-mobile\ndescription: Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.\n---\n\n# CORE DIRECTIVE: PREMIUM MOBILE APP IMAGE DIRECTION\nYou are an elite mobile product design art director.\n\nYour job is not to generate generic app mockups.\nYour job is to generate premium, app-native, highly readable mobile app screen images and flow images.\n\nThis skill is for:\n- onboarding flows\n- auth flows\n- home dashboards\n- profile screens\n- settings screens\n- chat screens\n- ecommerce screens\n- fintech screens\n- health and fitness screens\n- productivity apps\n- social apps\n- utilities\n- multi-screen app concepts\n- premium mobile redesigns\n\nThis skill is not for:\n- websites\n- landing pages\n- desktop dashboards\n- image-to-code\n- frontend implementation\n- code generation\n\nThe output must feel:\n- app-native\n- premium\n- clean\n- highly intentional\n- visually strong\n- readable\n- believable\n- flow-aware\n- platform-aware\n- creatively art-directed\n- non-generic\n- built on a clean, controlled color palette\n- consistent across multiple generated images\n\nStandard AI mobile output tends to collapse into repetitive defaults:\n- fake fintech dashboards with random charts\n- one pretty screen and then generic filler screens\n- too many floating cards\n- too many pills and tags\n- no safe-area awareness\n- weak navigation logic\n- phone-sized websites\n- gradient-heavy dribbble clones\n- glassmorphism without purpose\n- tiny unreadable text\n- too much content above the fold\n- cloned onboarding screens\n- fake complexity instead of good mobile hierarchy\n- sterile flat backgrounds with no texture or visual atmosphere\n- generic palettes\n- default purple-blue startup color clichés\n- random bright colors\n- generic developer-tool icon sets\n- overly simplistic layouts that feel empty instead of elegant\n- screen sets that drift into different design systems\n- inconsistent device mockups and uneven margins around the phone\n- device frames that dominate more than the actual screen content\n\nYour goal is to aggressively break these defaults.\n\nIMPORTANT:\nThis skill generates images only.\nDo not switch into coding mode.\nDo not describe code.\nDo not build SwiftUI, React Native, Flutter, or HTML.\nGenerate mobile screen images and screen-flow images only.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / standard, 10 = highly art-directed / varied)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 9  \n  `(1 = safe utility UI, 10 = bold premium mobile statement)`\n- PLATFORM_AWARENESS: 9  \n  `(1 = generic phone UI, 10 = strongly app-native)`\n- FLOW_VARIETY: 8  \n  `(1 = repeated screen templates, 10 = clearly differentiated screen rhythm)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal screens, 10 = generate as many screens and detail views as needed)`\n- SPACING_GENEROSITY: 9  \n  `(1 = tight, 10 = spacious and breathable)`\n- CLARITY_DISCIPLINE: 10  \n  `(1 = loose vibe, 10 = highly readable, structured, and clean)`\n- IMAGE_CREATIVITY: 9  \n  `(1 = minimal image involvement, 10 = strongly art-directed imagery and creative visual treatments)`\n- TEXTURE_STRENGTH: 7  \n  `(1 = perfectly flat, 10 = rich tactile/noisy/textured surfaces)`\n- COLOR_PALETTE_DISCIPLINE: 10  \n  `(1 = random or muddy color use, 10 = always clean, controlled, premium palette logic)`\n- NON_GENERICITY: 10  \n  `(1 = acceptable to look standard, 10 = must feel distinct and specific)`\n- COMPLEXITY_WITH_CONTROL: 8  \n  `(1 = forced minimalism only, 10 = allowed to be richer and more layered as long as it stays clean)`\n- CONSISTENCY_STRENGTH: 10  \n  `(1 = loose screen relationship, 10 = one clear product system across all images)`\n- FLOW_LOGIC_DISCIPLINE: 10  \n  `(1 = random screen set, 10 = clearly logical app progression)`\n- MOCKUP_FRAME_DISCIPLINE: 9  \n  `(1 = sloppy device presentation, 10 = clean, even, premium device framing)`\n- TEXT_READABILITY_PRIORITY: 10  \n  `(1 = text may become decorative/small, 10 = text must stay clearly readable)`\n- CONTENT_FIRST_MOCKUP_BALANCE: 10  \n  `(1 = device frame dominates, 10 = device frame supports the screen but content remains the hero)`\n- MIN_TEXT_SIZE_DISCIPLINE: 10  \n  `(1 = small text acceptable, 10 = text must never feel too small at normal viewing size)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the app category.\n\nInterpretation:\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"premium iOS\", bias toward elegant restraint and native-feeling hierarchy.\n- If the user says \"Android\", bias toward stronger Material-like structure and navigation clarity.\n- If the user says \"creative social app\", increase visual variance and image creativity without sacrificing readability.\n- If the user says \"fintech\", \"health\", or \"productivity\", increase trust, calmness, and structural clarity.\n- Do not be lazy with screen count.\n- If more screens would make the flow better, generate more screens.\n- If more detail renders would make the UI clearer, generate more detail renders.\n- Default toward richer art direction than standard AI mobile output.\n- Use creative assets, texture, and imagery deliberately, not randomly.\n- Always keep the color palette clean, controlled, and intentional.\n- Avoid generic color choices.\n- Do not force every app into ultra-simple minimalism.\n- Keep text comfortably readable at normal viewing size.\n- Maintain strong consistency across all generated images in the same set.\n- Keep device framing neat, even, and professional.\n- Show the app inside a clean phone mockup by default, but keep the focus on the app content.\n\n---\n\n## 2. PLATFORM MODE RULE\n\nAlways decide the platform mode first.\n\nChoose one:\n1. iOS-native premium\n2. Android-native premium\n3. cross-platform premium neutral\n\n### iOS-native premium\nBias toward:\n- cleaner top areas\n- tab-bar clarity\n- safe-area awareness\n- elegant spacing\n- restrained chrome\n- calm hierarchy\n- native-feeling sheets and cards\n- polished but not overdecorated interfaces\n\n### Android-native premium\nBias toward:\n- stronger component rhythm\n- clearer app bar behavior\n- bottom navigation clarity\n- sheet logic\n- card/list structure\n- slightly firmer layout framing\n- more explicit state clarity where useful\n\n### Cross-platform premium neutral\nBias toward:\n- clean safe-area handling\n- universal mobile navigation patterns\n- clear hierarchy\n- less platform-specific ornament\n- premium but broadly buildable visual language\n\nDo not mix iOS and Android patterns carelessly.\nPick one dominant platform feel and stay coherent.\n\n---\n\n## 3. MANDATORY SCREEN-FIRST RULE\n\nFor mobile app requests, generate the screen image or screen set directly.\n\nDo not:\n- answer with only text\n- describe what the app could look like without generating it\n- collapse multiple screens into one vague idea board if the user actually needs a flow\n\nThe main deliverable is:\n- one or more mobile screen images\n- optionally extra detail views when needed\n- a clear flow set when multiple screens are requested\n\n---\n\n## 4. GENERATE ENOUGH SCREENS RULE\n\nGenerate enough screens to make the flow feel real.\n\nDo not be lazy with screen count.\n\nIf the user asks for:\n- 1 screen → generate 1 screen image\n- 2 screens → generate 2 screen images\n- 3 screens → generate 3 screen images\n- 5 screens → generate 5 screen images\n- 7 screens → generate 7 screen images\n- onboarding flow → generate multiple onboarding screens, not one\n- auth flow → generate separate sign in / sign up / recovery states when useful\n- app concept → generate a meaningful set, not one isolated hero mockup\n\nIt is better to generate:\n- multiple clean readable screens\nthan:\n- one compressed board with tiny unreadable text\n\nIf a detail is unclear:\n- generate an extra detail image\n- or regenerate that screen cleanly\n\nNever reduce screen count just for convenience if it weakens the app concept.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a screen or detail needs a dedicated view, do not just crop or zoom into a previously generated larger image.\n\nDo not:\n- crop a settings view out of a larger board\n- crop tiny onboarding copy out of a multi-screen collage\n- crop a small card from a broader screen to inspect it\n- rely on cutouts if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh standalone screen image\n- generate a fresh detail render\n- keep the same design language, colors, type mood, and component family\n- make the new image specifically optimized for readability\n\nFresh screen-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. APP DESIGN BIBLE RULE\n\nWhen generating multiple images for the same app, lock an internal design bible before continuing.\n\nThis design bible should remain consistent across the whole set:\n- platform mode\n- device frame style\n- device scale\n- palette logic\n- typography mood\n- type scale rhythm\n- spacing system\n- corner radius logic\n- icon style\n- illustration / imagery treatment\n- texture intensity\n- decorative asset language\n- navigation model\n- card and list behavior\n- button styling\n- shadow language\n\nDo not let screen 3, 4, or 5 drift into a different app.\n\nEvery new screen should feel like it belongs to the same product world.\n\n---\n\n## 7. MULTI-SCREEN CONSISTENCY RULE\n\nIf multiple screens are requested, consistency is mandatory.\n\nKeep consistent:\n- overall brand mood\n- type hierarchy\n- palette\n- safe-area handling\n- navigation behavior\n- component family\n- surface treatment\n- card treatment\n- background logic\n- image framing\n- decorative accents\n- device frame presentation\n\nVariation is allowed in:\n- composition\n- feature emphasis\n- image placement\n- screen purpose\n- visual tempo\n\nBut not in:\n- product identity\n- design system\n- mockup quality\n- core spacing logic\n\nThe flow should feel varied but unified.\n\n---\n\n## 8. LOGICAL FLOW RULE\n\nWhen multiple images are generated, they must form a believable app flow.\n\nDo not generate random unrelated screens.\n\nThe screen order should make sense.\n\nExamples:\n- onboarding → auth → home\n- home → browse → detail\n- profile → settings → edit profile\n- cart → checkout → confirmation\n- dashboard → activity → detail\n- welcome → permissions → personalized home\n\nAsk internally:\n- why does screen 2 come after screen 1?\n- what action or navigation leads to the next screen?\n- is this a believable user journey?\n- does the UI state carry forward logically?\n\nA good screen set should feel like a real product walkthrough, not a loose visual collection.\n\n---\n\n## 9. DEFAULT MOCKUP PRESENCE RULE\n\nBy default, present the mobile UI inside a clean phone mockup with a visible device border/frame.\n\nThis should usually be:\n- a clean iPhone-style mockup for iOS or neutral premium concepts\n- a clean Android-style mockup for Android-native concepts\n- a subtle premium generic phone mockup for cross-platform concepts\n\nDo not omit the device frame by default.\n\nOnly remove the visible device frame if:\n- the user explicitly asks for raw screen-only output\n- the concept clearly benefits from borderless presentation\n- the user asks for UI sheets or assets instead of full phone compositions\n\nDefault rule:\nphone mockup present  \ncontent still primary\n\n---\n\n## 10. DEVICE MOCKUP FRAME RULE\n\nWhen using an iPhone, Android, or generic phone mockup, the mockup must look clean and premium.\n\nRules:\n- use one coherent device style across the full set unless the user explicitly wants mixed devices\n- keep device scale consistent across all screens in the same series\n- keep the mockup centered or aligned with clear discipline\n- keep outer spacing around the device clean and balanced\n- keep top, bottom, left, and right canvas margins visually even\n- do not let the phone touch the canvas edges\n- do not use awkwardly cropped device frames\n- do not use inconsistent bezels or random frame sizes across screens\n- keep shadows soft and controlled\n- keep the mockup presentation calm and premium\n- the phone border/frame should be visible and clean\n- the mockup should support the screen, not overpower it\n- keep visual emphasis on the UI content inside the phone\n\nIf multiple device mockups appear in one composition:\n- keep the same scale\n- keep equal gutter spacing between devices\n- align them cleanly\n- avoid random overlap unless explicitly art-directed\n\nIf the concept works better without a visible device frame:\n- only then present the screen cleanly with equal outer margins and controlled padding\n\nThe presentation should feel:\n- neat\n- balanced\n- premium\n- intentional\n- content-first\n\n---\n\n## 11. ONBOARDING FLOW RULE\n\nOnboarding should not feel like repeated template slides.\n\nIf the user asks for onboarding:\n- generate multiple distinct onboarding screens\n- vary composition across screens\n- vary the balance of image, text, and CTA\n- keep the flow coherent\n- keep copy short\n- keep the first screen especially clean\n\nGood onboarding should feel:\n- clear\n- fast\n- helpful\n- visually memorable\n- not overexplained\n\nAvoid:\n- 3 identical screens with only icon and headline changes\n- too much copy\n- giant abstract blobs with no product meaning\n- fake motivational filler language\n- early rating/review prompts\n- cluttered first-run screens\n\n---\n\n## 12. FIRST SCREEN CLEANLINESS RULE\n\nThe first visible screen matters most.\n\nWhether it is:\n- onboarding\n- home\n- auth\n- intro\n- welcome\n- dashboard\n\nit must feel:\n- calm\n- premium\n- immediately readable\n- visually focused\n\nRules:\n- use one primary focal point\n- keep the top screen area controlled\n- keep the headline short\n- do not overload the first viewport\n- do not fill it with extra stats, chips, tags, or pills\n- do not bury the main CTA\n- make the first screen work on a normal phone size without feeling cramped\n- if imagery is used behind text, preserve clear readability with fades, masks, or soft scrims\n\nStrong preference:\n- 1 to 3 short lines for the main statement\n- concise supporting text\n- one clear next action\n\nAvoid:\n- giant wall of text\n- too many micro-labels\n- too many overlapping cards\n- fake enterprise complexity\n- \"website hero inside a phone frame\"\n\n---\n\n## 13. SAFE AREA AND SYSTEM REGION RULE\n\nRespect mobile screen realities.\n\nAlways design with awareness of:\n- safe areas\n- status bar region\n- top bar or title region\n- bottom navigation region\n- home indicator region\n- sheet docking zone\n- gesture space\n\nDo not:\n- cram important content into unsafe areas\n- ignore top and bottom system regions\n- make screens feel like edge-to-edge posters with no functional logic\n- place critical UI where it would be visually unsafe\n\nMobile images should feel like real app screens, not posters.\n\n---\n\n## 14. NAVIGATION RULE\n\nNavigation must feel intentional and believable.\n\nUse familiar mobile patterns when appropriate:\n- tab bar / bottom navigation for major app sections\n- stack navigation feel for drill-down flows\n- sheets for secondary tasks\n- segmented controls for local switching\n- app bars where useful\n- clear primary and secondary actions\n\nDo not:\n- overload bottom navigation\n- hide the main path through the app\n- make every action equally important\n- create unclear hierarchy between tabs, sheets, and actions\n\nThe screen set should imply a believable app flow.\n\n---\n\n## 15. CLEAN LAYOUT RULE\n\nDo not default to box-in-box-in-box mobile UI.\n\nAvoid:\n- giant nested card stacks\n- floating surfaces everywhere\n- 5 levels of framing\n- dashboard clutter for no reason\n- tiny widgets packed together\n- fake operating-system labels\n- decorative pills and micro-status elements\n\nPrefer:\n- cleaner surfaces\n- stronger whitespace\n- fewer but clearer containers\n- direct hierarchy\n- cleaner grouping\n- flatter structure where possible\n- one strong structural move rather than many small noisy ones\n\nA premium mobile screen should not feel trapped inside too many boxes.\n\n---\n\n## 16. CREATIVE IMAGE DIRECTION RULE\n\nThis skill should be more creative than generic app UI generators.\n\nActively use imagery and art direction when it helps the concept.\n\nCreative image usage may include:\n- photography-led onboarding\n- large editorial image blocks\n- image-backed headers\n- product or lifestyle imagery\n- scenic or atmospheric backgrounds\n- illustration-driven entry screens\n- media cards with layered treatment\n- bold visual covers on key screens\n- image strips, shelves, or carousels\n- background images partially revealed behind typography\n\nDo not make imagery feel like an afterthought.\nDo not use lazy filler thumbnails.\nUse real image logic as part of the layout and mood.\n\nWhen the app category supports it, prefer:\n- stronger hero imagery\n- more visual storytelling\n- richer art direction\n- more memorable image composition\n\n---\n\n## 17. BACKGROUND TEXTURE AND SURFACE RULE\n\nDo not default to perfectly sterile flat backgrounds.\n\nWhen appropriate, introduce subtle or medium-strength texture to create a richer visual atmosphere.\n\nAllowed background treatments:\n- soft film grain\n- subtle noise\n- paper-like texture\n- lightly speckled surfaces\n- brushed or frosted texture feel\n- tonal gradient fog\n- clouded ambient depth\n- tactile matte surfaces\n- faint grid or pattern texture\n- blurred photographic background layers\n\nUse texture to make the UI feel:\n- more premium\n- more tactile\n- less generic\n- more art-directed\n\nBut:\n- keep it controlled\n- keep the UI readable\n- do not let heavy texture overwhelm text\n- do not introduce noise just for the sake of noise\n\nGood rule:\ntexture should support the mood, not compete with the interface.\n\n---\n\n## 18. IMAGE-BEHIND-TEXT RULE\n\nWhen appropriate, use images behind or beneath text in a controlled, premium way.\n\nPreferred treatments:\n- image background under a title block with a fade to transparent\n- bottom-to-top gradient fade to support text legibility\n- side fade masks so text sits over the clean portion\n- soft blur overlays behind text\n- image partially visible behind copy, fading into the background color\n- large edge-to-edge visual with a scrim under headline and CTA\n- photo or illustration bleeding behind typography but gently masked\n\nThis is especially useful for:\n- onboarding\n- welcome screens\n- media apps\n- fashion / travel / lifestyle apps\n- premium commerce apps\n- social apps\n- editorial experiences\n\nRules:\n- text must stay readable\n- the fade / mask should feel elegant\n- the image should still be visually meaningful\n- the treatment should feel intentional, not like random opacity\n\nAvoid:\n- raw image under text with no readability support\n- muddy overlays\n- too many heavy gradients\n- noisy backgrounds that destroy hierarchy\n\n---\n\n## 19. CREATIVE ASSET RULE\n\nUse tasteful supporting creative assets when they improve the visual language.\n\nAllowed creative assets:\n- clean micro-illustrations\n- simple geometric SVG-style motifs\n- tiny line-art accents\n- subtle vector icons\n- dotted guides\n- arc shapes\n- orbital lines\n- tasteful starbursts\n- calm abstract marks\n- mini diagram-like elements\n- product-relevant iconography\n- clean sticker-like accent elements when suitable\n\nThese assets should feel:\n- clean\n- premium\n- restrained\n- integrated into the design system\n- supportive, not distracting\n\nDo not:\n- spam random stickers\n- clutter the interface with decorative icons\n- add meaningless SVG art\n- use childish doodles unless the brand clearly wants it\n\nA few clean visual accents are good.\nToo many become noise.\n\n---\n\n## 20. ICONOGRAPHY RULE\n\nDo not default to generic developer-style icon packs or bland Lucide-like icon vibes.\n\nAvoid:\n- generic line-icon defaults that make the app feel like a template\n- overused developer-tool icon language\n- icons that feel too plain, too open-source-default, or too undifferentiated\n- randomly mixing icon weights and styles\n\nPrefer:\n- a clean custom-feeling icon system\n- restrained, brand-appropriate iconography\n- consistent stroke or filled logic\n- icons with slightly more character when the concept allows it\n- product-specific icon decisions instead of default library-looking symbols\n\nIcons should feel:\n- clean\n- intentional\n- premium\n- integrated\n- not generic\n\n---\n\n## 21. MOBILE ANTI-AI-TELLS RULE\n\nStrictly avoid these unless explicitly requested.\n\n### Visual AI tells\n- purple-blue fintech gradients everywhere\n- random glass cards\n- ambient blobs with no purpose\n- fake neon premium look\n- generic dribbble-style floating widgets\n- oversized corner radii on everything\n- over-rendered glossy surfaces without hierarchy\n\n### Layout AI tells\n- fake chart dashboard spam\n- repeated stat cards with no product reason\n- a homepage that looks like 12 widgets fighting for attention\n- cloned screens in a flow\n- giant empty cards with weak content\n- phone-shaped websites instead of app screens\n\n### Copy AI tells\nAvoid filler phrases like:\n- elevate your life\n- unlock your potential\n- next-gen finance\n- seamless control\n- smarter than ever\n- transform your day\n\nAvoid fake brand slop:\n- Acme\n- NovaCore\n- Flowbit\n- Quantix\n- VeloPay\n\n### UI clutter tells\n- too many pills\n- too many badges\n- too many tiny labels\n- fake system markers\n- meaningless avatar rows\n- random chart inserts\n- decorative toggles with no product meaning\n\n---\n\n## 22. STYLE VARIATION ENGINE\n\nTo avoid repetitive mobile design output, choose a clear visual direction and commit to it.\n\n### Theme Paradigm\nChoose 1:\n1. pristine light\n2. deep dark\n3. soft wellness neutral\n4. premium monochrome\n5. rich accent-driven\n6. editorial luxe\n7. playful consumer color\n8. calm productivity minimal\n\n### Typography Character\nChoose 1:\n1. clean system-like sans\n2. refined grotesk\n3. expressive premium display + clean body\n4. soft humanist sans\n5. sharper product sans with disciplined hierarchy\n\n### Structure Bias\nChoose 1:\n1. list-led utility\n2. card-led modular\n3. dashboard-led overview\n4. media-led storytelling\n5. profile-led identity\n6. commerce-led browse and detail flow\n7. chat-led conversational flow\n8. wellness-led calm block rhythm\n\n### Image Art Direction Bias\nChoose 1:\n1. editorial photography\n2. cinematic lifestyle imagery\n3. soft illustration-led\n4. tactile abstract compositions\n5. premium product imagery\n6. mixed photo + vector art direction\n7. moody atmospheric backdrops\n8. collage-lite layered imagery\n\n### Texture / Surface Treatment\nChoose 1:\n1. ultra-subtle grain\n2. matte paper texture\n3. foggy gradient atmosphere\n4. soft noise wash\n5. blurred image haze\n6. clean flat with one textured hero area\n7. tactile monochrome surface\n8. low-opacity technical pattern\n\n### Palette Logic\nChoose 1:\n1. restrained monochrome + one accent\n2. warm neutral palette + sharp dark contrast\n3. cool mineral palette + clean highlight accent\n4. editorial cream / charcoal / muted accent\n5. rich dark base + refined warm accent\n6. wellness soft palette with controlled saturation\n7. bright consumer palette with disciplined balance\n8. desaturated premium palette with one bold hit\n\n### Signature Component Set\nChoose exactly 4:\n- large hero metric card\n- compact stat strip\n- modular collection grid\n- media carousel\n- layered profile header\n- premium segmented control\n- bottom action sheet\n- framed product card stack\n- progress ring block\n- message bubble system\n- settings group cells\n- photo-led card strip\n- sticky mini player\n- collection shelf\n- habit tracker block\n- checkout summary card\n- journal entry card\n- achievement tile row\n\n### Decorative Asset Set\nChoose exactly 2:\n- minimal line icon cluster\n- abstract orbit lines\n- dotted arc accents\n- starburst micro-motif\n- rounded sticker accent\n- tiny directional arrow system\n- fine-grid motif\n- soft waveform line\n- clean badge glyphs\n- mini geometric markers\n\n### Motion-Implied Language\nChoose exactly 2:\n- springy card lift energy\n- sheet rise energy\n- tab transition calmness\n- staggered list reveal energy\n- soft dashboard fade-up energy\n- parallax header drift energy\n- carousel glide energy\n\nThese are image-direction cues, not code instructions.\n\n---\n\n## 23. COLOR PALETTE RULE\n\nAlways use a clean, controlled color palette.\n\nColor should feel:\n- intentional\n- premium\n- coherent\n- non-generic\n- visually calm even when expressive\n\nRules:\n- use a strong palette with internal logic\n- keep color relationships clean\n- let one or two accents do real work\n- avoid muddy, accidental, or chaotic color combinations\n- avoid generic startup gradients unless they truly fit\n- avoid default purple-blue AI palettes unless specifically justified\n- avoid random bright rainbow color use\n- avoid throwing many unrelated saturated colors together\n- keep saturation under control unless the brand clearly benefits from stronger intensity\n\nA palette can be:\n- bold\n- soft\n- dark\n- editorial\n- playful\n- luxurious\n- atmospheric\n\nBut it must still feel clean.\n\nGood color direction should make the app feel:\n- distinctive\n- art-directed\n- brand-specific\n- expensive or thoughtfully designed\n\nNot:\n- template-like\n- random\n- overcooked\n- generic\n\n---\n\n## 24. NON-GENERICITY RULE\n\nThe app should not feel like a default template.\n\nDo not settle for:\n- standard generic fintech\n- standard wellness pastel app\n- standard social feed clone\n- standard productivity dashboard clone\n- standard ecommerce browse/detail clone without personality\n\nPush the concept toward:\n- stronger identity\n- stronger mood\n- stronger art direction\n- cleaner but more original composition\n- better image treatment\n- more distinctive asset language\n- more specific palette logic\n- more memorable screen-to-screen rhythm\n\nThe result should feel like:\n- a real designed product\nnot:\n- a reusable starter template with better lighting\n\n---\n\n## 25. NOT ALWAYS SIMPLE RULE\n\nDo not force every app into hyper-minimal simplicity.\n\nSimplicity is not the goal by itself.\nCleanliness is the goal.\n\nThis means:\n- a screen may be rich, layered, and expressive if it remains readable\n- a flow may have stronger visuals, texture, and more atmosphere if it stays structured\n- an app may use bold imagery, richer backgrounds, and more art direction without becoming messy\n\nAllowed:\n- sophisticated layering\n- controlled visual depth\n- richer compositions\n- stronger image presence\n- decorative accents with purpose\n- multiple visual zones within a screen\n- more character when the brand needs it\n\nNot allowed:\n- noisy complexity\n- clutter disguised as creativity\n- random decorative overload\n- muddy hierarchy\n- unreadable interfaces\n\nThe rule is:\nnot always simple  \nalways clean\n\n---\n\n## 26. IMAGE SYSTEM RULE\n\nImages are not mandatory on every app screen, but when they appear they must feel important.\n\nUse images when the app category benefits from them:\n- social\n- ecommerce\n- travel\n- wellness\n- editorial\n- food\n- fashion\n- content apps\n- creator apps\n- marketplace apps\n\nTypes of image usage:\n- onboarding hero visuals\n- profile imagery\n- product imagery\n- collection thumbnails\n- editorial crops\n- photo-led cards\n- cover blocks\n- media shelves\n- gallery strips\n- background images under text with fade treatments\n- softly masked image headers\n- atmospheric scene layers behind core content\n\nRules:\n- image usage should match the app category\n- repeated image modules should use controlled proportions\n- images should feel curated and consistent\n- the app should not rely on one single image if the flow clearly needs more\n- different screens can use different images, but they must still belong to one product world\n- if imagery is important, push it hard enough to feel intentional\n\nAvoid:\n- random filler thumbnails\n- one pretty screen and then no imagery at all\n- inconsistent image proportions\n- collage chaos unless explicitly requested\n\n---\n\n## 27. FIXED MOBILE MEDIA FRAME RULE\n\nWhen images are used, place them inside clear, controlled frames.\n\nPrefer:\n- stable aspect ratios\n- consistent crop behavior\n- repeatable media modules\n- clear radius logic\n- clean framing\n\nExamples:\n- onboarding hero in a bounded visual block\n- product cards with consistent proportions\n- editorial shelves with repeatable crops\n- profile/media headers with stable framing\n- image rows with controlled ratios\n\nAvoid:\n- random image sizes\n- messy scaling\n- inconsistent crop systems\n- uncontrolled visual noise\n\nThe goal is strong media inside a believable mobile system.\n\n---\n\n## 28. TEXT RULE\n\nCopy should be:\n- short\n- clean\n- product-appropriate\n- readable\n- useful for the screen\n\nUse:\n- concise headlines\n- believable button labels\n- minimal supporting copy\n- screen titles that feel real\n\nAvoid:\n- lorem ipsum overload\n- long paragraphs\n- fake inspirational filler\n- overloaded onboarding explanations\n- overly technical filler labels\n\nFor first screens and onboarding especially:\n- keep copy tight\n- reduce words rather than forcing more lines\n\n---\n\n## 29. TEXT SIZE AND READABILITY RULE\n\nText must never feel too small.\n\nStrong rule:\n- if the text feels small, the design is not finished yet\n\nPrioritize:\n- comfortably readable titles\n- clearly readable body copy\n- readable labels and buttons\n- enough contrast against the background\n- enough spacing around text blocks\n- strong hierarchy between headline, body, and small supporting text\n\nDo not:\n- shrink text to fit too much UI\n- use tiny decorative labels\n- let body copy become hard to read\n- sacrifice legibility for style\n- place text on busy imagery without protection\n- compress too much information into one screen until the type becomes small\n\nIf a design choice makes text too small:\n- simplify the layout\n- reduce content\n- increase spacing\n- enlarge the text\n- split content into another screen if needed\n- regenerate the screen if necessary\n\nReadable beats clever.\nReadable beats dense.\nReadable beats decorative small type.\n\n---\n\n## 30. TYPOGRAPHY RULE\n\nTypography is a primary design tool.\n\nAlways ensure:\n- strong title/body/label contrast\n- readable mobile scale\n- clear section headers\n- short CTA copy\n- believable type rhythm across screens\n- good line count control\n\nDo not:\n- make everything the same weight\n- use too many font moods\n- create awkward line wrapping\n- use oversized headline drama on every screen\n- let body text become tiny or decorative\n\nFor premium apps:\n- typography should feel deliberate, not loud by default\n\n---\n\n## 31. SPACING AND DENSITY RULE\n\nDo not make the app too dense.\n\nThe UI should breathe.\n\nRules:\n- use generous spacing between major screen blocks\n- keep internal padding clean\n- avoid one screen feeling cramped while the next is empty\n- smaller modules still need enough surrounding space\n- let whitespace create calmness and focus\n- separate dense screens from calmer screens in a flow\n- allow textured or image-led areas to breathe instead of stacking more UI on top\n\nA premium mobile app should feel:\n- open\n- composed\n- balanced\n- touch-friendly\n- calm\n\nNot:\n- cramped\n- jittery\n- noisy\n- overfilled\n- visually exhausting\n\n---\n\n## 32. SCREEN-TO-SCREEN VARIATION RULE\n\nA multi-screen app flow should not feel like one screen duplicated several times.\n\nAcross the flow, vary:\n- top-area composition\n- image-to-text balance\n- content density\n- card/list emphasis\n- CTA placement\n- visual tempo\n- module proportions\n- background treatment\n- texture intensity\n- use of creative assets\n\nBut:\n- keep the app coherent\n- preserve the same product language\n- do not drift into a different design system\n- do not randomize for the sake of randomizing\n\nThe flow should feel varied but unified.\n\n---\n\n## 33. CATEGORY-SPECIFIC BIAS\n\n### Fintech\nPrefer:\n- trust\n- calm spacing\n- clear numbers\n- restrained accents\n- less fake chart spam\n- strong transaction clarity\n- subtle texture, not loud effects\n\n### Health / Fitness\nPrefer:\n- calm structure\n- strong metric hierarchy\n- motivating but not noisy screens\n- readable progress modules\n- airy spacing\n- optimistic imagery or wellness textures where useful\n\n### Productivity\nPrefer:\n- clarity\n- list and card discipline\n- navigation simplicity\n- calm density\n- strong task hierarchy\n- minimal but premium supporting visuals\n\n### Social\nPrefer:\n- profile and feed rhythm\n- media moments where useful\n- clearer hierarchy between creation and browsing\n- stronger flow variety\n- more expressive image direction\n\n### Commerce\nPrefer:\n- browse / detail / cart clarity\n- strong product imagery\n- stable product card proportions\n- clean checkout hierarchy\n- tasteful editorial image treatments\n\n### Wellness / Lifestyle\nPrefer:\n- softer materials\n- calm typography\n- less visual noise\n- breathing room\n- elegant imagery\n- tactile backgrounds and soft fades\n\n---\n\n## 34. REGENERATION RULE\n\nIf a generated screen is not strong enough, regenerate it.\n\nRegenerate when:\n- text is too small\n- spacing is unclear\n- navigation feels fake\n- the screen looks too much like a website\n- the UI is too crowded\n- the onboarding screens are too repetitive\n- image framing is inconsistent\n- cards are too nested\n- the first screen is too noisy\n- the flow lacks variation\n- backgrounds feel too flat or generic\n- imagery is weak, lazy, or missing\n- the fade/mask treatment behind text is poor\n- decorative assets feel absent or overly bland\n- creative elements are too timid to matter\n- the color palette feels generic or muddy\n- the design feels too simple in a boring way\n- the screen set loses consistency\n- the device mockup framing feels uneven or sloppy\n\nDo not settle for the first mediocre render.\nRefine until the screen set feels clean, believable, art-directed, and consistent.\n\n---\n\n## 35. QUALITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Does this feel like a real mobile app, not a website in a phone?\n2. Are safe areas respected visually?\n3. Is the first screen clean enough?\n4. Is the copy short enough?\n5. Is the type readable?\n6. Are there enough screens for the requested flow?\n7. Were too few screens generated out of laziness?\n8. If a detail was unclear, was a new detail render created?\n9. Is the app free of obvious mobile AI tells?\n10. Is the layout free of box-in-box clutter?\n11. Are image moments purposeful and consistent?\n12. Does the flow feel coherent?\n13. Do screens vary enough without breaking the design system?\n14. Does the product feel premium and app-native?\n15. Is there enough creative imagery, texture, or atmosphere for the concept?\n16. If images sit behind text, is readability protected with clean fades or masks?\n17. Are decorative assets clean and restrained?\n18. Does the visual system feel more art-directed than generic AI mobile output?\n19. Is the color palette clean and controlled?\n20. Does the design feel non-generic?\n21. Is the design clean without being boringly oversimplified?\n22. Do all screens clearly belong to the same app?\n23. Is the flow logical from screen to screen?\n24. Is the phone mockup framing clean and evenly padded on all sides?\n25. Is the text comfortably readable and not too small?\n26. Does the iconography feel intentional rather than generic library-default?\n27. Is the phone border/mockup present and clean without stealing attention from the screen content?\n\nIf not, refine before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a mobile app image concept:\n1. infer app category\n2. infer platform mode\n3. infer number of screens\n4. choose a strong visual direction\n5. choose an image art direction bias\n6. choose a texture / surface treatment\n7. choose tasteful decorative assets\n8. choose a clean palette logic\n9. lock an internal design bible for consistency\n10. generate the required screen images\n11. generate more screens if needed for a believable flow\n12. generate extra detail renders if needed\n13. keep the first screen especially clean\n14. avoid website-like layouts\n15. avoid nested-card clutter\n16. enforce strong and creative image usage where appropriate\n17. use texture, fades, masks, and background imagery when they improve the result\n18. keep spacing generous and readable\n19. keep text comfortably legible\n20. avoid generic palettes and generic composition\n21. avoid generic icon-library-looking iconography\n22. present screens inside a clean phone mockup by default\n23. keep the phone border/mockup subtle and premium\n24. keep focus on the app content, not on showing off the device\n25. maintain strong consistency across the whole image set\n26. keep device mockups clean, balanced, and evenly spaced\n27. refine weak screens instead of accepting them\n28. output the final screen set\n\nDo not switch into coding mode.\nDo not write implementation instructions.\nDo not collapse a requested flow into one lazy collage.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n\"make a premium fitness app\"\n\nInterpretation:\n- choose iOS-native or cross-platform premium\n- generate multiple screens, not just one\n- include a clean first screen\n- use calm spacing and strong metric hierarchy\n- avoid fake chart spam\n- use tasteful texture or soft imagery if it helps\n- keep the flow believable\n- keep the palette clean and controlled\n- keep all screens and mockups visually consistent\n- keep text readable and not tiny\n- show the screens in a subtle, clean phone mockup\n\n### Example 2\nUser:\n\"design a 5-screen ecommerce app\"\n\nInterpretation:\n- generate 5 clean screen images\n- include browse, detail, cart or checkout logic\n- use strong product imagery\n- use fixed media frames\n- use tasteful editorial image treatments or background fades where useful\n- keep hierarchy clean and product-first\n- avoid generic commerce templates\n- keep device framing and spacing consistent across all 5 images\n- avoid generic default icon language\n- use a clean visible phone frame without letting it dominate\n\n### Example 3\nUser:\n\"make an onboarding flow for a social app\"\n\nInterpretation:\n- generate multiple onboarding screens\n- vary layout across screens\n- keep copy short\n- make the first screen especially clean\n- avoid repetitive slide-template design\n- push imagery, texture, and background fade treatments more creatively\n- keep the palette clean but distinctive\n- keep the screen progression logical and consistent\n- keep typography readable and properly scaled\n- present the flow in consistent phone mockups with balanced outer margins\n\n---\n\n## 38. FINAL GOAL\n\nGenerate mobile app screen images that feel:\n- premium\n- app-native\n- clear\n- clean\n- structured\n- readable\n- memorable\n- anti-generic\n- believable\n- creatively art-directed\n\nThis skill should create strong mobile app image concepts and flow images only.\n\nIt should not write code.\nIt should not behave like a website skill.\nIt should not produce lazy one-board output when multiple screens are clearly needed.\n\nIt should actively allow:\n- stronger imagery\n- richer background textures\n- subtle noise or tactile surfaces\n- image-backed text areas with elegant fade-to-transparent treatment\n- clean decorative SVG-like accents\n- more creative assets when they help the product feel distinct\n- clean but expressive color palettes\n- more visual character without losing clarity\n- richer layouts when appropriate, not just forced simplicity\n- strong consistency across all generated images\n- logical screen progression\n- clean iPhone or similar phone mockups with visible borders/frames\n- equal outer spacing and balanced framing around the device\n- a content-first presentation where the mockup supports the UI instead of overpowering it\n\nIt should actively avoid:\n- random bright colors\n- muddy palettes\n- tiny text\n- generic Lucide-like icon defaults\n- template-looking app screens\n- inconsistent screen sets\n- sloppy or missing phone mockups\n- oversized device framing that distracts from the design\n\nThe final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.\n",".agents/skills/imagegen-frontend-web/SKILL.md":"---\nname: imagegen-frontend-web\ndescription: Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate.\n---\n\n# HARD OUTPUT RULE — READ FIRST\n\n**Generate one separate horizontal image PER section. Always. No exceptions.**\n\n- 1 section requested -> 1 image\n- 4 sections requested -> 4 images\n- 8 sections requested -> 8 images\n- 12 sections requested -> 12 images\n- \"landing page\" with no count -> default to 6 sections -> 6 images\n- \"full website template\" -> default to 8 sections -> 8 images\n\nEach image is one section, generated as its own image call. Never combine multiple sections into one frame. Never return a single tall image that contains the whole page.\n\nIf you can only render one image at a time, output them sequentially in the same response, one after the other, until every section has its own image. Announce each one (\"Section 1 of 8: Hero\", \"Section 2 of 8: Trust bar\", etc.).\n\nThis rule overrides any model default that wants to collapse output into a single image.\n\n---\n\n# HERO COMPOSITION BIAS — READ FIRST\n\nThe default **left-text / right-image hero is the most overused AI pattern**. It is allowed, but it should not be your first instinct.\n\nBefore reaching for it, consider these alternatives and pick whichever fits the brand best:\n- centered over background image\n- bottom-left over image\n- bottom-right over image\n- top-left lead\n- stacked center\n- image-as-canvas\n- off-grid editorial\n- mini minimalist\n- right-text / left-image (inverted classic)\n\nUse left-text / right-image only when it is genuinely the strongest choice — not by default.\n\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL IMAGE ART DIRECTION\nYou are an elite frontend image art director.\n\nYour job is not to generate generic AI art.\nYour job is to generate highly creative, premium, frontend design reference images that feel like real high-end website concepts.\n\nStandard image generation tends to collapse into repetitive defaults:\n- centered dark hero\n- purple/blue AI glow\n- floating meaningless blobs\n- generic dashboard card spam\n- weak typography hierarchy\n- cloned sections\n- \"luxury\" that is just beige serif text\n- \"creative\" that is actually messy and unreadable\n- text-heavy layouts with not enough imagery\n- overly dense sections with no breathing room\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- art-directed\n- premium\n- visually memorable\n- structured\n- readable\n- implementation-friendly\n- clearly usable as a frontend reference\n\nDo not generate random mood art unless explicitly asked.\nDefault to website design comps.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8\n  `(1 = rigid / symmetrical, 10 = artsy / asymmetric)`\n- VISUAL_DENSITY: 4\n  `(1 = airy / gallery-like, 10 = packed / intense)`\n- ART_DIRECTION: 8\n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9\n  `(1 = loose moodboard, 10 = very codeable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9\n  `(1 = mostly typographic, 10 = strongly image-led)`\n- SPACING_GENEROSITY: 8\n  `(1 = compact / tight, 10 = very spacious / breathable)`\n- LAYOUT_VARIATION: 8\n  `(1 = same anchor repeats, 10 = bold composition variety across sections)`\n- CONVERSION_DISCIPLINE: 8\n  `(1 = pure art moodboard, 10 = clear funnel + premium design balance)`\n\nAI Instruction:\nUse these as global defaults unless the user clearly asks for something else.\nDo not ask the user to edit this file.\nAdapt these values dynamically from the prompt.\n\nInterpretation:\n- **Adaptation priority**: the user's brief always overrides defaults. Read the prompt carefully, then adjust dials, hero scale, background mode, gradient use, and composition variety to match — never force a recipe that contradicts the brief.\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"crazy creative\", increase variance and art direction.\n- If the user says \"premium SaaS\", keep clarity high and art direction controlled.\n- If the user says \"editorial\", allow stronger type and more asymmetry.\n- Bias toward stronger visual concepts, not safe layouts — but never against the brief.\n- Use imagery as a core design material — including as **full-bleed backgrounds**, not only as inline assets, **when the brief allows it**.\n- Vary composition: do not default to \"text left, image right\". Move text to bottom-left, center, top-right, etc. across sections.\n- Keep sections breathable. Do not over-pack the page.\n- Prefer slightly more whitespace between sections than default.\n- Stay conversion-aware: every section has a job (hook / proof / educate / convert).\n\n### Brief-to-direction mapping\nRead the brief. Then bias the picks like this:\n\nIf the user says **\"minimalist\" / \"clean\" / \"typography-only\" / \"swiss\" / \"ultra simple\"**:\n- Hero Scale: Mini Minimalist\n- Background Mode: solid surfaces, subtle texture, optional ONE color-blocked diptych\n- Gradients: skip or use only the softest tonal gradient\n- Composition: stacked center, generous negative space\n- Skip the \"must include full-bleed\" rule\n\nIf the user says **\"editorial\" / \"magazine\" / \"art-directed\" / \"fashion\"**:\n- Hero Scale: Mid Editorial or Giant Statement\n- Background Mode: editorial side-image, duotone treated image, atmospheric photo grade\n- Gradients: subtle tonal grades only\n- Composition: off-grid editorial offset, asymmetric pulls\n- Strong typography contrast\n\nIf the user says **\"cinematic\" / \"atmospheric\" / \"premium\" / \"luxury\" / \"bold\"**:\n- Hero Scale: Giant Statement\n- Background Mode: full-bleed image with tonal overlay, soft radial vignette + product, micro-noise gradient\n- Gradients: cinematic palette-matched welcomed\n- Composition: bottom-left over background image, centered low, image-as-canvas\n\nIf the user says **\"SaaS\" / \"product\" / \"dashboard\" / \"fintech\" / \"infra\"**:\n- Hero Scale: Mid Editorial\n- Background Mode: solid + inline asset, flat block + detail crop, occasional editorial side-image\n- Gradients: very subtle, palette-matched only\n- Composition: clear product framing, trust-driven anchors\n- Slightly higher implementation clarity\n\nIf the user says **\"agency\" / \"creative studio\" / \"portfolio\"**:\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive)\n- Background Mode: vary boldly (full-bleed image, color-blocked diptych, duotone)\n- Gradients: editorial color washes acceptable\n- Composition: off-grid, poster-like\n\nIf the user says **\"e-commerce\" / \"shop\" / \"store\" / \"product page\"**:\n- Hero Scale: Mid Editorial with strong product focus\n- Background Mode: full-bleed product photo, soft radial vignette + crop, flat block + detail\n- Gradients: subtle, never competing with product\n- Composition: product-led; CTAs unmistakable\n\nIf the brief is silent on style:\n- Use defaults from §1 + §2 with confident background variety\n- Pick one Hero Scale decisively, do not split the difference\n\nNever force backgrounds, gradients, or full-bleed treatments where the brief asks for restraint. Never strip them out where the brief asks for atmosphere.\n\n---\n\n## 2. THE COMBINATORIAL VARIATION ENGINE\nTo avoid repetitive AI-looking output, internally choose one option from each category based on the prompt and commit to it consistently.\n\nDo not mash everything together into chaos.\nPick a strong combination and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n   Off-white / cream / paper tones, sharp dark text, editorial confidence.\n2. Deep Dark Mode\n   Charcoal / graphite / zinc, elegant glow only when justified.\n3. Bold Studio Solid\n   Strong controlled color fields like oxblood, royal blue, forest, vermilion, or emerald with crisp contrasting UI.\n4. Quiet Premium Neutral\n   Bone, sand, taupe, stone, smoke, muted contrast, restrained luxury.\n\n### Background Character\nChoose 1:\n1. Subtle technical grid / dotted field\n2. Pure solid field with soft ambient gradient depth\n3. Full-bleed cinematic imagery with proper contrast control\n4. Quiet textured paper / material / tactile surface feel\n\n### Typography Character\nChoose 1:\n1. Satoshi-like clean grotesk\n2. Neue-Montreal-like refined grotesk\n3. Cabinet / Clash-like expressive display\n4. Monument-like compressed statement typography\n5. Elegant editorial serif + sans pairing\n6. Swiss rational sans with very strong hierarchy\n\nNever drift into boring default web typography energy.\n\n### Hero Architecture\nChoose 1:\n1. Cinematic Centered Minimalist\n2. Asymmetric Split Hero\n3. Floating Polaroid Scatter\n4. Inline Typography Behemoth\n5. Editorial Offset Composition\n6. Massive Image-First Hero with restrained text\n\n### Section System\nChoose 1 dominant structure:\n1. Strict modular bento rhythm\n2. Alternating editorial blocks\n3. Poster-like stacked storytelling\n4. Gallery-led visual cadence\n5. Swiss grid discipline\n6. Asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- Diagonal Staggered Square Masonry\n- 3D Cascading Card Deck\n- Hover-Accordion Slice Layout\n- Pristine Gapless Bento Grid\n- Infinite Brand Marquee Strip\n- Turning Polaroid Arc\n- Vertical Rhythm Lines\n- Off-Grid Editorial Layout\n- Product UI Panel Stack\n- Split Testimonial Quote Wall\n- Oversized Metrics Strip\n- Layered Image Crop Frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\n### Composition Anchor (per-section)\nThe **left-text / right-image** layout is allowed, but it is the most overused AI pattern — do not use it as the default. Reach for it only when it is the genuinely best fit.\n\nEach section picks 1 anchor; across the site at least 3 different anchors must appear; vary the hero so the page does not open on the AI default.\n- Centered statement\n- Top-left lead, support bottom-right\n- Bottom-left text over background image\n- Bottom-right CTA cluster\n- Left-third caption + right-two-thirds visual (classic — use sparingly, never twice in a row)\n- Right-third caption + left-two-thirds visual (inverted classic)\n- Centered low (text in lower 40% over hero image)\n- Off-grid editorial offset (asymmetric pull)\n- Stacked center (label / headline / sub / CTA all centered, ultra minimalist)\n- Image-as-canvas with text overlaid in a clean safe area\n\n### Background Mode (per-section)\nPick 1 per section; vary across the page so it is never all the same mode. Be **confident** with backgrounds — they are a primary tool, not a risk.\n- Solid surface with inline asset\n- Subtle texture / paper / grid as background\n- Full-bleed image background with tonal overlay (text remains highly readable)\n- Editorial side-image (50/50, 60/40, 40/60 — invertible)\n- Image as the entire visual + text overlaid in a clean safe area\n- Flat color block + small product / detail crop as accent\n- Cinematic tonal gradient (palette-matched, low chroma, professional)\n- Atmospheric photo with strong color grade (single-tone graded for brand mood)\n- Duotone treated image (two-color photo treatment, palette-locked)\n- Soft radial vignette + product crop (luxury / editorial feel)\n- Micro-noise gradient over solid (premium tactile depth, not flashy)\n- Color-blocked diptych (two flat fields meeting, modernist)\n\n### CTA Variation\nPick the CTA style that fits each section, not a default pill every time:\n- Classic primary pill\n- Outline / ghost\n- Underlined inline link with arrow\n- Banner-style full-width CTA\n- Oversized headline + tiny CTA hint\n- CTA as caption under a strong visual\n\nAcross the site, vary CTA style at least once. The page's primary action stays unmistakable.\n\n### Hero Scale (per-page)\nPick 1 — must match brand mood:\n- Giant Statement Hero (massive type, large image, dominant first viewport)\n- Mid Editorial Hero (balanced type/image, cinematic but not screen-filling)\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, almost no image, lots of negative space)\n\nMini does not mean weak — it means confident restraint.\n\n### Narrative / Concept Spine\nPick 1 and let it thread through visuals and short copy across the page.\n- Artifact / collectible — proof, specimen, treasured object framing\n- Journey / pilgrimage — directional flow, waypoint sections, roadmap feeling\n- Tool / precision instrument — machined detail, calibrated UI, tactile controls\n- Living system / garden — organic growth metaphor, branching layout, nurtured tone\n- Stage / spotlight — theatrical contrast, performer + audience framing\n- Archive / dossier — indexed rows, captions, understated authority\n\n### Second-Read Moment\nPick exactly 1 unobvious but legible motif and place it deliberately, once across the page:\n- asymmetric bleed that still respects hierarchy\n- one oversized punctuation or numeral serving structure\n- a single unexpected material switch (paper vs gloss vs metal accent)\n- a narrow vertical side-rail editorial note style\n- a macro crop that carries brand color naturally\nAvoid gimmick-for-gimmick: the moment must aid scan order or brand recall.\n\nImportant:\nThese are not coding instructions.\nThey are visual-direction cues the generated design should imply.\n\n---\n\n## 3. FRONTEND REFERENCE RULE\nEvery generated image must clearly communicate:\n- layout\n- section hierarchy\n- spacing\n- typography scale\n- visual rhythm\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image and understand how to build it.\n\nDo not produce vague abstract artwork when the request is for frontend.\n\n---\n\n## 4. HERO MINIMALISM RULES\nThe hero must feel cinematic, clear, and intentional.\n\n### Hero Composition Bias\nThe **left-text / right-image hero is the most overused AI hero pattern**. It is allowed, but it should not be your default starting point.\n\nPrefer one of these instead, unless left-text / right-image is genuinely the strongest fit:\n- Centered statement over full-bleed image (text in lower 40%)\n- Bottom-left text over background image\n- Bottom-right text over background image\n- Top-left lead, support bottom-right\n- Stacked center (label / headline / sub / CTA all centered)\n- Image-as-canvas with text overlaid in a clean safe area\n- Right-text / left-image (inverted classic)\n- Off-grid editorial offset\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, mostly negative space)\n\n### Pre-output check\nBefore rendering the hero image, ask yourself: \"Am I drafting the default text-left / image-right layout out of habit?\" If yes, prefer a different anchor from the list above unless the brief or brand truly requires the classic.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- headline should usually read like 5-10 strong words, not a paragraph\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n\n### Headline Rule\nThe H1 should visually read like a premium statement.\nDo not let it feel long, weak, or overly wrapped.\n\n### Typography Execution\nPrefer:\n- medium / normal / light elegance\n- tight tracking\n- controlled line count\n- strong scale contrast\n\nAvoid:\n- random extra-bold shouting everywhere\n- gradient text as a lazy premium effect\n- 6-line startup headings\n- text treatment that looks generated\n\n### Graphic Restraint\nDo not default to:\n- giant meaningless outline numbers\n- cheap SVG-looking filler graphics\n- generic AI blobs\n- random orb clutter\n\nUse:\n- typography\n- image crops\n- real layout tension\n- premium materials\n- strong framing\ninstead.\n\n---\n\n## 5. IMAGE COUNT & PAGE SLICING\n\n### THIS IS THE PRIMARY OUTPUT RULE\nGenerate **one separate horizontal image PER section**. Always.\n\n- never combine multiple sections in a single image\n- never return a single tall slice that contains the whole page\n- never return one \"best\" image and skip the rest\n- never replace several sections with one collage\n\nIf the request is ambiguous about section count, **default high**:\n- \"hero\" -> 1 image\n- \"landing page\" / \"site template\" -> default to 6 sections -> 6 images\n- \"full website\" -> default to 8 sections -> 8 images\n- \"marketing site\" -> default to 8 sections -> 8 images\n- \"product page\" -> default to 6 sections -> 6 images\n- \"portfolio\" -> default to 6 sections -> 6 images\n\nIf the model can only render one image per call, generate them **sequentially in the same response**, one after the other, labeled \"Section X of N: <name>\" until the full set is delivered.\n\n### Format\n- Always horizontal (16:9, 16:10, or 21:9 depending on density)\n- Each image renders one focused section in high fidelity\n- Hero usually 16:9 or 21:9; narrower content sections may be 16:10\n\n### Counting rule\n- 1 section -> 1 horizontal image\n- 4 sections -> 4 horizontal images\n- 8 sections -> 8 horizontal images\n- 12 sections -> 12 horizontal images\n\nDo not collapse multiple sections into one tall slice. Section size and density may still vary, but the canvas stays horizontal and **one section per frame**.\n\n### Section size variety\nAcross the site, mix section ambition deliberately:\n- some sections are large, content-rich, art-directed\n- some sections are mini, ultra minimalist, mostly negative space\n- some sections are medium editorial blocks\n\nThis rhythm creates a premium scrollscape, not uniform slabs.\n\n### Continuity Rule\nAcross all per-section images, enforce one brand world:\n- same palette and accent logic\n- same typography family and scale\n- same CTA family (style variations are fine, identity is not)\n- same border radius language\n- same image treatment (color grade, materials, framing)\n- same tonal voice in any short copy\n\nA viewer scrolling through all frames must read them as one site.\n\n---\n\n## 6. CREATIVITY ESCALATION RULE\nThe design must show real creative ambition.\n\nDo not settle for the first obvious layout solution.\nPush the work beyond generic SaaS patterns.\n\nActively increase at least 3 of these:\n- stronger composition\n- more distinctive typography\n- more confident scale contrast\n- more memorable hero concept\n- more interesting image treatment\n- more expressive section rhythm\n- more original framing / cropping\n- more art-directed visual tension\n- more surprising but clear layout structure\n\nCreativity must feel intentional, not chaotic.\n\nDo:\n- make bold but controlled design decisions\n- use asymmetry when it improves the page\n- create visual moments that feel premium and memorable\n- make the page feel designed, not auto-generated\n\nDo not:\n- default to safe template layouts\n- repeat the same block structure too often\n- confuse creativity with clutter\n- make the page overly dense\n\n---\n\n## 7. IMAGE-FIRST ART DIRECTION\nThis skill must actively use images.\n\nImages are not optional decoration.\nImages are a core part of the frontend design language.\n\nStrongly prefer:\n- art-directed photography\n- product imagery\n- editorial imagery\n- image crops\n- framed image panels\n- layered image compositions\n- image-led hero sections\n- image-supported storytelling blocks\n\nUse images to:\n- create visual hierarchy\n- break up text-heavy layouts\n- build mood and brand character\n- support section transitions\n- make the design easier to interpret and implement\n\nImportant:\n- the design should not become text-only or card-only unless the user explicitly wants that\n- if a page has multiple sections, several sections should meaningfully include imagery\n- if a hero exists, it should usually contain a strong visual image, product visual, or art-directed media element\n- imagery should feel premium and intentional, not like stock filler\n\nAvoid:\n- tiny useless thumbnails\n- random decorative images with no structural role\n- one single image and then a completely text-heavy rest of page\n- overusing fake UI panels instead of real visual variety\n\n---\n\n## 8. ANTI-AI-SLOP RULES\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- perfect but lifeless symmetry everywhere\n- fake complexity without hierarchy\n- empty decorative space with no purpose\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating spheres / blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods in one page\n- awkward line breaks\n- lazy all-caps everywhere\n- gradient headline as shortcut for \"premium\"\n\n### Content slop\nBan generic copy vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- powerful solution\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n- obvious nonsense wordmarks\n\nUse short, believable, design-friendly copy.\n\n### Density slop\n- no over-packed sections\n- no card overload in every block\n- no tiny spacing between major sections\n- no trying to fill every empty area\n- no visually exhausting wall-of-content layouts\n\n### Carousel / marquee slop (layout)\n- infinity logo strips repeating the same 6 blobs\n- “trusted by” ticker that is unreadable mosquito logos\n- auto-play-style hero dots with no semantic purpose\n\n### Data / KPI slop\n- three identical stat columns (99% satisfaction, $10 saved, ∞ scale) unless user asked for KPIs\n- fake dashboards with pointless charts shading the real layout\n\n---\n\n## 9. TYPOGRAPHY-FIRST DISCIPLINE\nTypography is not filler.\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- supporting text that is readable and brief\n- labels, captions, and section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 10. SECTION RHYTHM RULE\nA high-end site does not feel like repeated boxes.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nDo not let every section feel generated from the same template.\n\nImportant:\n- rhythm variation should not break overall cleanliness\n- keep the page visually balanced from top to bottom\n- section heights may vary, but the spacing between sections should feel controlled and fairly even\n- avoid abrupt jumps between very small and very large sections without enough breathing room\n- the full page should feel curated, smooth, and consistent\n\n---\n\n## 11. COMPONENT EXECUTION GUIDELINES\n\n### Diagonal Staggered Square Masonry\nUse square image or content blocks with strong staggered vertical rhythm.\nShould feel curated and graphic, not messy.\n\n### 3D Cascading Card Deck\nCards layered as a physical stack with depth logic.\nShould feel premium and tactile, not gimmicky.\n\n### Hover-Accordion Slice Layout\nA row of compressed visual slices that feel expandable.\nIn static images, imply interaction clearly through proportions and emphasis.\n\n### Pristine Gapless Bento Grid\nMathematically clean grid.\nNo accidental gaps.\nMix large visual blocks with smaller dense information panels.\n\n### Turning Polaroid Arc\nClustered, rotated imagery with elegant composition.\nShould feel styled and intentional, not scrapbook-random.\n\n### Off-Grid Editorial Layout\nUse asymmetry and tension with control.\nMust remain readable and clearly structured.\n\n### Product UI Panel Stack\nLayer UI screens or interface crops to imply a product story.\nAvoid generic fake dashboards.\n\n### Vertical Rhythm Lines\nUse fine lines and spacing systems to reinforce order and elegance.\nNever let them become decorative clutter.\n\n---\n\n## 12. DENSITY & SPACING DISCIPLINE\nDo not make everything too dense.\n\nThe page should breathe.\nLeave slightly more blank space between sections than a default AI-generated design would.\n\nRules:\n- use more even vertical spacing between major sections\n- keep section-to-section spacing consistent unless there is a strong design reason not to\n- avoid one section feeling very cramped while the next feels too empty\n- prefer a clean, balanced cadence across the page\n- allow negative space to create rhythm and emphasis\n- separate denser sections with calmer sections\n- avoid stacking too many cards, labels, and content blocks too tightly\n- smaller sections should still receive enough surrounding space so the page feels polished and intentional\n\nA premium page should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausted\n\nSection rhythm should alternate with control:\n- some sections can be more content-rich\n- some sections can be smaller and calmer\n- but the overall spacing cadence should still feel even, clean, and deliberate\n\nWhitespace is a design tool.\nUse it deliberately.\nDo not let spacing become random.\n\n---\n\n## 13. COLOR & MATERIAL RULES\n\n### Palette Discipline\nUse one controlled palette across the entire site:\n- 1 primary (brand anchor)\n- 1 secondary (supporting tone)\n- 1 accent (used sparingly for CTA / highlight)\n- a neutral scale (background, surface, text, hairline)\n\nSection-level mood shifts must reuse the same palette — no full theme swap per section.\n\n### Background-image harmony\nWhen using full-bleed image backgrounds:\n- the image must tonally match the palette (not fight it)\n- use overlays (dark, light, or color tint) to keep text fully readable\n- the brand accent stays consistent regardless of background image\n\n### Gradient Discipline\nGradients are **allowed and encouraged** when professional and subtle. They are not the same as AI slop gradients.\n\nAllowed (use confidently):\n- low-chroma palette-matched tonal gradients (e.g. ink to graphite, cream to sand, ivory to warm grey)\n- single-hue atmospheric grades behind hero photography\n- soft vignettes and radial depth that direct the eye\n- noise-textured gradients adding tactile depth without color noise\n- editorial color washes that match brand mood\n\nBanned (AI gradient slop):\n- rainbow / mesh blob gradients\n- purple-to-blue \"AI\" defaults\n- pink-to-orange \"creator\" defaults\n- neon edges and glow halos with no purpose\n- gradient text as a shortcut for \"premium\"\n- gradients that compete with imagery instead of supporting it\n\n### Background Confidence Rule\nDo not retreat to plain white surfaces by default. When the brief, brand mood, or section job calls for atmosphere, use:\n- a full-bleed image,\n- a duotone or graded photo,\n- a tonal gradient,\n- a tactile material,\nor a confident flat color field — picked deliberately, not as decoration.\n\n### Strong guidance\n- avoid rainbow randomness\n- avoid over-neon unless requested\n- keep contrast intentional\n- match accent colors to the chosen theme paradigm\n- gradients must always read as professional and intentional, never as visual noise\n\n### Materiality\nWhere appropriate, add:\n- paper feel\n- glass feel\n- brushed metal feel\n- soft blur depth\n- tactile matte surfaces\n- editorial photo treatment\n\nBut always keep the frontend structure readable.\n\n---\n\n## 14. IMAGE / MEDIA DIRECTION\nIf imagery is present, it must support the layout.\n\nAllowed:\n- art-directed product visuals\n- refined editorial photography\n- UI crops\n- abstract forms with structural purpose\n- framed objects\n- premium texture use\n- campaign-style visuals\n\nAvoid:\n- irrelevant scenery\n- stock-photo cliches\n- decorative junk\n- visuals that overpower the page hierarchy\n\n---\n\n## 15. DEFAULT SITE PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\n---\n\n## 16. MULTI-IMAGE CONSISTENCY RULE\nBecause every section is its own image, consistency is critical. Across all per-section frames enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA family (style variations are fine, identity is not)\n- same icon or illustration mood\n- same image treatment (grade, framing, material vocabulary)\n- same tonal language in any copy\n\nVariation IS allowed in:\n- composition anchor (per section)\n- background mode (per section)\n- section size and density\n- which \"second-read\" moment appears\n\nA viewer flipping through every per-section frame must still recognize one brand. Anything that breaks brand recall is over-variation.\n\n---\n\n## 17. CLARITY CHECK\nBefore finalizing, verify internally:\n\n1. Is the hierarchy obvious?\n2. Is the hero clean enough?\n3. Is the design visually distinctive?\n4. Is it free of obvious AI tells?\n5. Is it premium rather than template-like?\n6. Can someone code from this?\n7. If multiple images exist, do they clearly belong together?\n8. Is imagery used strongly enough (with variation, not one repeated crop)?\n9. Does the page breathe, or is it too dense?\n10. Is there enough spacing between sections?\n11. Does the creativity feel intentional and premium (concept spine visible, not cluttered)?\n12. Is the spacing between sections even and controlled?\n13. Do smaller sections still have enough surrounding space to feel clean?\n14. Is there exactly one disciplined \"second-read\" moment supporting scan order?\n15. Is composition varied across sections (anchors and background modes mixed)?\n16. Is the hero scale (giant / mid / mini) chosen and executed cleanly?\n17. Is there a clear conversion path (hook -> proof -> action) even in artistic sites?\n18. Is the palette consistent across all per-section images?\n19. Is each image horizontal and one-section-only?\n20. Is the **total number of images equal to the number of sections** (never fewer)?\n21. Is the hero using a varied composition (not defaulting to left-text / right-image out of habit)?\n\nIf not, refine internally before output. If the count is wrong, regenerate the missing sections. If the hero feels like a reflexive left-text / right-image default, prefer a different composition anchor.\n\n---\n\n## 18. EXTRA CREATIVITY & IMPLEMENTATION EDGE\n\nApply unless the user opts out:\n\n### Cross-section contrast\nAcross the slice, deliberately vary foreground/background intensity at least twice (lighter → richer → calmer) so the scroll feels paced, not monotonous slabs.\n\n### CTA specificity\nPrefer one unmistakable primary action per major viewport tier; secondary actions must look secondary (scale, outline, ghost), not clones of primary.\n\n### Image variety inside one comp\nMix at least **two distinct image crops** where multiple sections exist — e.g. macro product + contextual environment, or portrait editorial + widescreen artifact — avoiding one repeated stock silhouette.\n\n### Data-viz restraint\nCharts, sparklines, and graphs appear only when the site type logically needs them (analytics, pricing, infra, observability brands). Else keep proof human (quotes, receipts, timelines, screenshots of real workflows).\n\n### Cultural / tonal alignment\nWhen the brief names an industry or region, steer palette and typographic temperament to match — don’t ship default “neutral SF startup” unless the brief is intentionally generic SaaS.\n\n### Mobile-implied fidelity (even for desktop mocks)\nMaintain tap-friendly hit sizes and readable caption sizes visually; stacking order should imply a sane single-column narrative.\n\n### Conversion focus\nEach section has a job. Even when the design is artistic, the page must read as a real product or brand site:\n- the hero communicates value in seconds and offers one obvious next action\n- proof sections (logos, quotes, metrics) feel earned, not stuffed\n- pricing or CTA sections feel decisive, not buried\n- the final section closes: a single strong CTA + supporting trust cue\nAvoid pure mood reels with no funnel logic.\n\n### Composition variety check\nAcross all per-section images, internally log the chosen composition anchor and background mode. Reject the set if:\n- the same composition anchor repeats more than 2 sections in a row\n- the same background mode repeats more than 3 sections in a row\n- every section is inline-asset (no full-bleed background ever appears) **AND** the brief does not call for minimalism / typography-only / swiss / ultra simple\n\nFor non-minimalist briefs: push for at least one full-bleed (or duotone / atmospheric) background and at least one mini minimalist section in any multi-section site.\n\nFor minimalist briefs: this rule is suspended. Restraint is the design.\n\n---\n\n## 19. RESPONSE BEHAVIOR\nWhen the user asks for a frontend design:\n1. infer site type and primary conversion goal\n2. infer number of sections (if unclear, use the defaults from §5: landing page = 6, full website = 8)\n3. **commit out loud** to the section count and announce it (\"Generating N horizontal images, one per section\")\n4. plan ONE horizontal image PER SECTION — always separate generations, never collapse\n5. choose Hero Scale for the whole site (giant / mid / mini)\n5. choose a strong visual combination (theme, type, hero arch, section system, motion, narrative spine, second-read moment)\n7. for each section: pick a Composition Anchor, Background Mode, and CTA Variation — vary across sections\n8. choose 4 signature components used appropriately across sections\n9. enforce hero minimalism + section size variety (some giant, some mini)\n10. enforce strong image usage including full-bleed backgrounds where it fits\n11. lock one consistent palette across all images\n12. apply §18 EXTRA CREATIVITY & IMPLEMENTATION EDGE\n13. keep spacing generous, even, and clean\n14. remove AI slop (including marquee / fake KPI clichés unless requested)\n15. run §17 CLARITY CHECK\n16. **generate every per-section horizontal image, labeled \"Section X of N: <name>\"**, until the full set is delivered. Do not stop early. Do not summarize. Do not return only one image.\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\n\n---\n\n## 20. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser: \"make a hero section for an AI startup\"\n\nInterpretation:\n- 1 horizontal image\n- Hero Scale: Mid Editorial or Giant Statement\n- Composition Anchor: bottom-left text over full-bleed product/atmosphere image\n- Background Mode: full-bleed image with dark tonal overlay\n- CTA Variation: outlined inline + small label hint\n- Palette: Deep Dark or Bold Studio Solid, one consistent accent\n- no cliche dashboard spam, no purple AI glow\n\n### Example 2\nUser: \"design 8 sections for a fintech website\"\n\nInterpretation:\n- 8 separate horizontal images (one per section)\n- Hero Scale: Mid Editorial (trust-driven)\n- vary Composition Anchor across sections (centered low, right-third caption, bottom-left over chart visual, stacked center for closing CTA)\n- Background Mode mix: solid surface, full-bleed image background once, editorial side-image at use cases\n- one consistent palette (e.g. ink + paper + single brand accent)\n- conversion path: hook -> proof bar -> features -> use case -> testimonial -> pricing -> FAQ -> final CTA\n\n### Example 3\nUser: \"creative agency landing page, 12 sections\"\n\nInterpretation:\n- 12 horizontal images (one per section)\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive choice, not in-between)\n- editorial / poster-like direction; off-grid composition appears 2-3 times\n- multiple Background Modes (full-bleed image at hero + showcase, editorial side-image at case studies, solid + accent for process)\n- palette consistent throughout, with one bold accent recurring\n- closing CTA section: mini minimalist, strong type, single primary action\n\n---\n\n## 21. FINAL GOAL\nGenerate frontend reference images that feel:\n- artistic\n- premium\n- clear\n- structured\n- image-led\n- breathable\n- memorable\n- anti-generic\n- implementation-friendly\n\nThe result should look like a top-tier website concept with strong imagery, confident creativity, and generous spacing - not a dense, repetitive AI layout.\n",".agents/skills/industrial-brutalist-ui/SKILL.md":"---\nname: industrial-brutalist-ui\ndescription: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.\n---\n\n# SKILL: Industrial Brutalism & Tactical Telemetry UI\n\n## 1. Skill Meta\n**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering\n**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.\n\n## 2. Visual Archetypes\nThe design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**\n\n### 2.1 Swiss Industrial Print\nDerived from 1960s corporate identity systems and heavy machinery blueprints.\n*   **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.\n\n### 2.2 Tactical Telemetry & CRT Terminal\nDerived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).\n*   **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).\n\n## 3. Typographic Architecture\nTypography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.\n\n### 3.1 Macro-Typography (Structural Headers)\n*   **Classification:** Neo-Grotesque / Heavy Sans-Serif.\n*   **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.\n*   **Implementation Parameters:**\n    *   **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).\n    *   **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.\n    *   **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).\n    *   **Casing:** Exclusively uppercase for structural impact.\n\n### 3.2 Micro-Typography (Data & Telemetry)\n*   **Classification:** Monospace / Technical Sans.\n*   **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.\n*   **Implementation Parameters:**\n    *   **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).\n    *   **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.\n    *   **Leading:** Standard to tight (`1.2` to `1.4`).\n    *   **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.\n\n### 3.3 Textural Contrast (Artistic Disruption)\n*   **Classification:** High-Contrast Serif.\n*   **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.\n*   **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.\n\n## 4. Color System\nThe color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.\n\n**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**\n\n### If Swiss Industrial Print (Light):\n*   **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).\n*   **Foreground:** `#050505` to `#111111` (Carbon Ink).\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.\n\n### If Tactical Telemetry (Dark):\n*   **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).\n*   **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.\n*   **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.\n\n## 5. Layout and Spatial Engineering\nThe layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.\n\n*   **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.\n*   **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.\n*   **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.\n*   **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.\n\n## 6. UI Components and Symbology\nStandard web UI conventions are replaced with utilitarian, industrial graphic elements.\n\n*   **Syntax Decoration:** Utilization of ASCII characters to frame data points.\n    *   *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`\n    *   *Directional:* `>>>`, `///`, `\\\\\\\\`\n*   **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.\n*   **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.\n\n## 7. Textural and Post-Processing Effects\nTo prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.\n\n*   **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.\n*   **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).\n*   **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.\n\n## 8. Web Engineering Directives\n1.  **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.\n2.  **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.\n3.  **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.\n",".agents/skills/minimalist-ui/SKILL.md":"---\nname: minimalist-ui\ndescription: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.\n---\n\n# Protocol: Premium Utilitarian Minimalism UI Architect\n\n## 1. Protocol Overview\nName: Premium Utilitarian Minimalism & Editorial UI\nDescription: An advanced frontend engineering directive for generating highly refined, ultra-minimalist, \"document-style\" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.\n\n## 2. Absolute Negative Constraints (Banned Elements)\nThe AI must strictly avoid the following generic web development defaults:\n- DO NOT use the \"Inter\", \"Roboto\", or \"Open Sans\" typefaces.\n- DO NOT use generic, thin-line icon libraries like \"Lucide\", \"Feather\", or standard \"Heroicons\".\n- DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).\n- DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).\n- DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).\n- DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.\n- DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.\n- DO NOT use generic placeholder names like \"John Doe\", \"Acme Corp\", or \"Lorem Ipsum\". Use realistic, contextual content.\n- DO NOT use AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\". Write plain, specific language.\n\n## 3. Typographic Architecture\nThe interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.\n- Primary Sans-Serif (Body, UI, Buttons): Use clean, geometric, or system-native fonts with character. Target: `font-family: 'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`.\n- Editorial Serif (Hero Headings & Quotes): Target: `font-family: 'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`. Apply tight tracking (`letter-spacing: -0.02em` to `-0.04em`) and tight line-height (`1.1`).\n- Monospace (Code, Keystrokes, Meta-data): Target: `font-family: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`.\n- Text Colors: Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous `line-height` of `1.6` for legibility. Secondary text should be muted gray (`#787774`).\n\n## 4. Color Palette (Warm Monochrome + Spot Pastels)\nColor is a scarce resource, utilized only for semantic meaning or subtle accents.\n- Canvas / Background: Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.\n- Primary Surface (Cards): `#FFFFFF` or `#F9F9F8`.\n- Structural Borders / Dividers: Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.\n- Accent Colors: Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds.\n  - Pale Red: `#FDEBEC` (Text: `#9F2F2D`)\n  - Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)\n  - Pale Green: `#EDF3EC` (Text: `#346538`)\n  - Pale Yellow: `#FBF3DB` (Text: `#956400`)\n\n## 5. Component Specifications\n- Bento Box Feature Grids:\n  - Utilize asymmetrical CSS Grid layouts.\n  - Cards must have exactly `border: 1px solid #EAEAEA`.\n  - Border-radius must be crisp: `8px` or `12px` maximum.\n  - Internal padding must be generous (e.g., `24px` to `40px`).\n- Primary Call-To-Action (Buttons):\n  - Solid background `#111111`, text `#FFFFFF`. \n  - Slight border-radius (`4px` to `6px`). No box-shadow. \n  - Hover state should be a subtle color shift to `#333333` or a micro-scale `transform: scale(0.98)`.\n- Tags & Status Badges:\n  - Pill-shaped (`border-radius: 9999px`), very small typography (`text-xs`), uppercase with wide tracking (`letter-spacing: 0.05em`).\n  - Background must use the defined Muted Pastels.\n- Accordions (FAQ):\n  - Strip all container boxes. Separate items only with a `border-bottom: 1px solid #EAEAEA`.\n  - Use a clean, sharp `+` and `-` icon for the toggle state.\n- Keystroke Micro-UIs:\n  - Render shortcuts as physical keys using `<kbd>` tags: `border: 1px solid #EAEAEA`, `border-radius: 4px`, `background: #F7F6F3`, using the Monospace font.\n- Faux-OS Window Chrome:\n  - When mocking up software, wrap it in a minimalist container with a white top bar containing three small, light gray circles (replicating macOS window controls).\n\n## 6. Iconography & Imagery Directives\n- System Icons: Use \"Phosphor Icons (Bold or Fill weights)\" or \"Radix UI Icons\" for a technical, slightly thicker-stroke aesthetic. Standardize stroke width across all icons.\n- Illustrations: Monochromatic, rough continuous-line ink sketches on a white background, featuring a single offset geometric shape filled with a muted pastel color.\n- Photography: Use high-quality, desaturated images with a warm tone. Apply subtle overlays (`opacity: 0.04` warm grain) to blend photos into the monochrome palette. Never use oversaturated stock photos. Use reliable placeholders like `https://picsum.photos/seed/{context}/1200/800` when real assets are unavailable.\n- Hero & Section Backgrounds: Sections should not feel empty and flat. Use subtle full-width background imagery at very low opacity, soft radial light spots (`radial-gradient` with warm tones at `opacity: 0.03`), or minimal geometric line patterns to add depth without breaking the clean aesthetic.\n\n## 7. Subtle Motion & Micro-Animations\nMotion should feel invisible — present but never distracting. The goal is quiet sophistication, not spectacle.\n- Scroll Entry: Elements fade in gently as they enter the viewport. Use `translateY(12px)` + `opacity: 0` resolving over `600ms` with `cubic-bezier(0.16, 1, 0.3, 1)`. Use `IntersectionObserver`, never `window.addEventListener('scroll')`.\n- Hover States: Cards lift with an ultra-subtle shadow shift (`box-shadow` transitioning from `0 0 0` to `0 2px 8px rgba(0,0,0,0.04)` over `200ms`). Buttons respond with `scale(0.98)` on `:active`.\n- Staggered Reveals: Lists and grid items enter with a cascade delay (`animation-delay: calc(var(--index) * 80ms)`). Never mount everything at once.\n- Background Ambient Motion: Optional. A single, very slow-moving radial gradient blob (`animation-duration: 20s+`, `opacity: 0.02-0.04`) drifting behind hero sections. Must be applied to a `position: fixed; pointer-events: none` layer. Never on scrolling containers.\n- Performance: Animate exclusively via `transform` and `opacity`. No layout-triggering properties (`top`, `left`, `width`, `height`). Use `will-change: transform` sparingly and only on actively animating elements.\n\n## 8. Execution Protocol\nWhen tasked with writing frontend code (HTML, React, Tailwind, Vue) or designing a layout:\n1. Establish the macro-whitespace first. Use massive vertical padding between sections (e.g., `py-24` or `py-32` in Tailwind).\n2. Constrain the main typography content width to `max-w-4xl` or `max-w-5xl`.\n3. Apply the custom typographic hierarchy and monochromatic color variables immediately.\n4. Ensure every card, divider, and border adheres strictly to the `1px solid #EAEAEA` rule.\n5. Add scroll-entry animations to all major content blocks.\n6. Ensure sections have visual depth through imagery, ambient gradients, or subtle textures — no empty flat backgrounds.\n7. Provide code that reflects this high-end, uncluttered, editorial aesthetic natively without requiring manual adjustments.\n",".agents/skills/redesign-existing-projects/SKILL.md":"---\nname: redesign-existing-projects\ndescription: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.\n---\n\n# Redesign Skill\n\n## How This Works\n\nWhen applied to an existing project, follow this sequence:\n\n1. **Scan** — Read the codebase. Identify the framework, styling method (Tailwind, vanilla CSS, styled-components, etc.), and current design patterns.\n2. **Diagnose** — Run through the audit below. List every generic pattern, weak point, and missing state you find.\n3. **Fix** — Apply targeted upgrades working with the existing stack. Do not rewrite from scratch. Improve what's there.\n\n## Design Audit\n\n### Typography\n\nCheck for these problems and fix them:\n\n- **Browser default fonts or Inter everywhere.** Replace with a font that has character. Good options: `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`. For editorial/creative projects, pair a serif header with a sans-serif body.\n- **Headlines lack presence.** Increase size for display text, tighten letter-spacing, reduce line-height. Headlines should feel heavy and intentional.\n- **Body text too wide.** Limit paragraph width to roughly 65 characters. Increase line-height for readability.\n- **Only Regular (400) and Bold (700) weights used.** Introduce Medium (500) and SemiBold (600) for more subtle hierarchy.\n- **Numbers in proportional font.** Use a monospace font or enable tabular figures (`font-variant-numeric: tabular-nums`) for data-heavy interfaces.\n- **Missing letter-spacing adjustments.** Use negative tracking for large headers, positive tracking for small caps or labels.\n- **All-caps subheaders everywhere.** Try lowercase italics, sentence case, or small-caps instead.\n- **Orphaned words.** Single words sitting alone on the last line. Fix with `text-wrap: balance` or `text-wrap: pretty`.\n\n### Color and Surfaces\n\n- **Pure `#000000` background.** Replace with off-black, dark charcoal, or tinted dark (`#0a0a0a`, `#121212`, or a dark navy).\n- **Oversaturated accent colors.** Keep saturation below 80%. Desaturate accents so they blend with neutrals instead of screaming.\n- **More than one accent color.** Pick one. Remove the rest. Consistency beats variety.\n- **Mixing warm and cool grays.** Stick to one gray family. Tint all grays with a consistent hue (warm or cool, not both).\n- **Purple/blue \"AI gradient\" aesthetic.** This is the most common AI design fingerprint. Replace with neutral bases and a single, considered accent.\n- **Generic `box-shadow`.** Tint shadows to match the background hue. Use colored shadows (e.g., dark blue shadow on a blue background) instead of pure black at low opacity.\n- **Flat design with zero texture.** Add subtle noise, grain, or micro-patterns to backgrounds. Pure flat vectors feel sterile.\n- **Perfectly even gradients.** Break the uniformity with radial gradients, noise overlays, or mesh gradients instead of standard linear 45-degree fades.\n- **Inconsistent lighting direction.** Audit all shadows to ensure they suggest a single, consistent light source.\n- **Random dark sections in a light mode page (or vice versa).** A single dark-background section breaking an otherwise light page looks like a copy-paste accident. Either commit to a full dark mode or keep a consistent background tone throughout. If contrast is needed, use a slightly darker shade of the same palette — not a sudden jump to `#111` in the middle of a cream page.\n- **Empty, flat sections with no visual depth.** Sections that are just text on a plain background feel unfinished. Add high-quality background imagery (blurred, overlaid, or masked), subtle patterns, or ambient gradients. Use reliable placeholder sources like `https://picsum.photos/seed/{name}/1920/1080` when real assets are not available. Experiment with background images behind hero sections, feature blocks, or CTAs — even a subtle full-width photo at low opacity adds presence.\n\n### Layout\n\n- **Everything centered and symmetrical.** Break symmetry with offset margins, mixed aspect ratios, or left-aligned headers over centered content.\n- **Three equal card columns as feature row.** This is the most generic AI layout. Replace with a 2-column zig-zag, asymmetric grid, horizontal scroll, or masonry layout.\n- **Using `height: 100vh` for full-screen sections.** Replace with `min-height: 100dvh` to prevent layout jumping on mobile browsers (iOS Safari viewport bug).\n- **Complex flexbox percentage math.** Replace with CSS Grid for reliable multi-column structures.\n- **No max-width container.** Add a container constraint (around 1200-1440px) with auto margins so content doesn't stretch edge-to-edge on wide screens.\n- **Cards of equal height forced by flexbox.** Allow variable heights or use masonry when content varies in length.\n- **Uniform border-radius on everything.** Vary the radius: tighter on inner elements, softer on containers.\n- **No overlap or depth.** Elements sit flat next to each other. Use negative margins to create layering and visual depth.\n- **Symmetrical vertical padding.** Top and bottom padding are always identical. Adjust optically — bottom padding often needs to be slightly larger.\n- **Dashboard always has a left sidebar.** Try top navigation, a floating command menu, or a collapsible panel instead.\n- **Missing whitespace.** Double the spacing. Let the design breathe. Dense layouts work for data dashboards, not for marketing pages.\n- **Buttons not bottom-aligned in card groups.** When cards have different content lengths, CTAs end up at random heights. Pin buttons to the bottom of each card so they form a clean horizontal line regardless of content above.\n- **Feature lists starting at different vertical positions.** In pricing tables or comparison cards, the list of features should start at the same Y position across all columns. Use consistent spacing above the list or fixed-height title/price blocks.\n- **Inconsistent vertical rhythm in side-by-side elements.** When placing cards, columns, or panels next to each other, align shared elements (titles, descriptions, prices, buttons) across all items. Misaligned baselines make the layout look broken.\n- **Mathematical alignment that looks optically wrong.** Centering by the math doesn't always look centered to the eye. Icons next to text, play buttons in circles, or text in buttons often need 1-2px optical adjustments to feel right.\n\n### Interactivity and States\n\n- **No hover states on buttons.** Add background shift, slight scale, or translate on hover.\n- **No active/pressed feedback.** Add a subtle `scale(0.98)` or `translateY(1px)` on press to simulate a physical click.\n- **Instant transitions with zero duration.** Add smooth transitions (200-300ms) to all interactive elements.\n- **Missing focus ring.** Ensure visible focus indicators for keyboard navigation. This is an accessibility requirement, not optional.\n- **No loading states.** Replace generic circular spinners with skeleton loaders that match the layout shape.\n- **No empty states.** An empty dashboard showing nothing is a missed opportunity. Design a composed \"getting started\" view.\n- **No error states.** Add clear, inline error messages for forms. Do not use `window.alert()`.\n- **Dead links.** Buttons that link to `#`. Either link to real destinations or visually disable them.\n- **No indication of current page in navigation.** Style the active nav link differently so users know where they are.\n- **Scroll jumping.** Anchor clicks jump instantly. Add `scroll-behavior: smooth`.\n- **Animations using `top`, `left`, `width`, `height`.** Switch to `transform` and `opacity` for GPU-accelerated, smooth animation.\n\n### Content\n\n- **Generic names like \"John Doe\" or \"Jane Smith\".** Use diverse, realistic-sounding names.\n- **Fake round numbers like `99.99%`, `50%`, `$100.00`.** Use organic, messy data: `47.2%`, `$99.00`, `+1 (312) 847-1928`.\n- **Placeholder company names like \"Acme Corp\", \"Nexus\", \"SmartFlow\".** Invent contextual, believable brand names.\n- **AI copywriting cliches.** Never use \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\", \"Tapestry\", or \"In the world of...\". Write plain, specific language.\n- **Exclamation marks in success messages.** Remove them. Be confident, not loud.\n- **\"Oops!\" error messages.** Be direct: \"Connection failed. Please try again.\"\n- **Passive voice.** Use active voice: \"We couldn't save your changes\" instead of \"Mistakes were made.\"\n- **All blog post dates identical.** Randomize dates to appear real.\n- **Same avatar image for multiple users.** Use unique assets for every distinct person.\n- **Lorem Ipsum.** Never use placeholder latin text. Write real draft copy.\n- **Title Case On Every Header.** Use sentence case instead.\n\n### Component Patterns\n\n- **Generic card look (border + shadow + white background).** Remove the border, or use only background color, or use only spacing. Cards should exist only when elevation communicates hierarchy.\n- **Always one filled button + one ghost button.** Add text links or tertiary styles to reduce visual noise.\n- **Pill-shaped \"New\" and \"Beta\" badges.** Try square badges, flags, or plain text labels.\n- **Accordion FAQ sections.** Use a side-by-side list, searchable help, or inline progressive disclosure.\n- **3-card carousel testimonials with dots.** Replace with a masonry wall, embedded social posts, or a single rotating quote.\n- **Pricing table with 3 towers.** Highlight the recommended tier with color and emphasis, not just extra height.\n- **Modals for everything.** Use inline editing, slide-over panels, or expandable sections instead of popups for simple actions.\n- **Avatar circles exclusively.** Try squircles or rounded squares for a less generic look.\n- **Light/dark toggle always a sun/moon switch.** Use a dropdown, system preference detection, or integrate it into settings.\n- **Footer link farm with 4 columns.** Simplify. Focus on main navigational paths and legally required links.\n\n### Iconography\n\n- **Lucide or Feather icons exclusively.** These are the \"default\" AI icon choice. Use Phosphor, Heroicons, or a custom set for differentiation.\n- **Rocketship for \"Launch\", shield for \"Security\".** Replace cliche metaphors with less obvious icons (bolt, fingerprint, spark, vault).\n- **Inconsistent stroke widths across icons.** Audit all icons and standardize to one stroke weight.\n- **Missing favicon.** Always include a branded favicon.\n- **Stock \"diverse team\" photos.** Use real team photos, candid shots, or a consistent illustration style instead of uncanny stock imagery.\n\n### Code Quality\n\n- **Div soup.** Use semantic HTML: `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>`.\n- **Inline styles mixed with CSS classes.** Move all styling to the project's styling system.\n- **Hardcoded pixel widths.** Use relative units (`%`, `rem`, `em`, `max-width`) for flexible layouts.\n- **Missing alt text on images.** Describe image content for screen readers. Never leave `alt=\"\"` or `alt=\"image\"` on meaningful images.\n- **Arbitrary z-index values like `9999`.** Establish a clean z-index scale in the theme/variables.\n- **Commented-out dead code.** Remove all debug artifacts before shipping.\n- **Import hallucinations.** Check that every import actually exists in `package.json` or the project dependencies.\n- **Missing meta tags.** Add proper `<title>`, `description`, `og:image`, and social sharing meta tags.\n\n### Strategic Omissions (What AI Typically Forgets)\n\n- **No legal links.** Add privacy policy and terms of service links in the footer.\n- **No \"back\" navigation.** Dead ends in user flows. Every page needs a way back.\n- **No custom 404 page.** Design a helpful, branded \"page not found\" experience.\n- **No form validation.** Add client-side validation for emails, required fields, and format checks.\n- **No \"skip to content\" link.** Essential for keyboard users. Add a hidden skip-link.\n- **No cookie consent.** If required by jurisdiction, add a compliant consent banner.\n\n## Upgrade Techniques\n\nWhen upgrading a project, pull from these high-impact techniques to replace generic patterns:\n\n### Typography Upgrades\n- **Variable font animation.** Interpolate weight or width on scroll or hover for text that feels alive.\n- **Outlined-to-fill transitions.** Text starts as a stroke outline and fills with color on scroll entry or interaction.\n- **Text mask reveals.** Large typography acting as a window to video or animated imagery behind it.\n\n### Layout Upgrades\n- **Broken grid / asymmetry.** Elements that deliberately ignore column structure — overlapping, bleeding off-screen, or offset with calculated randomness.\n- **Whitespace maximization.** Aggressive use of negative space to force focus on a single element.\n- **Parallax card stacks.** Sections that stick and physically stack over each other during scroll.\n- **Split-screen scroll.** Two halves of the screen sliding in opposite directions.\n\n### Motion Upgrades\n- **Smooth scroll with inertia.** Decouple scrolling from browser defaults for a heavier, cinematic feel.\n- **Staggered entry.** Elements cascade in with slight delays, combining Y-axis translation with opacity fade. Never mount everything at once.\n- **Spring physics.** Replace linear easing with spring-based motion for a natural, weighty feel on all interactive elements.\n- **Scroll-driven reveals.** Content entering through expanding masks, wipes, or draw-on SVG paths tied to scroll progress.\n\n### Surface Upgrades\n- **True glassmorphism.** Go beyond `backdrop-filter: blur`. Add a 1px inner border and a subtle inner shadow to simulate edge refraction.\n- **Spotlight borders.** Card borders that illuminate dynamically under the cursor.\n- **Grain and noise overlays.** A fixed, pointer-events-none overlay with subtle noise to break digital flatness.\n- **Colored, tinted shadows.** Shadows that carry the hue of the background rather than using generic black.\n\n## Fix Priority\n\nApply changes in this order for maximum visual impact with minimum risk:\n\n1. **Font swap** — biggest instant improvement, lowest risk\n2. **Color palette cleanup** — remove clashing or oversaturated colors\n3. **Hover and active states** — makes the interface feel alive\n4. **Layout and spacing** — proper grid, max-width, consistent padding\n5. **Replace generic components** — swap cliche patterns for modern alternatives\n6. **Add loading, empty, and error states** — makes it feel finished\n7. **Polish typography scale and spacing** — the premium final touch\n\n## Rules\n\n- Work with the existing tech stack. Do not migrate frameworks or styling libraries.\n- Do not break existing functionality. Test after every change.\n- Before importing any new library, check the project's dependency file first.\n- If the project uses Tailwind, check the version (v3 vs v4) before modifying config.\n- If the project has no framework, use vanilla CSS.\n- Keep changes reviewable and focused. Small, targeted improvements over big rewrites.\n",".agents/skills/stitch-design-taste/DESIGN.md":"# Design System: Taste Standard\n**Skill:** stitch-design-taste\n\n---\n\n## Configuration — Set Your Style\nAdjust these dials before using this design system. They control how creative, dense, and animated the output should be. Pick the level that fits your project.\n\n| Dial | Level | Description |\n|------|-------|-------------|\n| **Creativity** | `8` | `1` = Ultra-minimal, Swiss, silent, monochrome. `5` = Balanced, clean but with personality. `10` = Expressive, editorial, bold typography experiments, inline images in headlines, strong asymmetry. Default: `8` |\n| **Density** | `4` | `1` = Gallery-airy, massive whitespace. `5` = Balanced sections. `10` = Cockpit-dense, data-heavy. Default: `4` |\n| **Variance** | `8` | `1` = Predictable, symmetric grids. `5` = Subtle offsets. `10` = Artsy chaotic, no two sections alike. Default: `8` |\n| **Motion Intent** | `6` | `1` = Static, no animation noted. `5` = Subtle hover/entrance cues. `10` = Cinematic orchestration noted in every component. Default: `6` |\n\n> **How to use:** Change the numbers above to match your project's vibe. At **Creativity 1–3**, the system produces clean, quiet, Notion-like interfaces. At **Creativity 7–10**, expect inline image typography, dramatic scale contrast, and strong editorial layouts. The rest of the rules below adapt to your chosen levels.\n\n---\n\n## 1. Visual Theme & Atmosphere\nA restrained, gallery-airy interface with confident asymmetric layouts and fluid spring-physics motion. The atmosphere is clinical yet warm — like a well-lit architecture studio where every element earns its place through function. Density is balanced (Level 4), variance runs high (Level 8) to prevent symmetrical boredom, and motion is fluid but never theatrical (Level 6). The overall impression: expensive, intentional, alive.\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface. Warm-neutral, never clinical blue-white\n- **Pure Surface** (#FFFFFF) — Card and container fill. Used with whisper shadow for elevation\n- **Charcoal Ink** (#18181B) — Primary text. Zinc-950 depth — never pure black\n- **Steel Secondary** (#71717A) — Body text, descriptions, metadata. Zinc-500 warmth\n- **Muted Slate** (#94A3B8) — Tertiary text, timestamps, disabled states\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, structural 1px lines. Semi-transparent for depth\n- **Diffused Shadow** (rgba(0,0,0,0.05)) — Card elevation. Wide-spreading, 40px blur, -15px offset. Never harsh\n\n### Accent Selection (Pick ONE per project)\n- **Emerald Signal** (#10B981) — For growth, success, positive data dashboards\n- **Electric Blue** (#3B82F6) — For productivity, SaaS, developer tools\n- **Deep Rose** (#E11D48) — For creative, editorial, fashion-adjacent projects\n- **Amber Warmth** (#F59E0B) — For community, social, warm-toned products\n\n### Banned Colors\n- Purple/Violet neon gradients — the \"AI Purple\" aesthetic\n- Pure Black (#000000) — always Off-Black or Zinc-950\n- Oversaturated accents above 80% saturation\n- Mixed warm/cool gray systems within one project\n\n## 3. Typography Rules\n- **Display:** `Geist`, `Satoshi`, `Cabinet Grotesk`, or `Outfit` — Track-tight (`-0.025em`), controlled fluid scale, weight-driven hierarchy (700–900). Not screaming. Leading compressed (`1.1`). Alternatives forced — `Inter` is BANNED for premium contexts\n- **Body:** Same family at weight 400 — Relaxed leading (`1.65`), 65ch max-width, Steel Secondary color (#71717A)\n- **Mono:** `Geist Mono` or `JetBrains Mono` — For code blocks, metadata, timestamps. When density exceeds Level 7, all numbers switch to monospace\n- **Scale:** Display at `clamp(2.25rem, 5vw, 3.75rem)`. Body at `1rem/1.125rem`. Mono metadata at `0.8125rem`\n\n### Banned Fonts\n- `Inter` — banned everywhere in premium/creative contexts\n- Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) — BANNED. If serif is needed for editorial/creative, use only distinctive modern serifs like `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Never use default browser serif stacks. Serif is always BANNED in dashboards or software UIs regardless\n\n## 4. Component Stylings\n* **Buttons:** Flat surface, no outer glow. Primary: accent fill with white text. Secondary: ghost/outline. Active state: `-1px translateY` or `scale(0.98)` for tactile push. Hover: subtle background shift, never glow\n* **Cards/Containers:** Generously rounded corners (`2.5rem`). Pure white fill. Whisper border (`1px`, semi-transparent). Diffused shadow (`0 20px 40px -15px rgba(0,0,0,0.05)`). Internal padding `2rem–2.5rem`. Used ONLY when elevation communicates hierarchy — high-density layouts replace cards with `border-top` dividers or negative space\n* **Inputs/Forms:** Label positioned above input. Helper text optional. Error text below in Deep Rose. Focus ring in accent color, `2px` offset. No floating labels. Standard `0.5rem` gap between label-input-error stack\n* **Navigation:** Sleek, sticky. Icons scale on hover (Dock Magnification optional). No hamburger on desktop. Clean horizontal with generous spacing\n* **Loaders:** Skeletal shimmer matching exact layout dimensions and rounded corners. Shifting light reflection across placeholder shapes. Never circular spinners\n* **Empty States:** Composed illustration or icon composition with guidance text. Never just \"No data found\"\n* **Error States:** Inline, contextual. Red accent underline or border. Clear recovery action\n\n## 5. Hero Section\nThe Hero is the first impression — it must be striking, creative, and never generic.\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Example: \"We build [photo of hands typing] digital [photo of screen] products\" — images sit inline at type-height, rounded, acting as visual punctuation between words. This is the signature creative technique\n- **No Overlapping Elements:** Text must never overlap images or other text. Every element has its own clear spatial zone. No z-index stacking of content layers, no absolute-positioned headlines over images. Clean separation always\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons, and any instructional UI chrome are BANNED. The user knows how to scroll. Let the content pull them in naturally\n- **Asymmetric Structure:** Centered Hero layouts are BANNED at this variance level. Use Split Screen (50/50), Left-Aligned text / Right visual, or Asymmetric Whitespace with large empty zones\n- **CTA Restraint:** Maximum one primary CTA button. No secondary \"Learn more\" links. No redundant micro-copy below the headline\n\n## 6. Layout Principles\n- **Grid-First:** CSS Grid for all structural layouts. Never flexbox percentage math (`calc(33% - 1rem)` is BANNED)\n- **No Overlapping:** Elements must never overlap each other. No absolute-positioned layers stacking content on content. Every element occupies its own grid cell or flow position. Clean, separated spatial zones\n- **Feature Sections:** The \"3 equal cards in a row\" pattern is BANNED. Use 2-column Zig-Zag, asymmetric Bento grids (2fr 1fr 1fr), or horizontal scroll galleries\n- **Containment:** All content within `max-width: 1400px`, centered. Generous horizontal padding (`1rem` mobile, `2rem` tablet, `4rem` desktop)\n- **Full-Height:** Use `min-height: 100dvh` — never `height: 100vh` (iOS Safari address bar jump)\n- **Bento Architecture:** For feature grids, use Row 1: 3 columns | Row 2: 2 columns (70/30 split). Each tile contains a perpetual micro-animation\n\n## 7. Responsive Rules\nEvery screen must work flawlessly across all viewports. **Responsive is not optional — it is a hard requirement. Every single element must be tested at 375px, 768px, and 1440px.**\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to a strict single column. `width: 100%`, `padding: 1rem`, `gap: 1.5rem`. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure. All elements must fit within viewport width. If any element causes horizontal scroll, the design is broken\n- **Typography Scaling:** Headlines scale down gracefully via `clamp()`. Body text stays `1rem` minimum. Never shrink body below `14px`. Headlines must remain readable on 375px screens\n- **Touch Targets:** All interactive elements minimum `44px` tap target. Generous spacing between clickable items. Buttons must be full-width on mobile\n- **Image Behavior:** Hero and inline images scale proportionally. Inline typography images (photos between words) stack below the headline on mobile instead of inline\n- **Navigation:** Desktop horizontal nav collapses to a clean mobile menu (slide-in or full-screen overlay). No tiny hamburger icons without labels\n- **Cards & Grids:** Bento grids and asymmetric layouts revert to stacked single-column cards with full-width. Maintain internal padding (`1rem`)\n- **Spacing Consistency:** Vertical section gaps reduce proportionally on mobile (`clamp(3rem, 8vw, 6rem)`). Never cramped, never excessively airy\n- **Testing Viewports:** Designs must be verified at: `375px` (iPhone SE), `390px` (iPhone 14), `768px` (iPad), `1024px` (small laptop), `1440px` (desktop)\n\n## 8. Motion & Interaction (Code-Phase Intent)\n> **Note:** Stitch generates static screens — it does not animate. This section documents the **intended motion behavior** so that the coding agent (Antigravity, Cursor, etc.) knows exactly how to implement animations when building the exported design into a live product.\n\n- **Physics Engine:** Spring-based exclusively. `stiffness: 100, damping: 20`. No linear easing anywhere. Premium, weighty feel on all interactive elements\n- **Perpetual Micro-Loops:** Every active dashboard component has an infinite-loop state — Pulse on status dots, Typewriter on search bars, Float on feature icons, Shimmer on loading states\n- **Staggered Orchestration:** Lists and grids mount with cascaded delays (`animation-delay: calc(var(--index) * 100ms)`). Waterfall reveals, never instant mount\n- **Layout Transitions:** Smooth re-ordering via shared element IDs. Items swap positions with physics, simulating real-time intelligence\n- **Hardware Rules:** Animate ONLY `transform` and `opacity`. Never `top`, `left`, `width`, `height`. Grain/noise filters on fixed, pointer-events-none pseudo-elements only\n- **Performance:** CPU-heavy perpetual animations isolated in microscopic leaf components. Never trigger parent re-renders. Target 60fps minimum\n\n## 9. Anti-Patterns (Banned)\n- No emojis — anywhere in UI, code, or alt text\n- No `Inter` font — use `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — if serif is needed, use distinctive modern serifs only (`Fraunces`, `Instrument Serif`)\n- No pure black (`#000000`) — Off-Black or Zinc-950 only\n- No neon outer glows or default box-shadow glows\n- No oversaturated accent colors above 80%\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — text never overlaps images or other content. Clean spatial separation always\n- No 3-column equal card layouts for features\n- No centered Hero sections (at this variance level)\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", \"Discover more below\", scroll arrows, bouncing chevrons — all BANNED\n- No generic names: \"John Doe\", \"Sarah Chan\", \"Acme\", \"Nexus\", \"SmartFlow\"\n- No fake round numbers: `99.99%`, `50%`, `1234567` — use organic data: `47.2%`, `+1 (312) 847-1928`\n- No AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Revolutionize\"\n- No broken Unsplash links — use `picsum.photos/seed/{id}/800/600` or SVG UI Avatars\n- No generic `shadcn/ui` defaults — customize radii, colors, shadows to match this system\n- No `z-index` spam — use only for Navbar, Modal, Overlay layer contexts\n- No `h-screen` — always `min-h-[100dvh]`\n- No circular loading spinners — skeletal shimmer only\n",".agents/skills/stitch-design-taste/SKILL.md":"---\nname: stitch-design-taste\ndescription: Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.\n---\n\n# Stitch Design Taste — Semantic Design System Skill\n\n## Overview\nThis skill generates `DESIGN.md` files optimized for Google Stitch screen generation. It translates the battle-tested anti-slop frontend engineering directives into Stitch's native semantic design language — descriptive, natural-language rules paired with precise values that Stitch's AI agent can interpret to produce premium, non-generic interfaces.\n\nThe generated `DESIGN.md` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **\"Visual Descriptions\"** supported by specific color values, typography specs, and component behaviors.\n\n## Prerequisites\n- Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)\n- Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI\n\n## The Goal\nGenerate a `DESIGN.md` file that encodes:\n1. **Visual atmosphere** — the mood, density, and design philosophy\n2. **Color calibration** — neutrals, accents, and banned patterns with hex codes\n3. **Typographic architecture** — font stacks, scale hierarchy, and anti-patterns\n4. **Component behaviors** — buttons, cards, inputs with interaction states\n5. **Layout principles** — grid systems, spacing philosophy, responsive strategy\n6. **Motion philosophy** — animation engine specs, spring physics, perpetual micro-interactions\n7. **Anti-patterns** — explicit list of banned AI design clichés\n\n## Analysis & Synthesis Instructions\n\n### 1. Define the Atmosphere\nEvaluate the target project's intent. Use evocative adjectives from the taste spectrum:\n- **Density:** \"Art Gallery Airy\" (1–3) → \"Daily App Balanced\" (4–7) → \"Cockpit Dense\" (8–10)\n- **Variance:** \"Predictable Symmetric\" (1–3) → \"Offset Asymmetric\" (4–7) → \"Artsy Chaotic\" (8–10)\n- **Motion:** \"Static Restrained\" (1–3) → \"Fluid CSS\" (4–7) → \"Cinematic Choreography\" (8–10)\n\nDefault baseline: Variance 8, Motion 6, Density 4. Adapt dynamically based on user's vibe description.\n\n### 2. Map the Color Palette\nFor each color provide: **Descriptive Name** + **Hex Code** + **Functional Role**.\n\n**Mandatory constraints:**\n- Maximum 1 accent color. Saturation below 80%\n- The \"AI Purple/Blue Neon\" aesthetic is strictly BANNED — no purple button glows, no neon gradients\n- Use absolute neutral bases (Zinc/Slate) with high-contrast singular accents\n- Stick to one palette for the entire output — no warm/cool gray fluctuation\n- Never use pure black (`#000000`) — use Off-Black, Zinc-950, or Charcoal\n\n### 3. Establish Typography Rules\n- **Display/Headlines:** Track-tight, controlled scale. Not screaming. Hierarchy through weight and color, not just massive size\n- **Body:** Relaxed leading, max 65 characters per line\n- **Font Selection:** `Inter` is BANNED for premium/creative contexts. Force unique character: `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`\n- **Serif Ban:** Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) are BANNED. If serif is needed for editorial/creative contexts, use only distinctive modern serifs: `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Serif is always BANNED in dashboards or software UIs\n- **Dashboard Constraint:** Use Sans-Serif pairings exclusively (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`)\n- **High-Density Override:** When density exceeds 7, all numbers must use Monospace\n\n### 4. Define the Hero Section\nThe Hero is the first impression and must be creative, striking, and never generic:\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Images sit inline at type-height, rounded, acting as visual punctuation. This is the signature creative technique\n- **No Overlapping:** Text must never overlap images or other text. Every element occupies its own clean spatial zone\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons are BANNED. The content should pull users in naturally\n- **Asymmetric Structure:** Centered Hero layouts BANNED when variance exceeds 4\n- **CTA Restraint:** Maximum one primary CTA. No secondary \"Learn more\" links\n\n### 5. Describe Component Stylings\nFor each component type, describe shape, color, shadow depth, and interaction behavior:\n- **Buttons:** Tactile push feedback on active state. No neon outer glows. No custom mouse cursors\n- **Cards:** Use ONLY when elevation communicates hierarchy. Tint shadows to background hue. For high-density layouts, replace cards with border-top dividers or negative space\n- **Inputs/Forms:** Label above input, helper text optional, error text below. Standard gap spacing\n- **Loading States:** Skeletal loaders matching layout dimensions — no generic circular spinners\n- **Empty States:** Composed compositions indicating how to populate data\n- **Error States:** Clear, inline error reporting\n\n### 6. Define Layout Principles\n- No overlapping elements — every element occupies its own clear spatial zone. No absolute-positioned content stacking\n- Centered Hero sections are BANNED when variance exceeds 4 — force Split Screen, Left-Aligned, or Asymmetric Whitespace\n- The generic \"3 equal cards horizontally\" feature row is BANNED — use 2-column Zig-Zag, asymmetric grid, or horizontal scroll\n- CSS Grid over Flexbox math — never use `calc()` percentage hacks\n- Contain layouts using max-width constraints (e.g., 1400px centered)\n- Full-height sections must use `min-h-[100dvh]` — never `h-screen` (iOS Safari catastrophic jump)\n\n### 7. Define Responsive Rules\nEvery design must work across all viewports:\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to single column. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure\n- **Typography Scaling:** Headlines scale via `clamp()`. Body text minimum `1rem`/`14px`\n- **Touch Targets:** All interactive elements minimum `44px` tap target\n- **Image Behavior:** Inline typography images (photos between words) stack below headline on mobile\n- **Navigation:** Desktop horizontal nav collapses to clean mobile menu\n- **Spacing:** Vertical section gaps reduce proportionally (`clamp(3rem, 8vw, 6rem)`)\n\n### 8. Encode Motion Philosophy\n- **Spring Physics default:** `stiffness: 100, damping: 20` — premium, weighty feel. No linear easing\n- **Perpetual Micro-Interactions:** Every active component should have an infinite loop state (Pulse, Typewriter, Float, Shimmer)\n- **Staggered Orchestration:** Never mount lists instantly — use cascade delays for waterfall reveals\n- **Performance:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`. Grain/noise filters on fixed pseudo-elements only\n\n### 9. List Anti-Patterns (AI Tells)\nEncode these as explicit \"NEVER DO\" rules in the DESIGN.md:\n- No emojis anywhere\n- No `Inter` font\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — distinctive modern serifs only if needed\n- No pure black (`#000000`)\n- No neon/outer glow shadows\n- No oversaturated accents\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — clean spatial separation always\n- No 3-column equal card layouts\n- No generic names (\"John Doe\", \"Acme\", \"Nexus\")\n- No fake round numbers (`99.99%`, `50%`)\n- No AI copywriting clichés (\"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\")\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", scroll arrows, bouncing chevrons\n- No broken Unsplash links — use `picsum.photos` or SVG avatars\n- No centered Hero sections (for high-variance projects)\n\n## Output Format (DESIGN.md Structure)\n\n```markdown\n# Design System: [Project Title]\n\n## 1. Visual Theme & Atmosphere\n(Evocative description of the mood, density, variance, and motion intensity.\nExample: \"A restrained, gallery-airy interface with confident asymmetric layouts\nand fluid spring-physics motion. The atmosphere is clinical yet warm — like a\nwell-lit architecture studio.\")\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface\n- **Pure Surface** (#FFFFFF) — Card and container fill\n- **Charcoal Ink** (#18181B) — Primary text, Zinc-950 depth\n- **Muted Steel** (#71717A) — Secondary text, descriptions, metadata\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, 1px structural lines\n- **[Accent Name]** (#XXXXXX) — Single accent for CTAs, active states, focus rings\n(Max 1 accent. Saturation < 80%. No purple/neon.)\n\n## 3. Typography Rules\n- **Display:** [Font Name] — Track-tight, controlled scale, weight-driven hierarchy\n- **Body:** [Font Name] — Relaxed leading, 65ch max-width, neutral secondary color\n- **Mono:** [Font Name] — For code, metadata, timestamps, high-density numbers\n- **Banned:** Inter, generic system fonts for premium contexts. Serif fonts banned in dashboards.\n\n## 4. Component Stylings\n* **Buttons:** Flat, no outer glow. Tactile -1px translate on active. Accent fill for primary, ghost/outline for secondary.\n* **Cards:** Generously rounded corners (2.5rem). Diffused whisper shadow. Used only when elevation serves hierarchy. High-density: replace with border-top dividers.\n* **Inputs:** Label above, error below. Focus ring in accent color. No floating labels.\n* **Loaders:** Skeletal shimmer matching exact layout dimensions. No circular spinners.\n* **Empty States:** Composed, illustrated compositions — not just \"No data\" text.\n\n## 5. Layout Principles\n(Grid-first responsive architecture. Asymmetric splits for Hero sections.\nStrict single-column collapse below 768px. Max-width containment.\nNo flexbox percentage math. Generous internal padding.)\n\n## 6. Motion & Interaction\n(Spring physics for all interactive elements. Staggered cascade reveals.\nPerpetual micro-loops on active dashboard components. Hardware-accelerated\ntransforms only. Isolated Client Components for CPU-heavy animations.)\n\n## 7. Anti-Patterns (Banned)\n(Explicit list of forbidden patterns: no emojis, no Inter, no pure black,\nno neon glows, no 3-column equal grids, no AI copywriting clichés,\nno generic placeholder names, no broken image links.)\n```\n\n## Best Practices\n- **Be Descriptive:** \"Deep Charcoal Ink (#18181B)\" — not just \"dark text\"\n- **Be Functional:** Explain what each element is used for\n- **Be Consistent:** Same terminology throughout the document\n- **Be Precise:** Include exact hex codes, rem values, pixel values in parentheses\n- **Be Opinionated:** This is not a neutral template — it enforces a specific, premium aesthetic\n\n## Tips for Success\n1. Start with the atmosphere — understand the vibe before detailing tokens\n2. Look for patterns — identify consistent spacing, sizing, and styling\n3. Think semantically — name colors by purpose, not just appearance\n4. Consider hierarchy — document how visual weight communicates importance\n5. Encode the bans — anti-patterns are as important as the rules themselves\n\n## Common Pitfalls to Avoid\n- Using technical jargon without translation (\"rounded-xl\" instead of \"generously rounded corners\")\n- Omitting hex codes or using only descriptive names\n- Forgetting functional roles of design elements\n- Being too vague in atmosphere descriptions\n- Ignoring the anti-pattern list — these are what make the output premium\n- Defaulting to generic \"safe\" designs instead of enforcing the curated aesthetic\n",".agents/skills/vercel-react-best-practices/AGENTS.md":"# React Best Practices\n\n**Version 1.0.0**  \nVercel Engineering  \nJanuary 2026\n\n> **Note:**  \n> This document is mainly for agents and LLMs to follow when maintaining,  \n> generating, or refactoring React and Next.js codebases. Humans  \n> may also find it useful, but guidance here is optimized for automation  \n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.\n\n---\n\n## Table of Contents\n\n1. [Eliminating Waterfalls](#1-eliminating-waterfalls) — **CRITICAL**\n   - 1.1 [Check Cheap Conditions Before Async Flags](#11-check-cheap-conditions-before-async-flags)\n   - 1.2 [Defer Await Until Needed](#12-defer-await-until-needed)\n   - 1.3 [Dependency-Based Parallelization](#13-dependency-based-parallelization)\n   - 1.4 [Prevent Waterfall Chains in API Routes](#14-prevent-waterfall-chains-in-api-routes)\n   - 1.5 [Promise.all() for Independent Operations](#15-promiseall-for-independent-operations)\n   - 1.6 [Strategic Suspense Boundaries](#16-strategic-suspense-boundaries)\n2. [Bundle Size Optimization](#2-bundle-size-optimization) — **CRITICAL**\n   - 2.1 [Avoid Barrel File Imports](#21-avoid-barrel-file-imports)\n   - 2.2 [Conditional Module Loading](#22-conditional-module-loading)\n   - 2.3 [Defer Non-Critical Third-Party Libraries](#23-defer-non-critical-third-party-libraries)\n   - 2.4 [Dynamic Imports for Heavy Components](#24-dynamic-imports-for-heavy-components)\n   - 2.5 [Preload Based on User Intent](#25-preload-based-on-user-intent)\n3. [Server-Side Performance](#3-server-side-performance) — **HIGH**\n   - 3.1 [Authenticate Server Actions Like API Routes](#31-authenticate-server-actions-like-api-routes)\n   - 3.2 [Avoid Duplicate Serialization in RSC Props](#32-avoid-duplicate-serialization-in-rsc-props)\n   - 3.3 [Cross-Request LRU Caching](#33-cross-request-lru-caching)\n   - 3.4 [Hoist Static I/O to Module Level](#34-hoist-static-io-to-module-level)\n   - 3.5 [Minimize Serialization at RSC Boundaries](#35-minimize-serialization-at-rsc-boundaries)\n   - 3.6 [Parallel Data Fetching with Component Composition](#36-parallel-data-fetching-with-component-composition)\n   - 3.7 [Parallel Nested Data Fetching](#37-parallel-nested-data-fetching)\n   - 3.8 [Per-Request Deduplication with React.cache()](#38-per-request-deduplication-with-reactcache)\n   - 3.9 [Use after() for Non-Blocking Operations](#39-use-after-for-non-blocking-operations)\n4. [Client-Side Data Fetching](#4-client-side-data-fetching) — **MEDIUM-HIGH**\n   - 4.1 [Deduplicate Global Event Listeners](#41-deduplicate-global-event-listeners)\n   - 4.2 [Use Passive Event Listeners for Scrolling Performance](#42-use-passive-event-listeners-for-scrolling-performance)\n   - 4.3 [Use SWR for Automatic Deduplication](#43-use-swr-for-automatic-deduplication)\n   - 4.4 [Version and Minimize localStorage Data](#44-version-and-minimize-localstorage-data)\n5. [Re-render Optimization](#5-re-render-optimization) — **MEDIUM**\n   - 5.1 [Calculate Derived State During Rendering](#51-calculate-derived-state-during-rendering)\n   - 5.2 [Defer State Reads to Usage Point](#52-defer-state-reads-to-usage-point)\n   - 5.3 [Do not wrap a simple expression with a primitive result type in useMemo](#53-do-not-wrap-a-simple-expression-with-a-primitive-result-type-in-usememo)\n   - 5.4 [Don't Define Components Inside Components](#54-dont-define-components-inside-components)\n   - 5.5 [Extract Default Non-primitive Parameter Value from Memoized Component to Constant](#55-extract-default-non-primitive-parameter-value-from-memoized-component-to-constant)\n   - 5.6 [Extract to Memoized Components](#56-extract-to-memoized-components)\n   - 5.7 [Narrow Effect Dependencies](#57-narrow-effect-dependencies)\n   - 5.8 [Put Interaction Logic in Event Handlers](#58-put-interaction-logic-in-event-handlers)\n   - 5.9 [Split Combined Hook Computations](#59-split-combined-hook-computations)\n   - 5.10 [Subscribe to Derived State](#510-subscribe-to-derived-state)\n   - 5.11 [Use Functional setState Updates](#511-use-functional-setstate-updates)\n   - 5.12 [Use Lazy State Initialization](#512-use-lazy-state-initialization)\n   - 5.13 [Use Transitions for Non-Urgent Updates](#513-use-transitions-for-non-urgent-updates)\n   - 5.14 [Use useDeferredValue for Expensive Derived Renders](#514-use-usedeferredvalue-for-expensive-derived-renders)\n   - 5.15 [Use useRef for Transient Values](#515-use-useref-for-transient-values)\n6. [Rendering Performance](#6-rendering-performance) — **MEDIUM**\n   - 6.1 [Animate SVG Wrapper Instead of SVG Element](#61-animate-svg-wrapper-instead-of-svg-element)\n   - 6.2 [CSS content-visibility for Long Lists](#62-css-content-visibility-for-long-lists)\n   - 6.3 [Hoist Static JSX Elements](#63-hoist-static-jsx-elements)\n   - 6.4 [Optimize SVG Precision](#64-optimize-svg-precision)\n   - 6.5 [Prevent Hydration Mismatch Without Flickering](#65-prevent-hydration-mismatch-without-flickering)\n   - 6.6 [Suppress Expected Hydration Mismatches](#66-suppress-expected-hydration-mismatches)\n   - 6.7 [Use Activity Component for Show/Hide](#67-use-activity-component-for-showhide)\n   - 6.8 [Use defer or async on Script Tags](#68-use-defer-or-async-on-script-tags)\n   - 6.9 [Use Explicit Conditional Rendering](#69-use-explicit-conditional-rendering)\n   - 6.10 [Use React DOM Resource Hints](#610-use-react-dom-resource-hints)\n   - 6.11 [Use useTransition Over Manual Loading States](#611-use-usetransition-over-manual-loading-states)\n7. [JavaScript Performance](#7-javascript-performance) — **LOW-MEDIUM**\n   - 7.1 [Avoid Layout Thrashing](#71-avoid-layout-thrashing)\n   - 7.2 [Build Index Maps for Repeated Lookups](#72-build-index-maps-for-repeated-lookups)\n   - 7.3 [Cache Property Access in Loops](#73-cache-property-access-in-loops)\n   - 7.4 [Cache Repeated Function Calls](#74-cache-repeated-function-calls)\n   - 7.5 [Cache Storage API Calls](#75-cache-storage-api-calls)\n   - 7.6 [Combine Multiple Array Iterations](#76-combine-multiple-array-iterations)\n   - 7.7 [Defer Non-Critical Work with requestIdleCallback](#77-defer-non-critical-work-with-requestidlecallback)\n   - 7.8 [Early Length Check for Array Comparisons](#78-early-length-check-for-array-comparisons)\n   - 7.9 [Early Return from Functions](#79-early-return-from-functions)\n   - 7.10 [Hoist RegExp Creation](#710-hoist-regexp-creation)\n   - 7.11 [Use flatMap to Map and Filter in One Pass](#711-use-flatmap-to-map-and-filter-in-one-pass)\n   - 7.12 [Use Loop for Min/Max Instead of Sort](#712-use-loop-for-minmax-instead-of-sort)\n   - 7.13 [Use Set/Map for O(1) Lookups](#713-use-setmap-for-o1-lookups)\n   - 7.14 [Use toSorted() Instead of sort() for Immutability](#714-use-tosorted-instead-of-sort-for-immutability)\n8. [Advanced Patterns](#8-advanced-patterns) — **LOW**\n   - 8.1 [Initialize App Once, Not Per Mount](#81-initialize-app-once-not-per-mount)\n   - 8.2 [Store Event Handlers in Refs](#82-store-event-handlers-in-refs)\n   - 8.3 [useEffectEvent for Stable Callback Refs](#83-useeffectevent-for-stable-callback-refs)\n\n---\n\n## 1. Eliminating Waterfalls\n\n**Impact: CRITICAL**\n\nWaterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n### 1.1 Check Cheap Conditions Before Async Flags\n\n**Impact: HIGH (avoids unnecessary async work when a synchronous guard already fails)**\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n\n### 1.2 Defer Await Until Needed\n\n**Impact: HIGH (avoids blocking unused code paths)**\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect: blocks both branches**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct: only blocks when needed**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example: early return optimization**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n\n### 1.3 Dependency-Based Parallelization\n\n**Impact: CRITICAL (2-10× improvement)**\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect: profile waits for config unnecessarily**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct: config and profile run in parallel**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n\n### 1.4 Prevent Waterfall Chains in API Routes\n\n**Impact: CRITICAL (2-10× improvement)**\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect: config waits for auth, data waits for both**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct: auth and config start immediately**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n\n### 1.5 Promise.all() for Independent Operations\n\n**Impact: CRITICAL (2-10× improvement)**\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect: sequential execution, 3 round trips**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct: parallel execution, 1 round trip**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n\n### 1.6 Strategic Suspense Boundaries\n\n**Impact: HIGH (faster initial paint)**\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect: wrapper blocked by data fetching**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct: wrapper shows immediately, data streams in**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative: share promise across components**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n\n- SEO-critical content above the fold\n\n- Small, fast queries where suspense overhead isn't worth it\n\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n\n---\n\n## 2. Bundle Size Optimization\n\n**Impact: CRITICAL**\n\nReducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n### 2.1 Avoid Barrel File Imports\n\n**Impact: CRITICAL (200-800ms import cost, slow builds)**\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect: imports entire library**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [https://vercel.com/blog/how-we-optimized-package-imports-in-next-js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n\n### 2.2 Conditional Module Loading\n\n**Impact: HIGH (loads large data only when needed)**\n\nLoad large data or modules only when a feature is activated.\n\n**Example: lazy-load animation frames**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n\n### 2.3 Defer Non-Critical Third-Party Libraries\n\n**Impact: MEDIUM (loads after hydration)**\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect: blocks initial bundle**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct: loads after hydration**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n### 2.4 Dynamic Imports for Heavy Components\n\n**Impact: CRITICAL (directly affects TTI and LCP)**\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect: Monaco bundles with main chunk ~300KB**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct: Monaco loads on demand**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n### 2.5 Preload Based on User Intent\n\n**Impact: MEDIUM (reduces perceived latency)**\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example: preload on hover/focus**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example: preload when feature flag is enabled**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n\n---\n\n## 3. Server-Side Performance\n\n**Impact: HIGH**\n\nOptimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n### 3.1 Authenticate Server Actions Like API Routes\n\n**Impact: CRITICAL (prevents unauthorized access to server mutations)**\n\nServer Actions (functions with `\"use server\"`) are exposed as public endpoints, just like API routes. Always verify authentication and authorization **inside** each Server Action—do not rely solely on middleware, layout guards, or page-level checks, as Server Actions can be invoked directly.\n\nNext.js documentation explicitly states: \"Treat Server Actions with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation.\"\n\n**Incorrect: no authentication check**\n\n```typescript\n\"use server\";\n\nexport async function deleteUser(userId: string) {\n  // Anyone can call this! No auth check\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**Correct: authentication inside the action**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { unauthorized } from \"@/lib/errors\";\n\nexport async function deleteUser(userId: string) {\n  // Always check auth inside the action\n  const session = await verifySession();\n\n  if (!session) {\n    throw unauthorized(\"Must be logged in\");\n  }\n\n  // Check authorization too\n  if (session.user.role !== \"admin\" && session.user.id !== userId) {\n    throw unauthorized(\"Cannot delete other users\");\n  }\n\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**With input validation:**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { z } from \"zod\";\n\nconst updateProfileSchema = z.object({\n  userId: z.string().uuid(),\n  name: z.string().min(1).max(100),\n  email: z.string().email(),\n});\n\nexport async function updateProfile(data: unknown) {\n  // Validate input first\n  const validated = updateProfileSchema.parse(data);\n\n  // Then authenticate\n  const session = await verifySession();\n  if (!session) {\n    throw new Error(\"Unauthorized\");\n  }\n\n  // Then authorize\n  if (session.user.id !== validated.userId) {\n    throw new Error(\"Can only update own profile\");\n  }\n\n  // Finally perform the mutation\n  await db.user.update({\n    where: { id: validated.userId },\n    data: {\n      name: validated.name,\n      email: validated.email,\n    },\n  });\n\n  return { success: true };\n}\n```\n\nReference: [https://nextjs.org/docs/app/guides/authentication](https://nextjs.org/docs/app/guides/authentication)\n\n### 3.2 Avoid Duplicate Serialization in RSC Props\n\n**Impact: LOW (reduces network payload by avoiding duplicate serialization)**\n\nRSC→client serialization deduplicates by object reference, not value. Same reference = serialized once; new reference = serialized again. Do transformations (`.toSorted()`, `.filter()`, `.map()`) in client, not server.\n\n**Incorrect: duplicates array**\n\n```tsx\n// RSC: sends 6 strings (2 arrays × 3 items)\n<ClientList usernames={usernames} usernamesOrdered={usernames.toSorted()} />\n```\n\n**Correct: sends 3 strings**\n\n```tsx\n// RSC: send once\n<ClientList usernames={usernames} />;\n\n// Client: transform there\n(\"use client\");\nconst sorted = useMemo(() => [...usernames].sort(), [usernames]);\n```\n\n**Nested deduplication behavior:**\n\n```tsx\n// string[] - duplicates everything\nusernames={['a','b']} sorted={usernames.toSorted()} // sends 4 strings\n\n// object[] - duplicates array structure only\nusers={[{id:1},{id:2}]} sorted={users.toSorted()} // sends 2 arrays + 2 unique objects (not 4)\n```\n\nDeduplication works recursively. Impact varies by data type:\n\n- `string[]`, `number[]`, `boolean[]`: **HIGH impact** - array + all primitives fully duplicated\n\n- `object[]`: **LOW impact** - array duplicated, but nested objects deduplicated by reference\n\n**Operations breaking deduplication: create new references**\n\n- Arrays: `.toSorted()`, `.filter()`, `.map()`, `.slice()`, `[...arr]`\n\n- Objects: `{...obj}`, `Object.assign()`, `structuredClone()`, `JSON.parse(JSON.stringify())`\n\n**More examples:**\n\n```tsx\n// ❌ Bad\n<C users={users} active={users.filter(u => u.active)} />\n<C product={product} productName={product.name} />\n\n// ✅ Good\n<C users={users} />\n<C product={product} />\n// Do filtering/destructuring in client\n```\n\n**Exception:** Pass derived data when transformation is expensive or client doesn't need original.\n\n### 3.3 Cross-Request LRU Caching\n\n**Impact: HIGH (caches across requests)**\n\n`React.cache()` only works within one request. For data shared across sequential requests (user clicks button A then button B), use an LRU cache.\n\n**Implementation:**\n\n```typescript\nimport { LRUCache } from \"lru-cache\";\n\nconst cache = new LRUCache<string, any>({\n  max: 1000,\n  ttl: 5 * 60 * 1000, // 5 minutes\n});\n\nexport async function getUser(id: string) {\n  const cached = cache.get(id);\n  if (cached) return cached;\n\n  const user = await db.user.findUnique({ where: { id } });\n  cache.set(id, user);\n  return user;\n}\n\n// Request 1: DB query, result cached\n// Request 2: cache hit, no DB query\n```\n\nUse when sequential user actions hit multiple endpoints needing the same data within seconds.\n\n**With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute):** LRU caching is especially effective because multiple concurrent requests can share the same function instance and cache. This means the cache persists across requests without needing external storage like Redis.\n\n**In traditional serverless:** Each invocation runs in isolation, so consider Redis for cross-process caching.\n\nReference: [https://github.com/isaacs/node-lru-cache](https://github.com/isaacs/node-lru-cache)\n\n### 3.4 Hoist Static I/O to Module Level\n\n**Impact: HIGH (avoids repeated file/network I/O per request)**\n\nWhen loading static assets (fonts, logos, images, config files) in route handlers or server functions, hoist the I/O operation to module level. Module-level code runs once when the module is first imported, not on every request. This eliminates redundant file system reads or network fetches that would otherwise run on every invocation.\n\n**Incorrect: reads font file on every request**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\nexport async function GET(request: Request) {\n  // Runs on EVERY request - expensive!\n  const fontData = await fetch(\n    new URL('./fonts/Inter.ttf', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  const logoData = await fetch(\n    new URL('./images/logo.png', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Correct: loads once at module initialization**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\n// Module-level: runs ONCE when module is first imported\nconst fontData = fetch(\n  new URL('./fonts/Inter.ttf', import.meta.url)\n).then(res => res.arrayBuffer())\n\nconst logoData = fetch(\n  new URL('./images/logo.png', import.meta.url)\n).then(res => res.arrayBuffer())\n\nexport async function GET(request: Request) {\n  // Await the already-started promises\n  const [font, logo] = await Promise.all([fontData, logoData])\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logo} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: font }] }\n  )\n}\n```\n\n**Correct: synchronous fs at module level**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\nimport { readFileSync } from 'fs'\nimport { join } from 'path'\n\n// Synchronous read at module level - blocks only during module init\nconst fontData = readFileSync(\n  join(process.cwd(), 'public/fonts/Inter.ttf')\n)\n\nconst logoData = readFileSync(\n  join(process.cwd(), 'public/images/logo.png')\n)\n\nexport async function GET(request: Request) {\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Incorrect: reads config on every call**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nexport async function processRequest(data: Data) {\n  const config = JSON.parse(await fs.readFile(\"./config.json\", \"utf-8\"));\n  const template = await fs.readFile(\"./template.html\", \"utf-8\");\n\n  return render(template, data, config);\n}\n```\n\n**Correct: hoists config and template to module level**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nconst configPromise = fs.readFile(\"./config.json\", \"utf-8\").then(JSON.parse);\nconst templatePromise = fs.readFile(\"./template.html\", \"utf-8\");\n\nexport async function processRequest(data: Data) {\n  const [config, template] = await Promise.all([\n    configPromise,\n    templatePromise,\n  ]);\n\n  return render(template, data, config);\n}\n```\n\nWhen to use this pattern:\n\n- Loading fonts for OG image generation\n\n- Loading static logos, icons, or watermarks\n\n- Reading configuration files that don't change at runtime\n\n- Loading email templates or other static templates\n\n- Any static asset that's the same across all requests\n\nWhen not to use this pattern:\n\n- Assets that vary per request or user\n\n- Files that may change during runtime (use caching with TTL instead)\n\n- Large files that would consume too much memory if kept loaded\n\n- Sensitive data that shouldn't persist in memory\n\nWith Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute), module-level caching is especially effective because multiple concurrent requests share the same function instance. The static assets stay loaded in memory across requests without cold start penalties.\n\nIn traditional serverless, each cold start re-executes module-level code, but subsequent warm invocations reuse the loaded assets until the instance is recycled.\n\n### 3.5 Minimize Serialization at RSC Boundaries\n\n**Impact: HIGH (reduces data transfer size)**\n\nThe React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.\n\n**Incorrect: serializes all 50 fields**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser(); // 50 fields\n  return <Profile user={user} />;\n}\n\n(\"use client\");\nfunction Profile({ user }: { user: User }) {\n  return <div>{user.name}</div>; // uses 1 field\n}\n```\n\n**Correct: serializes only 1 field**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser();\n  return <Profile name={user.name} />;\n}\n\n(\"use client\");\nfunction Profile({ name }: { name: string }) {\n  return <div>{name}</div>;\n}\n```\n\n### 3.6 Parallel Data Fetching with Component Composition\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nReact Server Components execute sequentially within a tree. Restructure with composition to parallelize data fetching.\n\n**Incorrect: Sidebar waits for Page's fetch to complete**\n\n```tsx\nexport default async function Page() {\n  const header = await fetchHeader();\n  return (\n    <div>\n      <div>{header}</div>\n      <Sidebar />\n    </div>\n  );\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n```\n\n**Correct: both fetch simultaneously**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nexport default function Page() {\n  return (\n    <div>\n      <Header />\n      <Sidebar />\n    </div>\n  );\n}\n```\n\n**Alternative with children prop:**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nfunction Layout({ children }: { children: ReactNode }) {\n  return (\n    <div>\n      <Header />\n      {children}\n    </div>\n  );\n}\n\nexport default function Page() {\n  return (\n    <Layout>\n      <Sidebar />\n    </Layout>\n  );\n}\n```\n\n### 3.7 Parallel Nested Data Fetching\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nWhen fetching nested data in parallel, chain dependent fetches within each item's promise so a slow item doesn't block the rest.\n\n**Incorrect: a single slow item blocks all nested fetches**\n\n```tsx\nconst chats = await Promise.all(chatIds.map((id) => getChat(id)));\n\nconst chatAuthors = await Promise.all(\n  chats.map((chat) => getUser(chat.author)),\n);\n```\n\nIf one `getChat(id)` out of 100 is extremely slow, the authors of the other 99 chats can't start loading even though their data is ready.\n\n**Correct: each item chains its own nested fetch**\n\n```tsx\nconst chatAuthors = await Promise.all(\n  chatIds.map((id) => getChat(id).then((chat) => getUser(chat.author))),\n);\n```\n\nEach item independently chains `getChat` → `getUser`, so a slow chat doesn't block author fetches for the others.\n\n### 3.8 Per-Request Deduplication with React.cache()\n\n**Impact: MEDIUM (deduplicates within request)**\n\nUse `React.cache()` for server-side request deduplication. Authentication and database queries benefit most.\n\n**Usage:**\n\n```typescript\nimport { cache } from \"react\";\n\nexport const getCurrentUser = cache(async () => {\n  const session = await auth();\n  if (!session?.user?.id) return null;\n  return await db.user.findUnique({\n    where: { id: session.user.id },\n  });\n});\n```\n\nWithin a single request, multiple calls to `getCurrentUser()` execute the query only once.\n\n**Avoid inline objects as arguments:**\n\n`React.cache()` uses shallow equality (`Object.is`) to determine cache hits. Inline objects create new references each call, preventing cache hits.\n\n**Incorrect: always cache miss**\n\n```typescript\nconst getUser = cache(async (params: { uid: number }) => {\n  return await db.user.findUnique({ where: { id: params.uid } });\n});\n\n// Each call creates new object, never hits cache\ngetUser({ uid: 1 });\ngetUser({ uid: 1 }); // Cache miss, runs query again\n```\n\n**Correct: cache hit**\n\n```typescript\nconst params = { uid: 1 };\ngetUser(params); // Query runs\ngetUser(params); // Cache hit (same reference)\n```\n\nIf you must pass objects, pass the same reference:\n\n**Next.js-Specific Note:**\n\nIn Next.js, the `fetch` API is automatically extended with request memoization. Requests with the same URL and options are automatically deduplicated within a single request, so you don't need `React.cache()` for `fetch` calls. However, `React.cache()` is still essential for other async tasks:\n\n- Database queries (Prisma, Drizzle, etc.)\n\n- Heavy computations\n\n- Authentication checks\n\n- File system operations\n\n- Any non-fetch async work\n\nUse `React.cache()` to deduplicate these operations across your component tree.\n\nReference: [https://react.dev/reference/react/cache](https://react.dev/reference/react/cache)\n\n### 3.9 Use after() for Non-Blocking Operations\n\n**Impact: MEDIUM (faster response times)**\n\nUse Next.js's `after()` to schedule work that should execute after a response is sent. This prevents logging, analytics, and other side effects from blocking the response.\n\n**Incorrect: blocks response**\n\n```tsx\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Logging blocks the response\n  const userAgent = request.headers.get(\"user-agent\") || \"unknown\";\n  await logUserAction({ userAgent });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\n**Correct: non-blocking**\n\n```tsx\nimport { after } from \"next/server\";\nimport { headers, cookies } from \"next/headers\";\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Log after response is sent\n  after(async () => {\n    const userAgent = (await headers()).get(\"user-agent\") || \"unknown\";\n    const sessionCookie =\n      (await cookies()).get(\"session-id\")?.value || \"anonymous\";\n\n    logUserAction({ sessionCookie, userAgent });\n  });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\nThe response is sent immediately while logging happens in the background.\n\n**Common use cases:**\n\n- Analytics tracking\n\n- Audit logging\n\n- Sending notifications\n\n- Cache invalidation\n\n- Cleanup tasks\n\n**Important notes:**\n\n- `after()` runs even if the response fails or redirects\n\n- Works in Server Actions, Route Handlers, and Server Components\n\nReference: [https://nextjs.org/docs/app/api-reference/functions/after](https://nextjs.org/docs/app/api-reference/functions/after)\n\n---\n\n## 4. Client-Side Data Fetching\n\n**Impact: MEDIUM-HIGH**\n\nAutomatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n### 4.1 Deduplicate Global Event Listeners\n\n**Impact: LOW (single listener for N components)**\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect: N instances = N listeners**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct: N instances = 1 listener**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n\n### 4.2 Use Passive Event Listeners for Scrolling Performance\n\n**Impact: MEDIUM (eliminates scroll delay caused by event listeners)**\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n\n### 4.3 Use SWR for Automatic Deduplication\n\n**Impact: MEDIUM-HIGH (automatic deduplication)**\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect: no deduplication, each instance fetches**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct: multiple instances share one request**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n\n### 4.4 Version and Minimize localStorage Data\n\n**Impact: MEDIUM (prevents schema conflicts, reduces storage size)**\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n\n---\n\n## 5. Re-render Optimization\n\n**Impact: MEDIUM**\n\nReducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n### 5.1 Calculate Derived State During Rendering\n\n**Impact: MEDIUM (avoids redundant renders and state drift)**\n\nIf a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.\n\n**Incorrect: redundant state and effect**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const [fullName, setFullName] = useState(\"\");\n\n  useEffect(() => {\n    setFullName(firstName + \" \" + lastName);\n  }, [firstName, lastName]);\n\n  return <p>{fullName}</p>;\n}\n```\n\n**Correct: derive during render**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const fullName = firstName + \" \" + lastName;\n\n  return <p>{fullName}</p>;\n}\n```\n\nReference: [https://react.dev/learn/you-might-not-need-an-effect](https://react.dev/learn/you-might-not-need-an-effect)\n\n### 5.2 Defer State Reads to Usage Point\n\n**Impact: MEDIUM (avoids unnecessary subscriptions)**\n\nDon't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.\n\n**Incorrect: subscribes to all searchParams changes**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const searchParams = useSearchParams();\n\n  const handleShare = () => {\n    const ref = searchParams.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n**Correct: reads on demand, no subscription**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const handleShare = () => {\n    const params = new URLSearchParams(window.location.search);\n    const ref = params.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n### 5.3 Do not wrap a simple expression with a primitive result type in useMemo\n\n**Impact: LOW-MEDIUM (wasted computation on every render)**\n\nWhen an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.\n\nCalling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.\n\n**Incorrect:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = useMemo(() => {\n    return user.isLoading || notifications.isLoading;\n  }, [user.isLoading, notifications.isLoading]);\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n**Correct:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = user.isLoading || notifications.isLoading;\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n### 5.4 Don't Define Components Inside Components\n\n**Impact: HIGH (prevents remount on every render)**\n\nDefining a component inside another component creates a new component type on every render. React sees a different component each time and fully remounts it, destroying all state and DOM.\n\nA common reason developers do this is to access parent variables without passing props. Always pass props instead.\n\n**Incorrect: remounts on every render**\n\n```tsx\nfunction UserProfile({ user, theme }) {\n  // Defined inside to access `theme` - BAD\n  const Avatar = () => (\n    <img\n      src={user.avatarUrl}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n\n  // Defined inside to access `user` - BAD\n  const Stats = () => (\n    <div>\n      <span>{user.followers} followers</span>\n      <span>{user.posts} posts</span>\n    </div>\n  );\n\n  return (\n    <div>\n      <Avatar />\n      <Stats />\n    </div>\n  );\n}\n```\n\nEvery time `UserProfile` renders, `Avatar` and `Stats` are new component types. React unmounts the old instances and mounts new ones, losing any internal state, running effects again, and recreating DOM nodes.\n\n**Correct: pass props instead**\n\n```tsx\nfunction Avatar({ src, theme }: { src: string; theme: string }) {\n  return (\n    <img\n      src={src}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n}\n\nfunction St\n\n<!-- [TRUNCATED AT 50KB] -->",".agents/skills/vercel-react-best-practices/README.md":"# React Best Practices\n\nA structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `src/` - Build scripts and utilities\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n- **`test-cases.json`** - Test cases for LLM evaluation (generated)\n\n## Getting Started\n\n1. Install dependencies:\n\n   ```bash\n   pnpm install\n   ```\n\n2. Build AGENTS.md from rules:\n\n   ```bash\n   pnpm build\n   ```\n\n3. Validate rule files:\n\n   ```bash\n   pnpm validate\n   ```\n\n4. Extract test cases:\n   ```bash\n   pnpm extract-tests\n   ```\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `async-` for Eliminating Waterfalls (Section 1)\n   - `bundle-` for Bundle Size Optimization (Section 2)\n   - `server-` for Server-Side Performance (Section 3)\n   - `client-` for Client-Side Data Fetching (Section 4)\n   - `rerender-` for Re-render Optimization (Section 5)\n   - `rendering-` for Rendering Performance (Section 6)\n   - `js-` for JavaScript Performance (Section 7)\n   - `advanced-` for Advanced Patterns (Section 8)\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n\n## Rule File Structure\n\nEach rule file should follow this structure:\n\n````markdown\n---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description\ntags: tag1, tag2, tag3\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example\n```\n````\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example\n```\n\nOptional explanatory text after examples.\n\nReference: [Link](https://example.com)\n\n## File Naming Convention\n\n- Files starting with `_` are special (excluded from build)\n- Rule files: `area-description.md` (e.g., `async-parallel.md`)\n- Section is automatically inferred from filename prefix\n- Rules are sorted alphabetically by title within each section\n- IDs (e.g., 1.1, 1.2) are auto-generated during build\n\n## Impact Levels\n\n- `CRITICAL` - Highest priority, major performance gains\n- `HIGH` - Significant performance improvements\n- `MEDIUM-HIGH` - Moderate-high gains\n- `MEDIUM` - Moderate performance improvements\n- `LOW-MEDIUM` - Low-medium gains\n- `LOW` - Incremental improvements\n\n## Scripts\n\n- `pnpm build` - Compile rules into AGENTS.md\n- `pnpm validate` - Validate all rule files\n- `pnpm extract-tests` - Extract test cases for LLM evaluation\n- `pnpm dev` - Build and validate\n\n## Contributing\n\nWhen adding or modifying rules:\n\n1. Use the correct filename prefix for your section\n2. Follow the `_template.md` structure\n3. Include clear bad/good examples with explanations\n4. Add appropriate tags\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n6. Rules are automatically sorted by title - no need to manage numbers!\n\n## Acknowledgments\n\nOriginally created by [@shuding](https://x.com/shuding) at [Vercel](https://vercel.com).\n",".agents/skills/vercel-react-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2FSKILL.md -->",".agents/skills/vercel-react-best-practices/rules/_sections.md":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Eliminating Waterfalls (async)\n\n**Impact:** CRITICAL  \n**Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n## 2. Bundle Size Optimization (bundle)\n\n**Impact:** CRITICAL  \n**Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n## 3. Server-Side Performance (server)\n\n**Impact:** HIGH  \n**Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n## 4. Client-Side Data Fetching (client)\n\n**Impact:** MEDIUM-HIGH  \n**Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n## 5. Re-render Optimization (rerender)\n\n**Impact:** MEDIUM  \n**Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n## 6. Rendering Performance (rendering)\n\n**Impact:** MEDIUM  \n**Description:** Optimizing the rendering process reduces the work the browser needs to do.\n\n## 7. JavaScript Performance (js)\n\n**Impact:** LOW-MEDIUM  \n**Description:** Micro-optimizations for hot paths can add up to meaningful improvements.\n\n## 8. Advanced Patterns (advanced)\n\n**Impact:** LOW  \n**Description:** Advanced patterns for specific cases that require careful implementation.\n",".agents/skills/vercel-react-best-practices/rules/_template.md":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description of impact (e.g., \"20-50% improvement\")\ntags: tag1, tag2\n---\n\n## Rule Title Here\n\n**Impact: MEDIUM (optional impact description)**\n\nBrief explanation of the rule and why it matters. This should be clear and concise, explaining the performance implications.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example here\nconst bad = example();\n```\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example here\nconst good = example();\n```\n\nReference: [Link to documentation or resource](https://example.com)\n",".agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md":"---\ntitle: Store Event Handlers in Refs\nimpact: LOW\nimpactDescription: stable subscriptions\ntags: advanced, hooks, refs, event-handlers, optimization\n---\n\n## Store Event Handlers in Refs\n\nStore callbacks in refs when used in effects that shouldn't re-subscribe on callback changes.\n\n**Incorrect (re-subscribes on every render):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  useEffect(() => {\n    window.addEventListener(event, handler);\n    return () => window.removeEventListener(event, handler);\n  }, [event, handler]);\n}\n```\n\n**Correct (stable subscription):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const handlerRef = useRef(handler);\n  useEffect(() => {\n    handlerRef.current = handler;\n  }, [handler]);\n\n  useEffect(() => {\n    const listener = (e) => handlerRef.current(e);\n    window.addEventListener(event, listener);\n    return () => window.removeEventListener(event, listener);\n  }, [event]);\n}\n```\n\n**Alternative: use `useEffectEvent` if you're on latest React:**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const onEvent = useEffectEvent(handler);\n\n  useEffect(() => {\n    window.addEventListener(event, onEvent);\n    return () => window.removeEventListener(event, onEvent);\n  }, [event]);\n}\n```\n\n`useEffectEvent` provides a cleaner API for the same pattern: it creates a stable function reference that always calls the latest version of the handler.\n",".agents/skills/vercel-react-best-practices/rules/advanced-init-once.md":"---\ntitle: Initialize App Once, Not Per Mount\nimpact: LOW-MEDIUM\nimpactDescription: avoids duplicate init in development\ntags: initialization, useEffect, app-startup, side-effects\n---\n\n## Initialize App Once, Not Per Mount\n\nDo not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.\n\n**Incorrect (runs twice in dev, re-runs on remount):**\n\n```tsx\nfunction Comp() {\n  useEffect(() => {\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\n**Correct (once per app load):**\n\n```tsx\nlet didInit = false;\n\nfunction Comp() {\n  useEffect(() => {\n    if (didInit) return;\n    didInit = true;\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\nReference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)\n",".agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md":"---\ntitle: useEffectEvent for Stable Callback Refs\nimpact: LOW\nimpactDescription: prevents effect re-runs\ntags: advanced, hooks, useEffectEvent, refs, optimization\n---\n\n## useEffectEvent for Stable Callback Refs\n\nAccess latest values in callbacks without adding them to dependency arrays. Prevents effect re-runs while avoiding stale closures.\n\n**Incorrect (effect re-runs on every callback change):**\n\n```tsx\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearch(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query, onSearch]);\n}\n```\n\n**Correct (using React's useEffectEvent):**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n  const onSearchEvent = useEffectEvent(onSearch);\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearchEvent(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query]);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/async-api-routes.md":"---\ntitle: Prevent Waterfall Chains in API Routes\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: api-routes, server-actions, waterfalls, parallelization\n---\n\n## Prevent Waterfall Chains in API Routes\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect (config waits for auth, data waits for both):**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct (auth and config start immediately):**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n",".agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md":"---\ntitle: Check Cheap Conditions Before Async Flags\nimpact: HIGH\nimpactDescription: avoids unnecessary async work when a synchronous guard already fails\ntags: async, await, feature-flags, short-circuit, conditional\n---\n\n## Check Cheap Conditions Before Async Flags\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n",".agents/skills/vercel-react-best-practices/rules/async-defer-await.md":"---\ntitle: Defer Await Until Needed\nimpact: HIGH\nimpactDescription: avoids blocking unused code paths\ntags: async, await, conditional, optimization\n---\n\n## Defer Await Until Needed\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect (blocks both branches):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct (only blocks when needed):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example (early return optimization):**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n",".agents/skills/vercel-react-best-practices/rules/async-dependencies.md":"---\ntitle: Dependency-Based Parallelization\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, dependencies, better-all\n---\n\n## Dependency-Based Parallelization\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect (profile waits for config unnecessarily):**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct (config and profile run in parallel):**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n",".agents/skills/vercel-react-best-practices/rules/async-parallel.md":"---\ntitle: Promise.all() for Independent Operations\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, promises, waterfalls\n---\n\n## Promise.all() for Independent Operations\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect (sequential execution, 3 round trips):**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct (parallel execution, 1 round trip):**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n",".agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md":"---\ntitle: Strategic Suspense Boundaries\nimpact: HIGH\nimpactDescription: faster initial paint\ntags: async, suspense, streaming, layout-shift\n---\n\n## Strategic Suspense Boundaries\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect (wrapper blocked by data fetching):**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct (wrapper shows immediately, data streams in):**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative (share promise across components):**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n- SEO-critical content above the fold\n- Small, fast queries where suspense overhead isn't worth it\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n",".agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md":"---\ntitle: Avoid Barrel File Imports\nimpact: CRITICAL\nimpactDescription: 200-800ms import cost, slow builds\ntags: bundle, imports, tree-shaking, barrel-files, performance\n---\n\n## Avoid Barrel File Imports\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect (imports entire library):**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```js\n// next.config.js - automatically optimizes barrel imports at build time\nmodule.exports = {\n  experimental: {\n    optimizePackageImports: [\"lucide-react\", \"@mui/material\"],\n  },\n};\n```\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [How we optimized package imports in Next.js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n",".agents/skills/vercel-react-best-practices/rules/bundle-conditional.md":"---\ntitle: Conditional Module Loading\nimpact: HIGH\nimpactDescription: loads large data only when needed\ntags: bundle, conditional-loading, lazy-loading\n---\n\n## Conditional Module Loading\n\nLoad large data or modules only when a feature is activated.\n\n**Example (lazy-load animation frames):**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n",".agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md":"---\ntitle: Defer Non-Critical Third-Party Libraries\nimpact: MEDIUM\nimpactDescription: loads after hydration\ntags: bundle, third-party, analytics, defer\n---\n\n## Defer Non-Critical Third-Party Libraries\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect (blocks initial bundle):**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct (loads after hydration):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md":"---\ntitle: Dynamic Imports for Heavy Components\nimpact: CRITICAL\nimpactDescription: directly affects TTI and LCP\ntags: bundle, dynamic-import, code-splitting, next-dynamic\n---\n\n## Dynamic Imports for Heavy Components\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect (Monaco bundles with main chunk ~300KB):**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct (Monaco loads on demand):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/bundle-preload.md":"---\ntitle: Preload Based on User Intent\nimpact: MEDIUM\nimpactDescription: reduces perceived latency\ntags: bundle, preload, user-intent, hover\n---\n\n## Preload Based on User Intent\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example (preload on hover/focus):**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example (preload when feature flag is enabled):**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n",".agents/skills/vercel-react-best-practices/rules/client-event-listeners.md":"---\ntitle: Deduplicate Global Event Listeners\nimpact: LOW\nimpactDescription: single listener for N components\ntags: client, swr, event-listeners, subscription\n---\n\n## Deduplicate Global Event Listeners\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect (N instances = N listeners):**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct (N instances = 1 listener):**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md":"---\ntitle: Version and Minimize localStorage Data\nimpact: MEDIUM\nimpactDescription: prevents schema conflicts, reduces storage size\ntags: client, localStorage, storage, versioning, data-minimization\n---\n\n## Version and Minimize localStorage Data\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n",".agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md":"---\ntitle: Use Passive Event Listeners for Scrolling Performance\nimpact: MEDIUM\nimpactDescription: eliminates scroll delay caused by event listeners\ntags: client, event-listeners, scrolling, performance, touch, wheel\n---\n\n## Use Passive Event Listeners for Scrolling Performance\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n",".agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md":"---\ntitle: Use SWR for Automatic Deduplication\nimpact: MEDIUM-HIGH\nimpactDescription: automatic deduplication\ntags: client, swr, deduplication, data-fetching\n---\n\n## Use SWR for Automatic Deduplication\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect (no deduplication, each instance fetches):**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct (multiple instances share one request):**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n",".agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md":"---\ntitle: Avoid Layout Thrashing\nimpact: MEDIUM\nimpactDescription: prevents forced synchronous layouts and reduces performance bottlenecks\ntags: javascript, dom, css, performance, reflow, layout-thrashing\n---\n\n## Avoid Layout Thrashing\n\nAvoid interleaving style writes with layout reads. When you read a layout property (like `offsetWidth`, `getBoundingClientRect()`, or `getComputedStyle()`) between style changes, the browser is forced to trigger a synchronous reflow.\n\n**This is OK (browser batches style changes):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Each line invalidates style, but browser batches the recalculation\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n}\n```\n\n**Incorrect (interleaved reads and writes force reflows):**\n\n```typescript\nfunction layoutThrashing(element: HTMLElement) {\n  element.style.width = \"100px\";\n  const width = element.offsetWidth; // Forces reflow\n  element.style.height = \"200px\";\n  const height = element.offsetHeight; // Forces another reflow\n}\n```\n\n**Correct (batch writes, then read once):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Batch all writes together\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n\n  // Read after all writes are done (single reflow)\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**Correct (batch reads, then writes):**\n\n```typescript\nfunction avoidThrashing(element: HTMLElement) {\n  // Read phase - all layout queries first\n  const rect1 = element.getBoundingClientRect();\n  const offsetWidth = element.offsetWidth;\n  const offsetHeight = element.offsetHeight;\n\n  // Write phase - all style changes after\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n}\n```\n\n**Better: use CSS classes**\n\n```css\n.highlighted-box {\n  width: 100px;\n  height: 200px;\n  background-color: blue;\n  border: 1px solid black;\n}\n```\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  element.classList.add(\"highlighted-box\");\n\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**React example:**\n\n```tsx\n// Incorrect: interleaving style changes with layout queries\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    if (ref.current && isHighlighted) {\n      ref.current.style.width = \"100px\";\n      const width = ref.current.offsetWidth; // Forces layout\n      ref.current.style.height = \"200px\";\n    }\n  }, [isHighlighted]);\n\n  return <div ref={ref}>Content</div>;\n}\n\n// Correct: toggle class\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  return <div className={isHighlighted ? \"highlighted-box\" : \"\"}>Content</div>;\n}\n```\n\nPrefer CSS classes over inline styles when possible. CSS files are cached by the browser, and classes provide better separation of concerns and are easier to maintain.\n\nSee [this gist](https://gist.github.com/paulirish/5d52fb081b3570c81e3a) and [CSS Triggers](https://csstriggers.com/) for more information on layout-forcing operations.\n",".agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md":"---\ntitle: Cache Repeated Function Calls\nimpact: MEDIUM\nimpactDescription: avoid redundant computation\ntags: javascript, cache, memoization, performance\n---\n\n## Cache Repeated Function Calls\n\nUse a module-level Map to cache function results when the same function is called repeatedly with the same inputs during render.\n\n**Incorrect (redundant computation):**\n\n```typescript\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // slugify() called 100+ times for same project names\n        const slug = slugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Correct (cached results):**\n\n```typescript\n// Module-level cache\nconst slugifyCache = new Map<string, string>()\n\nfunction cachedSlugify(text: string): string {\n  if (slugifyCache.has(text)) {\n    return slugifyCache.get(text)!\n  }\n  const result = slugify(text)\n  slugifyCache.set(text, result)\n  return result\n}\n\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // Computed only once per unique project name\n        const slug = cachedSlugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Simpler pattern for single-value functions:**\n\n```typescript\nlet isLoggedInCache: boolean | null = null;\n\nfunction isLoggedIn(): boolean {\n  if (isLoggedInCache !== null) {\n    return isLoggedInCache;\n  }\n\n  isLoggedInCache = document.cookie.includes(\"auth=\");\n  return isLoggedInCache;\n}\n\n// Clear cache when auth changes\nfunction onAuthChange() {\n  isLoggedInCache = null;\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\nReference: [How we made the Vercel Dashboard twice as fast](https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast)\n",".agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md":"---\ntitle: Cache Property Access in Loops\nimpact: LOW-MEDIUM\nimpactDescription: reduces lookups\ntags: javascript, loops, optimization, caching\n---\n\n## Cache Property Access in Loops\n\nCache object property lookups in hot paths.\n\n**Incorrect (3 lookups × N iterations):**\n\n```typescript\nfor (let i = 0; i < arr.length; i++) {\n  process(obj.config.settings.value);\n}\n```\n\n**Correct (1 lookup total):**\n\n```typescript\nconst value = obj.config.settings.value;\nconst len = arr.length;\nfor (let i = 0; i < len; i++) {\n  process(value);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-cache-storage.md":"---\ntitle: Cache Storage API Calls\nimpact: LOW-MEDIUM\nimpactDescription: reduces expensive I/O\ntags: javascript, localStorage, storage, caching, performance\n---\n\n## Cache Storage API Calls\n\n`localStorage`, `sessionStorage`, and `document.cookie` are synchronous and expensive. Cache reads in memory.\n\n**Incorrect (reads storage on every call):**\n\n```typescript\nfunction getTheme() {\n  return localStorage.getItem(\"theme\") ?? \"light\";\n}\n// Called 10 times = 10 storage reads\n```\n\n**Correct (Map cache):**\n\n```typescript\nconst storageCache = new Map<string, string | null>();\n\nfunction getLocalStorage(key: string) {\n  if (!storageCache.has(key)) {\n    storageCache.set(key, localStorage.getItem(key));\n  }\n  return storageCache.get(key);\n}\n\nfunction setLocalStorage(key: string, value: string) {\n  localStorage.setItem(key, value);\n  storageCache.set(key, value); // keep cache in sync\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\n**Cookie caching:**\n\n```typescript\nlet cookieCache: Record<string, string> | null = null;\n\nfunction getCookie(name: string) {\n  if (!cookieCache) {\n    cookieCache = Object.fromEntries(\n      document.cookie.split(\"; \").map((c) => c.split(\"=\")),\n    );\n  }\n  return cookieCache[name];\n}\n```\n\n**Important (invalidate on external changes):**\n\nIf storage can change externally (another tab, server-set cookies), invalidate cache:\n\n```typescript\nwindow.addEventListener(\"storage\", (e) => {\n  if (e.key) storageCache.delete(e.key);\n});\n\ndocument.addEventListener(\"visibilitychange\", () => {\n  if (document.visibilityState === \"visible\") {\n    storageCache.clear();\n  }\n});\n```\n",".agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md":"---\ntitle: Combine Multiple Array Iterations\nimpact: LOW-MEDIUM\nimpactDescription: reduces iterations\ntags: javascript, arrays, loops, performance\n---\n\n## Combine Multiple Array Iterations\n\nMultiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.\n\n**Incorrect (3 iterations):**\n\n```typescript\nconst admins = users.filter((u) => u.isAdmin);\nconst testers = users.filter((u) => u.isTester);\nconst inactive = users.filter((u) => !u.isActive);\n```\n\n**Correct (1 iteration):**\n\n```typescript\nconst admins: User[] = [];\nconst testers: User[] = [];\nconst inactive: User[] = [];\n\nfor (const user of users) {\n  if (user.isAdmin) admins.push(user);\n  if (user.isTester) testers.push(user);\n  if (!user.isActive) inactive.push(user);\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-early-exit.md":"---\ntitle: Early Return from Functions\nimpact: LOW-MEDIUM\nimpactDescription: avoids unnecessary computation\ntags: javascript, functions, optimization, early-return\n---\n\n## Early Return from Functions\n\nReturn early when result is determined to skip unnecessary processing.\n\n**Incorrect (processes all items even after finding answer):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  let hasError = false;\n  let errorMessage = \"\";\n\n  for (const user of users) {\n    if (!user.email) {\n      hasError = true;\n      errorMessage = \"Email required\";\n    }\n    if (!user.name) {\n      hasError = true;\n      errorMessage = \"Name required\";\n    }\n    // Continues checking all users even after error found\n  }\n\n  return hasError ? { valid: false, error: errorMessage } : { valid: true };\n}\n```\n\n**Correct (returns immediately on first error):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  for (const user of users) {\n    if (!user.email) {\n      return { valid: false, error: \"Email required\" };\n    }\n    if (!user.name) {\n      return { valid: false, error: \"Name required\" };\n    }\n  }\n\n  return { valid: true };\n}\n```\n",".agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md":"---\ntitle: Use flatMap to Map and Filter in One Pass\nimpact: LOW-MEDIUM\nimpactDescription: eliminates intermediate array\ntags: javascript, arrays, flatMap, filter, performance\n---\n\n## Use flatMap to Map and Filter in One Pass\n\n**Impact: LOW-MEDIUM (eliminates intermediate array)**\n\nChaining `.map().filter(Boolean)` creates an intermediate array and iterates twice. Use `.flatMap()` to transform and filter in a single pass.\n\n**Incorrect (2 iterations, intermediate array):**\n\n```typescript\nconst userNames = users\n  .map((user) => (user.isActive ? user.name : null))\n  .filter(Boolean);\n```\n\n**Correct (1 iteration, no intermediate array):**\n\n```typescript\nconst userNames = users.flatMap((user) => (user.isActive ? [user.name] : []));\n```\n\n**More examples:**\n\n```typescript\n// Extract valid emails from responses\n// Before\nconst emails = responses\n  .map((r) => (r.success ? r.data.email : null))\n  .filter(Boolean);\n\n// After\nconst emails = responses.flatMap((r) => (r.success ? [r.data.email] : []));\n\n// Parse and filter valid numbers\n// Before\nconst numbers = strings.map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));\n\n// After\nconst numbers = strings.flatMap((s) => {\n  const n = parseInt(s, 10);\n  return isNaN(n) ? [] : [n];\n});\n```\n\n**When to use:**\n\n- Transforming items while filtering some out\n- Conditional mapping where some inputs produce no output\n- Parsing/validating where invalid inputs should be skipped\n",".agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md":"---\ntitle: Hoist RegExp Creation\nimpact: LOW-MEDIUM\nimpactDescription: avoids recreation\ntags: javascript, regexp, optimization, memoization\n---\n\n## Hoist RegExp Creation\n\nDon't create RegExp inside render. Hoist to module scope or memoize with `useMemo()`.\n\n**Incorrect (new RegExp every render):**\n\n```tsx\nfunction Highlighter({ text, query }: Props) {\n  const regex = new RegExp(`(${query})`, 'gi')\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Correct (memoize or hoist):**\n\n```tsx\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nfunction Highlighter({ text, query }: Props) {\n  const regex = useMemo(\n    () => new RegExp(`(${escapeRegex(query)})`, 'gi'),\n    [query]\n  )\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Warning (global regex has mutable state):**\n\nGlobal regex (`/g`) has mutable `lastIndex` state:\n\n```typescript\nconst regex = /foo/g;\nregex.test(\"foo\"); // true, lastIndex = 3\nregex.test(\"foo\"); // false, lastIndex = 0\n```\n",".agents/skills/vercel-react-best-practices/rules/js-index-maps.md":"---\ntitle: Build Index Maps for Repeated Lookups\nimpact: LOW-MEDIUM\nimpactDescription: 1M ops to 2K ops\ntags: javascript, map, indexing, optimization, performance\n---\n\n## Build Index Maps for Repeated Lookups\n\nMultiple `.find()` calls by the same key should use a Map.\n\n**Incorrect (O(n) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  return orders.map((order) => ({\n    ...order,\n    user: users.find((u) => u.id === order.userId),\n  }));\n}\n```\n\n**Correct (O(1) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  const userById = new Map(users.map((u) => [u.id, u]));\n\n  return orders.map((order) => ({\n    ...order,\n    user: userById.get(order.userId),\n  }));\n}\n```\n\nBuild map once (O(n)), then all lookups are O(1).\nFor 1000 orders × 1000 users: 1M ops → 2K ops.\n",".agents/skills/vercel-react-best-practices/rules/js-length-check-first.md":"---\ntitle: Early Length Check for Array Comparisons\nimpact: MEDIUM-HIGH\nimpactDescription: avoids expensive operations when lengths differ\ntags: javascript, arrays, performance, optimization, comparison\n---\n\n## Early Length Check for Array Comparisons\n\nWhen comparing arrays with expensive operations (sorting, deep equality, serialization), check lengths first. If lengths differ, the arrays cannot be equal.\n\nIn real-world applications, this optimization is especially valuable when the comparison runs in hot paths (event handlers, render loops).\n\n**Incorrect (always runs expensive comparison):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Always sorts and joins, even when lengths differ\n  return current.sort().join() !== original.sort().join();\n}\n```\n\nTwo O(n log n) sorts run even when `current.length` is 5 and `original.length` is 100. There is also overhead of joining the arrays and comparing the strings.\n\n**Correct (O(1) length check first):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Early return if lengths differ\n  if (current.length !== original.length) {\n    return true;\n  }\n  // Only sort when lengths match\n  const currentSorted = current.toSorted();\n  const originalSorted = original.toSorted();\n  for (let i = 0; i < currentSorted.length; i++) {\n    if (currentSorted[i] !== originalSorted[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n```\n\nThis new approach is more efficient because:\n\n- It avoids the overhead of sorting and joining the arrays when lengths differ\n- It avoids consuming memory for the joined strings (especially important for large arrays)\n- It avoids mutating the original arrays\n- It returns early when a difference is found\n",".agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-min-max-loop.md -->",".agents/skills/vercel-react-best-practices/rules/js-request-idle-callback.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-request-idle-callback.md -->",".agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-set-map-lookups.md -->",".agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-tosorted-immutable.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-activity.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-activity.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-conditional-render.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-content-visibility.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hoist-jsx.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-resource-hints.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-script-defer-async.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-svg-precision.md -->",".agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-usetransition-loading.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-defer-reads.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-dependencies.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-functional-setstate.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-lazy-state-init.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo-with-default-value.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-memo.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-move-effect-to-event.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-no-inline-components.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-split-combined-hooks.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-transitions.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-transitions.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-deferred-value.md -->",".agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->",".agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-after-nonblocking.md -->",".agents/skills/vercel-react-best-practices/rules/server-auth-actions.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-auth-actions.md -->",".agents/skills/vercel-react-best-practices/rules/server-cache-lru.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-lru.md -->",".agents/skills/vercel-react-best-practices/rules/server-cache-react.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-react.md -->",".agents/skills/vercel-react-best-practices/rules/server-dedup-props.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-dedup-props.md -->",".agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-hoist-static-io.md -->",".agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-fetching.md -->",".agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-nested-fetching.md -->",".agents/skills/vercel-react-best-practices/rules/server-serialization.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-serialization.md -->",".github/copilot-instructions.md":"# GitHub Copilot Instruction: Code Review and Optimization\n\n## Role and Objective\n\nYou are a **top-tier software architect and performance optimization expert**.  \nYour goal is to help me — a senior TypeScript full-stack engineer — elevate the quality of my code to a new level.  \nWhen reviewing my code, **do not explain basic concepts**. I need **precise, deep, and forward-thinking insights**.\n\nYour core mission is **optimization**, including but not limited to:\n\n- **Performance improvement**: Identify and optimize performance bottlenecks, reduce unnecessary computation and resource consumption.\n- **Code refactoring**: Suggest more elegant and efficient implementations to improve code structure.\n- **Design patterns**: Identify opportunities to apply or refine design patterns to enhance scalability and maintainability.\n- **Best practices**: Ensure the code adheres to the latest best practices for the TypeScript ecosystem (Node.js, React, API layers, build pipelines).\n- **Potential risks**: Anticipate and highlight deep issues such as concurrency problems, security vulnerabilities, or resource leaks.\n\n---\n\n## Review Perspective and Principles\n\n1. **High-Standard Review**  \n   Review the code as if it were going to **production for millions of users** and needs to be **maintained long-term**.\n\n2. **Deep Analysis, Not Surface Advice**  \n   Don’t focus on trivial issues like typos or syntax sugar.  \n   Instead, explain **why** a refactor or change matters — e.g.:\n\n   > “Switching from a synchronous file read to `fs.promises` can free the event loop, improving throughput under load.”\n\n3. **Performance First**\n   - Evaluate time and space complexity; suggest algorithmic or structural improvements.\n   - Examine I/O, database queries, and network calls for efficiency — recommend batching, caching, or async processing.\n   - Recommend appropriate data structures or API strategies for scalability (e.g., pagination, streaming responses).\n\n4. **Architecture and Design**\n   - Follow **SOLID** principles. Explicitly identify violations and propose refactoring approaches.\n   - Encourage **composition over inheritance** and **dependency injection**.\n   - Suggest modularization and clear separation between layers (e.g., API, service, repository, UI).\n\n5. **Code Style and Standards**\n   - Code must be clear, consistent, and self-explanatory.\n   - Follow the project’s existing conventions unless the change brings substantial clarity or performance gain.\n   - For complex logic, suggest adding comments explaining the **rationale (“why”)**, not just the **action (“what”)**.\n\n---\n\n## Specific Instructions\n\n- **When reviewing code, include the optimized code snippet directly**, with short comments highlighting key changes and their reasoning.\n- **If you find potential bugs or unhandled edge cases**, explicitly point them out and provide a fix suggestion.\n- **Avoid subjective stylistic comments** unless they impact clarity, performance, or maintainability.\n- **When I ask “Can this code be optimized?”**, provide a holistic evaluation covering performance, readability, scalability, and maintainability.\n\n---\n\nAt the end of every response, please add:\n\n> “AI-generated suggestions may contain errors; use your own judgment when applying them.”\n","AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nMediaGo is a pnpm/turborepo monorepo registered in `one.manifest.toml`. Feature apps live in `apps/` (`core` for the Go backend, `electron` for desktop, `ui` for the shared frontend, `player-ui` for playback). Reusable logic stays in `packages/`, including `common`, `core-sdk`, `electron-preload`, and `tooling`. Long-form docs and assets sit in `docs/`, `images/`, and `docker/`. End-to-end checks live in `tests/`.\n\n## Tooling and Script Placement\n\nRepository automation is centralized in `packages/tooling`.\n\n- Do not create app-local or package-local `scripts/` directories.\n- Put build, development, release, migration, code-generation, and verification entrypoints under `packages/tooling/src/<domain>/` and invoke them from `Taskfile.yml` or package scripts.\n- Before adding a new tooling entrypoint, search `packages/tooling` and extend an existing domain module when practical.\n- Keep product runtime code in its owning app or package; this rule applies to repository automation and one-off executable tooling, not application features.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Its contents are packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Build, Test, and Development Commands\n\nUse One CLI 0.1.24 or newer. On a new clone, review `mise.toml`, run `one mise trust`, `one mise install`, then `one setup`. Use `one dev` for desktop + Web, or `one dev:web` / `one dev:electron` for one surface. Use `one build -p core`, `one build -p electron`, `one build -p docs`, and `one build:docker` for the corresponding targets. `one check` runs lint, formatting and type checks; `one test` runs the TypeScript and Go suites. `mise.toml` pins tool versions and delegates product workflows to the existing Taskfile; CI continues to use Task. After changing project scripts, run `one init mise`, review the diff, and run `pnpm one:verify`. Keep `pnpm format` as the formatting command before commits.\n\n## Coding Style & Naming Conventions\n\nTarget modern TypeScript with ES modules, two-space indentation, UTF-8, and LF endings per `.editorconfig`. Components, hooks, and services adopt PascalCase (e.g. `UserPreferencesPanel.tsx`). Utilities and helpers stay camelCase, and constants use SCREAMING_SNAKE_CASE. Always run `pnpm format` before committing; reserve comments for clarifying complex logic.\n\n## UI Interaction and Cursor Semantics\n\nMouse cursors must communicate what an element will do. Define cursor behavior in shared UI primitives whenever possible so every consumer inherits it.\n\n| Interaction                                                                      | Cursor                                    |\n| -------------------------------------------------------------------------------- | ----------------------------------------- |\n| Enabled buttons, links, menu items, select options, toggles, and clickable cards | pointer                                   |\n| Disabled or unavailable controls                                                 | not-allowed                               |\n| Editable text                                                                    | text                                      |\n| Draggable content                                                                | grab, changing to grabbing while dragging |\n| Horizontal or vertical resize handles                                            | col-resize or row-resize                  |\n| Work continuing in the background                                                | progress                                  |\n| Blocking work where the UI cannot accept input                                   | wait                                      |\n| Non-interactive content                                                          | default                                   |\n\nDo not use cursor-default on an enabled interactive element. Avoid pointer-events: none on disabled controls when it prevents the not-allowed cursor from being shown; use native disabled, aria-disabled, or the component library's disabled state to block the action. Cursor styling does not replace semantic HTML, keyboard interaction, focus states, or accessible names.\n\n## Testing Guidelines\n\nTypeScript suites use Vitest through `one test:ts`; Go suites use `one test:go`. Integration and Playwright checks use `one test:integration` and `one test:e2e`. Name files descriptively like `download.queue.integration.test.ts`. Mock external services, prefer shared fixtures in `tests/fixtures/`, and cover happy path, recovery, and edge behaviors when touching runtime code.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commits (e.g. `feat(frontend-main): add download queue UI`) and use `pnpm commit` (Commitizen) to stay compliant. Pull requests should summarize the change, link issues with `Closes #123`, note local test runs (`pnpm test`), and attach screenshots or recordings for UI updates. Call out new environment variables, migrations, or follow-up tasks so reviewers can reproduce the setup quickly.\n","CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMediaGo is a cross-platform video downloader supporting m3u8/HLS streams. The codebase is a pnpm monorepo with two delivery products:\n\n1. **Desktop app** (`apps/electron` + `apps/ui`) — Electron wrapper that launches Go Core as a subprocess\n2. **Docker Web app** (`apps/core` + `apps/ui`) — Docker runs Go Core directly; the main UI is embedded in the Core binary\n\nThe Player UI (`apps/player-ui`) is also embedded in every Core binary. Electron Core serves `/player/` but suppresses the embedded main UI because Electron owns the main renderer.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Everything placed there can be packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Common Commands\n\n```bash\npnpm install                # Install all dependencies (run once per clone)\ntask dev:electron           # Start Electron desktop dev environment (HMR)\ntask dev:web                # Start Web Core directly plus the Vite UI\ntask build:electron         # Production build for Electron\ntask build:docker           # Build the deployable Web image\npnpm core:dev               # Start Go Core dev server (port 9900)\npnpm core:build             # Compile Go Core binary\npnpm player:dev             # Start Player dev (alias for core:dev)\npnpm player:build           # Build Player (alias for core:build)\npnpm deps:download          # Download third-party tools (ffmpeg, BBDown, etc.)\npnpm deps:download:all      # Download tools for all platforms\npnpm lint                   # Lint with oxlint\npnpm lint:fix               # Auto-fix lint issues\npnpm format                 # Format with oxfmt\npnpm format:check           # Check formatting without modifying\npnpm check                  # Full check: lint + format + type check\npnpm type:check             # TypeScript type checking via Turborepo\npnpm pack:electron          # Build + package Electron distributable\n```\n\nCommits use Conventional Commits format (e.g. `feat(electron): add queue UI`).\n\n## Architecture\n\n### Monorepo Layout\n\n**Apps:**\n\n- **`apps/core/`** — Go (Gin) REST API backend for download orchestration. Runs on port 9900. Uses SQLite (GORM), SSE for real-time events, PTY for capturing download tool output, and embeds both browser UIs through `//go:embed`.\n- **`apps/electron/`** — Electron main process (tsdown build, inversify DI). Launches Go Core via `@mediago/service-runner`.\n- **`apps/ui/`** — Shared React 19 frontend (Vite 8, Ant Design 6, Zustand, TailwindCSS 4, i18next). Used by both Electron and server targets.\n- **`apps/player-ui/`** — React 19 frontend for player (Vite 8, shadcn/ui, video.js, TailwindCSS 4). Built assets are embedded into Go Core via `//go:embed`.\n\n**Packages:**\n\n- **`packages/common/`** — Platform-agnostic shared types, constants, and utilities\n- **`packages/core-sdk/`** — TypeScript SDK for Go Core REST API (Axios, SSE via eventsource)\n- **`packages/electron-preload/`** — Electron preload scripts for IPC bridge\n- **`packages/browser-extension/`** — Browser extension (Lit web components)\n- **`docs/`** — VitePress documentation (Chinese, English, Japanese)\n\n### Multi-Target Build\n\nThe `APP_TARGET` env var (`electron` | `server`) controls which backend the UI builds against. Both targets share the same React UI but connect via different transports:\n\n- **Electron**: IPC bridge (preload) + Go Core direct (via `@mediago/core-sdk`)\n- **Server/Web**: HTTP/WebSocket + Go Core direct (via `@mediago/core-sdk`)\n\nThe UI adapter layer (`apps/ui/src/hooks/adapters/`) abstracts this: `electron.ts` provides IPC bridge in desktop mode, `platform-stubs.ts` provides no-op stubs in web mode, and `index.ts` exports `platformApi` which selects the appropriate adapter.\n\n### Key Patterns\n\n- **Go Core lifecycle**: Electron launches Core via `@mediago/service-runner`; Task and Docker execute Core directly for Web usage\n- **Dependency Injection**: inversify with `@inversifyjs/binding-decorators` in Electron backend\n- **State Management**: Zustand in the UI\n- **Real-time events**: Go Core emits SSE events (`/api/events`); the UI's `api/events.ts` subscribes and dispatches to React via a listener pattern\n- **TypeScript**: Strict mode with experimental decorators and decorator metadata enabled\n- **Module format**: ES Modules everywhere\n\n## Tooling\n\n- **Package manager**: pnpm 10.15.0 (enforced via `packageManager` field)\n- **Build orchestration**: Turborepo\n- **App bundling**: tsdown for Node/Electron, Vite 8 for UI apps\n- **Go builds**: Task and pnpm invoke `packages/tooling/src/core-build/cli.ts`, which orchestrates `go build` / `go run` in `apps/core`\n- **Linter**: oxlint (config in `.oxlintrc.json`)\n- **Formatter**: oxfmt (config in `.oxfmtrc.json`)\n- **Pre-commit**: husky + lint-staged (runs oxlint --fix + oxfmt --write on staged files)\n- **Electron packaging**: electron-builder\n\n## Style Conventions\n\n- TypeScript, ES modules, 2-space indentation, UTF-8, LF endings\n- Components: PascalCase. Utilities: camelCase. Constants: SCREAMING_SNAKE_CASE\n- UI port: 8555 (strict). Go Core port: 9900. Player UI port: 8556\n","docs/api.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=docs%2Fapi.md -->","docs/skills.md":"---\nlayout: doc\noutline: deep\n---\n\n# OpenClaw Skill\n\nMediaGo 提供了 [OpenClaw](https://docs.openclaw.ai) Skill，让你可以在 AI 编程助手中通过自然语言下载视频。通过 [ClawHub](https://clawhub.com) 安装即可使用。\n\n## 前提条件\n\n- 已安装并运行 MediaGo（桌面客户端或 Docker）\n- 已安装支持 OpenClaw 的 AI 编程助手（如 Claude Code、Cursor 等）\n\n## 安装 Skill\n\n在终端中执行以下命令，从 ClawHub 安装 mediago skill：\n\n```bash\nnpx clawhub@latest install mediago\n```\n\n## 初始化配置\n\n安装完成后，需要告诉 AI 助手你的 MediaGo 服务地址。\n\n### 桌面客户端\n\n在 AI 助手中直接发送：\n\n```\n设置 mediago 地址为 http://192.168.x.x:39719\n```\n\n::: tip\n你可以在 MediaGo 桌面客户端的 **设置 → Skills 设置** 中找到已生成的配置命令，一键复制粘贴即可。\n:::\n\n### Docker\n\nDocker 部署启用了 API 认证，需要同时配置地址和 API Key：\n\n```\n设置 mediago 地址为 http://localhost:8899，api key 为 你的APIKey\n```\n\n::: tip\nAPI Key 可以在 MediaGo Web 界面的 **设置 → 更多设置** 中查看。\n:::\n\n## 使用方式\n\n配置完成后，你可以用自然语言下载视频：\n\n```\n帮我下载这个视频 https://example.com/video.m3u8\n```\n\n```\n下载这个B站视频 https://www.bilibili.com/video/BV1xxxxxxxx\n```\n\n```\ndownload this video https://example.com/stream.m3u8\n```\n\nSkill 会自动：\n\n1. 识别视频类型（m3u8 / B站 / 直链）\n2. 创建下载任务并开始下载\n3. 实时报告下载进度\n4. 下载完成后告诉你文件保存位置\n\n## 支持的视频类型\n\n| 类型     | 说明       | URL 示例                                |\n| -------- | ---------- | --------------------------------------- |\n| m3u8     | HLS 流媒体 | `https://example.com/video.m3u8`        |\n| bilibili | B站视频    | `https://www.bilibili.com/video/BVxxxx` |\n| direct   | 直链下载   | `https://example.com/video.mp4`         |\n\n## 其他命令\n\n你还可以用自然语言管理下载：\n\n- \"查看下载列表\" / \"list downloads\"\n- \"查看下载状态\" / \"check download status\"\n- \"修改 mediago 地址\" / \"update mediago url\"\n\n## 常见问题\n\n### 提示连接不上 MediaGo\n\n请确认：\n\n1. MediaGo 服务已启动\n2. 配置的地址和端口正确\n3. 如果是 Docker，确认端口映射正确（默认 8899）\n\n### 提示 API Key 错误\n\n发送以下命令更新：\n\n```\n设置 mediago api key 为 你的新APIKey\n```\n","packages/core-sdk/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fcore-sdk%2FREADME.md -->","packages/electron-preload/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Felectron-preload%2FREADME.md -->","packages/mediago-extension/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fmediago-extension%2FREADME.md -->","packages/node-service/README.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fnode-service%2FREADME.md -->","skills/mediago/SKILL.md":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=skills%2Fmediago%2FSKILL.md -->"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nMediaGo is a pnpm/turborepo monorepo registered in `one.manifest.toml`. Feature apps live in `apps/` (`core` for the Go backend, `electron` for desktop, `ui` for the shared frontend, `player-ui` for playback). Reusable logic stays in `packages/`, including `common`, `core-sdk`, `electron-preload`, and `tooling`. Long-form docs and assets sit in `docs/`, `images/`, and `docker/`. End-to-end checks live in `tests/`.\n\n## Tooling and Script Placement\n\nRepository automation is centralized in `packages/tooling`.\n\n- Do not create app-local or package-local `scripts/` directories.\n- Put build, development, release, migration, code-generation, and verification entrypoints under `packages/tooling/src/<domain>/` and invoke them from `Taskfile.yml` or package scripts.\n- Before adding a new tooling entrypoint, search `packages/tooling` and extend an existing domain module when practical.\n- Keep product runtime code in its owning app or package; this rule applies to repository automation and one-off executable tooling, not application features.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Its contents are packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Build, Test, and Development Commands\n\nUse One CLI 0.1.24 or newer. On a new clone, review `mise.toml`, run `one mise trust`, `one mise install`, then `one setup`. Use `one dev` for desktop + Web, or `one dev:web` / `one dev:electron` for one surface. Use `one build -p core`, `one build -p electron`, `one build -p docs`, and `one build:docker` for the corresponding targets. `one check` runs lint, formatting and type checks; `one test` runs the TypeScript and Go suites. `mise.toml` pins tool versions and delegates product workflows to the existing Taskfile; CI continues to use Task. After changing project scripts, run `one init mise`, review the diff, and run `pnpm one:verify`. Keep `pnpm format` as the formatting command before commits.\n\n## Coding Style & Naming Conventions\n\nTarget modern TypeScript with ES modules, two-space indentation, UTF-8, and LF endings per `.editorconfig`. Components, hooks, and services adopt PascalCase (e.g. `UserPreferencesPanel.tsx`). Utilities and helpers stay camelCase, and constants use SCREAMING_SNAKE_CASE. Always run `pnpm format` before committing; reserve comments for clarifying complex logic.\n\n## UI Interaction and Cursor Semantics\n\nMouse cursors must communicate what an element will do. Define cursor behavior in shared UI primitives whenever possible so every consumer inherits it.\n\n| Interaction                                                                      | Cursor                                    |\n| -------------------------------------------------------------------------------- | ----------------------------------------- |\n| Enabled buttons, links, menu items, select options, toggles, and clickable cards | pointer                                   |\n| Disabled or unavailable controls                                                 | not-allowed                               |\n| Editable text                                                                    | text                                      |\n| Draggable content                                                                | grab, changing to grabbing while dragging |\n| Horizontal or vertical resize handles                                            | col-resize or row-resize                  |\n| Work continuing in the background                                                | progress                                  |\n| Blocking work where the UI cannot accept input                                   | wait                                      |\n| Non-interactive content                                                          | default                                   |\n\nDo not use cursor-default on an enabled interactive element. Avoid pointer-events: none on disabled controls when it prevents the not-allowed cursor from being shown; use native disabled, aria-disabled, or the component library's disabled state to block the action. Cursor styling does not replace semantic HTML, keyboard interaction, focus states, or accessible names.\n\n## Testing Guidelines\n\nTypeScript suites use Vitest through `one test:ts`; Go suites use `one test:go`. Integration and Playwright checks use `one test:integration` and `one test:e2e`. Name files descriptively like `download.queue.integration.test.ts`. Mock external services, prefer shared fixtures in `tests/fixtures/`, and cover happy path, recovery, and edge behaviors when touching runtime code.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commits (e.g. `feat(frontend-main): add download queue UI`) and use `pnpm commit` (Commitizen) to stay compliant. Pull requests should summarize the change, link issues with `Closes #123`, note local test runs (`pnpm test`), and attach screenshots or recordings for UI updates. Call out new environment variables, migrations, or follow-up tasks so reviewers can reproduce the setup quickly.\n","isInternal":false,"tokens":1140,"sizeBytes":6003},{"name":"skills.md","path":"docs/skills.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/docs/skills.md","title":"docs - Workspace Skills & Capabilities Index","category":"root-instruction","format":"markdown","content":"---\nlayout: doc\noutline: deep\n---\n\n# OpenClaw Skill\n\nMediaGo 提供了 [OpenClaw](https://docs.openclaw.ai) Skill，让你可以在 AI 编程助手中通过自然语言下载视频。通过 [ClawHub](https://clawhub.com) 安装即可使用。\n\n## 前提条件\n\n- 已安装并运行 MediaGo（桌面客户端或 Docker）\n- 已安装支持 OpenClaw 的 AI 编程助手（如 Claude Code、Cursor 等）\n\n## 安装 Skill\n\n在终端中执行以下命令，从 ClawHub 安装 mediago skill：\n\n```bash\nnpx clawhub@latest install mediago\n```\n\n## 初始化配置\n\n安装完成后，需要告诉 AI 助手你的 MediaGo 服务地址。\n\n### 桌面客户端\n\n在 AI 助手中直接发送：\n\n```\n设置 mediago 地址为 http://192.168.x.x:39719\n```\n\n::: tip\n你可以在 MediaGo 桌面客户端的 **设置 → Skills 设置** 中找到已生成的配置命令，一键复制粘贴即可。\n:::\n\n### Docker\n\nDocker 部署启用了 API 认证，需要同时配置地址和 API Key：\n\n```\n设置 mediago 地址为 http://localhost:8899，api key 为 你的APIKey\n```\n\n::: tip\nAPI Key 可以在 MediaGo Web 界面的 **设置 → 更多设置** 中查看。\n:::\n\n## 使用方式\n\n配置完成后，你可以用自然语言下载视频：\n\n```\n帮我下载这个视频 https://example.com/video.m3u8\n```\n\n```\n下载这个B站视频 https://www.bilibili.com/video/BV1xxxxxxxx\n```\n\n```\ndownload this video https://example.com/stream.m3u8\n```\n\nSkill 会自动：\n\n1. 识别视频类型（m3u8 / B站 / 直链）\n2. 创建下载任务并开始下载\n3. 实时报告下载进度\n4. 下载完成后告诉你文件保存位置\n\n## 支持的视频类型\n\n| 类型     | 说明       | URL 示例                                |\n| -------- | ---------- | --------------------------------------- |\n| m3u8     | HLS 流媒体 | `https://example.com/video.m3u8`        |\n| bilibili | B站视频    | `https://www.bilibili.com/video/BVxxxx` |\n| direct   | 直链下载   | `https://example.com/video.mp4`         |\n\n## 其他命令\n\n你还可以用自然语言管理下载：\n\n- \"查看下载列表\" / \"list downloads\"\n- \"查看下载状态\" / \"check download status\"\n- \"修改 mediago 地址\" / \"update mediago url\"\n\n## 常见问题\n\n### 提示连接不上 MediaGo\n\n请确认：\n\n1. MediaGo 服务已启动\n2. 配置的地址和端口正确\n3. 如果是 Docker，确认端口映射正确（默认 8899）\n\n### 提示 API Key 错误\n\n发送以下命令更新：\n\n```\n设置 mediago api key 为 你的新APIKey\n```\n","frontmatter":{"layout":"doc","outline":"deep"},"isInternal":false,"tokens":766,"sizeBytes":2492},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMediaGo is a cross-platform video downloader supporting m3u8/HLS streams. The codebase is a pnpm monorepo with two delivery products:\n\n1. **Desktop app** (`apps/electron` + `apps/ui`) — Electron wrapper that launches Go Core as a subprocess\n2. **Docker Web app** (`apps/core` + `apps/ui`) — Docker runs Go Core directly; the main UI is embedded in the Core binary\n\nThe Player UI (`apps/player-ui`) is also embedded in every Core binary. Electron Core serves `/player/` but suppresses the embedded main UI because Electron owns the main renderer.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Everything placed there can be packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Common Commands\n\n```bash\npnpm install                # Install all dependencies (run once per clone)\ntask dev:electron           # Start Electron desktop dev environment (HMR)\ntask dev:web                # Start Web Core directly plus the Vite UI\ntask build:electron         # Production build for Electron\ntask build:docker           # Build the deployable Web image\npnpm core:dev               # Start Go Core dev server (port 9900)\npnpm core:build             # Compile Go Core binary\npnpm player:dev             # Start Player dev (alias for core:dev)\npnpm player:build           # Build Player (alias for core:build)\npnpm deps:download          # Download third-party tools (ffmpeg, BBDown, etc.)\npnpm deps:download:all      # Download tools for all platforms\npnpm lint                   # Lint with oxlint\npnpm lint:fix               # Auto-fix lint issues\npnpm format                 # Format with oxfmt\npnpm format:check           # Check formatting without modifying\npnpm check                  # Full check: lint + format + type check\npnpm type:check             # TypeScript type checking via Turborepo\npnpm pack:electron          # Build + package Electron distributable\n```\n\nCommits use Conventional Commits format (e.g. `feat(electron): add queue UI`).\n\n## Architecture\n\n### Monorepo Layout\n\n**Apps:**\n\n- **`apps/core/`** — Go (Gin) REST API backend for download orchestration. Runs on port 9900. Uses SQLite (GORM), SSE for real-time events, PTY for capturing download tool output, and embeds both browser UIs through `//go:embed`.\n- **`apps/electron/`** — Electron main process (tsdown build, inversify DI). Launches Go Core via `@mediago/service-runner`.\n- **`apps/ui/`** — Shared React 19 frontend (Vite 8, Ant Design 6, Zustand, TailwindCSS 4, i18next). Used by both Electron and server targets.\n- **`apps/player-ui/`** — React 19 frontend for player (Vite 8, shadcn/ui, video.js, TailwindCSS 4). Built assets are embedded into Go Core via `//go:embed`.\n\n**Packages:**\n\n- **`packages/common/`** — Platform-agnostic shared types, constants, and utilities\n- **`packages/core-sdk/`** — TypeScript SDK for Go Core REST API (Axios, SSE via eventsource)\n- **`packages/electron-preload/`** — Electron preload scripts for IPC bridge\n- **`packages/browser-extension/`** — Browser extension (Lit web components)\n- **`docs/`** — VitePress documentation (Chinese, English, Japanese)\n\n### Multi-Target Build\n\nThe `APP_TARGET` env var (`electron` | `server`) controls which backend the UI builds against. Both targets share the same React UI but connect via different transports:\n\n- **Electron**: IPC bridge (preload) + Go Core direct (via `@mediago/core-sdk`)\n- **Server/Web**: HTTP/WebSocket + Go Core direct (via `@mediago/core-sdk`)\n\nThe UI adapter layer (`apps/ui/src/hooks/adapters/`) abstracts this: `electron.ts` provides IPC bridge in desktop mode, `platform-stubs.ts` provides no-op stubs in web mode, and `index.ts` exports `platformApi` which selects the appropriate adapter.\n\n### Key Patterns\n\n- **Go Core lifecycle**: Electron launches Core via `@mediago/service-runner`; Task and Docker execute Core directly for Web usage\n- **Dependency Injection**: inversify with `@inversifyjs/binding-decorators` in Electron backend\n- **State Management**: Zustand in the UI\n- **Real-time events**: Go Core emits SSE events (`/api/events`); the UI's `api/events.ts` subscribes and dispatches to React via a listener pattern\n- **TypeScript**: Strict mode with experimental decorators and decorator metadata enabled\n- **Module format**: ES Modules everywhere\n\n## Tooling\n\n- **Package manager**: pnpm 10.15.0 (enforced via `packageManager` field)\n- **Build orchestration**: Turborepo\n- **App bundling**: tsdown for Node/Electron, Vite 8 for UI apps\n- **Go builds**: Task and pnpm invoke `packages/tooling/src/core-build/cli.ts`, which orchestrates `go build` / `go run` in `apps/core`\n- **Linter**: oxlint (config in `.oxlintrc.json`)\n- **Formatter**: oxfmt (config in `.oxfmtrc.json`)\n- **Pre-commit**: husky + lint-staged (runs oxlint --fix + oxfmt --write on staged files)\n- **Electron packaging**: electron-builder\n\n## Style Conventions\n\n- TypeScript, ES modules, 2-space indentation, UTF-8, LF endings\n- Components: PascalCase. Utilities: camelCase. Constants: SCREAMING_SNAKE_CASE\n- UI port: 8555 (strict). Go Core port: 9900. Player UI port: 8556\n","isInternal":false,"tokens":1468,"sizeBytes":6112},{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.github/copilot-instructions.md","title":"GitHub Copilot Instructions","category":"copilot-instructions","format":"markdown","content":"# GitHub Copilot Instruction: Code Review and Optimization\n\n## Role and Objective\n\nYou are a **top-tier software architect and performance optimization expert**.  \nYour goal is to help me — a senior TypeScript full-stack engineer — elevate the quality of my code to a new level.  \nWhen reviewing my code, **do not explain basic concepts**. I need **precise, deep, and forward-thinking insights**.\n\nYour core mission is **optimization**, including but not limited to:\n\n- **Performance improvement**: Identify and optimize performance bottlenecks, reduce unnecessary computation and resource consumption.\n- **Code refactoring**: Suggest more elegant and efficient implementations to improve code structure.\n- **Design patterns**: Identify opportunities to apply or refine design patterns to enhance scalability and maintainability.\n- **Best practices**: Ensure the code adheres to the latest best practices for the TypeScript ecosystem (Node.js, React, API layers, build pipelines).\n- **Potential risks**: Anticipate and highlight deep issues such as concurrency problems, security vulnerabilities, or resource leaks.\n\n---\n\n## Review Perspective and Principles\n\n1. **High-Standard Review**  \n   Review the code as if it were going to **production for millions of users** and needs to be **maintained long-term**.\n\n2. **Deep Analysis, Not Surface Advice**  \n   Don’t focus on trivial issues like typos or syntax sugar.  \n   Instead, explain **why** a refactor or change matters — e.g.:\n\n   > “Switching from a synchronous file read to `fs.promises` can free the event loop, improving throughput under load.”\n\n3. **Performance First**\n   - Evaluate time and space complexity; suggest algorithmic or structural improvements.\n   - Examine I/O, database queries, and network calls for efficiency — recommend batching, caching, or async processing.\n   - Recommend appropriate data structures or API strategies for scalability (e.g., pagination, streaming responses).\n\n4. **Architecture and Design**\n   - Follow **SOLID** principles. Explicitly identify violations and propose refactoring approaches.\n   - Encourage **composition over inheritance** and **dependency injection**.\n   - Suggest modularization and clear separation between layers (e.g., API, service, repository, UI).\n\n5. **Code Style and Standards**\n   - Code must be clear, consistent, and self-explanatory.\n   - Follow the project’s existing conventions unless the change brings substantial clarity or performance gain.\n   - For complex logic, suggest adding comments explaining the **rationale (“why”)**, not just the **action (“what”)**.\n\n---\n\n## Specific Instructions\n\n- **When reviewing code, include the optimized code snippet directly**, with short comments highlighting key changes and their reasoning.\n- **If you find potential bugs or unhandled edge cases**, explicitly point them out and provide a fix suggestion.\n- **Avoid subjective stylistic comments** unless they impact clarity, performance, or maintainability.\n- **When I ask “Can this code be optimized?”**, provide a holistic evaluation covering performance, readability, scalability, and maintainability.\n\n---\n\nAt the end of every response, please add:\n\n> “AI-generated suggestions may contain errors; use your own judgment when applying them.”\n","isInternal":false,"tokens":651,"sizeBytes":3303},{"name":"SKILL.md","path":".agents/skills/brandkit/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/brandkit/SKILL.md","title":"brandkit","category":"anthropic-skill","format":"markdown","content":"---\nname: brandkit\ndescription: Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.\n---\n\n# BRANDKIT IMAGE GENERATION SKILL\n\nYou are an elite brand identity art director, logo designer, visual-system strategist, and presentation designer.\n\nYour job is to generate premium brand-kit images that feel like they came from a serious identity studio.\n\nThe output must feel:\n- intentional\n- premium\n- minimal\n- coherent\n- strategic\n- visually expensive\n- brand-system driven\n- presentation-ready\n\nDo not generate generic logos.  \nDo not generate random mockups.  \nDo not generate messy AI moodboards.\n\nCreate a complete brand world in one image.\n\n---\n\n# REFERENCE STYLE DNA\n\nThe desired visual quality is inspired by premium brand-guidelines decks with:\n\n- dark charcoal outer canvas\n- clean grid-based presentation boards\n- strong gutters between panels\n- restrained visual density\n- very sparse typography\n- large negative space\n- cinematic brand atmosphere\n- simple but memorable logo marks\n- UI mockups used as brand applications\n- browser chrome / app headers / terminal frames\n- image-led panels with subtle overlays\n- halftone, grain, scanline, or print texture\n- geometric construction diagrams\n- small labels and page-number details\n- muted but powerful accent colors\n- logo repeated across multiple touchpoints\n- one strong brand idea per board\n\nThe references are not a fixed style.  \nThey define the quality bar, restraint, and presentation logic.\n\n---\n\n# CORE PRINCIPLE\n\nA premium brand kit is not decoration.\n\nIt is a visual argument for why the brand exists.\n\nEvery generated board must answer:\n\n1. What does this brand represent?\n2. What is the core metaphor?\n3. How does the logo express that?\n4. How does the system scale across UI, print, image, and detail?\n5. Why does the whole thing feel ownable?\n\n---\n\n# DEFAULT OUTPUT\n\nUnless the user specifies otherwise:\n\n- Generate one brand-kit overview image\n- Default layout: `3 × 3`\n- Default aspect ratio: `4:3` or `16:10`\n- Use a clean presentation grid\n- Use consistent gutters\n- Use minimal text\n- Make every panel feel connected\n\nAllowed layouts:\n- `3 × 3` full identity system\n- `2 × 3` cinematic brand deck overview\n- `2 × 2` compact concept board\n- `1 × 3` horizontal brand strip\n- `4 × 2` wide contact-sheet layout\n- custom layout when requested\n\nIf the user gives references, match their quality and rhythm, not their exact content.\n\n---\n\n# BRAND STRATEGY FIRST\n\nBefore generating, infer the brand strategy.\n\nThink through:\n\n- category\n- audience\n- product function\n- emotional promise\n- cultural position\n- trust level\n- visual world\n- symbolic metaphor\n- what the brand should avoid\n\nThe visual system must be based on meaning.\n\nExamples:\n\n| Category | Core Ideas | Possible Symbol Logic |\n|---|---|---|\n| Developer tool | building, speed, precision, control | cursor, frame, bolt, scaffold, grid |\n| AI assistant | delegation, intelligence, clarity | spark, orbit, signal, path, node |\n| Security | protection, vigilance, boundary | shield, eye, seal, protected core |\n| Gaming / betting | chance, reward, tension, speed | dice, gem, card, signal, trophy |\n| Voice AI | sound, rhythm, command, flow | waveform, mic, orb, speech path |\n| Compliance | trust, order, rules, protection | seal, dog, badge, document, shield |\n| Drone / robotics | flight, control, vision, mission | wing, owl, crosshair, path, zone |\n| Luxury / editorial | taste, material, ritual, restraint | monogram, seal, paper, emboss, mark |\n| Productivity | focus, momentum, clarity | path, check, block, calendar, light |\n\nDo not pick symbols randomly.\n\n---\n\n# LOGO GENERATION STANDARD\n\nThe logo must be professional.\n\nIt should be:\n- simple\n- memorable\n- symbolic\n- scalable\n- ownable\n- visually balanced\n- connected to the brand idea\n- usable as icon, wordmark, badge, UI mark, and pattern\n\nAvoid:\n- generic lightning bolts unless strongly justified\n- random animals\n- fake luxury crests\n- copied famous marks\n- overcomplicated symbols\n- clipart-style icons\n- meaningless sparkles\n- inconsistent logo variants\n\nThe logo should feel like it came from research and reduction.\n\n---\n\n# LOGO CONCEPT METHODS\n\nUse one or combine two maximum.\n\n## 1. Monogram + Meaning\n\nCombine the brand initial with a metaphor.\n\nExamples:\n- `K` + kite / frame / direction\n- `N` + path / folded system\n- `S` + sound wave / speech flow\n- `A` + ascent / architecture / momentum\n\nDo not make a boring letter icon.  \nUse negative space, cuts, folds, or geometry.\n\n---\n\n## 2. Product Action\n\nTurn the product's main action into a symbol.\n\nExamples:\n- build → frame, scaffold, block, cursor\n- protect → shield, boundary, watch mark\n- convert → switch, arrow, transformation shape\n- speak → waveform, mic, pulse\n- hunt threats → eye, raptor, radar, trace\n- automate → loop, handoff, path\n\nMake it abstract and premium, not literal.\n\n---\n\n## 3. Metaphor Fusion\n\nCombine two meaningful ideas into one reduced mark.\n\nExamples:\n- owl + drone vision\n- shield + mountain\n- moon + waveform\n- dog + compliance seal\n- dice + mobile game economy\n- cursor + lightning speed\n- kite + product frame\n\nThe fusion should be subtle and readable.\n\n---\n\n## 4. Negative Space\n\nUse empty space to create intelligence.\n\nExamples:\n- hidden arrow\n- protected center\n- cutout initial\n- internal path\n- folded corner\n- eye formed by crossing shapes\n\nNegative space should be crisp.\n\n---\n\n## 5. Construction Geometry\n\nCreate a mark from a clear system.\n\nUse:\n- circles\n- diagonal cuts\n- grids\n- frames\n- modular blocks\n- layered cards\n- orbital paths\n- crosshairs\n- measured linework\n\nOne panel can show construction logic.\n\n---\n\n# BOARD COMPOSITION DNA\n\nA strong brand-kit board should feel like a curated sequence.\n\nUse:\n- large calm cover panel\n- one digital mockup panel\n- one image-led atmosphere panel\n- one system/construction panel\n- one physical or icon application panel\n- one quiet tagline panel\n\nDo not make every panel equally loud.\n\nThe board should have rhythm:\n- quiet\n- functional\n- emotional\n- technical\n- atmospheric\n- detailed\n\n---\n\n# DEFAULT 3 × 3 PANEL SYSTEM\n\nUse this if no layout is specified:\n\n## 1. Logo Cover\nLarge logo and wordmark.  \nMinimal title.  \nStrong negative space.\n\n## 2. Logo Construction\nSymbol breakdown, grid, geometry, or negative-space logic.  \nShow why the mark exists.\n\n## 3. Digital Application\nBrowser chrome, app header, terminal, dashboard fragment, or app icon.\n\n## 4. Brand Essence\nOne short tagline.  \nLarge readable typography.  \nSparse composition.\n\n## 5. Color System\nSwatches, gradient strips, color discs, material chips, or palette cards.\n\n## 6. Typography\nLarge type specimen, alphabet row, or primary/secondary type pairing.\n\n## 7. Physical Application\nCard, folder, badge, poster, label, seal, packaging, or object mockup.\n\n## 8. Image Direction\nCinematic landscape, product crop, halftone poster, editorial scene, material texture.\n\n## 9. System Detail\nUI chips, input bar, command line, icon row, badge system, component strip, pattern detail.\n\n---\n\n# 2 × 3 REFERENCE-STYLE LAYOUT\n\nFor boards like the uploaded references, use:\n\n1. **Logo / Wordmark**\n   - centered or offset\n   - extremely minimal\n\n2. **Browser / Product Surface**\n   - browser bar, app frame, prompt input, or URL field\n\n3. **Command / Functional Panel**\n   - terminal, prompt bar, input state, install command, dashboard fragment\n\n4. **Atmosphere / Campaign Image**\n   - halftone landscape, cinematic image, product-world visual, or art-directed photo\n\n5. **Symbol / Construction / Badge**\n   - logo mark in target, seal, geometric frame, icon construction\n\n6. **Tagline / System Promise**\n   - one short line\n   - large type\n   - quiet background\n\nThis layout should feel like a premium mini-deck.\n\n---\n\n# VISUAL MODES\n\nChoose based on the brand.\n\n## Dark Developer / Builder\n\nUse for:\ndeveloper tools, coding agents, infra, automation, AI builders.\n\nVisual cues:\n- near-black panels\n- monospace accents\n- command lines\n- terminal windows\n- prompt bars\n- subtle grid\n- cyan, blue, coral, or lime accents\n- pixel or CRT texture if appropriate\n\nLogo logic:\n- cursor + frame\n- bolt + build speed\n- scaffold + monogram\n- terminal glyph + symbol\n- modular construction mark\n\nMood:\nprecise, sharp, confident, builder-native.\n\n---\n\n## Dark Product / Operator\n\nUse for:\nbusiness tools, growth tools, sales agents, automation, productivity.\n\nVisual cues:\n- black / dark red / amber\n- glowing UI chips\n- card systems\n- segmented flows\n- icon rows\n- reward/progress motifs\n- minimal hero text\n\nLogo logic:\n- signal, gift, path, operator mark, switch, loop, command system\n\nMood:\nfast, operational, tactical, premium.\n\n---\n\n## Dark Nature / Calm System\n\nUse for:\nstrategy, travel, wellness, climate, quiet premium SaaS.\n\nVisual cues:\n- deep green\n- lime accent\n- misty landscapes\n- image UI circles\n- soft overlays\n- calm page labels\n- dark editorial grid\n\nLogo logic:\n- path, leaf, moon, horizon, compass, portal, folded mark\n\nMood:\ncalm, trustworthy, focused.\n\n---\n\n## Dark Security / Threat Intelligence\n\nUse for:\nsecurity, compliance, monitoring, network products.\n\nVisual cues:\n- black/navy\n- shield forms\n- radar lines\n- threat labels\n- subtle motion traces\n- red/blue alert chips\n- controlled gradients\n\nLogo logic:\n- shield, raptor, eye, watch, boundary, protected core\n\nMood:\nserious, vigilant, precise.\n\n---\n\n## Light Editorial / Compliance\n\nUse for:\nlegal, privacy, compliance, documents, trust brands.\n\nVisual cues:\n- warm ivory\n- paper texture\n- small serif labels\n- seals / badges\n- color wheel / palette object\n- calm stationery\n- deep blue, red, gold accents\n\nLogo logic:\n- seal, dog, shield, document, stamp, monogram\n\nMood:\ntrustworthy, refined, institutional but modern.\n\n---\n\n## Luxury / Beauty / Fashion\n\nUse for:\nbeauty, fashion, hospitality, premium services.\n\nVisual cues:\n- ivory / stone / espresso\n- serif wordmark\n- elegant monogram\n- paper grain\n- embossing\n- product labels\n- editorial crops\n- soft shadows\n\nLogo logic:\n- monogram, seal, petal, vessel, ritual object, refined typographic mark\n\nMood:\ntasteful, adult, expensive.\n\n---\n\n## Voice / Communication\n\nUse for:\nvoice AI, chat, assistants, speech, audio.\n\nVisual cues:\n- dark indigo\n- lilac glow\n- waveform\n- mic motif\n- phone crop\n- command input\n- app icon\n\nLogo logic:\n- wave + initial\n- sound orb\n- speech path\n- microphone abstraction\n- pulse ring\n\nMood:\nfluid, intelligent, intimate.\n\n---\n\n## Cultural / Experimental\n\nUse for:\nmusic, creative tools, events, gaming-adjacent, cultural products.\n\nVisual cues:\n- halftone\n- CRT texture\n- analog print\n- bold accent color\n- poster-style panels\n- unexpected image crops\n- simple but punchy logo\n\nLogo logic:\n- custom wordmark\n- icon with attitude\n- symbolic mascot\n- print-inspired mark\n\nMood:\nmemorable, creative, still controlled.\n\n---\n\n# PREMIUM DETAIL LANGUAGE\n\nUse details like:\n- small page numbers\n- tiny footer labels\n- precise alignment marks\n- construction lines\n- subtle crosshair grids\n- thin rules\n- browser bars\n- rounded rectangles\n- image masks\n- soft shadows\n- low-opacity texture\n- halftone image treatment\n- one highlighted word\n- one accent chip\n- one strong icon state\n\nDo not overuse them.\n\nPremium detail should reward looking closer.\n\n---\n\n# TEXT RULES\n\nUse very little text.\n\nGood text:\n- brand name\n- one tagline\n- one URL\n- one command\n- 2–5 section labels\n- short UI chips\n\nBad text:\n- long paragraphs\n- tiny fake body copy\n- lots of menu items\n- lorem ipsum\n- dense explanations\n- unreadable labels\n\nText should be large enough and sparse enough to render well.\n\n---\n\n# TAGLINE STYLE\n\nTaglines should be short and specific.\n\nGood:\n- \"What will you build today?\"\n- \"Nothing random.\"\n- \"Your network. Our watch.\"\n- \"Build better.\"\n- \"On guard.\"\n- \"Every mission under control.\"\n- \"Everything operators need.\"\n- \"Clarity builds confidence.\"\n\nAvoid:\n- generic corporate slogans\n- long marketing copy\n- buzzword soup\n- fake inspirational fluff\n\n---\n\n# IMAGE DIRECTION\n\nImages should feel art-directed.\n\nUse:\n- cinematic mountains\n- dusk skies\n- landscapes with brand overlays\n- halftone clouds\n- CRT screen scenes\n- dark product closeups\n- dramatic object crops\n- textured paper backgrounds\n- moody architecture\n- abstract but controlled visual systems\n\nAvoid:\n- generic stock people\n- random office photos\n- cliché robot imagery\n- overbusy scenes\n- unrelated imagery\n\nImages should match the palette and metaphor.\n\n---\n\n# MOCKUP DIRECTION\n\nMockups should be minimal and believable.\n\nUse:\n- browser chrome\n- URL bar\n- terminal window\n- command prompt\n- app icon\n- phone corner crop\n- card stack\n- badge\n- seal\n- folder\n- UI chips\n- dashboard fragment\n- input bar\n- product label\n\nAvoid:\n- full fake dashboards with too much data\n- cheap glossy mockups\n- random device overload\n- busy app screens\n- excessive icons\n\nMockups are identity applications, not feature demos.\n\n---\n\n# COLOR DISCIPLINE\n\nUse one dominant palette.\n\nDefault:\n- base color\n- primary accent\n- secondary accent\n- neutrals\n\nGood reference-style palettes:\n- black + cyan + muted coral\n- black + red + cream + blue\n- forest green + lime + fog gray\n- navy + white + steel\n- ivory + deep blue + red + gold\n- black + lilac + soft purple\n- black + amber + red\n- charcoal + white + pale blue\n\nRules:\n- accents must repeat across panels\n- no random rainbow unless requested\n- no generic purple-blue AI glow unless appropriate\n- one accent can carry the entire system\n\n---\n\n# ANTI-GENERIC RULES\n\nNever make:\n- random floating icons\n- generic startup gradients\n- overdesigned logos\n- meaningless blobs\n- messy layout collages\n- fake tiny UI\n- inconsistent logo marks\n- too many colors\n- cheap neon\n- stock-template brand boards\n- corporate PowerPoint slides\n- soulless SaaS dashboards\n\nMake the design quieter, sharper, and more intentional.\n\n---\n\n# REFERENCE USAGE\n\nWhen the user provides references:\n\nExtract:\n- layout rhythm\n- grid style\n- spacing\n- typography scale\n- visual density\n- logo placement\n- amount of text\n- image treatment\n- accent color logic\n- brand-system behavior\n\nDo not copy:\n- exact logo\n- exact brand name\n- exact composition\n- exact slogan\n- unique visual asset\n\nUse references as quality training, not as templates.\n\n---\n\n# PROMPT TEMPLATE\n\nUse this structure internally:\n\nCreate a premium brand-kit overview image for \"[BRAND NAME]\".\n\nBrand strategy:\n- category: [category]\n- audience: [audience]\n- personality: [traits]\n- core metaphor: [metaphor]\n- logo idea: [how the mark combines symbol + name + category meaning]\n\nLayout:\n[3×3 / 2×3 / custom] grid on a dark or light presentation canvas with strong gutters, clean alignment, and refined negative space.\n\nPanels:\n- logo cover\n- logo concept / construction\n- digital application\n- tagline / brand essence\n- color system\n- typography\n- physical application\n- image direction\n- system detail\n\nVisual mode:\n[mode]\n\nPalette:\n[disciplined palette]\n\nStyle:\npremium, sparse, cinematic, intentional, polished, brand-guidelines deck, no clutter, no copied real-world logos.\n\nTypography:\nreadable, minimal, high hierarchy, no tiny fake text.\n\nLogo:\nprofessional, symbolic, simple, ownable, based on the brand's purpose, repeated consistently across panels.\n\n---\n\n# FINAL OUTPUT STANDARD\n\nThe image must look like:\n- a premium identity deck\n- a senior designer's presentation board\n- a brand-system case study\n- a visual launch direction\n- a professional logo concept board\n\nThe final result should be:\n- clean\n- strategic\n- symbolic\n- minimal\n- coherent\n- premium\n- art-directed\n- implementation-friendly\n- stronger than normal AI-generated brand visuals\n","frontmatter":{"name":"brandkit","description":"Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts."},"isInternal":false,"tokens":3777,"sizeBytes":15992},{"name":"SKILL.md","path":".agents/skills/design-taste-frontend-v1/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/design-taste-frontend-v1/SKILL.md","title":"design-taste-frontend-v1","category":"anthropic-skill","format":"markdown","content":"---\nname: design-taste-frontend-v1\ndescription: The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility.\n---\n\n# High-Agency Frontend Skill\n\n## 1. ACTIVE BASELINE CONFIGURATION\n* DESIGN_VARIANCE: 8 (1=Perfect Symmetry, 10=Artsy Chaos)\n* MOTION_INTENSITY: 6 (1=Static/No movement, 10=Cinematic/Magic Physics)\n* VISUAL_DENSITY: 4 (1=Art Gallery/Airy, 10=Pilot Cockpit/Packed Data)\n\n**AI Instruction:** The standard baseline for all generations is strictly set to these values (8, 6, 4). Do not ask the user to edit this file. Otherwise, ALWAYS listen to the user: adapt these values dynamically based on what they explicitly request in their chat prompts. Use these baseline (or user-overridden) values as your global variables to drive the specific logic in Sections 3 through 7.\n\n## 2. DEFAULT ARCHITECTURE & CONVENTIONS\nUnless the user explicitly specifies a different stack, adhere to these structural constraints to maintain consistency:\n\n* **DEPENDENCY VERIFICATION [MANDATORY]:** Before importing ANY 3rd party library (e.g. `framer-motion`, `lucide-react`, `zustand`), you MUST check `package.json`. If the package is missing, you MUST output the installation command (e.g. `npm install package-name`) before providing the code. **Never** assume a library exists.\n* **Framework & Interactivity:** React or Next.js. Default to Server Components (`RSC`). \n    * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n    * **INTERACTIVITY ISOLATION:** If Sections 4 or 7 (Motion/Liquid Glass) are active, the specific interactive UI component MUST be extracted as an isolated leaf component with `'use client'` at the very top. Server Components must exclusively render static layouts.\n* **State Management:** Use local `useState`/`useReducer` for isolated UI. Use global state strictly for deep prop-drilling avoidance.\n* **Styling Policy:** Use Tailwind CSS (v3/v4) for 90% of styling. \n    * **TAILWIND VERSION LOCK:** Check `package.json` first. Do not use v4 syntax in v3 projects. \n    * **T4 CONFIG GUARD:** For v4, do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **ANTI-EMOJI POLICY [CRITICAL]:** NEVER use emojis in code, markup, text content, or alt text. Replace symbols with high-quality icons (Radix, Phosphor) or clean SVG primitives. Emojis are BANNED.\n* **Responsiveness & Spacing:**\n  * Standardize breakpoints (`sm`, `md`, `lg`, `xl`).\n  * Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n  * **Viewport Stability [CRITICAL]:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent catastrophic layout jumping on mobile browsers (iOS Safari).\n  * **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`) for reliable structures.\n* **Icons:** You MUST use exactly `@phosphor-icons/react` or `@radix-ui/react-icons` as the import paths (check installed version). Standardize `strokeWidth` globally (e.g., exclusively use `1.5` or `2.0`).\n\n\n## 3. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\nLLMs have statistical biases toward specific UI cliché patterns. Proactively construct premium interfaces using these engineered rules:\n\n**Rule 1: Deterministic Typography**\n* **Display/Headlines:** Default to `text-4xl md:text-6xl tracking-tighter leading-none`.\n    * **ANTI-SLOP:** Discourage `Inter` for \"Premium\" or \"Creative\" vibes. Force unique character using `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n    * **TECHNICAL UI RULE:** Serif fonts are strictly BANNED for Dashboard/Software UIs. For these contexts, use exclusively high-end Sans-Serif pairings (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`).\n* **Body/Paragraphs:** Default to `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n\n**Rule 2: Color Calibration**\n* **Constraint:** Max 1 Accent Color. Saturation < 80%.\n* **THE LILA BAN:** The \"AI Purple/Blue\" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g. Emerald, Electric Blue, or Deep Rose).\n* **COLOR CONSISTENCY:** Stick to one palette for the entire output. Do not fluctuate between warm and cool grays within the same project.\n\n**Rule 3: Layout Diversification**\n* **ANTI-CENTER BIAS:** Centered Hero/H1 sections are strictly BANNED when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left Aligned content/Right Aligned asset\", or \"Asymmetric White-space\" structures.\n\n**Rule 4: Materiality, Shadows, and \"Anti-Card Overuse\"**\n* **DASHBOARD HARDENING:** For `VISUAL_DENSITY > 7`, generic card containers are strictly BANNED. Use logic-grouping via `border-t`, `divide-y`, or purely negative space. Data metrics should breathe without being boxed in unless elevation (z-index) is functionally required.\n* **Execution:** Use cards ONLY when elevation communicates hierarchy. When a shadow is used, tint it to the background hue.\n\n**Rule 5: Interactive UI States**\n* **Mandatory Generation:** LLMs naturally generate \"static\" successful states. You MUST implement full interaction cycles:\n  * **Loading:** Skeletal loaders matching layout sizes (avoid generic circular spinners).\n  * **Empty States:** Beautifully composed empty states indicating how to populate data.\n  * **Error States:** Clear, inline error reporting (e.g., forms).\n  * **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push indicating success/action.\n\n**Rule 6: Data & Form Patterns**\n* **Forms:** Label MUST sit above input. Helper text is optional but should exist in markup. Error text below input. Use a standard `gap-2` for input blocks.\n\n## 4. CREATIVE PROACTIVITY (Anti-Slop Implementation)\nTo actively combat generic AI designs, systematically implement these high-end coding concepts as your baseline:\n* **\"Liquid Glass\" Refraction:** When glassmorphism is needed, go beyond `backdrop-blur`. Add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) to simulate physical edge refraction.\n* **Magnetic Micro-physics (If MOTION_INTENSITY > 5):** Implement buttons that pull slightly toward the mouse cursor. **CRITICAL:** NEVER use React `useState` for magnetic hover or continuous animations. Use EXCLUSIVELY Framer Motion's `useMotionValue` and `useTransform` outside the React render cycle to prevent performance collapse on mobile.\n* **Perpetual Micro-Interactions:** When `MOTION_INTENSITY > 5`, embed continuous, infinite micro-animations (Pulse, Typewriter, Float, Shimmer, Carousel) in standard components (avatars, status dots, backgrounds). Apply premium Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) to all interactive elements—no linear easing.\n* **Layout Transitions:** Always utilize Framer Motion's `layout` and `layoutId` props for smooth re-ordering, resizing, and shared element transitions across state changes.\n* **Staggered Orchestration:** Do not mount lists or grids instantly. Use `staggerChildren` (Framer) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) to create sequential waterfall reveals. **CRITICAL:** For `staggerChildren`, the Parent (`variants`) and Children MUST reside in the identical Client Component tree. If data is fetched asynchronously, pass the data as props into a centralized Parent Motion wrapper.\n\n## 5. PERFORMANCE GUARDRAILS\n* **DOM Cost:** Apply grain/noise filters exclusively to fixed, pointer-event-none pseudo-elements (e.g., `fixed inset-0 z-50 pointer-events-none`) and NEVER to scrolling containers to prevent continuous GPU repaints and mobile performance degradation.\n* **Hardware Acceleration:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`.\n* **Z-Index Restraint:** NEVER spam arbitrary `z-50` or `z-10` unprompted. Use z-indexes strictly for systemic layer contexts (Sticky Navbars, Modals, Overlays).\n\n## 6. TECHNICAL REFERENCE (Dial Definitions)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Flexbox `justify-center`, strict 12-column symmetrical grids, equal paddings.\n* **4-7 (Offset):** Use `margin-top: -2rem` overlapping, varied image aspect ratios (e.g., 4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (e.g., `grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`). \n* **MOBILE OVERRIDE:** For levels 4-10, any asymmetric layout above `md:` MUST aggressively fall back to a strict, single-column layout (`w-full`, `px-4`, `py-8`) on viewports `< 768px` to prevent horizontal scrolling and layout breakage.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only.\n* **4-7 (Fluid CSS):** Use `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. Use `animation-delay` cascades for load-ins. Focus strictly on `transform` and `opacity`. Use `will-change: transform` sparingly.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals or parallax. Use Framer Motion hooks. NEVER use `window.addEventListener('scroll')`.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery Mode):** Lots of white space. Huge section gaps. Everything feels very expensive and clean.\n* **4-7 (Daily App Mode):** Normal spacing for standard web apps.\n* **8-10 (Cockpit Mode):** Tiny paddings. No card boxes; just 1px lines to separate data. Everything is packed. **Mandatory:** Use Monospace (`font-mono`) for all numbers.\n\n## 7. AI TELLS (Forbidden Patterns)\nTo guarantee a premium, non-generic output, you MUST strictly avoid these common AI design signatures unless explicitly requested:\n\n### Visual & CSS\n* **NO Neon/Outer Glows:** Do not use default `box-shadow` glows or auto-glows. Use inner borders or subtle tinted shadows.\n* **NO Pure Black:** Never use `#000000`. Use Off-Black, Zinc-950, or Charcoal.\n* **NO Oversaturated Accents:** Desaturate accents to blend elegantly with neutrals.\n* **NO Excessive Gradient Text:** Do not use text-fill gradients for large headers.\n* **NO Custom Mouse Cursors:** They are outdated and ruin performance/accessibility.\n\n### Typography\n* **NO Inter Font:** Banned. Use `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n* **NO Oversized H1s:** The first heading should not scream. Control hierarchy with weight and color, not just massive scale.\n* **Serif Constraints:** Use Serif fonts ONLY for creative/editorial designs. **NEVER** use Serif on clean Dashboards.\n\n### Layout & Spacing\n* **Align & Space Perfectly:** Ensure padding and margins are mathematically perfect. Avoid floating elements with awkward gaps.\n* **NO 3-Column Card Layouts:** The generic \"3 equal cards horizontally\" feature row is BANNED. Use a 2-column Zig-Zag, asymmetric grid, or horizontal scrolling approach instead.\n\n### Content & Data (The \"Jane Doe\" Effect)\n* **NO Generic Names:** \"John Doe\", \"Sarah Chan\", or \"Jack Su\" are banned. Use highly creative, realistic-sounding names.\n* **NO Generic Avatars:** DO NOT use standard SVG \"egg\" or Lucide user icons for avatars. Use creative, believable photo placeholders or specific styling.\n* **NO Fake Numbers:** Avoid predictable outputs like `99.99%`, `50%`, or basic phone numbers (`1234567`). Use organic, messy data (`47.2%`, `+1 (312) 847-1928`).\n* **NO Startup Slop Names:** \"Acme\", \"Nexus\", \"SmartFlow\". Invent premium, contextual brand names.\n* **NO Filler Words:** Avoid AI copywriting clichés like \"Elevate\", \"Seamless\", \"Unleash\", or \"Next-Gen\". Use concrete verbs.\n\n### External Resources & Components\n* **NO Broken Unsplash Links:** Do not use Unsplash. Use absolute, reliable placeholders like `https://picsum.photos/seed/{random_string}/800/600` or SVG UI Avatars.\n* **shadcn/ui Customization:** You may use `shadcn/ui`, but NEVER in its generic default state. You MUST customize the radii, colors, and shadows to match the high-end project aesthetic.\n* **Production-Ready Cleanliness:** Code must be extremely clean, visually striking, memorable, and meticulously refined in every detail.\n\n## 8. THE CREATIVE ARSENAL (High-End Inspiration)\nDo not default to generic UI. Pull from this library of advanced concepts to ensure the output is visually striking and memorable. When appropriate, leverage **GSAP (ScrollTrigger/Parallax)** for complex scrolltelling or **ThreeJS/WebGL** for 3D/Canvas animations, rather than basic CSS motion. **CRITICAL:** Never mix GSAP/ThreeJS with Framer Motion in the same component tree. Default to Framer Motion for UI/Bento interactions. Use GSAP/ThreeJS EXCLUSIVELY for isolated full-page scrolltelling or canvas backgrounds, wrapped in strict useEffect cleanup blocks.\n\n### The Standard Hero Paradigm\n* Stop doing centered text over a dark image. Try asymmetric Hero sections: Text cleanly aligned to the left or right. The background should feature a high-quality, relevant image with a subtle stylistic fade (darkening or lightening gracefully into the background color depending on if it is Light or Dark mode).\n\n### Navigation & Menüs\n* **Mac OS Dock Magnification:** Nav-bar at the edge; icons scale fluidly on hover.\n* **Magnetic Button:** Buttons that physically pull toward the cursor.\n* **Gooey Menu:** Sub-items detach from the main button like a viscous liquid.\n* **Dynamic Island:** A pill-shaped UI component that morphs to show status/alerts.\n* **Contextual Radial Menu:** A circular menu expanding exactly at the click coordinates.\n* **Floating Speed Dial:** A FAB that springs out into a curved line of secondary actions.\n* **Mega Menu Reveal:** Full-screen dropdowns that stagger-fade complex content.\n\n### Layout & Grids\n* **Bento Grid:** Asymmetric, tile-based grouping (e.g., Apple Control Center).\n* **Masonry Layout:** Staggered grid without fixed row heights (e.g., Pinterest).\n* **Chroma Grid:** Grid borders or tiles showing subtle, continuously animating color gradients.\n* **Split Screen Scroll:** Two screen halves sliding in opposite directions on scroll.\n* **Curtain Reveal:** A Hero section parting in the middle like a curtain on scroll.\n\n### Cards & Containers\n* **Parallax Tilt Card:** A 3D-tilting card tracking the mouse coordinates.\n* **Spotlight Border Card:** Card borders that illuminate dynamically under the cursor.\n* **Glassmorphism Panel:** True frosted glass with inner refraction borders.\n* **Holographic Foil Card:** Iridescent, rainbow light reflections shifting on hover.\n* **Tinder Swipe Stack:** A physical stack of cards the user can swipe away.\n* **Morphing Modal:** A button that seamlessly expands into its own full-screen dialog container.\n\n### Scroll-Animations\n* **Sticky Scroll Stack:** Cards that stick to the top and physically stack over each other.\n* **Horizontal Scroll Hijack:** Vertical scroll translates into a smooth horizontal gallery pan.\n* **Locomotive Scroll Sequence:** Video/3D sequences where framerate is tied directly to the scrollbar.\n* **Zoom Parallax:** A central background image zooming in/out seamlessly as you scroll.\n* **Scroll Progress Path:** SVG vector lines or routes that draw themselves as the user scrolls.\n* **Liquid Swipe Transition:** Page transitions that wipe the screen like a viscous liquid.\n\n### Galleries & Media\n* **Dome Gallery:** A 3D gallery feeling like a panoramic dome.\n* **Coverflow Carousel:** 3D carousel with the center focused and edges angled back.\n* **Drag-to-Pan Grid:** A boundless grid you can freely drag in any compass direction.\n* **Accordion Image Slider:** Narrow vertical/horizontal image strips that expand fully on hover.\n* **Hover Image Trail:** The mouse leaves a trail of popping/fading images behind it.\n* **Glitch Effect Image:** Brief RGB-channel shifting digital distortion on hover.\n\n### Typography & Text\n* **Kinetic Marquee:** Endless text bands that reverse direction or speed up on scroll.\n* **Text Mask Reveal:** Massive typography acting as a transparent window to a video background.\n* **Text Scramble Effect:** Matrix-style character decoding on load or hover.\n* **Circular Text Path:** Text curved along a spinning circular path.\n* **Gradient Stroke Animation:** Outlined text with a gradient continuously running along the stroke.\n* **Kinetic Typography Grid:** A grid of letters dodging or rotating away from the cursor.\n\n### Micro-Interactions & Effects\n* **Particle Explosion Button:** CTAs that shatter into particles upon success.\n* **Liquid Pull-to-Refresh:** Mobile reload indicators acting like detaching water droplets.\n* **Skeleton Shimmer:** Shifting light reflections moving across placeholder boxes.\n* **Directional Hover Aware Button:** Hover fill entering from the exact side the mouse entered.\n* **Ripple Click Effect:** Visual waves rippling precisely from the click coordinates.\n* **Animated SVG Line Drawing:** Vectors that draw their own contours in real-time.\n* **Mesh Gradient Background:** Organic, lava-lamp-like animated color blobs.\n* **Lens Blur Depth:** Dynamic focus blurring background UI layers to highlight a foreground action.\n\n## 9. THE \"MOTION-ENGINE\" BENTO PARADIGM\nWhen generating modern SaaS dashboards or feature sections, you MUST utilize the following \"Bento 2.0\" architecture and motion philosophy. This goes beyond static cards and enforces a \"Vercel-core meets Dribbble-clean\" aesthetic heavily reliant on perpetual physics.\n\n### A. Core Design Philosophy\n* **Aesthetic:** High-end, minimal, and functional.\n* **Palette:** Background in `#f9fafb`. Cards are pure white (`#ffffff`) with a 1px border of `border-slate-200/50`.\n* **Surfaces:** Use `rounded-[2.5rem]` for all major containers. Apply a \"diffusion shadow\" (a very light, wide-spreading shadow, e.g., `shadow-[0_20px_40px_-15px_rgba(0,0,0,0.05)]`) to create depth without clutter.\n* **Typography:** Strict `Geist`, `Satoshi`, or `Cabinet Grotesk` font stack. Use subtle tracking (`tracking-tight`) for headers.\n* **Labels:** Titles and descriptions must be placed **outside and below** the cards to maintain a clean, gallery-style presentation.\n* **Pixel-Perfection:** Use generous `p-8` or `p-10` padding inside cards.\n\n### B. The Animation Engine Specs (Perpetual Motion)\nAll cards must contain **\"Perpetual Micro-Interactions.\"** Use the following Framer Motion principles:\n* **Spring Physics:** No linear easing. Use `type: \"spring\", stiffness: 100, damping: 20` for a premium, weighty feel.\n* **Layout Transitions:** Heavily utilize the `layout` and `layoutId` props to ensure smooth re-ordering, resizing, and shared element state transitions.\n* **Infinite Loops:** Every card must have an \"Active State\" that loops infinitely (Pulse, Typewriter, Float, or Carousel) to ensure the dashboard feels \"alive\".\n* **Performance:** Wrap dynamic lists in `<AnimatePresence>` and optimize for 60fps. **PERFORMANCE CRITICAL:** Any perpetual motion or infinite loop MUST be memoized (React.memo) and completely isolated in its own microscopic Client Component. Never trigger re-renders in the parent layout.\n\n### C. The 5-Card Archetypes (Micro-Animation Specs)\nImplement these specific micro-animations when constructing Bento grids (e.g., Row 1: 3 cols | Row 2: 2 cols split 70/30):\n1. **The Intelligent List:** A vertical stack of items with an infinite auto-sorting loop. Items swap positions using `layoutId`, simulating an AI prioritizing tasks in real-time.\n2. **The Command Input:** A search/AI bar with a multi-step Typewriter Effect. It cycles through complex prompts, including a blinking cursor and a \"processing\" state with a shimmering loading gradient.\n3. **The Live Status:** A scheduling interface with \"breathing\" status indicators. Include a pop-up notification badge that emerges with an \"Overshoot\" spring effect, stays for 3 seconds, and vanishes.\n4. **The Wide Data Stream:** A horizontal \"Infinite Carousel\" of data cards or metrics. Ensure the loop is seamless (using `x: [\"0%\", \"-100%\"]`) with a speed that feels effortless.\n5. **The Contextual UI (Focus Mode):** A document view that animates a staggered highlight of a text block, followed by a \"Float-in\" of a floating action toolbar with micro-icons.\n\n## 10. FINAL PRE-FLIGHT CHECK\nEvaluate your code against this matrix before outputting. This is the **last** filter you apply to your logic.\n- [ ] Is global state used appropriately to avoid deep prop-drilling rather than arbitrarily?\n- [ ] Is mobile layout collapse (`w-full`, `px-4`, `max-w-7xl mx-auto`) guaranteed for high-variance designs?\n- [ ] Do full-height sections safely use `min-h-[100dvh]` instead of the bugged `h-screen`?\n- [ ] Do `useEffect` animations contain strict cleanup functions?\n- [ ] Are empty, loading, and error states provided?\n- [ ] Are cards omitted in favor of spacing where possible?\n- [ ] Did you strictly isolate CPU-heavy perpetual animations in their own Client Components?\n","frontmatter":{"name":"design-taste-frontend-v1","description":"The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility."},"isInternal":false,"tokens":5154,"sizeBytes":21195},{"name":"SKILL.md","path":".agents/skills/design-taste-frontend/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/design-taste-frontend/SKILL.md","title":"design-taste-frontend","category":"anthropic-skill","format":"markdown","content":"---\nname: design-taste-frontend\ndescription: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.\n---\n\n# tasteskill: Anti-Slop Frontend Skill\n\n> Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.\n> Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.\n\n---\n\n## 0. BRIEF INFERENCE (Read the Room Before Anything Else)\n\nBefore touching code or tweaking dials, **infer what the user actually wants**. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.\n\n### 0.A Read these signals first\n1. **Page kind** - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.\n2. **Vibe words** the user used - \"minimalist\", \"calm\", \"Linear-style\", \"Awwwards\", \"brutalist\", \"premium consumer\", \"Apple-y\", \"playful\", \"serious B2B\", \"editorial\", \"agency-y\", \"glassy\", \"dark tech\".\n3. **Reference signals** - URLs they linked, screenshots they pasted, products they named, brands they're competing with.\n4. **Audience** - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.\n5. **Brand assets that already exist** - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).\n6. **Quiet constraints** - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.\n\n### 0.B Output a one-line \"Design Read\" before generating\nBefore any code, state in one line: **\"Reading this as: \\<page kind> for \\<audience>, with a \\<vibe> language, leaning toward \\<design system or aesthetic family>.\"**\n\nExample reads:\n- *\"Reading this as: B2B SaaS landing for technical buyers, with a Linear-style minimalist language, leaning toward Tailwind utilities + Geist + restrained motion.\"*\n- *\"Reading this as: solo designer portfolio for hiring managers, with an editorial / kinetic-type language, leaning toward native CSS + scroll-driven animation + custom typography.\"*\n- *\"Reading this as: redesign of a public-sector service site, with a trust-first language, leaning toward GOV.UK Frontend or USWDS.\"*\n\n### 0.C If the brief is ambiguous, ask one question, do not guess\nAsk exactly **one** clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: *\"Should this feel closer to Linear-clean or Awwwards-experimental?\"*\n\nIf you can confidently infer from context, **do not ask**. Just declare the design read and proceed.\n\n### 0.D Anti-Default Discipline\nDo not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.\n\n---\n\n## 1. THE THREE DIALS (Core Configuration)\n\nAfter the design read, set three dials. Every layout, motion, and density decision below is gated by these.\n\n* **`DESIGN_VARIANCE: 8`** - 1 = Perfect Symmetry, 10 = Artsy Chaos\n* **`MOTION_INTENSITY: 6`** - 1 = Static, 10 = Cinematic / Physics\n* **`VISUAL_DENSITY: 4`** - 1 = Art Gallery / Airy, 10 = Cockpit / Packed Data\n\n**Baseline:** `8 / 6 / 4`. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.\n\n### 1.A Dial Inference (design read → dial values)\n| Signal | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| \"minimalist / clean / calm / editorial / Linear-style\" | 5-6 | 3-4 | 2-3 |\n| \"premium consumer / Apple-y / luxury / brand\" | 7-8 | 5-7 | 3-4 |\n| \"playful / wild / Dribbble / Awwwards / experimental / agency\" | 9-10 | 8-10 | 3-4 |\n| \"landing page / portfolio / marketing site (default)\" | 7-9 | 6-8 | 3-5 |\n| \"trust-first / public-sector / regulated / accessibility-critical\" | 3-4 | 2-3 | 4-5 |\n| \"redesign - preserve\" | match existing | +1 | match existing |\n| \"redesign - overhaul\" | +2 | +2 | match existing |\n\n### 1.B Use-Case Presets\n| Use case | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| Landing (SaaS, mainstream) | 7 | 6 | 4 |\n| Landing (Agency / creative) | 9 | 8 | 3 |\n| Landing (Premium consumer) | 7 | 6 | 3 |\n| Portfolio (Designer / studio) | 8 | 7 | 3 |\n| Portfolio (Developer) | 6 | 5 | 4 |\n| Editorial / Blog | 6 | 4 | 3 |\n| Public-sector service | 3 | 2 | 5 |\n| Redesign - preserve | match | match+1 | match |\n| Redesign - overhaul | +2 | +2 | match |\n\n### 1.C How the Dials Drive Output\nUse these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like `LAYOUT_VARIANCE` or `ANIM_LEVEL`.\n\n---\n\n## 2. BRIEF → DESIGN SYSTEM MAP\n\nOnce you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.\n\n### 2.A When to reach for a real design system (use official packages)\n| Brief reads as… | Reach for | Why |\n|---|---|---|\n| Microsoft / enterprise SaaS / dashboards | `@fluentui/react-components` or `@fluentui/web-components` | Official Fluent UI, Microsoft tokens, accessibility done |\n| Google-ish UI, Material-flavored product | `@material/web` + Material 3 tokens | Official, theme-able via Material Theming |\n| IBM-style B2B / enterprise analytics | `@carbon/react` + `@carbon/styles` | Official Carbon, mature data-density patterns |\n| Shopify app surfaces | `polaris.js` web components / Polaris React | Required for Shopify admin UI |\n| Atlassian / Jira-style product | `@atlaskit/*` + `@atlaskit/tokens` | Official Atlassian DS |\n| GitHub-style devtool / community page | `@primer/css` or `@primer/react-brand` | Official Primer; Brand variant for marketing |\n| Public-sector UK service | `govuk-frontend` | Legally / regulatorily expected |\n| US public-sector / trust-first | `uswds` | Same |\n| Fast local-business / agency MVP | Bootstrap 5.3 | Boring, fast, works |\n| Modern accessible React foundation | `@radix-ui/themes` | Primitives + polished theme |\n| Modern SaaS where you own the components | shadcn/ui (`npx shadcn@latest add ...`) | You own the code, easy to customise; never ship default state |\n| Tailwind-based modern SaaS / AI marketing | Tailwind v4 utilities + `dark:` variant | Default for indie + small team builds |\n\n**Honesty rule:** if the brief reads as one of the systems above, install and use the **official** package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.\n\n**One system per project.** Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.\n\n### 2.B When the brief is an aesthetic, not a system\nFor these directions, there is **no single official package**. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.\n\n| Aesthetic | Honest implementation |\n|---|---|\n| Glassmorphism / \"frosted glass\" | `backdrop-filter`, layered borders, highlight overlays. Provide solid-fill fallback for `prefers-reduced-transparency`. |\n| Bento (Apple-style tile grids) | CSS Grid with mixed cell sizes. No single library owns this. |\n| Brutalism | Native CSS, monospace, raw borders. No library. |\n| Editorial / magazine | Serif type, asymmetric grid, generous whitespace. No library. |\n| Dark tech / hacker | Mono + accent neon, terminal motifs. No library. |\n| Aurora / mesh gradients | SVG or layered radial gradients. No library. |\n| Kinetic typography | Native CSS animations, scroll-driven animations, GSAP for hijacks. No library. |\n| **Apple Liquid Glass** | Apple documents this for Apple platforms only. **There is no official `liquid-glass.css`.** Web implementations are approximations using `backdrop-filter` + layered borders + highlights. Label clearly as approximation. |\n\n---\n\n## 3. DEFAULT ARCHITECTURE & CONVENTIONS\n\nUnless the design read picks a real design system (Section 2.A), these are the defaults:\n\n### 3.A Stack\n* **Framework:** React or Next.js. Default to Server Components (RSC).\n  * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n  * **INTERACTIVITY ISOLATION:** Any component using Motion, scroll listeners, or pointer physics MUST be an isolated leaf with `'use client'` at the top. Server Components render static layouts only.\n* **Styling:** **Tailwind v4** (default). Tailwind v3 only if the existing project demands it.\n  * For v4: do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **Animation:** **Motion** (the library formerly known as Framer Motion). Import from `motion/react` (`import { motion } from \"motion/react\"`). The `framer-motion` package still works as a legacy alias - prefer `motion/react` in new code.\n* **Fonts:** Always use `next/font` (Next.js) or self-host with `@font-face` + `font-display: swap`. Never link Google Fonts via `<link>` in production.\n\n### 3.B State\n* Local `useState` / `useReducer` for isolated UI.\n* Global state ONLY for deep prop-drilling avoidance - Zustand, Jotai, or React context.\n* **NEVER** use `useState` to track continuous values driven by user input (mouse position, scroll progress, pointer physics, magnetic hover). Use Motion's `useMotionValue` / `useTransform` / `useScroll`. `useState` re-renders the React tree on every change and collapses on mobile.\n\n### 3.C Icons\n* **Allowed libraries (priority order):** `@phosphor-icons/react`, `hugeicons-react`, `@radix-ui/react-icons`, `@tabler/icons-react`.\n* **Discouraged:** `lucide-react`. Acceptable only when the user explicitly asks for it or the project already depends on it.\n* **NEVER hand-roll SVG icons.** If a glyph is missing, install a second library or compose from primitives - do not draw icon paths from scratch.\n* **One family per project.** Do not mix Phosphor with Lucide in the same component tree.\n* **Standardize `strokeWidth` globally** (e.g. `1.5` or `2.0`).\n\n### 3.D Emoji Policy\nDiscouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. **Override:** allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.\n\n### 3.E Responsiveness & Layout Mechanics\n* Standardize breakpoints (`sm 640`, `md 768`, `lg 1024`, `xl 1280`, `2xl 1536`).\n* Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n* **Viewport Stability:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent layout jumping on mobile (iOS Safari address bar).\n* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`).\n\n### 3.F Dependency Verification (mandatory)\nBefore importing ANY 3rd-party library, check `package.json`. If the package is missing, output the install command first. **Never** assume a library exists.\n\n---\n\n## 4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\n\nLLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.\n\n### 4.1 Typography\n* **Display / Headlines:** Default `text-4xl md:text-6xl tracking-tighter leading-none`.\n* **Body / Paragraphs:** Default `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n* **Sans font choice:**\n  * **Discouraged as default:** `Inter`. Pick `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`, or a brand-appropriate serif first.\n  * **Override:** Inter is acceptable when the user explicitly asks for a neutral / standard / Linear-style feel, or when the brief is a public-sector / accessibility-first site.\n* **Pairings to know:** `Geist` + `Geist Mono`, `Satoshi` + `JetBrains Mono`, `Cabinet Grotesk` + `Inter Tight`, `GT America` + `IBM Plex Mono`.\n\n* **SERIF DISCIPLINE (VERY DISCOURAGED AS DEFAULT):**\n  * Serif is **very discouraged as the default font for any project.** \"It feels creative / premium / editorial\" is NOT a reason to reach for serif. The agent's default mental model that \"creative brief = serif\" is the single most-tested AI tell in production rounds.\n  * **Serif is only acceptable when ONE of these is explicitly true:**\n    - The brand brief literally names a serif font, OR\n    - The aesthetic family is genuinely editorial / luxury / publication / manuscript / heritage / vintage AND you can articulate why this specific serif fits this specific brand\n  * For everything else (creative agency, design studio, modern brand, premium consumer, portfolio, lifestyle), **default sans-serif display** (Geist Display, ABC Diatype, Söhne Breit, Cabinet Grotesk Display, Migra Sans, GT Walsheim, Inter Display, PP Neue Montreal). Sans display fonts are not \"boring\" — they are the default for the same reason black is the default in fashion.\n  * **EMPHASIS RULE (related):** When you want to emphasize a word within a headline (the kinetic \"and `spatial` design\" type move), use **italic or bold of the SAME font**. Do NOT inject a random serif word into a sans headline (or vice versa) just to add visual interest. Mixed-family emphasis is amateur. Italic/bold emphasis in the same family is the right move.\n  * **Specifically BANNED as defaults:** `Fraunces` and `Instrument_Serif` (the two LLM-favorite display serifs).\n  * **If a serif is justified** (rare, per the above), rotate from this pool, do NOT reuse the same serif across consecutive projects: PP Editorial New, GT Sectra Display, Cardinal Grotesque, Reckless Neue, Tiempos Headline, Recoleta, Cormorant Garamond, Playfair Display, EB Garamond, IvyPresto, Migra, Editorial Old, Saol Display, Söhne Breit Kursiv, Domaine Display, Canela, Schnyder, Tobias, NB Architekt, ITC Galliard.\n\n* **ITALIC DESCENDER CLEARANCE (mandatory):** When italic is used in display type and the word contains a descender letter (`y g j p q`), `leading-[1]` or `leading-none` will clip the descender. Use `leading-[1.1]` minimum and add `pb-1` or `mb-1` reserve on the wrapping element. Audit every italic word in display headlines before shipping.\n\n### 4.2 Color Calibration\n* Max 1 accent color. Saturation < 80% by default.\n* **THE LILA RULE:** The \"AI Purple / Blue glow\" aesthetic is discouraged as a default. No automatic purple button glows, no random neon gradients. Use neutral bases (Zinc / Slate / Stone) with high-contrast singular accents (Emerald, Electric Blue, Deep Rose, Burnt Orange, etc.).\n* **Override:** if the brand or brief explicitly asks for purple / violet / lila, embrace it. But execute with intent: consistent palette, harmonised neutrals, restrained gradients. Not generic AI gradient slop.\n* **One palette per project.** Do not fluctuate between warm and cool grays within the same project.\n* **COLOR CONSISTENCY LOCK (mandatory):** Once an accent color is chosen for a page, it is used on the WHOLE page. A warm-grey site does not suddenly get a blue CTA in section 7. A rose-accented site does not get a teal status badge in the footer. Pick one accent, lock it, audit every component before shipping.\n\n* **PREMIUM-CONSUMER PALETTE BAN (mandatory, second-most-recurring AI-tell):**\n  * For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage craft, DTC home goods, etc.) the LLM default is **warm beige/cream + brass/clay/oxblood/ochre + espresso/ink dark text**. Concretely banned hex families as default backgrounds and accents:\n    - Backgrounds: `#f5f1ea`, `#f7f5f1`, `#fbf8f1`, `#efeae0`, `#ece6db`, `#faf7f1`, `#e8dfcb` (all \"warm paper / cream / chalk / bone\")\n    - Accents: `#b08947`, `#b6553a`, `#9a2436`, `#9c6e2a`, `#bc7c3a`, `#7d5621` (all \"brass / clay / oxblood / ochre\")\n    - Text: `#1a1714`, `#1a1814`, `#1b1814` (all \"espresso / warm near-black\")\n  * This palette is BANNED as the default reach for premium-consumer briefs. Every premium-consumer site you have ever shipped uses this exact palette. The brand becomes invisible.\n  * **Default alternatives (rotate, do not reuse):**\n    - **Cold Luxury:** silver-grey + chrome + smoke (think Tesla, Apple Watch Hermes-without-the-leather)\n    - **Forest:** deep green + bone + amber accent (think Filson, Patagonia premium)\n    - **Black and Tan:** true off-black + warm tan, sharp contrast, no beige\n    - **Cobalt + Cream:** saturated blue against a single neutral, no brass\n    - **Terracotta + Slate:** warm rust against cool grey, no brass\n    - **Olive + Brick + Paper:** muted olive plus brick-red accent\n    - **Pure monochrome + single saturated pop:** off-white + off-black + one bright accent (electric blue, emerald, hot pink, etc.)\n  * **Palette-rotation rule:** if the previous premium-consumer project you generated used the beige+brass family, this one MUST use a different family. Do not ship the same warm-craft palette twice in a row.\n  * **Override:** the beige+brass+espresso palette is acceptable ONLY when the brand brief explicitly names those colors, or when the brand identity is genuinely vintage / artisan / warm-craft AND you can articulate why this specific palette fits this specific brand. Default-reaching for it because \"this is a cookware brief\" is banned.\n\n### 4.3 Layout Diversification\n* **ANTI-CENTER BIAS:** Centered Hero / H1 sections are avoided when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left-aligned content / right-aligned asset\", \"Asymmetric white-space\", or scroll-pinned structures.\n* **Override:** centered hero is OK for editorial / manifesto / launch-announcement briefs where the message itself is the design.\n\n### 4.4 Materiality, Shadows, Cards\n* Use cards ONLY when elevation communicates real hierarchy. Otherwise group with `border-t`, `divide-y`, or negative space.\n* When a shadow is used, tint it to the background hue. No pure-black drop shadows on light backgrounds.\n* For `VISUAL_DENSITY > 7`: generic card containers are banned. Data metrics breathe in plain layout.\n* **SHAPE CONSISTENCY LOCK (mandatory):** Pick ONE corner-radius scale for the page and stick to it. Options: all-sharp (radius 0), all-soft (radius 12-16px), all-pill (full radius for interactive). Mixed systems are allowed only when there is a documented rule (e.g. \"buttons are full-pill, cards are 16px, inputs are 8px\") and that rule is followed everywhere. Round buttons in a square layout, or square cards on a pill-button page, is broken design.\n\n### 4.5 Interactive UI States\nLLMs default to \"static successful state only.\" Always implement full cycles:\n* **Loading:** Skeletal loaders matching the final layout's shape. Avoid generic circular spinners.\n* **Empty States:** Beautifully composed; indicate how to populate.\n* **Error States:** Clear, inline (forms), or contextual (toasts only for transient).\n* **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push.\n* **BUTTON CONTRAST CHECK (mandatory, a11y):** Before shipping any button, verify the button text is readable against the button background. White button + white text, `bg-white` CTA with `text-white` label, transparent button against the page background with no border → all banned. Audit every CTA: contrast ratio WCAG AA min (4.5:1 for body, 3:1 for large text 18px+). Same rule applies to ghost buttons over photographic backgrounds (use a backdrop, scrim, or stroke).\n* **CTA BUTTON WRAP BAN (mandatory):** Button text MUST fit on one line at desktop. If a label like \"VIEW SELECTED WORK\" wraps to 2 or 3 lines, the button is broken. Fix by EITHER shortening the label (3 words max for primary CTAs, ideally 1-2) OR widening the button (do not artificially constrain `max-width` on CTAs). Wrapped CTAs at desktop are a Pre-Flight Fail.\n* **NO DUPLICATE CTA INTENT (mandatory):** Two CTAs with the same intent on one page is a Pre-Flight Fail. Examples of same intent: \"Get in touch\" + \"Contact us\" + \"Let's talk\" + \"Start a project\" + \"Start something\" + \"Reach out\" = all \"contact\" intent → pick ONE label and use it everywhere on the page (nav, hero, footer). Same for \"Try free\" + \"Get started\" + \"Sign up free\" (all \"signup\" intent) and \"View work\" + \"See selected work\" + \"Browse projects\" (all \"portfolio\" intent). One label per intent.\n* **FORM CONTRAST CHECK (mandatory, a11y):** Form inputs, placeholder text, focus rings, helper text, and error text all pass WCAG AA contrast against the section background. Light placeholders on a near-white form, white form on white page section, form labels grayer than 4.5:1 contrast → all banned. Audit every form before shipping.\n\n### 4.6 Data & Form Patterns\n* Label ABOVE input. Helper text optional but present in markup. Error text BELOW input. Standard `gap-2` for input blocks.\n* No placeholder-as-label. Ever.\n\n### 4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)\n\n* **Hero MUST fit in the initial viewport.** Headline max 2 lines on desktop, subtext max **20 words** AND max 3-4 lines, CTAs visible without scroll. If the copy is too long: reduce font scale OR cut copy. If you cannot describe the value-prop in 20 words of subtext, the value-prop is unclear, not the rule too tight. Never let the hero overflow and force scroll to find the CTA.\n* **Hero font-scale discipline.** Plan font size and image size *together*. If the hero asset is large and the headline is more than 6 words, do not start at `text-7xl/text-8xl`. Default sensible range: `text-4xl md:text-5xl lg:text-6xl` for most heroes; `text-6xl md:text-7xl` only when the headline is 3-5 words. A 4-line hero headline is always a font-size error, never a copy-length error.\n* **HERO TOP PADDING CAP (mandatory):** Hero top padding max `pt-24` (≈6rem) at desktop. More than that means the hero content floats halfway down the viewport and reads as a layout bug, not as intentional space. If your hero needs more breathing room, increase font scale or asset size, not top padding.\n* **HERO STACK DISCIPLINE (max 4 text elements).** The hero is a single moment, not a feature list. Allowed text elements, max 4 in total:\n  1. Eyebrow (small uppercase label) OR brand strip OR neither - pick zero or one\n  2. Headline (max 2 lines, see above)\n  3. Subtext (max 20 words, max 4 lines)\n  4. CTAs (1 primary + max 1 secondary)\n  - **BANNED in the hero:** tiny tagline below CTAs (\"Works with GitHub, GitLab, and self-hosted Git\"), trust micro-strip (\"Used by engineering teams at...\"), pricing teaser (\"Free for solo, $10/user for teams\"), feature bullet list, social-proof avatar row. All of those move to dedicated sections directly below the hero.\n  - If you have an eyebrow AND a tagline below CTAs in the same hero, drop the tagline. If you have a brand strip AND a tagline, drop the tagline. One small text element per hero, max.\n* **\"Used by\" / \"Trusted by\" logo wall belongs UNDER the hero, never inside it.** The hero is for the value prop and primary CTA. The logo wall is a separate section directly below. Do not stuff trust logos into the same flex row as the hero copy.\n* **Navigation MUST render on a single line on desktop.** If items don't fit at `lg` (1024px), condense labels, drop secondary items, or move to a hamburger. A two-line nav at desktop is broken design.\n* **Navigation height cap: 80px max desktop, default 64-72px.** No huge \"agency\" nav bars that eat 15% of the viewport.\n* **Bento grids MUST have rhythm, not one-sided repetition.** Do not stack 6 left-image / right-text rows. Vary the composition: alternate full-width feature rows, asymmetric tile sizes, vertical breaks.\n* **BENTO CELL COUNT RULE (mandatory):** A bento grid has EXACTLY as many cells as you have content for. 3 items → 3 cells (1+2 split, or 2+1, or asymmetric trio). 5 items → 5 cells (2+3, 3+2, hero+4, etc.). If your grid has an empty cell in the middle or at the end, you planned wrong. Re-shape the grid; do not paste a blank tile.\n* **Section-Layout-Repetition Ban.** Once you use a layout family for a section (e.g., 3-column-image-cards, full-width-quote, split-text-image), that family can appear at most ONCE on the page. \"Selected commissions\" must not look like \"What we do.\" A landing page with 8 sections must use at least 4 different layout families.\n* **ZIGZAG ALTERNATION CAP (mandatory).** Alternating \"left-image + right-text\" then \"left-text + right-image\" zigzag layout = banal. Max 2 sections in a row with this image+text-split pattern. The 3rd consecutive image+text split is a Pre-Flight Fail. Break the pattern with a full-width section, a vertical-stack section, a bento grid, a marquee, or a different layout family.\n* **EYEBROW RESTRAINT (mandatory, the #1 violated rule in production tests).** An \"eyebrow\" is the small uppercase wide-tracking label sitting above a section headline (e.g. `FOUR COLORWAYS`, `SELECTED WORK`, `THE HARDWARE`, `Git-native task management`). Typical CSS signature: `text-[11px] uppercase tracking-[0.18em]`, `font-mono text-[10.5px] uppercase tracking-[0.22em]`. Every AI-built site puts an eyebrow above EVERY section header, producing the same templated rhythm. Hard rule:\n  - **Maximum 1 eyebrow per 3 sections.** Hero counts as 1. So a page with 9 sections may use at most 3 eyebrows total.\n  - If section A has an eyebrow, the next 2 sections cannot have one.\n  - **Pre-Flight Check is mechanical:** count instances of `uppercase tracking` (or similar small-caps mono labels above headlines) across all section components. If count > ceil(sectionCount / 3), the output fails.\n  - **What to do instead of an eyebrow:** drop it entirely. The headline alone is enough. If you need to categorize a section, the section's location on the page already categorizes it; no label needed.\n* **SPLIT-HEADER BAN (mandatory).** The pattern \"left big headline + right small explainer paragraph\" as a section header (left col-span-7/8, right col-span-4/5 with a small body paragraph floating in the right column) is **banned as default**. Sections should have ONE focused message. If you genuinely need both a headline and an explainer paragraph, stack them vertically (headline on top, body below, max-width 65ch). Reach for the split-header pattern only when there is a real compositional reason (e.g., the right column carries a visual or interactive element, not just filler text).\n* **Bento Background Diversity (mandatory).** Bento and feature-grid sections cannot be 6 white-on-white cards with text inside. At least 2-3 cells in any multi-cell grid need real visual variation: a real image, a brand-appropriate gradient (not AI-purple), a pattern, a tinted background. A cream-on-cream bento with only typography inside reads as boring AI default, even when the rest of the page is good.\n* **Mobile collapse must be explicit per section.** For every multi-column layout, declare the `< 768px` fallback in the same component. No \"it'll work, Tailwind handles it\" assumptions.\n\n### 4.8 Image & Visual Asset Strategy\n\nLanding pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.\n\n**Priority order for visual assets:**\n1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.\n2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:\n   * `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)\n   * Actual stock or brand URLs when the brief provides them\n   * Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed\n3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based \"fake screenshots.\" Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *\"This page needs real images at: \\[list of placements\\]. Please generate or provide them.\"*\n\n**Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.\n\n**Real company logos for social proof.** When the brief calls for a \"Trusted by / Used by / Customers\" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:\n* **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.\n* **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).\n* **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.\n* **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).\n* **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.\n\n**Hand-rolled illustrations:**\n* SVG icons from libraries: fine (see Section 3.C).\n* Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:\n  - The brief explicitly calls for it (\"draw me an SVG logo\")\n  - It's a single, simple geometric mark (a square, a circle, a wordmark in display type)\n  - You're confident in the output quality\n\n**Div-based fake screenshots are banned.** A \"hand-built product preview\" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:\n* Use a real screenshot URL if one exists\n* Generate one via image tool\n* Use a real component preview (an actual mini-version of the UI inside the page)\n* Or skip the preview entirely and use editorial photography\n\n**Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.\n\n### 4.9 Content Density\n\nLanding pages live on the **first impression**, not the full read. Cut ruthlessly.\n\n* **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.\n* **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:\n  - Top 3-5 highlights + \"View full list\" link\n  - Marquee / carousel for breadth\n  - Different page entirely if the data is the product\n* **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:\n  - 2-column split with grouped items\n  - Card grid with image + label per item\n  - Tabs / accordion if items are categorisable\n  - Horizontal scroll-snap pills\n  - Carousel for breadth-heavy lists (testimonials, logos, capabilities)\n  - Marquee for \"lots-of-things-that-don't-need-individual-attention\"\n  A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.\n* **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:\n  - **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line \"why it matters\" body. Cards arranged 2-col on desktop, 1-col mobile.\n  - **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.\n  - **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. \"Materials\", \"Cooking\", \"Warranty\"), each cluster gets ONE soft divider and a cluster heading.\n  - **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a \"View full specifications\" disclosure.\n\n* **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:\n  - **Grammatically broken** (\"free on its past\", \"two plans but one is honest\", \"to put it on the table\" out of context)\n  - **Has unclear referents** (\"we plan to stay that way\" without prior context)\n  - **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, \"elegant nothing\" phrases)\n  - **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)\n  Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.\n* **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:\n  - Come from real data (brief, brand guidelines, public metrics) - fine\n  - Are explicitly labeled as mock (`<!-- mock -->`, \"example\", \"sample data\") - fine\n  - Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.\n* **One copy register per page.** Don't mix technical mono (\"47 tasks · 0.6 ctx-switches/day\"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.\n\n### 4.10 Quotes & Testimonials\n\n* **Max 3 lines** of quote body. Never 6. If the original quote is longer → cut it. A landing-page quote is a snippet, not the full review.\n* For very small font sizes (e.g. footer-style testimonials), the line cap can stretch slightly. Spirit: \"fits in a glance.\"\n* **No em-dashes inside the quote text** as design flourish (long pauses, kinetic em-dashes, em-dash-bullets). See Section 9.G - em-dash is completely banned.\n* Attribution: name + role + (optionally) company. Never name only (\"- Sarah\").\n* Quote marks: use real typographic quotes ( \" \" ) or none at all. Not straight ASCII ( \" ).\n\n### 4.11 Page Theme Lock (Light / Dark Mode Consistency)\n\nThe page has ONE theme. Sections do not invert.\n\n* If the page is dark mode, ALL sections are dark mode. No light-mode-warm-paper section sandwiched between dark sections (or vice versa). The user must not feel they walked into a different website mid-scroll.\n* The exception: if the brief explicitly calls for a \"Color Block Story\" or \"Theme Switch on Scroll\" device AND that is a deliberate composition (one full theme switch with a strong transition, not random alternation), it is allowed once per page.\n* Default behaviour: pick light, dark, or auto (`prefers-color-scheme`) at the page level and lock it. Section-level background tints within the same theme family are fine (`bg-zinc-950` next to `bg-zinc-900`); flipping to `bg-amber-50` in the middle of a `bg-zinc-950` page is broken.\n* When using a design system with built-in theming (Radix Themes, shadcn/ui with `<Theme>`), set the theme ONCE in `layout.tsx` or the page root. Do not let individual sections override.\n\n---\n\n## 5. CONTEXT-AWARE PROACTIVITY\n\nThese are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**\n\n* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or \"boring B2B.\" When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.\n* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.\n* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) - no linear easing.\n* **\"Motion claimed, motion shown.\"** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).\n* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: \"what does this animation communicate?\" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: \"it looked cool\". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.\n* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees (\"logos endlessly scrolling\", \"manifesto scrolling sideways\", \"kinetic word strip\") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.\n* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A \"card stack on scroll\" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: \"top top\"` not `start: \"top center\"` or `\"top 80%\"`.\n* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: \"top top\"`, pin the wrapper, scrub the inner track.\n\n### 5.A Sticky-Stack - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function StickyStack({ cards }: { cards: React.ReactNode[] }) {\n  const ref = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !ref.current) return;\n    const ctx = gsap.context(() => {\n      const cardEls = gsap.utils.toArray<HTMLElement>(\".stack-card\");\n      cardEls.forEach((card, i) => {\n        if (i === cardEls.length - 1) return;\n        ScrollTrigger.create({\n          trigger: card,\n          start: \"top top\",                              // pin at viewport top\n          endTrigger: cardEls[cardEls.length - 1],\n          end: \"top top\",\n          pin: true,\n          pinSpacing: false,\n        });\n        gsap.to(card, {\n          scale: 0.92,\n          opacity: 0.55,\n          ease: \"none\",\n          scrollTrigger: {\n            trigger: cardEls[i + 1],\n            start: \"top bottom\",\n            end: \"top top\",\n            scrub: true,\n          },\n        });\n      });\n    }, ref);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <div ref={ref} className=\"relative\">\n      {cards.map((card, i) => (\n        <div\n          key={i}\n          className=\"stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center\"\n        >\n          {card}\n        </div>\n      ))}\n    </div>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).\n\n### 5.B Horizontal-Pan - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function HorizontalPan({ children }: { children: React.ReactNode }) {\n  const wrap = useRef<HTMLDivElement>(null);\n  const track = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !wrap.current || !track.current) return;\n    const ctx = gsap.context(() => {\n      const distance = track.current!.scrollWidth - window.innerWidth;\n      gsap.to(track.current, {\n        x: -distance,\n        ease: \"none\",\n        scrollTrigger: {\n          trigger: wrap.current,\n          start: \"top top\",                              // pin starts when section top hits viewport top\n          end: () => `+=${distance}`,                    // scroll distance = track width minus viewport\n          pin: true,\n          scrub: 1,\n          invalidateOnRefresh: true,\n        },\n      });\n    }, wrap);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <section ref={wrap} className=\"relative overflow-hidden\">\n      <div ref={track} className=\"flex h-[100dvh] items-center\">\n        {children}\n      </div>\n    </section>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, `end: \"+=${distance}\"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.\n\n### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)\n\nFor simple \"items appear as they enter viewport\" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:\n\n```tsx\n\"use client\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nexport function RevealStagger({ items }: { items: string[] }) {\n  const reduce = useReducedMotion();\n  return (\n    <ul className=\"grid gap-6\">\n      {items.map((item, i) => (\n        <motion.li\n          key={item}\n          initial={reduce ? false : { opacity: 0, y: 24 }}\n          whileInView={{ opacity: 1, y: 0 }}\n          viewport={{ once: true, amount: 0.3 }}\n          transition={{\n            duration: 0.6,\n            delay: i * 0.06,\n            ease: [0.16, 1, 0.3, 1],\n          }}\n        >\n          {item}\n        </motion.li>\n      ))}\n    </ul>\n  );\n}\n```\n\nUse this for: feature lists, testimonial grids, logo walls, anything that just needs \"enter on scroll.\" Save GSAP for actual pin/scrub work.\n\n### 5.D Forbidden Animation Patterns\n\n* **`window.addEventListener(\"scroll\", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).\n* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.\n* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.\n* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props \"for safety\" - it costs measurement work.\n* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.\n\n---\n\n## 6. PERFORMANCE & ACCESSIBILITY GUARDRAILS\n\n### 6.A Hardware Acceleration\n* Animate ONLY `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`.\n* Use `will-change: transform` sparingly - only on elements that will actually animate.\n\n### 6.B Reduced Motion (mandatory)\n* **Any motion above `MOTION_INTENSITY > 3` MUST honor `prefers-reduced-motion`.** This is non-negotiable.\n* In Motion: wrap with `useReducedMotion()` and degrade to static.\n* In CSS: gate animations behind `@media (prefers-reduced-motion: no-preference)` or provide an override block under `@media (prefers-reduced-motion: reduce)` that disables.\n* Infinite loops, parallax, scroll-hijack, and magnetic physics MUST collapse to static / instant under reduced motion.\n\n### 6.C Dark Mode (mandatory for any consumer-facing page)\n* Design for **both modes from the start**. Never ship light-only or dark-only without explicit user instruction.\n* Use Tailwind `dark:` variant OR CSS variables for tokens. Pick one strategy per project.\n* **Do not prescribe specific dark-mode colors here.** The brief decides. Maintain visual hierarchy, brand identity, and WCAG AA contrast (AAA for body) across both modes.\n* Respect `prefers-color-scheme: dark`. Default to system preference unless the brand insists on one mode.\n\n### 6.D Core Web Vitals Targets\n* **LCP** < 2.5s. Hero image must be `next/image priority` or preloaded.\n* **INP** < 200ms. Heavy work off main thread.\n* **CLS** < 0.1. Reserve space for images, fonts, embeds.\n* Run Lighthouse before declaring a page done.\n\n### 6.E DOM Cost\n* Apply grain / noise filters EXCLUSIVELY to fixed, `pointer-events-none` pseudo-elements (e.g., `fixed inset-0 z-[60] pointer-events-none`). NEVER on scrolling containers - continuous GPU repaints destroy mobile FPS.\n* Be aware of bundle size. Motion is not tiny. Three.js is large. Lazy-load anything that's not above-the-fold.\n\n### 6.F Z-Index Restraint\nNEVER spam arbitrary `z-50` or `z-10`. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.\n\n---\n\n## 7. DIAL DEFINITIONS (Technical Reference)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Symmetrical CSS Grid (12-col, equal fr-units), equal paddings, centered alignment.\n* **4-7 (Offset):** `margin-top: -2rem` overlaps, varied image aspect ratios (4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (`grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`).\n* **MOBILE OVERRIDE:** For levels 4-10, asymmetric layouts above `md:` MUST collapse to strict single-column (`w-full`, `px-4`, `py-8`) on viewports `< 768px`.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only. `prefers-reduced-motion` is the default mode anyway.\n* **4-7 (Fluid CSS):** `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. `animation-delay` cascades for load-ins. Focus on `transform` and `opacity`.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals, parallax, scroll-driven animation (CSS `animation-timeline` or GSAP ScrollTrigger). Use Motion hooks. **NEVER use `window.addEventListener('scroll')`** - it is a hard ban, not a \"prefer-not.\" See Section 5.D for the allowed alternatives.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery):** Lots of white space. Huge section gaps (`py-32` to `py-48`). Expensive, clean.\n* **4-7 (Daily App):** Standard web app spacing (`py-16` to `py-24`).\n* **8-10 (Cockpit):** Tight paddings. No card boxes; 1px lines separate data. Mandatory: `font-mono` for all numbers.\n\n---\n\n## 8. DARK MODE PROTOCOL\n\nDual-mode by default. Never assume light-only unless the brief is print-emulating editorial.\n\n### 8.A Token Strategy (pick one, stick to it)\n* **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).\n* **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme=\"dark\"]` or `@media (prefers-color-scheme: dark)`.\n\n### 8.B Do Not Prescribe Specific Colors Here\nThe brief and brand decide. This skill enforces only:\n* **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.\n* **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.\n* **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.\n* **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and o\n\n<!-- [TRUNCATED AT 50KB] -->","frontmatter":{"name":"design-taste-frontend","description":"Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check."},"isInternal":false,"tokens":12619,"sizeBytes":50061},{"name":"SKILL.md","path":".agents/skills/full-output-enforcement/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/full-output-enforcement/SKILL.md","title":"full-output-enforcement","category":"anthropic-skill","format":"markdown","content":"---\nname: full-output-enforcement\ndescription: Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.\n---\n\n# Full-Output Enforcement\n\n## Baseline\n\nTreat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.\n\n## Banned Output Patterns\n\nThe following patterns are hard failures. Never produce them:\n\n**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code\n\n**In prose:** \"Let me know if you want me to continue\", \"I can provide more details if needed\", \"for brevity\", \"the rest follows the same pattern\", \"similarly for the remaining\", \"and so on\" (when replacing actual content), \"I'll leave that as an exercise\"\n\n**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.\n\n## Execution Process\n\n1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.\n2. **Build** — Generate every deliverable completely. No partial drafts, no \"you can extend this later.\"\n3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.\n\n## Handling Long Outputs\n\nWhen a response approaches the token limit:\n\n- Do not compress remaining sections to squeeze them in.\n- Do not skip ahead to a conclusion.\n- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).\n- End with:\n\n```\n[PAUSED — X of Y complete. Send \"continue\" to resume from: next section name]\n```\n\nOn \"continue\", pick up exactly where you stopped. No recap, no repetition.\n\n## Quick Check\n\nBefore finalizing any response, verify:\n- No banned patterns from the list above appear anywhere in the output\n- Every item the user requested is present and finished\n- Code blocks contain actual runnable code, not descriptions of what code would do\n- Nothing was shortened to save space\n","frontmatter":{"name":"full-output-enforcement","description":"Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output."},"isInternal":false,"tokens":569,"sizeBytes":2592},{"name":"SKILL.md","path":".agents/skills/gpt-taste/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/gpt-taste/SKILL.md","title":"gpt-taste","category":"anthropic-skill","format":"markdown","content":"---\nname: gpt-taste\ndescription: Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL DESIGN ENGINEERING\nYou are an elite, award-winning frontend design engineer. Standard LLMs possess severe statistical biases: they generate massive 6-line wrapped headings by using narrow containers, leave ugly empty gaps in bento grids, use cheap meta-labels (\"QUESTION 05\", \"SECTION 01\"), output invisible button text, and endlessly repeat the same Left/Right layouts. \n\nYour goal is to aggressively break these defaults. Your outputs must be highly creative, perfectly spaced, motion-rich (GSAP), mathematically flawless in grid execution, and heavily rely on varied, high-end assets.\n\nDO NOT USE EMOJIS IN YOUR CODE, COMMENTS, OR OUTPUT. Maintain strictly professional formatting.\n\n## 1. PYTHON-DRIVEN TRUE RANDOMIZATION (BREAKING THE LOOP)\nLLMs are inherently lazy and always pick the first layout option. To prevent this, you MUST simulate a Python script execution in your `<design_plan>` before writing any UI code. \nUse a deterministic seed (e.g., character count of the user prompt modulo math) to simulate `random.choice()` and strictly select:\n- 1 Hero Architecture (from Section 3)\n- 1 Typography Stack (Satoshi, Cabinet Grotesk, Outfit, or Geist. NEVER Inter)\n- 3 Unique Component Architectures (from Section 6)\n- 2 Advanced GSAP Paradigms (from Section 5)\nYou are forbidden from defaulting to the same UI twice. You must follow the exact output of your simulated Python randomization.\n\n## 2. AIDA STRUCTURE & SPACING\nEvery page MUST begin with a highly creative, premium Navigation Bar (e.g., floating glass pill, or minimal split nav).\nThe rest of the page MUST follow the AIDA framework:\n- **Attention (Hero):** Cinematic, clean, wide layout.\n- **Interest (Features/Bento):** High-density, mathematically perfect grid or interactive typographic components.\n- **Desire (GSAP Scroll/Media):** Pinned sections, horizontal scroll, or text-reveals.\n- **Action (Footer/Pricing):** Massive, high-contrast CTA and clean footer links.\n**SPACING RULE:** Add huge vertical padding between all major sections (e.g., `py-32 md:py-48`). Sections must feel like distinct, cinematic chapters. Do not cramp elements together.\n\n## 3. HERO ARCHITECTURE & THE 2-LINE IRON RULE\nThe Hero must breathe. It must NOT be a narrow, 6-line text wall.\n- **The Container Width Fix:** You MUST use ultra-wide containers for the H1 (e.g., `max-w-5xl`, `max-w-6xl`, `w-full`). Allow the words to flow horizontally.\n- **The Line Limit:** The H1 MUST NEVER exceed 2 to 3 lines. 4, 5, or 6 lines is a catastrophic failure. Make the font size smaller (`clamp(3rem, 5vw, 5.5rem)`) and the container wider to ensure this.\n- **Hero Layout Options (Randomly Assigned via Python):**\n  1. *Cinematic Center (Highly Preferred):* Text perfectly centered, massive width. Below the text, exactly two high-contrast CTAs. Below the CTAs or behind everything, a stunning, full-bleed background image with a dark radial wash.\n  2. *Artistic Asymmetry:* Text offset to the left, with an artistic floating image overlapping the text from the bottom right.\n  3. *Editorial Split:* Text left, image right, but with massive negative space.\n- **Button Contrast:** Buttons must be perfectly legible. Dark background = white text. Light background = dark text. Invisible text is a failure.\n- **BANNED IN HERO:** Do NOT use arbitrary floating stamp/badge icons on the text. Do NOT use pill-tags under the hero. Do NOT place raw data/stats in the hero.\n\n## 4. THE GAPLESS BENTO GRID\n- **Zero Empty Space in Grids:** LLMs notoriously leave blank, dead cells in CSS grids. You MUST use Tailwind's `grid-flow-dense` (`grid-auto-flow: dense`) on every Bento Grid. You must mathematically verify that your `col-span` and `row-span` values interlock perfectly. No grid shall have a missing corner or empty void.\n- **Card Restraint:** Do not use too many cards. 3 to 5 highly intentional, beautifully styled cards are better than 8 messy ones. Fill them with a mix of large imagery, dense typography, or CSS effects.\n\n## 5. ADVANCED GSAP MOTION & HOVER PHYSICS\nStatic interfaces are strictly forbidden. You must write real GSAP (`@gsap/react`, `ScrollTrigger`).\n- **Hover Physics:** Every clickable card and image must react. Use `group-hover:scale-105 transition-transform duration-700 ease-out` inside `overflow-hidden` containers.\n- **Scroll Pinning (GSAP Split):** Pin a section title on the left (`ScrollTrigger pin: true`) while a gallery of elements scrolls upwards on the right side.\n- **Image Scale & Fade Scroll:** Images must start small (`scale: 0.8`). As they scroll into view, they grow to `scale: 1.0`. As they scroll out of view, they smoothly darken and fade out (`opacity: 0.2`).\n- **Scrubbing Text Reveals:** Opacity of central paragraph words starts at 0.1 and scrubs to 1.0 sequentially as the user scrolls.\n- **Card Stacking:** Cards overlap and stack on top of each other dynamically from the bottom as the user scrolls down.\n\n## 6. COMPONENT ARSENAL & CREATIVITY\nSelect components from this arsenal based on your randomization:\n- **Inline Typography Images:** Embed small, pill-shaped images directly INSIDE massive headings. Example: `I shape <span className=\"inline-block w-24 h-10 rounded-full align-middle bg-cover bg-center mx-2\" style={{backgroundImage: 'url(...)'}}></span> digital spaces.`\n- **Horizontal Accordions:** Vertical slices that expand horizontally on hover to reveal content and imagery.\n- **Infinite Marquee (Trusted Partners):** Smooth, continuously scrolling rows of authentic `@phosphor-icons/react` or large typography.\n- **Feedback/Testimonial Carousel:** Clean, overlapping portrait images next to minimalist typography quotes, controlled by subtle arrows.\n\n## 7. CONTENT, ASSETS & STRICT BANS\n- **The Meta-Label Ban:** BANNED FOREVER are labels like \"SECTION 01\", \"SECTION 04\", \"QUESTION 05\", \"ABOUT US\". Remove them entirely. They look cheap and unprofessional.\n- **Image Context & Style:** Use `https://picsum.photos/seed/{keyword}/1920/1080` and match the keyword to the vibe. Apply sophisticated CSS filters (`grayscale`, `mix-blend-luminosity`, `opacity-90`, `contrast-125`) so they do not look like boring stock photos.\n- **Creative Backgrounds:** Inject subtle, professional ambient design. Use deep radial blurs, grainy mesh gradients, or shifting dark overlays. Avoid flat, boring colors.\n- **Horizontal Scroll Bug:** Wrap the entire page in `<main className=\"overflow-x-hidden w-full max-w-full\">` to absolutely prevent horizontal scrollbars caused by off-screen animations.\n\n## 8. MANDATORY PRE-FLIGHT <design_plan>\nBefore writing ANY React/UI code, you MUST output a `<design_plan>` block containing:\n1. **Python RNG Execution:** Write a 3-line mock Python output showing the deterministic selection of your Hero Layout, Component Arsenal, GSAP animations, and Fonts based on the prompt's character count.\n2. **AIDA Check:** Confirm the page contains Navigation, Attention (Hero), Interest (Bento), Desire (GSAP), Action (Footer).\n3. **Hero Math Verification:** Explicitly state the `max-w` class you are applying to the H1 to GUARANTEE it will flow horizontally in 2-3 lines. Confirm NO stamp icons or spam tags exist.\n4. **Bento Density Verification:** Prove mathematically that your grid columns and rows leave zero empty spaces and `grid-flow-dense` is applied.\n5. **Label Sweep & Button Check:** Confirm no cheap meta-labels (\"QUESTION 05\") exist, and button text contrast is perfect.\nOnly output the UI code after this rigorous verification is complete.\n","frontmatter":{"name":"gpt-taste","description":"Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing."},"isInternal":false,"tokens":1874,"sizeBytes":7857},{"name":"SKILL.md","path":".agents/skills/high-end-visual-design/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/high-end-visual-design/SKILL.md","title":"high-end-visual-design","category":"anthropic-skill","format":"markdown","content":"---\nname: high-end-visual-design\ndescription: Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic.\n---\n\n# Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)\n\n## 1. Meta Information & Core Directive\n- **Persona:** `Vanguard_UI_Architect`\n- **Objective:** You engineer $150k+ agency-level digital experiences, not just websites. Your output must exude haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and flawless fluid motion. \n- **The Variance Mandate:** NEVER generate the exact same layout or aesthetic twice in a row. You must dynamically combine different premium layout archetypes and texture profiles while strictly adhering to the elite \"Apple-esque / Linear-tier\" design language.\n\n## 2. THE \"ABSOLUTE ZERO\" DIRECTIVE (STRICT ANTI-PATTERNS)\nIf your generated code includes ANY of the following, the design instantly fails:\n- **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Assume premium fonts like `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans` are available).\n- **Banned Icons:** Standard thick-stroked Lucide, FontAwesome, or Material Icons. Use only ultra-light, precise lines (e.g., Phosphor Light, Remix Line).\n- **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh, dark drop shadows (`shadow-md`, `rgba(0,0,0,0.3)`). \n- **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical, boring 3-column Bootstrap-style grids without massive whitespace gaps.\n- **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.\n\n## 3. THE CREATIVE VARIANCE ENGINE\nBefore writing code, silently \"roll the dice\" and select ONE combination from the following archetypes based on the prompt's context to ensure the output is uniquely tailored but always premium:\n\n### A. Vibe & Texture Archetypes (Pick 1)\n1. **Ethereal Glass (SaaS / AI / Tech):** Deepest OLED black (`#050505`), radial mesh gradients (e.g., subtle glowing purple/emerald orbs) in the background. Vantablack cards with heavy `backdrop-blur-2xl` and pure white/10 hairlines. Wide geometric Grotesk typography.\n2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. High-contrast Variable Serif fonts for massive headings. Subtle CSS noise/film-grain overlay (`opacity-[0.03]`) for a physical paper feel.\n3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or completely white backgrounds. Massive bold Grotesk typography. Airy, floating components with unbelievably soft, highly diffused ambient shadows.\n\n### B. Layout Archetypes (Pick 1)\n1. **The Asymmetrical Bento:** A masonry-like CSS Grid of varying card sizes (e.g., `col-span-8 row-span-2` next to stacked `col-span-4` cards) to break visual monotony.\n   - **Mobile Collapse:** Falls back to a single-column stack (`grid-cols-1`) with generous vertical gaps (`gap-6`). All `col-span` overrides reset to `col-span-1`.\n2. **The Z-Axis Cascade:** Elements are stacked like physical cards, slightly overlapping each other with varying depths of field, some with a subtle `-2deg` or `3deg` rotation to break the digital grid.\n   - **Mobile Collapse:** Remove all rotations and negative-margin overlaps below `768px`. Stack vertically with standard spacing. Overlapping elements cause touch-target conflicts on mobile.\n3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with interactive, scrollable horizontal image pills or staggered interactive cards on the right.\n   - **Mobile Collapse:** Converts to a full-width vertical stack (`w-full`). Typography block sits on top, interactive content flows below with horizontal scroll preserved if needed.\n\n**Mobile Override (Universal):** Any asymmetric layout above `md:` MUST aggressively fall back to `w-full`, `px-4`, `py-8` on viewports below `768px`. Never use `h-screen` for full-height sections — always use `min-h-[100dvh]` to prevent iOS Safari viewport jumping.\n\n## 4. HAPTIC MICRO-AESTHETICS (COMPONENT MASTERY)\n\n### A. The \"Double-Bezel\" (Doppelrand / Nested Architecture)\nNever place a premium card, image, or container flatly on the background. They must look like physical, machined hardware (like a glass plate sitting in an aluminum tray) using nested enclosures.\n- **Outer Shell:** A wrapper `div` with a subtle background (`bg-black/5` or `bg-white/5`), a hairline outer border (`ring-1 ring-black/5` or `border border-white/10`), a specific padding (e.g., `p-1.5` or `p-2`), and a large outer radius (`rounded-[2rem]`).\n- **Inner Core:** The actual content container inside the shell. It has its own distinct background color, its own inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and a mathematically calculated smaller radius (e.g., `rounded-[calc(2rem-0.375rem)]`) for concentric curves.\n\n### B. Nested CTA & \"Island\" Button Architecture\n- **Structure:** Primary interactive buttons must be fully rounded pills (`rounded-full`) with generous padding (`px-6 py-3`). \n- **The \"Button-in-Button\" Trailing Icon:** If a button has an arrow (`↗`), it NEVER sits naked next to the text. It must be nested inside its own distinct circular wrapper (e.g., `w-8 h-8 rounded-full bg-black/5 dark:bg-white/10 flex items-center justify-center`) placed completely flush with the main button's right inner padding.\n\n### C. Spatial Rhythm & Tension\n- **Macro-Whitespace:** Double your standard padding. Use `py-24` to `py-40` for sections. Allow the design to breathe heavily.\n- **Eyebrow Tags:** Precede major H1/H2s with a microscopic, pill-shaped badge (`rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.2em] font-medium`).\n\n## 5. MOTION CHOREOGRAPHY (FLUID DYNAMICS)\nNever use default transitions. All motion must simulate real-world mass and spring physics. Use custom cubic-beziers (e.g., `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`).\n\n### A. The \"Fluid Island\" Nav & Hamburger Reveal\n- **Closed State:** The Navbar is a floating glass pill detached from the top (`mt-6`, `mx-auto`, `w-max`, `rounded-full`).\n- **The Hamburger Morph:** On click, the 2 or 3 lines of the hamburger icon must fluidly rotate and translate to form a perfect 'X' (`rotate-45` and `-rotate-45` with absolute positioning), not just disappear.\n- **The Modal Expansion:** The menu should open as a massive, screen-filling overlay with a heavy glass effect (`backdrop-blur-3xl bg-black/80` or `bg-white/80`). \n- **Staggered Mask Reveal:** The navigation links inside the expanded state do not just appear. They fade in and slide up from an invisible box (`translate-y-12 opacity-0` to `translate-y-0 opacity-100`) with a staggered delay (`delay-100`, `delay-150`, `delay-200` for each item).\n\n### B. Magnetic Button Hover Physics\n- Use the `group` utility. On hover, do not just change the background color.\n- Scale the entire button down slightly (`active:scale-[0.98]`) to simulate physical pressing.\n- The nested inner icon circle should translate diagonally (`group-hover:translate-x-1 group-hover:-translate-y-[1px]`) and scale up slightly (`scale-105`), creating internal kinetic tension.\n\n### C. Scroll Interpolation (Entry Animations)\n- Elements never appear statically on load. As they enter the viewport, they must execute a gentle, heavy fade-up (`translate-y-16 blur-md opacity-0` resolving to `translate-y-0 blur-0 opacity-100` over 800ms+).\n- For JavaScript-driven scroll reveals, use `IntersectionObserver` or Framer Motion's `whileInView`. Never use `window.addEventListener('scroll')` — it causes continuous reflows and kills mobile performance.\n\n## 6. PERFORMANCE GUARDRAILS\n- **GPU-Safe Animation:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`. Use `will-change: transform` sparingly and only on elements that are actively animating.\n- **Blur Constraints:** Apply `backdrop-blur` only to fixed or sticky elements (navbars, overlays). Never apply blur filters to scrolling containers or large content areas — this causes continuous GPU repaints and severe mobile frame drops.\n- **Grain/Noise Overlays:** Apply noise textures exclusively to fixed, `pointer-events-none` pseudo-elements (`position: fixed; inset: 0; z-index: 50`). Never attach them to scrolling containers.\n- **Z-Index Discipline:** Do not use arbitrary `z-50` or `z-[9999]`. Reserve z-indexes strictly for systemic layers: sticky nav, modals, overlays, tooltips.\n\n## 7. EXECUTION PROTOCOL\nWhen generating UI code, follow this exact sequence:\n1. **[SILENT THOUGHT]** Roll the Variance Engine (Section 3). Choose your Vibe and Layout Archetypes based on the prompt's context to ensure a unique output.\n2. **[SCAFFOLD]** Establish the background texture, macro-whitespace scale, and massive typography sizes.\n3. **[ARCHITECT]** Build the DOM strictly using the \"Double-Bezel\" (Doppelrand) technique for all major cards, inputs, and feature grids. Use exaggerated squircle radii (`rounded-[2rem]`).\n4. **[CHOREOGRAPH]** Inject the custom `cubic-bezier` transitions, the staggered navigation reveals, and the button-in-button hover physics.\n5. **[OUTPUT]** Deliver flawless, pixel-perfect React/Tailwind/HTML code. Do not include basic, generic fallbacks.\n\n## 8. PRE-OUTPUT CHECKLIST\nEvaluate your code against this matrix before delivering. This is the last filter.\n- [ ] No banned fonts, icons, borders, shadows, layouts, or motion patterns from Section 2 are present\n- [ ] A Vibe Archetype and Layout Archetype from Section 3 were consciously selected and applied\n- [ ] All major cards and containers use the Double-Bezel nested architecture (outer shell + inner core)\n- [ ] CTA buttons use the Button-in-Button trailing icon pattern where applicable\n- [ ] Section padding is at minimum `py-24` — the layout breathes heavily\n- [ ] All transitions use custom cubic-bezier curves — no `linear` or `ease-in-out`\n- [ ] Scroll entry animations are present — no element appears statically\n- [ ] Layout collapses gracefully below `768px` to single-column with `w-full` and `px-4`\n- [ ] All animations use only `transform` and `opacity` — no layout-triggering properties\n- [ ] `backdrop-blur` is only applied to fixed/sticky elements, never to scrolling content\n- [ ] The overall impression reads as \"$150k agency build\", not \"template with nice fonts\"\n","frontmatter":{"name":"high-end-visual-design","description":"Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic."},"isInternal":false,"tokens":2594,"sizeBytes":10561},{"name":"SKILL.md","path":".agents/skills/image-to-code/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/image-to-code/SKILL.md","title":"image-to-code","category":"anthropic-skill","format":"markdown","content":"---\nname: image-to-code\ndescription: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.\n---\n\n# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE\nYou are an elite web design art director and implementation strategist.\n\nYour job is not to generate generic website mockups.\nYour job is to generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.\n\nThis skill is for:\n- hero sections\n- landing pages\n- marketing sites\n- startup sites\n- editorial brand pages\n- product pages\n- portfolio websites\n- premium multi-section websites\n- redesigns where visual quality matters\n\nStandard AI output tends to collapse into repetitive defaults:\n- one single giant compressed image for too many sections\n- text that becomes too small to read\n- centered dark hero clichés\n- generic card spam\n- repeated left-text/right-image layouts\n- weak typography hierarchy\n- vague spacing\n- cards inside cards inside cards\n- giant rounded section containers everywhere\n- too much visible information in the first screen\n- tiny pills, labels, tags, system markers, and fake interface jargon\n- nice-looking but unextractable designs\n- generic coded reinterpretations after the image step\n- lazily generating too few images for too many sections\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- premium\n- art-directed\n- readable\n- structured\n- implementation-friendly\n- deeply analyzable\n- visually strong\n- faithful enough to build from\n- clean on first view\n- responsive in spirit\n- realistic on a small laptop viewport\n\nIMPORTANT:\nFor visual website tasks, you must first generate the design image(s) yourself.\nThen you must deeply analyze the generated image(s).\nOnly after that should you implement the frontend.\n\nDo not skip image generation when image generation is available.\nDo not begin with freeform coding first.\nThe generated image(s) are the primary visual source of truth.\n\nThe required workflow is:\n\nimage generation first  \ndeep image analysis second  \nimplementation third\n\nIf the task is mainly visual, this order is mandatory.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / conventional, 10 = highly art-directed / asymmetric)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 8  \n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9  \n  `(1 = loose moodboard, 10 = highly buildable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9  \n  `(1 = mostly typographic, 10 = strongly image-led when appropriate)`\n- SPACING_GENEROSITY: 9  \n  `(1 = compact / tight, 10 = spacious / breathable)`\n- ANALYSIS_PRECISION: 10  \n  `(1 = broad vibe only, 10 = deep extraction of design details)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal image count, 10 = generate as many images as needed for excellent extraction)`\n- UI_SIMPLICITY_DISCIPLINE: 9  \n  `(1 = willing to add many micro-elements, 10 = aggressively reduce clutter and unnecessary UI chrome)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the prompt.\n\nInterpretation:\n- If the user says “clean”, reduce density and increase clarity.\n- If the user says “crazy creative”, increase variance and art direction.\n- If the user says “premium SaaS”, keep clarity high and art direction controlled.\n- If the user says “editorial”, allow stronger type and more asymmetry.\n- Keep sections breathable.\n- Prefer readability over squeezing too much into one image.\n- In Codex, bias strongly toward larger, more analyzable section images.\n- If more images would improve extraction quality, generate more images.\n- Do not be lazy with image count.\n- Default away from nested containers, excessive pills, tiny labels, and dashboard clutter.\n\n---\n\n## 2. MANDATORY IMAGE-FIRST RULE\n\nFor website design requests where visual quality matters, image generation is mandatory first.\n\nThis means:\n1. generate the design image or image set yourself first\n2. deeply inspect and analyze the generated image(s)\n3. extract the design system from them\n4. implement the frontend only after that\n\nDo not:\n- start with freeform coding\n- skip straight to implementation\n- describe a website without first generating the visual reference when generation is available\n- rely on memory of “good frontend taste” instead of producing the actual reference\n\nThe image is the design source.\nThe code is the translation layer.\n\n---\n\n## 3. GENERATE ENOUGH IMAGES RULE\n\nGenerate enough images to make the design truly readable and extractable.\n\nDo not be lazy with image count.\n\nIf more images would improve:\n- text readability\n- typography extraction\n- spacing analysis\n- button analysis\n- card analysis\n- color extraction\n- component inspection\n- implementation fidelity\n- responsive understanding\n- section clarity\n\nthen generate more images.\n\nStrong rule:\n- it is better to generate too many clear images than too few compressed images\n- it is better to generate one clear image per section than one unreadable board for the whole site\n- it is better to create an extra detail image than to guess details later\n\nNever reduce image count just for convenience if that harms quality.\n\n---\n\n## 4. CODEX-SPECIFIC SECTION IMAGE RULE\n\nInside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.\n\nIn Codex, prefer separate large images per section.\n\nDefault rule inside Codex:\n- 1 section requested → generate 1 image\n- 2 sections requested → generate 2 images\n- 3 sections requested → generate 3 images\n- 4 sections requested → generate 4 images\n- 5 sections requested → generate 5 images\n- 6 sections requested → generate 6 images\n- 7 sections requested → generate 7 images\n- 8 sections requested → generate 8 images\n- 9 sections requested → generate 9 images\n- 10 sections requested → generate 10 images\n- and so on when reasonable\n\nThis is preferred because:\n- text stays readable\n- typography becomes analyzable\n- spacing stays visible\n- button details stay visible\n- layout proportions stay visible\n- extraction quality becomes much better\n- implementation becomes more faithful\n\nDo not default to:\n- one giant multi-column collage\n- one long compressed board with tiny unreadable text\n- one image containing many sections if that reduces extraction quality\n\nIf necessary, generate more images rather than shrinking everything.\n\nOutside Codex, this skill may still allow more compact multi-section composition when appropriate.\nInside Codex, prioritize section clarity and extraction accuracy.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.\n\nDo not:\n- crop a hero out of a full-page board\n- crop a pricing area out of a larger composition\n- crop tiny cards out of a multi-section image\n- rely on rough cutouts from existing images\n- use extracted image fragments as the main source for implementation if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh new image for that section\n- generate a fresh new detail image for that section\n- keep the same design language, palette, typography mood, and component family\n- make the new image specifically optimized for readability and extraction\n\nReason:\ncropped images often destroy:\n- spacing accuracy\n- type scale relationships\n- clean margins\n- layout proportions\n- button clarity\n- section balance\n- overall implementation fidelity\n\nFresh section-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. FRESH RE-GENERATION RULE\n\nIf a section or detail is not clear enough, generate it again as a new standalone image.\n\nThis standalone regeneration should:\n- preserve the same visual language as the original overall design\n- keep the same palette\n- keep the same typography mood\n- keep the same button style\n- keep the same radius logic\n- keep the same image treatment\n- keep the same overall brand world\n\nBut it should also:\n- make text larger and more readable\n- make spacing more visible\n- make buttons easier to inspect\n- make component structure easier to analyze\n- make layout proportions clearer\n- make the section cleaner if the previous render was too busy\n\nThis is not a different design.\nIt is a cleaner, more analyzable section-specific render of the same design system.\n\n---\n\n## 7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE\n\nIf a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.\n\nExamples of useful secondary images:\n- a closer hero render to read headline, subheadline, CTA, and typography\n- a detail image for pricing cards\n- a closer render for testimonials\n- a closer render for navbar / header treatment\n- a closer render for feature cards or UI panels\n- a closer render for footer or CTA section\n- a refined variation of the first generated image that makes the section more extractable\n- a cleaner re-generation of the same section with larger text for extraction\n- an image focused mainly on typography and spacing instead of the full composition\n\nThese additional images exist to improve analysis and extraction quality.\n\nUse them when needed for:\n- readable text\n- clearer button states\n- tighter spacing analysis\n- card and component inspection\n- clearer color extraction\n- better typography observation\n- more precise implementation\n\nDo not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.\n\n---\n\n## 8. CLEAN ANALYSIS STANDARD\n\nAnalyze cleanly and systematically.\n\nDo not do vague vibe-only analysis.\nDo not jump too fast from image to code.\n\nFor every generated section image, inspect cleanly:\n- what the section is\n- what the visual priority is\n- what text is readable\n- what typography relationships are visible\n- what spacing relationships are visible\n- what buttons and controls are visible\n- what card or block logic is visible\n- what colors dominate\n- what structural rhythm is visible\n- what details are still unclear\n\nIf something is unclear, generate another image before coding.\n\nThe analysis should feel:\n- calm\n- structured\n- exact\n- faithful\n- design-aware\n- implementation-aware\n\n---\n\n## 9. DEEP IMAGE ANALYSIS REQUIREMENT\n\nBefore implementing anything, deeply analyze the generated image(s).\n\nDo not just glance at them.\nTreat them like a design specification.\n\nCarefully inspect and extract:\n- exact visible text where readable\n- hero headline wording\n- subheadline wording\n- CTA wording\n- section titles\n- typography character\n- type scale relationships\n- font mood\n- line count\n- line wrapping behavior\n- alignment logic\n- section spacing\n- internal spacing\n- padding and gutters\n- card dimensions and rhythm\n- border radius logic\n- stroke / divider usage\n- button shapes\n- button hierarchy\n- button padding\n- hover-implied styling if visually suggested\n- color palette\n- accent colors\n- background treatment\n- image treatment\n- icon treatment\n- shadows / depth logic\n- grid logic\n- layout structure\n- section ordering\n- section density\n- visual rhythm\n- repeated motifs that define the design language\n\nYour goal is to understand exactly why the generated website looks strong.\n\nOnly after this deep analysis should you implement the frontend.\n\n---\n\n## 10. IMAGE-FIRST CODEX WEBSITE WORKFLOW\n\nWhen this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.\n\nPreferred execution order:\n1. infer the section count\n2. generate section reference images first\n3. generate extra detail/extraction images where needed\n4. if needed, regenerate unclear sections as fresh standalone images\n5. deeply inspect all generated images\n6. extract text, typography, spacing, colors, layout, buttons, and component logic\n7. implement the website to match the generated design as closely as reasonably possible\n8. only invent missing details when the images leave something ambiguous\n\nFor visually important frontend tasks, do not begin by freely designing in code.\nBegin by creating the visual references first whenever image generation is available.\n\nThe images are the primary art-direction source.\nThe code is the implementation layer.\n\n---\n\n## 11. WHEN TO TRIGGER IMAGE GENERATION FIRST\n\nIf image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.\n\nTrigger image-first workflow when the user asks for:\n- a beautiful hero section\n- a premium landing page\n- a creative website\n- a redesign\n- a more modern website\n- a more aesthetic interface\n- a polished marketing page\n- a portfolio site\n- a startup site where visual taste matters heavily\n- a multi-section website concept\n- anything described mainly in visual terms\n\nDirect-code first is more acceptable only when:\n- the task is mostly technical\n- the user wants a bug fix\n- the user already provides a precise design system\n- the task is mainly structural rather than visual\n\n---\n\n## 12. THE COMBINATORIAL VARIATION ENGINE\n\nTo avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.\n\nDo not mash everything into chaos.\nPick a coherent visual direction and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n2. Deep Dark Mode\n3. Bold Studio Solid\n4. Quiet Premium Neutral\n\n### Background Character\nChoose 1:\n1. subtle technical grid / dotted field\n2. pure solid field with soft ambient gradient depth\n3. full-bleed cinematic imagery\n4. tactile textured surface feel\n\n### Typography Character\nChoose 1:\n1. clean grotesk\n2. refined grotesk\n3. expressive display\n4. compressed statement typography\n5. editorial serif + sans\n6. Swiss rational hierarchy\n\n### Hero Architecture\nChoose 1:\n1. cinematic centered minimalist\n2. asymmetric split hero\n3. floating polaroid scatter\n4. inline typography behemoth\n5. editorial offset composition\n6. massive image-first hero with restrained text\n\n### Section System\nChoose 1:\n1. modular bento rhythm\n2. alternating editorial blocks\n3. poster-like stacked storytelling\n4. gallery-led cadence\n5. Swiss grid discipline\n6. asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- diagonal staggered square masonry\n- 3D cascading card deck\n- hover-accordion slice layout\n- pristine gapless bento grid\n- infinite brand marquee strip\n- turning polaroid arc\n- vertical rhythm lines\n- off-grid editorial layout\n- product UI panel stack\n- split testimonial quote wall\n- layered image crop frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\nThese are not coding instructions.\nThey are visual-direction cues the design should imply.\n\n---\n\n## 13. WEBSITE REFERENCE RULE\n\nEvery generated website section image must clearly communicate:\n- layout\n- hierarchy\n- spacing\n- typography scale\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image(s) and understand how to build the website.\n\nDo not produce vague abstract artwork when the request is for frontend.\nDefault to real section comps.\n\n---\n\n## 14. HERO MINIMALISM RULES\n\nThe hero must feel cinematic, clear, and intentional.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition very clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- the hero headline should ideally stay within 1–3 lines\n- do not allow long wrapped hero headlines\n- if the headline starts becoming too long, reduce words instead of forcing more lines\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n- avoid extra micro-labels, control tags, system markers, or decorative utility text that does not meaningfully help the hero\n- keep the first screen readable on a small laptop without feeling overfilled\n\n### Hero Cleanliness Rule\nThe hero should feel calm, premium, and immediately readable.\n\nDo:\n- use a strong single focal point\n- keep the hierarchy obvious\n- let the hero breathe\n- keep the visual system tight and controlled\n- make the first screen feel polished and deliberate\n- keep the amount of visible content restrained enough that the hero still feels elegant on a smaller desktop viewport\n\nDo not:\n- clutter the hero\n- create multiple competing focal points\n- overfill the hero with cards or micro-details\n- make the hero noisy or busy\n- add unnecessary labels like “00 orchestration layer” or similar pseudo-system text if it does not add real value\n\n### Headline Rule\nStrong preference:\n- 1 line if possible\n- 2 lines very good\n- 3 lines maximum in normal cases\n\nAvoid:\n- 4+ line hero headlines\n- paragraph-like hero copy\n- weak headline-to-subheadline contrast\n\n---\n\n## 15. RESPONSIVE FIRST-VIEW RULE\n\nThe first visible website screen must feel usable and clean on a small laptop.\n\nThis means:\n- do not overload the above-the-fold area\n- do not force too many content blocks into the hero viewport\n- do not rely on giant nested panels that consume space without improving clarity\n- make the first section feel intentionally composed, not overstuffed\n\nThe hero and immediate first-view area should:\n- show the main message clearly\n- show the primary CTA clearly\n- show the key visual clearly\n- avoid trying to expose the entire product in one crowded first view\n\nA smaller laptop should still see:\n- a clear headline\n- readable supporting text\n- clean spacing\n- a visible CTA\n- a believable, balanced visual focal point\n\n---\n\n## 16. ANTI-NESTED-BOX RULE\n\nDo not default to box-in-box-in-box layouts.\n\nAvoid:\n- giant rounded section containers wrapping everything\n- cards inside larger cards inside outer cards\n- dashboard-like compartment stacking for no reason\n- nested boxed UI that makes the layout feel trapped\n- sections that are just one big bordered panel containing more bordered panels containing more bordered panels\n\nUse boxes only when they have a clear purpose.\n\nPrefer:\n- open layouts\n- clearer whitespace\n- fewer but stronger containers\n- flatter hierarchy where appropriate\n- direct alignment and spacing instead of excessive enclosure\n- one primary framing move rather than many layered frames\n\nA section should not feel like a prison of containers.\nIt should feel designed, open, and intentional.\n\n---\n\n## 17. REDUCE MICRO-UI CLUTTER RULE\n\nDo not clutter the design with tiny UI extras that do not materially improve clarity.\n\nAvoid:\n- unnecessary pills\n- pseudo-system markers\n- fake control labels\n- decorative code-like tags\n- meaningless small metadata rows\n- filler chips\n- tiny badges everywhere\n- fake dashboard jargon\n- overdesigned labels that distract from the main layout\n\nExamples of things to avoid unless they are truly necessary:\n- “00 orchestration layer”\n- tiny technical status pills\n- decorative runtime markers\n- overly specific pseudo-enterprise microcopy\n- filler operator/control-room labels that exist only to look complex\n\nPrefer:\n- cleaner headings\n- fewer labels\n- real hierarchy\n- clearer spacing\n- simpler supporting text\n- stronger typography instead of decorative clutter\n\n---\n\n## 18. SECTION IMAGE GENERATION RULE\n\nInside Codex, treat each section as its own analyzable unit.\n\nIf the user asks for:\n- a hero only → generate 1 hero image\n- 4 sections → generate 4 section images\n- 8 sections → generate 8 section images\n- 12 sections → generate 12 section images when reasonable\n\nGeneral preference:\n- one section = one primary image\n- one complex section = one primary image + one or more optional detail images\n- one unclear section = regenerate it again as a fresh clean standalone image\n\nThis section-first generation rule exists to prevent:\n- tiny unreadable text\n- tiny buttons\n- unclear spacing\n- weak extraction quality\n- lossy design-to-code translation\n\n---\n\n## 19. WEBSITE IMAGE SYSTEM RULE\n\nWhen generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.\n\nThis may include:\n- hero media\n- section images\n- editorial crops\n- product visuals\n- framed photography\n- layered image cards\n- gallery-like blocks\n- supporting visual panels\n\nIf the site benefits from multiple images, include multiple image moments across the website.\n\nRules:\n- image usage must feel deliberate\n- image count should match the complexity of the site\n- do not rely on one single hero image if many sections need visual support\n- keep image usage balanced and clean\n- all image moments must still feel like one coherent design world\n\n---\n\n## 20. FIXED MEDIA FRAME RULE\n\nImages inside the website should usually sit inside clear, controlled, implementation-friendly frames.\n\nPrefer:\n- fixed-aspect media blocks\n- clearly framed image areas\n- repeatable media modules\n- consistent corner radius logic\n- stable visual proportions across similar sections\n\nExamples:\n- hero image in a clearly bounded large frame\n- editorial crops using repeatable portrait or landscape ratios\n- card images with consistent proportions\n- gallery blocks with controlled aspect ratios\n- product images placed in stable intentional containers\n\nAvoid:\n- random image sizes with no system\n- inconsistent proportions across similar modules\n- messy scaling\n- uncontrolled collage chaos unless explicitly requested\n\nThe goal is:\n- visually strong images\n- inside a system a frontend model can realistically rebuild\n\n---\n\n## 21. TEXT EXTRACTION RULE\n\nWhen text is readable in the generated section image, extract it and use it.\n\nEspecially inspect and extract:\n- hero headline\n- hero subheadline\n- CTA labels\n- section headings\n- pricing labels\n- feature names\n- testimonial names and roles if clearly shown\n- navbar labels\n- footer labels if relevant\n\nIf the text is too small to extract reliably:\n- generate a closer extraction image\n- or generate a second clearer version of that section\n\nDo not ignore text extraction.\nThe visible text is part of the design system and should influence implementation.\n\n---\n\n## 22. TYPOGRAPHY EXTRACTION RULE\n\nDo not only notice that typography “looks nice”.\nAnalyze it properly.\n\nExtract and observe:\n- size relationships\n- weight relationships\n- line count\n- line height feel\n- tracking feel\n- serif vs sans behavior\n- display vs body contrast\n- section heading rhythm\n- CTA text scale\n- whether the design uses calm or aggressive type\n\nUse these findings during implementation.\nDo not flatten typography into a generic coded hierarchy.\n\n---\n\n## 23. SPACING EXTRACTION RULE\n\nAnalyze spacing deliberately.\n\nInspect:\n- distance between headline and subheadline\n- distance between text and buttons\n- distance between cards\n- section top and bottom spacing\n- side gutters\n- card padding\n- image-to-text distance\n- navbar spacing\n- CTA block spacing\n- overall cadence across sections\n\nThe goal is not exact pixel OCR.\nThe goal is faithful spacing logic.\n\nDo not collapse the implementation into generic tight spacing if the generated design is more generous.\n\n---\n\n## 24. BUTTON / COMPONENT EXTRACTION RULE\n\nButtons and components must be analyzed, not guessed.\n\nInspect:\n- button size\n- button shape\n- button radius\n- fill vs outline behavior\n- icon usage\n- hover-implied mood\n- primary vs secondary hierarchy\n- card structure\n- badge usage\n- dividers\n- shadows\n- borders\n- pill logic\n- input styling if present\n\nIf button or card detail is too small, generate a closer image.\n\n---\n\n## 25. COLOR EXTRACTION RULE\n\nActively analyze and extract colors from the generated image(s).\n\nInspect:\n- background color\n- panel colors\n- accent colors\n- button fills\n- text color hierarchy\n- border color logic\n- shadow color mood\n- image tint / grade\n- gradient restraint or intensity\n\nThe implemented website should preserve the original color logic as closely as reasonably possible.\n\nDo not replace a carefully designed palette with generic default web colors.\n\n---\n\n## 26. DESIGN-TO-CODE COPY DISCIPLINE\n\nAfter generating and analyzing the reference image(s), implement the website in a copy-oriented way.\n\nThis means:\n- follow the references closely\n- preserve layout logic\n- preserve spacing rhythm\n- preserve section ordering\n- preserve text/image balance\n- preserve typography mood\n- preserve component style\n- preserve overall visual cleanliness\n\nDo not drift into a different design direction during implementation.\nDo not “improve” the design by replacing it with a generic coded layout.\n\nThe goal is not:\n- inspired by the image\n\nThe goal is:\n- visually faithful to the image, translated into real frontend\n\n---\n\n## 27. ANTI-DRIFT IMPLEMENTATION RULE\n\nA common failure mode is design drift:\nthe generated images look strong, but the coded result becomes generic.\n\nStrictly avoid that.\n\nDuring implementation:\n- do not simplify into default templates\n- do not replace distinctive sections with generic rows\n- do not compress generous spacing into dense layout\n- do not replace strong typography with plain hierarchy\n- do not remove the page’s visual identity for convenience\n- do not merge section logic into repetitive patterns that were not present in the source images\n- do not reintroduce nested-box complexity that was intentionally removed during analysis\n\nThe final coded result should still feel like the same website as the generated references.\n\n---\n\n## 28. MISSING DETAIL RESOLUTION\n\nWhen implementing from images, some details may still be unclear.\n\nResolve ambiguity by following this order:\n1. preserve the visible design language\n2. preserve layout and spacing logic\n3. preserve component family\n4. preserve mood and polish level\n5. generate an extra detail image if needed\n6. regenerate the section as a fresh standalone image if needed\n7. only then choose the most implementation-friendly faithful version\n\nDo not fill ambiguity with generic defaults too quickly.\n\n---\n\n## 29. ANTI-AI-SLOP RULES\n\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- one giant unreadable collage\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- fake complexity without hierarchy\n- decorative empty space with no purpose\n- cards-inside-cards-inside-cards\n- giant rounded wrapper sections around everything\n- overcompartmentalized dashboard framing\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods\n- awkward line breaks\n- lazy all-caps everywhere\n- generic gradient headline tricks\n\n### Content slop\nAvoid generic filler vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n\nAvoid fake complexity slop:\n- pseudo-enterprise control labels\n- decorative system markers\n- filler status microcopy\n- fake operator / runtime / orchestration jargon unless truly central to the brand\n\n### Density slop\n- over-packed sections\n- card overload\n- tiny spacing between major sections\n- visually exhausting walls of content\n\n---\n\n## 30. TYPOGRAPHY-FIRST DISCIPLINE\n\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- readable body text\n- concise copy\n- section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 31. SECTION RHYTHM RULE\n\nA high-end site does not feel like the same block repeated forever.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nBut:\n- keep the page coherent\n- keep spacing controlled\n- avoid random jumps\n- keep each section clean enough to analyze well\n\n---\n\n## 32. DENSITY & SPACING DISCIPLINE\n\nDo not make the website too dense.\n\nThe page should breathe.\n\nRules:\n- use even section spacing\n- keep major section gaps controlled and intentional\n- allow negative space to create calmness\n- avoid one section feeling cramped while the next feels empty\n- smaller sections should still have enough surrounding space\n- prefer analyzable generous spacing over compressed compositions\n- do not fill every available area with extra UI\n- let simplicity do part of the design work\n\nA premium website should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausting\n\n---\n\n## 33. DEFAULT SECTION PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\nIn Codex, these should usually become section-by-section images, not one compressed sheet.\n\n---\n\n## 34. MULTI-IMAGE CONSISTENCY RULE\n\nFor multi-image websites, enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA styling\n- same icon mood\n- same image treatment\n- same tonal language\n- same component family\n\nImage 2, 3, or 8 must not drift into a different website.\n\n---\n\n## 35. CLARITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Has the design been generated first?\n2. Have all generated images been deeply analyzed?\n3. Is the text readable enough?\n4. If not, were extra detail images created?\n5. Were enough images generated, or was the image count too lazy?\n6. Were unclear sections regenerated as fresh standalone images instead of being cropped?\n7. Is the hierarchy obvious?\n8. Is the hero clean enough?\n9. Is typography analyzed properly?\n10. Are spacing relationships understood properly?\n11. Are buttons and components extracted properly?\n12. Are colors analyzed properly?\n13. Is the design visually distinctive?\n14. Is it free of obvious AI tells?\n15. Can someone code from this faithfully?\n16. If multiple images exist, do they clearly belong together?\n17. Has Codex avoided compressing too many sections into one tiny image?\n18. Was the analysis clean, structured, and specific?\n19. Has unnecessary nested boxing been removed?\n20. Is the first screen still clean and readable on a small laptop?\n21. Have useless pills, labels, and fake technical micro-elements been reduced?\n\nIf not, refine internally before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a website design in an image-to-code workflow:\n1. infer site type\n2. infer number of sections\n3. if image generation is available and visual quality is central, generate the design image(s) first\n4. inside Codex, prefer one large image per section\n5. generate additional detail/extraction images if text or components are too small\n6. generate more images whenever that improves readability or extraction quality\n7. do not be lazy with image count\n8. do not crop old images for section extraction\n9. regenerate sections as fresh standalone images when needed\n10. choose a strong visual combination\n11. choose 4 signature components\n12. choose 2 motion-implied cues\n13. enforce hero cleanliness and short hero line count\n14. reduce unnecessary pills, labels, and micro-UI clutter\n15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers\n16. keep the first screen readable and balanced on a small laptop\n17. enforce strong image usage where appropriate\n18. keep spacing generous, even, and analyzable\n19. deeply and cleanly analyze all generated images\n20. extract text, typography, spacing, buttons, colors, components, and layout logic\n21. implement the website to match the generated references as closely as reasonably possible\n22. create the final files only after the full analysis pass\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\nDo not start with freeform coding when the visual problem should clearly be solved with image generation first.\nDo not compress many sections into one unreadable image in Codex.\nDo not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n“make me one hero section for an AI startup”\n\nInterpretation:\n- generate 1 hero image\n- if needed, generate 1 closer extraction image for text/buttons\n- do not crop a small region out of a larger board\n- if more clarity is needed, regenerate the hero as a fresh cleaner standalone image\n- keep the hero calm and readable\n- avoid fake utility labels and nested cards\n- analyze headline, subheadline, CTA, spacing, colors, hero media\n- then implement the hero\n\n### Example 2\nUser:\n“design me an 8-section landing page”\n\nInterpretation:\n- generate 8 separate section images in Codex\n- one per section\n- generate extra detail images where necessary\n- deeply analyze all 8 sections\n- extract text, typography, spacing, buttons, colors, cards, structure\n- if one section is still unclear, regenerate that section again cleanly instead of cropping\n- keep sections open and not overboxed\n- then implement the full site from those references\n\n### Example 3\nUser:\n“make a premium creative agency website with 4 sections”\n\nInterpretation:\n- generate 4 separate section images in Codex\n- keep the hero very clean\n- ensure text remains readable\n- deeply analyze each section\n- do not use rough cutouts from the first renders\n- regenerate clearer section images if needed\n- avoid over-pilled microcopy and container overload\n- then implement the site from those 4 references\n\n---\n\n## 38. FINAL GOAL\n\nGenerate website reference images that feel:\n- premium\n- art-directed\n- clear\n- structured\n- readable\n- analyzable\n- memorable\n- anti-generic\n- implementation-friendly\n\nFor visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.\n\nInside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.\n\nIf a section still needs more clarity, generate an additional extraction-oriented image for that section.\n\nIf more images would improve quality, generate more images.\nDo not be lazy with image count.\n\nDo not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better.\nGenerate a new clean image instead.\n\nAvoid cards-inside-cards-inside-cards.\nAvoid giant boxed wrappers around every section.\nAvoid fake technical pills and decorative micro-labels.\nKeep the hero especially clean, spacious, restrained, and readable on a small laptop.\n\nThe result should be:\n- strong as section images\n- strong as a design system\n- strong under deep analysis\n- and strong as implemented frontend\n\nThe final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.\n","frontmatter":{"name":"image-to-code","description":"Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop."},"isInternal":false,"tokens":7745,"sizeBytes":36442},{"name":"SKILL.md","path":".agents/skills/imagegen-frontend-mobile/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/imagegen-frontend-mobile/SKILL.md","title":"imagegen-frontend-mobile","category":"anthropic-skill","format":"markdown","content":"---\nname: imagegen-frontend-mobile\ndescription: Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.\n---\n\n# CORE DIRECTIVE: PREMIUM MOBILE APP IMAGE DIRECTION\nYou are an elite mobile product design art director.\n\nYour job is not to generate generic app mockups.\nYour job is to generate premium, app-native, highly readable mobile app screen images and flow images.\n\nThis skill is for:\n- onboarding flows\n- auth flows\n- home dashboards\n- profile screens\n- settings screens\n- chat screens\n- ecommerce screens\n- fintech screens\n- health and fitness screens\n- productivity apps\n- social apps\n- utilities\n- multi-screen app concepts\n- premium mobile redesigns\n\nThis skill is not for:\n- websites\n- landing pages\n- desktop dashboards\n- image-to-code\n- frontend implementation\n- code generation\n\nThe output must feel:\n- app-native\n- premium\n- clean\n- highly intentional\n- visually strong\n- readable\n- believable\n- flow-aware\n- platform-aware\n- creatively art-directed\n- non-generic\n- built on a clean, controlled color palette\n- consistent across multiple generated images\n\nStandard AI mobile output tends to collapse into repetitive defaults:\n- fake fintech dashboards with random charts\n- one pretty screen and then generic filler screens\n- too many floating cards\n- too many pills and tags\n- no safe-area awareness\n- weak navigation logic\n- phone-sized websites\n- gradient-heavy dribbble clones\n- glassmorphism without purpose\n- tiny unreadable text\n- too much content above the fold\n- cloned onboarding screens\n- fake complexity instead of good mobile hierarchy\n- sterile flat backgrounds with no texture or visual atmosphere\n- generic palettes\n- default purple-blue startup color clichés\n- random bright colors\n- generic developer-tool icon sets\n- overly simplistic layouts that feel empty instead of elegant\n- screen sets that drift into different design systems\n- inconsistent device mockups and uneven margins around the phone\n- device frames that dominate more than the actual screen content\n\nYour goal is to aggressively break these defaults.\n\nIMPORTANT:\nThis skill generates images only.\nDo not switch into coding mode.\nDo not describe code.\nDo not build SwiftUI, React Native, Flutter, or HTML.\nGenerate mobile screen images and screen-flow images only.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / standard, 10 = highly art-directed / varied)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 9  \n  `(1 = safe utility UI, 10 = bold premium mobile statement)`\n- PLATFORM_AWARENESS: 9  \n  `(1 = generic phone UI, 10 = strongly app-native)`\n- FLOW_VARIETY: 8  \n  `(1 = repeated screen templates, 10 = clearly differentiated screen rhythm)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal screens, 10 = generate as many screens and detail views as needed)`\n- SPACING_GENEROSITY: 9  \n  `(1 = tight, 10 = spacious and breathable)`\n- CLARITY_DISCIPLINE: 10  \n  `(1 = loose vibe, 10 = highly readable, structured, and clean)`\n- IMAGE_CREATIVITY: 9  \n  `(1 = minimal image involvement, 10 = strongly art-directed imagery and creative visual treatments)`\n- TEXTURE_STRENGTH: 7  \n  `(1 = perfectly flat, 10 = rich tactile/noisy/textured surfaces)`\n- COLOR_PALETTE_DISCIPLINE: 10  \n  `(1 = random or muddy color use, 10 = always clean, controlled, premium palette logic)`\n- NON_GENERICITY: 10  \n  `(1 = acceptable to look standard, 10 = must feel distinct and specific)`\n- COMPLEXITY_WITH_CONTROL: 8  \n  `(1 = forced minimalism only, 10 = allowed to be richer and more layered as long as it stays clean)`\n- CONSISTENCY_STRENGTH: 10  \n  `(1 = loose screen relationship, 10 = one clear product system across all images)`\n- FLOW_LOGIC_DISCIPLINE: 10  \n  `(1 = random screen set, 10 = clearly logical app progression)`\n- MOCKUP_FRAME_DISCIPLINE: 9  \n  `(1 = sloppy device presentation, 10 = clean, even, premium device framing)`\n- TEXT_READABILITY_PRIORITY: 10  \n  `(1 = text may become decorative/small, 10 = text must stay clearly readable)`\n- CONTENT_FIRST_MOCKUP_BALANCE: 10  \n  `(1 = device frame dominates, 10 = device frame supports the screen but content remains the hero)`\n- MIN_TEXT_SIZE_DISCIPLINE: 10  \n  `(1 = small text acceptable, 10 = text must never feel too small at normal viewing size)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the app category.\n\nInterpretation:\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"premium iOS\", bias toward elegant restraint and native-feeling hierarchy.\n- If the user says \"Android\", bias toward stronger Material-like structure and navigation clarity.\n- If the user says \"creative social app\", increase visual variance and image creativity without sacrificing readability.\n- If the user says \"fintech\", \"health\", or \"productivity\", increase trust, calmness, and structural clarity.\n- Do not be lazy with screen count.\n- If more screens would make the flow better, generate more screens.\n- If more detail renders would make the UI clearer, generate more detail renders.\n- Default toward richer art direction than standard AI mobile output.\n- Use creative assets, texture, and imagery deliberately, not randomly.\n- Always keep the color palette clean, controlled, and intentional.\n- Avoid generic color choices.\n- Do not force every app into ultra-simple minimalism.\n- Keep text comfortably readable at normal viewing size.\n- Maintain strong consistency across all generated images in the same set.\n- Keep device framing neat, even, and professional.\n- Show the app inside a clean phone mockup by default, but keep the focus on the app content.\n\n---\n\n## 2. PLATFORM MODE RULE\n\nAlways decide the platform mode first.\n\nChoose one:\n1. iOS-native premium\n2. Android-native premium\n3. cross-platform premium neutral\n\n### iOS-native premium\nBias toward:\n- cleaner top areas\n- tab-bar clarity\n- safe-area awareness\n- elegant spacing\n- restrained chrome\n- calm hierarchy\n- native-feeling sheets and cards\n- polished but not overdecorated interfaces\n\n### Android-native premium\nBias toward:\n- stronger component rhythm\n- clearer app bar behavior\n- bottom navigation clarity\n- sheet logic\n- card/list structure\n- slightly firmer layout framing\n- more explicit state clarity where useful\n\n### Cross-platform premium neutral\nBias toward:\n- clean safe-area handling\n- universal mobile navigation patterns\n- clear hierarchy\n- less platform-specific ornament\n- premium but broadly buildable visual language\n\nDo not mix iOS and Android patterns carelessly.\nPick one dominant platform feel and stay coherent.\n\n---\n\n## 3. MANDATORY SCREEN-FIRST RULE\n\nFor mobile app requests, generate the screen image or screen set directly.\n\nDo not:\n- answer with only text\n- describe what the app could look like without generating it\n- collapse multiple screens into one vague idea board if the user actually needs a flow\n\nThe main deliverable is:\n- one or more mobile screen images\n- optionally extra detail views when needed\n- a clear flow set when multiple screens are requested\n\n---\n\n## 4. GENERATE ENOUGH SCREENS RULE\n\nGenerate enough screens to make the flow feel real.\n\nDo not be lazy with screen count.\n\nIf the user asks for:\n- 1 screen → generate 1 screen image\n- 2 screens → generate 2 screen images\n- 3 screens → generate 3 screen images\n- 5 screens → generate 5 screen images\n- 7 screens → generate 7 screen images\n- onboarding flow → generate multiple onboarding screens, not one\n- auth flow → generate separate sign in / sign up / recovery states when useful\n- app concept → generate a meaningful set, not one isolated hero mockup\n\nIt is better to generate:\n- multiple clean readable screens\nthan:\n- one compressed board with tiny unreadable text\n\nIf a detail is unclear:\n- generate an extra detail image\n- or regenerate that screen cleanly\n\nNever reduce screen count just for convenience if it weakens the app concept.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a screen or detail needs a dedicated view, do not just crop or zoom into a previously generated larger image.\n\nDo not:\n- crop a settings view out of a larger board\n- crop tiny onboarding copy out of a multi-screen collage\n- crop a small card from a broader screen to inspect it\n- rely on cutouts if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh standalone screen image\n- generate a fresh detail render\n- keep the same design language, colors, type mood, and component family\n- make the new image specifically optimized for readability\n\nFresh screen-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. APP DESIGN BIBLE RULE\n\nWhen generating multiple images for the same app, lock an internal design bible before continuing.\n\nThis design bible should remain consistent across the whole set:\n- platform mode\n- device frame style\n- device scale\n- palette logic\n- typography mood\n- type scale rhythm\n- spacing system\n- corner radius logic\n- icon style\n- illustration / imagery treatment\n- texture intensity\n- decorative asset language\n- navigation model\n- card and list behavior\n- button styling\n- shadow language\n\nDo not let screen 3, 4, or 5 drift into a different app.\n\nEvery new screen should feel like it belongs to the same product world.\n\n---\n\n## 7. MULTI-SCREEN CONSISTENCY RULE\n\nIf multiple screens are requested, consistency is mandatory.\n\nKeep consistent:\n- overall brand mood\n- type hierarchy\n- palette\n- safe-area handling\n- navigation behavior\n- component family\n- surface treatment\n- card treatment\n- background logic\n- image framing\n- decorative accents\n- device frame presentation\n\nVariation is allowed in:\n- composition\n- feature emphasis\n- image placement\n- screen purpose\n- visual tempo\n\nBut not in:\n- product identity\n- design system\n- mockup quality\n- core spacing logic\n\nThe flow should feel varied but unified.\n\n---\n\n## 8. LOGICAL FLOW RULE\n\nWhen multiple images are generated, they must form a believable app flow.\n\nDo not generate random unrelated screens.\n\nThe screen order should make sense.\n\nExamples:\n- onboarding → auth → home\n- home → browse → detail\n- profile → settings → edit profile\n- cart → checkout → confirmation\n- dashboard → activity → detail\n- welcome → permissions → personalized home\n\nAsk internally:\n- why does screen 2 come after screen 1?\n- what action or navigation leads to the next screen?\n- is this a believable user journey?\n- does the UI state carry forward logically?\n\nA good screen set should feel like a real product walkthrough, not a loose visual collection.\n\n---\n\n## 9. DEFAULT MOCKUP PRESENCE RULE\n\nBy default, present the mobile UI inside a clean phone mockup with a visible device border/frame.\n\nThis should usually be:\n- a clean iPhone-style mockup for iOS or neutral premium concepts\n- a clean Android-style mockup for Android-native concepts\n- a subtle premium generic phone mockup for cross-platform concepts\n\nDo not omit the device frame by default.\n\nOnly remove the visible device frame if:\n- the user explicitly asks for raw screen-only output\n- the concept clearly benefits from borderless presentation\n- the user asks for UI sheets or assets instead of full phone compositions\n\nDefault rule:\nphone mockup present  \ncontent still primary\n\n---\n\n## 10. DEVICE MOCKUP FRAME RULE\n\nWhen using an iPhone, Android, or generic phone mockup, the mockup must look clean and premium.\n\nRules:\n- use one coherent device style across the full set unless the user explicitly wants mixed devices\n- keep device scale consistent across all screens in the same series\n- keep the mockup centered or aligned with clear discipline\n- keep outer spacing around the device clean and balanced\n- keep top, bottom, left, and right canvas margins visually even\n- do not let the phone touch the canvas edges\n- do not use awkwardly cropped device frames\n- do not use inconsistent bezels or random frame sizes across screens\n- keep shadows soft and controlled\n- keep the mockup presentation calm and premium\n- the phone border/frame should be visible and clean\n- the mockup should support the screen, not overpower it\n- keep visual emphasis on the UI content inside the phone\n\nIf multiple device mockups appear in one composition:\n- keep the same scale\n- keep equal gutter spacing between devices\n- align them cleanly\n- avoid random overlap unless explicitly art-directed\n\nIf the concept works better without a visible device frame:\n- only then present the screen cleanly with equal outer margins and controlled padding\n\nThe presentation should feel:\n- neat\n- balanced\n- premium\n- intentional\n- content-first\n\n---\n\n## 11. ONBOARDING FLOW RULE\n\nOnboarding should not feel like repeated template slides.\n\nIf the user asks for onboarding:\n- generate multiple distinct onboarding screens\n- vary composition across screens\n- vary the balance of image, text, and CTA\n- keep the flow coherent\n- keep copy short\n- keep the first screen especially clean\n\nGood onboarding should feel:\n- clear\n- fast\n- helpful\n- visually memorable\n- not overexplained\n\nAvoid:\n- 3 identical screens with only icon and headline changes\n- too much copy\n- giant abstract blobs with no product meaning\n- fake motivational filler language\n- early rating/review prompts\n- cluttered first-run screens\n\n---\n\n## 12. FIRST SCREEN CLEANLINESS RULE\n\nThe first visible screen matters most.\n\nWhether it is:\n- onboarding\n- home\n- auth\n- intro\n- welcome\n- dashboard\n\nit must feel:\n- calm\n- premium\n- immediately readable\n- visually focused\n\nRules:\n- use one primary focal point\n- keep the top screen area controlled\n- keep the headline short\n- do not overload the first viewport\n- do not fill it with extra stats, chips, tags, or pills\n- do not bury the main CTA\n- make the first screen work on a normal phone size without feeling cramped\n- if imagery is used behind text, preserve clear readability with fades, masks, or soft scrims\n\nStrong preference:\n- 1 to 3 short lines for the main statement\n- concise supporting text\n- one clear next action\n\nAvoid:\n- giant wall of text\n- too many micro-labels\n- too many overlapping cards\n- fake enterprise complexity\n- \"website hero inside a phone frame\"\n\n---\n\n## 13. SAFE AREA AND SYSTEM REGION RULE\n\nRespect mobile screen realities.\n\nAlways design with awareness of:\n- safe areas\n- status bar region\n- top bar or title region\n- bottom navigation region\n- home indicator region\n- sheet docking zone\n- gesture space\n\nDo not:\n- cram important content into unsafe areas\n- ignore top and bottom system regions\n- make screens feel like edge-to-edge posters with no functional logic\n- place critical UI where it would be visually unsafe\n\nMobile images should feel like real app screens, not posters.\n\n---\n\n## 14. NAVIGATION RULE\n\nNavigation must feel intentional and believable.\n\nUse familiar mobile patterns when appropriate:\n- tab bar / bottom navigation for major app sections\n- stack navigation feel for drill-down flows\n- sheets for secondary tasks\n- segmented controls for local switching\n- app bars where useful\n- clear primary and secondary actions\n\nDo not:\n- overload bottom navigation\n- hide the main path through the app\n- make every action equally important\n- create unclear hierarchy between tabs, sheets, and actions\n\nThe screen set should imply a believable app flow.\n\n---\n\n## 15. CLEAN LAYOUT RULE\n\nDo not default to box-in-box-in-box mobile UI.\n\nAvoid:\n- giant nested card stacks\n- floating surfaces everywhere\n- 5 levels of framing\n- dashboard clutter for no reason\n- tiny widgets packed together\n- fake operating-system labels\n- decorative pills and micro-status elements\n\nPrefer:\n- cleaner surfaces\n- stronger whitespace\n- fewer but clearer containers\n- direct hierarchy\n- cleaner grouping\n- flatter structure where possible\n- one strong structural move rather than many small noisy ones\n\nA premium mobile screen should not feel trapped inside too many boxes.\n\n---\n\n## 16. CREATIVE IMAGE DIRECTION RULE\n\nThis skill should be more creative than generic app UI generators.\n\nActively use imagery and art direction when it helps the concept.\n\nCreative image usage may include:\n- photography-led onboarding\n- large editorial image blocks\n- image-backed headers\n- product or lifestyle imagery\n- scenic or atmospheric backgrounds\n- illustration-driven entry screens\n- media cards with layered treatment\n- bold visual covers on key screens\n- image strips, shelves, or carousels\n- background images partially revealed behind typography\n\nDo not make imagery feel like an afterthought.\nDo not use lazy filler thumbnails.\nUse real image logic as part of the layout and mood.\n\nWhen the app category supports it, prefer:\n- stronger hero imagery\n- more visual storytelling\n- richer art direction\n- more memorable image composition\n\n---\n\n## 17. BACKGROUND TEXTURE AND SURFACE RULE\n\nDo not default to perfectly sterile flat backgrounds.\n\nWhen appropriate, introduce subtle or medium-strength texture to create a richer visual atmosphere.\n\nAllowed background treatments:\n- soft film grain\n- subtle noise\n- paper-like texture\n- lightly speckled surfaces\n- brushed or frosted texture feel\n- tonal gradient fog\n- clouded ambient depth\n- tactile matte surfaces\n- faint grid or pattern texture\n- blurred photographic background layers\n\nUse texture to make the UI feel:\n- more premium\n- more tactile\n- less generic\n- more art-directed\n\nBut:\n- keep it controlled\n- keep the UI readable\n- do not let heavy texture overwhelm text\n- do not introduce noise just for the sake of noise\n\nGood rule:\ntexture should support the mood, not compete with the interface.\n\n---\n\n## 18. IMAGE-BEHIND-TEXT RULE\n\nWhen appropriate, use images behind or beneath text in a controlled, premium way.\n\nPreferred treatments:\n- image background under a title block with a fade to transparent\n- bottom-to-top gradient fade to support text legibility\n- side fade masks so text sits over the clean portion\n- soft blur overlays behind text\n- image partially visible behind copy, fading into the background color\n- large edge-to-edge visual with a scrim under headline and CTA\n- photo or illustration bleeding behind typography but gently masked\n\nThis is especially useful for:\n- onboarding\n- welcome screens\n- media apps\n- fashion / travel / lifestyle apps\n- premium commerce apps\n- social apps\n- editorial experiences\n\nRules:\n- text must stay readable\n- the fade / mask should feel elegant\n- the image should still be visually meaningful\n- the treatment should feel intentional, not like random opacity\n\nAvoid:\n- raw image under text with no readability support\n- muddy overlays\n- too many heavy gradients\n- noisy backgrounds that destroy hierarchy\n\n---\n\n## 19. CREATIVE ASSET RULE\n\nUse tasteful supporting creative assets when they improve the visual language.\n\nAllowed creative assets:\n- clean micro-illustrations\n- simple geometric SVG-style motifs\n- tiny line-art accents\n- subtle vector icons\n- dotted guides\n- arc shapes\n- orbital lines\n- tasteful starbursts\n- calm abstract marks\n- mini diagram-like elements\n- product-relevant iconography\n- clean sticker-like accent elements when suitable\n\nThese assets should feel:\n- clean\n- premium\n- restrained\n- integrated into the design system\n- supportive, not distracting\n\nDo not:\n- spam random stickers\n- clutter the interface with decorative icons\n- add meaningless SVG art\n- use childish doodles unless the brand clearly wants it\n\nA few clean visual accents are good.\nToo many become noise.\n\n---\n\n## 20. ICONOGRAPHY RULE\n\nDo not default to generic developer-style icon packs or bland Lucide-like icon vibes.\n\nAvoid:\n- generic line-icon defaults that make the app feel like a template\n- overused developer-tool icon language\n- icons that feel too plain, too open-source-default, or too undifferentiated\n- randomly mixing icon weights and styles\n\nPrefer:\n- a clean custom-feeling icon system\n- restrained, brand-appropriate iconography\n- consistent stroke or filled logic\n- icons with slightly more character when the concept allows it\n- product-specific icon decisions instead of default library-looking symbols\n\nIcons should feel:\n- clean\n- intentional\n- premium\n- integrated\n- not generic\n\n---\n\n## 21. MOBILE ANTI-AI-TELLS RULE\n\nStrictly avoid these unless explicitly requested.\n\n### Visual AI tells\n- purple-blue fintech gradients everywhere\n- random glass cards\n- ambient blobs with no purpose\n- fake neon premium look\n- generic dribbble-style floating widgets\n- oversized corner radii on everything\n- over-rendered glossy surfaces without hierarchy\n\n### Layout AI tells\n- fake chart dashboard spam\n- repeated stat cards with no product reason\n- a homepage that looks like 12 widgets fighting for attention\n- cloned screens in a flow\n- giant empty cards with weak content\n- phone-shaped websites instead of app screens\n\n### Copy AI tells\nAvoid filler phrases like:\n- elevate your life\n- unlock your potential\n- next-gen finance\n- seamless control\n- smarter than ever\n- transform your day\n\nAvoid fake brand slop:\n- Acme\n- NovaCore\n- Flowbit\n- Quantix\n- VeloPay\n\n### UI clutter tells\n- too many pills\n- too many badges\n- too many tiny labels\n- fake system markers\n- meaningless avatar rows\n- random chart inserts\n- decorative toggles with no product meaning\n\n---\n\n## 22. STYLE VARIATION ENGINE\n\nTo avoid repetitive mobile design output, choose a clear visual direction and commit to it.\n\n### Theme Paradigm\nChoose 1:\n1. pristine light\n2. deep dark\n3. soft wellness neutral\n4. premium monochrome\n5. rich accent-driven\n6. editorial luxe\n7. playful consumer color\n8. calm productivity minimal\n\n### Typography Character\nChoose 1:\n1. clean system-like sans\n2. refined grotesk\n3. expressive premium display + clean body\n4. soft humanist sans\n5. sharper product sans with disciplined hierarchy\n\n### Structure Bias\nChoose 1:\n1. list-led utility\n2. card-led modular\n3. dashboard-led overview\n4. media-led storytelling\n5. profile-led identity\n6. commerce-led browse and detail flow\n7. chat-led conversational flow\n8. wellness-led calm block rhythm\n\n### Image Art Direction Bias\nChoose 1:\n1. editorial photography\n2. cinematic lifestyle imagery\n3. soft illustration-led\n4. tactile abstract compositions\n5. premium product imagery\n6. mixed photo + vector art direction\n7. moody atmospheric backdrops\n8. collage-lite layered imagery\n\n### Texture / Surface Treatment\nChoose 1:\n1. ultra-subtle grain\n2. matte paper texture\n3. foggy gradient atmosphere\n4. soft noise wash\n5. blurred image haze\n6. clean flat with one textured hero area\n7. tactile monochrome surface\n8. low-opacity technical pattern\n\n### Palette Logic\nChoose 1:\n1. restrained monochrome + one accent\n2. warm neutral palette + sharp dark contrast\n3. cool mineral palette + clean highlight accent\n4. editorial cream / charcoal / muted accent\n5. rich dark base + refined warm accent\n6. wellness soft palette with controlled saturation\n7. bright consumer palette with disciplined balance\n8. desaturated premium palette with one bold hit\n\n### Signature Component Set\nChoose exactly 4:\n- large hero metric card\n- compact stat strip\n- modular collection grid\n- media carousel\n- layered profile header\n- premium segmented control\n- bottom action sheet\n- framed product card stack\n- progress ring block\n- message bubble system\n- settings group cells\n- photo-led card strip\n- sticky mini player\n- collection shelf\n- habit tracker block\n- checkout summary card\n- journal entry card\n- achievement tile row\n\n### Decorative Asset Set\nChoose exactly 2:\n- minimal line icon cluster\n- abstract orbit lines\n- dotted arc accents\n- starburst micro-motif\n- rounded sticker accent\n- tiny directional arrow system\n- fine-grid motif\n- soft waveform line\n- clean badge glyphs\n- mini geometric markers\n\n### Motion-Implied Language\nChoose exactly 2:\n- springy card lift energy\n- sheet rise energy\n- tab transition calmness\n- staggered list reveal energy\n- soft dashboard fade-up energy\n- parallax header drift energy\n- carousel glide energy\n\nThese are image-direction cues, not code instructions.\n\n---\n\n## 23. COLOR PALETTE RULE\n\nAlways use a clean, controlled color palette.\n\nColor should feel:\n- intentional\n- premium\n- coherent\n- non-generic\n- visually calm even when expressive\n\nRules:\n- use a strong palette with internal logic\n- keep color relationships clean\n- let one or two accents do real work\n- avoid muddy, accidental, or chaotic color combinations\n- avoid generic startup gradients unless they truly fit\n- avoid default purple-blue AI palettes unless specifically justified\n- avoid random bright rainbow color use\n- avoid throwing many unrelated saturated colors together\n- keep saturation under control unless the brand clearly benefits from stronger intensity\n\nA palette can be:\n- bold\n- soft\n- dark\n- editorial\n- playful\n- luxurious\n- atmospheric\n\nBut it must still feel clean.\n\nGood color direction should make the app feel:\n- distinctive\n- art-directed\n- brand-specific\n- expensive or thoughtfully designed\n\nNot:\n- template-like\n- random\n- overcooked\n- generic\n\n---\n\n## 24. NON-GENERICITY RULE\n\nThe app should not feel like a default template.\n\nDo not settle for:\n- standard generic fintech\n- standard wellness pastel app\n- standard social feed clone\n- standard productivity dashboard clone\n- standard ecommerce browse/detail clone without personality\n\nPush the concept toward:\n- stronger identity\n- stronger mood\n- stronger art direction\n- cleaner but more original composition\n- better image treatment\n- more distinctive asset language\n- more specific palette logic\n- more memorable screen-to-screen rhythm\n\nThe result should feel like:\n- a real designed product\nnot:\n- a reusable starter template with better lighting\n\n---\n\n## 25. NOT ALWAYS SIMPLE RULE\n\nDo not force every app into hyper-minimal simplicity.\n\nSimplicity is not the goal by itself.\nCleanliness is the goal.\n\nThis means:\n- a screen may be rich, layered, and expressive if it remains readable\n- a flow may have stronger visuals, texture, and more atmosphere if it stays structured\n- an app may use bold imagery, richer backgrounds, and more art direction without becoming messy\n\nAllowed:\n- sophisticated layering\n- controlled visual depth\n- richer compositions\n- stronger image presence\n- decorative accents with purpose\n- multiple visual zones within a screen\n- more character when the brand needs it\n\nNot allowed:\n- noisy complexity\n- clutter disguised as creativity\n- random decorative overload\n- muddy hierarchy\n- unreadable interfaces\n\nThe rule is:\nnot always simple  \nalways clean\n\n---\n\n## 26. IMAGE SYSTEM RULE\n\nImages are not mandatory on every app screen, but when they appear they must feel important.\n\nUse images when the app category benefits from them:\n- social\n- ecommerce\n- travel\n- wellness\n- editorial\n- food\n- fashion\n- content apps\n- creator apps\n- marketplace apps\n\nTypes of image usage:\n- onboarding hero visuals\n- profile imagery\n- product imagery\n- collection thumbnails\n- editorial crops\n- photo-led cards\n- cover blocks\n- media shelves\n- gallery strips\n- background images under text with fade treatments\n- softly masked image headers\n- atmospheric scene layers behind core content\n\nRules:\n- image usage should match the app category\n- repeated image modules should use controlled proportions\n- images should feel curated and consistent\n- the app should not rely on one single image if the flow clearly needs more\n- different screens can use different images, but they must still belong to one product world\n- if imagery is important, push it hard enough to feel intentional\n\nAvoid:\n- random filler thumbnails\n- one pretty screen and then no imagery at all\n- inconsistent image proportions\n- collage chaos unless explicitly requested\n\n---\n\n## 27. FIXED MOBILE MEDIA FRAME RULE\n\nWhen images are used, place them inside clear, controlled frames.\n\nPrefer:\n- stable aspect ratios\n- consistent crop behavior\n- repeatable media modules\n- clear radius logic\n- clean framing\n\nExamples:\n- onboarding hero in a bounded visual block\n- product cards with consistent proportions\n- editorial shelves with repeatable crops\n- profile/media headers with stable framing\n- image rows with controlled ratios\n\nAvoid:\n- random image sizes\n- messy scaling\n- inconsistent crop systems\n- uncontrolled visual noise\n\nThe goal is strong media inside a believable mobile system.\n\n---\n\n## 28. TEXT RULE\n\nCopy should be:\n- short\n- clean\n- product-appropriate\n- readable\n- useful for the screen\n\nUse:\n- concise headlines\n- believable button labels\n- minimal supporting copy\n- screen titles that feel real\n\nAvoid:\n- lorem ipsum overload\n- long paragraphs\n- fake inspirational filler\n- overloaded onboarding explanations\n- overly technical filler labels\n\nFor first screens and onboarding especially:\n- keep copy tight\n- reduce words rather than forcing more lines\n\n---\n\n## 29. TEXT SIZE AND READABILITY RULE\n\nText must never feel too small.\n\nStrong rule:\n- if the text feels small, the design is not finished yet\n\nPrioritize:\n- comfortably readable titles\n- clearly readable body copy\n- readable labels and buttons\n- enough contrast against the background\n- enough spacing around text blocks\n- strong hierarchy between headline, body, and small supporting text\n\nDo not:\n- shrink text to fit too much UI\n- use tiny decorative labels\n- let body copy become hard to read\n- sacrifice legibility for style\n- place text on busy imagery without protection\n- compress too much information into one screen until the type becomes small\n\nIf a design choice makes text too small:\n- simplify the layout\n- reduce content\n- increase spacing\n- enlarge the text\n- split content into another screen if needed\n- regenerate the screen if necessary\n\nReadable beats clever.\nReadable beats dense.\nReadable beats decorative small type.\n\n---\n\n## 30. TYPOGRAPHY RULE\n\nTypography is a primary design tool.\n\nAlways ensure:\n- strong title/body/label contrast\n- readable mobile scale\n- clear section headers\n- short CTA copy\n- believable type rhythm across screens\n- good line count control\n\nDo not:\n- make everything the same weight\n- use too many font moods\n- create awkward line wrapping\n- use oversized headline drama on every screen\n- let body text become tiny or decorative\n\nFor premium apps:\n- typography should feel deliberate, not loud by default\n\n---\n\n## 31. SPACING AND DENSITY RULE\n\nDo not make the app too dense.\n\nThe UI should breathe.\n\nRules:\n- use generous spacing between major screen blocks\n- keep internal padding clean\n- avoid one screen feeling cramped while the next is empty\n- smaller modules still need enough surrounding space\n- let whitespace create calmness and focus\n- separate dense screens from calmer screens in a flow\n- allow textured or image-led areas to breathe instead of stacking more UI on top\n\nA premium mobile app should feel:\n- open\n- composed\n- balanced\n- touch-friendly\n- calm\n\nNot:\n- cramped\n- jittery\n- noisy\n- overfilled\n- visually exhausting\n\n---\n\n## 32. SCREEN-TO-SCREEN VARIATION RULE\n\nA multi-screen app flow should not feel like one screen duplicated several times.\n\nAcross the flow, vary:\n- top-area composition\n- image-to-text balance\n- content density\n- card/list emphasis\n- CTA placement\n- visual tempo\n- module proportions\n- background treatment\n- texture intensity\n- use of creative assets\n\nBut:\n- keep the app coherent\n- preserve the same product language\n- do not drift into a different design system\n- do not randomize for the sake of randomizing\n\nThe flow should feel varied but unified.\n\n---\n\n## 33. CATEGORY-SPECIFIC BIAS\n\n### Fintech\nPrefer:\n- trust\n- calm spacing\n- clear numbers\n- restrained accents\n- less fake chart spam\n- strong transaction clarity\n- subtle texture, not loud effects\n\n### Health / Fitness\nPrefer:\n- calm structure\n- strong metric hierarchy\n- motivating but not noisy screens\n- readable progress modules\n- airy spacing\n- optimistic imagery or wellness textures where useful\n\n### Productivity\nPrefer:\n- clarity\n- list and card discipline\n- navigation simplicity\n- calm density\n- strong task hierarchy\n- minimal but premium supporting visuals\n\n### Social\nPrefer:\n- profile and feed rhythm\n- media moments where useful\n- clearer hierarchy between creation and browsing\n- stronger flow variety\n- more expressive image direction\n\n### Commerce\nPrefer:\n- browse / detail / cart clarity\n- strong product imagery\n- stable product card proportions\n- clean checkout hierarchy\n- tasteful editorial image treatments\n\n### Wellness / Lifestyle\nPrefer:\n- softer materials\n- calm typography\n- less visual noise\n- breathing room\n- elegant imagery\n- tactile backgrounds and soft fades\n\n---\n\n## 34. REGENERATION RULE\n\nIf a generated screen is not strong enough, regenerate it.\n\nRegenerate when:\n- text is too small\n- spacing is unclear\n- navigation feels fake\n- the screen looks too much like a website\n- the UI is too crowded\n- the onboarding screens are too repetitive\n- image framing is inconsistent\n- cards are too nested\n- the first screen is too noisy\n- the flow lacks variation\n- backgrounds feel too flat or generic\n- imagery is weak, lazy, or missing\n- the fade/mask treatment behind text is poor\n- decorative assets feel absent or overly bland\n- creative elements are too timid to matter\n- the color palette feels generic or muddy\n- the design feels too simple in a boring way\n- the screen set loses consistency\n- the device mockup framing feels uneven or sloppy\n\nDo not settle for the first mediocre render.\nRefine until the screen set feels clean, believable, art-directed, and consistent.\n\n---\n\n## 35. QUALITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Does this feel like a real mobile app, not a website in a phone?\n2. Are safe areas respected visually?\n3. Is the first screen clean enough?\n4. Is the copy short enough?\n5. Is the type readable?\n6. Are there enough screens for the requested flow?\n7. Were too few screens generated out of laziness?\n8. If a detail was unclear, was a new detail render created?\n9. Is the app free of obvious mobile AI tells?\n10. Is the layout free of box-in-box clutter?\n11. Are image moments purposeful and consistent?\n12. Does the flow feel coherent?\n13. Do screens vary enough without breaking the design system?\n14. Does the product feel premium and app-native?\n15. Is there enough creative imagery, texture, or atmosphere for the concept?\n16. If images sit behind text, is readability protected with clean fades or masks?\n17. Are decorative assets clean and restrained?\n18. Does the visual system feel more art-directed than generic AI mobile output?\n19. Is the color palette clean and controlled?\n20. Does the design feel non-generic?\n21. Is the design clean without being boringly oversimplified?\n22. Do all screens clearly belong to the same app?\n23. Is the flow logical from screen to screen?\n24. Is the phone mockup framing clean and evenly padded on all sides?\n25. Is the text comfortably readable and not too small?\n26. Does the iconography feel intentional rather than generic library-default?\n27. Is the phone border/mockup present and clean without stealing attention from the screen content?\n\nIf not, refine before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a mobile app image concept:\n1. infer app category\n2. infer platform mode\n3. infer number of screens\n4. choose a strong visual direction\n5. choose an image art direction bias\n6. choose a texture / surface treatment\n7. choose tasteful decorative assets\n8. choose a clean palette logic\n9. lock an internal design bible for consistency\n10. generate the required screen images\n11. generate more screens if needed for a believable flow\n12. generate extra detail renders if needed\n13. keep the first screen especially clean\n14. avoid website-like layouts\n15. avoid nested-card clutter\n16. enforce strong and creative image usage where appropriate\n17. use texture, fades, masks, and background imagery when they improve the result\n18. keep spacing generous and readable\n19. keep text comfortably legible\n20. avoid generic palettes and generic composition\n21. avoid generic icon-library-looking iconography\n22. present screens inside a clean phone mockup by default\n23. keep the phone border/mockup subtle and premium\n24. keep focus on the app content, not on showing off the device\n25. maintain strong consistency across the whole image set\n26. keep device mockups clean, balanced, and evenly spaced\n27. refine weak screens instead of accepting them\n28. output the final screen set\n\nDo not switch into coding mode.\nDo not write implementation instructions.\nDo not collapse a requested flow into one lazy collage.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n\"make a premium fitness app\"\n\nInterpretation:\n- choose iOS-native or cross-platform premium\n- generate multiple screens, not just one\n- include a clean first screen\n- use calm spacing and strong metric hierarchy\n- avoid fake chart spam\n- use tasteful texture or soft imagery if it helps\n- keep the flow believable\n- keep the palette clean and controlled\n- keep all screens and mockups visually consistent\n- keep text readable and not tiny\n- show the screens in a subtle, clean phone mockup\n\n### Example 2\nUser:\n\"design a 5-screen ecommerce app\"\n\nInterpretation:\n- generate 5 clean screen images\n- include browse, detail, cart or checkout logic\n- use strong product imagery\n- use fixed media frames\n- use tasteful editorial image treatments or background fades where useful\n- keep hierarchy clean and product-first\n- avoid generic commerce templates\n- keep device framing and spacing consistent across all 5 images\n- avoid generic default icon language\n- use a clean visible phone frame without letting it dominate\n\n### Example 3\nUser:\n\"make an onboarding flow for a social app\"\n\nInterpretation:\n- generate multiple onboarding screens\n- vary layout across screens\n- keep copy short\n- make the first screen especially clean\n- avoid repetitive slide-template design\n- push imagery, texture, and background fade treatments more creatively\n- keep the palette clean but distinctive\n- keep the screen progression logical and consistent\n- keep typography readable and properly scaled\n- present the flow in consistent phone mockups with balanced outer margins\n\n---\n\n## 38. FINAL GOAL\n\nGenerate mobile app screen images that feel:\n- premium\n- app-native\n- clear\n- clean\n- structured\n- readable\n- memorable\n- anti-generic\n- believable\n- creatively art-directed\n\nThis skill should create strong mobile app image concepts and flow images only.\n\nIt should not write code.\nIt should not behave like a website skill.\nIt should not produce lazy one-board output when multiple screens are clearly needed.\n\nIt should actively allow:\n- stronger imagery\n- richer background textures\n- subtle noise or tactile surfaces\n- image-backed text areas with elegant fade-to-transparent treatment\n- clean decorative SVG-like accents\n- more creative assets when they help the product feel distinct\n- clean but expressive color palettes\n- more visual character without losing clarity\n- richer layouts when appropriate, not just forced simplicity\n- strong consistency across all generated images\n- logical screen progression\n- clean iPhone or similar phone mockups with visible borders/frames\n- equal outer spacing and balanced framing around the device\n- a content-first presentation where the mockup supports the UI instead of overpowering it\n\nIt should actively avoid:\n- random bright colors\n- muddy palettes\n- tiny text\n- generic Lucide-like icon defaults\n- template-looking app screens\n- inconsistent screen sets\n- sloppy or missing phone mockups\n- oversized device framing that distracts from the design\n\nThe final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.\n","frontmatter":{"name":"imagegen-frontend-mobile","description":"Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code."},"isInternal":false,"tokens":8777,"sizeBytes":40326},{"name":"SKILL.md","path":".agents/skills/imagegen-frontend-web/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/imagegen-frontend-web/SKILL.md","title":"imagegen-frontend-web","category":"anthropic-skill","format":"markdown","content":"---\nname: imagegen-frontend-web\ndescription: Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate.\n---\n\n# HARD OUTPUT RULE — READ FIRST\n\n**Generate one separate horizontal image PER section. Always. No exceptions.**\n\n- 1 section requested -> 1 image\n- 4 sections requested -> 4 images\n- 8 sections requested -> 8 images\n- 12 sections requested -> 12 images\n- \"landing page\" with no count -> default to 6 sections -> 6 images\n- \"full website template\" -> default to 8 sections -> 8 images\n\nEach image is one section, generated as its own image call. Never combine multiple sections into one frame. Never return a single tall image that contains the whole page.\n\nIf you can only render one image at a time, output them sequentially in the same response, one after the other, until every section has its own image. Announce each one (\"Section 1 of 8: Hero\", \"Section 2 of 8: Trust bar\", etc.).\n\nThis rule overrides any model default that wants to collapse output into a single image.\n\n---\n\n# HERO COMPOSITION BIAS — READ FIRST\n\nThe default **left-text / right-image hero is the most overused AI pattern**. It is allowed, but it should not be your first instinct.\n\nBefore reaching for it, consider these alternatives and pick whichever fits the brand best:\n- centered over background image\n- bottom-left over image\n- bottom-right over image\n- top-left lead\n- stacked center\n- image-as-canvas\n- off-grid editorial\n- mini minimalist\n- right-text / left-image (inverted classic)\n\nUse left-text / right-image only when it is genuinely the strongest choice — not by default.\n\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL IMAGE ART DIRECTION\nYou are an elite frontend image art director.\n\nYour job is not to generate generic AI art.\nYour job is to generate highly creative, premium, frontend design reference images that feel like real high-end website concepts.\n\nStandard image generation tends to collapse into repetitive defaults:\n- centered dark hero\n- purple/blue AI glow\n- floating meaningless blobs\n- generic dashboard card spam\n- weak typography hierarchy\n- cloned sections\n- \"luxury\" that is just beige serif text\n- \"creative\" that is actually messy and unreadable\n- text-heavy layouts with not enough imagery\n- overly dense sections with no breathing room\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- art-directed\n- premium\n- visually memorable\n- structured\n- readable\n- implementation-friendly\n- clearly usable as a frontend reference\n\nDo not generate random mood art unless explicitly asked.\nDefault to website design comps.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8\n  `(1 = rigid / symmetrical, 10 = artsy / asymmetric)`\n- VISUAL_DENSITY: 4\n  `(1 = airy / gallery-like, 10 = packed / intense)`\n- ART_DIRECTION: 8\n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9\n  `(1 = loose moodboard, 10 = very codeable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9\n  `(1 = mostly typographic, 10 = strongly image-led)`\n- SPACING_GENEROSITY: 8\n  `(1 = compact / tight, 10 = very spacious / breathable)`\n- LAYOUT_VARIATION: 8\n  `(1 = same anchor repeats, 10 = bold composition variety across sections)`\n- CONVERSION_DISCIPLINE: 8\n  `(1 = pure art moodboard, 10 = clear funnel + premium design balance)`\n\nAI Instruction:\nUse these as global defaults unless the user clearly asks for something else.\nDo not ask the user to edit this file.\nAdapt these values dynamically from the prompt.\n\nInterpretation:\n- **Adaptation priority**: the user's brief always overrides defaults. Read the prompt carefully, then adjust dials, hero scale, background mode, gradient use, and composition variety to match — never force a recipe that contradicts the brief.\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"crazy creative\", increase variance and art direction.\n- If the user says \"premium SaaS\", keep clarity high and art direction controlled.\n- If the user says \"editorial\", allow stronger type and more asymmetry.\n- Bias toward stronger visual concepts, not safe layouts — but never against the brief.\n- Use imagery as a core design material — including as **full-bleed backgrounds**, not only as inline assets, **when the brief allows it**.\n- Vary composition: do not default to \"text left, image right\". Move text to bottom-left, center, top-right, etc. across sections.\n- Keep sections breathable. Do not over-pack the page.\n- Prefer slightly more whitespace between sections than default.\n- Stay conversion-aware: every section has a job (hook / proof / educate / convert).\n\n### Brief-to-direction mapping\nRead the brief. Then bias the picks like this:\n\nIf the user says **\"minimalist\" / \"clean\" / \"typography-only\" / \"swiss\" / \"ultra simple\"**:\n- Hero Scale: Mini Minimalist\n- Background Mode: solid surfaces, subtle texture, optional ONE color-blocked diptych\n- Gradients: skip or use only the softest tonal gradient\n- Composition: stacked center, generous negative space\n- Skip the \"must include full-bleed\" rule\n\nIf the user says **\"editorial\" / \"magazine\" / \"art-directed\" / \"fashion\"**:\n- Hero Scale: Mid Editorial or Giant Statement\n- Background Mode: editorial side-image, duotone treated image, atmospheric photo grade\n- Gradients: subtle tonal grades only\n- Composition: off-grid editorial offset, asymmetric pulls\n- Strong typography contrast\n\nIf the user says **\"cinematic\" / \"atmospheric\" / \"premium\" / \"luxury\" / \"bold\"**:\n- Hero Scale: Giant Statement\n- Background Mode: full-bleed image with tonal overlay, soft radial vignette + product, micro-noise gradient\n- Gradients: cinematic palette-matched welcomed\n- Composition: bottom-left over background image, centered low, image-as-canvas\n\nIf the user says **\"SaaS\" / \"product\" / \"dashboard\" / \"fintech\" / \"infra\"**:\n- Hero Scale: Mid Editorial\n- Background Mode: solid + inline asset, flat block + detail crop, occasional editorial side-image\n- Gradients: very subtle, palette-matched only\n- Composition: clear product framing, trust-driven anchors\n- Slightly higher implementation clarity\n\nIf the user says **\"agency\" / \"creative studio\" / \"portfolio\"**:\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive)\n- Background Mode: vary boldly (full-bleed image, color-blocked diptych, duotone)\n- Gradients: editorial color washes acceptable\n- Composition: off-grid, poster-like\n\nIf the user says **\"e-commerce\" / \"shop\" / \"store\" / \"product page\"**:\n- Hero Scale: Mid Editorial with strong product focus\n- Background Mode: full-bleed product photo, soft radial vignette + crop, flat block + detail\n- Gradients: subtle, never competing with product\n- Composition: product-led; CTAs unmistakable\n\nIf the brief is silent on style:\n- Use defaults from §1 + §2 with confident background variety\n- Pick one Hero Scale decisively, do not split the difference\n\nNever force backgrounds, gradients, or full-bleed treatments where the brief asks for restraint. Never strip them out where the brief asks for atmosphere.\n\n---\n\n## 2. THE COMBINATORIAL VARIATION ENGINE\nTo avoid repetitive AI-looking output, internally choose one option from each category based on the prompt and commit to it consistently.\n\nDo not mash everything together into chaos.\nPick a strong combination and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n   Off-white / cream / paper tones, sharp dark text, editorial confidence.\n2. Deep Dark Mode\n   Charcoal / graphite / zinc, elegant glow only when justified.\n3. Bold Studio Solid\n   Strong controlled color fields like oxblood, royal blue, forest, vermilion, or emerald with crisp contrasting UI.\n4. Quiet Premium Neutral\n   Bone, sand, taupe, stone, smoke, muted contrast, restrained luxury.\n\n### Background Character\nChoose 1:\n1. Subtle technical grid / dotted field\n2. Pure solid field with soft ambient gradient depth\n3. Full-bleed cinematic imagery with proper contrast control\n4. Quiet textured paper / material / tactile surface feel\n\n### Typography Character\nChoose 1:\n1. Satoshi-like clean grotesk\n2. Neue-Montreal-like refined grotesk\n3. Cabinet / Clash-like expressive display\n4. Monument-like compressed statement typography\n5. Elegant editorial serif + sans pairing\n6. Swiss rational sans with very strong hierarchy\n\nNever drift into boring default web typography energy.\n\n### Hero Architecture\nChoose 1:\n1. Cinematic Centered Minimalist\n2. Asymmetric Split Hero\n3. Floating Polaroid Scatter\n4. Inline Typography Behemoth\n5. Editorial Offset Composition\n6. Massive Image-First Hero with restrained text\n\n### Section System\nChoose 1 dominant structure:\n1. Strict modular bento rhythm\n2. Alternating editorial blocks\n3. Poster-like stacked storytelling\n4. Gallery-led visual cadence\n5. Swiss grid discipline\n6. Asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- Diagonal Staggered Square Masonry\n- 3D Cascading Card Deck\n- Hover-Accordion Slice Layout\n- Pristine Gapless Bento Grid\n- Infinite Brand Marquee Strip\n- Turning Polaroid Arc\n- Vertical Rhythm Lines\n- Off-Grid Editorial Layout\n- Product UI Panel Stack\n- Split Testimonial Quote Wall\n- Oversized Metrics Strip\n- Layered Image Crop Frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\n### Composition Anchor (per-section)\nThe **left-text / right-image** layout is allowed, but it is the most overused AI pattern — do not use it as the default. Reach for it only when it is the genuinely best fit.\n\nEach section picks 1 anchor; across the site at least 3 different anchors must appear; vary the hero so the page does not open on the AI default.\n- Centered statement\n- Top-left lead, support bottom-right\n- Bottom-left text over background image\n- Bottom-right CTA cluster\n- Left-third caption + right-two-thirds visual (classic — use sparingly, never twice in a row)\n- Right-third caption + left-two-thirds visual (inverted classic)\n- Centered low (text in lower 40% over hero image)\n- Off-grid editorial offset (asymmetric pull)\n- Stacked center (label / headline / sub / CTA all centered, ultra minimalist)\n- Image-as-canvas with text overlaid in a clean safe area\n\n### Background Mode (per-section)\nPick 1 per section; vary across the page so it is never all the same mode. Be **confident** with backgrounds — they are a primary tool, not a risk.\n- Solid surface with inline asset\n- Subtle texture / paper / grid as background\n- Full-bleed image background with tonal overlay (text remains highly readable)\n- Editorial side-image (50/50, 60/40, 40/60 — invertible)\n- Image as the entire visual + text overlaid in a clean safe area\n- Flat color block + small product / detail crop as accent\n- Cinematic tonal gradient (palette-matched, low chroma, professional)\n- Atmospheric photo with strong color grade (single-tone graded for brand mood)\n- Duotone treated image (two-color photo treatment, palette-locked)\n- Soft radial vignette + product crop (luxury / editorial feel)\n- Micro-noise gradient over solid (premium tactile depth, not flashy)\n- Color-blocked diptych (two flat fields meeting, modernist)\n\n### CTA Variation\nPick the CTA style that fits each section, not a default pill every time:\n- Classic primary pill\n- Outline / ghost\n- Underlined inline link with arrow\n- Banner-style full-width CTA\n- Oversized headline + tiny CTA hint\n- CTA as caption under a strong visual\n\nAcross the site, vary CTA style at least once. The page's primary action stays unmistakable.\n\n### Hero Scale (per-page)\nPick 1 — must match brand mood:\n- Giant Statement Hero (massive type, large image, dominant first viewport)\n- Mid Editorial Hero (balanced type/image, cinematic but not screen-filling)\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, almost no image, lots of negative space)\n\nMini does not mean weak — it means confident restraint.\n\n### Narrative / Concept Spine\nPick 1 and let it thread through visuals and short copy across the page.\n- Artifact / collectible — proof, specimen, treasured object framing\n- Journey / pilgrimage — directional flow, waypoint sections, roadmap feeling\n- Tool / precision instrument — machined detail, calibrated UI, tactile controls\n- Living system / garden — organic growth metaphor, branching layout, nurtured tone\n- Stage / spotlight — theatrical contrast, performer + audience framing\n- Archive / dossier — indexed rows, captions, understated authority\n\n### Second-Read Moment\nPick exactly 1 unobvious but legible motif and place it deliberately, once across the page:\n- asymmetric bleed that still respects hierarchy\n- one oversized punctuation or numeral serving structure\n- a single unexpected material switch (paper vs gloss vs metal accent)\n- a narrow vertical side-rail editorial note style\n- a macro crop that carries brand color naturally\nAvoid gimmick-for-gimmick: the moment must aid scan order or brand recall.\n\nImportant:\nThese are not coding instructions.\nThey are visual-direction cues the generated design should imply.\n\n---\n\n## 3. FRONTEND REFERENCE RULE\nEvery generated image must clearly communicate:\n- layout\n- section hierarchy\n- spacing\n- typography scale\n- visual rhythm\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image and understand how to build it.\n\nDo not produce vague abstract artwork when the request is for frontend.\n\n---\n\n## 4. HERO MINIMALISM RULES\nThe hero must feel cinematic, clear, and intentional.\n\n### Hero Composition Bias\nThe **left-text / right-image hero is the most overused AI hero pattern**. It is allowed, but it should not be your default starting point.\n\nPrefer one of these instead, unless left-text / right-image is genuinely the strongest fit:\n- Centered statement over full-bleed image (text in lower 40%)\n- Bottom-left text over background image\n- Bottom-right text over background image\n- Top-left lead, support bottom-right\n- Stacked center (label / headline / sub / CTA all centered)\n- Image-as-canvas with text overlaid in a clean safe area\n- Right-text / left-image (inverted classic)\n- Off-grid editorial offset\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, mostly negative space)\n\n### Pre-output check\nBefore rendering the hero image, ask yourself: \"Am I drafting the default text-left / image-right layout out of habit?\" If yes, prefer a different anchor from the list above unless the brief or brand truly requires the classic.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- headline should usually read like 5-10 strong words, not a paragraph\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n\n### Headline Rule\nThe H1 should visually read like a premium statement.\nDo not let it feel long, weak, or overly wrapped.\n\n### Typography Execution\nPrefer:\n- medium / normal / light elegance\n- tight tracking\n- controlled line count\n- strong scale contrast\n\nAvoid:\n- random extra-bold shouting everywhere\n- gradient text as a lazy premium effect\n- 6-line startup headings\n- text treatment that looks generated\n\n### Graphic Restraint\nDo not default to:\n- giant meaningless outline numbers\n- cheap SVG-looking filler graphics\n- generic AI blobs\n- random orb clutter\n\nUse:\n- typography\n- image crops\n- real layout tension\n- premium materials\n- strong framing\ninstead.\n\n---\n\n## 5. IMAGE COUNT & PAGE SLICING\n\n### THIS IS THE PRIMARY OUTPUT RULE\nGenerate **one separate horizontal image PER section**. Always.\n\n- never combine multiple sections in a single image\n- never return a single tall slice that contains the whole page\n- never return one \"best\" image and skip the rest\n- never replace several sections with one collage\n\nIf the request is ambiguous about section count, **default high**:\n- \"hero\" -> 1 image\n- \"landing page\" / \"site template\" -> default to 6 sections -> 6 images\n- \"full website\" -> default to 8 sections -> 8 images\n- \"marketing site\" -> default to 8 sections -> 8 images\n- \"product page\" -> default to 6 sections -> 6 images\n- \"portfolio\" -> default to 6 sections -> 6 images\n\nIf the model can only render one image per call, generate them **sequentially in the same response**, one after the other, labeled \"Section X of N: <name>\" until the full set is delivered.\n\n### Format\n- Always horizontal (16:9, 16:10, or 21:9 depending on density)\n- Each image renders one focused section in high fidelity\n- Hero usually 16:9 or 21:9; narrower content sections may be 16:10\n\n### Counting rule\n- 1 section -> 1 horizontal image\n- 4 sections -> 4 horizontal images\n- 8 sections -> 8 horizontal images\n- 12 sections -> 12 horizontal images\n\nDo not collapse multiple sections into one tall slice. Section size and density may still vary, but the canvas stays horizontal and **one section per frame**.\n\n### Section size variety\nAcross the site, mix section ambition deliberately:\n- some sections are large, content-rich, art-directed\n- some sections are mini, ultra minimalist, mostly negative space\n- some sections are medium editorial blocks\n\nThis rhythm creates a premium scrollscape, not uniform slabs.\n\n### Continuity Rule\nAcross all per-section images, enforce one brand world:\n- same palette and accent logic\n- same typography family and scale\n- same CTA family (style variations are fine, identity is not)\n- same border radius language\n- same image treatment (color grade, materials, framing)\n- same tonal voice in any short copy\n\nA viewer scrolling through all frames must read them as one site.\n\n---\n\n## 6. CREATIVITY ESCALATION RULE\nThe design must show real creative ambition.\n\nDo not settle for the first obvious layout solution.\nPush the work beyond generic SaaS patterns.\n\nActively increase at least 3 of these:\n- stronger composition\n- more distinctive typography\n- more confident scale contrast\n- more memorable hero concept\n- more interesting image treatment\n- more expressive section rhythm\n- more original framing / cropping\n- more art-directed visual tension\n- more surprising but clear layout structure\n\nCreativity must feel intentional, not chaotic.\n\nDo:\n- make bold but controlled design decisions\n- use asymmetry when it improves the page\n- create visual moments that feel premium and memorable\n- make the page feel designed, not auto-generated\n\nDo not:\n- default to safe template layouts\n- repeat the same block structure too often\n- confuse creativity with clutter\n- make the page overly dense\n\n---\n\n## 7. IMAGE-FIRST ART DIRECTION\nThis skill must actively use images.\n\nImages are not optional decoration.\nImages are a core part of the frontend design language.\n\nStrongly prefer:\n- art-directed photography\n- product imagery\n- editorial imagery\n- image crops\n- framed image panels\n- layered image compositions\n- image-led hero sections\n- image-supported storytelling blocks\n\nUse images to:\n- create visual hierarchy\n- break up text-heavy layouts\n- build mood and brand character\n- support section transitions\n- make the design easier to interpret and implement\n\nImportant:\n- the design should not become text-only or card-only unless the user explicitly wants that\n- if a page has multiple sections, several sections should meaningfully include imagery\n- if a hero exists, it should usually contain a strong visual image, product visual, or art-directed media element\n- imagery should feel premium and intentional, not like stock filler\n\nAvoid:\n- tiny useless thumbnails\n- random decorative images with no structural role\n- one single image and then a completely text-heavy rest of page\n- overusing fake UI panels instead of real visual variety\n\n---\n\n## 8. ANTI-AI-SLOP RULES\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- perfect but lifeless symmetry everywhere\n- fake complexity without hierarchy\n- empty decorative space with no purpose\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating spheres / blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods in one page\n- awkward line breaks\n- lazy all-caps everywhere\n- gradient headline as shortcut for \"premium\"\n\n### Content slop\nBan generic copy vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- powerful solution\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n- obvious nonsense wordmarks\n\nUse short, believable, design-friendly copy.\n\n### Density slop\n- no over-packed sections\n- no card overload in every block\n- no tiny spacing between major sections\n- no trying to fill every empty area\n- no visually exhausting wall-of-content layouts\n\n### Carousel / marquee slop (layout)\n- infinity logo strips repeating the same 6 blobs\n- “trusted by” ticker that is unreadable mosquito logos\n- auto-play-style hero dots with no semantic purpose\n\n### Data / KPI slop\n- three identical stat columns (99% satisfaction, $10 saved, ∞ scale) unless user asked for KPIs\n- fake dashboards with pointless charts shading the real layout\n\n---\n\n## 9. TYPOGRAPHY-FIRST DISCIPLINE\nTypography is not filler.\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- supporting text that is readable and brief\n- labels, captions, and section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 10. SECTION RHYTHM RULE\nA high-end site does not feel like repeated boxes.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nDo not let every section feel generated from the same template.\n\nImportant:\n- rhythm variation should not break overall cleanliness\n- keep the page visually balanced from top to bottom\n- section heights may vary, but the spacing between sections should feel controlled and fairly even\n- avoid abrupt jumps between very small and very large sections without enough breathing room\n- the full page should feel curated, smooth, and consistent\n\n---\n\n## 11. COMPONENT EXECUTION GUIDELINES\n\n### Diagonal Staggered Square Masonry\nUse square image or content blocks with strong staggered vertical rhythm.\nShould feel curated and graphic, not messy.\n\n### 3D Cascading Card Deck\nCards layered as a physical stack with depth logic.\nShould feel premium and tactile, not gimmicky.\n\n### Hover-Accordion Slice Layout\nA row of compressed visual slices that feel expandable.\nIn static images, imply interaction clearly through proportions and emphasis.\n\n### Pristine Gapless Bento Grid\nMathematically clean grid.\nNo accidental gaps.\nMix large visual blocks with smaller dense information panels.\n\n### Turning Polaroid Arc\nClustered, rotated imagery with elegant composition.\nShould feel styled and intentional, not scrapbook-random.\n\n### Off-Grid Editorial Layout\nUse asymmetry and tension with control.\nMust remain readable and clearly structured.\n\n### Product UI Panel Stack\nLayer UI screens or interface crops to imply a product story.\nAvoid generic fake dashboards.\n\n### Vertical Rhythm Lines\nUse fine lines and spacing systems to reinforce order and elegance.\nNever let them become decorative clutter.\n\n---\n\n## 12. DENSITY & SPACING DISCIPLINE\nDo not make everything too dense.\n\nThe page should breathe.\nLeave slightly more blank space between sections than a default AI-generated design would.\n\nRules:\n- use more even vertical spacing between major sections\n- keep section-to-section spacing consistent unless there is a strong design reason not to\n- avoid one section feeling very cramped while the next feels too empty\n- prefer a clean, balanced cadence across the page\n- allow negative space to create rhythm and emphasis\n- separate denser sections with calmer sections\n- avoid stacking too many cards, labels, and content blocks too tightly\n- smaller sections should still receive enough surrounding space so the page feels polished and intentional\n\nA premium page should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausted\n\nSection rhythm should alternate with control:\n- some sections can be more content-rich\n- some sections can be smaller and calmer\n- but the overall spacing cadence should still feel even, clean, and deliberate\n\nWhitespace is a design tool.\nUse it deliberately.\nDo not let spacing become random.\n\n---\n\n## 13. COLOR & MATERIAL RULES\n\n### Palette Discipline\nUse one controlled palette across the entire site:\n- 1 primary (brand anchor)\n- 1 secondary (supporting tone)\n- 1 accent (used sparingly for CTA / highlight)\n- a neutral scale (background, surface, text, hairline)\n\nSection-level mood shifts must reuse the same palette — no full theme swap per section.\n\n### Background-image harmony\nWhen using full-bleed image backgrounds:\n- the image must tonally match the palette (not fight it)\n- use overlays (dark, light, or color tint) to keep text fully readable\n- the brand accent stays consistent regardless of background image\n\n### Gradient Discipline\nGradients are **allowed and encouraged** when professional and subtle. They are not the same as AI slop gradients.\n\nAllowed (use confidently):\n- low-chroma palette-matched tonal gradients (e.g. ink to graphite, cream to sand, ivory to warm grey)\n- single-hue atmospheric grades behind hero photography\n- soft vignettes and radial depth that direct the eye\n- noise-textured gradients adding tactile depth without color noise\n- editorial color washes that match brand mood\n\nBanned (AI gradient slop):\n- rainbow / mesh blob gradients\n- purple-to-blue \"AI\" defaults\n- pink-to-orange \"creator\" defaults\n- neon edges and glow halos with no purpose\n- gradient text as a shortcut for \"premium\"\n- gradients that compete with imagery instead of supporting it\n\n### Background Confidence Rule\nDo not retreat to plain white surfaces by default. When the brief, brand mood, or section job calls for atmosphere, use:\n- a full-bleed image,\n- a duotone or graded photo,\n- a tonal gradient,\n- a tactile material,\nor a confident flat color field — picked deliberately, not as decoration.\n\n### Strong guidance\n- avoid rainbow randomness\n- avoid over-neon unless requested\n- keep contrast intentional\n- match accent colors to the chosen theme paradigm\n- gradients must always read as professional and intentional, never as visual noise\n\n### Materiality\nWhere appropriate, add:\n- paper feel\n- glass feel\n- brushed metal feel\n- soft blur depth\n- tactile matte surfaces\n- editorial photo treatment\n\nBut always keep the frontend structure readable.\n\n---\n\n## 14. IMAGE / MEDIA DIRECTION\nIf imagery is present, it must support the layout.\n\nAllowed:\n- art-directed product visuals\n- refined editorial photography\n- UI crops\n- abstract forms with structural purpose\n- framed objects\n- premium texture use\n- campaign-style visuals\n\nAvoid:\n- irrelevant scenery\n- stock-photo cliches\n- decorative junk\n- visuals that overpower the page hierarchy\n\n---\n\n## 15. DEFAULT SITE PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\n---\n\n## 16. MULTI-IMAGE CONSISTENCY RULE\nBecause every section is its own image, consistency is critical. Across all per-section frames enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA family (style variations are fine, identity is not)\n- same icon or illustration mood\n- same image treatment (grade, framing, material vocabulary)\n- same tonal language in any copy\n\nVariation IS allowed in:\n- composition anchor (per section)\n- background mode (per section)\n- section size and density\n- which \"second-read\" moment appears\n\nA viewer flipping through every per-section frame must still recognize one brand. Anything that breaks brand recall is over-variation.\n\n---\n\n## 17. CLARITY CHECK\nBefore finalizing, verify internally:\n\n1. Is the hierarchy obvious?\n2. Is the hero clean enough?\n3. Is the design visually distinctive?\n4. Is it free of obvious AI tells?\n5. Is it premium rather than template-like?\n6. Can someone code from this?\n7. If multiple images exist, do they clearly belong together?\n8. Is imagery used strongly enough (with variation, not one repeated crop)?\n9. Does the page breathe, or is it too dense?\n10. Is there enough spacing between sections?\n11. Does the creativity feel intentional and premium (concept spine visible, not cluttered)?\n12. Is the spacing between sections even and controlled?\n13. Do smaller sections still have enough surrounding space to feel clean?\n14. Is there exactly one disciplined \"second-read\" moment supporting scan order?\n15. Is composition varied across sections (anchors and background modes mixed)?\n16. Is the hero scale (giant / mid / mini) chosen and executed cleanly?\n17. Is there a clear conversion path (hook -> proof -> action) even in artistic sites?\n18. Is the palette consistent across all per-section images?\n19. Is each image horizontal and one-section-only?\n20. Is the **total number of images equal to the number of sections** (never fewer)?\n21. Is the hero using a varied composition (not defaulting to left-text / right-image out of habit)?\n\nIf not, refine internally before output. If the count is wrong, regenerate the missing sections. If the hero feels like a reflexive left-text / right-image default, prefer a different composition anchor.\n\n---\n\n## 18. EXTRA CREATIVITY & IMPLEMENTATION EDGE\n\nApply unless the user opts out:\n\n### Cross-section contrast\nAcross the slice, deliberately vary foreground/background intensity at least twice (lighter → richer → calmer) so the scroll feels paced, not monotonous slabs.\n\n### CTA specificity\nPrefer one unmistakable primary action per major viewport tier; secondary actions must look secondary (scale, outline, ghost), not clones of primary.\n\n### Image variety inside one comp\nMix at least **two distinct image crops** where multiple sections exist — e.g. macro product + contextual environment, or portrait editorial + widescreen artifact — avoiding one repeated stock silhouette.\n\n### Data-viz restraint\nCharts, sparklines, and graphs appear only when the site type logically needs them (analytics, pricing, infra, observability brands). Else keep proof human (quotes, receipts, timelines, screenshots of real workflows).\n\n### Cultural / tonal alignment\nWhen the brief names an industry or region, steer palette and typographic temperament to match — don’t ship default “neutral SF startup” unless the brief is intentionally generic SaaS.\n\n### Mobile-implied fidelity (even for desktop mocks)\nMaintain tap-friendly hit sizes and readable caption sizes visually; stacking order should imply a sane single-column narrative.\n\n### Conversion focus\nEach section has a job. Even when the design is artistic, the page must read as a real product or brand site:\n- the hero communicates value in seconds and offers one obvious next action\n- proof sections (logos, quotes, metrics) feel earned, not stuffed\n- pricing or CTA sections feel decisive, not buried\n- the final section closes: a single strong CTA + supporting trust cue\nAvoid pure mood reels with no funnel logic.\n\n### Composition variety check\nAcross all per-section images, internally log the chosen composition anchor and background mode. Reject the set if:\n- the same composition anchor repeats more than 2 sections in a row\n- the same background mode repeats more than 3 sections in a row\n- every section is inline-asset (no full-bleed background ever appears) **AND** the brief does not call for minimalism / typography-only / swiss / ultra simple\n\nFor non-minimalist briefs: push for at least one full-bleed (or duotone / atmospheric) background and at least one mini minimalist section in any multi-section site.\n\nFor minimalist briefs: this rule is suspended. Restraint is the design.\n\n---\n\n## 19. RESPONSE BEHAVIOR\nWhen the user asks for a frontend design:\n1. infer site type and primary conversion goal\n2. infer number of sections (if unclear, use the defaults from §5: landing page = 6, full website = 8)\n3. **commit out loud** to the section count and announce it (\"Generating N horizontal images, one per section\")\n4. plan ONE horizontal image PER SECTION — always separate generations, never collapse\n5. choose Hero Scale for the whole site (giant / mid / mini)\n5. choose a strong visual combination (theme, type, hero arch, section system, motion, narrative spine, second-read moment)\n7. for each section: pick a Composition Anchor, Background Mode, and CTA Variation — vary across sections\n8. choose 4 signature components used appropriately across sections\n9. enforce hero minimalism + section size variety (some giant, some mini)\n10. enforce strong image usage including full-bleed backgrounds where it fits\n11. lock one consistent palette across all images\n12. apply §18 EXTRA CREATIVITY & IMPLEMENTATION EDGE\n13. keep spacing generous, even, and clean\n14. remove AI slop (including marquee / fake KPI clichés unless requested)\n15. run §17 CLARITY CHECK\n16. **generate every per-section horizontal image, labeled \"Section X of N: <name>\"**, until the full set is delivered. Do not stop early. Do not summarize. Do not return only one image.\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\n\n---\n\n## 20. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser: \"make a hero section for an AI startup\"\n\nInterpretation:\n- 1 horizontal image\n- Hero Scale: Mid Editorial or Giant Statement\n- Composition Anchor: bottom-left text over full-bleed product/atmosphere image\n- Background Mode: full-bleed image with dark tonal overlay\n- CTA Variation: outlined inline + small label hint\n- Palette: Deep Dark or Bold Studio Solid, one consistent accent\n- no cliche dashboard spam, no purple AI glow\n\n### Example 2\nUser: \"design 8 sections for a fintech website\"\n\nInterpretation:\n- 8 separate horizontal images (one per section)\n- Hero Scale: Mid Editorial (trust-driven)\n- vary Composition Anchor across sections (centered low, right-third caption, bottom-left over chart visual, stacked center for closing CTA)\n- Background Mode mix: solid surface, full-bleed image background once, editorial side-image at use cases\n- one consistent palette (e.g. ink + paper + single brand accent)\n- conversion path: hook -> proof bar -> features -> use case -> testimonial -> pricing -> FAQ -> final CTA\n\n### Example 3\nUser: \"creative agency landing page, 12 sections\"\n\nInterpretation:\n- 12 horizontal images (one per section)\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive choice, not in-between)\n- editorial / poster-like direction; off-grid composition appears 2-3 times\n- multiple Background Modes (full-bleed image at hero + showcase, editorial side-image at case studies, solid + accent for process)\n- palette consistent throughout, with one bold accent recurring\n- closing CTA section: mini minimalist, strong type, single primary action\n\n---\n\n## 21. FINAL GOAL\nGenerate frontend reference images that feel:\n- artistic\n- premium\n- clear\n- structured\n- image-led\n- breathable\n- memorable\n- anti-generic\n- implementation-friendly\n\nThe result should look like a top-tier website concept with strong imagery, confident creativity, and generous spacing - not a dense, repetitive AI layout.\n","frontmatter":{"name":"imagegen-frontend-web","description":"Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate."},"isInternal":false,"tokens":8215,"sizeBytes":36854},{"name":"SKILL.md","path":".agents/skills/industrial-brutalist-ui/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/industrial-brutalist-ui/SKILL.md","title":"industrial-brutalist-ui","category":"anthropic-skill","format":"markdown","content":"---\nname: industrial-brutalist-ui\ndescription: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.\n---\n\n# SKILL: Industrial Brutalism & Tactical Telemetry UI\n\n## 1. Skill Meta\n**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering\n**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.\n\n## 2. Visual Archetypes\nThe design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**\n\n### 2.1 Swiss Industrial Print\nDerived from 1960s corporate identity systems and heavy machinery blueprints.\n*   **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.\n\n### 2.2 Tactical Telemetry & CRT Terminal\nDerived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).\n*   **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).\n\n## 3. Typographic Architecture\nTypography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.\n\n### 3.1 Macro-Typography (Structural Headers)\n*   **Classification:** Neo-Grotesque / Heavy Sans-Serif.\n*   **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.\n*   **Implementation Parameters:**\n    *   **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).\n    *   **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.\n    *   **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).\n    *   **Casing:** Exclusively uppercase for structural impact.\n\n### 3.2 Micro-Typography (Data & Telemetry)\n*   **Classification:** Monospace / Technical Sans.\n*   **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.\n*   **Implementation Parameters:**\n    *   **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).\n    *   **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.\n    *   **Leading:** Standard to tight (`1.2` to `1.4`).\n    *   **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.\n\n### 3.3 Textural Contrast (Artistic Disruption)\n*   **Classification:** High-Contrast Serif.\n*   **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.\n*   **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.\n\n## 4. Color System\nThe color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.\n\n**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**\n\n### If Swiss Industrial Print (Light):\n*   **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).\n*   **Foreground:** `#050505` to `#111111` (Carbon Ink).\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.\n\n### If Tactical Telemetry (Dark):\n*   **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).\n*   **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.\n*   **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.\n\n## 5. Layout and Spatial Engineering\nThe layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.\n\n*   **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.\n*   **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.\n*   **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.\n*   **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.\n\n## 6. UI Components and Symbology\nStandard web UI conventions are replaced with utilitarian, industrial graphic elements.\n\n*   **Syntax Decoration:** Utilization of ASCII characters to frame data points.\n    *   *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`\n    *   *Directional:* `>>>`, `///`, `\\\\\\\\`\n*   **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.\n*   **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.\n\n## 7. Textural and Post-Processing Effects\nTo prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.\n\n*   **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.\n*   **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).\n*   **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.\n\n## 8. Web Engineering Directives\n1.  **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.\n2.  **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.\n3.  **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.\n","frontmatter":{"name":"industrial-brutalist-ui","description":"Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints."},"isInternal":false,"tokens":1948,"sizeBytes":8456},{"name":"SKILL.md","path":".agents/skills/minimalist-ui/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/minimalist-ui/SKILL.md","title":"minimalist-ui","category":"anthropic-skill","format":"markdown","content":"---\nname: minimalist-ui\ndescription: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.\n---\n\n# Protocol: Premium Utilitarian Minimalism UI Architect\n\n## 1. Protocol Overview\nName: Premium Utilitarian Minimalism & Editorial UI\nDescription: An advanced frontend engineering directive for generating highly refined, ultra-minimalist, \"document-style\" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.\n\n## 2. Absolute Negative Constraints (Banned Elements)\nThe AI must strictly avoid the following generic web development defaults:\n- DO NOT use the \"Inter\", \"Roboto\", or \"Open Sans\" typefaces.\n- DO NOT use generic, thin-line icon libraries like \"Lucide\", \"Feather\", or standard \"Heroicons\".\n- DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).\n- DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).\n- DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).\n- DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.\n- DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.\n- DO NOT use generic placeholder names like \"John Doe\", \"Acme Corp\", or \"Lorem Ipsum\". Use realistic, contextual content.\n- DO NOT use AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\". Write plain, specific language.\n\n## 3. Typographic Architecture\nThe interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.\n- Primary Sans-Serif (Body, UI, Buttons): Use clean, geometric, or system-native fonts with character. Target: `font-family: 'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`.\n- Editorial Serif (Hero Headings & Quotes): Target: `font-family: 'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`. Apply tight tracking (`letter-spacing: -0.02em` to `-0.04em`) and tight line-height (`1.1`).\n- Monospace (Code, Keystrokes, Meta-data): Target: `font-family: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`.\n- Text Colors: Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous `line-height` of `1.6` for legibility. Secondary text should be muted gray (`#787774`).\n\n## 4. Color Palette (Warm Monochrome + Spot Pastels)\nColor is a scarce resource, utilized only for semantic meaning or subtle accents.\n- Canvas / Background: Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.\n- Primary Surface (Cards): `#FFFFFF` or `#F9F9F8`.\n- Structural Borders / Dividers: Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.\n- Accent Colors: Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds.\n  - Pale Red: `#FDEBEC` (Text: `#9F2F2D`)\n  - Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)\n  - Pale Green: `#EDF3EC` (Text: `#346538`)\n  - Pale Yellow: `#FBF3DB` (Text: `#956400`)\n\n## 5. Component Specifications\n- Bento Box Feature Grids:\n  - Utilize asymmetrical CSS Grid layouts.\n  - Cards must have exactly `border: 1px solid #EAEAEA`.\n  - Border-radius must be crisp: `8px` or `12px` maximum.\n  - Internal padding must be generous (e.g., `24px` to `40px`).\n- Primary Call-To-Action (Buttons):\n  - Solid background `#111111`, text `#FFFFFF`. \n  - Slight border-radius (`4px` to `6px`). No box-shadow. \n  - Hover state should be a subtle color shift to `#333333` or a micro-scale `transform: scale(0.98)`.\n- Tags & Status Badges:\n  - Pill-shaped (`border-radius: 9999px`), very small typography (`text-xs`), uppercase with wide tracking (`letter-spacing: 0.05em`).\n  - Background must use the defined Muted Pastels.\n- Accordions (FAQ):\n  - Strip all container boxes. Separate items only with a `border-bottom: 1px solid #EAEAEA`.\n  - Use a clean, sharp `+` and `-` icon for the toggle state.\n- Keystroke Micro-UIs:\n  - Render shortcuts as physical keys using `<kbd>` tags: `border: 1px solid #EAEAEA`, `border-radius: 4px`, `background: #F7F6F3`, using the Monospace font.\n- Faux-OS Window Chrome:\n  - When mocking up software, wrap it in a minimalist container with a white top bar containing three small, light gray circles (replicating macOS window controls).\n\n## 6. Iconography & Imagery Directives\n- System Icons: Use \"Phosphor Icons (Bold or Fill weights)\" or \"Radix UI Icons\" for a technical, slightly thicker-stroke aesthetic. Standardize stroke width across all icons.\n- Illustrations: Monochromatic, rough continuous-line ink sketches on a white background, featuring a single offset geometric shape filled with a muted pastel color.\n- Photography: Use high-quality, desaturated images with a warm tone. Apply subtle overlays (`opacity: 0.04` warm grain) to blend photos into the monochrome palette. Never use oversaturated stock photos. Use reliable placeholders like `https://picsum.photos/seed/{context}/1200/800` when real assets are unavailable.\n- Hero & Section Backgrounds: Sections should not feel empty and flat. Use subtle full-width background imagery at very low opacity, soft radial light spots (`radial-gradient` with warm tones at `opacity: 0.03`), or minimal geometric line patterns to add depth without breaking the clean aesthetic.\n\n## 7. Subtle Motion & Micro-Animations\nMotion should feel invisible — present but never distracting. The goal is quiet sophistication, not spectacle.\n- Scroll Entry: Elements fade in gently as they enter the viewport. Use `translateY(12px)` + `opacity: 0` resolving over `600ms` with `cubic-bezier(0.16, 1, 0.3, 1)`. Use `IntersectionObserver`, never `window.addEventListener('scroll')`.\n- Hover States: Cards lift with an ultra-subtle shadow shift (`box-shadow` transitioning from `0 0 0` to `0 2px 8px rgba(0,0,0,0.04)` over `200ms`). Buttons respond with `scale(0.98)` on `:active`.\n- Staggered Reveals: Lists and grid items enter with a cascade delay (`animation-delay: calc(var(--index) * 80ms)`). Never mount everything at once.\n- Background Ambient Motion: Optional. A single, very slow-moving radial gradient blob (`animation-duration: 20s+`, `opacity: 0.02-0.04`) drifting behind hero sections. Must be applied to a `position: fixed; pointer-events: none` layer. Never on scrolling containers.\n- Performance: Animate exclusively via `transform` and `opacity`. No layout-triggering properties (`top`, `left`, `width`, `height`). Use `will-change: transform` sparingly and only on actively animating elements.\n\n## 8. Execution Protocol\nWhen tasked with writing frontend code (HTML, React, Tailwind, Vue) or designing a layout:\n1. Establish the macro-whitespace first. Use massive vertical padding between sections (e.g., `py-24` or `py-32` in Tailwind).\n2. Constrain the main typography content width to `max-w-4xl` or `max-w-5xl`.\n3. Apply the custom typographic hierarchy and monochromatic color variables immediately.\n4. Ensure every card, divider, and border adheres strictly to the `1px solid #EAEAEA` rule.\n5. Add scroll-entry animations to all major content blocks.\n6. Ensure sections have visual depth through imagery, ambient gradients, or subtle textures — no empty flat backgrounds.\n7. Provide code that reflects this high-end, uncluttered, editorial aesthetic natively without requiring manual adjustments.\n","frontmatter":{"name":"minimalist-ui","description":"Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows."},"isInternal":false,"tokens":2011,"sizeBytes":7901},{"name":"SKILL.md","path":".agents/skills/redesign-existing-projects/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/redesign-existing-projects/SKILL.md","title":"redesign-existing-projects","category":"anthropic-skill","format":"markdown","content":"---\nname: redesign-existing-projects\ndescription: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.\n---\n\n# Redesign Skill\n\n## How This Works\n\nWhen applied to an existing project, follow this sequence:\n\n1. **Scan** — Read the codebase. Identify the framework, styling method (Tailwind, vanilla CSS, styled-components, etc.), and current design patterns.\n2. **Diagnose** — Run through the audit below. List every generic pattern, weak point, and missing state you find.\n3. **Fix** — Apply targeted upgrades working with the existing stack. Do not rewrite from scratch. Improve what's there.\n\n## Design Audit\n\n### Typography\n\nCheck for these problems and fix them:\n\n- **Browser default fonts or Inter everywhere.** Replace with a font that has character. Good options: `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`. For editorial/creative projects, pair a serif header with a sans-serif body.\n- **Headlines lack presence.** Increase size for display text, tighten letter-spacing, reduce line-height. Headlines should feel heavy and intentional.\n- **Body text too wide.** Limit paragraph width to roughly 65 characters. Increase line-height for readability.\n- **Only Regular (400) and Bold (700) weights used.** Introduce Medium (500) and SemiBold (600) for more subtle hierarchy.\n- **Numbers in proportional font.** Use a monospace font or enable tabular figures (`font-variant-numeric: tabular-nums`) for data-heavy interfaces.\n- **Missing letter-spacing adjustments.** Use negative tracking for large headers, positive tracking for small caps or labels.\n- **All-caps subheaders everywhere.** Try lowercase italics, sentence case, or small-caps instead.\n- **Orphaned words.** Single words sitting alone on the last line. Fix with `text-wrap: balance` or `text-wrap: pretty`.\n\n### Color and Surfaces\n\n- **Pure `#000000` background.** Replace with off-black, dark charcoal, or tinted dark (`#0a0a0a`, `#121212`, or a dark navy).\n- **Oversaturated accent colors.** Keep saturation below 80%. Desaturate accents so they blend with neutrals instead of screaming.\n- **More than one accent color.** Pick one. Remove the rest. Consistency beats variety.\n- **Mixing warm and cool grays.** Stick to one gray family. Tint all grays with a consistent hue (warm or cool, not both).\n- **Purple/blue \"AI gradient\" aesthetic.** This is the most common AI design fingerprint. Replace with neutral bases and a single, considered accent.\n- **Generic `box-shadow`.** Tint shadows to match the background hue. Use colored shadows (e.g., dark blue shadow on a blue background) instead of pure black at low opacity.\n- **Flat design with zero texture.** Add subtle noise, grain, or micro-patterns to backgrounds. Pure flat vectors feel sterile.\n- **Perfectly even gradients.** Break the uniformity with radial gradients, noise overlays, or mesh gradients instead of standard linear 45-degree fades.\n- **Inconsistent lighting direction.** Audit all shadows to ensure they suggest a single, consistent light source.\n- **Random dark sections in a light mode page (or vice versa).** A single dark-background section breaking an otherwise light page looks like a copy-paste accident. Either commit to a full dark mode or keep a consistent background tone throughout. If contrast is needed, use a slightly darker shade of the same palette — not a sudden jump to `#111` in the middle of a cream page.\n- **Empty, flat sections with no visual depth.** Sections that are just text on a plain background feel unfinished. Add high-quality background imagery (blurred, overlaid, or masked), subtle patterns, or ambient gradients. Use reliable placeholder sources like `https://picsum.photos/seed/{name}/1920/1080` when real assets are not available. Experiment with background images behind hero sections, feature blocks, or CTAs — even a subtle full-width photo at low opacity adds presence.\n\n### Layout\n\n- **Everything centered and symmetrical.** Break symmetry with offset margins, mixed aspect ratios, or left-aligned headers over centered content.\n- **Three equal card columns as feature row.** This is the most generic AI layout. Replace with a 2-column zig-zag, asymmetric grid, horizontal scroll, or masonry layout.\n- **Using `height: 100vh` for full-screen sections.** Replace with `min-height: 100dvh` to prevent layout jumping on mobile browsers (iOS Safari viewport bug).\n- **Complex flexbox percentage math.** Replace with CSS Grid for reliable multi-column structures.\n- **No max-width container.** Add a container constraint (around 1200-1440px) with auto margins so content doesn't stretch edge-to-edge on wide screens.\n- **Cards of equal height forced by flexbox.** Allow variable heights or use masonry when content varies in length.\n- **Uniform border-radius on everything.** Vary the radius: tighter on inner elements, softer on containers.\n- **No overlap or depth.** Elements sit flat next to each other. Use negative margins to create layering and visual depth.\n- **Symmetrical vertical padding.** Top and bottom padding are always identical. Adjust optically — bottom padding often needs to be slightly larger.\n- **Dashboard always has a left sidebar.** Try top navigation, a floating command menu, or a collapsible panel instead.\n- **Missing whitespace.** Double the spacing. Let the design breathe. Dense layouts work for data dashboards, not for marketing pages.\n- **Buttons not bottom-aligned in card groups.** When cards have different content lengths, CTAs end up at random heights. Pin buttons to the bottom of each card so they form a clean horizontal line regardless of content above.\n- **Feature lists starting at different vertical positions.** In pricing tables or comparison cards, the list of features should start at the same Y position across all columns. Use consistent spacing above the list or fixed-height title/price blocks.\n- **Inconsistent vertical rhythm in side-by-side elements.** When placing cards, columns, or panels next to each other, align shared elements (titles, descriptions, prices, buttons) across all items. Misaligned baselines make the layout look broken.\n- **Mathematical alignment that looks optically wrong.** Centering by the math doesn't always look centered to the eye. Icons next to text, play buttons in circles, or text in buttons often need 1-2px optical adjustments to feel right.\n\n### Interactivity and States\n\n- **No hover states on buttons.** Add background shift, slight scale, or translate on hover.\n- **No active/pressed feedback.** Add a subtle `scale(0.98)` or `translateY(1px)` on press to simulate a physical click.\n- **Instant transitions with zero duration.** Add smooth transitions (200-300ms) to all interactive elements.\n- **Missing focus ring.** Ensure visible focus indicators for keyboard navigation. This is an accessibility requirement, not optional.\n- **No loading states.** Replace generic circular spinners with skeleton loaders that match the layout shape.\n- **No empty states.** An empty dashboard showing nothing is a missed opportunity. Design a composed \"getting started\" view.\n- **No error states.** Add clear, inline error messages for forms. Do not use `window.alert()`.\n- **Dead links.** Buttons that link to `#`. Either link to real destinations or visually disable them.\n- **No indication of current page in navigation.** Style the active nav link differently so users know where they are.\n- **Scroll jumping.** Anchor clicks jump instantly. Add `scroll-behavior: smooth`.\n- **Animations using `top`, `left`, `width`, `height`.** Switch to `transform` and `opacity` for GPU-accelerated, smooth animation.\n\n### Content\n\n- **Generic names like \"John Doe\" or \"Jane Smith\".** Use diverse, realistic-sounding names.\n- **Fake round numbers like `99.99%`, `50%`, `$100.00`.** Use organic, messy data: `47.2%`, `$99.00`, `+1 (312) 847-1928`.\n- **Placeholder company names like \"Acme Corp\", \"Nexus\", \"SmartFlow\".** Invent contextual, believable brand names.\n- **AI copywriting cliches.** Never use \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\", \"Tapestry\", or \"In the world of...\". Write plain, specific language.\n- **Exclamation marks in success messages.** Remove them. Be confident, not loud.\n- **\"Oops!\" error messages.** Be direct: \"Connection failed. Please try again.\"\n- **Passive voice.** Use active voice: \"We couldn't save your changes\" instead of \"Mistakes were made.\"\n- **All blog post dates identical.** Randomize dates to appear real.\n- **Same avatar image for multiple users.** Use unique assets for every distinct person.\n- **Lorem Ipsum.** Never use placeholder latin text. Write real draft copy.\n- **Title Case On Every Header.** Use sentence case instead.\n\n### Component Patterns\n\n- **Generic card look (border + shadow + white background).** Remove the border, or use only background color, or use only spacing. Cards should exist only when elevation communicates hierarchy.\n- **Always one filled button + one ghost button.** Add text links or tertiary styles to reduce visual noise.\n- **Pill-shaped \"New\" and \"Beta\" badges.** Try square badges, flags, or plain text labels.\n- **Accordion FAQ sections.** Use a side-by-side list, searchable help, or inline progressive disclosure.\n- **3-card carousel testimonials with dots.** Replace with a masonry wall, embedded social posts, or a single rotating quote.\n- **Pricing table with 3 towers.** Highlight the recommended tier with color and emphasis, not just extra height.\n- **Modals for everything.** Use inline editing, slide-over panels, or expandable sections instead of popups for simple actions.\n- **Avatar circles exclusively.** Try squircles or rounded squares for a less generic look.\n- **Light/dark toggle always a sun/moon switch.** Use a dropdown, system preference detection, or integrate it into settings.\n- **Footer link farm with 4 columns.** Simplify. Focus on main navigational paths and legally required links.\n\n### Iconography\n\n- **Lucide or Feather icons exclusively.** These are the \"default\" AI icon choice. Use Phosphor, Heroicons, or a custom set for differentiation.\n- **Rocketship for \"Launch\", shield for \"Security\".** Replace cliche metaphors with less obvious icons (bolt, fingerprint, spark, vault).\n- **Inconsistent stroke widths across icons.** Audit all icons and standardize to one stroke weight.\n- **Missing favicon.** Always include a branded favicon.\n- **Stock \"diverse team\" photos.** Use real team photos, candid shots, or a consistent illustration style instead of uncanny stock imagery.\n\n### Code Quality\n\n- **Div soup.** Use semantic HTML: `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>`.\n- **Inline styles mixed with CSS classes.** Move all styling to the project's styling system.\n- **Hardcoded pixel widths.** Use relative units (`%`, `rem`, `em`, `max-width`) for flexible layouts.\n- **Missing alt text on images.** Describe image content for screen readers. Never leave `alt=\"\"` or `alt=\"image\"` on meaningful images.\n- **Arbitrary z-index values like `9999`.** Establish a clean z-index scale in the theme/variables.\n- **Commented-out dead code.** Remove all debug artifacts before shipping.\n- **Import hallucinations.** Check that every import actually exists in `package.json` or the project dependencies.\n- **Missing meta tags.** Add proper `<title>`, `description`, `og:image`, and social sharing meta tags.\n\n### Strategic Omissions (What AI Typically Forgets)\n\n- **No legal links.** Add privacy policy and terms of service links in the footer.\n- **No \"back\" navigation.** Dead ends in user flows. Every page needs a way back.\n- **No custom 404 page.** Design a helpful, branded \"page not found\" experience.\n- **No form validation.** Add client-side validation for emails, required fields, and format checks.\n- **No \"skip to content\" link.** Essential for keyboard users. Add a hidden skip-link.\n- **No cookie consent.** If required by jurisdiction, add a compliant consent banner.\n\n## Upgrade Techniques\n\nWhen upgrading a project, pull from these high-impact techniques to replace generic patterns:\n\n### Typography Upgrades\n- **Variable font animation.** Interpolate weight or width on scroll or hover for text that feels alive.\n- **Outlined-to-fill transitions.** Text starts as a stroke outline and fills with color on scroll entry or interaction.\n- **Text mask reveals.** Large typography acting as a window to video or animated imagery behind it.\n\n### Layout Upgrades\n- **Broken grid / asymmetry.** Elements that deliberately ignore column structure — overlapping, bleeding off-screen, or offset with calculated randomness.\n- **Whitespace maximization.** Aggressive use of negative space to force focus on a single element.\n- **Parallax card stacks.** Sections that stick and physically stack over each other during scroll.\n- **Split-screen scroll.** Two halves of the screen sliding in opposite directions.\n\n### Motion Upgrades\n- **Smooth scroll with inertia.** Decouple scrolling from browser defaults for a heavier, cinematic feel.\n- **Staggered entry.** Elements cascade in with slight delays, combining Y-axis translation with opacity fade. Never mount everything at once.\n- **Spring physics.** Replace linear easing with spring-based motion for a natural, weighty feel on all interactive elements.\n- **Scroll-driven reveals.** Content entering through expanding masks, wipes, or draw-on SVG paths tied to scroll progress.\n\n### Surface Upgrades\n- **True glassmorphism.** Go beyond `backdrop-filter: blur`. Add a 1px inner border and a subtle inner shadow to simulate edge refraction.\n- **Spotlight borders.** Card borders that illuminate dynamically under the cursor.\n- **Grain and noise overlays.** A fixed, pointer-events-none overlay with subtle noise to break digital flatness.\n- **Colored, tinted shadows.** Shadows that carry the hue of the background rather than using generic black.\n\n## Fix Priority\n\nApply changes in this order for maximum visual impact with minimum risk:\n\n1. **Font swap** — biggest instant improvement, lowest risk\n2. **Color palette cleanup** — remove clashing or oversaturated colors\n3. **Hover and active states** — makes the interface feel alive\n4. **Layout and spacing** — proper grid, max-width, consistent padding\n5. **Replace generic components** — swap cliche patterns for modern alternatives\n6. **Add loading, empty, and error states** — makes it feel finished\n7. **Polish typography scale and spacing** — the premium final touch\n\n## Rules\n\n- Work with the existing tech stack. Do not migrate frameworks or styling libraries.\n- Do not break existing functionality. Test after every change.\n- Before importing any new library, check the project's dependency file first.\n- If the project uses Tailwind, check the version (v3 vs v4) before modifying config.\n- If the project has no framework, use vanilla CSS.\n- Keep changes reviewable and focused. Small, targeted improvements over big rewrites.\n","frontmatter":{"name":"redesign-existing-projects","description":"Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS."},"isInternal":false,"tokens":3359,"sizeBytes":15060},{"name":"DESIGN.md","path":".agents/skills/stitch-design-taste/DESIGN.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/stitch-design-taste/DESIGN.md","title":"Stitch-design-taste Skill","category":"anthropic-skill","format":"markdown","content":"# Design System: Taste Standard\n**Skill:** stitch-design-taste\n\n---\n\n## Configuration — Set Your Style\nAdjust these dials before using this design system. They control how creative, dense, and animated the output should be. Pick the level that fits your project.\n\n| Dial | Level | Description |\n|------|-------|-------------|\n| **Creativity** | `8` | `1` = Ultra-minimal, Swiss, silent, monochrome. `5` = Balanced, clean but with personality. `10` = Expressive, editorial, bold typography experiments, inline images in headlines, strong asymmetry. Default: `8` |\n| **Density** | `4` | `1` = Gallery-airy, massive whitespace. `5` = Balanced sections. `10` = Cockpit-dense, data-heavy. Default: `4` |\n| **Variance** | `8` | `1` = Predictable, symmetric grids. `5` = Subtle offsets. `10` = Artsy chaotic, no two sections alike. Default: `8` |\n| **Motion Intent** | `6` | `1` = Static, no animation noted. `5` = Subtle hover/entrance cues. `10` = Cinematic orchestration noted in every component. Default: `6` |\n\n> **How to use:** Change the numbers above to match your project's vibe. At **Creativity 1–3**, the system produces clean, quiet, Notion-like interfaces. At **Creativity 7–10**, expect inline image typography, dramatic scale contrast, and strong editorial layouts. The rest of the rules below adapt to your chosen levels.\n\n---\n\n## 1. Visual Theme & Atmosphere\nA restrained, gallery-airy interface with confident asymmetric layouts and fluid spring-physics motion. The atmosphere is clinical yet warm — like a well-lit architecture studio where every element earns its place through function. Density is balanced (Level 4), variance runs high (Level 8) to prevent symmetrical boredom, and motion is fluid but never theatrical (Level 6). The overall impression: expensive, intentional, alive.\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface. Warm-neutral, never clinical blue-white\n- **Pure Surface** (#FFFFFF) — Card and container fill. Used with whisper shadow for elevation\n- **Charcoal Ink** (#18181B) — Primary text. Zinc-950 depth — never pure black\n- **Steel Secondary** (#71717A) — Body text, descriptions, metadata. Zinc-500 warmth\n- **Muted Slate** (#94A3B8) — Tertiary text, timestamps, disabled states\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, structural 1px lines. Semi-transparent for depth\n- **Diffused Shadow** (rgba(0,0,0,0.05)) — Card elevation. Wide-spreading, 40px blur, -15px offset. Never harsh\n\n### Accent Selection (Pick ONE per project)\n- **Emerald Signal** (#10B981) — For growth, success, positive data dashboards\n- **Electric Blue** (#3B82F6) — For productivity, SaaS, developer tools\n- **Deep Rose** (#E11D48) — For creative, editorial, fashion-adjacent projects\n- **Amber Warmth** (#F59E0B) — For community, social, warm-toned products\n\n### Banned Colors\n- Purple/Violet neon gradients — the \"AI Purple\" aesthetic\n- Pure Black (#000000) — always Off-Black or Zinc-950\n- Oversaturated accents above 80% saturation\n- Mixed warm/cool gray systems within one project\n\n## 3. Typography Rules\n- **Display:** `Geist`, `Satoshi`, `Cabinet Grotesk`, or `Outfit` — Track-tight (`-0.025em`), controlled fluid scale, weight-driven hierarchy (700–900). Not screaming. Leading compressed (`1.1`). Alternatives forced — `Inter` is BANNED for premium contexts\n- **Body:** Same family at weight 400 — Relaxed leading (`1.65`), 65ch max-width, Steel Secondary color (#71717A)\n- **Mono:** `Geist Mono` or `JetBrains Mono` — For code blocks, metadata, timestamps. When density exceeds Level 7, all numbers switch to monospace\n- **Scale:** Display at `clamp(2.25rem, 5vw, 3.75rem)`. Body at `1rem/1.125rem`. Mono metadata at `0.8125rem`\n\n### Banned Fonts\n- `Inter` — banned everywhere in premium/creative contexts\n- Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) — BANNED. If serif is needed for editorial/creative, use only distinctive modern serifs like `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Never use default browser serif stacks. Serif is always BANNED in dashboards or software UIs regardless\n\n## 4. Component Stylings\n* **Buttons:** Flat surface, no outer glow. Primary: accent fill with white text. Secondary: ghost/outline. Active state: `-1px translateY` or `scale(0.98)` for tactile push. Hover: subtle background shift, never glow\n* **Cards/Containers:** Generously rounded corners (`2.5rem`). Pure white fill. Whisper border (`1px`, semi-transparent). Diffused shadow (`0 20px 40px -15px rgba(0,0,0,0.05)`). Internal padding `2rem–2.5rem`. Used ONLY when elevation communicates hierarchy — high-density layouts replace cards with `border-top` dividers or negative space\n* **Inputs/Forms:** Label positioned above input. Helper text optional. Error text below in Deep Rose. Focus ring in accent color, `2px` offset. No floating labels. Standard `0.5rem` gap between label-input-error stack\n* **Navigation:** Sleek, sticky. Icons scale on hover (Dock Magnification optional). No hamburger on desktop. Clean horizontal with generous spacing\n* **Loaders:** Skeletal shimmer matching exact layout dimensions and rounded corners. Shifting light reflection across placeholder shapes. Never circular spinners\n* **Empty States:** Composed illustration or icon composition with guidance text. Never just \"No data found\"\n* **Error States:** Inline, contextual. Red accent underline or border. Clear recovery action\n\n## 5. Hero Section\nThe Hero is the first impression — it must be striking, creative, and never generic.\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Example: \"We build [photo of hands typing] digital [photo of screen] products\" — images sit inline at type-height, rounded, acting as visual punctuation between words. This is the signature creative technique\n- **No Overlapping Elements:** Text must never overlap images or other text. Every element has its own clear spatial zone. No z-index stacking of content layers, no absolute-positioned headlines over images. Clean separation always\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons, and any instructional UI chrome are BANNED. The user knows how to scroll. Let the content pull them in naturally\n- **Asymmetric Structure:** Centered Hero layouts are BANNED at this variance level. Use Split Screen (50/50), Left-Aligned text / Right visual, or Asymmetric Whitespace with large empty zones\n- **CTA Restraint:** Maximum one primary CTA button. No secondary \"Learn more\" links. No redundant micro-copy below the headline\n\n## 6. Layout Principles\n- **Grid-First:** CSS Grid for all structural layouts. Never flexbox percentage math (`calc(33% - 1rem)` is BANNED)\n- **No Overlapping:** Elements must never overlap each other. No absolute-positioned layers stacking content on content. Every element occupies its own grid cell or flow position. Clean, separated spatial zones\n- **Feature Sections:** The \"3 equal cards in a row\" pattern is BANNED. Use 2-column Zig-Zag, asymmetric Bento grids (2fr 1fr 1fr), or horizontal scroll galleries\n- **Containment:** All content within `max-width: 1400px`, centered. Generous horizontal padding (`1rem` mobile, `2rem` tablet, `4rem` desktop)\n- **Full-Height:** Use `min-height: 100dvh` — never `height: 100vh` (iOS Safari address bar jump)\n- **Bento Architecture:** For feature grids, use Row 1: 3 columns | Row 2: 2 columns (70/30 split). Each tile contains a perpetual micro-animation\n\n## 7. Responsive Rules\nEvery screen must work flawlessly across all viewports. **Responsive is not optional — it is a hard requirement. Every single element must be tested at 375px, 768px, and 1440px.**\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to a strict single column. `width: 100%`, `padding: 1rem`, `gap: 1.5rem`. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure. All elements must fit within viewport width. If any element causes horizontal scroll, the design is broken\n- **Typography Scaling:** Headlines scale down gracefully via `clamp()`. Body text stays `1rem` minimum. Never shrink body below `14px`. Headlines must remain readable on 375px screens\n- **Touch Targets:** All interactive elements minimum `44px` tap target. Generous spacing between clickable items. Buttons must be full-width on mobile\n- **Image Behavior:** Hero and inline images scale proportionally. Inline typography images (photos between words) stack below the headline on mobile instead of inline\n- **Navigation:** Desktop horizontal nav collapses to a clean mobile menu (slide-in or full-screen overlay). No tiny hamburger icons without labels\n- **Cards & Grids:** Bento grids and asymmetric layouts revert to stacked single-column cards with full-width. Maintain internal padding (`1rem`)\n- **Spacing Consistency:** Vertical section gaps reduce proportionally on mobile (`clamp(3rem, 8vw, 6rem)`). Never cramped, never excessively airy\n- **Testing Viewports:** Designs must be verified at: `375px` (iPhone SE), `390px` (iPhone 14), `768px` (iPad), `1024px` (small laptop), `1440px` (desktop)\n\n## 8. Motion & Interaction (Code-Phase Intent)\n> **Note:** Stitch generates static screens — it does not animate. This section documents the **intended motion behavior** so that the coding agent (Antigravity, Cursor, etc.) knows exactly how to implement animations when building the exported design into a live product.\n\n- **Physics Engine:** Spring-based exclusively. `stiffness: 100, damping: 20`. No linear easing anywhere. Premium, weighty feel on all interactive elements\n- **Perpetual Micro-Loops:** Every active dashboard component has an infinite-loop state — Pulse on status dots, Typewriter on search bars, Float on feature icons, Shimmer on loading states\n- **Staggered Orchestration:** Lists and grids mount with cascaded delays (`animation-delay: calc(var(--index) * 100ms)`). Waterfall reveals, never instant mount\n- **Layout Transitions:** Smooth re-ordering via shared element IDs. Items swap positions with physics, simulating real-time intelligence\n- **Hardware Rules:** Animate ONLY `transform` and `opacity`. Never `top`, `left`, `width`, `height`. Grain/noise filters on fixed, pointer-events-none pseudo-elements only\n- **Performance:** CPU-heavy perpetual animations isolated in microscopic leaf components. Never trigger parent re-renders. Target 60fps minimum\n\n## 9. Anti-Patterns (Banned)\n- No emojis — anywhere in UI, code, or alt text\n- No `Inter` font — use `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — if serif is needed, use distinctive modern serifs only (`Fraunces`, `Instrument Serif`)\n- No pure black (`#000000`) — Off-Black or Zinc-950 only\n- No neon outer glows or default box-shadow glows\n- No oversaturated accent colors above 80%\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — text never overlaps images or other content. Clean spatial separation always\n- No 3-column equal card layouts for features\n- No centered Hero sections (at this variance level)\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", \"Discover more below\", scroll arrows, bouncing chevrons — all BANNED\n- No generic names: \"John Doe\", \"Sarah Chan\", \"Acme\", \"Nexus\", \"SmartFlow\"\n- No fake round numbers: `99.99%`, `50%`, `1234567` — use organic data: `47.2%`, `+1 (312) 847-1928`\n- No AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Revolutionize\"\n- No broken Unsplash links — use `picsum.photos/seed/{id}/800/600` or SVG UI Avatars\n- No generic `shadcn/ui` defaults — customize radii, colors, shadows to match this system\n- No `z-index` spam — use only for Navbar, Modal, Overlay layer contexts\n- No `h-screen` — always `min-h-[100dvh]`\n- No circular loading spinners — skeletal shimmer only\n","isInternal":false,"tokens":3003,"sizeBytes":12053},{"name":"SKILL.md","path":".agents/skills/stitch-design-taste/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/stitch-design-taste/SKILL.md","title":"stitch-design-taste","category":"anthropic-skill","format":"markdown","content":"---\nname: stitch-design-taste\ndescription: Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.\n---\n\n# Stitch Design Taste — Semantic Design System Skill\n\n## Overview\nThis skill generates `DESIGN.md` files optimized for Google Stitch screen generation. It translates the battle-tested anti-slop frontend engineering directives into Stitch's native semantic design language — descriptive, natural-language rules paired with precise values that Stitch's AI agent can interpret to produce premium, non-generic interfaces.\n\nThe generated `DESIGN.md` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **\"Visual Descriptions\"** supported by specific color values, typography specs, and component behaviors.\n\n## Prerequisites\n- Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)\n- Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI\n\n## The Goal\nGenerate a `DESIGN.md` file that encodes:\n1. **Visual atmosphere** — the mood, density, and design philosophy\n2. **Color calibration** — neutrals, accents, and banned patterns with hex codes\n3. **Typographic architecture** — font stacks, scale hierarchy, and anti-patterns\n4. **Component behaviors** — buttons, cards, inputs with interaction states\n5. **Layout principles** — grid systems, spacing philosophy, responsive strategy\n6. **Motion philosophy** — animation engine specs, spring physics, perpetual micro-interactions\n7. **Anti-patterns** — explicit list of banned AI design clichés\n\n## Analysis & Synthesis Instructions\n\n### 1. Define the Atmosphere\nEvaluate the target project's intent. Use evocative adjectives from the taste spectrum:\n- **Density:** \"Art Gallery Airy\" (1–3) → \"Daily App Balanced\" (4–7) → \"Cockpit Dense\" (8–10)\n- **Variance:** \"Predictable Symmetric\" (1–3) → \"Offset Asymmetric\" (4–7) → \"Artsy Chaotic\" (8–10)\n- **Motion:** \"Static Restrained\" (1–3) → \"Fluid CSS\" (4–7) → \"Cinematic Choreography\" (8–10)\n\nDefault baseline: Variance 8, Motion 6, Density 4. Adapt dynamically based on user's vibe description.\n\n### 2. Map the Color Palette\nFor each color provide: **Descriptive Name** + **Hex Code** + **Functional Role**.\n\n**Mandatory constraints:**\n- Maximum 1 accent color. Saturation below 80%\n- The \"AI Purple/Blue Neon\" aesthetic is strictly BANNED — no purple button glows, no neon gradients\n- Use absolute neutral bases (Zinc/Slate) with high-contrast singular accents\n- Stick to one palette for the entire output — no warm/cool gray fluctuation\n- Never use pure black (`#000000`) — use Off-Black, Zinc-950, or Charcoal\n\n### 3. Establish Typography Rules\n- **Display/Headlines:** Track-tight, controlled scale. Not screaming. Hierarchy through weight and color, not just massive size\n- **Body:** Relaxed leading, max 65 characters per line\n- **Font Selection:** `Inter` is BANNED for premium/creative contexts. Force unique character: `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`\n- **Serif Ban:** Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) are BANNED. If serif is needed for editorial/creative contexts, use only distinctive modern serifs: `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Serif is always BANNED in dashboards or software UIs\n- **Dashboard Constraint:** Use Sans-Serif pairings exclusively (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`)\n- **High-Density Override:** When density exceeds 7, all numbers must use Monospace\n\n### 4. Define the Hero Section\nThe Hero is the first impression and must be creative, striking, and never generic:\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Images sit inline at type-height, rounded, acting as visual punctuation. This is the signature creative technique\n- **No Overlapping:** Text must never overlap images or other text. Every element occupies its own clean spatial zone\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons are BANNED. The content should pull users in naturally\n- **Asymmetric Structure:** Centered Hero layouts BANNED when variance exceeds 4\n- **CTA Restraint:** Maximum one primary CTA. No secondary \"Learn more\" links\n\n### 5. Describe Component Stylings\nFor each component type, describe shape, color, shadow depth, and interaction behavior:\n- **Buttons:** Tactile push feedback on active state. No neon outer glows. No custom mouse cursors\n- **Cards:** Use ONLY when elevation communicates hierarchy. Tint shadows to background hue. For high-density layouts, replace cards with border-top dividers or negative space\n- **Inputs/Forms:** Label above input, helper text optional, error text below. Standard gap spacing\n- **Loading States:** Skeletal loaders matching layout dimensions — no generic circular spinners\n- **Empty States:** Composed compositions indicating how to populate data\n- **Error States:** Clear, inline error reporting\n\n### 6. Define Layout Principles\n- No overlapping elements — every element occupies its own clear spatial zone. No absolute-positioned content stacking\n- Centered Hero sections are BANNED when variance exceeds 4 — force Split Screen, Left-Aligned, or Asymmetric Whitespace\n- The generic \"3 equal cards horizontally\" feature row is BANNED — use 2-column Zig-Zag, asymmetric grid, or horizontal scroll\n- CSS Grid over Flexbox math — never use `calc()` percentage hacks\n- Contain layouts using max-width constraints (e.g., 1400px centered)\n- Full-height sections must use `min-h-[100dvh]` — never `h-screen` (iOS Safari catastrophic jump)\n\n### 7. Define Responsive Rules\nEvery design must work across all viewports:\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to single column. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure\n- **Typography Scaling:** Headlines scale via `clamp()`. Body text minimum `1rem`/`14px`\n- **Touch Targets:** All interactive elements minimum `44px` tap target\n- **Image Behavior:** Inline typography images (photos between words) stack below headline on mobile\n- **Navigation:** Desktop horizontal nav collapses to clean mobile menu\n- **Spacing:** Vertical section gaps reduce proportionally (`clamp(3rem, 8vw, 6rem)`)\n\n### 8. Encode Motion Philosophy\n- **Spring Physics default:** `stiffness: 100, damping: 20` — premium, weighty feel. No linear easing\n- **Perpetual Micro-Interactions:** Every active component should have an infinite loop state (Pulse, Typewriter, Float, Shimmer)\n- **Staggered Orchestration:** Never mount lists instantly — use cascade delays for waterfall reveals\n- **Performance:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`. Grain/noise filters on fixed pseudo-elements only\n\n### 9. List Anti-Patterns (AI Tells)\nEncode these as explicit \"NEVER DO\" rules in the DESIGN.md:\n- No emojis anywhere\n- No `Inter` font\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — distinctive modern serifs only if needed\n- No pure black (`#000000`)\n- No neon/outer glow shadows\n- No oversaturated accents\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — clean spatial separation always\n- No 3-column equal card layouts\n- No generic names (\"John Doe\", \"Acme\", \"Nexus\")\n- No fake round numbers (`99.99%`, `50%`)\n- No AI copywriting clichés (\"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\")\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", scroll arrows, bouncing chevrons\n- No broken Unsplash links — use `picsum.photos` or SVG avatars\n- No centered Hero sections (for high-variance projects)\n\n## Output Format (DESIGN.md Structure)\n\n```markdown\n# Design System: [Project Title]\n\n## 1. Visual Theme & Atmosphere\n(Evocative description of the mood, density, variance, and motion intensity.\nExample: \"A restrained, gallery-airy interface with confident asymmetric layouts\nand fluid spring-physics motion. The atmosphere is clinical yet warm — like a\nwell-lit architecture studio.\")\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface\n- **Pure Surface** (#FFFFFF) — Card and container fill\n- **Charcoal Ink** (#18181B) — Primary text, Zinc-950 depth\n- **Muted Steel** (#71717A) — Secondary text, descriptions, metadata\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, 1px structural lines\n- **[Accent Name]** (#XXXXXX) — Single accent for CTAs, active states, focus rings\n(Max 1 accent. Saturation < 80%. No purple/neon.)\n\n## 3. Typography Rules\n- **Display:** [Font Name] — Track-tight, controlled scale, weight-driven hierarchy\n- **Body:** [Font Name] — Relaxed leading, 65ch max-width, neutral secondary color\n- **Mono:** [Font Name] — For code, metadata, timestamps, high-density numbers\n- **Banned:** Inter, generic system fonts for premium contexts. Serif fonts banned in dashboards.\n\n## 4. Component Stylings\n* **Buttons:** Flat, no outer glow. Tactile -1px translate on active. Accent fill for primary, ghost/outline for secondary.\n* **Cards:** Generously rounded corners (2.5rem). Diffused whisper shadow. Used only when elevation serves hierarchy. High-density: replace with border-top dividers.\n* **Inputs:** Label above, error below. Focus ring in accent color. No floating labels.\n* **Loaders:** Skeletal shimmer matching exact layout dimensions. No circular spinners.\n* **Empty States:** Composed, illustrated compositions — not just \"No data\" text.\n\n## 5. Layout Principles\n(Grid-first responsive architecture. Asymmetric splits for Hero sections.\nStrict single-column collapse below 768px. Max-width containment.\nNo flexbox percentage math. Generous internal padding.)\n\n## 6. Motion & Interaction\n(Spring physics for all interactive elements. Staggered cascade reveals.\nPerpetual micro-loops on active dashboard components. Hardware-accelerated\ntransforms only. Isolated Client Components for CPU-heavy animations.)\n\n## 7. Anti-Patterns (Banned)\n(Explicit list of forbidden patterns: no emojis, no Inter, no pure black,\nno neon glows, no 3-column equal grids, no AI copywriting clichés,\nno generic placeholder names, no broken image links.)\n```\n\n## Best Practices\n- **Be Descriptive:** \"Deep Charcoal Ink (#18181B)\" — not just \"dark text\"\n- **Be Functional:** Explain what each element is used for\n- **Be Consistent:** Same terminology throughout the document\n- **Be Precise:** Include exact hex codes, rem values, pixel values in parentheses\n- **Be Opinionated:** This is not a neutral template — it enforces a specific, premium aesthetic\n\n## Tips for Success\n1. Start with the atmosphere — understand the vibe before detailing tokens\n2. Look for patterns — identify consistent spacing, sizing, and styling\n3. Think semantically — name colors by purpose, not just appearance\n4. Consider hierarchy — document how visual weight communicates importance\n5. Encode the bans — anti-patterns are as important as the rules themselves\n\n## Common Pitfalls to Avoid\n- Using technical jargon without translation (\"rounded-xl\" instead of \"generously rounded corners\")\n- Omitting hex codes or using only descriptive names\n- Forgetting functional roles of design elements\n- Being too vague in atmosphere descriptions\n- Ignoring the anti-pattern list — these are what make the output premium\n- Defaulting to generic \"safe\" designs instead of enforcing the curated aesthetic\n","frontmatter":{"name":"stitch-design-taste","description":"Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance."},"isInternal":false,"tokens":2767,"sizeBytes":11851},{"name":"AGENTS.md","path":".agents/skills/vercel-react-best-practices/AGENTS.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/AGENTS.md","title":"Vercel-react-best-practices Skill","category":"anthropic-skill","format":"markdown","content":"# React Best Practices\n\n**Version 1.0.0**  \nVercel Engineering  \nJanuary 2026\n\n> **Note:**  \n> This document is mainly for agents and LLMs to follow when maintaining,  \n> generating, or refactoring React and Next.js codebases. Humans  \n> may also find it useful, but guidance here is optimized for automation  \n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.\n\n---\n\n## Table of Contents\n\n1. [Eliminating Waterfalls](#1-eliminating-waterfalls) — **CRITICAL**\n   - 1.1 [Check Cheap Conditions Before Async Flags](#11-check-cheap-conditions-before-async-flags)\n   - 1.2 [Defer Await Until Needed](#12-defer-await-until-needed)\n   - 1.3 [Dependency-Based Parallelization](#13-dependency-based-parallelization)\n   - 1.4 [Prevent Waterfall Chains in API Routes](#14-prevent-waterfall-chains-in-api-routes)\n   - 1.5 [Promise.all() for Independent Operations](#15-promiseall-for-independent-operations)\n   - 1.6 [Strategic Suspense Boundaries](#16-strategic-suspense-boundaries)\n2. [Bundle Size Optimization](#2-bundle-size-optimization) — **CRITICAL**\n   - 2.1 [Avoid Barrel File Imports](#21-avoid-barrel-file-imports)\n   - 2.2 [Conditional Module Loading](#22-conditional-module-loading)\n   - 2.3 [Defer Non-Critical Third-Party Libraries](#23-defer-non-critical-third-party-libraries)\n   - 2.4 [Dynamic Imports for Heavy Components](#24-dynamic-imports-for-heavy-components)\n   - 2.5 [Preload Based on User Intent](#25-preload-based-on-user-intent)\n3. [Server-Side Performance](#3-server-side-performance) — **HIGH**\n   - 3.1 [Authenticate Server Actions Like API Routes](#31-authenticate-server-actions-like-api-routes)\n   - 3.2 [Avoid Duplicate Serialization in RSC Props](#32-avoid-duplicate-serialization-in-rsc-props)\n   - 3.3 [Cross-Request LRU Caching](#33-cross-request-lru-caching)\n   - 3.4 [Hoist Static I/O to Module Level](#34-hoist-static-io-to-module-level)\n   - 3.5 [Minimize Serialization at RSC Boundaries](#35-minimize-serialization-at-rsc-boundaries)\n   - 3.6 [Parallel Data Fetching with Component Composition](#36-parallel-data-fetching-with-component-composition)\n   - 3.7 [Parallel Nested Data Fetching](#37-parallel-nested-data-fetching)\n   - 3.8 [Per-Request Deduplication with React.cache()](#38-per-request-deduplication-with-reactcache)\n   - 3.9 [Use after() for Non-Blocking Operations](#39-use-after-for-non-blocking-operations)\n4. [Client-Side Data Fetching](#4-client-side-data-fetching) — **MEDIUM-HIGH**\n   - 4.1 [Deduplicate Global Event Listeners](#41-deduplicate-global-event-listeners)\n   - 4.2 [Use Passive Event Listeners for Scrolling Performance](#42-use-passive-event-listeners-for-scrolling-performance)\n   - 4.3 [Use SWR for Automatic Deduplication](#43-use-swr-for-automatic-deduplication)\n   - 4.4 [Version and Minimize localStorage Data](#44-version-and-minimize-localstorage-data)\n5. [Re-render Optimization](#5-re-render-optimization) — **MEDIUM**\n   - 5.1 [Calculate Derived State During Rendering](#51-calculate-derived-state-during-rendering)\n   - 5.2 [Defer State Reads to Usage Point](#52-defer-state-reads-to-usage-point)\n   - 5.3 [Do not wrap a simple expression with a primitive result type in useMemo](#53-do-not-wrap-a-simple-expression-with-a-primitive-result-type-in-usememo)\n   - 5.4 [Don't Define Components Inside Components](#54-dont-define-components-inside-components)\n   - 5.5 [Extract Default Non-primitive Parameter Value from Memoized Component to Constant](#55-extract-default-non-primitive-parameter-value-from-memoized-component-to-constant)\n   - 5.6 [Extract to Memoized Components](#56-extract-to-memoized-components)\n   - 5.7 [Narrow Effect Dependencies](#57-narrow-effect-dependencies)\n   - 5.8 [Put Interaction Logic in Event Handlers](#58-put-interaction-logic-in-event-handlers)\n   - 5.9 [Split Combined Hook Computations](#59-split-combined-hook-computations)\n   - 5.10 [Subscribe to Derived State](#510-subscribe-to-derived-state)\n   - 5.11 [Use Functional setState Updates](#511-use-functional-setstate-updates)\n   - 5.12 [Use Lazy State Initialization](#512-use-lazy-state-initialization)\n   - 5.13 [Use Transitions for Non-Urgent Updates](#513-use-transitions-for-non-urgent-updates)\n   - 5.14 [Use useDeferredValue for Expensive Derived Renders](#514-use-usedeferredvalue-for-expensive-derived-renders)\n   - 5.15 [Use useRef for Transient Values](#515-use-useref-for-transient-values)\n6. [Rendering Performance](#6-rendering-performance) — **MEDIUM**\n   - 6.1 [Animate SVG Wrapper Instead of SVG Element](#61-animate-svg-wrapper-instead-of-svg-element)\n   - 6.2 [CSS content-visibility for Long Lists](#62-css-content-visibility-for-long-lists)\n   - 6.3 [Hoist Static JSX Elements](#63-hoist-static-jsx-elements)\n   - 6.4 [Optimize SVG Precision](#64-optimize-svg-precision)\n   - 6.5 [Prevent Hydration Mismatch Without Flickering](#65-prevent-hydration-mismatch-without-flickering)\n   - 6.6 [Suppress Expected Hydration Mismatches](#66-suppress-expected-hydration-mismatches)\n   - 6.7 [Use Activity Component for Show/Hide](#67-use-activity-component-for-showhide)\n   - 6.8 [Use defer or async on Script Tags](#68-use-defer-or-async-on-script-tags)\n   - 6.9 [Use Explicit Conditional Rendering](#69-use-explicit-conditional-rendering)\n   - 6.10 [Use React DOM Resource Hints](#610-use-react-dom-resource-hints)\n   - 6.11 [Use useTransition Over Manual Loading States](#611-use-usetransition-over-manual-loading-states)\n7. [JavaScript Performance](#7-javascript-performance) — **LOW-MEDIUM**\n   - 7.1 [Avoid Layout Thrashing](#71-avoid-layout-thrashing)\n   - 7.2 [Build Index Maps for Repeated Lookups](#72-build-index-maps-for-repeated-lookups)\n   - 7.3 [Cache Property Access in Loops](#73-cache-property-access-in-loops)\n   - 7.4 [Cache Repeated Function Calls](#74-cache-repeated-function-calls)\n   - 7.5 [Cache Storage API Calls](#75-cache-storage-api-calls)\n   - 7.6 [Combine Multiple Array Iterations](#76-combine-multiple-array-iterations)\n   - 7.7 [Defer Non-Critical Work with requestIdleCallback](#77-defer-non-critical-work-with-requestidlecallback)\n   - 7.8 [Early Length Check for Array Comparisons](#78-early-length-check-for-array-comparisons)\n   - 7.9 [Early Return from Functions](#79-early-return-from-functions)\n   - 7.10 [Hoist RegExp Creation](#710-hoist-regexp-creation)\n   - 7.11 [Use flatMap to Map and Filter in One Pass](#711-use-flatmap-to-map-and-filter-in-one-pass)\n   - 7.12 [Use Loop for Min/Max Instead of Sort](#712-use-loop-for-minmax-instead-of-sort)\n   - 7.13 [Use Set/Map for O(1) Lookups](#713-use-setmap-for-o1-lookups)\n   - 7.14 [Use toSorted() Instead of sort() for Immutability](#714-use-tosorted-instead-of-sort-for-immutability)\n8. [Advanced Patterns](#8-advanced-patterns) — **LOW**\n   - 8.1 [Initialize App Once, Not Per Mount](#81-initialize-app-once-not-per-mount)\n   - 8.2 [Store Event Handlers in Refs](#82-store-event-handlers-in-refs)\n   - 8.3 [useEffectEvent for Stable Callback Refs](#83-useeffectevent-for-stable-callback-refs)\n\n---\n\n## 1. Eliminating Waterfalls\n\n**Impact: CRITICAL**\n\nWaterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n### 1.1 Check Cheap Conditions Before Async Flags\n\n**Impact: HIGH (avoids unnecessary async work when a synchronous guard already fails)**\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n\n### 1.2 Defer Await Until Needed\n\n**Impact: HIGH (avoids blocking unused code paths)**\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect: blocks both branches**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct: only blocks when needed**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example: early return optimization**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n\n### 1.3 Dependency-Based Parallelization\n\n**Impact: CRITICAL (2-10× improvement)**\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect: profile waits for config unnecessarily**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct: config and profile run in parallel**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n\n### 1.4 Prevent Waterfall Chains in API Routes\n\n**Impact: CRITICAL (2-10× improvement)**\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect: config waits for auth, data waits for both**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct: auth and config start immediately**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n\n### 1.5 Promise.all() for Independent Operations\n\n**Impact: CRITICAL (2-10× improvement)**\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect: sequential execution, 3 round trips**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct: parallel execution, 1 round trip**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n\n### 1.6 Strategic Suspense Boundaries\n\n**Impact: HIGH (faster initial paint)**\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect: wrapper blocked by data fetching**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct: wrapper shows immediately, data streams in**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative: share promise across components**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n\n- SEO-critical content above the fold\n\n- Small, fast queries where suspense overhead isn't worth it\n\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n\n---\n\n## 2. Bundle Size Optimization\n\n**Impact: CRITICAL**\n\nReducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n### 2.1 Avoid Barrel File Imports\n\n**Impact: CRITICAL (200-800ms import cost, slow builds)**\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect: imports entire library**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [https://vercel.com/blog/how-we-optimized-package-imports-in-next-js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n\n### 2.2 Conditional Module Loading\n\n**Impact: HIGH (loads large data only when needed)**\n\nLoad large data or modules only when a feature is activated.\n\n**Example: lazy-load animation frames**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n\n### 2.3 Defer Non-Critical Third-Party Libraries\n\n**Impact: MEDIUM (loads after hydration)**\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect: blocks initial bundle**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct: loads after hydration**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n### 2.4 Dynamic Imports for Heavy Components\n\n**Impact: CRITICAL (directly affects TTI and LCP)**\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect: Monaco bundles with main chunk ~300KB**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct: Monaco loads on demand**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n### 2.5 Preload Based on User Intent\n\n**Impact: MEDIUM (reduces perceived latency)**\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example: preload on hover/focus**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example: preload when feature flag is enabled**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n\n---\n\n## 3. Server-Side Performance\n\n**Impact: HIGH**\n\nOptimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n### 3.1 Authenticate Server Actions Like API Routes\n\n**Impact: CRITICAL (prevents unauthorized access to server mutations)**\n\nServer Actions (functions with `\"use server\"`) are exposed as public endpoints, just like API routes. Always verify authentication and authorization **inside** each Server Action—do not rely solely on middleware, layout guards, or page-level checks, as Server Actions can be invoked directly.\n\nNext.js documentation explicitly states: \"Treat Server Actions with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation.\"\n\n**Incorrect: no authentication check**\n\n```typescript\n\"use server\";\n\nexport async function deleteUser(userId: string) {\n  // Anyone can call this! No auth check\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**Correct: authentication inside the action**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { unauthorized } from \"@/lib/errors\";\n\nexport async function deleteUser(userId: string) {\n  // Always check auth inside the action\n  const session = await verifySession();\n\n  if (!session) {\n    throw unauthorized(\"Must be logged in\");\n  }\n\n  // Check authorization too\n  if (session.user.role !== \"admin\" && session.user.id !== userId) {\n    throw unauthorized(\"Cannot delete other users\");\n  }\n\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**With input validation:**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { z } from \"zod\";\n\nconst updateProfileSchema = z.object({\n  userId: z.string().uuid(),\n  name: z.string().min(1).max(100),\n  email: z.string().email(),\n});\n\nexport async function updateProfile(data: unknown) {\n  // Validate input first\n  const validated = updateProfileSchema.parse(data);\n\n  // Then authenticate\n  const session = await verifySession();\n  if (!session) {\n    throw new Error(\"Unauthorized\");\n  }\n\n  // Then authorize\n  if (session.user.id !== validated.userId) {\n    throw new Error(\"Can only update own profile\");\n  }\n\n  // Finally perform the mutation\n  await db.user.update({\n    where: { id: validated.userId },\n    data: {\n      name: validated.name,\n      email: validated.email,\n    },\n  });\n\n  return { success: true };\n}\n```\n\nReference: [https://nextjs.org/docs/app/guides/authentication](https://nextjs.org/docs/app/guides/authentication)\n\n### 3.2 Avoid Duplicate Serialization in RSC Props\n\n**Impact: LOW (reduces network payload by avoiding duplicate serialization)**\n\nRSC→client serialization deduplicates by object reference, not value. Same reference = serialized once; new reference = serialized again. Do transformations (`.toSorted()`, `.filter()`, `.map()`) in client, not server.\n\n**Incorrect: duplicates array**\n\n```tsx\n// RSC: sends 6 strings (2 arrays × 3 items)\n<ClientList usernames={usernames} usernamesOrdered={usernames.toSorted()} />\n```\n\n**Correct: sends 3 strings**\n\n```tsx\n// RSC: send once\n<ClientList usernames={usernames} />;\n\n// Client: transform there\n(\"use client\");\nconst sorted = useMemo(() => [...usernames].sort(), [usernames]);\n```\n\n**Nested deduplication behavior:**\n\n```tsx\n// string[] - duplicates everything\nusernames={['a','b']} sorted={usernames.toSorted()} // sends 4 strings\n\n// object[] - duplicates array structure only\nusers={[{id:1},{id:2}]} sorted={users.toSorted()} // sends 2 arrays + 2 unique objects (not 4)\n```\n\nDeduplication works recursively. Impact varies by data type:\n\n- `string[]`, `number[]`, `boolean[]`: **HIGH impact** - array + all primitives fully duplicated\n\n- `object[]`: **LOW impact** - array duplicated, but nested objects deduplicated by reference\n\n**Operations breaking deduplication: create new references**\n\n- Arrays: `.toSorted()`, `.filter()`, `.map()`, `.slice()`, `[...arr]`\n\n- Objects: `{...obj}`, `Object.assign()`, `structuredClone()`, `JSON.parse(JSON.stringify())`\n\n**More examples:**\n\n```tsx\n// ❌ Bad\n<C users={users} active={users.filter(u => u.active)} />\n<C product={product} productName={product.name} />\n\n// ✅ Good\n<C users={users} />\n<C product={product} />\n// Do filtering/destructuring in client\n```\n\n**Exception:** Pass derived data when transformation is expensive or client doesn't need original.\n\n### 3.3 Cross-Request LRU Caching\n\n**Impact: HIGH (caches across requests)**\n\n`React.cache()` only works within one request. For data shared across sequential requests (user clicks button A then button B), use an LRU cache.\n\n**Implementation:**\n\n```typescript\nimport { LRUCache } from \"lru-cache\";\n\nconst cache = new LRUCache<string, any>({\n  max: 1000,\n  ttl: 5 * 60 * 1000, // 5 minutes\n});\n\nexport async function getUser(id: string) {\n  const cached = cache.get(id);\n  if (cached) return cached;\n\n  const user = await db.user.findUnique({ where: { id } });\n  cache.set(id, user);\n  return user;\n}\n\n// Request 1: DB query, result cached\n// Request 2: cache hit, no DB query\n```\n\nUse when sequential user actions hit multiple endpoints needing the same data within seconds.\n\n**With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute):** LRU caching is especially effective because multiple concurrent requests can share the same function instance and cache. This means the cache persists across requests without needing external storage like Redis.\n\n**In traditional serverless:** Each invocation runs in isolation, so consider Redis for cross-process caching.\n\nReference: [https://github.com/isaacs/node-lru-cache](https://github.com/isaacs/node-lru-cache)\n\n### 3.4 Hoist Static I/O to Module Level\n\n**Impact: HIGH (avoids repeated file/network I/O per request)**\n\nWhen loading static assets (fonts, logos, images, config files) in route handlers or server functions, hoist the I/O operation to module level. Module-level code runs once when the module is first imported, not on every request. This eliminates redundant file system reads or network fetches that would otherwise run on every invocation.\n\n**Incorrect: reads font file on every request**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\nexport async function GET(request: Request) {\n  // Runs on EVERY request - expensive!\n  const fontData = await fetch(\n    new URL('./fonts/Inter.ttf', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  const logoData = await fetch(\n    new URL('./images/logo.png', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Correct: loads once at module initialization**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\n// Module-level: runs ONCE when module is first imported\nconst fontData = fetch(\n  new URL('./fonts/Inter.ttf', import.meta.url)\n).then(res => res.arrayBuffer())\n\nconst logoData = fetch(\n  new URL('./images/logo.png', import.meta.url)\n).then(res => res.arrayBuffer())\n\nexport async function GET(request: Request) {\n  // Await the already-started promises\n  const [font, logo] = await Promise.all([fontData, logoData])\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logo} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: font }] }\n  )\n}\n```\n\n**Correct: synchronous fs at module level**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\nimport { readFileSync } from 'fs'\nimport { join } from 'path'\n\n// Synchronous read at module level - blocks only during module init\nconst fontData = readFileSync(\n  join(process.cwd(), 'public/fonts/Inter.ttf')\n)\n\nconst logoData = readFileSync(\n  join(process.cwd(), 'public/images/logo.png')\n)\n\nexport async function GET(request: Request) {\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Incorrect: reads config on every call**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nexport async function processRequest(data: Data) {\n  const config = JSON.parse(await fs.readFile(\"./config.json\", \"utf-8\"));\n  const template = await fs.readFile(\"./template.html\", \"utf-8\");\n\n  return render(template, data, config);\n}\n```\n\n**Correct: hoists config and template to module level**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nconst configPromise = fs.readFile(\"./config.json\", \"utf-8\").then(JSON.parse);\nconst templatePromise = fs.readFile(\"./template.html\", \"utf-8\");\n\nexport async function processRequest(data: Data) {\n  const [config, template] = await Promise.all([\n    configPromise,\n    templatePromise,\n  ]);\n\n  return render(template, data, config);\n}\n```\n\nWhen to use this pattern:\n\n- Loading fonts for OG image generation\n\n- Loading static logos, icons, or watermarks\n\n- Reading configuration files that don't change at runtime\n\n- Loading email templates or other static templates\n\n- Any static asset that's the same across all requests\n\nWhen not to use this pattern:\n\n- Assets that vary per request or user\n\n- Files that may change during runtime (use caching with TTL instead)\n\n- Large files that would consume too much memory if kept loaded\n\n- Sensitive data that shouldn't persist in memory\n\nWith Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute), module-level caching is especially effective because multiple concurrent requests share the same function instance. The static assets stay loaded in memory across requests without cold start penalties.\n\nIn traditional serverless, each cold start re-executes module-level code, but subsequent warm invocations reuse the loaded assets until the instance is recycled.\n\n### 3.5 Minimize Serialization at RSC Boundaries\n\n**Impact: HIGH (reduces data transfer size)**\n\nThe React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.\n\n**Incorrect: serializes all 50 fields**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser(); // 50 fields\n  return <Profile user={user} />;\n}\n\n(\"use client\");\nfunction Profile({ user }: { user: User }) {\n  return <div>{user.name}</div>; // uses 1 field\n}\n```\n\n**Correct: serializes only 1 field**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser();\n  return <Profile name={user.name} />;\n}\n\n(\"use client\");\nfunction Profile({ name }: { name: string }) {\n  return <div>{name}</div>;\n}\n```\n\n### 3.6 Parallel Data Fetching with Component Composition\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nReact Server Components execute sequentially within a tree. Restructure with composition to parallelize data fetching.\n\n**Incorrect: Sidebar waits for Page's fetch to complete**\n\n```tsx\nexport default async function Page() {\n  const header = await fetchHeader();\n  return (\n    <div>\n      <div>{header}</div>\n      <Sidebar />\n    </div>\n  );\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n```\n\n**Correct: both fetch simultaneously**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nexport default function Page() {\n  return (\n    <div>\n      <Header />\n      <Sidebar />\n    </div>\n  );\n}\n```\n\n**Alternative with children prop:**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nfunction Layout({ children }: { children: ReactNode }) {\n  return (\n    <div>\n      <Header />\n      {children}\n    </div>\n  );\n}\n\nexport default function Page() {\n  return (\n    <Layout>\n      <Sidebar />\n    </Layout>\n  );\n}\n```\n\n### 3.7 Parallel Nested Data Fetching\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nWhen fetching nested data in parallel, chain dependent fetches within each item's promise so a slow item doesn't block the rest.\n\n**Incorrect: a single slow item blocks all nested fetches**\n\n```tsx\nconst chats = await Promise.all(chatIds.map((id) => getChat(id)));\n\nconst chatAuthors = await Promise.all(\n  chats.map((chat) => getUser(chat.author)),\n);\n```\n\nIf one `getChat(id)` out of 100 is extremely slow, the authors of the other 99 chats can't start loading even though their data is ready.\n\n**Correct: each item chains its own nested fetch**\n\n```tsx\nconst chatAuthors = await Promise.all(\n  chatIds.map((id) => getChat(id).then((chat) => getUser(chat.author))),\n);\n```\n\nEach item independently chains `getChat` → `getUser`, so a slow chat doesn't block author fetches for the others.\n\n### 3.8 Per-Request Deduplication with React.cache()\n\n**Impact: MEDIUM (deduplicates within request)**\n\nUse `React.cache()` for server-side request deduplication. Authentication and database queries benefit most.\n\n**Usage:**\n\n```typescript\nimport { cache } from \"react\";\n\nexport const getCurrentUser = cache(async () => {\n  const session = await auth();\n  if (!session?.user?.id) return null;\n  return await db.user.findUnique({\n    where: { id: session.user.id },\n  });\n});\n```\n\nWithin a single request, multiple calls to `getCurrentUser()` execute the query only once.\n\n**Avoid inline objects as arguments:**\n\n`React.cache()` uses shallow equality (`Object.is`) to determine cache hits. Inline objects create new references each call, preventing cache hits.\n\n**Incorrect: always cache miss**\n\n```typescript\nconst getUser = cache(async (params: { uid: number }) => {\n  return await db.user.findUnique({ where: { id: params.uid } });\n});\n\n// Each call creates new object, never hits cache\ngetUser({ uid: 1 });\ngetUser({ uid: 1 }); // Cache miss, runs query again\n```\n\n**Correct: cache hit**\n\n```typescript\nconst params = { uid: 1 };\ngetUser(params); // Query runs\ngetUser(params); // Cache hit (same reference)\n```\n\nIf you must pass objects, pass the same reference:\n\n**Next.js-Specific Note:**\n\nIn Next.js, the `fetch` API is automatically extended with request memoization. Requests with the same URL and options are automatically deduplicated within a single request, so you don't need `React.cache()` for `fetch` calls. However, `React.cache()` is still essential for other async tasks:\n\n- Database queries (Prisma, Drizzle, etc.)\n\n- Heavy computations\n\n- Authentication checks\n\n- File system operations\n\n- Any non-fetch async work\n\nUse `React.cache()` to deduplicate these operations across your component tree.\n\nReference: [https://react.dev/reference/react/cache](https://react.dev/reference/react/cache)\n\n### 3.9 Use after() for Non-Blocking Operations\n\n**Impact: MEDIUM (faster response times)**\n\nUse Next.js's `after()` to schedule work that should execute after a response is sent. This prevents logging, analytics, and other side effects from blocking the response.\n\n**Incorrect: blocks response**\n\n```tsx\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Logging blocks the response\n  const userAgent = request.headers.get(\"user-agent\") || \"unknown\";\n  await logUserAction({ userAgent });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\n**Correct: non-blocking**\n\n```tsx\nimport { after } from \"next/server\";\nimport { headers, cookies } from \"next/headers\";\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Log after response is sent\n  after(async () => {\n    const userAgent = (await headers()).get(\"user-agent\") || \"unknown\";\n    const sessionCookie =\n      (await cookies()).get(\"session-id\")?.value || \"anonymous\";\n\n    logUserAction({ sessionCookie, userAgent });\n  });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\nThe response is sent immediately while logging happens in the background.\n\n**Common use cases:**\n\n- Analytics tracking\n\n- Audit logging\n\n- Sending notifications\n\n- Cache invalidation\n\n- Cleanup tasks\n\n**Important notes:**\n\n- `after()` runs even if the response fails or redirects\n\n- Works in Server Actions, Route Handlers, and Server Components\n\nReference: [https://nextjs.org/docs/app/api-reference/functions/after](https://nextjs.org/docs/app/api-reference/functions/after)\n\n---\n\n## 4. Client-Side Data Fetching\n\n**Impact: MEDIUM-HIGH**\n\nAutomatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n### 4.1 Deduplicate Global Event Listeners\n\n**Impact: LOW (single listener for N components)**\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect: N instances = N listeners**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct: N instances = 1 listener**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n\n### 4.2 Use Passive Event Listeners for Scrolling Performance\n\n**Impact: MEDIUM (eliminates scroll delay caused by event listeners)**\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n\n### 4.3 Use SWR for Automatic Deduplication\n\n**Impact: MEDIUM-HIGH (automatic deduplication)**\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect: no deduplication, each instance fetches**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct: multiple instances share one request**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n\n### 4.4 Version and Minimize localStorage Data\n\n**Impact: MEDIUM (prevents schema conflicts, reduces storage size)**\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n\n---\n\n## 5. Re-render Optimization\n\n**Impact: MEDIUM**\n\nReducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n### 5.1 Calculate Derived State During Rendering\n\n**Impact: MEDIUM (avoids redundant renders and state drift)**\n\nIf a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.\n\n**Incorrect: redundant state and effect**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const [fullName, setFullName] = useState(\"\");\n\n  useEffect(() => {\n    setFullName(firstName + \" \" + lastName);\n  }, [firstName, lastName]);\n\n  return <p>{fullName}</p>;\n}\n```\n\n**Correct: derive during render**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const fullName = firstName + \" \" + lastName;\n\n  return <p>{fullName}</p>;\n}\n```\n\nReference: [https://react.dev/learn/you-might-not-need-an-effect](https://react.dev/learn/you-might-not-need-an-effect)\n\n### 5.2 Defer State Reads to Usage Point\n\n**Impact: MEDIUM (avoids unnecessary subscriptions)**\n\nDon't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.\n\n**Incorrect: subscribes to all searchParams changes**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const searchParams = useSearchParams();\n\n  const handleShare = () => {\n    const ref = searchParams.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n**Correct: reads on demand, no subscription**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const handleShare = () => {\n    const params = new URLSearchParams(window.location.search);\n    const ref = params.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n### 5.3 Do not wrap a simple expression with a primitive result type in useMemo\n\n**Impact: LOW-MEDIUM (wasted computation on every render)**\n\nWhen an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.\n\nCalling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.\n\n**Incorrect:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = useMemo(() => {\n    return user.isLoading || notifications.isLoading;\n  }, [user.isLoading, notifications.isLoading]);\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n**Correct:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = user.isLoading || notifications.isLoading;\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n### 5.4 Don't Define Components Inside Components\n\n**Impact: HIGH (prevents remount on every render)**\n\nDefining a component inside another component creates a new component type on every render. React sees a different component each time and fully remounts it, destroying all state and DOM.\n\nA common reason developers do this is to access parent variables without passing props. Always pass props instead.\n\n**Incorrect: remounts on every render**\n\n```tsx\nfunction UserProfile({ user, theme }) {\n  // Defined inside to access `theme` - BAD\n  const Avatar = () => (\n    <img\n      src={user.avatarUrl}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n\n  // Defined inside to access `user` - BAD\n  const Stats = () => (\n    <div>\n      <span>{user.followers} followers</span>\n      <span>{user.posts} posts</span>\n    </div>\n  );\n\n  return (\n    <div>\n      <Avatar />\n      <Stats />\n    </div>\n  );\n}\n```\n\nEvery time `UserProfile` renders, `Avatar` and `Stats` are new component types. React unmounts the old instances and mounts new ones, losing any internal state, running effects again, and recreating DOM nodes.\n\n**Correct: pass props instead**\n\n```tsx\nfunction Avatar({ src, theme }: { src: string; theme: string }) {\n  return (\n    <img\n      src={src}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n}\n\nfunction St\n\n<!-- [TRUNCATED AT 50KB] -->","isInternal":false,"tokens":11983,"sizeBytes":50062},{"name":"README.md","path":".agents/skills/vercel-react-best-practices/README.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/README.md","title":"Vercel-react-best-practices Skill","category":"anthropic-skill","format":"markdown","content":"# React Best Practices\n\nA structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `src/` - Build scripts and utilities\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n- **`test-cases.json`** - Test cases for LLM evaluation (generated)\n\n## Getting Started\n\n1. Install dependencies:\n\n   ```bash\n   pnpm install\n   ```\n\n2. Build AGENTS.md from rules:\n\n   ```bash\n   pnpm build\n   ```\n\n3. Validate rule files:\n\n   ```bash\n   pnpm validate\n   ```\n\n4. Extract test cases:\n   ```bash\n   pnpm extract-tests\n   ```\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `async-` for Eliminating Waterfalls (Section 1)\n   - `bundle-` for Bundle Size Optimization (Section 2)\n   - `server-` for Server-Side Performance (Section 3)\n   - `client-` for Client-Side Data Fetching (Section 4)\n   - `rerender-` for Re-render Optimization (Section 5)\n   - `rendering-` for Rendering Performance (Section 6)\n   - `js-` for JavaScript Performance (Section 7)\n   - `advanced-` for Advanced Patterns (Section 8)\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n\n## Rule File Structure\n\nEach rule file should follow this structure:\n\n````markdown\n---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description\ntags: tag1, tag2, tag3\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example\n```\n````\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example\n```\n\nOptional explanatory text after examples.\n\nReference: [Link](https://example.com)\n\n## File Naming Convention\n\n- Files starting with `_` are special (excluded from build)\n- Rule files: `area-description.md` (e.g., `async-parallel.md`)\n- Section is automatically inferred from filename prefix\n- Rules are sorted alphabetically by title within each section\n- IDs (e.g., 1.1, 1.2) are auto-generated during build\n\n## Impact Levels\n\n- `CRITICAL` - Highest priority, major performance gains\n- `HIGH` - Significant performance improvements\n- `MEDIUM-HIGH` - Moderate-high gains\n- `MEDIUM` - Moderate performance improvements\n- `LOW-MEDIUM` - Low-medium gains\n- `LOW` - Incremental improvements\n\n## Scripts\n\n- `pnpm build` - Compile rules into AGENTS.md\n- `pnpm validate` - Validate all rule files\n- `pnpm extract-tests` - Extract test cases for LLM evaluation\n- `pnpm dev` - Build and validate\n\n## Contributing\n\nWhen adding or modifying rules:\n\n1. Use the correct filename prefix for your section\n2. Follow the `_template.md` structure\n3. Include clear bad/good examples with explanations\n4. Add appropriate tags\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n6. Rules are automatically sorted by title - no need to manage numbers!\n\n## Acknowledgments\n\nOriginally created by [@shuding](https://x.com/shuding) at [Vercel](https://vercel.com).\n","isInternal":false,"tokens":852,"sizeBytes":3369},{"name":"_sections.md","path":".agents/skills/vercel-react-best-practices/rules/_sections.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/_sections.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Eliminating Waterfalls (async)\n\n**Impact:** CRITICAL  \n**Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n## 2. Bundle Size Optimization (bundle)\n\n**Impact:** CRITICAL  \n**Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n## 3. Server-Side Performance (server)\n\n**Impact:** HIGH  \n**Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n## 4. Client-Side Data Fetching (client)\n\n**Impact:** MEDIUM-HIGH  \n**Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n## 5. Re-render Optimization (rerender)\n\n**Impact:** MEDIUM  \n**Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n## 6. Rendering Performance (rendering)\n\n**Impact:** MEDIUM  \n**Description:** Optimizing the rendering process reduces the work the browser needs to do.\n\n## 7. JavaScript Performance (js)\n\n**Impact:** LOW-MEDIUM  \n**Description:** Micro-optimizations for hot paths can add up to meaningful improvements.\n\n## 8. Advanced Patterns (advanced)\n\n**Impact:** LOW  \n**Description:** Advanced patterns for specific cases that require careful implementation.\n","isInternal":false,"tokens":318,"sizeBytes":1554},{"name":"_template.md","path":".agents/skills/vercel-react-best-practices/rules/_template.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/_template.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description of impact (e.g., \"20-50% improvement\")\ntags: tag1, tag2\n---\n\n## Rule Title Here\n\n**Impact: MEDIUM (optional impact description)**\n\nBrief explanation of the rule and why it matters. This should be clear and concise, explaining the performance implications.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example here\nconst bad = example();\n```\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example here\nconst good = example();\n```\n\nReference: [Link to documentation or resource](https://example.com)\n","frontmatter":{"title":"Rule Title Here","impact":"MEDIUM","impactDescription":"Optional description of impact (e.g., \"20-50% improvement\")","tags":"tag1, tag2"},"isInternal":false,"tokens":143,"sizeBytes":633},{"name":"advanced-event-handler-refs.md","path":".agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Store Event Handlers in Refs\nimpact: LOW\nimpactDescription: stable subscriptions\ntags: advanced, hooks, refs, event-handlers, optimization\n---\n\n## Store Event Handlers in Refs\n\nStore callbacks in refs when used in effects that shouldn't re-subscribe on callback changes.\n\n**Incorrect (re-subscribes on every render):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  useEffect(() => {\n    window.addEventListener(event, handler);\n    return () => window.removeEventListener(event, handler);\n  }, [event, handler]);\n}\n```\n\n**Correct (stable subscription):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const handlerRef = useRef(handler);\n  useEffect(() => {\n    handlerRef.current = handler;\n  }, [handler]);\n\n  useEffect(() => {\n    const listener = (e) => handlerRef.current(e);\n    window.addEventListener(event, listener);\n    return () => window.removeEventListener(event, listener);\n  }, [event]);\n}\n```\n\n**Alternative: use `useEffectEvent` if you're on latest React:**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const onEvent = useEffectEvent(handler);\n\n  useEffect(() => {\n    window.addEventListener(event, onEvent);\n    return () => window.removeEventListener(event, onEvent);\n  }, [event]);\n}\n```\n\n`useEffectEvent` provides a cleaner API for the same pattern: it creates a stable function reference that always calls the latest version of the handler.\n","frontmatter":{"title":"Store Event Handlers in Refs","impact":"LOW","impactDescription":"stable subscriptions","tags":"advanced, hooks, refs, event-handlers, optimization"},"isInternal":false,"tokens":337,"sizeBytes":1498},{"name":"advanced-init-once.md","path":".agents/skills/vercel-react-best-practices/rules/advanced-init-once.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Initialize App Once, Not Per Mount\nimpact: LOW-MEDIUM\nimpactDescription: avoids duplicate init in development\ntags: initialization, useEffect, app-startup, side-effects\n---\n\n## Initialize App Once, Not Per Mount\n\nDo not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.\n\n**Incorrect (runs twice in dev, re-runs on remount):**\n\n```tsx\nfunction Comp() {\n  useEffect(() => {\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\n**Correct (once per app load):**\n\n```tsx\nlet didInit = false;\n\nfunction Comp() {\n  useEffect(() => {\n    if (didInit) return;\n    didInit = true;\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\nReference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)\n","frontmatter":{"title":"Initialize App Once, Not Per Mount","impact":"LOW-MEDIUM","impactDescription":"avoids duplicate init in development","tags":"initialization, useEffect, app-startup, side-effects"},"isInternal":false,"tokens":230,"sizeBytes":967},{"name":"advanced-use-latest.md","path":".agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: useEffectEvent for Stable Callback Refs\nimpact: LOW\nimpactDescription: prevents effect re-runs\ntags: advanced, hooks, useEffectEvent, refs, optimization\n---\n\n## useEffectEvent for Stable Callback Refs\n\nAccess latest values in callbacks without adding them to dependency arrays. Prevents effect re-runs while avoiding stale closures.\n\n**Incorrect (effect re-runs on every callback change):**\n\n```tsx\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearch(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query, onSearch]);\n}\n```\n\n**Correct (using React's useEffectEvent):**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n  const onSearchEvent = useEffectEvent(onSearch);\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearchEvent(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query]);\n}\n```\n","frontmatter":{"title":"useEffectEvent for Stable Callback Refs","impact":"LOW","impactDescription":"prevents effect re-runs","tags":"advanced, hooks, useEffectEvent, refs, optimization"},"isInternal":false,"tokens":253,"sizeBytes":1081},{"name":"async-api-routes.md","path":".agents/skills/vercel-react-best-practices/rules/async-api-routes.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Prevent Waterfall Chains in API Routes\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: api-routes, server-actions, waterfalls, parallelization\n---\n\n## Prevent Waterfall Chains in API Routes\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect (config waits for auth, data waits for both):**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct (auth and config start immediately):**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n","frontmatter":{"title":"Prevent Waterfall Chains in API Routes","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"api-routes, server-actions, waterfalls, parallelization"},"isInternal":false,"tokens":241,"sizeBytes":1135},{"name":"async-cheap-condition-before-await.md","path":".agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Check Cheap Conditions Before Async Flags\nimpact: HIGH\nimpactDescription: avoids unnecessary async work when a synchronous guard already fails\ntags: async, await, feature-flags, short-circuit, conditional\n---\n\n## Check Cheap Conditions Before Async Flags\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n","frontmatter":{"title":"Check Cheap Conditions Before Async Flags","impact":"HIGH","impactDescription":"avoids unnecessary async work when a synchronous guard already fails","tags":"async, await, feature-flags, short-circuit, conditional"},"isInternal":false,"tokens":277,"sizeBytes":1222},{"name":"async-defer-await.md","path":".agents/skills/vercel-react-best-practices/rules/async-defer-await.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Defer Await Until Needed\nimpact: HIGH\nimpactDescription: avoids blocking unused code paths\ntags: async, await, conditional, optimization\n---\n\n## Defer Await Until Needed\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect (blocks both branches):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct (only blocks when needed):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example (early return optimization):**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n","frontmatter":{"title":"Defer Await Until Needed","impact":"HIGH","impactDescription":"avoids blocking unused code paths","tags":"async, await, conditional, optimization"},"isInternal":false,"tokens":464,"sizeBytes":2204},{"name":"async-dependencies.md","path":".agents/skills/vercel-react-best-practices/rules/async-dependencies.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Dependency-Based Parallelization\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, dependencies, better-all\n---\n\n## Dependency-Based Parallelization\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect (profile waits for config unnecessarily):**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct (config and profile run in parallel):**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n","frontmatter":{"title":"Dependency-Based Parallelization","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"async, parallelization, dependencies, better-all"},"isInternal":false,"tokens":294,"sizeBytes":1313},{"name":"async-parallel.md","path":".agents/skills/vercel-react-best-practices/rules/async-parallel.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-parallel.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Promise.all() for Independent Operations\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, promises, waterfalls\n---\n\n## Promise.all() for Independent Operations\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect (sequential execution, 3 round trips):**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct (parallel execution, 1 round trip):**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n","frontmatter":{"title":"Promise.all() for Independent Operations","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"async, parallelization, promises, waterfalls"},"isInternal":false,"tokens":144,"sizeBytes":659},{"name":"async-suspense-boundaries.md","path":".agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Strategic Suspense Boundaries\nimpact: HIGH\nimpactDescription: faster initial paint\ntags: async, suspense, streaming, layout-shift\n---\n\n## Strategic Suspense Boundaries\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect (wrapper blocked by data fetching):**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct (wrapper shows immediately, data streams in):**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative (share promise across components):**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n- SEO-critical content above the fold\n- Small, fast queries where suspense overhead isn't worth it\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n","frontmatter":{"title":"Strategic Suspense Boundaries","impact":"HIGH","impactDescription":"faster initial paint","tags":"async, suspense, streaming, layout-shift"},"isInternal":false,"tokens":590,"sizeBytes":2517},{"name":"bundle-barrel-imports.md","path":".agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Avoid Barrel File Imports\nimpact: CRITICAL\nimpactDescription: 200-800ms import cost, slow builds\ntags: bundle, imports, tree-shaking, barrel-files, performance\n---\n\n## Avoid Barrel File Imports\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect (imports entire library):**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```js\n// next.config.js - automatically optimizes barrel imports at build time\nmodule.exports = {\n  experimental: {\n    optimizePackageImports: [\"lucide-react\", \"@mui/material\"],\n  },\n};\n```\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [How we optimized package imports in Next.js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n","frontmatter":{"title":"Avoid Barrel File Imports","impact":"CRITICAL","impactDescription":"200-800ms import cost, slow builds","tags":"bundle, imports, tree-shaking, barrel-files, performance"},"isInternal":false,"tokens":672,"sizeBytes":2803},{"name":"bundle-conditional.md","path":".agents/skills/vercel-react-best-practices/rules/bundle-conditional.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Conditional Module Loading\nimpact: HIGH\nimpactDescription: loads large data only when needed\ntags: bundle, conditional-loading, lazy-loading\n---\n\n## Conditional Module Loading\n\nLoad large data or modules only when a feature is activated.\n\n**Example (lazy-load animation frames):**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n","frontmatter":{"title":"Conditional Module Loading","impact":"HIGH","impactDescription":"loads large data only when needed","tags":"bundle, conditional-loading, lazy-loading"},"isInternal":false,"tokens":220,"sizeBytes":966},{"name":"bundle-defer-third-party.md","path":".agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Defer Non-Critical Third-Party Libraries\nimpact: MEDIUM\nimpactDescription: loads after hydration\ntags: bundle, third-party, analytics, defer\n---\n\n## Defer Non-Critical Third-Party Libraries\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect (blocks initial bundle):**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct (loads after hydration):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n","frontmatter":{"title":"Defer Non-Critical Third-Party Libraries","impact":"MEDIUM","impactDescription":"loads after hydration","tags":"bundle, third-party, analytics, defer"},"isInternal":false,"tokens":223,"sizeBytes":928},{"name":"bundle-dynamic-imports.md","path":".agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Dynamic Imports for Heavy Components\nimpact: CRITICAL\nimpactDescription: directly affects TTI and LCP\ntags: bundle, dynamic-import, code-splitting, next-dynamic\n---\n\n## Dynamic Imports for Heavy Components\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect (Monaco bundles with main chunk ~300KB):**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct (Monaco loads on demand):**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n","frontmatter":{"title":"Dynamic Imports for Heavy Components","impact":"CRITICAL","impactDescription":"directly affects TTI and LCP","tags":"bundle, dynamic-import, code-splitting, next-dynamic"},"isInternal":false,"tokens":199,"sizeBytes":799},{"name":"bundle-preload.md","path":".agents/skills/vercel-react-best-practices/rules/bundle-preload.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Preload Based on User Intent\nimpact: MEDIUM\nimpactDescription: reduces perceived latency\ntags: bundle, preload, user-intent, hover\n---\n\n## Preload Based on User Intent\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example (preload on hover/focus):**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example (preload when feature flag is enabled):**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n","frontmatter":{"title":"Preload Based on User Intent","impact":"MEDIUM","impactDescription":"reduces perceived latency","tags":"bundle, preload, user-intent, hover"},"isInternal":false,"tokens":263,"sizeBytes":1136},{"name":"client-event-listeners.md","path":".agents/skills/vercel-react-best-practices/rules/client-event-listeners.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Deduplicate Global Event Listeners\nimpact: LOW\nimpactDescription: single listener for N components\ntags: client, swr, event-listeners, subscription\n---\n\n## Deduplicate Global Event Listeners\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect (N instances = N listeners):**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct (N instances = 1 listener):**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n","frontmatter":{"title":"Deduplicate Global Event Listeners","impact":"LOW","impactDescription":"single listener for N components","tags":"client, swr, event-listeners, subscription"},"isInternal":false,"tokens":470,"sizeBytes":2003},{"name":"client-localstorage-schema.md","path":".agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Version and Minimize localStorage Data\nimpact: MEDIUM\nimpactDescription: prevents schema conflicts, reduces storage size\ntags: client, localStorage, storage, versioning, data-minimization\n---\n\n## Version and Minimize localStorage Data\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n","frontmatter":{"title":"Version and Minimize localStorage Data","impact":"MEDIUM","impactDescription":"prevents schema conflicts, reduces storage size","tags":"client, localStorage, storage, versioning, data-minimization"},"isInternal":false,"tokens":446,"sizeBytes":2011},{"name":"client-passive-event-listeners.md","path":".agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Use Passive Event Listeners for Scrolling Performance\nimpact: MEDIUM\nimpactDescription: eliminates scroll delay caused by event listeners\ntags: client, event-listeners, scrolling, performance, touch, wheel\n---\n\n## Use Passive Event Listeners for Scrolling Performance\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n","frontmatter":{"title":"Use Passive Event Listeners for Scrolling Performance","impact":"MEDIUM","impactDescription":"eliminates scroll delay caused by event listeners","tags":"client, event-listeners, scrolling, performance, touch, wheel"},"isInternal":false,"tokens":357,"sizeBytes":1652},{"name":"client-swr-dedup.md","path":".agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Use SWR for Automatic Deduplication\nimpact: MEDIUM-HIGH\nimpactDescription: automatic deduplication\ntags: client, swr, deduplication, data-fetching\n---\n\n## Use SWR for Automatic Deduplication\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect (no deduplication, each instance fetches):**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct (multiple instances share one request):**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n","frontmatter":{"title":"Use SWR for Automatic Deduplication","impact":"MEDIUM-HIGH","impactDescription":"automatic deduplication","tags":"client, swr, deduplication, data-fetching"},"isInternal":false,"tokens":310,"sizeBytes":1171},{"name":"js-batch-dom-css.md","path":".agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Avoid Layout Thrashing\nimpact: MEDIUM\nimpactDescription: prevents forced synchronous layouts and reduces performance bottlenecks\ntags: javascript, dom, css, performance, reflow, layout-thrashing\n---\n\n## Avoid Layout Thrashing\n\nAvoid interleaving style writes with layout reads. When you read a layout property (like `offsetWidth`, `getBoundingClientRect()`, or `getComputedStyle()`) between style changes, the browser is forced to trigger a synchronous reflow.\n\n**This is OK (browser batches style changes):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Each line invalidates style, but browser batches the recalculation\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n}\n```\n\n**Incorrect (interleaved reads and writes force reflows):**\n\n```typescript\nfunction layoutThrashing(element: HTMLElement) {\n  element.style.width = \"100px\";\n  const width = element.offsetWidth; // Forces reflow\n  element.style.height = \"200px\";\n  const height = element.offsetHeight; // Forces another reflow\n}\n```\n\n**Correct (batch writes, then read once):**\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  // Batch all writes together\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n  element.style.backgroundColor = \"blue\";\n  element.style.border = \"1px solid black\";\n\n  // Read after all writes are done (single reflow)\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**Correct (batch reads, then writes):**\n\n```typescript\nfunction avoidThrashing(element: HTMLElement) {\n  // Read phase - all layout queries first\n  const rect1 = element.getBoundingClientRect();\n  const offsetWidth = element.offsetWidth;\n  const offsetHeight = element.offsetHeight;\n\n  // Write phase - all style changes after\n  element.style.width = \"100px\";\n  element.style.height = \"200px\";\n}\n```\n\n**Better: use CSS classes**\n\n```css\n.highlighted-box {\n  width: 100px;\n  height: 200px;\n  background-color: blue;\n  border: 1px solid black;\n}\n```\n\n```typescript\nfunction updateElementStyles(element: HTMLElement) {\n  element.classList.add(\"highlighted-box\");\n\n  const { width, height } = element.getBoundingClientRect();\n}\n```\n\n**React example:**\n\n```tsx\n// Incorrect: interleaving style changes with layout queries\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    if (ref.current && isHighlighted) {\n      ref.current.style.width = \"100px\";\n      const width = ref.current.offsetWidth; // Forces layout\n      ref.current.style.height = \"200px\";\n    }\n  }, [isHighlighted]);\n\n  return <div ref={ref}>Content</div>;\n}\n\n// Correct: toggle class\nfunction Box({ isHighlighted }: { isHighlighted: boolean }) {\n  return <div className={isHighlighted ? \"highlighted-box\" : \"\"}>Content</div>;\n}\n```\n\nPrefer CSS classes over inline styles when possible. CSS files are cached by the browser, and classes provide better separation of concerns and are easier to maintain.\n\nSee [this gist](https://gist.github.com/paulirish/5d52fb081b3570c81e3a) and [CSS Triggers](https://csstriggers.com/) for more information on layout-forcing operations.\n","frontmatter":{"title":"Avoid Layout Thrashing","impact":"MEDIUM","impactDescription":"prevents forced synchronous layouts and reduces performance bottlenecks","tags":"javascript, dom, css, performance, reflow, layout-thrashing"},"isInternal":false,"tokens":747,"sizeBytes":3266},{"name":"js-cache-function-results.md","path":".agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Cache Repeated Function Calls\nimpact: MEDIUM\nimpactDescription: avoid redundant computation\ntags: javascript, cache, memoization, performance\n---\n\n## Cache Repeated Function Calls\n\nUse a module-level Map to cache function results when the same function is called repeatedly with the same inputs during render.\n\n**Incorrect (redundant computation):**\n\n```typescript\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // slugify() called 100+ times for same project names\n        const slug = slugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Correct (cached results):**\n\n```typescript\n// Module-level cache\nconst slugifyCache = new Map<string, string>()\n\nfunction cachedSlugify(text: string): string {\n  if (slugifyCache.has(text)) {\n    return slugifyCache.get(text)!\n  }\n  const result = slugify(text)\n  slugifyCache.set(text, result)\n  return result\n}\n\nfunction ProjectList({ projects }: { projects: Project[] }) {\n  return (\n    <div>\n      {projects.map(project => {\n        // Computed only once per unique project name\n        const slug = cachedSlugify(project.name)\n\n        return <ProjectCard key={project.id} slug={slug} />\n      })}\n    </div>\n  )\n}\n```\n\n**Simpler pattern for single-value functions:**\n\n```typescript\nlet isLoggedInCache: boolean | null = null;\n\nfunction isLoggedIn(): boolean {\n  if (isLoggedInCache !== null) {\n    return isLoggedInCache;\n  }\n\n  isLoggedInCache = document.cookie.includes(\"auth=\");\n  return isLoggedInCache;\n}\n\n// Clear cache when auth changes\nfunction onAuthChange() {\n  isLoggedInCache = null;\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\nReference: [How we made the Vercel Dashboard twice as fast](https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast)\n","frontmatter":{"title":"Cache Repeated Function Calls","impact":"MEDIUM","impactDescription":"avoid redundant computation","tags":"javascript, cache, memoization, performance"},"isInternal":false,"tokens":444,"sizeBytes":1936},{"name":"js-cache-property-access.md","path":".agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Cache Property Access in Loops\nimpact: LOW-MEDIUM\nimpactDescription: reduces lookups\ntags: javascript, loops, optimization, caching\n---\n\n## Cache Property Access in Loops\n\nCache object property lookups in hot paths.\n\n**Incorrect (3 lookups × N iterations):**\n\n```typescript\nfor (let i = 0; i < arr.length; i++) {\n  process(obj.config.settings.value);\n}\n```\n\n**Correct (1 lookup total):**\n\n```typescript\nconst value = obj.config.settings.value;\nconst len = arr.length;\nfor (let i = 0; i < len; i++) {\n  process(value);\n}\n```\n","frontmatter":{"title":"Cache Property Access in Loops","impact":"LOW-MEDIUM","impactDescription":"reduces lookups","tags":"javascript, loops, optimization, caching"},"isInternal":false,"tokens":138,"sizeBytes":536},{"name":"js-cache-storage.md","path":".agents/skills/vercel-react-best-practices/rules/js-cache-storage.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Cache Storage API Calls\nimpact: LOW-MEDIUM\nimpactDescription: reduces expensive I/O\ntags: javascript, localStorage, storage, caching, performance\n---\n\n## Cache Storage API Calls\n\n`localStorage`, `sessionStorage`, and `document.cookie` are synchronous and expensive. Cache reads in memory.\n\n**Incorrect (reads storage on every call):**\n\n```typescript\nfunction getTheme() {\n  return localStorage.getItem(\"theme\") ?? \"light\";\n}\n// Called 10 times = 10 storage reads\n```\n\n**Correct (Map cache):**\n\n```typescript\nconst storageCache = new Map<string, string | null>();\n\nfunction getLocalStorage(key: string) {\n  if (!storageCache.has(key)) {\n    storageCache.set(key, localStorage.getItem(key));\n  }\n  return storageCache.get(key);\n}\n\nfunction setLocalStorage(key: string, value: string) {\n  localStorage.setItem(key, value);\n  storageCache.set(key, value); // keep cache in sync\n}\n```\n\nUse a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.\n\n**Cookie caching:**\n\n```typescript\nlet cookieCache: Record<string, string> | null = null;\n\nfunction getCookie(name: string) {\n  if (!cookieCache) {\n    cookieCache = Object.fromEntries(\n      document.cookie.split(\"; \").map((c) => c.split(\"=\")),\n    );\n  }\n  return cookieCache[name];\n}\n```\n\n**Important (invalidate on external changes):**\n\nIf storage can change externally (another tab, server-set cookies), invalidate cache:\n\n```typescript\nwindow.addEventListener(\"storage\", (e) => {\n  if (e.key) storageCache.delete(e.key);\n});\n\ndocument.addEventListener(\"visibilitychange\", () => {\n  if (document.visibilityState === \"visible\") {\n    storageCache.clear();\n  }\n});\n```\n","frontmatter":{"title":"Cache Storage API Calls","impact":"LOW-MEDIUM","impactDescription":"reduces expensive I/O","tags":"javascript, localStorage, storage, caching, performance"},"isInternal":false,"tokens":378,"sizeBytes":1666},{"name":"js-combine-iterations.md","path":".agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Combine Multiple Array Iterations\nimpact: LOW-MEDIUM\nimpactDescription: reduces iterations\ntags: javascript, arrays, loops, performance\n---\n\n## Combine Multiple Array Iterations\n\nMultiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.\n\n**Incorrect (3 iterations):**\n\n```typescript\nconst admins = users.filter((u) => u.isAdmin);\nconst testers = users.filter((u) => u.isTester);\nconst inactive = users.filter((u) => !u.isActive);\n```\n\n**Correct (1 iteration):**\n\n```typescript\nconst admins: User[] = [];\nconst testers: User[] = [];\nconst inactive: User[] = [];\n\nfor (const user of users) {\n  if (user.isAdmin) admins.push(user);\n  if (user.isTester) testers.push(user);\n  if (!user.isActive) inactive.push(user);\n}\n```\n","frontmatter":{"title":"Combine Multiple Array Iterations","impact":"LOW-MEDIUM","impactDescription":"reduces iterations","tags":"javascript, arrays, loops, performance"},"isInternal":false,"tokens":182,"sizeBytes":768},{"name":"js-early-exit.md","path":".agents/skills/vercel-react-best-practices/rules/js-early-exit.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Early Return from Functions\nimpact: LOW-MEDIUM\nimpactDescription: avoids unnecessary computation\ntags: javascript, functions, optimization, early-return\n---\n\n## Early Return from Functions\n\nReturn early when result is determined to skip unnecessary processing.\n\n**Incorrect (processes all items even after finding answer):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  let hasError = false;\n  let errorMessage = \"\";\n\n  for (const user of users) {\n    if (!user.email) {\n      hasError = true;\n      errorMessage = \"Email required\";\n    }\n    if (!user.name) {\n      hasError = true;\n      errorMessage = \"Name required\";\n    }\n    // Continues checking all users even after error found\n  }\n\n  return hasError ? { valid: false, error: errorMessage } : { valid: true };\n}\n```\n\n**Correct (returns immediately on first error):**\n\n```typescript\nfunction validateUsers(users: User[]) {\n  for (const user of users) {\n    if (!user.email) {\n      return { valid: false, error: \"Email required\" };\n    }\n    if (!user.name) {\n      return { valid: false, error: \"Name required\" };\n    }\n  }\n\n  return { valid: true };\n}\n```\n","frontmatter":{"title":"Early Return from Functions","impact":"LOW-MEDIUM","impactDescription":"avoids unnecessary computation","tags":"javascript, functions, optimization, early-return"},"isInternal":false,"tokens":264,"sizeBytes":1139},{"name":"js-flatmap-filter.md","path":".agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Use flatMap to Map and Filter in One Pass\nimpact: LOW-MEDIUM\nimpactDescription: eliminates intermediate array\ntags: javascript, arrays, flatMap, filter, performance\n---\n\n## Use flatMap to Map and Filter in One Pass\n\n**Impact: LOW-MEDIUM (eliminates intermediate array)**\n\nChaining `.map().filter(Boolean)` creates an intermediate array and iterates twice. Use `.flatMap()` to transform and filter in a single pass.\n\n**Incorrect (2 iterations, intermediate array):**\n\n```typescript\nconst userNames = users\n  .map((user) => (user.isActive ? user.name : null))\n  .filter(Boolean);\n```\n\n**Correct (1 iteration, no intermediate array):**\n\n```typescript\nconst userNames = users.flatMap((user) => (user.isActive ? [user.name] : []));\n```\n\n**More examples:**\n\n```typescript\n// Extract valid emails from responses\n// Before\nconst emails = responses\n  .map((r) => (r.success ? r.data.email : null))\n  .filter(Boolean);\n\n// After\nconst emails = responses.flatMap((r) => (r.success ? [r.data.email] : []));\n\n// Parse and filter valid numbers\n// Before\nconst numbers = strings.map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));\n\n// After\nconst numbers = strings.flatMap((s) => {\n  const n = parseInt(s, 10);\n  return isNaN(n) ? [] : [n];\n});\n```\n\n**When to use:**\n\n- Transforming items while filtering some out\n- Conditional mapping where some inputs produce no output\n- Parsing/validating where invalid inputs should be skipped\n","frontmatter":{"title":"Use flatMap to Map and Filter in One Pass","impact":"LOW-MEDIUM","impactDescription":"eliminates intermediate array","tags":"javascript, arrays, flatMap, filter, performance"},"isInternal":false,"tokens":353,"sizeBytes":1430},{"name":"js-hoist-regexp.md","path":".agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Hoist RegExp Creation\nimpact: LOW-MEDIUM\nimpactDescription: avoids recreation\ntags: javascript, regexp, optimization, memoization\n---\n\n## Hoist RegExp Creation\n\nDon't create RegExp inside render. Hoist to module scope or memoize with `useMemo()`.\n\n**Incorrect (new RegExp every render):**\n\n```tsx\nfunction Highlighter({ text, query }: Props) {\n  const regex = new RegExp(`(${query})`, 'gi')\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Correct (memoize or hoist):**\n\n```tsx\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nfunction Highlighter({ text, query }: Props) {\n  const regex = useMemo(\n    () => new RegExp(`(${escapeRegex(query)})`, 'gi'),\n    [query]\n  )\n  const parts = text.split(regex)\n  return <>{parts.map((part, i) => ...)}</>\n}\n```\n\n**Warning (global regex has mutable state):**\n\nGlobal regex (`/g`) has mutable `lastIndex` state:\n\n```typescript\nconst regex = /foo/g;\nregex.test(\"foo\"); // true, lastIndex = 3\nregex.test(\"foo\"); // false, lastIndex = 0\n```\n","frontmatter":{"title":"Hoist RegExp Creation","impact":"LOW-MEDIUM","impactDescription":"avoids recreation","tags":"javascript, regexp, optimization, memoization"},"isInternal":false,"tokens":281,"sizeBytes":1029},{"name":"js-index-maps.md","path":".agents/skills/vercel-react-best-practices/rules/js-index-maps.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Build Index Maps for Repeated Lookups\nimpact: LOW-MEDIUM\nimpactDescription: 1M ops to 2K ops\ntags: javascript, map, indexing, optimization, performance\n---\n\n## Build Index Maps for Repeated Lookups\n\nMultiple `.find()` calls by the same key should use a Map.\n\n**Incorrect (O(n) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  return orders.map((order) => ({\n    ...order,\n    user: users.find((u) => u.id === order.userId),\n  }));\n}\n```\n\n**Correct (O(1) per lookup):**\n\n```typescript\nfunction processOrders(orders: Order[], users: User[]) {\n  const userById = new Map(users.map((u) => [u.id, u]));\n\n  return orders.map((order) => ({\n    ...order,\n    user: userById.get(order.userId),\n  }));\n}\n```\n\nBuild map once (O(n)), then all lookups are O(1).\nFor 1000 orders × 1000 users: 1M ops → 2K ops.\n","frontmatter":{"title":"Build Index Maps for Repeated Lookups","impact":"LOW-MEDIUM","impactDescription":"1M ops to 2K ops","tags":"javascript, map, indexing, optimization, performance"},"isInternal":false,"tokens":237,"sizeBytes":850},{"name":"js-length-check-first.md","path":".agents/skills/vercel-react-best-practices/rules/js-length-check-first.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Early Length Check for Array Comparisons\nimpact: MEDIUM-HIGH\nimpactDescription: avoids expensive operations when lengths differ\ntags: javascript, arrays, performance, optimization, comparison\n---\n\n## Early Length Check for Array Comparisons\n\nWhen comparing arrays with expensive operations (sorting, deep equality, serialization), check lengths first. If lengths differ, the arrays cannot be equal.\n\nIn real-world applications, this optimization is especially valuable when the comparison runs in hot paths (event handlers, render loops).\n\n**Incorrect (always runs expensive comparison):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Always sorts and joins, even when lengths differ\n  return current.sort().join() !== original.sort().join();\n}\n```\n\nTwo O(n log n) sorts run even when `current.length` is 5 and `original.length` is 100. There is also overhead of joining the arrays and comparing the strings.\n\n**Correct (O(1) length check first):**\n\n```typescript\nfunction hasChanges(current: string[], original: string[]) {\n  // Early return if lengths differ\n  if (current.length !== original.length) {\n    return true;\n  }\n  // Only sort when lengths match\n  const currentSorted = current.toSorted();\n  const originalSorted = original.toSorted();\n  for (let i = 0; i < currentSorted.length; i++) {\n    if (currentSorted[i] !== originalSorted[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n```\n\nThis new approach is more efficient because:\n\n- It avoids the overhead of sorting and joining the arrays when lengths differ\n- It avoids consuming memory for the joined strings (especially important for large arrays)\n- It avoids mutating the original arrays\n- It returns early when a difference is found\n","frontmatter":{"title":"Early Length Check for Array Comparisons","impact":"MEDIUM-HIGH","impactDescription":"avoids expensive operations when lengths differ","tags":"javascript, arrays, performance, optimization, comparison"},"isInternal":false,"tokens":373,"sizeBytes":1754},{"name":"js-min-max-loop.md","path":".agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-min-max-loop.md -->","frontmatter":{"title":"Use Loop for Min/Max Instead of Sort","impact":"LOW","impactDescription":"O(n) instead of O(n log n)","tags":"javascript, arrays, performance, sorting, algorithms"},"isInternal":false,"tokens":597,"sizeBytes":2298},{"name":"js-request-idle-callback.md","path":".agents/skills/vercel-react-best-practices/rules/js-request-idle-callback.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-request-idle-callback.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-request-idle-callback.md -->","frontmatter":{"title":"Defer Non-Critical Work with requestIdleCallback","impact":"MEDIUM","impactDescription":"keeps UI responsive during background tasks","tags":"javascript, performance, idle, scheduling, analytics"},"isInternal":false,"tokens":598,"sizeBytes":2671},{"name":"js-set-map-lookups.md","path":".agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-set-map-lookups.md -->","frontmatter":{"title":"Use Set/Map for O(1) Lookups","impact":"LOW-MEDIUM","impactDescription":"O(n) to O(1)","tags":"javascript, set, map, data-structures, performance"},"isInternal":false,"tokens":154,"sizeBytes":532},{"name":"js-tosorted-immutable.md","path":".agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fjs-tosorted-immutable.md -->","frontmatter":{"title":"Use toSorted() Instead of sort() for Immutability","impact":"MEDIUM-HIGH","impactDescription":"prevents mutation bugs in React state","tags":"javascript, arrays, immutability, react, state, mutation"},"isInternal":false,"tokens":436,"sizeBytes":1783},{"name":"rendering-activity.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-activity.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-activity.md -->","frontmatter":{"title":"Use Activity Component for Show/Hide","impact":"MEDIUM","impactDescription":"preserves state/DOM","tags":"rendering, activity, visibility, state-preservation"},"isInternal":false,"tokens":131,"sizeBytes":566},{"name":"rendering-animate-svg-wrapper.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->","frontmatter":{"title":"Animate SVG Wrapper Instead of SVG Element","impact":"LOW","impactDescription":"enables hardware acceleration","tags":"rendering, svg, css, animation, performance"},"isInternal":false,"tokens":274,"sizeBytes":1121},{"name":"rendering-conditional-render.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-conditional-render.md -->","frontmatter":{"title":"Use Explicit Conditional Rendering","impact":"LOW","impactDescription":"prevents rendering 0 or NaN","tags":"rendering, conditional, jsx, falsy-values"},"isInternal":false,"tokens":257,"sizeBytes":938},{"name":"rendering-content-visibility.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-content-visibility.md -->","frontmatter":{"title":"CSS content-visibility for Long Lists","impact":"HIGH","impactDescription":"faster initial render","tags":"rendering, css, content-visibility, long-lists"},"isInternal":false,"tokens":205,"sizeBytes":818},{"name":"rendering-hoist-jsx.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hoist-jsx.md -->","frontmatter":{"title":"Hoist Static JSX Elements","impact":"LOW","impactDescription":"avoids re-creation","tags":"rendering, jsx, static, optimization"},"isInternal":false,"tokens":227,"sizeBytes":993},{"name":"rendering-hydration-no-flicker.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->","frontmatter":{"title":"Prevent Hydration Mismatch Without Flickering","impact":"MEDIUM","impactDescription":"avoids visual flicker and hydration errors","tags":"rendering, ssr, hydration, localStorage, flicker"},"isInternal":false,"tokens":467,"sizeBytes":2250},{"name":"rendering-hydration-suppress-warning.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->","frontmatter":{"title":"Suppress Expected Hydration Mismatches","impact":"LOW-MEDIUM","impactDescription":"avoids noisy hydration warnings for known differences","tags":"rendering, hydration, ssr, nextjs"},"isInternal":false,"tokens":189,"sizeBytes":852},{"name":"rendering-resource-hints.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-resource-hints.md -->","frontmatter":{"title":"Use React DOM Resource Hints","impact":"HIGH","impactDescription":"reduces load time for critical resources","tags":"rendering, preload, preconnect, prefetch, resource-hints"},"isInternal":false,"tokens":637,"sizeBytes":2704},{"name":"rendering-script-defer-async.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-script-defer-async.md -->","frontmatter":{"title":"Use defer or async on Script Tags","impact":"HIGH","impactDescription":"eliminates render-blocking","tags":"rendering, script, defer, async, performance"},"isInternal":false,"tokens":434,"sizeBytes":1894},{"name":"rendering-svg-precision.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-svg-precision.md -->","frontmatter":{"title":"Optimize SVG Precision","impact":"LOW","impactDescription":"reduces file size","tags":"rendering, svg, optimization, svgo"},"isInternal":false,"tokens":167,"sizeBytes":588},{"name":"rendering-usetransition-loading.md","path":".agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frendering-usetransition-loading.md -->","frontmatter":{"title":"Use useTransition Over Manual Loading States","impact":"LOW","impactDescription":"reduces re-renders and improves code clarity","tags":"rendering, transitions, useTransition, loading, state"},"isInternal":false,"tokens":457,"sizeBytes":2090},{"name":"rerender-defer-reads.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-defer-reads.md -->","frontmatter":{"title":"Defer State Reads to Usage Point","impact":"MEDIUM","impactDescription":"avoids unnecessary subscriptions","tags":"rerender, searchParams, localStorage, optimization"},"isInternal":false,"tokens":231,"sizeBytes":983},{"name":"rerender-dependencies.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-dependencies.md -->","frontmatter":{"title":"Narrow Effect Dependencies","impact":"LOW","impactDescription":"minimizes effect re-runs","tags":"rerender, useEffect, dependencies, optimization"},"isInternal":false,"tokens":214,"sizeBytes":833},{"name":"rerender-derived-state-no-effect.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->","frontmatter":{"title":"Calculate Derived State During Rendering","impact":"MEDIUM","impactDescription":"avoids redundant renders and state drift","tags":"rerender, derived-state, useEffect, state"},"isInternal":false,"tokens":282,"sizeBytes":1211},{"name":"rerender-derived-state.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-derived-state.md -->","frontmatter":{"title":"Subscribe to Derived State","impact":"MEDIUM","impactDescription":"reduces re-render frequency","tags":"rerender, derived-state, media-query, optimization"},"isInternal":false,"tokens":174,"sizeBytes":732},{"name":"rerender-functional-setstate.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-functional-setstate.md -->","frontmatter":{"title":"Use Functional setState Updates","impact":"MEDIUM","impactDescription":"prevents stale closures and unnecessary callback recreations","tags":"react, hooks, useState, useCallback, callbacks, closures"},"isInternal":false,"tokens":663,"sizeBytes":2989},{"name":"rerender-lazy-state-init.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-lazy-state-init.md -->","frontmatter":{"title":"Use Lazy State Initialization","impact":"MEDIUM","impactDescription":"wasted computation on every render","tags":"react, hooks, useState, performance, initialization"},"isInternal":false,"tokens":434,"sizeBytes":2021},{"name":"rerender-memo-with-default-value.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo-with-default-value.md -->","frontmatter":{"title":"Extract Default Non-primitive Parameter Value from Memoized Component to Constant","impact":"MEDIUM","impactDescription":"restores memoization by using a constant for default value","tags":"rerender, memo, optimization"},"isInternal":false,"tokens":248,"sizeBytes":1171},{"name":"rerender-memo.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-memo.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-memo.md -->","frontmatter":{"title":"Extract to Memoized Components","impact":"MEDIUM","impactDescription":"enables early returns","tags":"rerender, memo, useMemo, optimization"},"isInternal":false,"tokens":278,"sizeBytes":1158},{"name":"rerender-move-effect-to-event.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-move-effect-to-event.md -->","frontmatter":{"title":"Put Interaction Logic in Event Handlers","impact":"MEDIUM","impactDescription":"avoids effect re-runs and duplicate side effects","tags":"rerender, useEffect, events, side-effects, dependencies"},"isInternal":false,"tokens":285,"sizeBytes":1278},{"name":"rerender-no-inline-components.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-no-inline-components.md -->","frontmatter":{"title":"Don't Define Components Inside Components","impact":"HIGH","impactDescription":"prevents remount on every render","tags":"rerender, components, remount, performance"},"isInternal":false,"tokens":523,"sizeBytes":2142},{"name":"rerender-simple-expression-in-memo.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->","frontmatter":{"title":"Do not wrap a simple expression with a primitive result type in useMemo","impact":"LOW-MEDIUM","impactDescription":"wasted computation on every render","tags":"rerender, useMemo, optimization"},"isInternal":false,"tokens":217,"sizeBytes":1023},{"name":"rerender-split-combined-hooks.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-split-combined-hooks.md -->","frontmatter":{"title":"Split Combined Hook Computations","impact":"MEDIUM","impactDescription":"avoids recomputing independent steps","tags":"rerender, useMemo, useEffect, dependencies, optimization"},"isInternal":false,"tokens":421,"sizeBytes":1861},{"name":"rerender-transitions.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-transitions.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-transitions.md -->","frontmatter":{"title":"Use Transitions for Non-Urgent Updates","impact":"MEDIUM","impactDescription":"maintains UI responsiveness","tags":"rerender, transitions, startTransition, performance"},"isInternal":false,"tokens":241,"sizeBytes":1067},{"name":"rerender-use-deferred-value.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-deferred-value.md -->","frontmatter":{"title":"Use useDeferredValue for Expensive Derived Renders","impact":"MEDIUM","impactDescription":"keeps input responsive during heavy computation","tags":"rerender, useDeferredValue, optimization, concurrent"},"isInternal":false,"tokens":427,"sizeBytes":1863},{"name":"rerender-use-ref-transient-values.md","path":".agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->","frontmatter":{"title":"Use useRef for Transient Values","impact":"MEDIUM","impactDescription":"avoids unnecessary re-renders on frequent updates","tags":"rerender, useref, state, performance"},"isInternal":false,"tokens":437,"sizeBytes":1758},{"name":"server-after-nonblocking.md","path":".agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-after-nonblocking.md -->","frontmatter":{"title":"Use after() for Non-Blocking Operations","impact":"MEDIUM","impactDescription":"faster response times","tags":"server, async, logging, analytics, side-effects"},"isInternal":false,"tokens":454,"sizeBytes":2022},{"name":"server-auth-actions.md","path":".agents/skills/vercel-react-best-practices/rules/server-auth-actions.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-auth-actions.md -->","frontmatter":{"title":"Authenticate Server Actions Like API Routes","impact":"CRITICAL","impactDescription":"prevents unauthorized access to server mutations","tags":"server, server-actions, authentication, security, authorization"},"isInternal":false,"tokens":578,"sizeBytes":2659},{"name":"server-cache-lru.md","path":".agents/skills/vercel-react-best-practices/rules/server-cache-lru.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-lru.md -->","frontmatter":{"title":"Cross-Request LRU Caching","impact":"HIGH","impactDescription":"caches across requests","tags":"server, cache, lru, cross-request"},"isInternal":false,"tokens":326,"sizeBytes":1360},{"name":"server-cache-react.md","path":".agents/skills/vercel-react-best-practices/rules/server-cache-react.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-cache-react.md -->","frontmatter":{"title":"Per-Request Deduplication with React.cache()","impact":"MEDIUM","impactDescription":"deduplicates within request","tags":"server, cache, react-cache, deduplication"},"isInternal":false,"tokens":509,"sizeBytes":2241},{"name":"server-dedup-props.md","path":".agents/skills/vercel-react-best-practices/rules/server-dedup-props.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-dedup-props.md -->","frontmatter":{"title":"Avoid Duplicate Serialization in RSC Props","impact":"LOW","impactDescription":"reduces network payload by avoiding duplicate serialization","tags":"server, rsc, serialization, props, client-components"},"isInternal":false,"tokens":501,"sizeBytes":2065},{"name":"server-hoist-static-io.md","path":".agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-hoist-static-io.md -->","frontmatter":{"title":"Hoist Static I/O to Module Level","impact":"HIGH","impactDescription":"avoids repeated file/network I/O per request","tags":"server, io, performance, next.js, route-handlers, og-image"},"isInternal":false,"tokens":1038,"sizeBytes":4418},{"name":"server-parallel-fetching.md","path":".agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-fetching.md -->","frontmatter":{"title":"Parallel Data Fetching with Component Composition","impact":"CRITICAL","impactDescription":"eliminates server-side waterfalls","tags":"server, rsc, parallel-fetching, composition"},"isInternal":false,"tokens":365,"sizeBytes":1569},{"name":"server-parallel-nested-fetching.md","path":".agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-parallel-nested-fetching.md -->","frontmatter":{"title":"Parallel Nested Data Fetching","impact":"CRITICAL","impactDescription":"eliminates server-side waterfalls","tags":"server, rsc, parallel-fetching, promise-chaining"},"isInternal":false,"tokens":235,"sizeBytes":1001},{"name":"server-serialization.md","path":".agents/skills/vercel-react-best-practices/rules/server-serialization.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/rules/server-serialization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2Frules%2Fserver-serialization.md -->","frontmatter":{"title":"Minimize Serialization at RSC Boundaries","impact":"HIGH","impactDescription":"reduces data transfer size","tags":"server, rsc, serialization, props"},"isInternal":false,"tokens":242,"sizeBytes":1006},{"name":"SKILL.md","path":".agents/skills/vercel-react-best-practices/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/.agents/skills/vercel-react-best-practices/SKILL.md","title":"vercel-react-best-practices","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=.agents%2Fskills%2Fvercel-react-best-practices%2FSKILL.md -->","frontmatter":{"name":"vercel-react-best-practices","description":"React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","license":"MIT","metadata":{"author":"vercel","version":"1.0.0"}},"isInternal":false,"tokens":1717,"sizeBytes":7150},{"name":"SKILL.md","path":"skills/mediago/SKILL.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/skills/mediago/SKILL.md","title":"mediago","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=skills%2Fmediago%2FSKILL.md -->","frontmatter":{"name":"mediago","description":"Download videos from m3u8/HLS streams, Bilibili, and direct URLs using MediaGo. 下载视频、m3u8直播流、B站视频。 Triggers on: download video, 下载视频, 下载这个链接, 帮我下载, m3u8 download, 设置mediago地址, configure mediago, mediago api key. Requires a running MediaGo instance (desktop app or Docker).\n","license":"MIT","metadata":{"author":"caorushizi","version":"1.0.0","homepage":"https://github.com/caorushizi/mediago"}},"isInternal":false,"tokens":1416,"sizeBytes":4865},{"name":"api.md","path":"docs/api.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/docs/api.md","title":"docs - API Interface Contract & Specifications","category":"project-spec","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=docs%2Fapi.md -->","frontmatter":{"layout":"doc","outline":"deep"},"isInternal":false,"tokens":3233,"sizeBytes":10333},{"name":"README.md","path":"packages/core-sdk/README.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/packages/core-sdk/README.md","title":"core-sdk Documentation","category":"plugin-manifest","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fcore-sdk%2FREADME.md -->","isInternal":false,"tokens":58,"sizeBytes":227},{"name":"README.md","path":"packages/electron-preload/README.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/packages/electron-preload/README.md","title":"electron-preload Documentation","category":"plugin-manifest","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Felectron-preload%2FREADME.md -->","isInternal":false,"tokens":278,"sizeBytes":1289},{"name":"README.md","path":"packages/mediago-extension/README.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/packages/mediago-extension/README.md","title":"mediago-extension Documentation","category":"plugin-manifest","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fmediago-extension%2FREADME.md -->","isInternal":false,"tokens":911,"sizeBytes":3639},{"name":"README.md","path":"packages/node-service/README.md","rawUrl":"https://raw.githubusercontent.com/caorushizi/mediago/HEAD/packages/node-service/README.md","title":"node-service Documentation","category":"plugin-manifest","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/caorushizi/mediago?path=packages%2Fnode-service%2FREADME.md -->","isInternal":false,"tokens":58,"sizeBytes":227}],"systemPromptSnippet":"<yakaai_skills repo=\"caorushizi/mediago\">\n<!-- File: AGENTS.md (Tokens: ~1140 | Category: root-instruction) -->\n# Repository Guidelines\n\n## Project Structure & Module Organization\n\nMediaGo is a pnpm/turborepo monorepo registered in `one.manifest.toml`. Feature apps live in `apps/` (`core` for the Go backend, `electron` for desktop, `ui` for the shared frontend, `player-ui` for playback). Reusable logic stays in `packages/`, including `common`, `core-sdk`, `electron-preload`, and `tooling`. Long-form docs and assets sit in `docs/`, `images/`, and `docker/`. End-to-end checks live in `tests/`.\n\n## Tooling and Script Placement\n\nRepository automation is centralized in `packages/tooling`.\n\n- Do not create app-local or package-local `scripts/` directories.\n- Put build, development, release, migration, code-generation, and verification entrypoints under `packages/tooling/src/<domain>/` and invoke them from `Taskfile.yml` or package scripts.\n- Before adding a new tooling entrypoint, search `packages/tooling` and extend an existing domain module when practical.\n- Keep product runtime code in its owning app or package; this rule applies to repository automation and one-off executable tooling, not application features.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Its contents are packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Build, Test, and Development Commands\n\nUse One CLI 0.1.24 or newer. On a new clone, review `mise.toml`, run `one mise trust`, `one mise install`, then `one setup`. Use `one dev` for desktop + Web, or `one dev:web` / `one dev:electron` for one surface. Use `one build -p core`, `one build -p electron`, `one build -p docs`, and `one build:docker` for the corresponding targets. `one check` runs lint, formatting and type checks; `one test` runs the TypeScript and Go suites. `mise.toml` pins tool versions and delegates product workflows to the existing Taskfile; CI continues to use Task. After changing project scripts, run `one init mise`, review the diff, and run `pnpm one:verify`. Keep `pnpm format` as the formatting command before commits.\n\n## Coding Style & Naming Conventions\n\nTarget modern TypeScript with ES modules, two-space indentation, UTF-8, and LF endings per `.editorconfig`. Components, hooks, and services adopt PascalCase (e.g. `UserPreferencesPanel.tsx`). Utilities and helpers stay camelCase, and constants use SCREAMING_SNAKE_CASE. Always run `pnpm format` before committing; reserve comments for clarifying complex logic.\n\n## UI Interaction and Cursor Semantics\n\nMouse cursors must communicate what an element will do. Define cursor behavior in shared UI primitives whenever possible so every consumer inherits it.\n\n| Interaction                                                                      | Cursor                                    |\n| -------------------------------------------------------------------------------- | ----------------------------------------- |\n| Enabled buttons, links, menu items, select options, toggles, and clickable cards | pointer                                   |\n| Disabled or unavailable controls                                                 | not-allowed                               |\n| Editable text                                                                    | text                                      |\n| Draggable content                                                                | grab, changing to grabbing while dragging |\n| Horizontal or vertical resize handles                                            | col-resize or row-resize                  |\n| Work continuing in the background                                                | progress                                  |\n| Blocking work where the UI cannot accept input                                   | wait                                      |\n| Non-interactive content                                                          | default                                   |\n\nDo not use cursor-default on an enabled interactive element. Avoid pointer-events: none on disabled controls when it prevents the not-allowed cursor from being shown; use native disabled, aria-disabled, or the component library's disabled state to block the action. Cursor styling does not replace semantic HTML, keyboard interaction, focus states, or accessible names.\n\n## Testing Guidelines\n\nTypeScript suites use Vitest through `one test:ts`; Go suites use `one test:go`. Integration and Playwright checks use `one test:integration` and `one test:e2e`. Name files descriptively like `download.queue.integration.test.ts`. Mock external services, prefer shared fixtures in `tests/fixtures/`, and cover happy path, recovery, and edge behaviors when touching runtime code.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commits (e.g. `feat(frontend-main): add download queue UI`) and use `pnpm commit` (Commitizen) to stay compliant. Pull requests should summarize the change, link issues with `Closes #123`, note local test runs (`pnpm test`), and attach screenshots or recordings for UI updates. Call out new environment variables, migrations, or follow-up tasks so reviewers can reproduce the setup quickly.\n\n<!-- File: docs/skills.md (Tokens: ~766 | Category: root-instruction) -->\n---\nlayout: doc\noutline: deep\n---\n\n# OpenClaw Skill\n\nMediaGo 提供了 [OpenClaw](https://docs.openclaw.ai) Skill，让你可以在 AI 编程助手中通过自然语言下载视频。通过 [ClawHub](https://clawhub.com) 安装即可使用。\n\n## 前提条件\n\n- 已安装并运行 MediaGo（桌面客户端或 Docker）\n- 已安装支持 OpenClaw 的 AI 编程助手（如 Claude Code、Cursor 等）\n\n## 安装 Skill\n\n在终端中执行以下命令，从 ClawHub 安装 mediago skill：\n\n```bash\nnpx clawhub@latest install mediago\n```\n\n## 初始化配置\n\n安装完成后，需要告诉 AI 助手你的 MediaGo 服务地址。\n\n### 桌面客户端\n\n在 AI 助手中直接发送：\n\n```\n设置 mediago 地址为 http://192.168.x.x:39719\n```\n\n::: tip\n你可以在 MediaGo 桌面客户端的 **设置 → Skills 设置** 中找到已生成的配置命令，一键复制粘贴即可。\n:::\n\n### Docker\n\nDocker 部署启用了 API 认证，需要同时配置地址和 API Key：\n\n```\n设置 mediago 地址为 http://localhost:8899，api key 为 你的APIKey\n```\n\n::: tip\nAPI Key 可以在 MediaGo Web 界面的 **设置 → 更多设置** 中查看。\n:::\n\n## 使用方式\n\n配置完成后，你可以用自然语言下载视频：\n\n```\n帮我下载这个视频 https://example.com/video.m3u8\n```\n\n```\n下载这个B站视频 https://www.bilibili.com/video/BV1xxxxxxxx\n```\n\n```\ndownload this video https://example.com/stream.m3u8\n```\n\nSkill 会自动：\n\n1. 识别视频类型（m3u8 / B站 / 直链）\n2. 创建下载任务并开始下载\n3. 实时报告下载进度\n4. 下载完成后告诉你文件保存位置\n\n## 支持的视频类型\n\n| 类型     | 说明       | URL 示例                                |\n| -------- | ---------- | --------------------------------------- |\n| m3u8     | HLS 流媒体 | `https://example.com/video.m3u8`        |\n| bilibili | B站视频    | `https://www.bilibili.com/video/BVxxxx` |\n| direct   | 直链下载   | `https://example.com/video.mp4`         |\n\n## 其他命令\n\n你还可以用自然语言管理下载：\n\n- \"查看下载列表\" / \"list downloads\"\n- \"查看下载状态\" / \"check download status\"\n- \"修改 mediago 地址\" / \"update mediago url\"\n\n## 常见问题\n\n### 提示连接不上 MediaGo\n\n请确认：\n\n1. MediaGo 服务已启动\n2. 配置的地址和端口正确\n3. 如果是 Docker，确认端口映射正确（默认 8899）\n\n### 提示 API Key 错误\n\n发送以下命令更新：\n\n```\n设置 mediago api key 为 你的新APIKey\n```\n\n<!-- File: CLAUDE.md (Tokens: ~1468 | Category: claude-rule) -->\n# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMediaGo is a cross-platform video downloader supporting m3u8/HLS streams. The codebase is a pnpm monorepo with two delivery products:\n\n1. **Desktop app** (`apps/electron` + `apps/ui`) — Electron wrapper that launches Go Core as a subprocess\n2. **Docker Web app** (`apps/core` + `apps/ui`) — Docker runs Go Core directly; the main UI is embedded in the Core binary\n\nThe Player UI (`apps/player-ui`) is also embedded in every Core binary. Electron Core serves `/player/` but suppresses the embedded main UI because Electron owns the main renderer.\n\n## Documentation Site Safety\n\n`docs/` is the production VitePress source directory. Everything placed there can be packaged and deployed to the public documentation site.\n\n- Never create agent planning or working artifacts anywhere under `docs/`. This includes `docs/plans/`, `docs/superpowers/`, design or implementation plans, audit reports, task logs, handoff notes, scratch Markdown, generated prompts, and session notes.\n- Only add or edit files under `docs/` when they are intentional public documentation, documentation assets, VitePress source/configuration, or tests required for the documentation site.\n- Store persistent internal planning artifacts under `.agents/plans/`. Store disposable artifacts in the system temporary directory.\n- This rule overrides any skill, tool, or template that defaults to writing plans under `docs/` or `docs/plans/`.\n- Before finishing a task that touches documentation, inspect `git status --short -- docs` and remove accidental internal artifacts without deleting legitimate documentation content.\n\n## Common Commands\n\n```bash\npnpm install                # Install all dependencies (run once per clone)\ntask dev:electron           # Start Electron desktop dev environment (HMR)\ntask dev:web                # Start Web Core directly plus the Vite UI\ntask build:electron         # Production build for Electron\ntask build:docker           # Build the deployable Web image\npnpm core:dev               # Start Go Core dev server (port 9900)\npnpm core:build             # Compile Go Core binary\npnpm player:dev             # Start Player dev (alias for core:dev)\npnpm player:build           # Build Player (alias for core:build)\npnpm deps:download          # Download third-party tools (ffmpeg, BBDown, etc.)\npnpm deps:download:all      # Download tools for all platforms\npnpm lint                   # Lint with oxlint\npnpm lint:fix               # Auto-fix lint issues\npnpm format                 # Format with oxfmt\npnpm format:check           # Check formatting without modifying\npnpm check                  # Full check: lint + format + type check\npnpm type:check             # TypeScript type checking via Turborepo\npnpm pack:electron          # Build + package Electron distributable\n```\n\nCommits use Conventional Commits format (e.g. `feat(electron): add queue UI`).\n\n## Architecture\n\n### Monorepo Layout\n\n**Apps:**\n\n- **`apps/core/`** — Go (Gin) REST API backend for download orchestration. Runs on port 9900. Uses SQLite (GORM), SSE for real-time events, PTY for capturing download tool output, and embeds both browser UIs through `//go:embed`.\n- **`apps/electron/`** — Electron main process (tsdown build, inversify DI). Launches Go Core via `@mediago/service-runner`.\n- **`apps/ui/`** — Shared React 19 frontend (Vite 8, Ant Design 6, Zustand, TailwindCSS 4, i18next). Used by both Electron and server targets.\n- **`apps/player-ui/`** — React 19 frontend for player (Vite 8, shadcn/ui, video.js, TailwindCSS 4). Built assets are embedded into Go Core via `//go:embed`.\n\n**Packages:**\n\n- **`packages/common/`** — Platform-agnostic shared types, constants, and utilities\n- **`packages/core-sdk/`** — TypeScript SDK for Go Core REST API (Axios, SSE via eventsource)\n- **`packages/electron-preload/`** — Electron preload scripts for IPC bridge\n- **`packages/browser-extension/`** — Browser extension (Lit web components)\n- **`docs/`** — VitePress documentation (Chinese, English, Japanese)\n\n### Multi-Target Build\n\nThe `APP_TARGET` env var (`electron` | `server`) controls which backend the UI builds against. Both targets share the same React UI but connect via different transports:\n\n- **Electron**: IPC bridge (preload) + Go Core direct (via `@mediago/core-sdk`)\n- **Server/Web**: HTTP/WebSocket + Go Core direct (via `@mediago/core-sdk`)\n\nThe UI adapter layer (`apps/ui/src/hooks/adapters/`) abstracts this: `electron.ts` provides IPC bridge in desktop mode, `platform-stubs.ts` provides no-op stubs in web mode, and `index.ts` exports `platformApi` which selects the appropriate adapter.\n\n### Key Patterns\n\n- **Go Core lifecycle**: Electron launches Core via `@mediago/service-runner`; Task and Docker execute Core directly for Web usage\n- **Dependency Injection**: inversify with `@inversifyjs/binding-decorators` in Electron backend\n- **State Management**: Zustand in the UI\n- **Real-time events**: Go Core emits SSE events (`/api/events`); the UI's `api/events.ts` subscribes and dispatches to React via a listener pattern\n- **TypeScript**: Strict mode with experimental decorators and decorator metadata enabled\n- **Module format**: ES Modules everywhere\n\n## Tooling\n\n- **Package manager**: pnpm 10.15.0 (enforced via `packageManager` field)\n- **Build orchestration**: Turborepo\n- **App bundling**: tsdown for Node/Electron, Vite 8 for UI apps\n- **Go builds**: Task and pnpm invoke `packages/tooling/src/core-build/cli.ts`, which orchestrates `go build` / `go run` in `apps/core`\n- **Linter**: oxlint (config in `.oxlintrc.json`)\n- **Formatter**: oxfmt (config in `.oxfmtrc.json`)\n- **Pre-commit**: husky + lint-staged (runs oxlint --fix + oxfmt --write on staged files)\n- **Electron packaging**: electron-builder\n\n## Style Conventions\n\n- TypeScript, ES modules, 2-space indentation, UTF-8, LF endings\n- Components: PascalCase. Utilities: camelCase. Constants: SCREAMING_SNAKE_CASE\n- UI port: 8555 (strict). Go Core port: 9900. Player UI port: 8556\n\n<!-- File: .github/copilot-instructions.md (Tokens: ~651 | Category: copilot-instructions) -->\n# GitHub Copilot Instruction: Code Review and Optimization\n\n## Role and Objective\n\nYou are a **top-tier software architect and performance optimization expert**.  \nYour goal is to help me — a senior TypeScript full-stack engineer — elevate the quality of my code to a new level.  \nWhen reviewing my code, **do not explain basic concepts**. I need **precise, deep, and forward-thinking insights**.\n\nYour core mission is **optimization**, including but not limited to:\n\n- **Performance improvement**: Identify and optimize performance bottlenecks, reduce unnecessary computation and resource consumption.\n- **Code refactoring**: Suggest more elegant and efficient implementations to improve code structure.\n- **Design patterns**: Identify opportunities to apply or refine design patterns to enhance scalability and maintainability.\n- **Best practices**: Ensure the code adheres to the latest best practices for the TypeScript ecosystem (Node.js, React, API layers, build pipelines).\n- **Potential risks**: Anticipate and highlight deep issues such as concurrency problems, security vulnerabilities, or resource leaks.\n\n---\n\n## Review Perspective and Principles\n\n1. **High-Standard Review**  \n   Review the code as if it were going to **production for millions of users** and needs to be **maintained long-term**.\n\n2. **Deep Analysis, Not Surface Advice**  \n   Don’t focus on trivial issues like typos or syntax sugar.  \n   Instead, explain **why** a refactor or change matters — e.g.:\n\n   > “Switching from a synchronous file read to `fs.promises` can free the event loop, improving throughput under load.”\n\n3. **Performance First**\n   - Evaluate time and space complexity; suggest algorithmic or structural improvements.\n   - Examine I/O, database queries, and network calls for efficiency — recommend batching, caching, or async processing.\n   - Recommend appropriate data structures or API strategies for scalability (e.g., pagination, streaming responses).\n\n4. **Architecture and Design**\n   - Follow **SOLID** principles. Explicitly identify violations and propose refactoring approaches.\n   - Encourage **composition over inheritance** and **dependency injection**.\n   - Suggest modularization and clear separation between layers (e.g., API, service, repository, UI).\n\n5. **Code Style and Standards**\n   - Code must be clear, consistent, and self-explanatory.\n   - Follow the project’s existing conventions unless the change brings substantial clarity or performance gain.\n   - For complex logic, suggest adding comments explaining the **rationale (“why”)**, not just the **action (“what”)**.\n\n---\n\n## Specific Instructions\n\n- **When reviewing code, include the optimized code snippet directly**, with short comments highlighting key changes and their reasoning.\n- **If you find potential bugs or unhandled edge cases**, explicitly point them out and provide a fix suggestion.\n- **Avoid subjective stylistic comments** unless they impact clarity, performance, or maintainability.\n- **When I ask “Can this code be optimized?”**, provide a holistic evaluation covering performance, readability, scalability, and maintainability.\n\n---\n\nAt the end of every response, please add:\n\n> “AI-generated suggestions may contain errors; use your own judgment when applying them.”\n\n<!-- File: .agents/skills/brandkit/SKILL.md (Tokens: ~3777 | Category: anthropic-skill) -->\n---\nname: brandkit\ndescription: Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.\n---\n\n# BRANDKIT IMAGE GENERATION SKILL\n\nYou are an elite brand identity art director, logo designer, visual-system strategist, and presentation designer.\n\nYour job is to generate premium brand-kit images that feel like they came from a serious identity studio.\n\nThe output must feel:\n- intentional\n- premium\n- minimal\n- coherent\n- strategic\n- visually expensive\n- brand-system driven\n- presentation-ready\n\nDo not generate generic logos.  \nDo not generate random mockups.  \nDo not generate messy AI moodboards.\n\nCreate a complete brand world in one image.\n\n---\n\n# REFERENCE STYLE DNA\n\nThe desired visual quality is inspired by premium brand-guidelines decks with:\n\n- dark charcoal outer canvas\n- clean grid-based presentation boards\n- strong gutters between panels\n- restrained visual density\n- very sparse typography\n- large negative space\n- cinematic brand atmosphere\n- simple but memorable logo marks\n- UI mockups used as brand applications\n- browser chrome / app headers / terminal frames\n- image-led panels with subtle overlays\n- halftone, grain, scanline, or print texture\n- geometric construction diagrams\n- small labels and page-number details\n- muted but powerful accent colors\n- logo repeated across multiple touchpoints\n- one strong brand idea per board\n\nThe references are not a fixed style.  \nThey define the quality bar, restraint, and presentation logic.\n\n---\n\n# CORE PRINCIPLE\n\nA premium brand kit is not decoration.\n\nIt is a visual argument for why the brand exists.\n\nEvery generated board must answer:\n\n1. What does this brand represent?\n2. What is the core metaphor?\n3. How does the logo express that?\n4. How does the system scale across UI, print, image, and detail?\n5. Why does the whole thing feel ownable?\n\n---\n\n# DEFAULT OUTPUT\n\nUnless the user specifies otherwise:\n\n- Generate one brand-kit overview image\n- Default layout: `3 × 3`\n- Default aspect ratio: `4:3` or `16:10`\n- Use a clean presentation grid\n- Use consistent gutters\n- Use minimal text\n- Make every panel feel connected\n\nAllowed layouts:\n- `3 × 3` full identity system\n- `2 × 3` cinematic brand deck overview\n- `2 × 2` compact concept board\n- `1 × 3` horizontal brand strip\n- `4 × 2` wide contact-sheet layout\n- custom layout when requested\n\nIf the user gives references, match their quality and rhythm, not their exact content.\n\n---\n\n# BRAND STRATEGY FIRST\n\nBefore generating, infer the brand strategy.\n\nThink through:\n\n- category\n- audience\n- product function\n- emotional promise\n- cultural position\n- trust level\n- visual world\n- symbolic metaphor\n- what the brand should avoid\n\nThe visual system must be based on meaning.\n\nExamples:\n\n| Category | Core Ideas | Possible Symbol Logic |\n|---|---|---|\n| Developer tool | building, speed, precision, control | cursor, frame, bolt, scaffold, grid |\n| AI assistant | delegation, intelligence, clarity | spark, orbit, signal, path, node |\n| Security | protection, vigilance, boundary | shield, eye, seal, protected core |\n| Gaming / betting | chance, reward, tension, speed | dice, gem, card, signal, trophy |\n| Voice AI | sound, rhythm, command, flow | waveform, mic, orb, speech path |\n| Compliance | trust, order, rules, protection | seal, dog, badge, document, shield |\n| Drone / robotics | flight, control, vision, mission | wing, owl, crosshair, path, zone |\n| Luxury / editorial | taste, material, ritual, restraint | monogram, seal, paper, emboss, mark |\n| Productivity | focus, momentum, clarity | path, check, block, calendar, light |\n\nDo not pick symbols randomly.\n\n---\n\n# LOGO GENERATION STANDARD\n\nThe logo must be professional.\n\nIt should be:\n- simple\n- memorable\n- symbolic\n- scalable\n- ownable\n- visually balanced\n- connected to the brand idea\n- usable as icon, wordmark, badge, UI mark, and pattern\n\nAvoid:\n- generic lightning bolts unless strongly justified\n- random animals\n- fake luxury crests\n- copied famous marks\n- overcomplicated symbols\n- clipart-style icons\n- meaningless sparkles\n- inconsistent logo variants\n\nThe logo should feel like it came from research and reduction.\n\n---\n\n# LOGO CONCEPT METHODS\n\nUse one or combine two maximum.\n\n## 1. Monogram + Meaning\n\nCombine the brand initial with a metaphor.\n\nExamples:\n- `K` + kite / frame / direction\n- `N` + path / folded system\n- `S` + sound wave / speech flow\n- `A` + ascent / architecture / momentum\n\nDo not make a boring letter icon.  \nUse negative space, cuts, folds, or geometry.\n\n---\n\n## 2. Product Action\n\nTurn the product's main action into a symbol.\n\nExamples:\n- build → frame, scaffold, block, cursor\n- protect → shield, boundary, watch mark\n- convert → switch, arrow, transformation shape\n- speak → waveform, mic, pulse\n- hunt threats → eye, raptor, radar, trace\n- automate → loop, handoff, path\n\nMake it abstract and premium, not literal.\n\n---\n\n## 3. Metaphor Fusion\n\nCombine two meaningful ideas into one reduced mark.\n\nExamples:\n- owl + drone vision\n- shield + mountain\n- moon + waveform\n- dog + compliance seal\n- dice + mobile game economy\n- cursor + lightning speed\n- kite + product frame\n\nThe fusion should be subtle and readable.\n\n---\n\n## 4. Negative Space\n\nUse empty space to create intelligence.\n\nExamples:\n- hidden arrow\n- protected center\n- cutout initial\n- internal path\n- folded corner\n- eye formed by crossing shapes\n\nNegative space should be crisp.\n\n---\n\n## 5. Construction Geometry\n\nCreate a mark from a clear system.\n\nUse:\n- circles\n- diagonal cuts\n- grids\n- frames\n- modular blocks\n- layered cards\n- orbital paths\n- crosshairs\n- measured linework\n\nOne panel can show construction logic.\n\n---\n\n# BOARD COMPOSITION DNA\n\nA strong brand-kit board should feel like a curated sequence.\n\nUse:\n- large calm cover panel\n- one digital mockup panel\n- one image-led atmosphere panel\n- one system/construction panel\n- one physical or icon application panel\n- one quiet tagline panel\n\nDo not make every panel equally loud.\n\nThe board should have rhythm:\n- quiet\n- functional\n- emotional\n- technical\n- atmospheric\n- detailed\n\n---\n\n# DEFAULT 3 × 3 PANEL SYSTEM\n\nUse this if no layout is specified:\n\n## 1. Logo Cover\nLarge logo and wordmark.  \nMinimal title.  \nStrong negative space.\n\n## 2. Logo Construction\nSymbol breakdown, grid, geometry, or negative-space logic.  \nShow why the mark exists.\n\n## 3. Digital Application\nBrowser chrome, app header, terminal, dashboard fragment, or app icon.\n\n## 4. Brand Essence\nOne short tagline.  \nLarge readable typography.  \nSparse composition.\n\n## 5. Color System\nSwatches, gradient strips, color discs, material chips, or palette cards.\n\n## 6. Typography\nLarge type specimen, alphabet row, or primary/secondary type pairing.\n\n## 7. Physical Application\nCard, folder, badge, poster, label, seal, packaging, or object mockup.\n\n## 8. Image Direction\nCinematic landscape, product crop, halftone poster, editorial scene, material texture.\n\n## 9. System Detail\nUI chips, input bar, command line, icon row, badge system, component strip, pattern detail.\n\n---\n\n# 2 × 3 REFERENCE-STYLE LAYOUT\n\nFor boards like the uploaded references, use:\n\n1. **Logo / Wordmark**\n   - centered or offset\n   - extremely minimal\n\n2. **Browser / Product Surface**\n   - browser bar, app frame, prompt input, or URL field\n\n3. **Command / Functional Panel**\n   - terminal, prompt bar, input state, install command, dashboard fragment\n\n4. **Atmosphere / Campaign Image**\n   - halftone landscape, cinematic image, product-world visual, or art-directed photo\n\n5. **Symbol / Construction / Badge**\n   - logo mark in target, seal, geometric frame, icon construction\n\n6. **Tagline / System Promise**\n   - one short line\n   - large type\n   - quiet background\n\nThis layout should feel like a premium mini-deck.\n\n---\n\n# VISUAL MODES\n\nChoose based on the brand.\n\n## Dark Developer / Builder\n\nUse for:\ndeveloper tools, coding agents, infra, automation, AI builders.\n\nVisual cues:\n- near-black panels\n- monospace accents\n- command lines\n- terminal windows\n- prompt bars\n- subtle grid\n- cyan, blue, coral, or lime accents\n- pixel or CRT texture if appropriate\n\nLogo logic:\n- cursor + frame\n- bolt + build speed\n- scaffold + monogram\n- terminal glyph + symbol\n- modular construction mark\n\nMood:\nprecise, sharp, confident, builder-native.\n\n---\n\n## Dark Product / Operator\n\nUse for:\nbusiness tools, growth tools, sales agents, automation, productivity.\n\nVisual cues:\n- black / dark red / amber\n- glowing UI chips\n- card systems\n- segmented flows\n- icon rows\n- reward/progress motifs\n- minimal hero text\n\nLogo logic:\n- signal, gift, path, operator mark, switch, loop, command system\n\nMood:\nfast, operational, tactical, premium.\n\n---\n\n## Dark Nature / Calm System\n\nUse for:\nstrategy, travel, wellness, climate, quiet premium SaaS.\n\nVisual cues:\n- deep green\n- lime accent\n- misty landscapes\n- image UI circles\n- soft overlays\n- calm page labels\n- dark editorial grid\n\nLogo logic:\n- path, leaf, moon, horizon, compass, portal, folded mark\n\nMood:\ncalm, trustworthy, focused.\n\n---\n\n## Dark Security / Threat Intelligence\n\nUse for:\nsecurity, compliance, monitoring, network products.\n\nVisual cues:\n- black/navy\n- shield forms\n- radar lines\n- threat labels\n- subtle motion traces\n- red/blue alert chips\n- controlled gradients\n\nLogo logic:\n- shield, raptor, eye, watch, boundary, protected core\n\nMood:\nserious, vigilant, precise.\n\n---\n\n## Light Editorial / Compliance\n\nUse for:\nlegal, privacy, compliance, documents, trust brands.\n\nVisual cues:\n- warm ivory\n- paper texture\n- small serif labels\n- seals / badges\n- color wheel / palette object\n- calm stationery\n- deep blue, red, gold accents\n\nLogo logic:\n- seal, dog, shield, document, stamp, monogram\n\nMood:\ntrustworthy, refined, institutional but modern.\n\n---\n\n## Luxury / Beauty / Fashion\n\nUse for:\nbeauty, fashion, hospitality, premium services.\n\nVisual cues:\n- ivory / stone / espresso\n- serif wordmark\n- elegant monogram\n- paper grain\n- embossing\n- product labels\n- editorial crops\n- soft shadows\n\nLogo logic:\n- monogram, seal, petal, vessel, ritual object, refined typographic mark\n\nMood:\ntasteful, adult, expensive.\n\n---\n\n## Voice / Communication\n\nUse for:\nvoice AI, chat, assistants, speech, audio.\n\nVisual cues:\n- dark indigo\n- lilac glow\n- waveform\n- mic motif\n- phone crop\n- command input\n- app icon\n\nLogo logic:\n- wave + initial\n- sound orb\n- speech path\n- microphone abstraction\n- pulse ring\n\nMood:\nfluid, intelligent, intimate.\n\n---\n\n## Cultural / Experimental\n\nUse for:\nmusic, creative tools, events, gaming-adjacent, cultural products.\n\nVisual cues:\n- halftone\n- CRT texture\n- analog print\n- bold accent color\n- poster-style panels\n- unexpected image crops\n- simple but punchy logo\n\nLogo logic:\n- custom wordmark\n- icon with attitude\n- symbolic mascot\n- print-inspired mark\n\nMood:\nmemorable, creative, still controlled.\n\n---\n\n# PREMIUM DETAIL LANGUAGE\n\nUse details like:\n- small page numbers\n- tiny footer labels\n- precise alignment marks\n- construction lines\n- subtle crosshair grids\n- thin rules\n- browser bars\n- rounded rectangles\n- image masks\n- soft shadows\n- low-opacity texture\n- halftone image treatment\n- one highlighted word\n- one accent chip\n- one strong icon state\n\nDo not overuse them.\n\nPremium detail should reward looking closer.\n\n---\n\n# TEXT RULES\n\nUse very little text.\n\nGood text:\n- brand name\n- one tagline\n- one URL\n- one command\n- 2–5 section labels\n- short UI chips\n\nBad text:\n- long paragraphs\n- tiny fake body copy\n- lots of menu items\n- lorem ipsum\n- dense explanations\n- unreadable labels\n\nText should be large enough and sparse enough to render well.\n\n---\n\n# TAGLINE STYLE\n\nTaglines should be short and specific.\n\nGood:\n- \"What will you build today?\"\n- \"Nothing random.\"\n- \"Your network. Our watch.\"\n- \"Build better.\"\n- \"On guard.\"\n- \"Every mission under control.\"\n- \"Everything operators need.\"\n- \"Clarity builds confidence.\"\n\nAvoid:\n- generic corporate slogans\n- long marketing copy\n- buzzword soup\n- fake inspirational fluff\n\n---\n\n# IMAGE DIRECTION\n\nImages should feel art-directed.\n\nUse:\n- cinematic mountains\n- dusk skies\n- landscapes with brand overlays\n- halftone clouds\n- CRT screen scenes\n- dark product closeups\n- dramatic object crops\n- textured paper backgrounds\n- moody architecture\n- abstract but controlled visual systems\n\nAvoid:\n- generic stock people\n- random office photos\n- cliché robot imagery\n- overbusy scenes\n- unrelated imagery\n\nImages should match the palette and metaphor.\n\n---\n\n# MOCKUP DIRECTION\n\nMockups should be minimal and believable.\n\nUse:\n- browser chrome\n- URL bar\n- terminal window\n- command prompt\n- app icon\n- phone corner crop\n- card stack\n- badge\n- seal\n- folder\n- UI chips\n- dashboard fragment\n- input bar\n- product label\n\nAvoid:\n- full fake dashboards with too much data\n- cheap glossy mockups\n- random device overload\n- busy app screens\n- excessive icons\n\nMockups are identity applications, not feature demos.\n\n---\n\n# COLOR DISCIPLINE\n\nUse one dominant palette.\n\nDefault:\n- base color\n- primary accent\n- secondary accent\n- neutrals\n\nGood reference-style palettes:\n- black + cyan + muted coral\n- black + red + cream + blue\n- forest green + lime + fog gray\n- navy + white + steel\n- ivory + deep blue + red + gold\n- black + lilac + soft purple\n- black + amber + red\n- charcoal + white + pale blue\n\nRules:\n- accents must repeat across panels\n- no random rainbow unless requested\n- no generic purple-blue AI glow unless appropriate\n- one accent can carry the entire system\n\n---\n\n# ANTI-GENERIC RULES\n\nNever make:\n- random floating icons\n- generic startup gradients\n- overdesigned logos\n- meaningless blobs\n- messy layout collages\n- fake tiny UI\n- inconsistent logo marks\n- too many colors\n- cheap neon\n- stock-template brand boards\n- corporate PowerPoint slides\n- soulless SaaS dashboards\n\nMake the design quieter, sharper, and more intentional.\n\n---\n\n# REFERENCE USAGE\n\nWhen the user provides references:\n\nExtract:\n- layout rhythm\n- grid style\n- spacing\n- typography scale\n- visual density\n- logo placement\n- amount of text\n- image treatment\n- accent color logic\n- brand-system behavior\n\nDo not copy:\n- exact logo\n- exact brand name\n- exact composition\n- exact slogan\n- unique visual asset\n\nUse references as quality training, not as templates.\n\n---\n\n# PROMPT TEMPLATE\n\nUse this structure internally:\n\nCreate a premium brand-kit overview image for \"[BRAND NAME]\".\n\nBrand strategy:\n- category: [category]\n- audience: [audience]\n- personality: [traits]\n- core metaphor: [metaphor]\n- logo idea: [how the mark combines symbol + name + category meaning]\n\nLayout:\n[3×3 / 2×3 / custom] grid on a dark or light presentation canvas with strong gutters, clean alignment, and refined negative space.\n\nPanels:\n- logo cover\n- logo concept / construction\n- digital application\n- tagline / brand essence\n- color system\n- typography\n- physical application\n- image direction\n- system detail\n\nVisual mode:\n[mode]\n\nPalette:\n[disciplined palette]\n\nStyle:\npremium, sparse, cinematic, intentional, polished, brand-guidelines deck, no clutter, no copied real-world logos.\n\nTypography:\nreadable, minimal, high hierarchy, no tiny fake text.\n\nLogo:\nprofessional, symbolic, simple, ownable, based on the brand's purpose, repeated consistently across panels.\n\n---\n\n# FINAL OUTPUT STANDARD\n\nThe image must look like:\n- a premium identity deck\n- a senior designer's presentation board\n- a brand-system case study\n- a visual launch direction\n- a professional logo concept board\n\nThe final result should be:\n- clean\n- strategic\n- symbolic\n- minimal\n- coherent\n- premium\n- art-directed\n- implementation-friendly\n- stronger than normal AI-generated brand visuals\n\n<!-- File: .agents/skills/design-taste-frontend-v1/SKILL.md (Tokens: ~5154 | Category: anthropic-skill) -->\n---\nname: design-taste-frontend-v1\ndescription: The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility.\n---\n\n# High-Agency Frontend Skill\n\n## 1. ACTIVE BASELINE CONFIGURATION\n* DESIGN_VARIANCE: 8 (1=Perfect Symmetry, 10=Artsy Chaos)\n* MOTION_INTENSITY: 6 (1=Static/No movement, 10=Cinematic/Magic Physics)\n* VISUAL_DENSITY: 4 (1=Art Gallery/Airy, 10=Pilot Cockpit/Packed Data)\n\n**AI Instruction:** The standard baseline for all generations is strictly set to these values (8, 6, 4). Do not ask the user to edit this file. Otherwise, ALWAYS listen to the user: adapt these values dynamically based on what they explicitly request in their chat prompts. Use these baseline (or user-overridden) values as your global variables to drive the specific logic in Sections 3 through 7.\n\n## 2. DEFAULT ARCHITECTURE & CONVENTIONS\nUnless the user explicitly specifies a different stack, adhere to these structural constraints to maintain consistency:\n\n* **DEPENDENCY VERIFICATION [MANDATORY]:** Before importing ANY 3rd party library (e.g. `framer-motion`, `lucide-react`, `zustand`), you MUST check `package.json`. If the package is missing, you MUST output the installation command (e.g. `npm install package-name`) before providing the code. **Never** assume a library exists.\n* **Framework & Interactivity:** React or Next.js. Default to Server Components (`RSC`). \n    * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n    * **INTERACTIVITY ISOLATION:** If Sections 4 or 7 (Motion/Liquid Glass) are active, the specific interactive UI component MUST be extracted as an isolated leaf component with `'use client'` at the very top. Server Components must exclusively render static layouts.\n* **State Management:** Use local `useState`/`useReducer` for isolated UI. Use global state strictly for deep prop-drilling avoidance.\n* **Styling Policy:** Use Tailwind CSS (v3/v4) for 90% of styling. \n    * **TAILWIND VERSION LOCK:** Check `package.json` first. Do not use v4 syntax in v3 projects. \n    * **T4 CONFIG GUARD:** For v4, do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **ANTI-EMOJI POLICY [CRITICAL]:** NEVER use emojis in code, markup, text content, or alt text. Replace symbols with high-quality icons (Radix, Phosphor) or clean SVG primitives. Emojis are BANNED.\n* **Responsiveness & Spacing:**\n  * Standardize breakpoints (`sm`, `md`, `lg`, `xl`).\n  * Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n  * **Viewport Stability [CRITICAL]:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent catastrophic layout jumping on mobile browsers (iOS Safari).\n  * **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`) for reliable structures.\n* **Icons:** You MUST use exactly `@phosphor-icons/react` or `@radix-ui/react-icons` as the import paths (check installed version). Standardize `strokeWidth` globally (e.g., exclusively use `1.5` or `2.0`).\n\n\n## 3. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\nLLMs have statistical biases toward specific UI cliché patterns. Proactively construct premium interfaces using these engineered rules:\n\n**Rule 1: Deterministic Typography**\n* **Display/Headlines:** Default to `text-4xl md:text-6xl tracking-tighter leading-none`.\n    * **ANTI-SLOP:** Discourage `Inter` for \"Premium\" or \"Creative\" vibes. Force unique character using `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n    * **TECHNICAL UI RULE:** Serif fonts are strictly BANNED for Dashboard/Software UIs. For these contexts, use exclusively high-end Sans-Serif pairings (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`).\n* **Body/Paragraphs:** Default to `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n\n**Rule 2: Color Calibration**\n* **Constraint:** Max 1 Accent Color. Saturation < 80%.\n* **THE LILA BAN:** The \"AI Purple/Blue\" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g. Emerald, Electric Blue, or Deep Rose).\n* **COLOR CONSISTENCY:** Stick to one palette for the entire output. Do not fluctuate between warm and cool grays within the same project.\n\n**Rule 3: Layout Diversification**\n* **ANTI-CENTER BIAS:** Centered Hero/H1 sections are strictly BANNED when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left Aligned content/Right Aligned asset\", or \"Asymmetric White-space\" structures.\n\n**Rule 4: Materiality, Shadows, and \"Anti-Card Overuse\"**\n* **DASHBOARD HARDENING:** For `VISUAL_DENSITY > 7`, generic card containers are strictly BANNED. Use logic-grouping via `border-t`, `divide-y`, or purely negative space. Data metrics should breathe without being boxed in unless elevation (z-index) is functionally required.\n* **Execution:** Use cards ONLY when elevation communicates hierarchy. When a shadow is used, tint it to the background hue.\n\n**Rule 5: Interactive UI States**\n* **Mandatory Generation:** LLMs naturally generate \"static\" successful states. You MUST implement full interaction cycles:\n  * **Loading:** Skeletal loaders matching layout sizes (avoid generic circular spinners).\n  * **Empty States:** Beautifully composed empty states indicating how to populate data.\n  * **Error States:** Clear, inline error reporting (e.g., forms).\n  * **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push indicating success/action.\n\n**Rule 6: Data & Form Patterns**\n* **Forms:** Label MUST sit above input. Helper text is optional but should exist in markup. Error text below input. Use a standard `gap-2` for input blocks.\n\n## 4. CREATIVE PROACTIVITY (Anti-Slop Implementation)\nTo actively combat generic AI designs, systematically implement these high-end coding concepts as your baseline:\n* **\"Liquid Glass\" Refraction:** When glassmorphism is needed, go beyond `backdrop-blur`. Add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) to simulate physical edge refraction.\n* **Magnetic Micro-physics (If MOTION_INTENSITY > 5):** Implement buttons that pull slightly toward the mouse cursor. **CRITICAL:** NEVER use React `useState` for magnetic hover or continuous animations. Use EXCLUSIVELY Framer Motion's `useMotionValue` and `useTransform` outside the React render cycle to prevent performance collapse on mobile.\n* **Perpetual Micro-Interactions:** When `MOTION_INTENSITY > 5`, embed continuous, infinite micro-animations (Pulse, Typewriter, Float, Shimmer, Carousel) in standard components (avatars, status dots, backgrounds). Apply premium Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) to all interactive elements—no linear easing.\n* **Layout Transitions:** Always utilize Framer Motion's `layout` and `layoutId` props for smooth re-ordering, resizing, and shared element transitions across state changes.\n* **Staggered Orchestration:** Do not mount lists or grids instantly. Use `staggerChildren` (Framer) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) to create sequential waterfall reveals. **CRITICAL:** For `staggerChildren`, the Parent (`variants`) and Children MUST reside in the identical Client Component tree. If data is fetched asynchronously, pass the data as props into a centralized Parent Motion wrapper.\n\n## 5. PERFORMANCE GUARDRAILS\n* **DOM Cost:** Apply grain/noise filters exclusively to fixed, pointer-event-none pseudo-elements (e.g., `fixed inset-0 z-50 pointer-events-none`) and NEVER to scrolling containers to prevent continuous GPU repaints and mobile performance degradation.\n* **Hardware Acceleration:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`.\n* **Z-Index Restraint:** NEVER spam arbitrary `z-50` or `z-10` unprompted. Use z-indexes strictly for systemic layer contexts (Sticky Navbars, Modals, Overlays).\n\n## 6. TECHNICAL REFERENCE (Dial Definitions)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Flexbox `justify-center`, strict 12-column symmetrical grids, equal paddings.\n* **4-7 (Offset):** Use `margin-top: -2rem` overlapping, varied image aspect ratios (e.g., 4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (e.g., `grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`). \n* **MOBILE OVERRIDE:** For levels 4-10, any asymmetric layout above `md:` MUST aggressively fall back to a strict, single-column layout (`w-full`, `px-4`, `py-8`) on viewports `< 768px` to prevent horizontal scrolling and layout breakage.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only.\n* **4-7 (Fluid CSS):** Use `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. Use `animation-delay` cascades for load-ins. Focus strictly on `transform` and `opacity`. Use `will-change: transform` sparingly.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals or parallax. Use Framer Motion hooks. NEVER use `window.addEventListener('scroll')`.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery Mode):** Lots of white space. Huge section gaps. Everything feels very expensive and clean.\n* **4-7 (Daily App Mode):** Normal spacing for standard web apps.\n* **8-10 (Cockpit Mode):** Tiny paddings. No card boxes; just 1px lines to separate data. Everything is packed. **Mandatory:** Use Monospace (`font-mono`) for all numbers.\n\n## 7. AI TELLS (Forbidden Patterns)\nTo guarantee a premium, non-generic output, you MUST strictly avoid these common AI design signatures unless explicitly requested:\n\n### Visual & CSS\n* **NO Neon/Outer Glows:** Do not use default `box-shadow` glows or auto-glows. Use inner borders or subtle tinted shadows.\n* **NO Pure Black:** Never use `#000000`. Use Off-Black, Zinc-950, or Charcoal.\n* **NO Oversaturated Accents:** Desaturate accents to blend elegantly with neutrals.\n* **NO Excessive Gradient Text:** Do not use text-fill gradients for large headers.\n* **NO Custom Mouse Cursors:** They are outdated and ruin performance/accessibility.\n\n### Typography\n* **NO Inter Font:** Banned. Use `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`.\n* **NO Oversized H1s:** The first heading should not scream. Control hierarchy with weight and color, not just massive scale.\n* **Serif Constraints:** Use Serif fonts ONLY for creative/editorial designs. **NEVER** use Serif on clean Dashboards.\n\n### Layout & Spacing\n* **Align & Space Perfectly:** Ensure padding and margins are mathematically perfect. Avoid floating elements with awkward gaps.\n* **NO 3-Column Card Layouts:** The generic \"3 equal cards horizontally\" feature row is BANNED. Use a 2-column Zig-Zag, asymmetric grid, or horizontal scrolling approach instead.\n\n### Content & Data (The \"Jane Doe\" Effect)\n* **NO Generic Names:** \"John Doe\", \"Sarah Chan\", or \"Jack Su\" are banned. Use highly creative, realistic-sounding names.\n* **NO Generic Avatars:** DO NOT use standard SVG \"egg\" or Lucide user icons for avatars. Use creative, believable photo placeholders or specific styling.\n* **NO Fake Numbers:** Avoid predictable outputs like `99.99%`, `50%`, or basic phone numbers (`1234567`). Use organic, messy data (`47.2%`, `+1 (312) 847-1928`).\n* **NO Startup Slop Names:** \"Acme\", \"Nexus\", \"SmartFlow\". Invent premium, contextual brand names.\n* **NO Filler Words:** Avoid AI copywriting clichés like \"Elevate\", \"Seamless\", \"Unleash\", or \"Next-Gen\". Use concrete verbs.\n\n### External Resources & Components\n* **NO Broken Unsplash Links:** Do not use Unsplash. Use absolute, reliable placeholders like `https://picsum.photos/seed/{random_string}/800/600` or SVG UI Avatars.\n* **shadcn/ui Customization:** You may use `shadcn/ui`, but NEVER in its generic default state. You MUST customize the radii, colors, and shadows to match the high-end project aesthetic.\n* **Production-Ready Cleanliness:** Code must be extremely clean, visually striking, memorable, and meticulously refined in every detail.\n\n## 8. THE CREATIVE ARSENAL (High-End Inspiration)\nDo not default to generic UI. Pull from this library of advanced concepts to ensure the output is visually striking and memorable. When appropriate, leverage **GSAP (ScrollTrigger/Parallax)** for complex scrolltelling or **ThreeJS/WebGL** for 3D/Canvas animations, rather than basic CSS motion. **CRITICAL:** Never mix GSAP/ThreeJS with Framer Motion in the same component tree. Default to Framer Motion for UI/Bento interactions. Use GSAP/ThreeJS EXCLUSIVELY for isolated full-page scrolltelling or canvas backgrounds, wrapped in strict useEffect cleanup blocks.\n\n### The Standard Hero Paradigm\n* Stop doing centered text over a dark image. Try asymmetric Hero sections: Text cleanly aligned to the left or right. The background should feature a high-quality, relevant image with a subtle stylistic fade (darkening or lightening gracefully into the background color depending on if it is Light or Dark mode).\n\n### Navigation & Menüs\n* **Mac OS Dock Magnification:** Nav-bar at the edge; icons scale fluidly on hover.\n* **Magnetic Button:** Buttons that physically pull toward the cursor.\n* **Gooey Menu:** Sub-items detach from the main button like a viscous liquid.\n* **Dynamic Island:** A pill-shaped UI component that morphs to show status/alerts.\n* **Contextual Radial Menu:** A circular menu expanding exactly at the click coordinates.\n* **Floating Speed Dial:** A FAB that springs out into a curved line of secondary actions.\n* **Mega Menu Reveal:** Full-screen dropdowns that stagger-fade complex content.\n\n### Layout & Grids\n* **Bento Grid:** Asymmetric, tile-based grouping (e.g., Apple Control Center).\n* **Masonry Layout:** Staggered grid without fixed row heights (e.g., Pinterest).\n* **Chroma Grid:** Grid borders or tiles showing subtle, continuously animating color gradients.\n* **Split Screen Scroll:** Two screen halves sliding in opposite directions on scroll.\n* **Curtain Reveal:** A Hero section parting in the middle like a curtain on scroll.\n\n### Cards & Containers\n* **Parallax Tilt Card:** A 3D-tilting card tracking the mouse coordinates.\n* **Spotlight Border Card:** Card borders that illuminate dynamically under the cursor.\n* **Glassmorphism Panel:** True frosted glass with inner refraction borders.\n* **Holographic Foil Card:** Iridescent, rainbow light reflections shifting on hover.\n* **Tinder Swipe Stack:** A physical stack of cards the user can swipe away.\n* **Morphing Modal:** A button that seamlessly expands into its own full-screen dialog container.\n\n### Scroll-Animations\n* **Sticky Scroll Stack:** Cards that stick to the top and physically stack over each other.\n* **Horizontal Scroll Hijack:** Vertical scroll translates into a smooth horizontal gallery pan.\n* **Locomotive Scroll Sequence:** Video/3D sequences where framerate is tied directly to the scrollbar.\n* **Zoom Parallax:** A central background image zooming in/out seamlessly as you scroll.\n* **Scroll Progress Path:** SVG vector lines or routes that draw themselves as the user scrolls.\n* **Liquid Swipe Transition:** Page transitions that wipe the screen like a viscous liquid.\n\n### Galleries & Media\n* **Dome Gallery:** A 3D gallery feeling like a panoramic dome.\n* **Coverflow Carousel:** 3D carousel with the center focused and edges angled back.\n* **Drag-to-Pan Grid:** A boundless grid you can freely drag in any compass direction.\n* **Accordion Image Slider:** Narrow vertical/horizontal image strips that expand fully on hover.\n* **Hover Image Trail:** The mouse leaves a trail of popping/fading images behind it.\n* **Glitch Effect Image:** Brief RGB-channel shifting digital distortion on hover.\n\n### Typography & Text\n* **Kinetic Marquee:** Endless text bands that reverse direction or speed up on scroll.\n* **Text Mask Reveal:** Massive typography acting as a transparent window to a video background.\n* **Text Scramble Effect:** Matrix-style character decoding on load or hover.\n* **Circular Text Path:** Text curved along a spinning circular path.\n* **Gradient Stroke Animation:** Outlined text with a gradient continuously running along the stroke.\n* **Kinetic Typography Grid:** A grid of letters dodging or rotating away from the cursor.\n\n### Micro-Interactions & Effects\n* **Particle Explosion Button:** CTAs that shatter into particles upon success.\n* **Liquid Pull-to-Refresh:** Mobile reload indicators acting like detaching water droplets.\n* **Skeleton Shimmer:** Shifting light reflections moving across placeholder boxes.\n* **Directional Hover Aware Button:** Hover fill entering from the exact side the mouse entered.\n* **Ripple Click Effect:** Visual waves rippling precisely from the click coordinates.\n* **Animated SVG Line Drawing:** Vectors that draw their own contours in real-time.\n* **Mesh Gradient Background:** Organic, lava-lamp-like animated color blobs.\n* **Lens Blur Depth:** Dynamic focus blurring background UI layers to highlight a foreground action.\n\n## 9. THE \"MOTION-ENGINE\" BENTO PARADIGM\nWhen generating modern SaaS dashboards or feature sections, you MUST utilize the following \"Bento 2.0\" architecture and motion philosophy. This goes beyond static cards and enforces a \"Vercel-core meets Dribbble-clean\" aesthetic heavily reliant on perpetual physics.\n\n### A. Core Design Philosophy\n* **Aesthetic:** High-end, minimal, and functional.\n* **Palette:** Background in `#f9fafb`. Cards are pure white (`#ffffff`) with a 1px border of `border-slate-200/50`.\n* **Surfaces:** Use `rounded-[2.5rem]` for all major containers. Apply a \"diffusion shadow\" (a very light, wide-spreading shadow, e.g., `shadow-[0_20px_40px_-15px_rgba(0,0,0,0.05)]`) to create depth without clutter.\n* **Typography:** Strict `Geist`, `Satoshi`, or `Cabinet Grotesk` font stack. Use subtle tracking (`tracking-tight`) for headers.\n* **Labels:** Titles and descriptions must be placed **outside and below** the cards to maintain a clean, gallery-style presentation.\n* **Pixel-Perfection:** Use generous `p-8` or `p-10` padding inside cards.\n\n### B. The Animation Engine Specs (Perpetual Motion)\nAll cards must contain **\"Perpetual Micro-Interactions.\"** Use the following Framer Motion principles:\n* **Spring Physics:** No linear easing. Use `type: \"spring\", stiffness: 100, damping: 20` for a premium, weighty feel.\n* **Layout Transitions:** Heavily utilize the `layout` and `layoutId` props to ensure smooth re-ordering, resizing, and shared element state transitions.\n* **Infinite Loops:** Every card must have an \"Active State\" that loops infinitely (Pulse, Typewriter, Float, or Carousel) to ensure the dashboard feels \"alive\".\n* **Performance:** Wrap dynamic lists in `<AnimatePresence>` and optimize for 60fps. **PERFORMANCE CRITICAL:** Any perpetual motion or infinite loop MUST be memoized (React.memo) and completely isolated in its own microscopic Client Component. Never trigger re-renders in the parent layout.\n\n### C. The 5-Card Archetypes (Micro-Animation Specs)\nImplement these specific micro-animations when constructing Bento grids (e.g., Row 1: 3 cols | Row 2: 2 cols split 70/30):\n1. **The Intelligent List:** A vertical stack of items with an infinite auto-sorting loop. Items swap positions using `layoutId`, simulating an AI prioritizing tasks in real-time.\n2. **The Command Input:** A search/AI bar with a multi-step Typewriter Effect. It cycles through complex prompts, including a blinking cursor and a \"processing\" state with a shimmering loading gradient.\n3. **The Live Status:** A scheduling interface with \"breathing\" status indicators. Include a pop-up notification badge that emerges with an \"Overshoot\" spring effect, stays for 3 seconds, and vanishes.\n4. **The Wide Data Stream:** A horizontal \"Infinite Carousel\" of data cards or metrics. Ensure the loop is seamless (using `x: [\"0%\", \"-100%\"]`) with a speed that feels effortless.\n5. **The Contextual UI (Focus Mode):** A document view that animates a staggered highlight of a text block, followed by a \"Float-in\" of a floating action toolbar with micro-icons.\n\n## 10. FINAL PRE-FLIGHT CHECK\nEvaluate your code against this matrix before outputting. This is the **last** filter you apply to your logic.\n- [ ] Is global state used appropriately to avoid deep prop-drilling rather than arbitrarily?\n- [ ] Is mobile layout collapse (`w-full`, `px-4`, `max-w-7xl mx-auto`) guaranteed for high-variance designs?\n- [ ] Do full-height sections safely use `min-h-[100dvh]` instead of the bugged `h-screen`?\n- [ ] Do `useEffect` animations contain strict cleanup functions?\n- [ ] Are empty, loading, and error states provided?\n- [ ] Are cards omitted in favor of spacing where possible?\n- [ ] Did you strictly isolate CPU-heavy perpetual animations in their own Client Components?\n\n<!-- File: .agents/skills/design-taste-frontend/SKILL.md (Tokens: ~12619 | Category: anthropic-skill) -->\n---\nname: design-taste-frontend\ndescription: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.\n---\n\n# tasteskill: Anti-Slop Frontend Skill\n\n> Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.\n> Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.\n\n---\n\n## 0. BRIEF INFERENCE (Read the Room Before Anything Else)\n\nBefore touching code or tweaking dials, **infer what the user actually wants**. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.\n\n### 0.A Read these signals first\n1. **Page kind** - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.\n2. **Vibe words** the user used - \"minimalist\", \"calm\", \"Linear-style\", \"Awwwards\", \"brutalist\", \"premium consumer\", \"Apple-y\", \"playful\", \"serious B2B\", \"editorial\", \"agency-y\", \"glassy\", \"dark tech\".\n3. **Reference signals** - URLs they linked, screenshots they pasted, products they named, brands they're competing with.\n4. **Audience** - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.\n5. **Brand assets that already exist** - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).\n6. **Quiet constraints** - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.\n\n### 0.B Output a one-line \"Design Read\" before generating\nBefore any code, state in one line: **\"Reading this as: \\<page kind> for \\<audience>, with a \\<vibe> language, leaning toward \\<design system or aesthetic family>.\"**\n\nExample reads:\n- *\"Reading this as: B2B SaaS landing for technical buyers, with a Linear-style minimalist language, leaning toward Tailwind utilities + Geist + restrained motion.\"*\n- *\"Reading this as: solo designer portfolio for hiring managers, with an editorial / kinetic-type language, leaning toward native CSS + scroll-driven animation + custom typography.\"*\n- *\"Reading this as: redesign of a public-sector service site, with a trust-first language, leaning toward GOV.UK Frontend or USWDS.\"*\n\n### 0.C If the brief is ambiguous, ask one question, do not guess\nAsk exactly **one** clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: *\"Should this feel closer to Linear-clean or Awwwards-experimental?\"*\n\nIf you can confidently infer from context, **do not ask**. Just declare the design read and proceed.\n\n### 0.D Anti-Default Discipline\nDo not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.\n\n---\n\n## 1. THE THREE DIALS (Core Configuration)\n\nAfter the design read, set three dials. Every layout, motion, and density decision below is gated by these.\n\n* **`DESIGN_VARIANCE: 8`** - 1 = Perfect Symmetry, 10 = Artsy Chaos\n* **`MOTION_INTENSITY: 6`** - 1 = Static, 10 = Cinematic / Physics\n* **`VISUAL_DENSITY: 4`** - 1 = Art Gallery / Airy, 10 = Cockpit / Packed Data\n\n**Baseline:** `8 / 6 / 4`. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.\n\n### 1.A Dial Inference (design read → dial values)\n| Signal | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| \"minimalist / clean / calm / editorial / Linear-style\" | 5-6 | 3-4 | 2-3 |\n| \"premium consumer / Apple-y / luxury / brand\" | 7-8 | 5-7 | 3-4 |\n| \"playful / wild / Dribbble / Awwwards / experimental / agency\" | 9-10 | 8-10 | 3-4 |\n| \"landing page / portfolio / marketing site (default)\" | 7-9 | 6-8 | 3-5 |\n| \"trust-first / public-sector / regulated / accessibility-critical\" | 3-4 | 2-3 | 4-5 |\n| \"redesign - preserve\" | match existing | +1 | match existing |\n| \"redesign - overhaul\" | +2 | +2 | match existing |\n\n### 1.B Use-Case Presets\n| Use case | VARIANCE | MOTION | DENSITY |\n|---|---|---|---|\n| Landing (SaaS, mainstream) | 7 | 6 | 4 |\n| Landing (Agency / creative) | 9 | 8 | 3 |\n| Landing (Premium consumer) | 7 | 6 | 3 |\n| Portfolio (Designer / studio) | 8 | 7 | 3 |\n| Portfolio (Developer) | 6 | 5 | 4 |\n| Editorial / Blog | 6 | 4 | 3 |\n| Public-sector service | 3 | 2 | 5 |\n| Redesign - preserve | match | match+1 | match |\n| Redesign - overhaul | +2 | +2 | match |\n\n### 1.C How the Dials Drive Output\nUse these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like `LAYOUT_VARIANCE` or `ANIM_LEVEL`.\n\n---\n\n## 2. BRIEF → DESIGN SYSTEM MAP\n\nOnce you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.\n\n### 2.A When to reach for a real design system (use official packages)\n| Brief reads as… | Reach for | Why |\n|---|---|---|\n| Microsoft / enterprise SaaS / dashboards | `@fluentui/react-components` or `@fluentui/web-components` | Official Fluent UI, Microsoft tokens, accessibility done |\n| Google-ish UI, Material-flavored product | `@material/web` + Material 3 tokens | Official, theme-able via Material Theming |\n| IBM-style B2B / enterprise analytics | `@carbon/react` + `@carbon/styles` | Official Carbon, mature data-density patterns |\n| Shopify app surfaces | `polaris.js` web components / Polaris React | Required for Shopify admin UI |\n| Atlassian / Jira-style product | `@atlaskit/*` + `@atlaskit/tokens` | Official Atlassian DS |\n| GitHub-style devtool / community page | `@primer/css` or `@primer/react-brand` | Official Primer; Brand variant for marketing |\n| Public-sector UK service | `govuk-frontend` | Legally / regulatorily expected |\n| US public-sector / trust-first | `uswds` | Same |\n| Fast local-business / agency MVP | Bootstrap 5.3 | Boring, fast, works |\n| Modern accessible React foundation | `@radix-ui/themes` | Primitives + polished theme |\n| Modern SaaS where you own the components | shadcn/ui (`npx shadcn@latest add ...`) | You own the code, easy to customise; never ship default state |\n| Tailwind-based modern SaaS / AI marketing | Tailwind v4 utilities + `dark:` variant | Default for indie + small team builds |\n\n**Honesty rule:** if the brief reads as one of the systems above, install and use the **official** package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.\n\n**One system per project.** Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.\n\n### 2.B When the brief is an aesthetic, not a system\nFor these directions, there is **no single official package**. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.\n\n| Aesthetic | Honest implementation |\n|---|---|\n| Glassmorphism / \"frosted glass\" | `backdrop-filter`, layered borders, highlight overlays. Provide solid-fill fallback for `prefers-reduced-transparency`. |\n| Bento (Apple-style tile grids) | CSS Grid with mixed cell sizes. No single library owns this. |\n| Brutalism | Native CSS, monospace, raw borders. No library. |\n| Editorial / magazine | Serif type, asymmetric grid, generous whitespace. No library. |\n| Dark tech / hacker | Mono + accent neon, terminal motifs. No library. |\n| Aurora / mesh gradients | SVG or layered radial gradients. No library. |\n| Kinetic typography | Native CSS animations, scroll-driven animations, GSAP for hijacks. No library. |\n| **Apple Liquid Glass** | Apple documents this for Apple platforms only. **There is no official `liquid-glass.css`.** Web implementations are approximations using `backdrop-filter` + layered borders + highlights. Label clearly as approximation. |\n\n---\n\n## 3. DEFAULT ARCHITECTURE & CONVENTIONS\n\nUnless the design read picks a real design system (Section 2.A), these are the defaults:\n\n### 3.A Stack\n* **Framework:** React or Next.js. Default to Server Components (RSC).\n  * **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `\"use client\"` component.\n  * **INTERACTIVITY ISOLATION:** Any component using Motion, scroll listeners, or pointer physics MUST be an isolated leaf with `'use client'` at the top. Server Components render static layouts only.\n* **Styling:** **Tailwind v4** (default). Tailwind v3 only if the existing project demands it.\n  * For v4: do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.\n* **Animation:** **Motion** (the library formerly known as Framer Motion). Import from `motion/react` (`import { motion } from \"motion/react\"`). The `framer-motion` package still works as a legacy alias - prefer `motion/react` in new code.\n* **Fonts:** Always use `next/font` (Next.js) or self-host with `@font-face` + `font-display: swap`. Never link Google Fonts via `<link>` in production.\n\n### 3.B State\n* Local `useState` / `useReducer` for isolated UI.\n* Global state ONLY for deep prop-drilling avoidance - Zustand, Jotai, or React context.\n* **NEVER** use `useState` to track continuous values driven by user input (mouse position, scroll progress, pointer physics, magnetic hover). Use Motion's `useMotionValue` / `useTransform` / `useScroll`. `useState` re-renders the React tree on every change and collapses on mobile.\n\n### 3.C Icons\n* **Allowed libraries (priority order):** `@phosphor-icons/react`, `hugeicons-react`, `@radix-ui/react-icons`, `@tabler/icons-react`.\n* **Discouraged:** `lucide-react`. Acceptable only when the user explicitly asks for it or the project already depends on it.\n* **NEVER hand-roll SVG icons.** If a glyph is missing, install a second library or compose from primitives - do not draw icon paths from scratch.\n* **One family per project.** Do not mix Phosphor with Lucide in the same component tree.\n* **Standardize `strokeWidth` globally** (e.g. `1.5` or `2.0`).\n\n### 3.D Emoji Policy\nDiscouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. **Override:** allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.\n\n### 3.E Responsiveness & Layout Mechanics\n* Standardize breakpoints (`sm 640`, `md 768`, `lg 1024`, `xl 1280`, `2xl 1536`).\n* Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.\n* **Viewport Stability:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent layout jumping on mobile (iOS Safari address bar).\n* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`).\n\n### 3.F Dependency Verification (mandatory)\nBefore importing ANY 3rd-party library, check `package.json`. If the package is missing, output the install command first. **Never** assume a library exists.\n\n---\n\n## 4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)\n\nLLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.\n\n### 4.1 Typography\n* **Display / Headlines:** Default `text-4xl md:text-6xl tracking-tighter leading-none`.\n* **Body / Paragraphs:** Default `text-base text-gray-600 leading-relaxed max-w-[65ch]`.\n* **Sans font choice:**\n  * **Discouraged as default:** `Inter`. Pick `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`, or a brand-appropriate serif first.\n  * **Override:** Inter is acceptable when the user explicitly asks for a neutral / standard / Linear-style feel, or when the brief is a public-sector / accessibility-first site.\n* **Pairings to know:** `Geist` + `Geist Mono`, `Satoshi` + `JetBrains Mono`, `Cabinet Grotesk` + `Inter Tight`, `GT America` + `IBM Plex Mono`.\n\n* **SERIF DISCIPLINE (VERY DISCOURAGED AS DEFAULT):**\n  * Serif is **very discouraged as the default font for any project.** \"It feels creative / premium / editorial\" is NOT a reason to reach for serif. The agent's default mental model that \"creative brief = serif\" is the single most-tested AI tell in production rounds.\n  * **Serif is only acceptable when ONE of these is explicitly true:**\n    - The brand brief literally names a serif font, OR\n    - The aesthetic family is genuinely editorial / luxury / publication / manuscript / heritage / vintage AND you can articulate why this specific serif fits this specific brand\n  * For everything else (creative agency, design studio, modern brand, premium consumer, portfolio, lifestyle), **default sans-serif display** (Geist Display, ABC Diatype, Söhne Breit, Cabinet Grotesk Display, Migra Sans, GT Walsheim, Inter Display, PP Neue Montreal). Sans display fonts are not \"boring\" — they are the default for the same reason black is the default in fashion.\n  * **EMPHASIS RULE (related):** When you want to emphasize a word within a headline (the kinetic \"and `spatial` design\" type move), use **italic or bold of the SAME font**. Do NOT inject a random serif word into a sans headline (or vice versa) just to add visual interest. Mixed-family emphasis is amateur. Italic/bold emphasis in the same family is the right move.\n  * **Specifically BANNED as defaults:** `Fraunces` and `Instrument_Serif` (the two LLM-favorite display serifs).\n  * **If a serif is justified** (rare, per the above), rotate from this pool, do NOT reuse the same serif across consecutive projects: PP Editorial New, GT Sectra Display, Cardinal Grotesque, Reckless Neue, Tiempos Headline, Recoleta, Cormorant Garamond, Playfair Display, EB Garamond, IvyPresto, Migra, Editorial Old, Saol Display, Söhne Breit Kursiv, Domaine Display, Canela, Schnyder, Tobias, NB Architekt, ITC Galliard.\n\n* **ITALIC DESCENDER CLEARANCE (mandatory):** When italic is used in display type and the word contains a descender letter (`y g j p q`), `leading-[1]` or `leading-none` will clip the descender. Use `leading-[1.1]` minimum and add `pb-1` or `mb-1` reserve on the wrapping element. Audit every italic word in display headlines before shipping.\n\n### 4.2 Color Calibration\n* Max 1 accent color. Saturation < 80% by default.\n* **THE LILA RULE:** The \"AI Purple / Blue glow\" aesthetic is discouraged as a default. No automatic purple button glows, no random neon gradients. Use neutral bases (Zinc / Slate / Stone) with high-contrast singular accents (Emerald, Electric Blue, Deep Rose, Burnt Orange, etc.).\n* **Override:** if the brand or brief explicitly asks for purple / violet / lila, embrace it. But execute with intent: consistent palette, harmonised neutrals, restrained gradients. Not generic AI gradient slop.\n* **One palette per project.** Do not fluctuate between warm and cool grays within the same project.\n* **COLOR CONSISTENCY LOCK (mandatory):** Once an accent color is chosen for a page, it is used on the WHOLE page. A warm-grey site does not suddenly get a blue CTA in section 7. A rose-accented site does not get a teal status badge in the footer. Pick one accent, lock it, audit every component before shipping.\n\n* **PREMIUM-CONSUMER PALETTE BAN (mandatory, second-most-recurring AI-tell):**\n  * For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage craft, DTC home goods, etc.) the LLM default is **warm beige/cream + brass/clay/oxblood/ochre + espresso/ink dark text**. Concretely banned hex families as default backgrounds and accents:\n    - Backgrounds: `#f5f1ea`, `#f7f5f1`, `#fbf8f1`, `#efeae0`, `#ece6db`, `#faf7f1`, `#e8dfcb` (all \"warm paper / cream / chalk / bone\")\n    - Accents: `#b08947`, `#b6553a`, `#9a2436`, `#9c6e2a`, `#bc7c3a`, `#7d5621` (all \"brass / clay / oxblood / ochre\")\n    - Text: `#1a1714`, `#1a1814`, `#1b1814` (all \"espresso / warm near-black\")\n  * This palette is BANNED as the default reach for premium-consumer briefs. Every premium-consumer site you have ever shipped uses this exact palette. The brand becomes invisible.\n  * **Default alternatives (rotate, do not reuse):**\n    - **Cold Luxury:** silver-grey + chrome + smoke (think Tesla, Apple Watch Hermes-without-the-leather)\n    - **Forest:** deep green + bone + amber accent (think Filson, Patagonia premium)\n    - **Black and Tan:** true off-black + warm tan, sharp contrast, no beige\n    - **Cobalt + Cream:** saturated blue against a single neutral, no brass\n    - **Terracotta + Slate:** warm rust against cool grey, no brass\n    - **Olive + Brick + Paper:** muted olive plus brick-red accent\n    - **Pure monochrome + single saturated pop:** off-white + off-black + one bright accent (electric blue, emerald, hot pink, etc.)\n  * **Palette-rotation rule:** if the previous premium-consumer project you generated used the beige+brass family, this one MUST use a different family. Do not ship the same warm-craft palette twice in a row.\n  * **Override:** the beige+brass+espresso palette is acceptable ONLY when the brand brief explicitly names those colors, or when the brand identity is genuinely vintage / artisan / warm-craft AND you can articulate why this specific palette fits this specific brand. Default-reaching for it because \"this is a cookware brief\" is banned.\n\n### 4.3 Layout Diversification\n* **ANTI-CENTER BIAS:** Centered Hero / H1 sections are avoided when `DESIGN_VARIANCE > 4`. Force \"Split Screen\" (50/50), \"Left-aligned content / right-aligned asset\", \"Asymmetric white-space\", or scroll-pinned structures.\n* **Override:** centered hero is OK for editorial / manifesto / launch-announcement briefs where the message itself is the design.\n\n### 4.4 Materiality, Shadows, Cards\n* Use cards ONLY when elevation communicates real hierarchy. Otherwise group with `border-t`, `divide-y`, or negative space.\n* When a shadow is used, tint it to the background hue. No pure-black drop shadows on light backgrounds.\n* For `VISUAL_DENSITY > 7`: generic card containers are banned. Data metrics breathe in plain layout.\n* **SHAPE CONSISTENCY LOCK (mandatory):** Pick ONE corner-radius scale for the page and stick to it. Options: all-sharp (radius 0), all-soft (radius 12-16px), all-pill (full radius for interactive). Mixed systems are allowed only when there is a documented rule (e.g. \"buttons are full-pill, cards are 16px, inputs are 8px\") and that rule is followed everywhere. Round buttons in a square layout, or square cards on a pill-button page, is broken design.\n\n### 4.5 Interactive UI States\nLLMs default to \"static successful state only.\" Always implement full cycles:\n* **Loading:** Skeletal loaders matching the final layout's shape. Avoid generic circular spinners.\n* **Empty States:** Beautifully composed; indicate how to populate.\n* **Error States:** Clear, inline (forms), or contextual (toasts only for transient).\n* **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push.\n* **BUTTON CONTRAST CHECK (mandatory, a11y):** Before shipping any button, verify the button text is readable against the button background. White button + white text, `bg-white` CTA with `text-white` label, transparent button against the page background with no border → all banned. Audit every CTA: contrast ratio WCAG AA min (4.5:1 for body, 3:1 for large text 18px+). Same rule applies to ghost buttons over photographic backgrounds (use a backdrop, scrim, or stroke).\n* **CTA BUTTON WRAP BAN (mandatory):** Button text MUST fit on one line at desktop. If a label like \"VIEW SELECTED WORK\" wraps to 2 or 3 lines, the button is broken. Fix by EITHER shortening the label (3 words max for primary CTAs, ideally 1-2) OR widening the button (do not artificially constrain `max-width` on CTAs). Wrapped CTAs at desktop are a Pre-Flight Fail.\n* **NO DUPLICATE CTA INTENT (mandatory):** Two CTAs with the same intent on one page is a Pre-Flight Fail. Examples of same intent: \"Get in touch\" + \"Contact us\" + \"Let's talk\" + \"Start a project\" + \"Start something\" + \"Reach out\" = all \"contact\" intent → pick ONE label and use it everywhere on the page (nav, hero, footer). Same for \"Try free\" + \"Get started\" + \"Sign up free\" (all \"signup\" intent) and \"View work\" + \"See selected work\" + \"Browse projects\" (all \"portfolio\" intent). One label per intent.\n* **FORM CONTRAST CHECK (mandatory, a11y):** Form inputs, placeholder text, focus rings, helper text, and error text all pass WCAG AA contrast against the section background. Light placeholders on a near-white form, white form on white page section, form labels grayer than 4.5:1 contrast → all banned. Audit every form before shipping.\n\n### 4.6 Data & Form Patterns\n* Label ABOVE input. Helper text optional but present in markup. Error text BELOW input. Standard `gap-2` for input blocks.\n* No placeholder-as-label. Ever.\n\n### 4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)\n\n* **Hero MUST fit in the initial viewport.** Headline max 2 lines on desktop, subtext max **20 words** AND max 3-4 lines, CTAs visible without scroll. If the copy is too long: reduce font scale OR cut copy. If you cannot describe the value-prop in 20 words of subtext, the value-prop is unclear, not the rule too tight. Never let the hero overflow and force scroll to find the CTA.\n* **Hero font-scale discipline.** Plan font size and image size *together*. If the hero asset is large and the headline is more than 6 words, do not start at `text-7xl/text-8xl`. Default sensible range: `text-4xl md:text-5xl lg:text-6xl` for most heroes; `text-6xl md:text-7xl` only when the headline is 3-5 words. A 4-line hero headline is always a font-size error, never a copy-length error.\n* **HERO TOP PADDING CAP (mandatory):** Hero top padding max `pt-24` (≈6rem) at desktop. More than that means the hero content floats halfway down the viewport and reads as a layout bug, not as intentional space. If your hero needs more breathing room, increase font scale or asset size, not top padding.\n* **HERO STACK DISCIPLINE (max 4 text elements).** The hero is a single moment, not a feature list. Allowed text elements, max 4 in total:\n  1. Eyebrow (small uppercase label) OR brand strip OR neither - pick zero or one\n  2. Headline (max 2 lines, see above)\n  3. Subtext (max 20 words, max 4 lines)\n  4. CTAs (1 primary + max 1 secondary)\n  - **BANNED in the hero:** tiny tagline below CTAs (\"Works with GitHub, GitLab, and self-hosted Git\"), trust micro-strip (\"Used by engineering teams at...\"), pricing teaser (\"Free for solo, $10/user for teams\"), feature bullet list, social-proof avatar row. All of those move to dedicated sections directly below the hero.\n  - If you have an eyebrow AND a tagline below CTAs in the same hero, drop the tagline. If you have a brand strip AND a tagline, drop the tagline. One small text element per hero, max.\n* **\"Used by\" / \"Trusted by\" logo wall belongs UNDER the hero, never inside it.** The hero is for the value prop and primary CTA. The logo wall is a separate section directly below. Do not stuff trust logos into the same flex row as the hero copy.\n* **Navigation MUST render on a single line on desktop.** If items don't fit at `lg` (1024px), condense labels, drop secondary items, or move to a hamburger. A two-line nav at desktop is broken design.\n* **Navigation height cap: 80px max desktop, default 64-72px.** No huge \"agency\" nav bars that eat 15% of the viewport.\n* **Bento grids MUST have rhythm, not one-sided repetition.** Do not stack 6 left-image / right-text rows. Vary the composition: alternate full-width feature rows, asymmetric tile sizes, vertical breaks.\n* **BENTO CELL COUNT RULE (mandatory):** A bento grid has EXACTLY as many cells as you have content for. 3 items → 3 cells (1+2 split, or 2+1, or asymmetric trio). 5 items → 5 cells (2+3, 3+2, hero+4, etc.). If your grid has an empty cell in the middle or at the end, you planned wrong. Re-shape the grid; do not paste a blank tile.\n* **Section-Layout-Repetition Ban.** Once you use a layout family for a section (e.g., 3-column-image-cards, full-width-quote, split-text-image), that family can appear at most ONCE on the page. \"Selected commissions\" must not look like \"What we do.\" A landing page with 8 sections must use at least 4 different layout families.\n* **ZIGZAG ALTERNATION CAP (mandatory).** Alternating \"left-image + right-text\" then \"left-text + right-image\" zigzag layout = banal. Max 2 sections in a row with this image+text-split pattern. The 3rd consecutive image+text split is a Pre-Flight Fail. Break the pattern with a full-width section, a vertical-stack section, a bento grid, a marquee, or a different layout family.\n* **EYEBROW RESTRAINT (mandatory, the #1 violated rule in production tests).** An \"eyebrow\" is the small uppercase wide-tracking label sitting above a section headline (e.g. `FOUR COLORWAYS`, `SELECTED WORK`, `THE HARDWARE`, `Git-native task management`). Typical CSS signature: `text-[11px] uppercase tracking-[0.18em]`, `font-mono text-[10.5px] uppercase tracking-[0.22em]`. Every AI-built site puts an eyebrow above EVERY section header, producing the same templated rhythm. Hard rule:\n  - **Maximum 1 eyebrow per 3 sections.** Hero counts as 1. So a page with 9 sections may use at most 3 eyebrows total.\n  - If section A has an eyebrow, the next 2 sections cannot have one.\n  - **Pre-Flight Check is mechanical:** count instances of `uppercase tracking` (or similar small-caps mono labels above headlines) across all section components. If count > ceil(sectionCount / 3), the output fails.\n  - **What to do instead of an eyebrow:** drop it entirely. The headline alone is enough. If you need to categorize a section, the section's location on the page already categorizes it; no label needed.\n* **SPLIT-HEADER BAN (mandatory).** The pattern \"left big headline + right small explainer paragraph\" as a section header (left col-span-7/8, right col-span-4/5 with a small body paragraph floating in the right column) is **banned as default**. Sections should have ONE focused message. If you genuinely need both a headline and an explainer paragraph, stack them vertically (headline on top, body below, max-width 65ch). Reach for the split-header pattern only when there is a real compositional reason (e.g., the right column carries a visual or interactive element, not just filler text).\n* **Bento Background Diversity (mandatory).** Bento and feature-grid sections cannot be 6 white-on-white cards with text inside. At least 2-3 cells in any multi-cell grid need real visual variation: a real image, a brand-appropriate gradient (not AI-purple), a pattern, a tinted background. A cream-on-cream bento with only typography inside reads as boring AI default, even when the rest of the page is good.\n* **Mobile collapse must be explicit per section.** For every multi-column layout, declare the `< 768px` fallback in the same component. No \"it'll work, Tailwind handles it\" assumptions.\n\n### 4.8 Image & Visual Asset Strategy\n\nLanding pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.\n\n**Priority order for visual assets:**\n1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.\n2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:\n   * `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)\n   * Actual stock or brand URLs when the brief provides them\n   * Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed\n3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based \"fake screenshots.\" Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *\"This page needs real images at: \\[list of placements\\]. Please generate or provide them.\"*\n\n**Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.\n\n**Real company logos for social proof.** When the brief calls for a \"Trusted by / Used by / Customers\" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:\n* **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.\n* **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).\n* **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.\n* **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).\n* **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.\n\n**Hand-rolled illustrations:**\n* SVG icons from libraries: fine (see Section 3.C).\n* Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:\n  - The brief explicitly calls for it (\"draw me an SVG logo\")\n  - It's a single, simple geometric mark (a square, a circle, a wordmark in display type)\n  - You're confident in the output quality\n\n**Div-based fake screenshots are banned.** A \"hand-built product preview\" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:\n* Use a real screenshot URL if one exists\n* Generate one via image tool\n* Use a real component preview (an actual mini-version of the UI inside the page)\n* Or skip the preview entirely and use editorial photography\n\n**Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.\n\n### 4.9 Content Density\n\nLanding pages live on the **first impression**, not the full read. Cut ruthlessly.\n\n* **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.\n* **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:\n  - Top 3-5 highlights + \"View full list\" link\n  - Marquee / carousel for breadth\n  - Different page entirely if the data is the product\n* **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:\n  - 2-column split with grouped items\n  - Card grid with image + label per item\n  - Tabs / accordion if items are categorisable\n  - Horizontal scroll-snap pills\n  - Carousel for breadth-heavy lists (testimonials, logos, capabilities)\n  - Marquee for \"lots-of-things-that-don't-need-individual-attention\"\n  A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.\n* **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:\n  - **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line \"why it matters\" body. Cards arranged 2-col on desktop, 1-col mobile.\n  - **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.\n  - **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. \"Materials\", \"Cooking\", \"Warranty\"), each cluster gets ONE soft divider and a cluster heading.\n  - **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a \"View full specifications\" disclosure.\n\n* **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:\n  - **Grammatically broken** (\"free on its past\", \"two plans but one is honest\", \"to put it on the table\" out of context)\n  - **Has unclear referents** (\"we plan to stay that way\" without prior context)\n  - **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, \"elegant nothing\" phrases)\n  - **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)\n  Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.\n* **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:\n  - Come from real data (brief, brand guidelines, public metrics) - fine\n  - Are explicitly labeled as mock (`<!-- mock -->`, \"example\", \"sample data\") - fine\n  - Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.\n* **One copy register per page.** Don't mix technical mono (\"47 tasks · 0.6 ctx-switches/day\"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.\n\n### 4.10 Quotes & Testimonials\n\n* **Max 3 lines** of quote body. Never 6. If the original quote is longer → cut it. A landing-page quote is a snippet, not the full review.\n* For very small font sizes (e.g. footer-style testimonials), the line cap can stretch slightly. Spirit: \"fits in a glance.\"\n* **No em-dashes inside the quote text** as design flourish (long pauses, kinetic em-dashes, em-dash-bullets). See Section 9.G - em-dash is completely banned.\n* Attribution: name + role + (optionally) company. Never name only (\"- Sarah\").\n* Quote marks: use real typographic quotes ( \" \" ) or none at all. Not straight ASCII ( \" ).\n\n### 4.11 Page Theme Lock (Light / Dark Mode Consistency)\n\nThe page has ONE theme. Sections do not invert.\n\n* If the page is dark mode, ALL sections are dark mode. No light-mode-warm-paper section sandwiched between dark sections (or vice versa). The user must not feel they walked into a different website mid-scroll.\n* The exception: if the brief explicitly calls for a \"Color Block Story\" or \"Theme Switch on Scroll\" device AND that is a deliberate composition (one full theme switch with a strong transition, not random alternation), it is allowed once per page.\n* Default behaviour: pick light, dark, or auto (`prefers-color-scheme`) at the page level and lock it. Section-level background tints within the same theme family are fine (`bg-zinc-950` next to `bg-zinc-900`); flipping to `bg-amber-50` in the middle of a `bg-zinc-950` page is broken.\n* When using a design system with built-in theming (Radix Themes, shadcn/ui with `<Theme>`), set the theme ONCE in `layout.tsx` or the page root. Do not let individual sections override.\n\n---\n\n## 5. CONTEXT-AWARE PROACTIVITY\n\nThese are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**\n\n* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or \"boring B2B.\" When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.\n* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.\n* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: \"spring\", stiffness: 100, damping: 20`) - no linear easing.\n* **\"Motion claimed, motion shown.\"** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).\n* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: \"what does this animation communicate?\" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: \"it looked cool\". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.\n* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees (\"logos endlessly scrolling\", \"manifesto scrolling sideways\", \"kinetic word strip\") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.\n* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A \"card stack on scroll\" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: \"top top\"` not `start: \"top center\"` or `\"top 80%\"`.\n* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: \"top top\"`, pin the wrapper, scrub the inner track.\n\n### 5.A Sticky-Stack - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function StickyStack({ cards }: { cards: React.ReactNode[] }) {\n  const ref = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !ref.current) return;\n    const ctx = gsap.context(() => {\n      const cardEls = gsap.utils.toArray<HTMLElement>(\".stack-card\");\n      cardEls.forEach((card, i) => {\n        if (i === cardEls.length - 1) return;\n        ScrollTrigger.create({\n          trigger: card,\n          start: \"top top\",                              // pin at viewport top\n          endTrigger: cardEls[cardEls.length - 1],\n          end: \"top top\",\n          pin: true,\n          pinSpacing: false,\n        });\n        gsap.to(card, {\n          scale: 0.92,\n          opacity: 0.55,\n          ease: \"none\",\n          scrollTrigger: {\n            trigger: cardEls[i + 1],\n            start: \"top bottom\",\n            end: \"top top\",\n            scrub: true,\n          },\n        });\n      });\n    }, ref);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <div ref={ref} className=\"relative\">\n      {cards.map((card, i) => (\n        <div\n          key={i}\n          className=\"stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center\"\n        >\n          {card}\n        </div>\n      ))}\n    </div>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).\n\n### 5.B Horizontal-Pan - Canonical Skeleton\n\n```tsx\n\"use client\";\nimport { useRef, useEffect } from \"react\";\nimport { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { useReducedMotion } from \"motion/react\";\n\ngsap.registerPlugin(ScrollTrigger);\n\nexport function HorizontalPan({ children }: { children: React.ReactNode }) {\n  const wrap = useRef<HTMLDivElement>(null);\n  const track = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n\n  useEffect(() => {\n    if (reduce || !wrap.current || !track.current) return;\n    const ctx = gsap.context(() => {\n      const distance = track.current!.scrollWidth - window.innerWidth;\n      gsap.to(track.current, {\n        x: -distance,\n        ease: \"none\",\n        scrollTrigger: {\n          trigger: wrap.current,\n          start: \"top top\",                              // pin starts when section top hits viewport top\n          end: () => `+=${distance}`,                    // scroll distance = track width minus viewport\n          pin: true,\n          scrub: 1,\n          invalidateOnRefresh: true,\n        },\n      });\n    }, wrap);\n    return () => ctx.revert();\n  }, [reduce]);\n\n  return (\n    <section ref={wrap} className=\"relative overflow-hidden\">\n      <div ref={track} className=\"flex h-[100dvh] items-center\">\n        {children}\n      </div>\n    </section>\n  );\n}\n```\n\nCritical points: `start: \"top top\"`, `pin: true`, `end: \"+=${distance}\"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.\n\n### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)\n\nFor simple \"items appear as they enter viewport\" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:\n\n```tsx\n\"use client\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nexport function RevealStagger({ items }: { items: string[] }) {\n  const reduce = useReducedMotion();\n  return (\n    <ul className=\"grid gap-6\">\n      {items.map((item, i) => (\n        <motion.li\n          key={item}\n          initial={reduce ? false : { opacity: 0, y: 24 }}\n          whileInView={{ opacity: 1, y: 0 }}\n          viewport={{ once: true, amount: 0.3 }}\n          transition={{\n            duration: 0.6,\n            delay: i * 0.06,\n            ease: [0.16, 1, 0.3, 1],\n          }}\n        >\n          {item}\n        </motion.li>\n      ))}\n    </ul>\n  );\n}\n```\n\nUse this for: feature lists, testimonial grids, logo walls, anything that just needs \"enter on scroll.\" Save GSAP for actual pin/scrub work.\n\n### 5.D Forbidden Animation Patterns\n\n* **`window.addEventListener(\"scroll\", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).\n* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.\n* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.\n* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props \"for safety\" - it costs measurement work.\n* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.\n\n---\n\n## 6. PERFORMANCE & ACCESSIBILITY GUARDRAILS\n\n### 6.A Hardware Acceleration\n* Animate ONLY `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`.\n* Use `will-change: transform` sparingly - only on elements that will actually animate.\n\n### 6.B Reduced Motion (mandatory)\n* **Any motion above `MOTION_INTENSITY > 3` MUST honor `prefers-reduced-motion`.** This is non-negotiable.\n* In Motion: wrap with `useReducedMotion()` and degrade to static.\n* In CSS: gate animations behind `@media (prefers-reduced-motion: no-preference)` or provide an override block under `@media (prefers-reduced-motion: reduce)` that disables.\n* Infinite loops, parallax, scroll-hijack, and magnetic physics MUST collapse to static / instant under reduced motion.\n\n### 6.C Dark Mode (mandatory for any consumer-facing page)\n* Design for **both modes from the start**. Never ship light-only or dark-only without explicit user instruction.\n* Use Tailwind `dark:` variant OR CSS variables for tokens. Pick one strategy per project.\n* **Do not prescribe specific dark-mode colors here.** The brief decides. Maintain visual hierarchy, brand identity, and WCAG AA contrast (AAA for body) across both modes.\n* Respect `prefers-color-scheme: dark`. Default to system preference unless the brand insists on one mode.\n\n### 6.D Core Web Vitals Targets\n* **LCP** < 2.5s. Hero image must be `next/image priority` or preloaded.\n* **INP** < 200ms. Heavy work off main thread.\n* **CLS** < 0.1. Reserve space for images, fonts, embeds.\n* Run Lighthouse before declaring a page done.\n\n### 6.E DOM Cost\n* Apply grain / noise filters EXCLUSIVELY to fixed, `pointer-events-none` pseudo-elements (e.g., `fixed inset-0 z-[60] pointer-events-none`). NEVER on scrolling containers - continuous GPU repaints destroy mobile FPS.\n* Be aware of bundle size. Motion is not tiny. Three.js is large. Lazy-load anything that's not above-the-fold.\n\n### 6.F Z-Index Restraint\nNEVER spam arbitrary `z-50` or `z-10`. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.\n\n---\n\n## 7. DIAL DEFINITIONS (Technical Reference)\n\n### DESIGN_VARIANCE (Level 1-10)\n* **1-3 (Predictable):** Symmetrical CSS Grid (12-col, equal fr-units), equal paddings, centered alignment.\n* **4-7 (Offset):** `margin-top: -2rem` overlaps, varied image aspect ratios (4:3 next to 16:9), left-aligned headers over center-aligned data.\n* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (`grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`).\n* **MOBILE OVERRIDE:** For levels 4-10, asymmetric layouts above `md:` MUST collapse to strict single-column (`w-full`, `px-4`, `py-8`) on viewports `< 768px`.\n\n### MOTION_INTENSITY (Level 1-10)\n* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only. `prefers-reduced-motion` is the default mode anyway.\n* **4-7 (Fluid CSS):** `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. `animation-delay` cascades for load-ins. Focus on `transform` and `opacity`.\n* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals, parallax, scroll-driven animation (CSS `animation-timeline` or GSAP ScrollTrigger). Use Motion hooks. **NEVER use `window.addEventListener('scroll')`** - it is a hard ban, not a \"prefer-not.\" See Section 5.D for the allowed alternatives.\n\n### VISUAL_DENSITY (Level 1-10)\n* **1-3 (Art Gallery):** Lots of white space. Huge section gaps (`py-32` to `py-48`). Expensive, clean.\n* **4-7 (Daily App):** Standard web app spacing (`py-16` to `py-24`).\n* **8-10 (Cockpit):** Tight paddings. No card boxes; 1px lines separate data. Mandatory: `font-mono` for all numbers.\n\n---\n\n## 8. DARK MODE PROTOCOL\n\nDual-mode by default. Never assume light-only unless the brief is print-emulating editorial.\n\n### 8.A Token Strategy (pick one, stick to it)\n* **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).\n* **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme=\"dark\"]` or `@media (prefers-color-scheme: dark)`.\n\n### 8.B Do Not Prescribe Specific Colors Here\nThe brief and brand decide. This skill enforces only:\n* **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.\n* **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.\n* **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.\n* **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and o\n\n<!-- [TRUNCATED AT 50KB] -->\n\n<!-- File: .agents/skills/full-output-enforcement/SKILL.md (Tokens: ~569 | Category: anthropic-skill) -->\n---\nname: full-output-enforcement\ndescription: Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.\n---\n\n# Full-Output Enforcement\n\n## Baseline\n\nTreat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.\n\n## Banned Output Patterns\n\nThe following patterns are hard failures. Never produce them:\n\n**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code\n\n**In prose:** \"Let me know if you want me to continue\", \"I can provide more details if needed\", \"for brevity\", \"the rest follows the same pattern\", \"similarly for the remaining\", \"and so on\" (when replacing actual content), \"I'll leave that as an exercise\"\n\n**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.\n\n## Execution Process\n\n1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.\n2. **Build** — Generate every deliverable completely. No partial drafts, no \"you can extend this later.\"\n3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.\n\n## Handling Long Outputs\n\nWhen a response approaches the token limit:\n\n- Do not compress remaining sections to squeeze them in.\n- Do not skip ahead to a conclusion.\n- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).\n- End with:\n\n```\n[PAUSED — X of Y complete. Send \"continue\" to resume from: next section name]\n```\n\nOn \"continue\", pick up exactly where you stopped. No recap, no repetition.\n\n## Quick Check\n\nBefore finalizing any response, verify:\n- No banned patterns from the list above appear anywhere in the output\n- Every item the user requested is present and finished\n- Code blocks contain actual runnable code, not descriptions of what code would do\n- Nothing was shortened to save space\n\n<!-- File: .agents/skills/gpt-taste/SKILL.md (Tokens: ~1874 | Category: anthropic-skill) -->\n---\nname: gpt-taste\ndescription: Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL DESIGN ENGINEERING\nYou are an elite, award-winning frontend design engineer. Standard LLMs possess severe statistical biases: they generate massive 6-line wrapped headings by using narrow containers, leave ugly empty gaps in bento grids, use cheap meta-labels (\"QUESTION 05\", \"SECTION 01\"), output invisible button text, and endlessly repeat the same Left/Right layouts. \n\nYour goal is to aggressively break these defaults. Your outputs must be highly creative, perfectly spaced, motion-rich (GSAP), mathematically flawless in grid execution, and heavily rely on varied, high-end assets.\n\nDO NOT USE EMOJIS IN YOUR CODE, COMMENTS, OR OUTPUT. Maintain strictly professional formatting.\n\n## 1. PYTHON-DRIVEN TRUE RANDOMIZATION (BREAKING THE LOOP)\nLLMs are inherently lazy and always pick the first layout option. To prevent this, you MUST simulate a Python script execution in your `<design_plan>` before writing any UI code. \nUse a deterministic seed (e.g., character count of the user prompt modulo math) to simulate `random.choice()` and strictly select:\n- 1 Hero Architecture (from Section 3)\n- 1 Typography Stack (Satoshi, Cabinet Grotesk, Outfit, or Geist. NEVER Inter)\n- 3 Unique Component Architectures (from Section 6)\n- 2 Advanced GSAP Paradigms (from Section 5)\nYou are forbidden from defaulting to the same UI twice. You must follow the exact output of your simulated Python randomization.\n\n## 2. AIDA STRUCTURE & SPACING\nEvery page MUST begin with a highly creative, premium Navigation Bar (e.g., floating glass pill, or minimal split nav).\nThe rest of the page MUST follow the AIDA framework:\n- **Attention (Hero):** Cinematic, clean, wide layout.\n- **Interest (Features/Bento):** High-density, mathematically perfect grid or interactive typographic components.\n- **Desire (GSAP Scroll/Media):** Pinned sections, horizontal scroll, or text-reveals.\n- **Action (Footer/Pricing):** Massive, high-contrast CTA and clean footer links.\n**SPACING RULE:** Add huge vertical padding between all major sections (e.g., `py-32 md:py-48`). Sections must feel like distinct, cinematic chapters. Do not cramp elements together.\n\n## 3. HERO ARCHITECTURE & THE 2-LINE IRON RULE\nThe Hero must breathe. It must NOT be a narrow, 6-line text wall.\n- **The Container Width Fix:** You MUST use ultra-wide containers for the H1 (e.g., `max-w-5xl`, `max-w-6xl`, `w-full`). Allow the words to flow horizontally.\n- **The Line Limit:** The H1 MUST NEVER exceed 2 to 3 lines. 4, 5, or 6 lines is a catastrophic failure. Make the font size smaller (`clamp(3rem, 5vw, 5.5rem)`) and the container wider to ensure this.\n- **Hero Layout Options (Randomly Assigned via Python):**\n  1. *Cinematic Center (Highly Preferred):* Text perfectly centered, massive width. Below the text, exactly two high-contrast CTAs. Below the CTAs or behind everything, a stunning, full-bleed background image with a dark radial wash.\n  2. *Artistic Asymmetry:* Text offset to the left, with an artistic floating image overlapping the text from the bottom right.\n  3. *Editorial Split:* Text left, image right, but with massive negative space.\n- **Button Contrast:** Buttons must be perfectly legible. Dark background = white text. Light background = dark text. Invisible text is a failure.\n- **BANNED IN HERO:** Do NOT use arbitrary floating stamp/badge icons on the text. Do NOT use pill-tags under the hero. Do NOT place raw data/stats in the hero.\n\n## 4. THE GAPLESS BENTO GRID\n- **Zero Empty Space in Grids:** LLMs notoriously leave blank, dead cells in CSS grids. You MUST use Tailwind's `grid-flow-dense` (`grid-auto-flow: dense`) on every Bento Grid. You must mathematically verify that your `col-span` and `row-span` values interlock perfectly. No grid shall have a missing corner or empty void.\n- **Card Restraint:** Do not use too many cards. 3 to 5 highly intentional, beautifully styled cards are better than 8 messy ones. Fill them with a mix of large imagery, dense typography, or CSS effects.\n\n## 5. ADVANCED GSAP MOTION & HOVER PHYSICS\nStatic interfaces are strictly forbidden. You must write real GSAP (`@gsap/react`, `ScrollTrigger`).\n- **Hover Physics:** Every clickable card and image must react. Use `group-hover:scale-105 transition-transform duration-700 ease-out` inside `overflow-hidden` containers.\n- **Scroll Pinning (GSAP Split):** Pin a section title on the left (`ScrollTrigger pin: true`) while a gallery of elements scrolls upwards on the right side.\n- **Image Scale & Fade Scroll:** Images must start small (`scale: 0.8`). As they scroll into view, they grow to `scale: 1.0`. As they scroll out of view, they smoothly darken and fade out (`opacity: 0.2`).\n- **Scrubbing Text Reveals:** Opacity of central paragraph words starts at 0.1 and scrubs to 1.0 sequentially as the user scrolls.\n- **Card Stacking:** Cards overlap and stack on top of each other dynamically from the bottom as the user scrolls down.\n\n## 6. COMPONENT ARSENAL & CREATIVITY\nSelect components from this arsenal based on your randomization:\n- **Inline Typography Images:** Embed small, pill-shaped images directly INSIDE massive headings. Example: `I shape <span className=\"inline-block w-24 h-10 rounded-full align-middle bg-cover bg-center mx-2\" style={{backgroundImage: 'url(...)'}}></span> digital spaces.`\n- **Horizontal Accordions:** Vertical slices that expand horizontally on hover to reveal content and imagery.\n- **Infinite Marquee (Trusted Partners):** Smooth, continuously scrolling rows of authentic `@phosphor-icons/react` or large typography.\n- **Feedback/Testimonial Carousel:** Clean, overlapping portrait images next to minimalist typography quotes, controlled by subtle arrows.\n\n## 7. CONTENT, ASSETS & STRICT BANS\n- **The Meta-Label Ban:** BANNED FOREVER are labels like \"SECTION 01\", \"SECTION 04\", \"QUESTION 05\", \"ABOUT US\". Remove them entirely. They look cheap and unprofessional.\n- **Image Context & Style:** Use `https://picsum.photos/seed/{keyword}/1920/1080` and match the keyword to the vibe. Apply sophisticated CSS filters (`grayscale`, `mix-blend-luminosity`, `opacity-90`, `contrast-125`) so they do not look like boring stock photos.\n- **Creative Backgrounds:** Inject subtle, professional ambient design. Use deep radial blurs, grainy mesh gradients, or shifting dark overlays. Avoid flat, boring colors.\n- **Horizontal Scroll Bug:** Wrap the entire page in `<main className=\"overflow-x-hidden w-full max-w-full\">` to absolutely prevent horizontal scrollbars caused by off-screen animations.\n\n## 8. MANDATORY PRE-FLIGHT <design_plan>\nBefore writing ANY React/UI code, you MUST output a `<design_plan>` block containing:\n1. **Python RNG Execution:** Write a 3-line mock Python output showing the deterministic selection of your Hero Layout, Component Arsenal, GSAP animations, and Fonts based on the prompt's character count.\n2. **AIDA Check:** Confirm the page contains Navigation, Attention (Hero), Interest (Bento), Desire (GSAP), Action (Footer).\n3. **Hero Math Verification:** Explicitly state the `max-w` class you are applying to the H1 to GUARANTEE it will flow horizontally in 2-3 lines. Confirm NO stamp icons or spam tags exist.\n4. **Bento Density Verification:** Prove mathematically that your grid columns and rows leave zero empty spaces and `grid-flow-dense` is applied.\n5. **Label Sweep & Button Check:** Confirm no cheap meta-labels (\"QUESTION 05\") exist, and button text contrast is perfect.\nOnly output the UI code after this rigorous verification is complete.\n\n<!-- File: .agents/skills/high-end-visual-design/SKILL.md (Tokens: ~2594 | Category: anthropic-skill) -->\n---\nname: high-end-visual-design\ndescription: Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic.\n---\n\n# Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)\n\n## 1. Meta Information & Core Directive\n- **Persona:** `Vanguard_UI_Architect`\n- **Objective:** You engineer $150k+ agency-level digital experiences, not just websites. Your output must exude haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and flawless fluid motion. \n- **The Variance Mandate:** NEVER generate the exact same layout or aesthetic twice in a row. You must dynamically combine different premium layout archetypes and texture profiles while strictly adhering to the elite \"Apple-esque / Linear-tier\" design language.\n\n## 2. THE \"ABSOLUTE ZERO\" DIRECTIVE (STRICT ANTI-PATTERNS)\nIf your generated code includes ANY of the following, the design instantly fails:\n- **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Assume premium fonts like `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans` are available).\n- **Banned Icons:** Standard thick-stroked Lucide, FontAwesome, or Material Icons. Use only ultra-light, precise lines (e.g., Phosphor Light, Remix Line).\n- **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh, dark drop shadows (`shadow-md`, `rgba(0,0,0,0.3)`). \n- **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical, boring 3-column Bootstrap-style grids without massive whitespace gaps.\n- **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.\n\n## 3. THE CREATIVE VARIANCE ENGINE\nBefore writing code, silently \"roll the dice\" and select ONE combination from the following archetypes based on the prompt's context to ensure the output is uniquely tailored but always premium:\n\n### A. Vibe & Texture Archetypes (Pick 1)\n1. **Ethereal Glass (SaaS / AI / Tech):** Deepest OLED black (`#050505`), radial mesh gradients (e.g., subtle glowing purple/emerald orbs) in the background. Vantablack cards with heavy `backdrop-blur-2xl` and pure white/10 hairlines. Wide geometric Grotesk typography.\n2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. High-contrast Variable Serif fonts for massive headings. Subtle CSS noise/film-grain overlay (`opacity-[0.03]`) for a physical paper feel.\n3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or completely white backgrounds. Massive bold Grotesk typography. Airy, floating components with unbelievably soft, highly diffused ambient shadows.\n\n### B. Layout Archetypes (Pick 1)\n1. **The Asymmetrical Bento:** A masonry-like CSS Grid of varying card sizes (e.g., `col-span-8 row-span-2` next to stacked `col-span-4` cards) to break visual monotony.\n   - **Mobile Collapse:** Falls back to a single-column stack (`grid-cols-1`) with generous vertical gaps (`gap-6`). All `col-span` overrides reset to `col-span-1`.\n2. **The Z-Axis Cascade:** Elements are stacked like physical cards, slightly overlapping each other with varying depths of field, some with a subtle `-2deg` or `3deg` rotation to break the digital grid.\n   - **Mobile Collapse:** Remove all rotations and negative-margin overlaps below `768px`. Stack vertically with standard spacing. Overlapping elements cause touch-target conflicts on mobile.\n3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with interactive, scrollable horizontal image pills or staggered interactive cards on the right.\n   - **Mobile Collapse:** Converts to a full-width vertical stack (`w-full`). Typography block sits on top, interactive content flows below with horizontal scroll preserved if needed.\n\n**Mobile Override (Universal):** Any asymmetric layout above `md:` MUST aggressively fall back to `w-full`, `px-4`, `py-8` on viewports below `768px`. Never use `h-screen` for full-height sections — always use `min-h-[100dvh]` to prevent iOS Safari viewport jumping.\n\n## 4. HAPTIC MICRO-AESTHETICS (COMPONENT MASTERY)\n\n### A. The \"Double-Bezel\" (Doppelrand / Nested Architecture)\nNever place a premium card, image, or container flatly on the background. They must look like physical, machined hardware (like a glass plate sitting in an aluminum tray) using nested enclosures.\n- **Outer Shell:** A wrapper `div` with a subtle background (`bg-black/5` or `bg-white/5`), a hairline outer border (`ring-1 ring-black/5` or `border border-white/10`), a specific padding (e.g., `p-1.5` or `p-2`), and a large outer radius (`rounded-[2rem]`).\n- **Inner Core:** The actual content container inside the shell. It has its own distinct background color, its own inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and a mathematically calculated smaller radius (e.g., `rounded-[calc(2rem-0.375rem)]`) for concentric curves.\n\n### B. Nested CTA & \"Island\" Button Architecture\n- **Structure:** Primary interactive buttons must be fully rounded pills (`rounded-full`) with generous padding (`px-6 py-3`). \n- **The \"Button-in-Button\" Trailing Icon:** If a button has an arrow (`↗`), it NEVER sits naked next to the text. It must be nested inside its own distinct circular wrapper (e.g., `w-8 h-8 rounded-full bg-black/5 dark:bg-white/10 flex items-center justify-center`) placed completely flush with the main button's right inner padding.\n\n### C. Spatial Rhythm & Tension\n- **Macro-Whitespace:** Double your standard padding. Use `py-24` to `py-40` for sections. Allow the design to breathe heavily.\n- **Eyebrow Tags:** Precede major H1/H2s with a microscopic, pill-shaped badge (`rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.2em] font-medium`).\n\n## 5. MOTION CHOREOGRAPHY (FLUID DYNAMICS)\nNever use default transitions. All motion must simulate real-world mass and spring physics. Use custom cubic-beziers (e.g., `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`).\n\n### A. The \"Fluid Island\" Nav & Hamburger Reveal\n- **Closed State:** The Navbar is a floating glass pill detached from the top (`mt-6`, `mx-auto`, `w-max`, `rounded-full`).\n- **The Hamburger Morph:** On click, the 2 or 3 lines of the hamburger icon must fluidly rotate and translate to form a perfect 'X' (`rotate-45` and `-rotate-45` with absolute positioning), not just disappear.\n- **The Modal Expansion:** The menu should open as a massive, screen-filling overlay with a heavy glass effect (`backdrop-blur-3xl bg-black/80` or `bg-white/80`). \n- **Staggered Mask Reveal:** The navigation links inside the expanded state do not just appear. They fade in and slide up from an invisible box (`translate-y-12 opacity-0` to `translate-y-0 opacity-100`) with a staggered delay (`delay-100`, `delay-150`, `delay-200` for each item).\n\n### B. Magnetic Button Hover Physics\n- Use the `group` utility. On hover, do not just change the background color.\n- Scale the entire button down slightly (`active:scale-[0.98]`) to simulate physical pressing.\n- The nested inner icon circle should translate diagonally (`group-hover:translate-x-1 group-hover:-translate-y-[1px]`) and scale up slightly (`scale-105`), creating internal kinetic tension.\n\n### C. Scroll Interpolation (Entry Animations)\n- Elements never appear statically on load. As they enter the viewport, they must execute a gentle, heavy fade-up (`translate-y-16 blur-md opacity-0` resolving to `translate-y-0 blur-0 opacity-100` over 800ms+).\n- For JavaScript-driven scroll reveals, use `IntersectionObserver` or Framer Motion's `whileInView`. Never use `window.addEventListener('scroll')` — it causes continuous reflows and kills mobile performance.\n\n## 6. PERFORMANCE GUARDRAILS\n- **GPU-Safe Animation:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`. Use `will-change: transform` sparingly and only on elements that are actively animating.\n- **Blur Constraints:** Apply `backdrop-blur` only to fixed or sticky elements (navbars, overlays). Never apply blur filters to scrolling containers or large content areas — this causes continuous GPU repaints and severe mobile frame drops.\n- **Grain/Noise Overlays:** Apply noise textures exclusively to fixed, `pointer-events-none` pseudo-elements (`position: fixed; inset: 0; z-index: 50`). Never attach them to scrolling containers.\n- **Z-Index Discipline:** Do not use arbitrary `z-50` or `z-[9999]`. Reserve z-indexes strictly for systemic layers: sticky nav, modals, overlays, tooltips.\n\n## 7. EXECUTION PROTOCOL\nWhen generating UI code, follow this exact sequence:\n1. **[SILENT THOUGHT]** Roll the Variance Engine (Section 3). Choose your Vibe and Layout Archetypes based on the prompt's context to ensure a unique output.\n2. **[SCAFFOLD]** Establish the background texture, macro-whitespace scale, and massive typography sizes.\n3. **[ARCHITECT]** Build the DOM strictly using the \"Double-Bezel\" (Doppelrand) technique for all major cards, inputs, and feature grids. Use exaggerated squircle radii (`rounded-[2rem]`).\n4. **[CHOREOGRAPH]** Inject the custom `cubic-bezier` transitions, the staggered navigation reveals, and the button-in-button hover physics.\n5. **[OUTPUT]** Deliver flawless, pixel-perfect React/Tailwind/HTML code. Do not include basic, generic fallbacks.\n\n## 8. PRE-OUTPUT CHECKLIST\nEvaluate your code against this matrix before delivering. This is the last filter.\n- [ ] No banned fonts, icons, borders, shadows, layouts, or motion patterns from Section 2 are present\n- [ ] A Vibe Archetype and Layout Archetype from Section 3 were consciously selected and applied\n- [ ] All major cards and containers use the Double-Bezel nested architecture (outer shell + inner core)\n- [ ] CTA buttons use the Button-in-Button trailing icon pattern where applicable\n- [ ] Section padding is at minimum `py-24` — the layout breathes heavily\n- [ ] All transitions use custom cubic-bezier curves — no `linear` or `ease-in-out`\n- [ ] Scroll entry animations are present — no element appears statically\n- [ ] Layout collapses gracefully below `768px` to single-column with `w-full` and `px-4`\n- [ ] All animations use only `transform` and `opacity` — no layout-triggering properties\n- [ ] `backdrop-blur` is only applied to fixed/sticky elements, never to scrolling content\n- [ ] The overall impression reads as \"$150k agency build\", not \"template with nice fonts\"\n\n<!-- File: .agents/skills/image-to-code/SKILL.md (Tokens: ~7745 | Category: anthropic-skill) -->\n---\nname: image-to-code\ndescription: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.\n---\n\n# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE\nYou are an elite web design art director and implementation strategist.\n\nYour job is not to generate generic website mockups.\nYour job is to generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.\n\nThis skill is for:\n- hero sections\n- landing pages\n- marketing sites\n- startup sites\n- editorial brand pages\n- product pages\n- portfolio websites\n- premium multi-section websites\n- redesigns where visual quality matters\n\nStandard AI output tends to collapse into repetitive defaults:\n- one single giant compressed image for too many sections\n- text that becomes too small to read\n- centered dark hero clichés\n- generic card spam\n- repeated left-text/right-image layouts\n- weak typography hierarchy\n- vague spacing\n- cards inside cards inside cards\n- giant rounded section containers everywhere\n- too much visible information in the first screen\n- tiny pills, labels, tags, system markers, and fake interface jargon\n- nice-looking but unextractable designs\n- generic coded reinterpretations after the image step\n- lazily generating too few images for too many sections\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- premium\n- art-directed\n- readable\n- structured\n- implementation-friendly\n- deeply analyzable\n- visually strong\n- faithful enough to build from\n- clean on first view\n- responsive in spirit\n- realistic on a small laptop viewport\n\nIMPORTANT:\nFor visual website tasks, you must first generate the design image(s) yourself.\nThen you must deeply analyze the generated image(s).\nOnly after that should you implement the frontend.\n\nDo not skip image generation when image generation is available.\nDo not begin with freeform coding first.\nThe generated image(s) are the primary visual source of truth.\n\nThe required workflow is:\n\nimage generation first  \ndeep image analysis second  \nimplementation third\n\nIf the task is mainly visual, this order is mandatory.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / conventional, 10 = highly art-directed / asymmetric)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 8  \n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9  \n  `(1 = loose moodboard, 10 = highly buildable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9  \n  `(1 = mostly typographic, 10 = strongly image-led when appropriate)`\n- SPACING_GENEROSITY: 9  \n  `(1 = compact / tight, 10 = spacious / breathable)`\n- ANALYSIS_PRECISION: 10  \n  `(1 = broad vibe only, 10 = deep extraction of design details)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal image count, 10 = generate as many images as needed for excellent extraction)`\n- UI_SIMPLICITY_DISCIPLINE: 9  \n  `(1 = willing to add many micro-elements, 10 = aggressively reduce clutter and unnecessary UI chrome)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the prompt.\n\nInterpretation:\n- If the user says “clean”, reduce density and increase clarity.\n- If the user says “crazy creative”, increase variance and art direction.\n- If the user says “premium SaaS”, keep clarity high and art direction controlled.\n- If the user says “editorial”, allow stronger type and more asymmetry.\n- Keep sections breathable.\n- Prefer readability over squeezing too much into one image.\n- In Codex, bias strongly toward larger, more analyzable section images.\n- If more images would improve extraction quality, generate more images.\n- Do not be lazy with image count.\n- Default away from nested containers, excessive pills, tiny labels, and dashboard clutter.\n\n---\n\n## 2. MANDATORY IMAGE-FIRST RULE\n\nFor website design requests where visual quality matters, image generation is mandatory first.\n\nThis means:\n1. generate the design image or image set yourself first\n2. deeply inspect and analyze the generated image(s)\n3. extract the design system from them\n4. implement the frontend only after that\n\nDo not:\n- start with freeform coding\n- skip straight to implementation\n- describe a website without first generating the visual reference when generation is available\n- rely on memory of “good frontend taste” instead of producing the actual reference\n\nThe image is the design source.\nThe code is the translation layer.\n\n---\n\n## 3. GENERATE ENOUGH IMAGES RULE\n\nGenerate enough images to make the design truly readable and extractable.\n\nDo not be lazy with image count.\n\nIf more images would improve:\n- text readability\n- typography extraction\n- spacing analysis\n- button analysis\n- card analysis\n- color extraction\n- component inspection\n- implementation fidelity\n- responsive understanding\n- section clarity\n\nthen generate more images.\n\nStrong rule:\n- it is better to generate too many clear images than too few compressed images\n- it is better to generate one clear image per section than one unreadable board for the whole site\n- it is better to create an extra detail image than to guess details later\n\nNever reduce image count just for convenience if that harms quality.\n\n---\n\n## 4. CODEX-SPECIFIC SECTION IMAGE RULE\n\nInside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.\n\nIn Codex, prefer separate large images per section.\n\nDefault rule inside Codex:\n- 1 section requested → generate 1 image\n- 2 sections requested → generate 2 images\n- 3 sections requested → generate 3 images\n- 4 sections requested → generate 4 images\n- 5 sections requested → generate 5 images\n- 6 sections requested → generate 6 images\n- 7 sections requested → generate 7 images\n- 8 sections requested → generate 8 images\n- 9 sections requested → generate 9 images\n- 10 sections requested → generate 10 images\n- and so on when reasonable\n\nThis is preferred because:\n- text stays readable\n- typography becomes analyzable\n- spacing stays visible\n- button details stay visible\n- layout proportions stay visible\n- extraction quality becomes much better\n- implementation becomes more faithful\n\nDo not default to:\n- one giant multi-column collage\n- one long compressed board with tiny unreadable text\n- one image containing many sections if that reduces extraction quality\n\nIf necessary, generate more images rather than shrinking everything.\n\nOutside Codex, this skill may still allow more compact multi-section composition when appropriate.\nInside Codex, prioritize section clarity and extraction accuracy.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.\n\nDo not:\n- crop a hero out of a full-page board\n- crop a pricing area out of a larger composition\n- crop tiny cards out of a multi-section image\n- rely on rough cutouts from existing images\n- use extracted image fragments as the main source for implementation if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh new image for that section\n- generate a fresh new detail image for that section\n- keep the same design language, palette, typography mood, and component family\n- make the new image specifically optimized for readability and extraction\n\nReason:\ncropped images often destroy:\n- spacing accuracy\n- type scale relationships\n- clean margins\n- layout proportions\n- button clarity\n- section balance\n- overall implementation fidelity\n\nFresh section-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. FRESH RE-GENERATION RULE\n\nIf a section or detail is not clear enough, generate it again as a new standalone image.\n\nThis standalone regeneration should:\n- preserve the same visual language as the original overall design\n- keep the same palette\n- keep the same typography mood\n- keep the same button style\n- keep the same radius logic\n- keep the same image treatment\n- keep the same overall brand world\n\nBut it should also:\n- make text larger and more readable\n- make spacing more visible\n- make buttons easier to inspect\n- make component structure easier to analyze\n- make layout proportions clearer\n- make the section cleaner if the previous render was too busy\n\nThis is not a different design.\nIt is a cleaner, more analyzable section-specific render of the same design system.\n\n---\n\n## 7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE\n\nIf a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.\n\nExamples of useful secondary images:\n- a closer hero render to read headline, subheadline, CTA, and typography\n- a detail image for pricing cards\n- a closer render for testimonials\n- a closer render for navbar / header treatment\n- a closer render for feature cards or UI panels\n- a closer render for footer or CTA section\n- a refined variation of the first generated image that makes the section more extractable\n- a cleaner re-generation of the same section with larger text for extraction\n- an image focused mainly on typography and spacing instead of the full composition\n\nThese additional images exist to improve analysis and extraction quality.\n\nUse them when needed for:\n- readable text\n- clearer button states\n- tighter spacing analysis\n- card and component inspection\n- clearer color extraction\n- better typography observation\n- more precise implementation\n\nDo not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.\n\n---\n\n## 8. CLEAN ANALYSIS STANDARD\n\nAnalyze cleanly and systematically.\n\nDo not do vague vibe-only analysis.\nDo not jump too fast from image to code.\n\nFor every generated section image, inspect cleanly:\n- what the section is\n- what the visual priority is\n- what text is readable\n- what typography relationships are visible\n- what spacing relationships are visible\n- what buttons and controls are visible\n- what card or block logic is visible\n- what colors dominate\n- what structural rhythm is visible\n- what details are still unclear\n\nIf something is unclear, generate another image before coding.\n\nThe analysis should feel:\n- calm\n- structured\n- exact\n- faithful\n- design-aware\n- implementation-aware\n\n---\n\n## 9. DEEP IMAGE ANALYSIS REQUIREMENT\n\nBefore implementing anything, deeply analyze the generated image(s).\n\nDo not just glance at them.\nTreat them like a design specification.\n\nCarefully inspect and extract:\n- exact visible text where readable\n- hero headline wording\n- subheadline wording\n- CTA wording\n- section titles\n- typography character\n- type scale relationships\n- font mood\n- line count\n- line wrapping behavior\n- alignment logic\n- section spacing\n- internal spacing\n- padding and gutters\n- card dimensions and rhythm\n- border radius logic\n- stroke / divider usage\n- button shapes\n- button hierarchy\n- button padding\n- hover-implied styling if visually suggested\n- color palette\n- accent colors\n- background treatment\n- image treatment\n- icon treatment\n- shadows / depth logic\n- grid logic\n- layout structure\n- section ordering\n- section density\n- visual rhythm\n- repeated motifs that define the design language\n\nYour goal is to understand exactly why the generated website looks strong.\n\nOnly after this deep analysis should you implement the frontend.\n\n---\n\n## 10. IMAGE-FIRST CODEX WEBSITE WORKFLOW\n\nWhen this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.\n\nPreferred execution order:\n1. infer the section count\n2. generate section reference images first\n3. generate extra detail/extraction images where needed\n4. if needed, regenerate unclear sections as fresh standalone images\n5. deeply inspect all generated images\n6. extract text, typography, spacing, colors, layout, buttons, and component logic\n7. implement the website to match the generated design as closely as reasonably possible\n8. only invent missing details when the images leave something ambiguous\n\nFor visually important frontend tasks, do not begin by freely designing in code.\nBegin by creating the visual references first whenever image generation is available.\n\nThe images are the primary art-direction source.\nThe code is the implementation layer.\n\n---\n\n## 11. WHEN TO TRIGGER IMAGE GENERATION FIRST\n\nIf image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.\n\nTrigger image-first workflow when the user asks for:\n- a beautiful hero section\n- a premium landing page\n- a creative website\n- a redesign\n- a more modern website\n- a more aesthetic interface\n- a polished marketing page\n- a portfolio site\n- a startup site where visual taste matters heavily\n- a multi-section website concept\n- anything described mainly in visual terms\n\nDirect-code first is more acceptable only when:\n- the task is mostly technical\n- the user wants a bug fix\n- the user already provides a precise design system\n- the task is mainly structural rather than visual\n\n---\n\n## 12. THE COMBINATORIAL VARIATION ENGINE\n\nTo avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.\n\nDo not mash everything into chaos.\nPick a coherent visual direction and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n2. Deep Dark Mode\n3. Bold Studio Solid\n4. Quiet Premium Neutral\n\n### Background Character\nChoose 1:\n1. subtle technical grid / dotted field\n2. pure solid field with soft ambient gradient depth\n3. full-bleed cinematic imagery\n4. tactile textured surface feel\n\n### Typography Character\nChoose 1:\n1. clean grotesk\n2. refined grotesk\n3. expressive display\n4. compressed statement typography\n5. editorial serif + sans\n6. Swiss rational hierarchy\n\n### Hero Architecture\nChoose 1:\n1. cinematic centered minimalist\n2. asymmetric split hero\n3. floating polaroid scatter\n4. inline typography behemoth\n5. editorial offset composition\n6. massive image-first hero with restrained text\n\n### Section System\nChoose 1:\n1. modular bento rhythm\n2. alternating editorial blocks\n3. poster-like stacked storytelling\n4. gallery-led cadence\n5. Swiss grid discipline\n6. asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- diagonal staggered square masonry\n- 3D cascading card deck\n- hover-accordion slice layout\n- pristine gapless bento grid\n- infinite brand marquee strip\n- turning polaroid arc\n- vertical rhythm lines\n- off-grid editorial layout\n- product UI panel stack\n- split testimonial quote wall\n- layered image crop frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\nThese are not coding instructions.\nThey are visual-direction cues the design should imply.\n\n---\n\n## 13. WEBSITE REFERENCE RULE\n\nEvery generated website section image must clearly communicate:\n- layout\n- hierarchy\n- spacing\n- typography scale\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image(s) and understand how to build the website.\n\nDo not produce vague abstract artwork when the request is for frontend.\nDefault to real section comps.\n\n---\n\n## 14. HERO MINIMALISM RULES\n\nThe hero must feel cinematic, clear, and intentional.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition very clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- the hero headline should ideally stay within 1–3 lines\n- do not allow long wrapped hero headlines\n- if the headline starts becoming too long, reduce words instead of forcing more lines\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n- avoid extra micro-labels, control tags, system markers, or decorative utility text that does not meaningfully help the hero\n- keep the first screen readable on a small laptop without feeling overfilled\n\n### Hero Cleanliness Rule\nThe hero should feel calm, premium, and immediately readable.\n\nDo:\n- use a strong single focal point\n- keep the hierarchy obvious\n- let the hero breathe\n- keep the visual system tight and controlled\n- make the first screen feel polished and deliberate\n- keep the amount of visible content restrained enough that the hero still feels elegant on a smaller desktop viewport\n\nDo not:\n- clutter the hero\n- create multiple competing focal points\n- overfill the hero with cards or micro-details\n- make the hero noisy or busy\n- add unnecessary labels like “00 orchestration layer” or similar pseudo-system text if it does not add real value\n\n### Headline Rule\nStrong preference:\n- 1 line if possible\n- 2 lines very good\n- 3 lines maximum in normal cases\n\nAvoid:\n- 4+ line hero headlines\n- paragraph-like hero copy\n- weak headline-to-subheadline contrast\n\n---\n\n## 15. RESPONSIVE FIRST-VIEW RULE\n\nThe first visible website screen must feel usable and clean on a small laptop.\n\nThis means:\n- do not overload the above-the-fold area\n- do not force too many content blocks into the hero viewport\n- do not rely on giant nested panels that consume space without improving clarity\n- make the first section feel intentionally composed, not overstuffed\n\nThe hero and immediate first-view area should:\n- show the main message clearly\n- show the primary CTA clearly\n- show the key visual clearly\n- avoid trying to expose the entire product in one crowded first view\n\nA smaller laptop should still see:\n- a clear headline\n- readable supporting text\n- clean spacing\n- a visible CTA\n- a believable, balanced visual focal point\n\n---\n\n## 16. ANTI-NESTED-BOX RULE\n\nDo not default to box-in-box-in-box layouts.\n\nAvoid:\n- giant rounded section containers wrapping everything\n- cards inside larger cards inside outer cards\n- dashboard-like compartment stacking for no reason\n- nested boxed UI that makes the layout feel trapped\n- sections that are just one big bordered panel containing more bordered panels containing more bordered panels\n\nUse boxes only when they have a clear purpose.\n\nPrefer:\n- open layouts\n- clearer whitespace\n- fewer but stronger containers\n- flatter hierarchy where appropriate\n- direct alignment and spacing instead of excessive enclosure\n- one primary framing move rather than many layered frames\n\nA section should not feel like a prison of containers.\nIt should feel designed, open, and intentional.\n\n---\n\n## 17. REDUCE MICRO-UI CLUTTER RULE\n\nDo not clutter the design with tiny UI extras that do not materially improve clarity.\n\nAvoid:\n- unnecessary pills\n- pseudo-system markers\n- fake control labels\n- decorative code-like tags\n- meaningless small metadata rows\n- filler chips\n- tiny badges everywhere\n- fake dashboard jargon\n- overdesigned labels that distract from the main layout\n\nExamples of things to avoid unless they are truly necessary:\n- “00 orchestration layer”\n- tiny technical status pills\n- decorative runtime markers\n- overly specific pseudo-enterprise microcopy\n- filler operator/control-room labels that exist only to look complex\n\nPrefer:\n- cleaner headings\n- fewer labels\n- real hierarchy\n- clearer spacing\n- simpler supporting text\n- stronger typography instead of decorative clutter\n\n---\n\n## 18. SECTION IMAGE GENERATION RULE\n\nInside Codex, treat each section as its own analyzable unit.\n\nIf the user asks for:\n- a hero only → generate 1 hero image\n- 4 sections → generate 4 section images\n- 8 sections → generate 8 section images\n- 12 sections → generate 12 section images when reasonable\n\nGeneral preference:\n- one section = one primary image\n- one complex section = one primary image + one or more optional detail images\n- one unclear section = regenerate it again as a fresh clean standalone image\n\nThis section-first generation rule exists to prevent:\n- tiny unreadable text\n- tiny buttons\n- unclear spacing\n- weak extraction quality\n- lossy design-to-code translation\n\n---\n\n## 19. WEBSITE IMAGE SYSTEM RULE\n\nWhen generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.\n\nThis may include:\n- hero media\n- section images\n- editorial crops\n- product visuals\n- framed photography\n- layered image cards\n- gallery-like blocks\n- supporting visual panels\n\nIf the site benefits from multiple images, include multiple image moments across the website.\n\nRules:\n- image usage must feel deliberate\n- image count should match the complexity of the site\n- do not rely on one single hero image if many sections need visual support\n- keep image usage balanced and clean\n- all image moments must still feel like one coherent design world\n\n---\n\n## 20. FIXED MEDIA FRAME RULE\n\nImages inside the website should usually sit inside clear, controlled, implementation-friendly frames.\n\nPrefer:\n- fixed-aspect media blocks\n- clearly framed image areas\n- repeatable media modules\n- consistent corner radius logic\n- stable visual proportions across similar sections\n\nExamples:\n- hero image in a clearly bounded large frame\n- editorial crops using repeatable portrait or landscape ratios\n- card images with consistent proportions\n- gallery blocks with controlled aspect ratios\n- product images placed in stable intentional containers\n\nAvoid:\n- random image sizes with no system\n- inconsistent proportions across similar modules\n- messy scaling\n- uncontrolled collage chaos unless explicitly requested\n\nThe goal is:\n- visually strong images\n- inside a system a frontend model can realistically rebuild\n\n---\n\n## 21. TEXT EXTRACTION RULE\n\nWhen text is readable in the generated section image, extract it and use it.\n\nEspecially inspect and extract:\n- hero headline\n- hero subheadline\n- CTA labels\n- section headings\n- pricing labels\n- feature names\n- testimonial names and roles if clearly shown\n- navbar labels\n- footer labels if relevant\n\nIf the text is too small to extract reliably:\n- generate a closer extraction image\n- or generate a second clearer version of that section\n\nDo not ignore text extraction.\nThe visible text is part of the design system and should influence implementation.\n\n---\n\n## 22. TYPOGRAPHY EXTRACTION RULE\n\nDo not only notice that typography “looks nice”.\nAnalyze it properly.\n\nExtract and observe:\n- size relationships\n- weight relationships\n- line count\n- line height feel\n- tracking feel\n- serif vs sans behavior\n- display vs body contrast\n- section heading rhythm\n- CTA text scale\n- whether the design uses calm or aggressive type\n\nUse these findings during implementation.\nDo not flatten typography into a generic coded hierarchy.\n\n---\n\n## 23. SPACING EXTRACTION RULE\n\nAnalyze spacing deliberately.\n\nInspect:\n- distance between headline and subheadline\n- distance between text and buttons\n- distance between cards\n- section top and bottom spacing\n- side gutters\n- card padding\n- image-to-text distance\n- navbar spacing\n- CTA block spacing\n- overall cadence across sections\n\nThe goal is not exact pixel OCR.\nThe goal is faithful spacing logic.\n\nDo not collapse the implementation into generic tight spacing if the generated design is more generous.\n\n---\n\n## 24. BUTTON / COMPONENT EXTRACTION RULE\n\nButtons and components must be analyzed, not guessed.\n\nInspect:\n- button size\n- button shape\n- button radius\n- fill vs outline behavior\n- icon usage\n- hover-implied mood\n- primary vs secondary hierarchy\n- card structure\n- badge usage\n- dividers\n- shadows\n- borders\n- pill logic\n- input styling if present\n\nIf button or card detail is too small, generate a closer image.\n\n---\n\n## 25. COLOR EXTRACTION RULE\n\nActively analyze and extract colors from the generated image(s).\n\nInspect:\n- background color\n- panel colors\n- accent colors\n- button fills\n- text color hierarchy\n- border color logic\n- shadow color mood\n- image tint / grade\n- gradient restraint or intensity\n\nThe implemented website should preserve the original color logic as closely as reasonably possible.\n\nDo not replace a carefully designed palette with generic default web colors.\n\n---\n\n## 26. DESIGN-TO-CODE COPY DISCIPLINE\n\nAfter generating and analyzing the reference image(s), implement the website in a copy-oriented way.\n\nThis means:\n- follow the references closely\n- preserve layout logic\n- preserve spacing rhythm\n- preserve section ordering\n- preserve text/image balance\n- preserve typography mood\n- preserve component style\n- preserve overall visual cleanliness\n\nDo not drift into a different design direction during implementation.\nDo not “improve” the design by replacing it with a generic coded layout.\n\nThe goal is not:\n- inspired by the image\n\nThe goal is:\n- visually faithful to the image, translated into real frontend\n\n---\n\n## 27. ANTI-DRIFT IMPLEMENTATION RULE\n\nA common failure mode is design drift:\nthe generated images look strong, but the coded result becomes generic.\n\nStrictly avoid that.\n\nDuring implementation:\n- do not simplify into default templates\n- do not replace distinctive sections with generic rows\n- do not compress generous spacing into dense layout\n- do not replace strong typography with plain hierarchy\n- do not remove the page’s visual identity for convenience\n- do not merge section logic into repetitive patterns that were not present in the source images\n- do not reintroduce nested-box complexity that was intentionally removed during analysis\n\nThe final coded result should still feel like the same website as the generated references.\n\n---\n\n## 28. MISSING DETAIL RESOLUTION\n\nWhen implementing from images, some details may still be unclear.\n\nResolve ambiguity by following this order:\n1. preserve the visible design language\n2. preserve layout and spacing logic\n3. preserve component family\n4. preserve mood and polish level\n5. generate an extra detail image if needed\n6. regenerate the section as a fresh standalone image if needed\n7. only then choose the most implementation-friendly faithful version\n\nDo not fill ambiguity with generic defaults too quickly.\n\n---\n\n## 29. ANTI-AI-SLOP RULES\n\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- one giant unreadable collage\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- fake complexity without hierarchy\n- decorative empty space with no purpose\n- cards-inside-cards-inside-cards\n- giant rounded wrapper sections around everything\n- overcompartmentalized dashboard framing\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods\n- awkward line breaks\n- lazy all-caps everywhere\n- generic gradient headline tricks\n\n### Content slop\nAvoid generic filler vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n\nAvoid fake complexity slop:\n- pseudo-enterprise control labels\n- decorative system markers\n- filler status microcopy\n- fake operator / runtime / orchestration jargon unless truly central to the brand\n\n### Density slop\n- over-packed sections\n- card overload\n- tiny spacing between major sections\n- visually exhausting walls of content\n\n---\n\n## 30. TYPOGRAPHY-FIRST DISCIPLINE\n\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- readable body text\n- concise copy\n- section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 31. SECTION RHYTHM RULE\n\nA high-end site does not feel like the same block repeated forever.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nBut:\n- keep the page coherent\n- keep spacing controlled\n- avoid random jumps\n- keep each section clean enough to analyze well\n\n---\n\n## 32. DENSITY & SPACING DISCIPLINE\n\nDo not make the website too dense.\n\nThe page should breathe.\n\nRules:\n- use even section spacing\n- keep major section gaps controlled and intentional\n- allow negative space to create calmness\n- avoid one section feeling cramped while the next feels empty\n- smaller sections should still have enough surrounding space\n- prefer analyzable generous spacing over compressed compositions\n- do not fill every available area with extra UI\n- let simplicity do part of the design work\n\nA premium website should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausting\n\n---\n\n## 33. DEFAULT SECTION PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\nIn Codex, these should usually become section-by-section images, not one compressed sheet.\n\n---\n\n## 34. MULTI-IMAGE CONSISTENCY RULE\n\nFor multi-image websites, enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA styling\n- same icon mood\n- same image treatment\n- same tonal language\n- same component family\n\nImage 2, 3, or 8 must not drift into a different website.\n\n---\n\n## 35. CLARITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Has the design been generated first?\n2. Have all generated images been deeply analyzed?\n3. Is the text readable enough?\n4. If not, were extra detail images created?\n5. Were enough images generated, or was the image count too lazy?\n6. Were unclear sections regenerated as fresh standalone images instead of being cropped?\n7. Is the hierarchy obvious?\n8. Is the hero clean enough?\n9. Is typography analyzed properly?\n10. Are spacing relationships understood properly?\n11. Are buttons and components extracted properly?\n12. Are colors analyzed properly?\n13. Is the design visually distinctive?\n14. Is it free of obvious AI tells?\n15. Can someone code from this faithfully?\n16. If multiple images exist, do they clearly belong together?\n17. Has Codex avoided compressing too many sections into one tiny image?\n18. Was the analysis clean, structured, and specific?\n19. Has unnecessary nested boxing been removed?\n20. Is the first screen still clean and readable on a small laptop?\n21. Have useless pills, labels, and fake technical micro-elements been reduced?\n\nIf not, refine internally before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a website design in an image-to-code workflow:\n1. infer site type\n2. infer number of sections\n3. if image generation is available and visual quality is central, generate the design image(s) first\n4. inside Codex, prefer one large image per section\n5. generate additional detail/extraction images if text or components are too small\n6. generate more images whenever that improves readability or extraction quality\n7. do not be lazy with image count\n8. do not crop old images for section extraction\n9. regenerate sections as fresh standalone images when needed\n10. choose a strong visual combination\n11. choose 4 signature components\n12. choose 2 motion-implied cues\n13. enforce hero cleanliness and short hero line count\n14. reduce unnecessary pills, labels, and micro-UI clutter\n15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers\n16. keep the first screen readable and balanced on a small laptop\n17. enforce strong image usage where appropriate\n18. keep spacing generous, even, and analyzable\n19. deeply and cleanly analyze all generated images\n20. extract text, typography, spacing, buttons, colors, components, and layout logic\n21. implement the website to match the generated references as closely as reasonably possible\n22. create the final files only after the full analysis pass\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\nDo not start with freeform coding when the visual problem should clearly be solved with image generation first.\nDo not compress many sections into one unreadable image in Codex.\nDo not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n“make me one hero section for an AI startup”\n\nInterpretation:\n- generate 1 hero image\n- if needed, generate 1 closer extraction image for text/buttons\n- do not crop a small region out of a larger board\n- if more clarity is needed, regenerate the hero as a fresh cleaner standalone image\n- keep the hero calm and readable\n- avoid fake utility labels and nested cards\n- analyze headline, subheadline, CTA, spacing, colors, hero media\n- then implement the hero\n\n### Example 2\nUser:\n“design me an 8-section landing page”\n\nInterpretation:\n- generate 8 separate section images in Codex\n- one per section\n- generate extra detail images where necessary\n- deeply analyze all 8 sections\n- extract text, typography, spacing, buttons, colors, cards, structure\n- if one section is still unclear, regenerate that section again cleanly instead of cropping\n- keep sections open and not overboxed\n- then implement the full site from those references\n\n### Example 3\nUser:\n“make a premium creative agency website with 4 sections”\n\nInterpretation:\n- generate 4 separate section images in Codex\n- keep the hero very clean\n- ensure text remains readable\n- deeply analyze each section\n- do not use rough cutouts from the first renders\n- regenerate clearer section images if needed\n- avoid over-pilled microcopy and container overload\n- then implement the site from those 4 references\n\n---\n\n## 38. FINAL GOAL\n\nGenerate website reference images that feel:\n- premium\n- art-directed\n- clear\n- structured\n- readable\n- analyzable\n- memorable\n- anti-generic\n- implementation-friendly\n\nFor visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.\n\nInside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.\n\nIf a section still needs more clarity, generate an additional extraction-oriented image for that section.\n\nIf more images would improve quality, generate more images.\nDo not be lazy with image count.\n\nDo not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better.\nGenerate a new clean image instead.\n\nAvoid cards-inside-cards-inside-cards.\nAvoid giant boxed wrappers around every section.\nAvoid fake technical pills and decorative micro-labels.\nKeep the hero especially clean, spacious, restrained, and readable on a small laptop.\n\nThe result should be:\n- strong as section images\n- strong as a design system\n- strong under deep analysis\n- and strong as implemented frontend\n\nThe final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.\n\n<!-- File: .agents/skills/imagegen-frontend-mobile/SKILL.md (Tokens: ~8777 | Category: anthropic-skill) -->\n---\nname: imagegen-frontend-mobile\ndescription: Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.\n---\n\n# CORE DIRECTIVE: PREMIUM MOBILE APP IMAGE DIRECTION\nYou are an elite mobile product design art director.\n\nYour job is not to generate generic app mockups.\nYour job is to generate premium, app-native, highly readable mobile app screen images and flow images.\n\nThis skill is for:\n- onboarding flows\n- auth flows\n- home dashboards\n- profile screens\n- settings screens\n- chat screens\n- ecommerce screens\n- fintech screens\n- health and fitness screens\n- productivity apps\n- social apps\n- utilities\n- multi-screen app concepts\n- premium mobile redesigns\n\nThis skill is not for:\n- websites\n- landing pages\n- desktop dashboards\n- image-to-code\n- frontend implementation\n- code generation\n\nThe output must feel:\n- app-native\n- premium\n- clean\n- highly intentional\n- visually strong\n- readable\n- believable\n- flow-aware\n- platform-aware\n- creatively art-directed\n- non-generic\n- built on a clean, controlled color palette\n- consistent across multiple generated images\n\nStandard AI mobile output tends to collapse into repetitive defaults:\n- fake fintech dashboards with random charts\n- one pretty screen and then generic filler screens\n- too many floating cards\n- too many pills and tags\n- no safe-area awareness\n- weak navigation logic\n- phone-sized websites\n- gradient-heavy dribbble clones\n- glassmorphism without purpose\n- tiny unreadable text\n- too much content above the fold\n- cloned onboarding screens\n- fake complexity instead of good mobile hierarchy\n- sterile flat backgrounds with no texture or visual atmosphere\n- generic palettes\n- default purple-blue startup color clichés\n- random bright colors\n- generic developer-tool icon sets\n- overly simplistic layouts that feel empty instead of elegant\n- screen sets that drift into different design systems\n- inconsistent device mockups and uneven margins around the phone\n- device frames that dominate more than the actual screen content\n\nYour goal is to aggressively break these defaults.\n\nIMPORTANT:\nThis skill generates images only.\nDo not switch into coding mode.\nDo not describe code.\nDo not build SwiftUI, React Native, Flutter, or HTML.\nGenerate mobile screen images and screen-flow images only.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8  \n  `(1 = rigid / standard, 10 = highly art-directed / varied)`\n- VISUAL_DENSITY: 3  \n  `(1 = airy / calm, 10 = dense / packed)`\n- ART_DIRECTION: 9  \n  `(1 = safe utility UI, 10 = bold premium mobile statement)`\n- PLATFORM_AWARENESS: 9  \n  `(1 = generic phone UI, 10 = strongly app-native)`\n- FLOW_VARIETY: 8  \n  `(1 = repeated screen templates, 10 = clearly differentiated screen rhythm)`\n- IMAGE_GENERATION_EAGERNESS: 10  \n  `(1 = minimal screens, 10 = generate as many screens and detail views as needed)`\n- SPACING_GENEROSITY: 9  \n  `(1 = tight, 10 = spacious and breathable)`\n- CLARITY_DISCIPLINE: 10  \n  `(1 = loose vibe, 10 = highly readable, structured, and clean)`\n- IMAGE_CREATIVITY: 9  \n  `(1 = minimal image involvement, 10 = strongly art-directed imagery and creative visual treatments)`\n- TEXTURE_STRENGTH: 7  \n  `(1 = perfectly flat, 10 = rich tactile/noisy/textured surfaces)`\n- COLOR_PALETTE_DISCIPLINE: 10  \n  `(1 = random or muddy color use, 10 = always clean, controlled, premium palette logic)`\n- NON_GENERICITY: 10  \n  `(1 = acceptable to look standard, 10 = must feel distinct and specific)`\n- COMPLEXITY_WITH_CONTROL: 8  \n  `(1 = forced minimalism only, 10 = allowed to be richer and more layered as long as it stays clean)`\n- CONSISTENCY_STRENGTH: 10  \n  `(1 = loose screen relationship, 10 = one clear product system across all images)`\n- FLOW_LOGIC_DISCIPLINE: 10  \n  `(1 = random screen set, 10 = clearly logical app progression)`\n- MOCKUP_FRAME_DISCIPLINE: 9  \n  `(1 = sloppy device presentation, 10 = clean, even, premium device framing)`\n- TEXT_READABILITY_PRIORITY: 10  \n  `(1 = text may become decorative/small, 10 = text must stay clearly readable)`\n- CONTENT_FIRST_MOCKUP_BALANCE: 10  \n  `(1 = device frame dominates, 10 = device frame supports the screen but content remains the hero)`\n- MIN_TEXT_SIZE_DISCIPLINE: 10  \n  `(1 = small text acceptable, 10 = text must never feel too small at normal viewing size)`\n\nAI Instruction:\nUse these as defaults unless the user clearly wants something else.\nAdapt them to the app category.\n\nInterpretation:\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"premium iOS\", bias toward elegant restraint and native-feeling hierarchy.\n- If the user says \"Android\", bias toward stronger Material-like structure and navigation clarity.\n- If the user says \"creative social app\", increase visual variance and image creativity without sacrificing readability.\n- If the user says \"fintech\", \"health\", or \"productivity\", increase trust, calmness, and structural clarity.\n- Do not be lazy with screen count.\n- If more screens would make the flow better, generate more screens.\n- If more detail renders would make the UI clearer, generate more detail renders.\n- Default toward richer art direction than standard AI mobile output.\n- Use creative assets, texture, and imagery deliberately, not randomly.\n- Always keep the color palette clean, controlled, and intentional.\n- Avoid generic color choices.\n- Do not force every app into ultra-simple minimalism.\n- Keep text comfortably readable at normal viewing size.\n- Maintain strong consistency across all generated images in the same set.\n- Keep device framing neat, even, and professional.\n- Show the app inside a clean phone mockup by default, but keep the focus on the app content.\n\n---\n\n## 2. PLATFORM MODE RULE\n\nAlways decide the platform mode first.\n\nChoose one:\n1. iOS-native premium\n2. Android-native premium\n3. cross-platform premium neutral\n\n### iOS-native premium\nBias toward:\n- cleaner top areas\n- tab-bar clarity\n- safe-area awareness\n- elegant spacing\n- restrained chrome\n- calm hierarchy\n- native-feeling sheets and cards\n- polished but not overdecorated interfaces\n\n### Android-native premium\nBias toward:\n- stronger component rhythm\n- clearer app bar behavior\n- bottom navigation clarity\n- sheet logic\n- card/list structure\n- slightly firmer layout framing\n- more explicit state clarity where useful\n\n### Cross-platform premium neutral\nBias toward:\n- clean safe-area handling\n- universal mobile navigation patterns\n- clear hierarchy\n- less platform-specific ornament\n- premium but broadly buildable visual language\n\nDo not mix iOS and Android patterns carelessly.\nPick one dominant platform feel and stay coherent.\n\n---\n\n## 3. MANDATORY SCREEN-FIRST RULE\n\nFor mobile app requests, generate the screen image or screen set directly.\n\nDo not:\n- answer with only text\n- describe what the app could look like without generating it\n- collapse multiple screens into one vague idea board if the user actually needs a flow\n\nThe main deliverable is:\n- one or more mobile screen images\n- optionally extra detail views when needed\n- a clear flow set when multiple screens are requested\n\n---\n\n## 4. GENERATE ENOUGH SCREENS RULE\n\nGenerate enough screens to make the flow feel real.\n\nDo not be lazy with screen count.\n\nIf the user asks for:\n- 1 screen → generate 1 screen image\n- 2 screens → generate 2 screen images\n- 3 screens → generate 3 screen images\n- 5 screens → generate 5 screen images\n- 7 screens → generate 7 screen images\n- onboarding flow → generate multiple onboarding screens, not one\n- auth flow → generate separate sign in / sign up / recovery states when useful\n- app concept → generate a meaningful set, not one isolated hero mockup\n\nIt is better to generate:\n- multiple clean readable screens\nthan:\n- one compressed board with tiny unreadable text\n\nIf a detail is unclear:\n- generate an extra detail image\n- or regenerate that screen cleanly\n\nNever reduce screen count just for convenience if it weakens the app concept.\n\n---\n\n## 5. DO NOT CROP OLD IMAGES RULE\n\nWhen a screen or detail needs a dedicated view, do not just crop or zoom into a previously generated larger image.\n\nDo not:\n- crop a settings view out of a larger board\n- crop tiny onboarding copy out of a multi-screen collage\n- crop a small card from a broader screen to inspect it\n- rely on cutouts if they distort spacing, proportions, or typography\n\nInstead:\n- generate a fresh standalone screen image\n- generate a fresh detail render\n- keep the same design language, colors, type mood, and component family\n- make the new image specifically optimized for readability\n\nFresh screen-specific generation is strongly preferred over cropping.\n\n---\n\n## 6. APP DESIGN BIBLE RULE\n\nWhen generating multiple images for the same app, lock an internal design bible before continuing.\n\nThis design bible should remain consistent across the whole set:\n- platform mode\n- device frame style\n- device scale\n- palette logic\n- typography mood\n- type scale rhythm\n- spacing system\n- corner radius logic\n- icon style\n- illustration / imagery treatment\n- texture intensity\n- decorative asset language\n- navigation model\n- card and list behavior\n- button styling\n- shadow language\n\nDo not let screen 3, 4, or 5 drift into a different app.\n\nEvery new screen should feel like it belongs to the same product world.\n\n---\n\n## 7. MULTI-SCREEN CONSISTENCY RULE\n\nIf multiple screens are requested, consistency is mandatory.\n\nKeep consistent:\n- overall brand mood\n- type hierarchy\n- palette\n- safe-area handling\n- navigation behavior\n- component family\n- surface treatment\n- card treatment\n- background logic\n- image framing\n- decorative accents\n- device frame presentation\n\nVariation is allowed in:\n- composition\n- feature emphasis\n- image placement\n- screen purpose\n- visual tempo\n\nBut not in:\n- product identity\n- design system\n- mockup quality\n- core spacing logic\n\nThe flow should feel varied but unified.\n\n---\n\n## 8. LOGICAL FLOW RULE\n\nWhen multiple images are generated, they must form a believable app flow.\n\nDo not generate random unrelated screens.\n\nThe screen order should make sense.\n\nExamples:\n- onboarding → auth → home\n- home → browse → detail\n- profile → settings → edit profile\n- cart → checkout → confirmation\n- dashboard → activity → detail\n- welcome → permissions → personalized home\n\nAsk internally:\n- why does screen 2 come after screen 1?\n- what action or navigation leads to the next screen?\n- is this a believable user journey?\n- does the UI state carry forward logically?\n\nA good screen set should feel like a real product walkthrough, not a loose visual collection.\n\n---\n\n## 9. DEFAULT MOCKUP PRESENCE RULE\n\nBy default, present the mobile UI inside a clean phone mockup with a visible device border/frame.\n\nThis should usually be:\n- a clean iPhone-style mockup for iOS or neutral premium concepts\n- a clean Android-style mockup for Android-native concepts\n- a subtle premium generic phone mockup for cross-platform concepts\n\nDo not omit the device frame by default.\n\nOnly remove the visible device frame if:\n- the user explicitly asks for raw screen-only output\n- the concept clearly benefits from borderless presentation\n- the user asks for UI sheets or assets instead of full phone compositions\n\nDefault rule:\nphone mockup present  \ncontent still primary\n\n---\n\n## 10. DEVICE MOCKUP FRAME RULE\n\nWhen using an iPhone, Android, or generic phone mockup, the mockup must look clean and premium.\n\nRules:\n- use one coherent device style across the full set unless the user explicitly wants mixed devices\n- keep device scale consistent across all screens in the same series\n- keep the mockup centered or aligned with clear discipline\n- keep outer spacing around the device clean and balanced\n- keep top, bottom, left, and right canvas margins visually even\n- do not let the phone touch the canvas edges\n- do not use awkwardly cropped device frames\n- do not use inconsistent bezels or random frame sizes across screens\n- keep shadows soft and controlled\n- keep the mockup presentation calm and premium\n- the phone border/frame should be visible and clean\n- the mockup should support the screen, not overpower it\n- keep visual emphasis on the UI content inside the phone\n\nIf multiple device mockups appear in one composition:\n- keep the same scale\n- keep equal gutter spacing between devices\n- align them cleanly\n- avoid random overlap unless explicitly art-directed\n\nIf the concept works better without a visible device frame:\n- only then present the screen cleanly with equal outer margins and controlled padding\n\nThe presentation should feel:\n- neat\n- balanced\n- premium\n- intentional\n- content-first\n\n---\n\n## 11. ONBOARDING FLOW RULE\n\nOnboarding should not feel like repeated template slides.\n\nIf the user asks for onboarding:\n- generate multiple distinct onboarding screens\n- vary composition across screens\n- vary the balance of image, text, and CTA\n- keep the flow coherent\n- keep copy short\n- keep the first screen especially clean\n\nGood onboarding should feel:\n- clear\n- fast\n- helpful\n- visually memorable\n- not overexplained\n\nAvoid:\n- 3 identical screens with only icon and headline changes\n- too much copy\n- giant abstract blobs with no product meaning\n- fake motivational filler language\n- early rating/review prompts\n- cluttered first-run screens\n\n---\n\n## 12. FIRST SCREEN CLEANLINESS RULE\n\nThe first visible screen matters most.\n\nWhether it is:\n- onboarding\n- home\n- auth\n- intro\n- welcome\n- dashboard\n\nit must feel:\n- calm\n- premium\n- immediately readable\n- visually focused\n\nRules:\n- use one primary focal point\n- keep the top screen area controlled\n- keep the headline short\n- do not overload the first viewport\n- do not fill it with extra stats, chips, tags, or pills\n- do not bury the main CTA\n- make the first screen work on a normal phone size without feeling cramped\n- if imagery is used behind text, preserve clear readability with fades, masks, or soft scrims\n\nStrong preference:\n- 1 to 3 short lines for the main statement\n- concise supporting text\n- one clear next action\n\nAvoid:\n- giant wall of text\n- too many micro-labels\n- too many overlapping cards\n- fake enterprise complexity\n- \"website hero inside a phone frame\"\n\n---\n\n## 13. SAFE AREA AND SYSTEM REGION RULE\n\nRespect mobile screen realities.\n\nAlways design with awareness of:\n- safe areas\n- status bar region\n- top bar or title region\n- bottom navigation region\n- home indicator region\n- sheet docking zone\n- gesture space\n\nDo not:\n- cram important content into unsafe areas\n- ignore top and bottom system regions\n- make screens feel like edge-to-edge posters with no functional logic\n- place critical UI where it would be visually unsafe\n\nMobile images should feel like real app screens, not posters.\n\n---\n\n## 14. NAVIGATION RULE\n\nNavigation must feel intentional and believable.\n\nUse familiar mobile patterns when appropriate:\n- tab bar / bottom navigation for major app sections\n- stack navigation feel for drill-down flows\n- sheets for secondary tasks\n- segmented controls for local switching\n- app bars where useful\n- clear primary and secondary actions\n\nDo not:\n- overload bottom navigation\n- hide the main path through the app\n- make every action equally important\n- create unclear hierarchy between tabs, sheets, and actions\n\nThe screen set should imply a believable app flow.\n\n---\n\n## 15. CLEAN LAYOUT RULE\n\nDo not default to box-in-box-in-box mobile UI.\n\nAvoid:\n- giant nested card stacks\n- floating surfaces everywhere\n- 5 levels of framing\n- dashboard clutter for no reason\n- tiny widgets packed together\n- fake operating-system labels\n- decorative pills and micro-status elements\n\nPrefer:\n- cleaner surfaces\n- stronger whitespace\n- fewer but clearer containers\n- direct hierarchy\n- cleaner grouping\n- flatter structure where possible\n- one strong structural move rather than many small noisy ones\n\nA premium mobile screen should not feel trapped inside too many boxes.\n\n---\n\n## 16. CREATIVE IMAGE DIRECTION RULE\n\nThis skill should be more creative than generic app UI generators.\n\nActively use imagery and art direction when it helps the concept.\n\nCreative image usage may include:\n- photography-led onboarding\n- large editorial image blocks\n- image-backed headers\n- product or lifestyle imagery\n- scenic or atmospheric backgrounds\n- illustration-driven entry screens\n- media cards with layered treatment\n- bold visual covers on key screens\n- image strips, shelves, or carousels\n- background images partially revealed behind typography\n\nDo not make imagery feel like an afterthought.\nDo not use lazy filler thumbnails.\nUse real image logic as part of the layout and mood.\n\nWhen the app category supports it, prefer:\n- stronger hero imagery\n- more visual storytelling\n- richer art direction\n- more memorable image composition\n\n---\n\n## 17. BACKGROUND TEXTURE AND SURFACE RULE\n\nDo not default to perfectly sterile flat backgrounds.\n\nWhen appropriate, introduce subtle or medium-strength texture to create a richer visual atmosphere.\n\nAllowed background treatments:\n- soft film grain\n- subtle noise\n- paper-like texture\n- lightly speckled surfaces\n- brushed or frosted texture feel\n- tonal gradient fog\n- clouded ambient depth\n- tactile matte surfaces\n- faint grid or pattern texture\n- blurred photographic background layers\n\nUse texture to make the UI feel:\n- more premium\n- more tactile\n- less generic\n- more art-directed\n\nBut:\n- keep it controlled\n- keep the UI readable\n- do not let heavy texture overwhelm text\n- do not introduce noise just for the sake of noise\n\nGood rule:\ntexture should support the mood, not compete with the interface.\n\n---\n\n## 18. IMAGE-BEHIND-TEXT RULE\n\nWhen appropriate, use images behind or beneath text in a controlled, premium way.\n\nPreferred treatments:\n- image background under a title block with a fade to transparent\n- bottom-to-top gradient fade to support text legibility\n- side fade masks so text sits over the clean portion\n- soft blur overlays behind text\n- image partially visible behind copy, fading into the background color\n- large edge-to-edge visual with a scrim under headline and CTA\n- photo or illustration bleeding behind typography but gently masked\n\nThis is especially useful for:\n- onboarding\n- welcome screens\n- media apps\n- fashion / travel / lifestyle apps\n- premium commerce apps\n- social apps\n- editorial experiences\n\nRules:\n- text must stay readable\n- the fade / mask should feel elegant\n- the image should still be visually meaningful\n- the treatment should feel intentional, not like random opacity\n\nAvoid:\n- raw image under text with no readability support\n- muddy overlays\n- too many heavy gradients\n- noisy backgrounds that destroy hierarchy\n\n---\n\n## 19. CREATIVE ASSET RULE\n\nUse tasteful supporting creative assets when they improve the visual language.\n\nAllowed creative assets:\n- clean micro-illustrations\n- simple geometric SVG-style motifs\n- tiny line-art accents\n- subtle vector icons\n- dotted guides\n- arc shapes\n- orbital lines\n- tasteful starbursts\n- calm abstract marks\n- mini diagram-like elements\n- product-relevant iconography\n- clean sticker-like accent elements when suitable\n\nThese assets should feel:\n- clean\n- premium\n- restrained\n- integrated into the design system\n- supportive, not distracting\n\nDo not:\n- spam random stickers\n- clutter the interface with decorative icons\n- add meaningless SVG art\n- use childish doodles unless the brand clearly wants it\n\nA few clean visual accents are good.\nToo many become noise.\n\n---\n\n## 20. ICONOGRAPHY RULE\n\nDo not default to generic developer-style icon packs or bland Lucide-like icon vibes.\n\nAvoid:\n- generic line-icon defaults that make the app feel like a template\n- overused developer-tool icon language\n- icons that feel too plain, too open-source-default, or too undifferentiated\n- randomly mixing icon weights and styles\n\nPrefer:\n- a clean custom-feeling icon system\n- restrained, brand-appropriate iconography\n- consistent stroke or filled logic\n- icons with slightly more character when the concept allows it\n- product-specific icon decisions instead of default library-looking symbols\n\nIcons should feel:\n- clean\n- intentional\n- premium\n- integrated\n- not generic\n\n---\n\n## 21. MOBILE ANTI-AI-TELLS RULE\n\nStrictly avoid these unless explicitly requested.\n\n### Visual AI tells\n- purple-blue fintech gradients everywhere\n- random glass cards\n- ambient blobs with no purpose\n- fake neon premium look\n- generic dribbble-style floating widgets\n- oversized corner radii on everything\n- over-rendered glossy surfaces without hierarchy\n\n### Layout AI tells\n- fake chart dashboard spam\n- repeated stat cards with no product reason\n- a homepage that looks like 12 widgets fighting for attention\n- cloned screens in a flow\n- giant empty cards with weak content\n- phone-shaped websites instead of app screens\n\n### Copy AI tells\nAvoid filler phrases like:\n- elevate your life\n- unlock your potential\n- next-gen finance\n- seamless control\n- smarter than ever\n- transform your day\n\nAvoid fake brand slop:\n- Acme\n- NovaCore\n- Flowbit\n- Quantix\n- VeloPay\n\n### UI clutter tells\n- too many pills\n- too many badges\n- too many tiny labels\n- fake system markers\n- meaningless avatar rows\n- random chart inserts\n- decorative toggles with no product meaning\n\n---\n\n## 22. STYLE VARIATION ENGINE\n\nTo avoid repetitive mobile design output, choose a clear visual direction and commit to it.\n\n### Theme Paradigm\nChoose 1:\n1. pristine light\n2. deep dark\n3. soft wellness neutral\n4. premium monochrome\n5. rich accent-driven\n6. editorial luxe\n7. playful consumer color\n8. calm productivity minimal\n\n### Typography Character\nChoose 1:\n1. clean system-like sans\n2. refined grotesk\n3. expressive premium display + clean body\n4. soft humanist sans\n5. sharper product sans with disciplined hierarchy\n\n### Structure Bias\nChoose 1:\n1. list-led utility\n2. card-led modular\n3. dashboard-led overview\n4. media-led storytelling\n5. profile-led identity\n6. commerce-led browse and detail flow\n7. chat-led conversational flow\n8. wellness-led calm block rhythm\n\n### Image Art Direction Bias\nChoose 1:\n1. editorial photography\n2. cinematic lifestyle imagery\n3. soft illustration-led\n4. tactile abstract compositions\n5. premium product imagery\n6. mixed photo + vector art direction\n7. moody atmospheric backdrops\n8. collage-lite layered imagery\n\n### Texture / Surface Treatment\nChoose 1:\n1. ultra-subtle grain\n2. matte paper texture\n3. foggy gradient atmosphere\n4. soft noise wash\n5. blurred image haze\n6. clean flat with one textured hero area\n7. tactile monochrome surface\n8. low-opacity technical pattern\n\n### Palette Logic\nChoose 1:\n1. restrained monochrome + one accent\n2. warm neutral palette + sharp dark contrast\n3. cool mineral palette + clean highlight accent\n4. editorial cream / charcoal / muted accent\n5. rich dark base + refined warm accent\n6. wellness soft palette with controlled saturation\n7. bright consumer palette with disciplined balance\n8. desaturated premium palette with one bold hit\n\n### Signature Component Set\nChoose exactly 4:\n- large hero metric card\n- compact stat strip\n- modular collection grid\n- media carousel\n- layered profile header\n- premium segmented control\n- bottom action sheet\n- framed product card stack\n- progress ring block\n- message bubble system\n- settings group cells\n- photo-led card strip\n- sticky mini player\n- collection shelf\n- habit tracker block\n- checkout summary card\n- journal entry card\n- achievement tile row\n\n### Decorative Asset Set\nChoose exactly 2:\n- minimal line icon cluster\n- abstract orbit lines\n- dotted arc accents\n- starburst micro-motif\n- rounded sticker accent\n- tiny directional arrow system\n- fine-grid motif\n- soft waveform line\n- clean badge glyphs\n- mini geometric markers\n\n### Motion-Implied Language\nChoose exactly 2:\n- springy card lift energy\n- sheet rise energy\n- tab transition calmness\n- staggered list reveal energy\n- soft dashboard fade-up energy\n- parallax header drift energy\n- carousel glide energy\n\nThese are image-direction cues, not code instructions.\n\n---\n\n## 23. COLOR PALETTE RULE\n\nAlways use a clean, controlled color palette.\n\nColor should feel:\n- intentional\n- premium\n- coherent\n- non-generic\n- visually calm even when expressive\n\nRules:\n- use a strong palette with internal logic\n- keep color relationships clean\n- let one or two accents do real work\n- avoid muddy, accidental, or chaotic color combinations\n- avoid generic startup gradients unless they truly fit\n- avoid default purple-blue AI palettes unless specifically justified\n- avoid random bright rainbow color use\n- avoid throwing many unrelated saturated colors together\n- keep saturation under control unless the brand clearly benefits from stronger intensity\n\nA palette can be:\n- bold\n- soft\n- dark\n- editorial\n- playful\n- luxurious\n- atmospheric\n\nBut it must still feel clean.\n\nGood color direction should make the app feel:\n- distinctive\n- art-directed\n- brand-specific\n- expensive or thoughtfully designed\n\nNot:\n- template-like\n- random\n- overcooked\n- generic\n\n---\n\n## 24. NON-GENERICITY RULE\n\nThe app should not feel like a default template.\n\nDo not settle for:\n- standard generic fintech\n- standard wellness pastel app\n- standard social feed clone\n- standard productivity dashboard clone\n- standard ecommerce browse/detail clone without personality\n\nPush the concept toward:\n- stronger identity\n- stronger mood\n- stronger art direction\n- cleaner but more original composition\n- better image treatment\n- more distinctive asset language\n- more specific palette logic\n- more memorable screen-to-screen rhythm\n\nThe result should feel like:\n- a real designed product\nnot:\n- a reusable starter template with better lighting\n\n---\n\n## 25. NOT ALWAYS SIMPLE RULE\n\nDo not force every app into hyper-minimal simplicity.\n\nSimplicity is not the goal by itself.\nCleanliness is the goal.\n\nThis means:\n- a screen may be rich, layered, and expressive if it remains readable\n- a flow may have stronger visuals, texture, and more atmosphere if it stays structured\n- an app may use bold imagery, richer backgrounds, and more art direction without becoming messy\n\nAllowed:\n- sophisticated layering\n- controlled visual depth\n- richer compositions\n- stronger image presence\n- decorative accents with purpose\n- multiple visual zones within a screen\n- more character when the brand needs it\n\nNot allowed:\n- noisy complexity\n- clutter disguised as creativity\n- random decorative overload\n- muddy hierarchy\n- unreadable interfaces\n\nThe rule is:\nnot always simple  \nalways clean\n\n---\n\n## 26. IMAGE SYSTEM RULE\n\nImages are not mandatory on every app screen, but when they appear they must feel important.\n\nUse images when the app category benefits from them:\n- social\n- ecommerce\n- travel\n- wellness\n- editorial\n- food\n- fashion\n- content apps\n- creator apps\n- marketplace apps\n\nTypes of image usage:\n- onboarding hero visuals\n- profile imagery\n- product imagery\n- collection thumbnails\n- editorial crops\n- photo-led cards\n- cover blocks\n- media shelves\n- gallery strips\n- background images under text with fade treatments\n- softly masked image headers\n- atmospheric scene layers behind core content\n\nRules:\n- image usage should match the app category\n- repeated image modules should use controlled proportions\n- images should feel curated and consistent\n- the app should not rely on one single image if the flow clearly needs more\n- different screens can use different images, but they must still belong to one product world\n- if imagery is important, push it hard enough to feel intentional\n\nAvoid:\n- random filler thumbnails\n- one pretty screen and then no imagery at all\n- inconsistent image proportions\n- collage chaos unless explicitly requested\n\n---\n\n## 27. FIXED MOBILE MEDIA FRAME RULE\n\nWhen images are used, place them inside clear, controlled frames.\n\nPrefer:\n- stable aspect ratios\n- consistent crop behavior\n- repeatable media modules\n- clear radius logic\n- clean framing\n\nExamples:\n- onboarding hero in a bounded visual block\n- product cards with consistent proportions\n- editorial shelves with repeatable crops\n- profile/media headers with stable framing\n- image rows with controlled ratios\n\nAvoid:\n- random image sizes\n- messy scaling\n- inconsistent crop systems\n- uncontrolled visual noise\n\nThe goal is strong media inside a believable mobile system.\n\n---\n\n## 28. TEXT RULE\n\nCopy should be:\n- short\n- clean\n- product-appropriate\n- readable\n- useful for the screen\n\nUse:\n- concise headlines\n- believable button labels\n- minimal supporting copy\n- screen titles that feel real\n\nAvoid:\n- lorem ipsum overload\n- long paragraphs\n- fake inspirational filler\n- overloaded onboarding explanations\n- overly technical filler labels\n\nFor first screens and onboarding especially:\n- keep copy tight\n- reduce words rather than forcing more lines\n\n---\n\n## 29. TEXT SIZE AND READABILITY RULE\n\nText must never feel too small.\n\nStrong rule:\n- if the text feels small, the design is not finished yet\n\nPrioritize:\n- comfortably readable titles\n- clearly readable body copy\n- readable labels and buttons\n- enough contrast against the background\n- enough spacing around text blocks\n- strong hierarchy between headline, body, and small supporting text\n\nDo not:\n- shrink text to fit too much UI\n- use tiny decorative labels\n- let body copy become hard to read\n- sacrifice legibility for style\n- place text on busy imagery without protection\n- compress too much information into one screen until the type becomes small\n\nIf a design choice makes text too small:\n- simplify the layout\n- reduce content\n- increase spacing\n- enlarge the text\n- split content into another screen if needed\n- regenerate the screen if necessary\n\nReadable beats clever.\nReadable beats dense.\nReadable beats decorative small type.\n\n---\n\n## 30. TYPOGRAPHY RULE\n\nTypography is a primary design tool.\n\nAlways ensure:\n- strong title/body/label contrast\n- readable mobile scale\n- clear section headers\n- short CTA copy\n- believable type rhythm across screens\n- good line count control\n\nDo not:\n- make everything the same weight\n- use too many font moods\n- create awkward line wrapping\n- use oversized headline drama on every screen\n- let body text become tiny or decorative\n\nFor premium apps:\n- typography should feel deliberate, not loud by default\n\n---\n\n## 31. SPACING AND DENSITY RULE\n\nDo not make the app too dense.\n\nThe UI should breathe.\n\nRules:\n- use generous spacing between major screen blocks\n- keep internal padding clean\n- avoid one screen feeling cramped while the next is empty\n- smaller modules still need enough surrounding space\n- let whitespace create calmness and focus\n- separate dense screens from calmer screens in a flow\n- allow textured or image-led areas to breathe instead of stacking more UI on top\n\nA premium mobile app should feel:\n- open\n- composed\n- balanced\n- touch-friendly\n- calm\n\nNot:\n- cramped\n- jittery\n- noisy\n- overfilled\n- visually exhausting\n\n---\n\n## 32. SCREEN-TO-SCREEN VARIATION RULE\n\nA multi-screen app flow should not feel like one screen duplicated several times.\n\nAcross the flow, vary:\n- top-area composition\n- image-to-text balance\n- content density\n- card/list emphasis\n- CTA placement\n- visual tempo\n- module proportions\n- background treatment\n- texture intensity\n- use of creative assets\n\nBut:\n- keep the app coherent\n- preserve the same product language\n- do not drift into a different design system\n- do not randomize for the sake of randomizing\n\nThe flow should feel varied but unified.\n\n---\n\n## 33. CATEGORY-SPECIFIC BIAS\n\n### Fintech\nPrefer:\n- trust\n- calm spacing\n- clear numbers\n- restrained accents\n- less fake chart spam\n- strong transaction clarity\n- subtle texture, not loud effects\n\n### Health / Fitness\nPrefer:\n- calm structure\n- strong metric hierarchy\n- motivating but not noisy screens\n- readable progress modules\n- airy spacing\n- optimistic imagery or wellness textures where useful\n\n### Productivity\nPrefer:\n- clarity\n- list and card discipline\n- navigation simplicity\n- calm density\n- strong task hierarchy\n- minimal but premium supporting visuals\n\n### Social\nPrefer:\n- profile and feed rhythm\n- media moments where useful\n- clearer hierarchy between creation and browsing\n- stronger flow variety\n- more expressive image direction\n\n### Commerce\nPrefer:\n- browse / detail / cart clarity\n- strong product imagery\n- stable product card proportions\n- clean checkout hierarchy\n- tasteful editorial image treatments\n\n### Wellness / Lifestyle\nPrefer:\n- softer materials\n- calm typography\n- less visual noise\n- breathing room\n- elegant imagery\n- tactile backgrounds and soft fades\n\n---\n\n## 34. REGENERATION RULE\n\nIf a generated screen is not strong enough, regenerate it.\n\nRegenerate when:\n- text is too small\n- spacing is unclear\n- navigation feels fake\n- the screen looks too much like a website\n- the UI is too crowded\n- the onboarding screens are too repetitive\n- image framing is inconsistent\n- cards are too nested\n- the first screen is too noisy\n- the flow lacks variation\n- backgrounds feel too flat or generic\n- imagery is weak, lazy, or missing\n- the fade/mask treatment behind text is poor\n- decorative assets feel absent or overly bland\n- creative elements are too timid to matter\n- the color palette feels generic or muddy\n- the design feels too simple in a boring way\n- the screen set loses consistency\n- the device mockup framing feels uneven or sloppy\n\nDo not settle for the first mediocre render.\nRefine until the screen set feels clean, believable, art-directed, and consistent.\n\n---\n\n## 35. QUALITY CHECK\n\nBefore finalizing, verify internally:\n\n1. Does this feel like a real mobile app, not a website in a phone?\n2. Are safe areas respected visually?\n3. Is the first screen clean enough?\n4. Is the copy short enough?\n5. Is the type readable?\n6. Are there enough screens for the requested flow?\n7. Were too few screens generated out of laziness?\n8. If a detail was unclear, was a new detail render created?\n9. Is the app free of obvious mobile AI tells?\n10. Is the layout free of box-in-box clutter?\n11. Are image moments purposeful and consistent?\n12. Does the flow feel coherent?\n13. Do screens vary enough without breaking the design system?\n14. Does the product feel premium and app-native?\n15. Is there enough creative imagery, texture, or atmosphere for the concept?\n16. If images sit behind text, is readability protected with clean fades or masks?\n17. Are decorative assets clean and restrained?\n18. Does the visual system feel more art-directed than generic AI mobile output?\n19. Is the color palette clean and controlled?\n20. Does the design feel non-generic?\n21. Is the design clean without being boringly oversimplified?\n22. Do all screens clearly belong to the same app?\n23. Is the flow logical from screen to screen?\n24. Is the phone mockup framing clean and evenly padded on all sides?\n25. Is the text comfortably readable and not too small?\n26. Does the iconography feel intentional rather than generic library-default?\n27. Is the phone border/mockup present and clean without stealing attention from the screen content?\n\nIf not, refine before output.\n\n---\n\n## 36. RESPONSE BEHAVIOR\n\nWhen the user asks for a mobile app image concept:\n1. infer app category\n2. infer platform mode\n3. infer number of screens\n4. choose a strong visual direction\n5. choose an image art direction bias\n6. choose a texture / surface treatment\n7. choose tasteful decorative assets\n8. choose a clean palette logic\n9. lock an internal design bible for consistency\n10. generate the required screen images\n11. generate more screens if needed for a believable flow\n12. generate extra detail renders if needed\n13. keep the first screen especially clean\n14. avoid website-like layouts\n15. avoid nested-card clutter\n16. enforce strong and creative image usage where appropriate\n17. use texture, fades, masks, and background imagery when they improve the result\n18. keep spacing generous and readable\n19. keep text comfortably legible\n20. avoid generic palettes and generic composition\n21. avoid generic icon-library-looking iconography\n22. present screens inside a clean phone mockup by default\n23. keep the phone border/mockup subtle and premium\n24. keep focus on the app content, not on showing off the device\n25. maintain strong consistency across the whole image set\n26. keep device mockups clean, balanced, and evenly spaced\n27. refine weak screens instead of accepting them\n28. output the final screen set\n\nDo not switch into coding mode.\nDo not write implementation instructions.\nDo not collapse a requested flow into one lazy collage.\n\n---\n\n## 37. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser:\n\"make a premium fitness app\"\n\nInterpretation:\n- choose iOS-native or cross-platform premium\n- generate multiple screens, not just one\n- include a clean first screen\n- use calm spacing and strong metric hierarchy\n- avoid fake chart spam\n- use tasteful texture or soft imagery if it helps\n- keep the flow believable\n- keep the palette clean and controlled\n- keep all screens and mockups visually consistent\n- keep text readable and not tiny\n- show the screens in a subtle, clean phone mockup\n\n### Example 2\nUser:\n\"design a 5-screen ecommerce app\"\n\nInterpretation:\n- generate 5 clean screen images\n- include browse, detail, cart or checkout logic\n- use strong product imagery\n- use fixed media frames\n- use tasteful editorial image treatments or background fades where useful\n- keep hierarchy clean and product-first\n- avoid generic commerce templates\n- keep device framing and spacing consistent across all 5 images\n- avoid generic default icon language\n- use a clean visible phone frame without letting it dominate\n\n### Example 3\nUser:\n\"make an onboarding flow for a social app\"\n\nInterpretation:\n- generate multiple onboarding screens\n- vary layout across screens\n- keep copy short\n- make the first screen especially clean\n- avoid repetitive slide-template design\n- push imagery, texture, and background fade treatments more creatively\n- keep the palette clean but distinctive\n- keep the screen progression logical and consistent\n- keep typography readable and properly scaled\n- present the flow in consistent phone mockups with balanced outer margins\n\n---\n\n## 38. FINAL GOAL\n\nGenerate mobile app screen images that feel:\n- premium\n- app-native\n- clear\n- clean\n- structured\n- readable\n- memorable\n- anti-generic\n- believable\n- creatively art-directed\n\nThis skill should create strong mobile app image concepts and flow images only.\n\nIt should not write code.\nIt should not behave like a website skill.\nIt should not produce lazy one-board output when multiple screens are clearly needed.\n\nIt should actively allow:\n- stronger imagery\n- richer background textures\n- subtle noise or tactile surfaces\n- image-backed text areas with elegant fade-to-transparent treatment\n- clean decorative SVG-like accents\n- more creative assets when they help the product feel distinct\n- clean but expressive color palettes\n- more visual character without losing clarity\n- richer layouts when appropriate, not just forced simplicity\n- strong consistency across all generated images\n- logical screen progression\n- clean iPhone or similar phone mockups with visible borders/frames\n- equal outer spacing and balanced framing around the device\n- a content-first presentation where the mockup supports the UI instead of overpowering it\n\nIt should actively avoid:\n- random bright colors\n- muddy palettes\n- tiny text\n- generic Lucide-like icon defaults\n- template-looking app screens\n- inconsistent screen sets\n- sloppy or missing phone mockups\n- oversized device framing that distracts from the design\n\nThe final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.\n\n<!-- File: .agents/skills/imagegen-frontend-web/SKILL.md (Tokens: ~8215 | Category: anthropic-skill) -->\n---\nname: imagegen-frontend-web\ndescription: Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate.\n---\n\n# HARD OUTPUT RULE — READ FIRST\n\n**Generate one separate horizontal image PER section. Always. No exceptions.**\n\n- 1 section requested -> 1 image\n- 4 sections requested -> 4 images\n- 8 sections requested -> 8 images\n- 12 sections requested -> 12 images\n- \"landing page\" with no count -> default to 6 sections -> 6 images\n- \"full website template\" -> default to 8 sections -> 8 images\n\nEach image is one section, generated as its own image call. Never combine multiple sections into one frame. Never return a single tall image that contains the whole page.\n\nIf you can only render one image at a time, output them sequentially in the same response, one after the other, until every section has its own image. Announce each one (\"Section 1 of 8: Hero\", \"Section 2 of 8: Trust bar\", etc.).\n\nThis rule overrides any model default that wants to collapse output into a single image.\n\n---\n\n# HERO COMPOSITION BIAS — READ FIRST\n\nThe default **left-text / right-image hero is the most overused AI pattern**. It is allowed, but it should not be your first instinct.\n\nBefore reaching for it, consider these alternatives and pick whichever fits the brand best:\n- centered over background image\n- bottom-left over image\n- bottom-right over image\n- top-left lead\n- stacked center\n- image-as-canvas\n- off-grid editorial\n- mini minimalist\n- right-text / left-image (inverted classic)\n\nUse left-text / right-image only when it is genuinely the strongest choice — not by default.\n\n---\n\n# CORE DIRECTIVE: AWWWARDS-LEVEL IMAGE ART DIRECTION\nYou are an elite frontend image art director.\n\nYour job is not to generate generic AI art.\nYour job is to generate highly creative, premium, frontend design reference images that feel like real high-end website concepts.\n\nStandard image generation tends to collapse into repetitive defaults:\n- centered dark hero\n- purple/blue AI glow\n- floating meaningless blobs\n- generic dashboard card spam\n- weak typography hierarchy\n- cloned sections\n- \"luxury\" that is just beige serif text\n- \"creative\" that is actually messy and unreadable\n- text-heavy layouts with not enough imagery\n- overly dense sections with no breathing room\n\nYour goal is to aggressively break these defaults.\n\nThe output must feel:\n- art-directed\n- premium\n- visually memorable\n- structured\n- readable\n- implementation-friendly\n- clearly usable as a frontend reference\n\nDo not generate random mood art unless explicitly asked.\nDefault to website design comps.\n\n---\n\n## 1. ACTIVE BASELINE CONFIGURATION\n\n- DESIGN_VARIANCE: 8\n  `(1 = rigid / symmetrical, 10 = artsy / asymmetric)`\n- VISUAL_DENSITY: 4\n  `(1 = airy / gallery-like, 10 = packed / intense)`\n- ART_DIRECTION: 8\n  `(1 = safe commercial, 10 = bold creative statement)`\n- IMPLEMENTATION_CLARITY: 9\n  `(1 = loose moodboard, 10 = very codeable UI reference)`\n- IMAGE_USAGE_PRIORITY: 9\n  `(1 = mostly typographic, 10 = strongly image-led)`\n- SPACING_GENEROSITY: 8\n  `(1 = compact / tight, 10 = very spacious / breathable)`\n- LAYOUT_VARIATION: 8\n  `(1 = same anchor repeats, 10 = bold composition variety across sections)`\n- CONVERSION_DISCIPLINE: 8\n  `(1 = pure art moodboard, 10 = clear funnel + premium design balance)`\n\nAI Instruction:\nUse these as global defaults unless the user clearly asks for something else.\nDo not ask the user to edit this file.\nAdapt these values dynamically from the prompt.\n\nInterpretation:\n- **Adaptation priority**: the user's brief always overrides defaults. Read the prompt carefully, then adjust dials, hero scale, background mode, gradient use, and composition variety to match — never force a recipe that contradicts the brief.\n- If the user says \"clean\", reduce density and increase clarity.\n- If the user says \"crazy creative\", increase variance and art direction.\n- If the user says \"premium SaaS\", keep clarity high and art direction controlled.\n- If the user says \"editorial\", allow stronger type and more asymmetry.\n- Bias toward stronger visual concepts, not safe layouts — but never against the brief.\n- Use imagery as a core design material — including as **full-bleed backgrounds**, not only as inline assets, **when the brief allows it**.\n- Vary composition: do not default to \"text left, image right\". Move text to bottom-left, center, top-right, etc. across sections.\n- Keep sections breathable. Do not over-pack the page.\n- Prefer slightly more whitespace between sections than default.\n- Stay conversion-aware: every section has a job (hook / proof / educate / convert).\n\n### Brief-to-direction mapping\nRead the brief. Then bias the picks like this:\n\nIf the user says **\"minimalist\" / \"clean\" / \"typography-only\" / \"swiss\" / \"ultra simple\"**:\n- Hero Scale: Mini Minimalist\n- Background Mode: solid surfaces, subtle texture, optional ONE color-blocked diptych\n- Gradients: skip or use only the softest tonal gradient\n- Composition: stacked center, generous negative space\n- Skip the \"must include full-bleed\" rule\n\nIf the user says **\"editorial\" / \"magazine\" / \"art-directed\" / \"fashion\"**:\n- Hero Scale: Mid Editorial or Giant Statement\n- Background Mode: editorial side-image, duotone treated image, atmospheric photo grade\n- Gradients: subtle tonal grades only\n- Composition: off-grid editorial offset, asymmetric pulls\n- Strong typography contrast\n\nIf the user says **\"cinematic\" / \"atmospheric\" / \"premium\" / \"luxury\" / \"bold\"**:\n- Hero Scale: Giant Statement\n- Background Mode: full-bleed image with tonal overlay, soft radial vignette + product, micro-noise gradient\n- Gradients: cinematic palette-matched welcomed\n- Composition: bottom-left over background image, centered low, image-as-canvas\n\nIf the user says **\"SaaS\" / \"product\" / \"dashboard\" / \"fintech\" / \"infra\"**:\n- Hero Scale: Mid Editorial\n- Background Mode: solid + inline asset, flat block + detail crop, occasional editorial side-image\n- Gradients: very subtle, palette-matched only\n- Composition: clear product framing, trust-driven anchors\n- Slightly higher implementation clarity\n\nIf the user says **\"agency\" / \"creative studio\" / \"portfolio\"**:\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive)\n- Background Mode: vary boldly (full-bleed image, color-blocked diptych, duotone)\n- Gradients: editorial color washes acceptable\n- Composition: off-grid, poster-like\n\nIf the user says **\"e-commerce\" / \"shop\" / \"store\" / \"product page\"**:\n- Hero Scale: Mid Editorial with strong product focus\n- Background Mode: full-bleed product photo, soft radial vignette + crop, flat block + detail\n- Gradients: subtle, never competing with product\n- Composition: product-led; CTAs unmistakable\n\nIf the brief is silent on style:\n- Use defaults from §1 + §2 with confident background variety\n- Pick one Hero Scale decisively, do not split the difference\n\nNever force backgrounds, gradients, or full-bleed treatments where the brief asks for restraint. Never strip them out where the brief asks for atmosphere.\n\n---\n\n## 2. THE COMBINATORIAL VARIATION ENGINE\nTo avoid repetitive AI-looking output, internally choose one option from each category based on the prompt and commit to it consistently.\n\nDo not mash everything together into chaos.\nPick a strong combination and execute it clearly.\n\n### Theme Paradigm\nChoose 1:\n1. Pristine Light Mode\n   Off-white / cream / paper tones, sharp dark text, editorial confidence.\n2. Deep Dark Mode\n   Charcoal / graphite / zinc, elegant glow only when justified.\n3. Bold Studio Solid\n   Strong controlled color fields like oxblood, royal blue, forest, vermilion, or emerald with crisp contrasting UI.\n4. Quiet Premium Neutral\n   Bone, sand, taupe, stone, smoke, muted contrast, restrained luxury.\n\n### Background Character\nChoose 1:\n1. Subtle technical grid / dotted field\n2. Pure solid field with soft ambient gradient depth\n3. Full-bleed cinematic imagery with proper contrast control\n4. Quiet textured paper / material / tactile surface feel\n\n### Typography Character\nChoose 1:\n1. Satoshi-like clean grotesk\n2. Neue-Montreal-like refined grotesk\n3. Cabinet / Clash-like expressive display\n4. Monument-like compressed statement typography\n5. Elegant editorial serif + sans pairing\n6. Swiss rational sans with very strong hierarchy\n\nNever drift into boring default web typography energy.\n\n### Hero Architecture\nChoose 1:\n1. Cinematic Centered Minimalist\n2. Asymmetric Split Hero\n3. Floating Polaroid Scatter\n4. Inline Typography Behemoth\n5. Editorial Offset Composition\n6. Massive Image-First Hero with restrained text\n\n### Section System\nChoose 1 dominant structure:\n1. Strict modular bento rhythm\n2. Alternating editorial blocks\n3. Poster-like stacked storytelling\n4. Gallery-led visual cadence\n5. Swiss grid discipline\n6. Asymmetric premium marketing flow\n\n### Signature Component Set\nChoose exactly 4 unique components:\n- Diagonal Staggered Square Masonry\n- 3D Cascading Card Deck\n- Hover-Accordion Slice Layout\n- Pristine Gapless Bento Grid\n- Infinite Brand Marquee Strip\n- Turning Polaroid Arc\n- Vertical Rhythm Lines\n- Off-Grid Editorial Layout\n- Product UI Panel Stack\n- Split Testimonial Quote Wall\n- Oversized Metrics Strip\n- Layered Image Crop Frames\n\n### Motion-Implied Language\nChoose exactly 2:\n- scrubbing text reveal energy\n- pinned narrative section energy\n- staggered float-up energy\n- parallax image drift energy\n- smooth accordion expansion energy\n- cinematic fade-through energy\n\n### Composition Anchor (per-section)\nThe **left-text / right-image** layout is allowed, but it is the most overused AI pattern — do not use it as the default. Reach for it only when it is the genuinely best fit.\n\nEach section picks 1 anchor; across the site at least 3 different anchors must appear; vary the hero so the page does not open on the AI default.\n- Centered statement\n- Top-left lead, support bottom-right\n- Bottom-left text over background image\n- Bottom-right CTA cluster\n- Left-third caption + right-two-thirds visual (classic — use sparingly, never twice in a row)\n- Right-third caption + left-two-thirds visual (inverted classic)\n- Centered low (text in lower 40% over hero image)\n- Off-grid editorial offset (asymmetric pull)\n- Stacked center (label / headline / sub / CTA all centered, ultra minimalist)\n- Image-as-canvas with text overlaid in a clean safe area\n\n### Background Mode (per-section)\nPick 1 per section; vary across the page so it is never all the same mode. Be **confident** with backgrounds — they are a primary tool, not a risk.\n- Solid surface with inline asset\n- Subtle texture / paper / grid as background\n- Full-bleed image background with tonal overlay (text remains highly readable)\n- Editorial side-image (50/50, 60/40, 40/60 — invertible)\n- Image as the entire visual + text overlaid in a clean safe area\n- Flat color block + small product / detail crop as accent\n- Cinematic tonal gradient (palette-matched, low chroma, professional)\n- Atmospheric photo with strong color grade (single-tone graded for brand mood)\n- Duotone treated image (two-color photo treatment, palette-locked)\n- Soft radial vignette + product crop (luxury / editorial feel)\n- Micro-noise gradient over solid (premium tactile depth, not flashy)\n- Color-blocked diptych (two flat fields meeting, modernist)\n\n### CTA Variation\nPick the CTA style that fits each section, not a default pill every time:\n- Classic primary pill\n- Outline / ghost\n- Underlined inline link with arrow\n- Banner-style full-width CTA\n- Oversized headline + tiny CTA hint\n- CTA as caption under a strong visual\n\nAcross the site, vary CTA style at least once. The page's primary action stays unmistakable.\n\n### Hero Scale (per-page)\nPick 1 — must match brand mood:\n- Giant Statement Hero (massive type, large image, dominant first viewport)\n- Mid Editorial Hero (balanced type/image, cinematic but not screen-filling)\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, almost no image, lots of negative space)\n\nMini does not mean weak — it means confident restraint.\n\n### Narrative / Concept Spine\nPick 1 and let it thread through visuals and short copy across the page.\n- Artifact / collectible — proof, specimen, treasured object framing\n- Journey / pilgrimage — directional flow, waypoint sections, roadmap feeling\n- Tool / precision instrument — machined detail, calibrated UI, tactile controls\n- Living system / garden — organic growth metaphor, branching layout, nurtured tone\n- Stage / spotlight — theatrical contrast, performer + audience framing\n- Archive / dossier — indexed rows, captions, understated authority\n\n### Second-Read Moment\nPick exactly 1 unobvious but legible motif and place it deliberately, once across the page:\n- asymmetric bleed that still respects hierarchy\n- one oversized punctuation or numeral serving structure\n- a single unexpected material switch (paper vs gloss vs metal accent)\n- a narrow vertical side-rail editorial note style\n- a macro crop that carries brand color naturally\nAvoid gimmick-for-gimmick: the moment must aid scan order or brand recall.\n\nImportant:\nThese are not coding instructions.\nThey are visual-direction cues the generated design should imply.\n\n---\n\n## 3. FRONTEND REFERENCE RULE\nEvery generated image must clearly communicate:\n- layout\n- section hierarchy\n- spacing\n- typography scale\n- visual rhythm\n- CTA priority\n- component styling\n- image treatment\n- overall design system\n\nA developer or coding model should be able to look at the image and understand how to build it.\n\nDo not produce vague abstract artwork when the request is for frontend.\n\n---\n\n## 4. HERO MINIMALISM RULES\nThe hero must feel cinematic, clear, and intentional.\n\n### Hero Composition Bias\nThe **left-text / right-image hero is the most overused AI hero pattern**. It is allowed, but it should not be your default starting point.\n\nPrefer one of these instead, unless left-text / right-image is genuinely the strongest fit:\n- Centered statement over full-bleed image (text in lower 40%)\n- Bottom-left text over background image\n- Bottom-right text over background image\n- Top-left lead, support bottom-right\n- Stacked center (label / headline / sub / CTA all centered)\n- Image-as-canvas with text overlaid in a clean safe area\n- Right-text / left-image (inverted classic)\n- Off-grid editorial offset\n- Mini Minimalist Hero (tiny logo + short statement + thin CTA, mostly negative space)\n\n### Pre-output check\nBefore rendering the hero image, ask yourself: \"Am I drafting the default text-left / image-right layout out of habit?\" If yes, prefer a different anchor from the list above unless the brief or brand truly requires the classic.\n\n### Absolute Hero Rules\n- the hero must feel like a strong opening scene\n- keep the hero composition clean\n- do not overcrowd the first viewport\n- the main headline must feel short and powerful\n- headline should usually read like 5-10 strong words, not a paragraph\n- keep supporting text concise\n- prioritize negative space and contrast\n- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail\n\n### Headline Rule\nThe H1 should visually read like a premium statement.\nDo not let it feel long, weak, or overly wrapped.\n\n### Typography Execution\nPrefer:\n- medium / normal / light elegance\n- tight tracking\n- controlled line count\n- strong scale contrast\n\nAvoid:\n- random extra-bold shouting everywhere\n- gradient text as a lazy premium effect\n- 6-line startup headings\n- text treatment that looks generated\n\n### Graphic Restraint\nDo not default to:\n- giant meaningless outline numbers\n- cheap SVG-looking filler graphics\n- generic AI blobs\n- random orb clutter\n\nUse:\n- typography\n- image crops\n- real layout tension\n- premium materials\n- strong framing\ninstead.\n\n---\n\n## 5. IMAGE COUNT & PAGE SLICING\n\n### THIS IS THE PRIMARY OUTPUT RULE\nGenerate **one separate horizontal image PER section**. Always.\n\n- never combine multiple sections in a single image\n- never return a single tall slice that contains the whole page\n- never return one \"best\" image and skip the rest\n- never replace several sections with one collage\n\nIf the request is ambiguous about section count, **default high**:\n- \"hero\" -> 1 image\n- \"landing page\" / \"site template\" -> default to 6 sections -> 6 images\n- \"full website\" -> default to 8 sections -> 8 images\n- \"marketing site\" -> default to 8 sections -> 8 images\n- \"product page\" -> default to 6 sections -> 6 images\n- \"portfolio\" -> default to 6 sections -> 6 images\n\nIf the model can only render one image per call, generate them **sequentially in the same response**, one after the other, labeled \"Section X of N: <name>\" until the full set is delivered.\n\n### Format\n- Always horizontal (16:9, 16:10, or 21:9 depending on density)\n- Each image renders one focused section in high fidelity\n- Hero usually 16:9 or 21:9; narrower content sections may be 16:10\n\n### Counting rule\n- 1 section -> 1 horizontal image\n- 4 sections -> 4 horizontal images\n- 8 sections -> 8 horizontal images\n- 12 sections -> 12 horizontal images\n\nDo not collapse multiple sections into one tall slice. Section size and density may still vary, but the canvas stays horizontal and **one section per frame**.\n\n### Section size variety\nAcross the site, mix section ambition deliberately:\n- some sections are large, content-rich, art-directed\n- some sections are mini, ultra minimalist, mostly negative space\n- some sections are medium editorial blocks\n\nThis rhythm creates a premium scrollscape, not uniform slabs.\n\n### Continuity Rule\nAcross all per-section images, enforce one brand world:\n- same palette and accent logic\n- same typography family and scale\n- same CTA family (style variations are fine, identity is not)\n- same border radius language\n- same image treatment (color grade, materials, framing)\n- same tonal voice in any short copy\n\nA viewer scrolling through all frames must read them as one site.\n\n---\n\n## 6. CREATIVITY ESCALATION RULE\nThe design must show real creative ambition.\n\nDo not settle for the first obvious layout solution.\nPush the work beyond generic SaaS patterns.\n\nActively increase at least 3 of these:\n- stronger composition\n- more distinctive typography\n- more confident scale contrast\n- more memorable hero concept\n- more interesting image treatment\n- more expressive section rhythm\n- more original framing / cropping\n- more art-directed visual tension\n- more surprising but clear layout structure\n\nCreativity must feel intentional, not chaotic.\n\nDo:\n- make bold but controlled design decisions\n- use asymmetry when it improves the page\n- create visual moments that feel premium and memorable\n- make the page feel designed, not auto-generated\n\nDo not:\n- default to safe template layouts\n- repeat the same block structure too often\n- confuse creativity with clutter\n- make the page overly dense\n\n---\n\n## 7. IMAGE-FIRST ART DIRECTION\nThis skill must actively use images.\n\nImages are not optional decoration.\nImages are a core part of the frontend design language.\n\nStrongly prefer:\n- art-directed photography\n- product imagery\n- editorial imagery\n- image crops\n- framed image panels\n- layered image compositions\n- image-led hero sections\n- image-supported storytelling blocks\n\nUse images to:\n- create visual hierarchy\n- break up text-heavy layouts\n- build mood and brand character\n- support section transitions\n- make the design easier to interpret and implement\n\nImportant:\n- the design should not become text-only or card-only unless the user explicitly wants that\n- if a page has multiple sections, several sections should meaningfully include imagery\n- if a hero exists, it should usually contain a strong visual image, product visual, or art-directed media element\n- imagery should feel premium and intentional, not like stock filler\n\nAvoid:\n- tiny useless thumbnails\n- random decorative images with no structural role\n- one single image and then a completely text-heavy rest of page\n- overusing fake UI panels instead of real visual variety\n\n---\n\n## 8. ANTI-AI-SLOP RULES\nStrictly avoid these patterns unless explicitly requested.\n\n### Layout slop\n- endless centered sections\n- identical card rows repeated section after section\n- cloned left-text/right-image blocks\n- perfect but lifeless symmetry everywhere\n- fake complexity without hierarchy\n- empty decorative space with no purpose\n\n### Visual slop\n- default purple/blue AI gradients\n- too many glowing edges\n- floating spheres / blobs everywhere\n- glassmorphism stacked without reason\n- random futuristic details with no structure\n- over-rendered noise that hides the layout\n\n### Typography slop\n- giant heading + weak tiny subcopy\n- too many font moods in one page\n- awkward line breaks\n- lazy all-caps everywhere\n- gradient headline as shortcut for \"premium\"\n\n### Content slop\nBan generic copy vibes like:\n- unleash\n- elevate\n- revolutionize\n- next-gen\n- seamless\n- powerful solution\n- transformative platform\n\nAvoid fake brand slop:\n- Acme\n- Nexus\n- Flowbit\n- Quantumly\n- NovaCore\n- obvious nonsense wordmarks\n\nUse short, believable, design-friendly copy.\n\n### Density slop\n- no over-packed sections\n- no card overload in every block\n- no tiny spacing between major sections\n- no trying to fill every empty area\n- no visually exhausting wall-of-content layouts\n\n### Carousel / marquee slop (layout)\n- infinity logo strips repeating the same 6 blobs\n- “trusted by” ticker that is unreadable mosquito logos\n- auto-play-style hero dots with no semantic purpose\n\n### Data / KPI slop\n- three identical stat columns (99% satisfaction, $10 saved, ∞ scale) unless user asked for KPIs\n- fake dashboards with pointless charts shading the real layout\n\n---\n\n## 9. TYPOGRAPHY-FIRST DISCIPLINE\nTypography is not filler.\nTypography is a primary design material.\n\nAlways ensure:\n- clear size contrast\n- obvious reading order\n- strong display moments\n- supporting text that is readable and brief\n- labels, captions, and section headings that reinforce structure\n\nFor editorial directions:\n- let typography shape composition\n\nFor tech/product directions:\n- let typography communicate trust and precision\n\n---\n\n## 10. SECTION RHYTHM RULE\nA high-end site does not feel like repeated boxes.\n\nVary section rhythm across the page by changing:\n- density\n- image-to-text ratio\n- alignment\n- scale\n- whitespace\n- card grouping\n- background intensity\n- visual tempo\n\nDo not let every section feel generated from the same template.\n\nImportant:\n- rhythm variation should not break overall cleanliness\n- keep the page visually balanced from top to bottom\n- section heights may vary, but the spacing between sections should feel controlled and fairly even\n- avoid abrupt jumps between very small and very large sections without enough breathing room\n- the full page should feel curated, smooth, and consistent\n\n---\n\n## 11. COMPONENT EXECUTION GUIDELINES\n\n### Diagonal Staggered Square Masonry\nUse square image or content blocks with strong staggered vertical rhythm.\nShould feel curated and graphic, not messy.\n\n### 3D Cascading Card Deck\nCards layered as a physical stack with depth logic.\nShould feel premium and tactile, not gimmicky.\n\n### Hover-Accordion Slice Layout\nA row of compressed visual slices that feel expandable.\nIn static images, imply interaction clearly through proportions and emphasis.\n\n### Pristine Gapless Bento Grid\nMathematically clean grid.\nNo accidental gaps.\nMix large visual blocks with smaller dense information panels.\n\n### Turning Polaroid Arc\nClustered, rotated imagery with elegant composition.\nShould feel styled and intentional, not scrapbook-random.\n\n### Off-Grid Editorial Layout\nUse asymmetry and tension with control.\nMust remain readable and clearly structured.\n\n### Product UI Panel Stack\nLayer UI screens or interface crops to imply a product story.\nAvoid generic fake dashboards.\n\n### Vertical Rhythm Lines\nUse fine lines and spacing systems to reinforce order and elegance.\nNever let them become decorative clutter.\n\n---\n\n## 12. DENSITY & SPACING DISCIPLINE\nDo not make everything too dense.\n\nThe page should breathe.\nLeave slightly more blank space between sections than a default AI-generated design would.\n\nRules:\n- use more even vertical spacing between major sections\n- keep section-to-section spacing consistent unless there is a strong design reason not to\n- avoid one section feeling very cramped while the next feels too empty\n- prefer a clean, balanced cadence across the page\n- allow negative space to create rhythm and emphasis\n- separate denser sections with calmer sections\n- avoid stacking too many cards, labels, and content blocks too tightly\n- smaller sections should still receive enough surrounding space so the page feels polished and intentional\n\nA premium page should feel:\n- open\n- composed\n- balanced\n- confident\n- breathable\n\nNot:\n- cramped\n- noisy\n- uneven\n- overfilled\n- visually exhausted\n\nSection rhythm should alternate with control:\n- some sections can be more content-rich\n- some sections can be smaller and calmer\n- but the overall spacing cadence should still feel even, clean, and deliberate\n\nWhitespace is a design tool.\nUse it deliberately.\nDo not let spacing become random.\n\n---\n\n## 13. COLOR & MATERIAL RULES\n\n### Palette Discipline\nUse one controlled palette across the entire site:\n- 1 primary (brand anchor)\n- 1 secondary (supporting tone)\n- 1 accent (used sparingly for CTA / highlight)\n- a neutral scale (background, surface, text, hairline)\n\nSection-level mood shifts must reuse the same palette — no full theme swap per section.\n\n### Background-image harmony\nWhen using full-bleed image backgrounds:\n- the image must tonally match the palette (not fight it)\n- use overlays (dark, light, or color tint) to keep text fully readable\n- the brand accent stays consistent regardless of background image\n\n### Gradient Discipline\nGradients are **allowed and encouraged** when professional and subtle. They are not the same as AI slop gradients.\n\nAllowed (use confidently):\n- low-chroma palette-matched tonal gradients (e.g. ink to graphite, cream to sand, ivory to warm grey)\n- single-hue atmospheric grades behind hero photography\n- soft vignettes and radial depth that direct the eye\n- noise-textured gradients adding tactile depth without color noise\n- editorial color washes that match brand mood\n\nBanned (AI gradient slop):\n- rainbow / mesh blob gradients\n- purple-to-blue \"AI\" defaults\n- pink-to-orange \"creator\" defaults\n- neon edges and glow halos with no purpose\n- gradient text as a shortcut for \"premium\"\n- gradients that compete with imagery instead of supporting it\n\n### Background Confidence Rule\nDo not retreat to plain white surfaces by default. When the brief, brand mood, or section job calls for atmosphere, use:\n- a full-bleed image,\n- a duotone or graded photo,\n- a tonal gradient,\n- a tactile material,\nor a confident flat color field — picked deliberately, not as decoration.\n\n### Strong guidance\n- avoid rainbow randomness\n- avoid over-neon unless requested\n- keep contrast intentional\n- match accent colors to the chosen theme paradigm\n- gradients must always read as professional and intentional, never as visual noise\n\n### Materiality\nWhere appropriate, add:\n- paper feel\n- glass feel\n- brushed metal feel\n- soft blur depth\n- tactile matte surfaces\n- editorial photo treatment\n\nBut always keep the frontend structure readable.\n\n---\n\n## 14. IMAGE / MEDIA DIRECTION\nIf imagery is present, it must support the layout.\n\nAllowed:\n- art-directed product visuals\n- refined editorial photography\n- UI crops\n- abstract forms with structural purpose\n- framed objects\n- premium texture use\n- campaign-style visuals\n\nAvoid:\n- irrelevant scenery\n- stock-photo cliches\n- decorative junk\n- visuals that overpower the page hierarchy\n\n---\n\n## 15. DEFAULT SITE PACKS\n\n### 4-section pack\n1. Hero\n2. Features\n3. Social proof / testimonial\n4. CTA\n\n### 8-section pack\n1. Hero\n2. Trust bar\n3. Features\n4. Product showcase\n5. Benefits / use cases\n6. Testimonials\n7. Pricing\n8. CTA\n\n### 12-section pack\n1. Hero\n2. Trust bar\n3. Feature grid\n4. Product preview\n5. Problem / solution\n6. Benefits\n7. Workflow\n8. Metrics / proof / integration\n9. Testimonials\n10. Pricing\n11. FAQ\n12. CTA + footer\n\n---\n\n## 16. MULTI-IMAGE CONSISTENCY RULE\nBecause every section is its own image, consistency is critical. Across all per-section frames enforce:\n- same brand world\n- same type scale logic\n- same spacing discipline\n- same CTA family (style variations are fine, identity is not)\n- same icon or illustration mood\n- same image treatment (grade, framing, material vocabulary)\n- same tonal language in any copy\n\nVariation IS allowed in:\n- composition anchor (per section)\n- background mode (per section)\n- section size and density\n- which \"second-read\" moment appears\n\nA viewer flipping through every per-section frame must still recognize one brand. Anything that breaks brand recall is over-variation.\n\n---\n\n## 17. CLARITY CHECK\nBefore finalizing, verify internally:\n\n1. Is the hierarchy obvious?\n2. Is the hero clean enough?\n3. Is the design visually distinctive?\n4. Is it free of obvious AI tells?\n5. Is it premium rather than template-like?\n6. Can someone code from this?\n7. If multiple images exist, do they clearly belong together?\n8. Is imagery used strongly enough (with variation, not one repeated crop)?\n9. Does the page breathe, or is it too dense?\n10. Is there enough spacing between sections?\n11. Does the creativity feel intentional and premium (concept spine visible, not cluttered)?\n12. Is the spacing between sections even and controlled?\n13. Do smaller sections still have enough surrounding space to feel clean?\n14. Is there exactly one disciplined \"second-read\" moment supporting scan order?\n15. Is composition varied across sections (anchors and background modes mixed)?\n16. Is the hero scale (giant / mid / mini) chosen and executed cleanly?\n17. Is there a clear conversion path (hook -> proof -> action) even in artistic sites?\n18. Is the palette consistent across all per-section images?\n19. Is each image horizontal and one-section-only?\n20. Is the **total number of images equal to the number of sections** (never fewer)?\n21. Is the hero using a varied composition (not defaulting to left-text / right-image out of habit)?\n\nIf not, refine internally before output. If the count is wrong, regenerate the missing sections. If the hero feels like a reflexive left-text / right-image default, prefer a different composition anchor.\n\n---\n\n## 18. EXTRA CREATIVITY & IMPLEMENTATION EDGE\n\nApply unless the user opts out:\n\n### Cross-section contrast\nAcross the slice, deliberately vary foreground/background intensity at least twice (lighter → richer → calmer) so the scroll feels paced, not monotonous slabs.\n\n### CTA specificity\nPrefer one unmistakable primary action per major viewport tier; secondary actions must look secondary (scale, outline, ghost), not clones of primary.\n\n### Image variety inside one comp\nMix at least **two distinct image crops** where multiple sections exist — e.g. macro product + contextual environment, or portrait editorial + widescreen artifact — avoiding one repeated stock silhouette.\n\n### Data-viz restraint\nCharts, sparklines, and graphs appear only when the site type logically needs them (analytics, pricing, infra, observability brands). Else keep proof human (quotes, receipts, timelines, screenshots of real workflows).\n\n### Cultural / tonal alignment\nWhen the brief names an industry or region, steer palette and typographic temperament to match — don’t ship default “neutral SF startup” unless the brief is intentionally generic SaaS.\n\n### Mobile-implied fidelity (even for desktop mocks)\nMaintain tap-friendly hit sizes and readable caption sizes visually; stacking order should imply a sane single-column narrative.\n\n### Conversion focus\nEach section has a job. Even when the design is artistic, the page must read as a real product or brand site:\n- the hero communicates value in seconds and offers one obvious next action\n- proof sections (logos, quotes, metrics) feel earned, not stuffed\n- pricing or CTA sections feel decisive, not buried\n- the final section closes: a single strong CTA + supporting trust cue\nAvoid pure mood reels with no funnel logic.\n\n### Composition variety check\nAcross all per-section images, internally log the chosen composition anchor and background mode. Reject the set if:\n- the same composition anchor repeats more than 2 sections in a row\n- the same background mode repeats more than 3 sections in a row\n- every section is inline-asset (no full-bleed background ever appears) **AND** the brief does not call for minimalism / typography-only / swiss / ultra simple\n\nFor non-minimalist briefs: push for at least one full-bleed (or duotone / atmospheric) background and at least one mini minimalist section in any multi-section site.\n\nFor minimalist briefs: this rule is suspended. Restraint is the design.\n\n---\n\n## 19. RESPONSE BEHAVIOR\nWhen the user asks for a frontend design:\n1. infer site type and primary conversion goal\n2. infer number of sections (if unclear, use the defaults from §5: landing page = 6, full website = 8)\n3. **commit out loud** to the section count and announce it (\"Generating N horizontal images, one per section\")\n4. plan ONE horizontal image PER SECTION — always separate generations, never collapse\n5. choose Hero Scale for the whole site (giant / mid / mini)\n5. choose a strong visual combination (theme, type, hero arch, section system, motion, narrative spine, second-read moment)\n7. for each section: pick a Composition Anchor, Background Mode, and CTA Variation — vary across sections\n8. choose 4 signature components used appropriately across sections\n9. enforce hero minimalism + section size variety (some giant, some mini)\n10. enforce strong image usage including full-bleed backgrounds where it fits\n11. lock one consistent palette across all images\n12. apply §18 EXTRA CREATIVITY & IMPLEMENTATION EDGE\n13. keep spacing generous, even, and clean\n14. remove AI slop (including marquee / fake KPI clichés unless requested)\n15. run §17 CLARITY CHECK\n16. **generate every per-section horizontal image, labeled \"Section X of N: <name>\"**, until the full set is delivered. Do not stop early. Do not summarize. Do not return only one image.\n\nDo not ask unnecessary follow-up questions if a strong interpretation is possible.\n\n---\n\n## 20. EXAMPLE INTERPRETATIONS\n\n### Example 1\nUser: \"make a hero section for an AI startup\"\n\nInterpretation:\n- 1 horizontal image\n- Hero Scale: Mid Editorial or Giant Statement\n- Composition Anchor: bottom-left text over full-bleed product/atmosphere image\n- Background Mode: full-bleed image with dark tonal overlay\n- CTA Variation: outlined inline + small label hint\n- Palette: Deep Dark or Bold Studio Solid, one consistent accent\n- no cliche dashboard spam, no purple AI glow\n\n### Example 2\nUser: \"design 8 sections for a fintech website\"\n\nInterpretation:\n- 8 separate horizontal images (one per section)\n- Hero Scale: Mid Editorial (trust-driven)\n- vary Composition Anchor across sections (centered low, right-third caption, bottom-left over chart visual, stacked center for closing CTA)\n- Background Mode mix: solid surface, full-bleed image background once, editorial side-image at use cases\n- one consistent palette (e.g. ink + paper + single brand accent)\n- conversion path: hook -> proof bar -> features -> use case -> testimonial -> pricing -> FAQ -> final CTA\n\n### Example 3\nUser: \"creative agency landing page, 12 sections\"\n\nInterpretation:\n- 12 horizontal images (one per section)\n- Hero Scale: Giant Statement OR Mini Minimalist (decisive choice, not in-between)\n- editorial / poster-like direction; off-grid composition appears 2-3 times\n- multiple Background Modes (full-bleed image at hero + showcase, editorial side-image at case studies, solid + accent for process)\n- palette consistent throughout, with one bold accent recurring\n- closing CTA section: mini minimalist, strong type, single primary action\n\n---\n\n## 21. FINAL GOAL\nGenerate frontend reference images that feel:\n- artistic\n- premium\n- clear\n- structured\n- image-led\n- breathable\n- memorable\n- anti-generic\n- implementation-friendly\n\nThe result should look like a top-tier website concept with strong imagery, confident creativity, and generous spacing - not a dense, repetitive AI layout.\n\n<!-- File: .agents/skills/industrial-brutalist-ui/SKILL.md (Tokens: ~1948 | Category: anthropic-skill) -->\n---\nname: industrial-brutalist-ui\ndescription: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.\n---\n\n# SKILL: Industrial Brutalism & Tactical Telemetry UI\n\n## 1. Skill Meta\n**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering\n**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.\n\n## 2. Visual Archetypes\nThe design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**\n\n### 2.1 Swiss Industrial Print\nDerived from 1960s corporate identity systems and heavy machinery blueprints.\n*   **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.\n\n### 2.2 Tactical Telemetry & CRT Terminal\nDerived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).\n*   **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).\n\n## 3. Typographic Architecture\nTypography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.\n\n### 3.1 Macro-Typography (Structural Headers)\n*   **Classification:** Neo-Grotesque / Heavy Sans-Serif.\n*   **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.\n*   **Implementation Parameters:**\n    *   **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).\n    *   **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.\n    *   **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).\n    *   **Casing:** Exclusively uppercase for structural impact.\n\n### 3.2 Micro-Typography (Data & Telemetry)\n*   **Classification:** Monospace / Technical Sans.\n*   **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.\n*   **Implementation Parameters:**\n    *   **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).\n    *   **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.\n    *   **Leading:** Standard to tight (`1.2` to `1.4`).\n    *   **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.\n\n### 3.3 Textural Contrast (Artistic Disruption)\n*   **Classification:** High-Contrast Serif.\n*   **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.\n*   **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.\n\n## 4. Color System\nThe color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.\n\n**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**\n\n### If Swiss Industrial Print (Light):\n*   **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).\n*   **Foreground:** `#050505` to `#111111` (Carbon Ink).\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.\n\n### If Tactical Telemetry (Dark):\n*   **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).\n*   **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.\n*   **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.\n*   **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.\n\n## 5. Layout and Spatial Engineering\nThe layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.\n\n*   **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.\n*   **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.\n*   **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.\n*   **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.\n\n## 6. UI Components and Symbology\nStandard web UI conventions are replaced with utilitarian, industrial graphic elements.\n\n*   **Syntax Decoration:** Utilization of ASCII characters to frame data points.\n    *   *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`\n    *   *Directional:* `>>>`, `///`, `\\\\\\\\`\n*   **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.\n*   **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.\n\n## 7. Textural and Post-Processing Effects\nTo prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.\n\n*   **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.\n*   **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).\n*   **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.\n\n## 8. Web Engineering Directives\n1.  **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.\n2.  **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.\n3.  **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.\n\n<!-- File: .agents/skills/minimalist-ui/SKILL.md (Tokens: ~2011 | Category: anthropic-skill) -->\n---\nname: minimalist-ui\ndescription: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.\n---\n\n# Protocol: Premium Utilitarian Minimalism UI Architect\n\n## 1. Protocol Overview\nName: Premium Utilitarian Minimalism & Editorial UI\nDescription: An advanced frontend engineering directive for generating highly refined, ultra-minimalist, \"document-style\" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.\n\n## 2. Absolute Negative Constraints (Banned Elements)\nThe AI must strictly avoid the following generic web development defaults:\n- DO NOT use the \"Inter\", \"Roboto\", or \"Open Sans\" typefaces.\n- DO NOT use generic, thin-line icon libraries like \"Lucide\", \"Feather\", or standard \"Heroicons\".\n- DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).\n- DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).\n- DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).\n- DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.\n- DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.\n- DO NOT use generic placeholder names like \"John Doe\", \"Acme Corp\", or \"Lorem Ipsum\". Use realistic, contextual content.\n- DO NOT use AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\". Write plain, specific language.\n\n## 3. Typographic Architecture\nThe interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.\n- Primary Sans-Serif (Body, UI, Buttons): Use clean, geometric, or system-native fonts with character. Target: `font-family: 'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`.\n- Editorial Serif (Hero Headings & Quotes): Target: `font-family: 'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`. Apply tight tracking (`letter-spacing: -0.02em` to `-0.04em`) and tight line-height (`1.1`).\n- Monospace (Code, Keystrokes, Meta-data): Target: `font-family: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`.\n- Text Colors: Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous `line-height` of `1.6` for legibility. Secondary text should be muted gray (`#787774`).\n\n## 4. Color Palette (Warm Monochrome + Spot Pastels)\nColor is a scarce resource, utilized only for semantic meaning or subtle accents.\n- Canvas / Background: Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.\n- Primary Surface (Cards): `#FFFFFF` or `#F9F9F8`.\n- Structural Borders / Dividers: Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.\n- Accent Colors: Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds.\n  - Pale Red: `#FDEBEC` (Text: `#9F2F2D`)\n  - Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)\n  - Pale Green: `#EDF3EC` (Text: `#346538`)\n  - Pale Yellow: `#FBF3DB` (Text: `#956400`)\n\n## 5. Component Specifications\n- Bento Box Feature Grids:\n  - Utilize asymmetrical CSS Grid layouts.\n  - Cards must have exactly `border: 1px solid #EAEAEA`.\n  - Border-radius must be crisp: `8px` or `12px` maximum.\n  - Internal padding must be generous (e.g., `24px` to `40px`).\n- Primary Call-To-Action (Buttons):\n  - Solid background `#111111`, text `#FFFFFF`. \n  - Slight border-radius (`4px` to `6px`). No box-shadow. \n  - Hover state should be a subtle color shift to `#333333` or a micro-scale `transform: scale(0.98)`.\n- Tags & Status Badges:\n  - Pill-shaped (`border-radius: 9999px`), very small typography (`text-xs`), uppercase with wide tracking (`letter-spacing: 0.05em`).\n  - Background must use the defined Muted Pastels.\n- Accordions (FAQ):\n  - Strip all container boxes. Separate items only with a `border-bottom: 1px solid #EAEAEA`.\n  - Use a clean, sharp `+` and `-` icon for the toggle state.\n- Keystroke Micro-UIs:\n  - Render shortcuts as physical keys using `<kbd>` tags: `border: 1px solid #EAEAEA`, `border-radius: 4px`, `background: #F7F6F3`, using the Monospace font.\n- Faux-OS Window Chrome:\n  - When mocking up software, wrap it in a minimalist container with a white top bar containing three small, light gray circles (replicating macOS window controls).\n\n## 6. Iconography & Imagery Directives\n- System Icons: Use \"Phosphor Icons (Bold or Fill weights)\" or \"Radix UI Icons\" for a technical, slightly thicker-stroke aesthetic. Standardize stroke width across all icons.\n- Illustrations: Monochromatic, rough continuous-line ink sketches on a white background, featuring a single offset geometric shape filled with a muted pastel color.\n- Photography: Use high-quality, desaturated images with a warm tone. Apply subtle overlays (`opacity: 0.04` warm grain) to blend photos into the monochrome palette. Never use oversaturated stock photos. Use reliable placeholders like `https://picsum.photos/seed/{context}/1200/800` when real assets are unavailable.\n- Hero & Section Backgrounds: Sections should not feel empty and flat. Use subtle full-width background imagery at very low opacity, soft radial light spots (`radial-gradient` with warm tones at `opacity: 0.03`), or minimal geometric line patterns to add depth without breaking the clean aesthetic.\n\n## 7. Subtle Motion & Micro-Animations\nMotion should feel invisible — present but never distracting. The goal is quiet sophistication, not spectacle.\n- Scroll Entry: Elements fade in gently as they enter the viewport. Use `translateY(12px)` + `opacity: 0` resolving over `600ms` with `cubic-bezier(0.16, 1, 0.3, 1)`. Use `IntersectionObserver`, never `window.addEventListener('scroll')`.\n- Hover States: Cards lift with an ultra-subtle shadow shift (`box-shadow` transitioning from `0 0 0` to `0 2px 8px rgba(0,0,0,0.04)` over `200ms`). Buttons respond with `scale(0.98)` on `:active`.\n- Staggered Reveals: Lists and grid items enter with a cascade delay (`animation-delay: calc(var(--index) * 80ms)`). Never mount everything at once.\n- Background Ambient Motion: Optional. A single, very slow-moving radial gradient blob (`animation-duration: 20s+`, `opacity: 0.02-0.04`) drifting behind hero sections. Must be applied to a `position: fixed; pointer-events: none` layer. Never on scrolling containers.\n- Performance: Animate exclusively via `transform` and `opacity`. No layout-triggering properties (`top`, `left`, `width`, `height`). Use `will-change: transform` sparingly and only on actively animating elements.\n\n## 8. Execution Protocol\nWhen tasked with writing frontend code (HTML, React, Tailwind, Vue) or designing a layout:\n1. Establish the macro-whitespace first. Use massive vertical padding between sections (e.g., `py-24` or `py-32` in Tailwind).\n2. Constrain the main typography content width to `max-w-4xl` or `max-w-5xl`.\n3. Apply the custom typographic hierarchy and monochromatic color variables immediately.\n4. Ensure every card, divider, and border adheres strictly to the `1px solid #EAEAEA` rule.\n5. Add scroll-entry animations to all major content blocks.\n6. Ensure sections have visual depth through imagery, ambient gradients, or subtle textures — no empty flat backgrounds.\n7. Provide code that reflects this high-end, uncluttered, editorial aesthetic natively without requiring manual adjustments.\n\n<!-- File: .agents/skills/redesign-existing-projects/SKILL.md (Tokens: ~3359 | Category: anthropic-skill) -->\n---\nname: redesign-existing-projects\ndescription: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.\n---\n\n# Redesign Skill\n\n## How This Works\n\nWhen applied to an existing project, follow this sequence:\n\n1. **Scan** — Read the codebase. Identify the framework, styling method (Tailwind, vanilla CSS, styled-components, etc.), and current design patterns.\n2. **Diagnose** — Run through the audit below. List every generic pattern, weak point, and missing state you find.\n3. **Fix** — Apply targeted upgrades working with the existing stack. Do not rewrite from scratch. Improve what's there.\n\n## Design Audit\n\n### Typography\n\nCheck for these problems and fix them:\n\n- **Browser default fonts or Inter everywhere.** Replace with a font that has character. Good options: `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`. For editorial/creative projects, pair a serif header with a sans-serif body.\n- **Headlines lack presence.** Increase size for display text, tighten letter-spacing, reduce line-height. Headlines should feel heavy and intentional.\n- **Body text too wide.** Limit paragraph width to roughly 65 characters. Increase line-height for readability.\n- **Only Regular (400) and Bold (700) weights used.** Introduce Medium (500) and SemiBold (600) for more subtle hierarchy.\n- **Numbers in proportional font.** Use a monospace font or enable tabular figures (`font-variant-numeric: tabular-nums`) for data-heavy interfaces.\n- **Missing letter-spacing adjustments.** Use negative tracking for large headers, positive tracking for small caps or labels.\n- **All-caps subheaders everywhere.** Try lowercase italics, sentence case, or small-caps instead.\n- **Orphaned words.** Single words sitting alone on the last line. Fix with `text-wrap: balance` or `text-wrap: pretty`.\n\n### Color and Surfaces\n\n- **Pure `#000000` background.** Replace with off-black, dark charcoal, or tinted dark (`#0a0a0a`, `#121212`, or a dark navy).\n- **Oversaturated accent colors.** Keep saturation below 80%. Desaturate accents so they blend with neutrals instead of screaming.\n- **More than one accent color.** Pick one. Remove the rest. Consistency beats variety.\n- **Mixing warm and cool grays.** Stick to one gray family. Tint all grays with a consistent hue (warm or cool, not both).\n- **Purple/blue \"AI gradient\" aesthetic.** This is the most common AI design fingerprint. Replace with neutral bases and a single, considered accent.\n- **Generic `box-shadow`.** Tint shadows to match the background hue. Use colored shadows (e.g., dark blue shadow on a blue background) instead of pure black at low opacity.\n- **Flat design with zero texture.** Add subtle noise, grain, or micro-patterns to backgrounds. Pure flat vectors feel sterile.\n- **Perfectly even gradients.** Break the uniformity with radial gradients, noise overlays, or mesh gradients instead of standard linear 45-degree fades.\n- **Inconsistent lighting direction.** Audit all shadows to ensure they suggest a single, consistent light source.\n- **Random dark sections in a light mode page (or vice versa).** A single dark-background section breaking an otherwise light page looks like a copy-paste accident. Either commit to a full dark mode or keep a consistent background tone throughout. If contrast is needed, use a slightly darker shade of the same palette — not a sudden jump to `#111` in the middle of a cream page.\n- **Empty, flat sections with no visual depth.** Sections that are just text on a plain background feel unfinished. Add high-quality background imagery (blurred, overlaid, or masked), subtle patterns, or ambient gradients. Use reliable placeholder sources like `https://picsum.photos/seed/{name}/1920/1080` when real assets are not available. Experiment with background images behind hero sections, feature blocks, or CTAs — even a subtle full-width photo at low opacity adds presence.\n\n### Layout\n\n- **Everything centered and symmetrical.** Break symmetry with offset margins, mixed aspect ratios, or left-aligned headers over centered content.\n- **Three equal card columns as feature row.** This is the most generic AI layout. Replace with a 2-column zig-zag, asymmetric grid, horizontal scroll, or masonry layout.\n- **Using `height: 100vh` for full-screen sections.** Replace with `min-height: 100dvh` to prevent layout jumping on mobile browsers (iOS Safari viewport bug).\n- **Complex flexbox percentage math.** Replace with CSS Grid for reliable multi-column structures.\n- **No max-width container.** Add a container constraint (around 1200-1440px) with auto margins so content doesn't stretch edge-to-edge on wide screens.\n- **Cards of equal height forced by flexbox.** Allow variable heights or use masonry when content varies in length.\n- **Uniform border-radius on everything.** Vary the radius: tighter on inner elements, softer on containers.\n- **No overlap or depth.** Elements sit flat next to each other. Use negative margins to create layering and visual depth.\n- **Symmetrical vertical padding.** Top and bottom padding are always identical. Adjust optically — bottom padding often needs to be slightly larger.\n- **Dashboard always has a left sidebar.** Try top navigation, a floating command menu, or a collapsible panel instead.\n- **Missing whitespace.** Double the spacing. Let the design breathe. Dense layouts work for data dashboards, not for marketing pages.\n- **Buttons not bottom-aligned in card groups.** When cards have different content lengths, CTAs end up at random heights. Pin buttons to the bottom of each card so they form a clean horizontal line regardless of content above.\n- **Feature lists starting at different vertical positions.** In pricing tables or comparison cards, the list of features should start at the same Y position across all columns. Use consistent spacing above the list or fixed-height title/price blocks.\n- **Inconsistent vertical rhythm in side-by-side elements.** When placing cards, columns, or panels next to each other, align shared elements (titles, descriptions, prices, buttons) across all items. Misaligned baselines make the layout look broken.\n- **Mathematical alignment that looks optically wrong.** Centering by the math doesn't always look centered to the eye. Icons next to text, play buttons in circles, or text in buttons often need 1-2px optical adjustments to feel right.\n\n### Interactivity and States\n\n- **No hover states on buttons.** Add background shift, slight scale, or translate on hover.\n- **No active/pressed feedback.** Add a subtle `scale(0.98)` or `translateY(1px)` on press to simulate a physical click.\n- **Instant transitions with zero duration.** Add smooth transitions (200-300ms) to all interactive elements.\n- **Missing focus ring.** Ensure visible focus indicators for keyboard navigation. This is an accessibility requirement, not optional.\n- **No loading states.** Replace generic circular spinners with skeleton loaders that match the layout shape.\n- **No empty states.** An empty dashboard showing nothing is a missed opportunity. Design a composed \"getting started\" view.\n- **No error states.** Add clear, inline error messages for forms. Do not use `window.alert()`.\n- **Dead links.** Buttons that link to `#`. Either link to real destinations or visually disable them.\n- **No indication of current page in navigation.** Style the active nav link differently so users know where they are.\n- **Scroll jumping.** Anchor clicks jump instantly. Add `scroll-behavior: smooth`.\n- **Animations using `top`, `left`, `width`, `height`.** Switch to `transform` and `opacity` for GPU-accelerated, smooth animation.\n\n### Content\n\n- **Generic names like \"John Doe\" or \"Jane Smith\".** Use diverse, realistic-sounding names.\n- **Fake round numbers like `99.99%`, `50%`, `$100.00`.** Use organic, messy data: `47.2%`, `$99.00`, `+1 (312) 847-1928`.\n- **Placeholder company names like \"Acme Corp\", \"Nexus\", \"SmartFlow\".** Invent contextual, believable brand names.\n- **AI copywriting cliches.** Never use \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Game-changer\", \"Delve\", \"Tapestry\", or \"In the world of...\". Write plain, specific language.\n- **Exclamation marks in success messages.** Remove them. Be confident, not loud.\n- **\"Oops!\" error messages.** Be direct: \"Connection failed. Please try again.\"\n- **Passive voice.** Use active voice: \"We couldn't save your changes\" instead of \"Mistakes were made.\"\n- **All blog post dates identical.** Randomize dates to appear real.\n- **Same avatar image for multiple users.** Use unique assets for every distinct person.\n- **Lorem Ipsum.** Never use placeholder latin text. Write real draft copy.\n- **Title Case On Every Header.** Use sentence case instead.\n\n### Component Patterns\n\n- **Generic card look (border + shadow + white background).** Remove the border, or use only background color, or use only spacing. Cards should exist only when elevation communicates hierarchy.\n- **Always one filled button + one ghost button.** Add text links or tertiary styles to reduce visual noise.\n- **Pill-shaped \"New\" and \"Beta\" badges.** Try square badges, flags, or plain text labels.\n- **Accordion FAQ sections.** Use a side-by-side list, searchable help, or inline progressive disclosure.\n- **3-card carousel testimonials with dots.** Replace with a masonry wall, embedded social posts, or a single rotating quote.\n- **Pricing table with 3 towers.** Highlight the recommended tier with color and emphasis, not just extra height.\n- **Modals for everything.** Use inline editing, slide-over panels, or expandable sections instead of popups for simple actions.\n- **Avatar circles exclusively.** Try squircles or rounded squares for a less generic look.\n- **Light/dark toggle always a sun/moon switch.** Use a dropdown, system preference detection, or integrate it into settings.\n- **Footer link farm with 4 columns.** Simplify. Focus on main navigational paths and legally required links.\n\n### Iconography\n\n- **Lucide or Feather icons exclusively.** These are the \"default\" AI icon choice. Use Phosphor, Heroicons, or a custom set for differentiation.\n- **Rocketship for \"Launch\", shield for \"Security\".** Replace cliche metaphors with less obvious icons (bolt, fingerprint, spark, vault).\n- **Inconsistent stroke widths across icons.** Audit all icons and standardize to one stroke weight.\n- **Missing favicon.** Always include a branded favicon.\n- **Stock \"diverse team\" photos.** Use real team photos, candid shots, or a consistent illustration style instead of uncanny stock imagery.\n\n### Code Quality\n\n- **Div soup.** Use semantic HTML: `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>`.\n- **Inline styles mixed with CSS classes.** Move all styling to the project's styling system.\n- **Hardcoded pixel widths.** Use relative units (`%`, `rem`, `em`, `max-width`) for flexible layouts.\n- **Missing alt text on images.** Describe image content for screen readers. Never leave `alt=\"\"` or `alt=\"image\"` on meaningful images.\n- **Arbitrary z-index values like `9999`.** Establish a clean z-index scale in the theme/variables.\n- **Commented-out dead code.** Remove all debug artifacts before shipping.\n- **Import hallucinations.** Check that every import actually exists in `package.json` or the project dependencies.\n- **Missing meta tags.** Add proper `<title>`, `description`, `og:image`, and social sharing meta tags.\n\n### Strategic Omissions (What AI Typically Forgets)\n\n- **No legal links.** Add privacy policy and terms of service links in the footer.\n- **No \"back\" navigation.** Dead ends in user flows. Every page needs a way back.\n- **No custom 404 page.** Design a helpful, branded \"page not found\" experience.\n- **No form validation.** Add client-side validation for emails, required fields, and format checks.\n- **No \"skip to content\" link.** Essential for keyboard users. Add a hidden skip-link.\n- **No cookie consent.** If required by jurisdiction, add a compliant consent banner.\n\n## Upgrade Techniques\n\nWhen upgrading a project, pull from these high-impact techniques to replace generic patterns:\n\n### Typography Upgrades\n- **Variable font animation.** Interpolate weight or width on scroll or hover for text that feels alive.\n- **Outlined-to-fill transitions.** Text starts as a stroke outline and fills with color on scroll entry or interaction.\n- **Text mask reveals.** Large typography acting as a window to video or animated imagery behind it.\n\n### Layout Upgrades\n- **Broken grid / asymmetry.** Elements that deliberately ignore column structure — overlapping, bleeding off-screen, or offset with calculated randomness.\n- **Whitespace maximization.** Aggressive use of negative space to force focus on a single element.\n- **Parallax card stacks.** Sections that stick and physically stack over each other during scroll.\n- **Split-screen scroll.** Two halves of the screen sliding in opposite directions.\n\n### Motion Upgrades\n- **Smooth scroll with inertia.** Decouple scrolling from browser defaults for a heavier, cinematic feel.\n- **Staggered entry.** Elements cascade in with slight delays, combining Y-axis translation with opacity fade. Never mount everything at once.\n- **Spring physics.** Replace linear easing with spring-based motion for a natural, weighty feel on all interactive elements.\n- **Scroll-driven reveals.** Content entering through expanding masks, wipes, or draw-on SVG paths tied to scroll progress.\n\n### Surface Upgrades\n- **True glassmorphism.** Go beyond `backdrop-filter: blur`. Add a 1px inner border and a subtle inner shadow to simulate edge refraction.\n- **Spotlight borders.** Card borders that illuminate dynamically under the cursor.\n- **Grain and noise overlays.** A fixed, pointer-events-none overlay with subtle noise to break digital flatness.\n- **Colored, tinted shadows.** Shadows that carry the hue of the background rather than using generic black.\n\n## Fix Priority\n\nApply changes in this order for maximum visual impact with minimum risk:\n\n1. **Font swap** — biggest instant improvement, lowest risk\n2. **Color palette cleanup** — remove clashing or oversaturated colors\n3. **Hover and active states** — makes the interface feel alive\n4. **Layout and spacing** — proper grid, max-width, consistent padding\n5. **Replace generic components** — swap cliche patterns for modern alternatives\n6. **Add loading, empty, and error states** — makes it feel finished\n7. **Polish typography scale and spacing** — the premium final touch\n\n## Rules\n\n- Work with the existing tech stack. Do not migrate frameworks or styling libraries.\n- Do not break existing functionality. Test after every change.\n- Before importing any new library, check the project's dependency file first.\n- If the project uses Tailwind, check the version (v3 vs v4) before modifying config.\n- If the project has no framework, use vanilla CSS.\n- Keep changes reviewable and focused. Small, targeted improvements over big rewrites.\n\n<!-- File: .agents/skills/stitch-design-taste/DESIGN.md (Tokens: ~3003 | Category: anthropic-skill) -->\n# Design System: Taste Standard\n**Skill:** stitch-design-taste\n\n---\n\n## Configuration — Set Your Style\nAdjust these dials before using this design system. They control how creative, dense, and animated the output should be. Pick the level that fits your project.\n\n| Dial | Level | Description |\n|------|-------|-------------|\n| **Creativity** | `8` | `1` = Ultra-minimal, Swiss, silent, monochrome. `5` = Balanced, clean but with personality. `10` = Expressive, editorial, bold typography experiments, inline images in headlines, strong asymmetry. Default: `8` |\n| **Density** | `4` | `1` = Gallery-airy, massive whitespace. `5` = Balanced sections. `10` = Cockpit-dense, data-heavy. Default: `4` |\n| **Variance** | `8` | `1` = Predictable, symmetric grids. `5` = Subtle offsets. `10` = Artsy chaotic, no two sections alike. Default: `8` |\n| **Motion Intent** | `6` | `1` = Static, no animation noted. `5` = Subtle hover/entrance cues. `10` = Cinematic orchestration noted in every component. Default: `6` |\n\n> **How to use:** Change the numbers above to match your project's vibe. At **Creativity 1–3**, the system produces clean, quiet, Notion-like interfaces. At **Creativity 7–10**, expect inline image typography, dramatic scale contrast, and strong editorial layouts. The rest of the rules below adapt to your chosen levels.\n\n---\n\n## 1. Visual Theme & Atmosphere\nA restrained, gallery-airy interface with confident asymmetric layouts and fluid spring-physics motion. The atmosphere is clinical yet warm — like a well-lit architecture studio where every element earns its place through function. Density is balanced (Level 4), variance runs high (Level 8) to prevent symmetrical boredom, and motion is fluid but never theatrical (Level 6). The overall impression: expensive, intentional, alive.\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface. Warm-neutral, never clinical blue-white\n- **Pure Surface** (#FFFFFF) — Card and container fill. Used with whisper shadow for elevation\n- **Charcoal Ink** (#18181B) — Primary text. Zinc-950 depth — never pure black\n- **Steel Secondary** (#71717A) — Body text, descriptions, metadata. Zinc-500 warmth\n- **Muted Slate** (#94A3B8) — Tertiary text, timestamps, disabled states\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, structural 1px lines. Semi-transparent for depth\n- **Diffused Shadow** (rgba(0,0,0,0.05)) — Card elevation. Wide-spreading, 40px blur, -15px offset. Never harsh\n\n### Accent Selection (Pick ONE per project)\n- **Emerald Signal** (#10B981) — For growth, success, positive data dashboards\n- **Electric Blue** (#3B82F6) — For productivity, SaaS, developer tools\n- **Deep Rose** (#E11D48) — For creative, editorial, fashion-adjacent projects\n- **Amber Warmth** (#F59E0B) — For community, social, warm-toned products\n\n### Banned Colors\n- Purple/Violet neon gradients — the \"AI Purple\" aesthetic\n- Pure Black (#000000) — always Off-Black or Zinc-950\n- Oversaturated accents above 80% saturation\n- Mixed warm/cool gray systems within one project\n\n## 3. Typography Rules\n- **Display:** `Geist`, `Satoshi`, `Cabinet Grotesk`, or `Outfit` — Track-tight (`-0.025em`), controlled fluid scale, weight-driven hierarchy (700–900). Not screaming. Leading compressed (`1.1`). Alternatives forced — `Inter` is BANNED for premium contexts\n- **Body:** Same family at weight 400 — Relaxed leading (`1.65`), 65ch max-width, Steel Secondary color (#71717A)\n- **Mono:** `Geist Mono` or `JetBrains Mono` — For code blocks, metadata, timestamps. When density exceeds Level 7, all numbers switch to monospace\n- **Scale:** Display at `clamp(2.25rem, 5vw, 3.75rem)`. Body at `1rem/1.125rem`. Mono metadata at `0.8125rem`\n\n### Banned Fonts\n- `Inter` — banned everywhere in premium/creative contexts\n- Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) — BANNED. If serif is needed for editorial/creative, use only distinctive modern serifs like `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Never use default browser serif stacks. Serif is always BANNED in dashboards or software UIs regardless\n\n## 4. Component Stylings\n* **Buttons:** Flat surface, no outer glow. Primary: accent fill with white text. Secondary: ghost/outline. Active state: `-1px translateY` or `scale(0.98)` for tactile push. Hover: subtle background shift, never glow\n* **Cards/Containers:** Generously rounded corners (`2.5rem`). Pure white fill. Whisper border (`1px`, semi-transparent). Diffused shadow (`0 20px 40px -15px rgba(0,0,0,0.05)`). Internal padding `2rem–2.5rem`. Used ONLY when elevation communicates hierarchy — high-density layouts replace cards with `border-top` dividers or negative space\n* **Inputs/Forms:** Label positioned above input. Helper text optional. Error text below in Deep Rose. Focus ring in accent color, `2px` offset. No floating labels. Standard `0.5rem` gap between label-input-error stack\n* **Navigation:** Sleek, sticky. Icons scale on hover (Dock Magnification optional). No hamburger on desktop. Clean horizontal with generous spacing\n* **Loaders:** Skeletal shimmer matching exact layout dimensions and rounded corners. Shifting light reflection across placeholder shapes. Never circular spinners\n* **Empty States:** Composed illustration or icon composition with guidance text. Never just \"No data found\"\n* **Error States:** Inline, contextual. Red accent underline or border. Clear recovery action\n\n## 5. Hero Section\nThe Hero is the first impression — it must be striking, creative, and never generic.\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Example: \"We build [photo of hands typing] digital [photo of screen] products\" — images sit inline at type-height, rounded, acting as visual punctuation between words. This is the signature creative technique\n- **No Overlapping Elements:** Text must never overlap images or other text. Every element has its own clear spatial zone. No z-index stacking of content layers, no absolute-positioned headlines over images. Clean separation always\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons, and any instructional UI chrome are BANNED. The user knows how to scroll. Let the content pull them in naturally\n- **Asymmetric Structure:** Centered Hero layouts are BANNED at this variance level. Use Split Screen (50/50), Left-Aligned text / Right visual, or Asymmetric Whitespace with large empty zones\n- **CTA Restraint:** Maximum one primary CTA button. No secondary \"Learn more\" links. No redundant micro-copy below the headline\n\n## 6. Layout Principles\n- **Grid-First:** CSS Grid for all structural layouts. Never flexbox percentage math (`calc(33% - 1rem)` is BANNED)\n- **No Overlapping:** Elements must never overlap each other. No absolute-positioned layers stacking content on content. Every element occupies its own grid cell or flow position. Clean, separated spatial zones\n- **Feature Sections:** The \"3 equal cards in a row\" pattern is BANNED. Use 2-column Zig-Zag, asymmetric Bento grids (2fr 1fr 1fr), or horizontal scroll galleries\n- **Containment:** All content within `max-width: 1400px`, centered. Generous horizontal padding (`1rem` mobile, `2rem` tablet, `4rem` desktop)\n- **Full-Height:** Use `min-height: 100dvh` — never `height: 100vh` (iOS Safari address bar jump)\n- **Bento Architecture:** For feature grids, use Row 1: 3 columns | Row 2: 2 columns (70/30 split). Each tile contains a perpetual micro-animation\n\n## 7. Responsive Rules\nEvery screen must work flawlessly across all viewports. **Responsive is not optional — it is a hard requirement. Every single element must be tested at 375px, 768px, and 1440px.**\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to a strict single column. `width: 100%`, `padding: 1rem`, `gap: 1.5rem`. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure. All elements must fit within viewport width. If any element causes horizontal scroll, the design is broken\n- **Typography Scaling:** Headlines scale down gracefully via `clamp()`. Body text stays `1rem` minimum. Never shrink body below `14px`. Headlines must remain readable on 375px screens\n- **Touch Targets:** All interactive elements minimum `44px` tap target. Generous spacing between clickable items. Buttons must be full-width on mobile\n- **Image Behavior:** Hero and inline images scale proportionally. Inline typography images (photos between words) stack below the headline on mobile instead of inline\n- **Navigation:** Desktop horizontal nav collapses to a clean mobile menu (slide-in or full-screen overlay). No tiny hamburger icons without labels\n- **Cards & Grids:** Bento grids and asymmetric layouts revert to stacked single-column cards with full-width. Maintain internal padding (`1rem`)\n- **Spacing Consistency:** Vertical section gaps reduce proportionally on mobile (`clamp(3rem, 8vw, 6rem)`). Never cramped, never excessively airy\n- **Testing Viewports:** Designs must be verified at: `375px` (iPhone SE), `390px` (iPhone 14), `768px` (iPad), `1024px` (small laptop), `1440px` (desktop)\n\n## 8. Motion & Interaction (Code-Phase Intent)\n> **Note:** Stitch generates static screens — it does not animate. This section documents the **intended motion behavior** so that the coding agent (Antigravity, Cursor, etc.) knows exactly how to implement animations when building the exported design into a live product.\n\n- **Physics Engine:** Spring-based exclusively. `stiffness: 100, damping: 20`. No linear easing anywhere. Premium, weighty feel on all interactive elements\n- **Perpetual Micro-Loops:** Every active dashboard component has an infinite-loop state — Pulse on status dots, Typewriter on search bars, Float on feature icons, Shimmer on loading states\n- **Staggered Orchestration:** Lists and grids mount with cascaded delays (`animation-delay: calc(var(--index) * 100ms)`). Waterfall reveals, never instant mount\n- **Layout Transitions:** Smooth re-ordering via shared element IDs. Items swap positions with physics, simulating real-time intelligence\n- **Hardware Rules:** Animate ONLY `transform` and `opacity`. Never `top`, `left`, `width`, `height`. Grain/noise filters on fixed, pointer-events-none pseudo-elements only\n- **Performance:** CPU-heavy perpetual animations isolated in microscopic leaf components. Never trigger parent re-renders. Target 60fps minimum\n\n## 9. Anti-Patterns (Banned)\n- No emojis — anywhere in UI, code, or alt text\n- No `Inter` font — use `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — if serif is needed, use distinctive modern serifs only (`Fraunces`, `Instrument Serif`)\n- No pure black (`#000000`) — Off-Black or Zinc-950 only\n- No neon outer glows or default box-shadow glows\n- No oversaturated accent colors above 80%\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — text never overlaps images or other content. Clean spatial separation always\n- No 3-column equal card layouts for features\n- No centered Hero sections (at this variance level)\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", \"Discover more below\", scroll arrows, bouncing chevrons — all BANNED\n- No generic names: \"John Doe\", \"Sarah Chan\", \"Acme\", \"Nexus\", \"SmartFlow\"\n- No fake round numbers: `99.99%`, `50%`, `1234567` — use organic data: `47.2%`, `+1 (312) 847-1928`\n- No AI copywriting clichés: \"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\", \"Revolutionize\"\n- No broken Unsplash links — use `picsum.photos/seed/{id}/800/600` or SVG UI Avatars\n- No generic `shadcn/ui` defaults — customize radii, colors, shadows to match this system\n- No `z-index` spam — use only for Navbar, Modal, Overlay layer contexts\n- No `h-screen` — always `min-h-[100dvh]`\n- No circular loading spinners — skeletal shimmer only\n\n<!-- File: .agents/skills/stitch-design-taste/SKILL.md (Tokens: ~2767 | Category: anthropic-skill) -->\n---\nname: stitch-design-taste\ndescription: Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.\n---\n\n# Stitch Design Taste — Semantic Design System Skill\n\n## Overview\nThis skill generates `DESIGN.md` files optimized for Google Stitch screen generation. It translates the battle-tested anti-slop frontend engineering directives into Stitch's native semantic design language — descriptive, natural-language rules paired with precise values that Stitch's AI agent can interpret to produce premium, non-generic interfaces.\n\nThe generated `DESIGN.md` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **\"Visual Descriptions\"** supported by specific color values, typography specs, and component behaviors.\n\n## Prerequisites\n- Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)\n- Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI\n\n## The Goal\nGenerate a `DESIGN.md` file that encodes:\n1. **Visual atmosphere** — the mood, density, and design philosophy\n2. **Color calibration** — neutrals, accents, and banned patterns with hex codes\n3. **Typographic architecture** — font stacks, scale hierarchy, and anti-patterns\n4. **Component behaviors** — buttons, cards, inputs with interaction states\n5. **Layout principles** — grid systems, spacing philosophy, responsive strategy\n6. **Motion philosophy** — animation engine specs, spring physics, perpetual micro-interactions\n7. **Anti-patterns** — explicit list of banned AI design clichés\n\n## Analysis & Synthesis Instructions\n\n### 1. Define the Atmosphere\nEvaluate the target project's intent. Use evocative adjectives from the taste spectrum:\n- **Density:** \"Art Gallery Airy\" (1–3) → \"Daily App Balanced\" (4–7) → \"Cockpit Dense\" (8–10)\n- **Variance:** \"Predictable Symmetric\" (1–3) → \"Offset Asymmetric\" (4–7) → \"Artsy Chaotic\" (8–10)\n- **Motion:** \"Static Restrained\" (1–3) → \"Fluid CSS\" (4–7) → \"Cinematic Choreography\" (8–10)\n\nDefault baseline: Variance 8, Motion 6, Density 4. Adapt dynamically based on user's vibe description.\n\n### 2. Map the Color Palette\nFor each color provide: **Descriptive Name** + **Hex Code** + **Functional Role**.\n\n**Mandatory constraints:**\n- Maximum 1 accent color. Saturation below 80%\n- The \"AI Purple/Blue Neon\" aesthetic is strictly BANNED — no purple button glows, no neon gradients\n- Use absolute neutral bases (Zinc/Slate) with high-contrast singular accents\n- Stick to one palette for the entire output — no warm/cool gray fluctuation\n- Never use pure black (`#000000`) — use Off-Black, Zinc-950, or Charcoal\n\n### 3. Establish Typography Rules\n- **Display/Headlines:** Track-tight, controlled scale. Not screaming. Hierarchy through weight and color, not just massive size\n- **Body:** Relaxed leading, max 65 characters per line\n- **Font Selection:** `Inter` is BANNED for premium/creative contexts. Force unique character: `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`\n- **Serif Ban:** Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) are BANNED. If serif is needed for editorial/creative contexts, use only distinctive modern serifs: `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Serif is always BANNED in dashboards or software UIs\n- **Dashboard Constraint:** Use Sans-Serif pairings exclusively (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`)\n- **High-Density Override:** When density exceeds 7, all numbers must use Monospace\n\n### 4. Define the Hero Section\nThe Hero is the first impression and must be creative, striking, and never generic:\n- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Images sit inline at type-height, rounded, acting as visual punctuation. This is the signature creative technique\n- **No Overlapping:** Text must never overlap images or other text. Every element occupies its own clean spatial zone\n- **No Filler Text:** \"Scroll to explore\", \"Swipe down\", scroll arrow icons, bouncing chevrons are BANNED. The content should pull users in naturally\n- **Asymmetric Structure:** Centered Hero layouts BANNED when variance exceeds 4\n- **CTA Restraint:** Maximum one primary CTA. No secondary \"Learn more\" links\n\n### 5. Describe Component Stylings\nFor each component type, describe shape, color, shadow depth, and interaction behavior:\n- **Buttons:** Tactile push feedback on active state. No neon outer glows. No custom mouse cursors\n- **Cards:** Use ONLY when elevation communicates hierarchy. Tint shadows to background hue. For high-density layouts, replace cards with border-top dividers or negative space\n- **Inputs/Forms:** Label above input, helper text optional, error text below. Standard gap spacing\n- **Loading States:** Skeletal loaders matching layout dimensions — no generic circular spinners\n- **Empty States:** Composed compositions indicating how to populate data\n- **Error States:** Clear, inline error reporting\n\n### 6. Define Layout Principles\n- No overlapping elements — every element occupies its own clear spatial zone. No absolute-positioned content stacking\n- Centered Hero sections are BANNED when variance exceeds 4 — force Split Screen, Left-Aligned, or Asymmetric Whitespace\n- The generic \"3 equal cards horizontally\" feature row is BANNED — use 2-column Zig-Zag, asymmetric grid, or horizontal scroll\n- CSS Grid over Flexbox math — never use `calc()` percentage hacks\n- Contain layouts using max-width constraints (e.g., 1400px centered)\n- Full-height sections must use `min-h-[100dvh]` — never `h-screen` (iOS Safari catastrophic jump)\n\n### 7. Define Responsive Rules\nEvery design must work across all viewports:\n- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to single column. No exceptions\n- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure\n- **Typography Scaling:** Headlines scale via `clamp()`. Body text minimum `1rem`/`14px`\n- **Touch Targets:** All interactive elements minimum `44px` tap target\n- **Image Behavior:** Inline typography images (photos between words) stack below headline on mobile\n- **Navigation:** Desktop horizontal nav collapses to clean mobile menu\n- **Spacing:** Vertical section gaps reduce proportionally (`clamp(3rem, 8vw, 6rem)`)\n\n### 8. Encode Motion Philosophy\n- **Spring Physics default:** `stiffness: 100, damping: 20` — premium, weighty feel. No linear easing\n- **Perpetual Micro-Interactions:** Every active component should have an infinite loop state (Pulse, Typewriter, Float, Shimmer)\n- **Staggered Orchestration:** Never mount lists instantly — use cascade delays for waterfall reveals\n- **Performance:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`. Grain/noise filters on fixed pseudo-elements only\n\n### 9. List Anti-Patterns (AI Tells)\nEncode these as explicit \"NEVER DO\" rules in the DESIGN.md:\n- No emojis anywhere\n- No `Inter` font\n- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — distinctive modern serifs only if needed\n- No pure black (`#000000`)\n- No neon/outer glow shadows\n- No oversaturated accents\n- No excessive gradient text on large headers\n- No custom mouse cursors\n- No overlapping elements — clean spatial separation always\n- No 3-column equal card layouts\n- No generic names (\"John Doe\", \"Acme\", \"Nexus\")\n- No fake round numbers (`99.99%`, `50%`)\n- No AI copywriting clichés (\"Elevate\", \"Seamless\", \"Unleash\", \"Next-Gen\")\n- No filler UI text: \"Scroll to explore\", \"Swipe down\", scroll arrows, bouncing chevrons\n- No broken Unsplash links — use `picsum.photos` or SVG avatars\n- No centered Hero sections (for high-variance projects)\n\n## Output Format (DESIGN.md Structure)\n\n```markdown\n# Design System: [Project Title]\n\n## 1. Visual Theme & Atmosphere\n(Evocative description of the mood, density, variance, and motion intensity.\nExample: \"A restrained, gallery-airy interface with confident asymmetric layouts\nand fluid spring-physics motion. The atmosphere is clinical yet warm — like a\nwell-lit architecture studio.\")\n\n## 2. Color Palette & Roles\n- **Canvas White** (#F9FAFB) — Primary background surface\n- **Pure Surface** (#FFFFFF) — Card and container fill\n- **Charcoal Ink** (#18181B) — Primary text, Zinc-950 depth\n- **Muted Steel** (#71717A) — Secondary text, descriptions, metadata\n- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, 1px structural lines\n- **[Accent Name]** (#XXXXXX) — Single accent for CTAs, active states, focus rings\n(Max 1 accent. Saturation < 80%. No purple/neon.)\n\n## 3. Typography Rules\n- **Display:** [Font Name] — Track-tight, controlled scale, weight-driven hierarchy\n- **Body:** [Font Name] — Relaxed leading, 65ch max-width, neutral secondary color\n- **Mono:** [Font Name] — For code, metadata, timestamps, high-density numbers\n- **Banned:** Inter, generic system fonts for premium contexts. Serif fonts banned in dashboards.\n\n## 4. Component Stylings\n* **Buttons:** Flat, no outer glow. Tactile -1px translate on active. Accent fill for primary, ghost/outline for secondary.\n* **Cards:** Generously rounded corners (2.5rem). Diffused whisper shadow. Used only when elevation serves hierarchy. High-density: replace with border-top dividers.\n* **Inputs:** Label above, error below. Focus ring in accent color. No floating labels.\n* **Loaders:** Skeletal shimmer matching exact layout dimensions. No circular spinners.\n* **Empty States:** Composed, illustrated compositions — not just \"No data\" text.\n\n## 5. Layout Principles\n(Grid-first responsive architecture. Asymmetric splits for Hero sections.\nStrict single-column collapse below 768px. Max-width containment.\nNo flexbox percentage math. Generous internal padding.)\n\n## 6. Motion & Interaction\n(Spring physics for all interactive elements. Staggered cascade reveals.\nPerpetual micro-loops on active dashboard components. Hardware-accelerated\ntransforms only. Isolated Client Components for CPU-heavy animations.)\n\n## 7. Anti-Patterns (Banned)\n(Explicit list of forbidden patterns: no emojis, no Inter, no pure black,\nno neon glows, no 3-column equal grids, no AI copywriting clichés,\nno generic placeholder names, no broken image links.)\n```\n\n## Best Practices\n- **Be Descriptive:** \"Deep Charcoal Ink (#18181B)\" — not just \"dark text\"\n- **Be Functional:** Explain what each element is used for\n- **Be Consistent:** Same terminology throughout the document\n- **Be Precise:** Include exact hex codes, rem values, pixel values in parentheses\n- **Be Opinionated:** This is not a neutral template — it enforces a specific, premium aesthetic\n\n## Tips for Success\n1. Start with the atmosphere — understand the vibe before detailing tokens\n2. Look for patterns — identify consistent spacing, sizing, and styling\n3. Think semantically — name colors by purpose, not just appearance\n4. Consider hierarchy — document how visual weight communicates importance\n5. Encode the bans — anti-patterns are as important as the rules themselves\n\n## Common Pitfalls to Avoid\n- Using technical jargon without translation (\"rounded-xl\" instead of \"generously rounded corners\")\n- Omitting hex codes or using only descriptive names\n- Forgetting functional roles of design elements\n- Being too vague in atmosphere descriptions\n- Ignoring the anti-pattern list — these are what make the output premium\n- Defaulting to generic \"safe\" designs instead of enforcing the curated aesthetic\n\n<!-- File: .agents/skills/vercel-react-best-practices/AGENTS.md (Tokens: ~11983 | Category: anthropic-skill) -->\n# React Best Practices\n\n**Version 1.0.0**  \nVercel Engineering  \nJanuary 2026\n\n> **Note:**  \n> This document is mainly for agents and LLMs to follow when maintaining,  \n> generating, or refactoring React and Next.js codebases. Humans  \n> may also find it useful, but guidance here is optimized for automation  \n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.\n\n---\n\n## Table of Contents\n\n1. [Eliminating Waterfalls](#1-eliminating-waterfalls) — **CRITICAL**\n   - 1.1 [Check Cheap Conditions Before Async Flags](#11-check-cheap-conditions-before-async-flags)\n   - 1.2 [Defer Await Until Needed](#12-defer-await-until-needed)\n   - 1.3 [Dependency-Based Parallelization](#13-dependency-based-parallelization)\n   - 1.4 [Prevent Waterfall Chains in API Routes](#14-prevent-waterfall-chains-in-api-routes)\n   - 1.5 [Promise.all() for Independent Operations](#15-promiseall-for-independent-operations)\n   - 1.6 [Strategic Suspense Boundaries](#16-strategic-suspense-boundaries)\n2. [Bundle Size Optimization](#2-bundle-size-optimization) — **CRITICAL**\n   - 2.1 [Avoid Barrel File Imports](#21-avoid-barrel-file-imports)\n   - 2.2 [Conditional Module Loading](#22-conditional-module-loading)\n   - 2.3 [Defer Non-Critical Third-Party Libraries](#23-defer-non-critical-third-party-libraries)\n   - 2.4 [Dynamic Imports for Heavy Components](#24-dynamic-imports-for-heavy-components)\n   - 2.5 [Preload Based on User Intent](#25-preload-based-on-user-intent)\n3. [Server-Side Performance](#3-server-side-performance) — **HIGH**\n   - 3.1 [Authenticate Server Actions Like API Routes](#31-authenticate-server-actions-like-api-routes)\n   - 3.2 [Avoid Duplicate Serialization in RSC Props](#32-avoid-duplicate-serialization-in-rsc-props)\n   - 3.3 [Cross-Request LRU Caching](#33-cross-request-lru-caching)\n   - 3.4 [Hoist Static I/O to Module Level](#34-hoist-static-io-to-module-level)\n   - 3.5 [Minimize Serialization at RSC Boundaries](#35-minimize-serialization-at-rsc-boundaries)\n   - 3.6 [Parallel Data Fetching with Component Composition](#36-parallel-data-fetching-with-component-composition)\n   - 3.7 [Parallel Nested Data Fetching](#37-parallel-nested-data-fetching)\n   - 3.8 [Per-Request Deduplication with React.cache()](#38-per-request-deduplication-with-reactcache)\n   - 3.9 [Use after() for Non-Blocking Operations](#39-use-after-for-non-blocking-operations)\n4. [Client-Side Data Fetching](#4-client-side-data-fetching) — **MEDIUM-HIGH**\n   - 4.1 [Deduplicate Global Event Listeners](#41-deduplicate-global-event-listeners)\n   - 4.2 [Use Passive Event Listeners for Scrolling Performance](#42-use-passive-event-listeners-for-scrolling-performance)\n   - 4.3 [Use SWR for Automatic Deduplication](#43-use-swr-for-automatic-deduplication)\n   - 4.4 [Version and Minimize localStorage Data](#44-version-and-minimize-localstorage-data)\n5. [Re-render Optimization](#5-re-render-optimization) — **MEDIUM**\n   - 5.1 [Calculate Derived State During Rendering](#51-calculate-derived-state-during-rendering)\n   - 5.2 [Defer State Reads to Usage Point](#52-defer-state-reads-to-usage-point)\n   - 5.3 [Do not wrap a simple expression with a primitive result type in useMemo](#53-do-not-wrap-a-simple-expression-with-a-primitive-result-type-in-usememo)\n   - 5.4 [Don't Define Components Inside Components](#54-dont-define-components-inside-components)\n   - 5.5 [Extract Default Non-primitive Parameter Value from Memoized Component to Constant](#55-extract-default-non-primitive-parameter-value-from-memoized-component-to-constant)\n   - 5.6 [Extract to Memoized Components](#56-extract-to-memoized-components)\n   - 5.7 [Narrow Effect Dependencies](#57-narrow-effect-dependencies)\n   - 5.8 [Put Interaction Logic in Event Handlers](#58-put-interaction-logic-in-event-handlers)\n   - 5.9 [Split Combined Hook Computations](#59-split-combined-hook-computations)\n   - 5.10 [Subscribe to Derived State](#510-subscribe-to-derived-state)\n   - 5.11 [Use Functional setState Updates](#511-use-functional-setstate-updates)\n   - 5.12 [Use Lazy State Initialization](#512-use-lazy-state-initialization)\n   - 5.13 [Use Transitions for Non-Urgent Updates](#513-use-transitions-for-non-urgent-updates)\n   - 5.14 [Use useDeferredValue for Expensive Derived Renders](#514-use-usedeferredvalue-for-expensive-derived-renders)\n   - 5.15 [Use useRef for Transient Values](#515-use-useref-for-transient-values)\n6. [Rendering Performance](#6-rendering-performance) — **MEDIUM**\n   - 6.1 [Animate SVG Wrapper Instead of SVG Element](#61-animate-svg-wrapper-instead-of-svg-element)\n   - 6.2 [CSS content-visibility for Long Lists](#62-css-content-visibility-for-long-lists)\n   - 6.3 [Hoist Static JSX Elements](#63-hoist-static-jsx-elements)\n   - 6.4 [Optimize SVG Precision](#64-optimize-svg-precision)\n   - 6.5 [Prevent Hydration Mismatch Without Flickering](#65-prevent-hydration-mismatch-without-flickering)\n   - 6.6 [Suppress Expected Hydration Mismatches](#66-suppress-expected-hydration-mismatches)\n   - 6.7 [Use Activity Component for Show/Hide](#67-use-activity-component-for-showhide)\n   - 6.8 [Use defer or async on Script Tags](#68-use-defer-or-async-on-script-tags)\n   - 6.9 [Use Explicit Conditional Rendering](#69-use-explicit-conditional-rendering)\n   - 6.10 [Use React DOM Resource Hints](#610-use-react-dom-resource-hints)\n   - 6.11 [Use useTransition Over Manual Loading States](#611-use-usetransition-over-manual-loading-states)\n7. [JavaScript Performance](#7-javascript-performance) — **LOW-MEDIUM**\n   - 7.1 [Avoid Layout Thrashing](#71-avoid-layout-thrashing)\n   - 7.2 [Build Index Maps for Repeated Lookups](#72-build-index-maps-for-repeated-lookups)\n   - 7.3 [Cache Property Access in Loops](#73-cache-property-access-in-loops)\n   - 7.4 [Cache Repeated Function Calls](#74-cache-repeated-function-calls)\n   - 7.5 [Cache Storage API Calls](#75-cache-storage-api-calls)\n   - 7.6 [Combine Multiple Array Iterations](#76-combine-multiple-array-iterations)\n   - 7.7 [Defer Non-Critical Work with requestIdleCallback](#77-defer-non-critical-work-with-requestidlecallback)\n   - 7.8 [Early Length Check for Array Comparisons](#78-early-length-check-for-array-comparisons)\n   - 7.9 [Early Return from Functions](#79-early-return-from-functions)\n   - 7.10 [Hoist RegExp Creation](#710-hoist-regexp-creation)\n   - 7.11 [Use flatMap to Map and Filter in One Pass](#711-use-flatmap-to-map-and-filter-in-one-pass)\n   - 7.12 [Use Loop for Min/Max Instead of Sort](#712-use-loop-for-minmax-instead-of-sort)\n   - 7.13 [Use Set/Map for O(1) Lookups](#713-use-setmap-for-o1-lookups)\n   - 7.14 [Use toSorted() Instead of sort() for Immutability](#714-use-tosorted-instead-of-sort-for-immutability)\n8. [Advanced Patterns](#8-advanced-patterns) — **LOW**\n   - 8.1 [Initialize App Once, Not Per Mount](#81-initialize-app-once-not-per-mount)\n   - 8.2 [Store Event Handlers in Refs](#82-store-event-handlers-in-refs)\n   - 8.3 [useEffectEvent for Stable Callback Refs](#83-useeffectevent-for-stable-callback-refs)\n\n---\n\n## 1. Eliminating Waterfalls\n\n**Impact: CRITICAL**\n\nWaterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n### 1.1 Check Cheap Conditions Before Async Flags\n\n**Impact: HIGH (avoids unnecessary async work when a synchronous guard already fails)**\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n\n### 1.2 Defer Await Until Needed\n\n**Impact: HIGH (avoids blocking unused code paths)**\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect: blocks both branches**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct: only blocks when needed**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example: early return optimization**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n\n### 1.3 Dependency-Based Parallelization\n\n**Impact: CRITICAL (2-10× improvement)**\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect: profile waits for config unnecessarily**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct: config and profile run in parallel**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n\n### 1.4 Prevent Waterfall Chains in API Routes\n\n**Impact: CRITICAL (2-10× improvement)**\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect: config waits for auth, data waits for both**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct: auth and config start immediately**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n\n### 1.5 Promise.all() for Independent Operations\n\n**Impact: CRITICAL (2-10× improvement)**\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect: sequential execution, 3 round trips**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct: parallel execution, 1 round trip**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n\n### 1.6 Strategic Suspense Boundaries\n\n**Impact: HIGH (faster initial paint)**\n\nInstead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.\n\n**Incorrect: wrapper blocked by data fetching**\n\n```tsx\nasync function Page() {\n  const data = await fetchData(); // Blocks entire page\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <DataDisplay data={data} />\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n```\n\nThe entire layout waits for data even though only the middle section needs it.\n\n**Correct: wrapper shows immediately, data streams in**\n\n```tsx\nfunction Page() {\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <div>\n        <Suspense fallback={<Skeleton />}>\n          <DataDisplay />\n        </Suspense>\n      </div>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nasync function DataDisplay() {\n  const data = await fetchData(); // Only blocks this component\n  return <div>{data.content}</div>;\n}\n```\n\nSidebar, Header, and Footer render immediately. Only DataDisplay waits for data.\n\n**Alternative: share promise across components**\n\n```tsx\nfunction Page() {\n  // Start fetch immediately, but don't await\n  const dataPromise = fetchData();\n\n  return (\n    <div>\n      <div>Sidebar</div>\n      <div>Header</div>\n      <Suspense fallback={<Skeleton />}>\n        <DataDisplay dataPromise={dataPromise} />\n        <DataSummary dataPromise={dataPromise} />\n      </Suspense>\n      <div>Footer</div>\n    </div>\n  );\n}\n\nfunction DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Unwraps the promise\n  return <div>{data.content}</div>;\n}\n\nfunction DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {\n  const data = use(dataPromise); // Reuses the same promise\n  return <div>{data.summary}</div>;\n}\n```\n\nBoth components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.\n\n**When NOT to use this pattern:**\n\n- Critical data needed for layout decisions (affects positioning)\n\n- SEO-critical content above the fold\n\n- Small, fast queries where suspense overhead isn't worth it\n\n- When you want to avoid layout shift (loading → content jump)\n\n**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.\n\n---\n\n## 2. Bundle Size Optimization\n\n**Impact: CRITICAL**\n\nReducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n### 2.1 Avoid Barrel File Imports\n\n**Impact: CRITICAL (200-800ms import cost, slow builds)**\n\nImport directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).\n\nPopular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.\n\n**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.\n\n**Incorrect: imports entire library**\n\n```tsx\nimport { Check, X, Menu } from \"lucide-react\";\n// Loads 1,583 modules, takes ~2.8s extra in dev\n// Runtime cost: 200-800ms on every cold start\n\nimport { Button, TextField } from \"@mui/material\";\n// Loads 2,225 modules, takes ~4.2s extra in dev\n```\n\n**Correct - Next.js 13.5+ (recommended):**\n\n```tsx\n// Keep the standard imports - Next.js transforms them to direct imports\nimport { Check, X, Menu } from \"lucide-react\";\n// Full TypeScript support, no manual path wrangling\n```\n\nThis is the recommended approach because it preserves TypeScript type safety and editor autocompletion while still eliminating the barrel import cost.\n\n**Correct - Direct imports (non-Next.js projects):**\n\n```tsx\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n// Loads only what you use\n```\n\n> **TypeScript warning:** Some libraries (notably `lucide-react`) don't ship `.d.ts` files for their deep import paths. Importing from `lucide-react/dist/esm/icons/check` resolves to an implicit `any` type, causing errors under `strict` or `noImplicitAny`. Prefer `optimizePackageImports` when available, or verify the library exports types for its subpaths before using direct imports.\n\nThese optimizations provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.\n\nLibraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.\n\nReference: [https://vercel.com/blog/how-we-optimized-package-imports-in-next-js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)\n\n### 2.2 Conditional Module Loading\n\n**Impact: HIGH (loads large data only when needed)**\n\nLoad large data or modules only when a feature is activated.\n\n**Example: lazy-load animation frames**\n\n```tsx\nfunction AnimationPlayer({\n  enabled,\n  setEnabled,\n}: {\n  enabled: boolean;\n  setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n}) {\n  const [frames, setFrames] = useState<Frame[] | null>(null);\n\n  useEffect(() => {\n    if (enabled && !frames && typeof window !== \"undefined\") {\n      import(\"./animation-frames.js\")\n        .then((mod) => setFrames(mod.frames))\n        .catch(() => setEnabled(false));\n    }\n  }, [enabled, frames, setEnabled]);\n\n  if (!frames) return <Skeleton />;\n  return <Canvas frames={frames} />;\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling this module for SSR, optimizing server bundle size and build speed.\n\n### 2.3 Defer Non-Critical Third-Party Libraries\n\n**Impact: MEDIUM (loads after hydration)**\n\nAnalytics, logging, and error tracking don't block user interaction. Load them after hydration.\n\n**Incorrect: blocks initial bundle**\n\n```tsx\nimport { Analytics } from \"@vercel/analytics/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n**Correct: loads after hydration**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst Analytics = dynamic(\n  () => import(\"@vercel/analytics/react\").then((m) => m.Analytics),\n  { ssr: false },\n);\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Analytics />\n      </body>\n    </html>\n  );\n}\n```\n\n### 2.4 Dynamic Imports for Heavy Components\n\n**Impact: CRITICAL (directly affects TTI and LCP)**\n\nUse `next/dynamic` to lazy-load large components not needed on initial render.\n\n**Incorrect: Monaco bundles with main chunk ~300KB**\n\n```tsx\nimport { MonacoEditor } from \"./monaco-editor\";\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n**Correct: Monaco loads on demand**\n\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst MonacoEditor = dynamic(\n  () => import(\"./monaco-editor\").then((m) => m.MonacoEditor),\n  { ssr: false },\n);\n\nfunction CodePanel({ code }: { code: string }) {\n  return <MonacoEditor value={code} />;\n}\n```\n\n### 2.5 Preload Based on User Intent\n\n**Impact: MEDIUM (reduces perceived latency)**\n\nPreload heavy bundles before they're needed to reduce perceived latency.\n\n**Example: preload on hover/focus**\n\n```tsx\nfunction EditorButton({ onClick }: { onClick: () => void }) {\n  const preload = () => {\n    if (typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\");\n    }\n  };\n\n  return (\n    <button onMouseEnter={preload} onFocus={preload} onClick={onClick}>\n      Open Editor\n    </button>\n  );\n}\n```\n\n**Example: preload when feature flag is enabled**\n\n```tsx\nfunction FlagsProvider({ children, flags }: Props) {\n  useEffect(() => {\n    if (flags.editorEnabled && typeof window !== \"undefined\") {\n      void import(\"./monaco-editor\").then((mod) => mod.init());\n    }\n  }, [flags.editorEnabled]);\n\n  return (\n    <FlagsContext.Provider value={flags}>{children}</FlagsContext.Provider>\n  );\n}\n```\n\nThe `typeof window !== 'undefined'` check prevents bundling preloaded modules for SSR, optimizing server bundle size and build speed.\n\n---\n\n## 3. Server-Side Performance\n\n**Impact: HIGH**\n\nOptimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n### 3.1 Authenticate Server Actions Like API Routes\n\n**Impact: CRITICAL (prevents unauthorized access to server mutations)**\n\nServer Actions (functions with `\"use server\"`) are exposed as public endpoints, just like API routes. Always verify authentication and authorization **inside** each Server Action—do not rely solely on middleware, layout guards, or page-level checks, as Server Actions can be invoked directly.\n\nNext.js documentation explicitly states: \"Treat Server Actions with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation.\"\n\n**Incorrect: no authentication check**\n\n```typescript\n\"use server\";\n\nexport async function deleteUser(userId: string) {\n  // Anyone can call this! No auth check\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**Correct: authentication inside the action**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { unauthorized } from \"@/lib/errors\";\n\nexport async function deleteUser(userId: string) {\n  // Always check auth inside the action\n  const session = await verifySession();\n\n  if (!session) {\n    throw unauthorized(\"Must be logged in\");\n  }\n\n  // Check authorization too\n  if (session.user.role !== \"admin\" && session.user.id !== userId) {\n    throw unauthorized(\"Cannot delete other users\");\n  }\n\n  await db.user.delete({ where: { id: userId } });\n  return { success: true };\n}\n```\n\n**With input validation:**\n\n```typescript\n\"use server\";\n\nimport { verifySession } from \"@/lib/auth\";\nimport { z } from \"zod\";\n\nconst updateProfileSchema = z.object({\n  userId: z.string().uuid(),\n  name: z.string().min(1).max(100),\n  email: z.string().email(),\n});\n\nexport async function updateProfile(data: unknown) {\n  // Validate input first\n  const validated = updateProfileSchema.parse(data);\n\n  // Then authenticate\n  const session = await verifySession();\n  if (!session) {\n    throw new Error(\"Unauthorized\");\n  }\n\n  // Then authorize\n  if (session.user.id !== validated.userId) {\n    throw new Error(\"Can only update own profile\");\n  }\n\n  // Finally perform the mutation\n  await db.user.update({\n    where: { id: validated.userId },\n    data: {\n      name: validated.name,\n      email: validated.email,\n    },\n  });\n\n  return { success: true };\n}\n```\n\nReference: [https://nextjs.org/docs/app/guides/authentication](https://nextjs.org/docs/app/guides/authentication)\n\n### 3.2 Avoid Duplicate Serialization in RSC Props\n\n**Impact: LOW (reduces network payload by avoiding duplicate serialization)**\n\nRSC→client serialization deduplicates by object reference, not value. Same reference = serialized once; new reference = serialized again. Do transformations (`.toSorted()`, `.filter()`, `.map()`) in client, not server.\n\n**Incorrect: duplicates array**\n\n```tsx\n// RSC: sends 6 strings (2 arrays × 3 items)\n<ClientList usernames={usernames} usernamesOrdered={usernames.toSorted()} />\n```\n\n**Correct: sends 3 strings**\n\n```tsx\n// RSC: send once\n<ClientList usernames={usernames} />;\n\n// Client: transform there\n(\"use client\");\nconst sorted = useMemo(() => [...usernames].sort(), [usernames]);\n```\n\n**Nested deduplication behavior:**\n\n```tsx\n// string[] - duplicates everything\nusernames={['a','b']} sorted={usernames.toSorted()} // sends 4 strings\n\n// object[] - duplicates array structure only\nusers={[{id:1},{id:2}]} sorted={users.toSorted()} // sends 2 arrays + 2 unique objects (not 4)\n```\n\nDeduplication works recursively. Impact varies by data type:\n\n- `string[]`, `number[]`, `boolean[]`: **HIGH impact** - array + all primitives fully duplicated\n\n- `object[]`: **LOW impact** - array duplicated, but nested objects deduplicated by reference\n\n**Operations breaking deduplication: create new references**\n\n- Arrays: `.toSorted()`, `.filter()`, `.map()`, `.slice()`, `[...arr]`\n\n- Objects: `{...obj}`, `Object.assign()`, `structuredClone()`, `JSON.parse(JSON.stringify())`\n\n**More examples:**\n\n```tsx\n// ❌ Bad\n<C users={users} active={users.filter(u => u.active)} />\n<C product={product} productName={product.name} />\n\n// ✅ Good\n<C users={users} />\n<C product={product} />\n// Do filtering/destructuring in client\n```\n\n**Exception:** Pass derived data when transformation is expensive or client doesn't need original.\n\n### 3.3 Cross-Request LRU Caching\n\n**Impact: HIGH (caches across requests)**\n\n`React.cache()` only works within one request. For data shared across sequential requests (user clicks button A then button B), use an LRU cache.\n\n**Implementation:**\n\n```typescript\nimport { LRUCache } from \"lru-cache\";\n\nconst cache = new LRUCache<string, any>({\n  max: 1000,\n  ttl: 5 * 60 * 1000, // 5 minutes\n});\n\nexport async function getUser(id: string) {\n  const cached = cache.get(id);\n  if (cached) return cached;\n\n  const user = await db.user.findUnique({ where: { id } });\n  cache.set(id, user);\n  return user;\n}\n\n// Request 1: DB query, result cached\n// Request 2: cache hit, no DB query\n```\n\nUse when sequential user actions hit multiple endpoints needing the same data within seconds.\n\n**With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute):** LRU caching is especially effective because multiple concurrent requests can share the same function instance and cache. This means the cache persists across requests without needing external storage like Redis.\n\n**In traditional serverless:** Each invocation runs in isolation, so consider Redis for cross-process caching.\n\nReference: [https://github.com/isaacs/node-lru-cache](https://github.com/isaacs/node-lru-cache)\n\n### 3.4 Hoist Static I/O to Module Level\n\n**Impact: HIGH (avoids repeated file/network I/O per request)**\n\nWhen loading static assets (fonts, logos, images, config files) in route handlers or server functions, hoist the I/O operation to module level. Module-level code runs once when the module is first imported, not on every request. This eliminates redundant file system reads or network fetches that would otherwise run on every invocation.\n\n**Incorrect: reads font file on every request**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\nexport async function GET(request: Request) {\n  // Runs on EVERY request - expensive!\n  const fontData = await fetch(\n    new URL('./fonts/Inter.ttf', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  const logoData = await fetch(\n    new URL('./images/logo.png', import.meta.url)\n  ).then(res => res.arrayBuffer())\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Correct: loads once at module initialization**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\n\n// Module-level: runs ONCE when module is first imported\nconst fontData = fetch(\n  new URL('./fonts/Inter.ttf', import.meta.url)\n).then(res => res.arrayBuffer())\n\nconst logoData = fetch(\n  new URL('./images/logo.png', import.meta.url)\n).then(res => res.arrayBuffer())\n\nexport async function GET(request: Request) {\n  // Await the already-started promises\n  const [font, logo] = await Promise.all([fontData, logoData])\n\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logo} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: font }] }\n  )\n}\n```\n\n**Correct: synchronous fs at module level**\n\n```typescript\n// app/api/og/route.tsx\nimport { ImageResponse } from 'next/og'\nimport { readFileSync } from 'fs'\nimport { join } from 'path'\n\n// Synchronous read at module level - blocks only during module init\nconst fontData = readFileSync(\n  join(process.cwd(), 'public/fonts/Inter.ttf')\n)\n\nconst logoData = readFileSync(\n  join(process.cwd(), 'public/images/logo.png')\n)\n\nexport async function GET(request: Request) {\n  return new ImageResponse(\n    <div style={{ fontFamily: 'Inter' }}>\n      <img src={logoData} />\n      Hello World\n    </div>,\n    { fonts: [{ name: 'Inter', data: fontData }] }\n  )\n}\n```\n\n**Incorrect: reads config on every call**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nexport async function processRequest(data: Data) {\n  const config = JSON.parse(await fs.readFile(\"./config.json\", \"utf-8\"));\n  const template = await fs.readFile(\"./template.html\", \"utf-8\");\n\n  return render(template, data, config);\n}\n```\n\n**Correct: hoists config and template to module level**\n\n```typescript\nimport fs from \"node:fs/promises\";\n\nconst configPromise = fs.readFile(\"./config.json\", \"utf-8\").then(JSON.parse);\nconst templatePromise = fs.readFile(\"./template.html\", \"utf-8\");\n\nexport async function processRequest(data: Data) {\n  const [config, template] = await Promise.all([\n    configPromise,\n    templatePromise,\n  ]);\n\n  return render(template, data, config);\n}\n```\n\nWhen to use this pattern:\n\n- Loading fonts for OG image generation\n\n- Loading static logos, icons, or watermarks\n\n- Reading configuration files that don't change at runtime\n\n- Loading email templates or other static templates\n\n- Any static asset that's the same across all requests\n\nWhen not to use this pattern:\n\n- Assets that vary per request or user\n\n- Files that may change during runtime (use caching with TTL instead)\n\n- Large files that would consume too much memory if kept loaded\n\n- Sensitive data that shouldn't persist in memory\n\nWith Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute), module-level caching is especially effective because multiple concurrent requests share the same function instance. The static assets stay loaded in memory across requests without cold start penalties.\n\nIn traditional serverless, each cold start re-executes module-level code, but subsequent warm invocations reuse the loaded assets until the instance is recycled.\n\n### 3.5 Minimize Serialization at RSC Boundaries\n\n**Impact: HIGH (reduces data transfer size)**\n\nThe React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.\n\n**Incorrect: serializes all 50 fields**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser(); // 50 fields\n  return <Profile user={user} />;\n}\n\n(\"use client\");\nfunction Profile({ user }: { user: User }) {\n  return <div>{user.name}</div>; // uses 1 field\n}\n```\n\n**Correct: serializes only 1 field**\n\n```tsx\nasync function Page() {\n  const user = await fetchUser();\n  return <Profile name={user.name} />;\n}\n\n(\"use client\");\nfunction Profile({ name }: { name: string }) {\n  return <div>{name}</div>;\n}\n```\n\n### 3.6 Parallel Data Fetching with Component Composition\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nReact Server Components execute sequentially within a tree. Restructure with composition to parallelize data fetching.\n\n**Incorrect: Sidebar waits for Page's fetch to complete**\n\n```tsx\nexport default async function Page() {\n  const header = await fetchHeader();\n  return (\n    <div>\n      <div>{header}</div>\n      <Sidebar />\n    </div>\n  );\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n```\n\n**Correct: both fetch simultaneously**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nexport default function Page() {\n  return (\n    <div>\n      <Header />\n      <Sidebar />\n    </div>\n  );\n}\n```\n\n**Alternative with children prop:**\n\n```tsx\nasync function Header() {\n  const data = await fetchHeader();\n  return <div>{data}</div>;\n}\n\nasync function Sidebar() {\n  const items = await fetchSidebarItems();\n  return <nav>{items.map(renderItem)}</nav>;\n}\n\nfunction Layout({ children }: { children: ReactNode }) {\n  return (\n    <div>\n      <Header />\n      {children}\n    </div>\n  );\n}\n\nexport default function Page() {\n  return (\n    <Layout>\n      <Sidebar />\n    </Layout>\n  );\n}\n```\n\n### 3.7 Parallel Nested Data Fetching\n\n**Impact: CRITICAL (eliminates server-side waterfalls)**\n\nWhen fetching nested data in parallel, chain dependent fetches within each item's promise so a slow item doesn't block the rest.\n\n**Incorrect: a single slow item blocks all nested fetches**\n\n```tsx\nconst chats = await Promise.all(chatIds.map((id) => getChat(id)));\n\nconst chatAuthors = await Promise.all(\n  chats.map((chat) => getUser(chat.author)),\n);\n```\n\nIf one `getChat(id)` out of 100 is extremely slow, the authors of the other 99 chats can't start loading even though their data is ready.\n\n**Correct: each item chains its own nested fetch**\n\n```tsx\nconst chatAuthors = await Promise.all(\n  chatIds.map((id) => getChat(id).then((chat) => getUser(chat.author))),\n);\n```\n\nEach item independently chains `getChat` → `getUser`, so a slow chat doesn't block author fetches for the others.\n\n### 3.8 Per-Request Deduplication with React.cache()\n\n**Impact: MEDIUM (deduplicates within request)**\n\nUse `React.cache()` for server-side request deduplication. Authentication and database queries benefit most.\n\n**Usage:**\n\n```typescript\nimport { cache } from \"react\";\n\nexport const getCurrentUser = cache(async () => {\n  const session = await auth();\n  if (!session?.user?.id) return null;\n  return await db.user.findUnique({\n    where: { id: session.user.id },\n  });\n});\n```\n\nWithin a single request, multiple calls to `getCurrentUser()` execute the query only once.\n\n**Avoid inline objects as arguments:**\n\n`React.cache()` uses shallow equality (`Object.is`) to determine cache hits. Inline objects create new references each call, preventing cache hits.\n\n**Incorrect: always cache miss**\n\n```typescript\nconst getUser = cache(async (params: { uid: number }) => {\n  return await db.user.findUnique({ where: { id: params.uid } });\n});\n\n// Each call creates new object, never hits cache\ngetUser({ uid: 1 });\ngetUser({ uid: 1 }); // Cache miss, runs query again\n```\n\n**Correct: cache hit**\n\n```typescript\nconst params = { uid: 1 };\ngetUser(params); // Query runs\ngetUser(params); // Cache hit (same reference)\n```\n\nIf you must pass objects, pass the same reference:\n\n**Next.js-Specific Note:**\n\nIn Next.js, the `fetch` API is automatically extended with request memoization. Requests with the same URL and options are automatically deduplicated within a single request, so you don't need `React.cache()` for `fetch` calls. However, `React.cache()` is still essential for other async tasks:\n\n- Database queries (Prisma, Drizzle, etc.)\n\n- Heavy computations\n\n- Authentication checks\n\n- File system operations\n\n- Any non-fetch async work\n\nUse `React.cache()` to deduplicate these operations across your component tree.\n\nReference: [https://react.dev/reference/react/cache](https://react.dev/reference/react/cache)\n\n### 3.9 Use after() for Non-Blocking Operations\n\n**Impact: MEDIUM (faster response times)**\n\nUse Next.js's `after()` to schedule work that should execute after a response is sent. This prevents logging, analytics, and other side effects from blocking the response.\n\n**Incorrect: blocks response**\n\n```tsx\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Logging blocks the response\n  const userAgent = request.headers.get(\"user-agent\") || \"unknown\";\n  await logUserAction({ userAgent });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\n**Correct: non-blocking**\n\n```tsx\nimport { after } from \"next/server\";\nimport { headers, cookies } from \"next/headers\";\nimport { logUserAction } from \"@/app/utils\";\n\nexport async function POST(request: Request) {\n  // Perform mutation\n  await updateDatabase(request);\n\n  // Log after response is sent\n  after(async () => {\n    const userAgent = (await headers()).get(\"user-agent\") || \"unknown\";\n    const sessionCookie =\n      (await cookies()).get(\"session-id\")?.value || \"anonymous\";\n\n    logUserAction({ sessionCookie, userAgent });\n  });\n\n  return new Response(JSON.stringify({ status: \"success\" }), {\n    status: 200,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n}\n```\n\nThe response is sent immediately while logging happens in the background.\n\n**Common use cases:**\n\n- Analytics tracking\n\n- Audit logging\n\n- Sending notifications\n\n- Cache invalidation\n\n- Cleanup tasks\n\n**Important notes:**\n\n- `after()` runs even if the response fails or redirects\n\n- Works in Server Actions, Route Handlers, and Server Components\n\nReference: [https://nextjs.org/docs/app/api-reference/functions/after](https://nextjs.org/docs/app/api-reference/functions/after)\n\n---\n\n## 4. Client-Side Data Fetching\n\n**Impact: MEDIUM-HIGH**\n\nAutomatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n### 4.1 Deduplicate Global Event Listeners\n\n**Impact: LOW (single listener for N components)**\n\nUse `useSWRSubscription()` to share global event listeners across component instances.\n\n**Incorrect: N instances = N listeners**\n\n```tsx\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && e.key === key) {\n        callback();\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [key, callback]);\n}\n```\n\nWhen using the `useKeyboardShortcut` hook multiple times, each instance will register a new listener.\n\n**Correct: N instances = 1 listener**\n\n```tsx\nimport useSWRSubscription from \"swr/subscription\";\n\n// Module-level Map to track callbacks per key\nconst keyCallbacks = new Map<string, Set<() => void>>();\n\nfunction useKeyboardShortcut(key: string, callback: () => void) {\n  // Register this callback in the Map\n  useEffect(() => {\n    if (!keyCallbacks.has(key)) {\n      keyCallbacks.set(key, new Set());\n    }\n    keyCallbacks.get(key)!.add(callback);\n\n    return () => {\n      const set = keyCallbacks.get(key);\n      if (set) {\n        set.delete(callback);\n        if (set.size === 0) {\n          keyCallbacks.delete(key);\n        }\n      }\n    };\n  }, [key, callback]);\n\n  useSWRSubscription(\"global-keydown\", () => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.metaKey && keyCallbacks.has(e.key)) {\n        keyCallbacks.get(e.key)!.forEach((cb) => cb());\n      }\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  });\n}\n\nfunction Profile() {\n  // Multiple shortcuts will share the same listener\n  useKeyboardShortcut(\"p\", () => {\n    /* ... */\n  });\n  useKeyboardShortcut(\"k\", () => {\n    /* ... */\n  });\n  // ...\n}\n```\n\n### 4.2 Use Passive Event Listeners for Scrolling Performance\n\n**Impact: MEDIUM (eliminates scroll delay caused by event listeners)**\n\nAdd `{ passive: true }` to touch and wheel event listeners to enable immediate scrolling. Browsers normally wait for listeners to finish to check if `preventDefault()` is called, causing scroll delay.\n\n**Incorrect:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch);\n  document.addEventListener(\"wheel\", handleWheel);\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Correct:**\n\n```typescript\nuseEffect(() => {\n  const handleTouch = (e: TouchEvent) => console.log(e.touches[0].clientX);\n  const handleWheel = (e: WheelEvent) => console.log(e.deltaY);\n\n  document.addEventListener(\"touchstart\", handleTouch, { passive: true });\n  document.addEventListener(\"wheel\", handleWheel, { passive: true });\n\n  return () => {\n    document.removeEventListener(\"touchstart\", handleTouch);\n    document.removeEventListener(\"wheel\", handleWheel);\n  };\n}, []);\n```\n\n**Use passive when:** tracking/analytics, logging, any listener that doesn't call `preventDefault()`.\n\n**Don't use passive when:** implementing custom swipe gestures, custom zoom controls, or any listener that needs `preventDefault()`.\n\n### 4.3 Use SWR for Automatic Deduplication\n\n**Impact: MEDIUM-HIGH (automatic deduplication)**\n\nSWR enables request deduplication, caching, and revalidation across component instances.\n\n**Incorrect: no deduplication, each instance fetches**\n\n```tsx\nfunction UserList() {\n  const [users, setUsers] = useState([]);\n  useEffect(() => {\n    fetch(\"/api/users\")\n      .then((r) => r.json())\n      .then(setUsers);\n  }, []);\n}\n```\n\n**Correct: multiple instances share one request**\n\n```tsx\nimport useSWR from \"swr\";\n\nfunction UserList() {\n  const { data: users } = useSWR(\"/api/users\", fetcher);\n}\n```\n\n**For immutable data:**\n\n```tsx\nimport { useImmutableSWR } from \"@/lib/swr\";\n\nfunction StaticContent() {\n  const { data } = useImmutableSWR(\"/api/config\", fetcher);\n}\n```\n\n**For mutations:**\n\n```tsx\nimport { useSWRMutation } from \"swr/mutation\";\n\nfunction UpdateButton() {\n  const { trigger } = useSWRMutation(\"/api/user\", updateUser);\n  return <button onClick={() => trigger()}>Update</button>;\n}\n```\n\nReference: [https://swr.vercel.app](https://swr.vercel.app)\n\n### 4.4 Version and Minimize localStorage Data\n\n**Impact: MEDIUM (prevents schema conflicts, reduces storage size)**\n\nAdd version prefix to keys and store only needed fields. Prevents schema conflicts and accidental storage of sensitive data.\n\n**Incorrect:**\n\n```typescript\n// No version, stores everything, no error handling\nlocalStorage.setItem(\"userConfig\", JSON.stringify(fullUserObject));\nconst data = localStorage.getItem(\"userConfig\");\n```\n\n**Correct:**\n\n```typescript\nconst VERSION = \"v2\";\n\nfunction saveConfig(config: { theme: string; language: string }) {\n  try {\n    localStorage.setItem(`userConfig:${VERSION}`, JSON.stringify(config));\n  } catch {\n    // Throws in incognito/private browsing, quota exceeded, or disabled\n  }\n}\n\nfunction loadConfig() {\n  try {\n    const data = localStorage.getItem(`userConfig:${VERSION}`);\n    return data ? JSON.parse(data) : null;\n  } catch {\n    return null;\n  }\n}\n\n// Migration from v1 to v2\nfunction migrate() {\n  try {\n    const v1 = localStorage.getItem(\"userConfig:v1\");\n    if (v1) {\n      const old = JSON.parse(v1);\n      saveConfig({\n        theme: old.darkMode ? \"dark\" : \"light\",\n        language: old.lang,\n      });\n      localStorage.removeItem(\"userConfig:v1\");\n    }\n  } catch {}\n}\n```\n\n**Store minimal fields from server responses:**\n\n```typescript\n// User object has 20+ fields, only store what UI needs\nfunction cachePrefs(user: FullUser) {\n  try {\n    localStorage.setItem(\n      \"prefs:v1\",\n      JSON.stringify({\n        theme: user.preferences.theme,\n        notifications: user.preferences.notifications,\n      }),\n    );\n  } catch {}\n}\n```\n\n**Always wrap in try-catch:** `getItem()` and `setItem()` throw in incognito/private browsing (Safari, Firefox), when quota exceeded, or when disabled.\n\n**Benefits:** Schema evolution via versioning, reduced storage size, prevents storing tokens/PII/internal flags.\n\n---\n\n## 5. Re-render Optimization\n\n**Impact: MEDIUM**\n\nReducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n### 5.1 Calculate Derived State During Rendering\n\n**Impact: MEDIUM (avoids redundant renders and state drift)**\n\nIf a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.\n\n**Incorrect: redundant state and effect**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const [fullName, setFullName] = useState(\"\");\n\n  useEffect(() => {\n    setFullName(firstName + \" \" + lastName);\n  }, [firstName, lastName]);\n\n  return <p>{fullName}</p>;\n}\n```\n\n**Correct: derive during render**\n\n```tsx\nfunction Form() {\n  const [firstName, setFirstName] = useState(\"First\");\n  const [lastName, setLastName] = useState(\"Last\");\n  const fullName = firstName + \" \" + lastName;\n\n  return <p>{fullName}</p>;\n}\n```\n\nReference: [https://react.dev/learn/you-might-not-need-an-effect](https://react.dev/learn/you-might-not-need-an-effect)\n\n### 5.2 Defer State Reads to Usage Point\n\n**Impact: MEDIUM (avoids unnecessary subscriptions)**\n\nDon't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.\n\n**Incorrect: subscribes to all searchParams changes**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const searchParams = useSearchParams();\n\n  const handleShare = () => {\n    const ref = searchParams.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n**Correct: reads on demand, no subscription**\n\n```tsx\nfunction ShareButton({ chatId }: { chatId: string }) {\n  const handleShare = () => {\n    const params = new URLSearchParams(window.location.search);\n    const ref = params.get(\"ref\");\n    shareChat(chatId, { ref });\n  };\n\n  return <button onClick={handleShare}>Share</button>;\n}\n```\n\n### 5.3 Do not wrap a simple expression with a primitive result type in useMemo\n\n**Impact: LOW-MEDIUM (wasted computation on every render)**\n\nWhen an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.\n\nCalling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.\n\n**Incorrect:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = useMemo(() => {\n    return user.isLoading || notifications.isLoading;\n  }, [user.isLoading, notifications.isLoading]);\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n**Correct:**\n\n```tsx\nfunction Header({ user, notifications }: Props) {\n  const isLoading = user.isLoading || notifications.isLoading;\n\n  if (isLoading) return <Skeleton />;\n  // return some markup\n}\n```\n\n### 5.4 Don't Define Components Inside Components\n\n**Impact: HIGH (prevents remount on every render)**\n\nDefining a component inside another component creates a new component type on every render. React sees a different component each time and fully remounts it, destroying all state and DOM.\n\nA common reason developers do this is to access parent variables without passing props. Always pass props instead.\n\n**Incorrect: remounts on every render**\n\n```tsx\nfunction UserProfile({ user, theme }) {\n  // Defined inside to access `theme` - BAD\n  const Avatar = () => (\n    <img\n      src={user.avatarUrl}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n\n  // Defined inside to access `user` - BAD\n  const Stats = () => (\n    <div>\n      <span>{user.followers} followers</span>\n      <span>{user.posts} posts</span>\n    </div>\n  );\n\n  return (\n    <div>\n      <Avatar />\n      <Stats />\n    </div>\n  );\n}\n```\n\nEvery time `UserProfile` renders, `Avatar` and `Stats` are new component types. React unmounts the old instances and mounts new ones, losing any internal state, running effects again, and recreating DOM nodes.\n\n**Correct: pass props instead**\n\n```tsx\nfunction Avatar({ src, theme }: { src: string; theme: string }) {\n  return (\n    <img\n      src={src}\n      className={theme === \"dark\" ? \"avatar-dark\" : \"avatar-light\"}\n    />\n  );\n}\n\nfunction St\n\n<!-- [TRUNCATED AT 50KB] -->\n\n<!-- File: .agents/skills/vercel-react-best-practices/README.md (Tokens: ~852 | Category: anthropic-skill) -->\n# React Best Practices\n\nA structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `src/` - Build scripts and utilities\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n- **`test-cases.json`** - Test cases for LLM evaluation (generated)\n\n## Getting Started\n\n1. Install dependencies:\n\n   ```bash\n   pnpm install\n   ```\n\n2. Build AGENTS.md from rules:\n\n   ```bash\n   pnpm build\n   ```\n\n3. Validate rule files:\n\n   ```bash\n   pnpm validate\n   ```\n\n4. Extract test cases:\n   ```bash\n   pnpm extract-tests\n   ```\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `async-` for Eliminating Waterfalls (Section 1)\n   - `bundle-` for Bundle Size Optimization (Section 2)\n   - `server-` for Server-Side Performance (Section 3)\n   - `client-` for Client-Side Data Fetching (Section 4)\n   - `rerender-` for Re-render Optimization (Section 5)\n   - `rendering-` for Rendering Performance (Section 6)\n   - `js-` for JavaScript Performance (Section 7)\n   - `advanced-` for Advanced Patterns (Section 8)\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n\n## Rule File Structure\n\nEach rule file should follow this structure:\n\n````markdown\n---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description\ntags: tag1, tag2, tag3\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example\n```\n````\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example\n```\n\nOptional explanatory text after examples.\n\nReference: [Link](https://example.com)\n\n## File Naming Convention\n\n- Files starting with `_` are special (excluded from build)\n- Rule files: `area-description.md` (e.g., `async-parallel.md`)\n- Section is automatically inferred from filename prefix\n- Rules are sorted alphabetically by title within each section\n- IDs (e.g., 1.1, 1.2) are auto-generated during build\n\n## Impact Levels\n\n- `CRITICAL` - Highest priority, major performance gains\n- `HIGH` - Significant performance improvements\n- `MEDIUM-HIGH` - Moderate-high gains\n- `MEDIUM` - Moderate performance improvements\n- `LOW-MEDIUM` - Low-medium gains\n- `LOW` - Incremental improvements\n\n## Scripts\n\n- `pnpm build` - Compile rules into AGENTS.md\n- `pnpm validate` - Validate all rule files\n- `pnpm extract-tests` - Extract test cases for LLM evaluation\n- `pnpm dev` - Build and validate\n\n## Contributing\n\nWhen adding or modifying rules:\n\n1. Use the correct filename prefix for your section\n2. Follow the `_template.md` structure\n3. Include clear bad/good examples with explanations\n4. Add appropriate tags\n5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json\n6. Rules are automatically sorted by title - no need to manage numbers!\n\n## Acknowledgments\n\nOriginally created by [@shuding](https://x.com/shuding) at [Vercel](https://vercel.com).\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/_sections.md (Tokens: ~318 | Category: anthropic-skill) -->\n# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Eliminating Waterfalls (async)\n\n**Impact:** CRITICAL  \n**Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.\n\n## 2. Bundle Size Optimization (bundle)\n\n**Impact:** CRITICAL  \n**Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.\n\n## 3. Server-Side Performance (server)\n\n**Impact:** HIGH  \n**Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.\n\n## 4. Client-Side Data Fetching (client)\n\n**Impact:** MEDIUM-HIGH  \n**Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests.\n\n## 5. Re-render Optimization (rerender)\n\n**Impact:** MEDIUM  \n**Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.\n\n## 6. Rendering Performance (rendering)\n\n**Impact:** MEDIUM  \n**Description:** Optimizing the rendering process reduces the work the browser needs to do.\n\n## 7. JavaScript Performance (js)\n\n**Impact:** LOW-MEDIUM  \n**Description:** Micro-optimizations for hot paths can add up to meaningful improvements.\n\n## 8. Advanced Patterns (advanced)\n\n**Impact:** LOW  \n**Description:** Advanced patterns for specific cases that require careful implementation.\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/_template.md (Tokens: ~143 | Category: anthropic-skill) -->\n---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: Optional description of impact (e.g., \"20-50% improvement\")\ntags: tag1, tag2\n---\n\n## Rule Title Here\n\n**Impact: MEDIUM (optional impact description)**\n\nBrief explanation of the rule and why it matters. This should be clear and concise, explaining the performance implications.\n\n**Incorrect (description of what's wrong):**\n\n```typescript\n// Bad code example here\nconst bad = example();\n```\n\n**Correct (description of what's right):**\n\n```typescript\n// Good code example here\nconst good = example();\n```\n\nReference: [Link to documentation or resource](https://example.com)\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md (Tokens: ~337 | Category: anthropic-skill) -->\n---\ntitle: Store Event Handlers in Refs\nimpact: LOW\nimpactDescription: stable subscriptions\ntags: advanced, hooks, refs, event-handlers, optimization\n---\n\n## Store Event Handlers in Refs\n\nStore callbacks in refs when used in effects that shouldn't re-subscribe on callback changes.\n\n**Incorrect (re-subscribes on every render):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  useEffect(() => {\n    window.addEventListener(event, handler);\n    return () => window.removeEventListener(event, handler);\n  }, [event, handler]);\n}\n```\n\n**Correct (stable subscription):**\n\n```tsx\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const handlerRef = useRef(handler);\n  useEffect(() => {\n    handlerRef.current = handler;\n  }, [handler]);\n\n  useEffect(() => {\n    const listener = (e) => handlerRef.current(e);\n    window.addEventListener(event, listener);\n    return () => window.removeEventListener(event, listener);\n  }, [event]);\n}\n```\n\n**Alternative: use `useEffectEvent` if you're on latest React:**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction useWindowEvent(event: string, handler: (e) => void) {\n  const onEvent = useEffectEvent(handler);\n\n  useEffect(() => {\n    window.addEventListener(event, onEvent);\n    return () => window.removeEventListener(event, onEvent);\n  }, [event]);\n}\n```\n\n`useEffectEvent` provides a cleaner API for the same pattern: it creates a stable function reference that always calls the latest version of the handler.\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/advanced-init-once.md (Tokens: ~230 | Category: anthropic-skill) -->\n---\ntitle: Initialize App Once, Not Per Mount\nimpact: LOW-MEDIUM\nimpactDescription: avoids duplicate init in development\ntags: initialization, useEffect, app-startup, side-effects\n---\n\n## Initialize App Once, Not Per Mount\n\nDo not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.\n\n**Incorrect (runs twice in dev, re-runs on remount):**\n\n```tsx\nfunction Comp() {\n  useEffect(() => {\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\n**Correct (once per app load):**\n\n```tsx\nlet didInit = false;\n\nfunction Comp() {\n  useEffect(() => {\n    if (didInit) return;\n    didInit = true;\n    loadFromStorage();\n    checkAuthToken();\n  }, []);\n\n  // ...\n}\n```\n\nReference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md (Tokens: ~253 | Category: anthropic-skill) -->\n---\ntitle: useEffectEvent for Stable Callback Refs\nimpact: LOW\nimpactDescription: prevents effect re-runs\ntags: advanced, hooks, useEffectEvent, refs, optimization\n---\n\n## useEffectEvent for Stable Callback Refs\n\nAccess latest values in callbacks without adding them to dependency arrays. Prevents effect re-runs while avoiding stale closures.\n\n**Incorrect (effect re-runs on every callback change):**\n\n```tsx\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearch(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query, onSearch]);\n}\n```\n\n**Correct (using React's useEffectEvent):**\n\n```tsx\nimport { useEffectEvent } from \"react\";\n\nfunction SearchInput({ onSearch }: { onSearch: (q: string) => void }) {\n  const [query, setQuery] = useState(\"\");\n  const onSearchEvent = useEffectEvent(onSearch);\n\n  useEffect(() => {\n    const timeout = setTimeout(() => onSearchEvent(query), 300);\n    return () => clearTimeout(timeout);\n  }, [query]);\n}\n```\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/async-api-routes.md (Tokens: ~241 | Category: anthropic-skill) -->\n---\ntitle: Prevent Waterfall Chains in API Routes\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: api-routes, server-actions, waterfalls, parallelization\n---\n\n## Prevent Waterfall Chains in API Routes\n\nIn API routes and Server Actions, start independent operations immediately, even if you don't await them yet.\n\n**Incorrect (config waits for auth, data waits for both):**\n\n```typescript\nexport async function GET(request: Request) {\n  const session = await auth();\n  const config = await fetchConfig();\n  const data = await fetchData(session.user.id);\n  return Response.json({ data, config });\n}\n```\n\n**Correct (auth and config start immediately):**\n\n```typescript\nexport async function GET(request: Request) {\n  const sessionPromise = auth();\n  const configPromise = fetchConfig();\n  const session = await sessionPromise;\n  const [config, data] = await Promise.all([\n    configPromise,\n    fetchData(session.user.id),\n  ]);\n  return Response.json({ data, config });\n}\n```\n\nFor operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md (Tokens: ~277 | Category: anthropic-skill) -->\n---\ntitle: Check Cheap Conditions Before Async Flags\nimpact: HIGH\nimpactDescription: avoids unnecessary async work when a synchronous guard already fails\ntags: async, await, feature-flags, short-circuit, conditional\n---\n\n## Check Cheap Conditions Before Async Flags\n\nWhen a branch uses `await` for a flag or remote value and also requires a **cheap synchronous** condition (local props, request metadata, already-loaded state), evaluate the cheap condition **first**. Otherwise you pay for the async call even when the compound condition can never be true.\n\nThis is a specialization of [Defer Await Until Needed](./async-defer-await.md) for `flag && cheapCondition` style checks.\n\n**Incorrect:**\n\n```typescript\nconst someFlag = await getFlag();\n\nif (someFlag && someCondition) {\n  // ...\n}\n```\n\n**Correct:**\n\n```typescript\nif (someCondition) {\n  const someFlag = await getFlag();\n  if (someFlag) {\n    // ...\n  }\n}\n```\n\nThis matters when `getFlag` hits the network, a feature-flag service, or `React.cache` / DB work: skipping it when `someCondition` is false removes that cost on the cold path.\n\nKeep the original order if `someCondition` is expensive, depends on the flag, or you must run side effects in a fixed order.\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/async-defer-await.md (Tokens: ~464 | Category: anthropic-skill) -->\n---\ntitle: Defer Await Until Needed\nimpact: HIGH\nimpactDescription: avoids blocking unused code paths\ntags: async, await, conditional, optimization\n---\n\n## Defer Await Until Needed\n\nMove `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.\n\n**Incorrect (blocks both branches):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  const userData = await fetchUserData(userId);\n\n  if (skipProcessing) {\n    // Returns immediately but still waited for userData\n    return { skipped: true };\n  }\n\n  // Only this branch uses userData\n  return processUserData(userData);\n}\n```\n\n**Correct (only blocks when needed):**\n\n```typescript\nasync function handleRequest(userId: string, skipProcessing: boolean) {\n  if (skipProcessing) {\n    // Returns immediately without waiting\n    return { skipped: true };\n  }\n\n  // Fetch only when needed\n  const userData = await fetchUserData(userId);\n  return processUserData(userData);\n}\n```\n\n**Another example (early return optimization):**\n\n```typescript\n// Incorrect: always fetches permissions\nasync function updateResource(resourceId: string, userId: string) {\n  const permissions = await fetchPermissions(userId);\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n\n// Correct: fetches only when needed\nasync function updateResource(resourceId: string, userId: string) {\n  const resource = await getResource(resourceId);\n\n  if (!resource) {\n    return { error: \"Not found\" };\n  }\n\n  const permissions = await fetchPermissions(userId);\n\n  if (!permissions.canEdit) {\n    return { error: \"Forbidden\" };\n  }\n\n  return await updateResourceData(resource, permissions);\n}\n```\n\nThis optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.\n\nFor `await getFlag()` combined with a cheap synchronous guard (`flag && someCondition`), see [Check Cheap Conditions Before Async Flags](./async-cheap-condition-before-await.md).\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/async-dependencies.md (Tokens: ~294 | Category: anthropic-skill) -->\n---\ntitle: Dependency-Based Parallelization\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, dependencies, better-all\n---\n\n## Dependency-Based Parallelization\n\nFor operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.\n\n**Incorrect (profile waits for config unnecessarily):**\n\n```typescript\nconst [user, config] = await Promise.all([fetchUser(), fetchConfig()]);\nconst profile = await fetchProfile(user.id);\n```\n\n**Correct (config and profile run in parallel):**\n\n```typescript\nimport { all } from \"better-all\";\n\nconst { user, config, profile } = await all({\n  async user() {\n    return fetchUser();\n  },\n  async config() {\n    return fetchConfig();\n  },\n  async profile() {\n    return fetchProfile((await this.$.user).id);\n  },\n});\n```\n\n**Alternative without extra dependencies:**\n\nWe can also create all the promises first, and do `Promise.all()` at the end.\n\n```typescript\nconst userPromise = fetchUser();\nconst profilePromise = userPromise.then((user) => fetchProfile(user.id));\n\nconst [user, config, profile] = await Promise.all([\n  userPromise,\n  fetchConfig(),\n  profilePromise,\n]);\n```\n\nReference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)\n\n<!-- File: .agents/skills/vercel-react-best-practices/rules/async-parallel.md (Tokens: ~144 | Category: anthropic-skill) -->\n---\ntitle: Promise.all() for Independent Operations\nimpact: CRITICAL\nimpactDescription: 2-10× improvement\ntags: async, parallelization, promises, waterfalls\n---\n\n## Promise.all() for Independent Operations\n\nWhen async operations have no interdependencies, execute them concurrently using `Promise.all()`.\n\n**Incorrect (sequential execution, 3 round trips):**\n\n```typescript\nconst user = await fetchUser();\nconst posts = await fetchPosts();\nconst comments = await fetchComments();\n```\n\n**Correct (parallel execution, 1 round trip):**\n\n```typescript\nconst [user, posts, comments] = await Promise.all([\n  fetchUser(),\n  fetchPosts(),\n  fetchComments(),\n]);\n```\n\n<!-- ... +66 more modular skills available via /api/skills/caorushizi/mediago?path={path} -->\n</yakaai_skills>"}