Frontend implementation skill for ima2 users. Use for any frontend, web UI, or visual implementation work — building, styling, or redesigning pages/components, responsive layouts, motion, component architecture, and production-surface polish. Pairs with ima2-uiux: load it first when design direction is vague; this skill implements the chosen direction. Triggers: 'frontend', 'UI', 'component', 'CSS', 'responsive', 'animation', 'React', 'Vue', 'Svelte', 'Tailwind', 'layout', 'styling', 'redesign', 'mockup', 'anti-slop', '프론트엔드', 'UI 작업', '반응형', '디자인 수정'.
Agent bootstrap:ima2 ping first. If unreachable: ima2 serve &. If not
installed: npm install -g ima2-gen && ima2 setup. Use ima2 skill path to
locate the skills directory; read ../ima2-uiux/SKILL.md for design direction
and ../ima2-front/SKILL.md (this file) for implementation.
Build production-grade frontend implementations from an established product/design direction.
This skill owns HTML/CSS/component/runtime implementation, responsive behavior, accessibility
wiring, visual verification, and frontend platform rules.
Role separation: For design judgment — typography/color/layout direction, UX decision
gates, product personalities, or vague visual briefs — load ima2-uiux first. This
skill implements the chosen direction; ima2-uiux makes the design decisions.
Implementation anti-slop enforcement stays here; design taste/pattern judgment lives there.
C0/C1 work (small local patches): For small patches, skip the full reference chain.
Modular References
Loading references via CLI:Recommended: install skills to your agent's skill directory.
ima2 skill install --dir <agent-skill-path> # agent provides its own path
ima2 skill install --tmp # ephemeral fallback
The agent determines its own skill directory (e.g. ~/.codex/skills/,
./skills/, etc.) and passes it via --dir. After install, SKILL.md and
references/ are on disk — the agent reads them natively via relative paths.
Ad-hoc reading (without install):
ima2 skill front refs # list all reference modules with line counts
ima2 skill front ref motion # print one module (basename match)
ima2 skill front ref stacks/react # print a nested module
File
When to Read
What It Covers
references/crud-ui.md
C2 list/detail/form product screens
State coverage (loading/empty/error/permission), forms, objective UX gates
references/anti-slop.md
New components or UI redesign
2026 AI slop patterns, Korean slop, oversized text, fake assets, default UI smells
Start with anti-slop.md, aesthetics.md, responsive-viewport.md, and visual-verification.md. Add domain/locale/stack references only when relevant.
For C2 ordinary app screens (form/table/list/detail), crud-ui.md alone suffices; add the style references above for marketing/visual surfaces or C3+ work.
When frontend choices depend on current framework, design-system, browser API,
library behavior, browser-rendered source evidence, or package/source freshness,
read the active search skill and follow its source-fetch and evidence-status
rules before treating external material as proof.
Verification grounding
STRICT: For render/executable artifacts (HTML, SVG, games, UI, charts),
run the real renderer: headless browser, screenshot, canvas check, or equivalent.
Observe the actual output yourself, fix what observation reveals, then re-run.
Static parsing confirms well-formed files; it does not prove the artifact is
visually or interactively correct. One clean observation is enough for unchanged
state; do not re-render unchanged output just to repeat evidence.
0. Frontend Routing
Before designing or coding, classify the work:
Decision
Options
Why It Matters
Product surface
landing, app, dashboard, AI tool, public service, education, game, creative
For apps/tools/dashboards, build the actual working surface first, not a marketing hero.
For Korean-first work, read korea-2026.md and ux-writing-ko.md.
For any soft 3D miniature, mascot, chibi, toy-like object, or character-like asset, read soft-3d-asset-gates.md.
For product/brand/object/place/person pages, use concrete visual assets in the first viewport.
For finance, government, B2B, admin, auth, security, and developer tools, keep visual warmth restrained and subordinate to clarity.
Every user-facing decision point must justify its existence — defaults first, one primary action per screen, choices demoted to progressive disclosure (ima2-uiux UX-LAZY-01 owns the gate).
For text-heavy surfaces (landing, marketing, editorial, public service), apply typography wrapping defaults — see typography-wrapping.md. Dashboard table cells are excluded.
1. Component Identification
When the user describes UI in vague terms (e.g. "접히는 거", "팝업 같은 거"):
Recommend the best-fit component with reasoning: <Name> — <what it does, why it fits>
For new React/Vue/Svelte/Next UI source files, prefer .tsx or typed component files when the repo supports TypeScript. Inherit dev TypeScript strict-compatibility rules.
If frontend structure is unclear, read existing source-of-truth docs first, then document pages, components, routes, state stores, and build commands in the repo's existing docs before broad implementation.
1.5 Objective Gates vs Style Samples
Two different kinds of rules live in this skill (see the work classifier):
Objective UX gates (STRICT/DEFAULT) — accessibility baseline (§7, §11), state coverage
(loading/empty/error/permission), keyboard operability, visible focus, contrast. Missing
these are review findings.
Style direction (STYLE_SAMPLE) — design direction intake (§2), aesthetics, density profiles,
product personalities, preset tokens, and the concrete values in §4-§5 (palettes, font
choices, pixel max-widths). These illustrate acceptable choices; they are NOT
requirements, must not override an existing design system (Design System Detection stays
MANDATORY), and must never be enforced as universal taste (UX-STYLE-01).
2. Design Direction Intake
When the user cannot articulate a clear design direction, load ima2-uiux to
discover intent and choose a direction before implementing here.
Before coding, commit to a domain-correct direction:
Purpose: What problem does this interface solve? Who uses it?
Surface: Is this a working tool, dashboard, public service, AI workflow, game, landing page, or editorial surface?
Tone: Pick a specific direction. For product tools this often means quiet, dense, trustworthy, and fast rather than loud.
Signature: What ONE thing will make this unforgettable? (the signature
moment; supporting scroll reveals may exist alongside it per
motion.md FE-MOTION-BUCKET-01)
When user intent is vague ("깔끔하게", "모던하게", "just make it look good"), read the ima2-uiux skill and run the User Intent Discovery Protocol before making routing decisions.
If the user cannot answer these questions, use the ima2-uiux skill's structured preference elicitation flow. Offer product references ("Notion 느낌? Linear 느낌?") and visual comparisons.
Concept pass before code (stub — canonical: ima2-uiux §2.5 UX-CONCEPT-GEN-01):
for a C2+ new/redesigned expressive or brand-visible surface (page, hero, key
chrome like a top bar) with open design direction — probe ima2 status, attempt
ima2 serve if down, then run ima2 models --kind image and configure
ima2 defaults set image <lane>/<model> before any bare ima2 gen; use the
native image generator only as a true fallback — then
generate 5 highly specific candidate mockups of ONE locked concept, then SYNTHESIZE the
best elements across all 5 (NOT pick a single winner) into DESIGN.md and implement from
that synthesis — do not start coding the layout blind.
Intentionality over intensity. Bold maximalism, refined minimalism, dense utility, and friendly consumer UI can all work when they match the domain.
3. Baseline Configuration
Adjust these dials based on what's being built. Present to user if unclear.
Dial
Default
Range
Meaning
DESIGN_VARIANCE
5
1-10
1=symmetric utility, 10=asymmetric art
MOTION_INTENSITY
4
1-10
1=static, 10=cinematic choreography
VISUAL_DENSITY
5
1-10
1=art gallery airy, 10=cockpit dense
After Design Read, set dials per ima2-uiux §2 Dial Setting.
Product density profile (D1-D8 in references/product-density.md) sets component class; VISUAL_DENSITY (1-10) sets spacing within that class. These are orthogonal axes.
Adapt dynamically based on user requests. Dashboard → density up. Portfolio → variance up. Data tool → motion down.
Korean app/tool surfaces usually need higher density and clearer hierarchy, not oversized hero text.
4. Implementation
Read references/aesthetics.md for full guidelines. Summary:
Typography: Use domain-appropriate typography. For Korean-first UIs, prioritize CJK-safe stacks before Latin display fonts. Apply text-wrap: balance on all headings AND short descriptors (hero subtitle, card description, caption — anything 1-3 lines). Use text-wrap: pretty only on body paragraphs (4+ lines). pretty has no effect on short text and will leave Korean orphans like "합니다." or "화." on a line alone. See typography-wrapping.md for full rules.
Color: Max 1 accent. Use neutral bases (Zinc/Slate) with singular high-contrast accent — avoid purple-on-white.
Layout: Match the product surface. Avoid centered-card/hero patterns in repeated-use tools.
Motion: See references/motion.md. One signature moment + a few
supporting reveals > 10 scattered effects; landing-bucket floor/ceiling per
FE-MOTION-BUCKET-01.
Assets: Use screenshots, product images, diagrams, charts, illustrations, generated bitmaps, or soft 3D only when they add product meaning. When a real bitmap is needed (icon, hero, illustration), generate it with ima2 — probe ima2 status, attempt ima2 serve if down, inspect ima2 models --kind image, and set ima2 defaults set image <lane>/<model> before using bare generation — falling back to the native imagegen tool only when ima2 is truly unavailable; never ship a placeholder. ima2 is preferred because it supports reference images, multi-candidate generation (-n N, multimode, independent CLI parallel — see asset-requirements.md FE-ASSET-PARALLEL-01), a backend-selectable prompt builder, raster-to-vector tracing (ima2 vectorize and Canvas trace — see asset-requirements.md Raster vs real vector), session style sheets, provider routing (GPT/Grok/Gemini — see asset-requirements.md FE-ASSET-PROVIDER-01), variant selection with element-ledger synthesis (asset-requirements.md FE-ASSET-SELECT-01), cutout asset background strategy (asset-requirements.md FE-ASSET-BG-01), and video (ima2 video — see motion.md FE-MOTION-VIDEO-01) for motion assets. For parallel generation, monitor with ima2 ps --json and cancel unwanted jobs with ima2 cancel <id>. Write very explicit long prompts (subject, composition, palette, lighting, style, aspect) per asset-requirements.md; prefer real/generated image or video assets over CSS gradient washes. Read any design reference or captured screenshot back into context with view_image before matching it. Third-party captures follow reference-capture.md (analysis-only, provenance manifest).
Visual verification: after UI changes, exercise the flow per visual verification (screenshot -> view_image) — browser:control-in-app-browser on the dev server, screenshot, view_image — instead of claiming visual correctness from code alone.
GPT Image 2 cannot produce transparent backgrounds. Requesting "transparent
background" or "PNG with alpha" yields checkerboard artifacts or solid fills.
Every cutout asset (icons, product shots, 3D objects, illustrations, stickers,
UI elements that float over arbitrary backgrounds) MUST use the solid-background-
then-remove pipeline. Full rules and recipes: references/asset-requirements.md
§ Asset Background Strategy.
Quick reference — generation template:
# Reflective/metallic/glass subjects → PURE BLACK bg
ima2 gen "3D render of [subject], [material/style details], [composition]. \
Floating on a PURE SOLID BLACK background. The background must be 100% flat \
pure black hex #000000. No checkerboard, no transparency pattern, no gradient, \
no floor plane, no shadow, no vignette, no ambient glow on the background." \
--model oauth/luna --quality high --size 1024x1024 --mode direct -o asset.png
# Dark/opaque subjects → PURE WHITE bg
ima2 gen "[subject description], centered, floating. PURE SOLID WHITE background \
hex #ffffff. No shadow, no gradient, no surface, no reflection plane." \
--model oauth/luna --quality high --size 1024x1024 --mode direct -o asset.png
# Known destination color → match it exactly
ima2 gen "[subject description], centered. PURE SOLID background hex #[target]. \
No gradient, no texture, no shadow." \
--model oauth/luna --quality medium --size 512x512 --mode direct -o asset.png
For programmatic removal (build pipelines): sharp, ImageMagick, or rembg.
For interactive cleanup: ima2 Canvas Mode. For targeted fix: ima2 edit.
5. Anti-Slop Enforcement
Rule classes (dev §0.2): items below are DEFAULT — deviate with a stated reason; concrete
values and palettes are STYLE_SAMPLE (§1.5); the emoji-as-UI-icon ban is the only STRICT item.
Read references/anti-slop.md for full rules. Key standards:
Hero discipline (FE-HERO-01)
First viewport must fit: hero content leaves a hint of the next section on mobile and desktop.
Keep hero copy to ~4 text elements max: headline, subhead, primary CTA, one proof/context line.
Do not put trust strips, pricing teasers, feature bullets, or mini dashboards inside the hero.
Logo walls belong below the hero, not as hero filler.
Plan font scale with image/product scale so neither crushes the other.
Treat unexamined default typography as a slop signal. Choose a domain-appropriate stack; Korean-first UI should use CJK-safe fonts and system fallbacks deliberately.
Gradient budget (FE-GRADIENT-01): gradient soup is the 2026 #1 anti-slop signal; max 1 ambient gradient per viewport and no gradients on 3+ sibling cards — see anti-slop.md § Gradient Budget
One-note theme ban (FE-ONENOTE-01): full-page single-hue dark washes (terminal green, cyber cyan, CRT amber) are the current dark-mode tell — see anti-slop.md § One-Note Theme Ban
No self-describing meta copy (FE-METACOPY-01): UI text must explain the product/user job, never narrate the mockup, layout, responsive behavior, or agent process — see anti-slop.md § Self-Describing Meta Copy
Use neutral or intentional color palettes — purple gradients on white are now the old tell; gradient overuse and one-note single-hue themes are the current tell
Use asymmetric or purposeful layouts — centered-everything reads as template
Vary card sizes, spans, and groupings — equal 3-card grids read as generic
Bento composition (FE-BENTO-01): bento grids must read as one interlocking slab with aligned row edges, a dominant cell, content-weighted spans, and no orphan tail — see layout-discipline.md § Bento Composition
Avoid oversized bold hero text inside tools, dashboards, admin, finance flows, and public services
Hero composition (FE-HERO-SPLIT-01): never build a split hero (left bold headline + right boxed screenshot/mockup card) unless the user explicitly requests one — the product visual is the stage (full-width, background, or interactive demo), never a right-column card; paid-conversion LPs are the one context to propose it — see layout-discipline.md § Hero Composition Grammar
Avoid asset-free UI: abstract blobs/gradients do not replace real visual evidence
Avoid generic soft 3D icon packs; soft 3D must be semantic, brand-consistent, and restrained
NEVER use emoji as UI visual elements (feature icons, card icons, section markers, buttons) — emoji in production UI is the #1 AI slop signal. Use SVG icons (Lucide/Phosphor/Heroicons). See anti-slop.md § Emoji Slop
Warm beige/cream backgrounds with brass/clay accents are banned as defaults for premium-consumer briefs — see anti-slop.md § Premium-Consumer Palette Ban
Layout monotony (same family repeated, 3+ zigzag sections, overused eyebrows) — see references/layout-discipline.md
Color, shape, and theme must be locked per-page and audited before shipping — see references/consistency-locks.md
Use off-black (#0a0a0a, #111) — pure #000000 lacks depth
Responsive enforcement: every multi-column section must declare its mobile/tablet collapse behavior — "it'll work at mobile" is not a plan. See responsive-viewport.md
Page containment required: max-w-[1400px] mx-auto or equivalent wrapper. Content stretching to viewport edges on wide monitors is a layout bug
Mobile is a different product: section composition, CTA placement, and interaction model change on mobile — it is NOT just "desktop stacked vertically." See mobile-ux.md
Use realistic, specific names and brands in placeholder content
Write original copy — avoid "Elevate", "Seamless", "Next-Gen" and similar clichés
Treat uncontrolled heading line breaks (orphaned single word, no text-wrap, no max-width in ch) as a slop signal — see typography-wrapping.md
Treat short descriptors (hero subtitle, card description, caption) using text-wrap: pretty instead of balance as a slop signal — pretty does nothing on 1-3 line text, especially Korean
Treat Korean orphan fragments ("합니다.", "화.", "입니다." alone on a line) as a slop signal — always verify Korean text breaks at target viewports
Treat generic stroke icons as brand logo substitutes as a slop signal — use actual brand SVGs from Simple Icons, SVGL, or press kits. See brand-asset-sourcing.md
When NO design brief exists, do not invent a generic default: apply the domain-gated no-brief kit owned by ima2-uiux §1 UX-DEFAULT-ISM-01 and state the assumption
Do not ship these tells (FE-AI-TELL-01)
Version labels in heroes, numbered eyebrows, middle-dot overuse, duplicate image reuse, monospace uppercase card labels, fake social-proof headers, decorative scroll cues, weather/status strips with no product purpose, photo-credit captions in UI chrome, and generic "trusted by teams worldwide" claims are AI-default tells. Full catalog: references/anti-slop.md + references/layout-discipline.md.
6. Performance Guardrails
Animate transform and opacity only — layout properties (top, left, width, height) cause jank
Grain/noise filters → fixed pseudo-elements only, keep off scrolling containers
will-change sparingly — remove after animation completes
Z-index only for systemic layers (navbar, modal, overlay)
Memoize perpetual animations in isolated components
Browser Connection Limits
Protocol
Limit
HTTP/1.1
6 connections per domain (Chrome/Firefox)
HTTP/2
1 TCP connection, 100 concurrent streams
WebSocket
Shares the HTTP/1.1 connection pool
Rules:
Never open >2 SSE/WebSocket connections to the same origin from one page
Use connection multiplexing (single WebSocket with channel/topic routing) over multiple connections
If >6 parallel requests needed: use HTTP/2, batch API endpoints, or domain sharding (last resort)
Preflight OPTIONS requests count against the connection limit; consolidate CORS-heavy calls
Banned:
Opening unbounded WebSocket connections per component instance
Polling from multiple components independently (centralize into one subscription, fan out via state)
Creating new SSE connections on every remount without cleanup
7. Accessibility Baseline
Semantic HTML (<button>, <nav>, <main>)
Keyboard navigation for all interactive elements
WCAG AA minimum (4.5:1 normal text, 3:1 large text)
Visible focus indicators (focus-visible:ring-2)
prefers-reduced-motion support
Skip link or equivalent bypass for repeated navigation
Focus must not be hidden by sticky headers, sticky bottom bars, sheets, or overlays
Icon-only buttons need accessible names (aria-label, visible text, or labelled-by)
Charts, status messages, loading progress, and AI streaming states need screen-reader labels or live regions where appropriate
Do not encode meaning by color alone
Modals, menus, comboboxes, bottom sheets, and command palettes must have a complete keyboard path
Stress-test Korean long labels and screen-reader names; clipped Hangul is a failure
Pointer targets follow WCAG 2.2 AA target-size rules; 44×44px is a conservative product baseline, not the only legal minimum
A11y polish (FE-A11Y-POLISH-01)
CTA text fits on one line at target breakpoints; if it wraps, shorten the label or change the layout.
Inputs need visible boundaries against their background in default, focus, error, and disabled states.
Duplicate CTA intent on the same screen should merge or clearly differ by outcome.
Button contrast is checked during visual review, not left to palette intent.
8. Custom Hooks
Create a custom hook only when it owns reusable behavior, not just because code is a few lines long.
Good hook candidates: subscription lifecycle, reusable async state machine, form-field behavior shared across components, media/query/observer integration, keyboard/focus behavior, external store wrapper.
Avoid hooks that are merely thin aliases for useState, useToggle, useDebounce, or one-off component logic unless the repo already standardizes them.
Hook rules:
The hook name describes behavior, not implementation
Inputs are explicit and stable; return shape is small
Side effects are justified by an external system; cleanup is correct
Dependencies are honest; use useEffectEvent for non-reactive callbacks inside Effects
Do not hide server state, router state, or form ownership inside a generic hook
9. React Performance
Default performance strategy: keep components pure, keep state local, classify state ownership correctly, use server rendering/caching boundaries, split expensive client islands, measure before memoizing.
Tool
Use when
memo
child render is expensive and props are stable
useMemo
calculation is expensive or identity is required
useCallback
callback identity is required by memoized child or external API
useTransition
interaction should stay responsive while non-urgent work completes
useOptimistic
mutation UX benefits from reversible optimistic state
Activity
hidden UI should preserve state without active Effects
If React Compiler is enabled, remove defensive memoization unless measurement or semantics justify it. Split at route boundaries and heavy components (charts, editors, 3D).
10. Form Handling
For simple forms, use controlled components with schema validation (Zod). For complex forms (multi-step, dynamic fields), use react-hook-form + Zod resolver. Always show field-level errors with role="alert".
11. Accessibility Quick-Wins
Beyond the baseline (§7):
Focus management: trap focus in modals, restore on close, handle Escape
Arrow keys navigate lists and menus; Enter/Space activate buttons and links
Tab order follows visual flow
aria-expanded, aria-haspopup, aria-activedescendant on composite widgets
Test with screen reader and keyboard-only navigation
12. 2026 Frontend Platform Rules
Use this section when modernizing or creating React/Next/Vite frontends. Prefer project conventions first.
React 19.2+
Activity: Use <Activity> for state-preserving hidden UI (tabs, drawers, route shells). Do not use for security hiding or active subscriptions.
useEffectEvent: For non-reactive logic inside Effects that needs latest props/state without resubscribing. Never call during render or pass to children.
Partial Pre-rendering: Design pages as static shell + explicit dynamic holes + Suspense boundaries. No Date.now(), Math.random(), or request-specific data in the pre-rendered shell.
React Compiler: Do not cargo-cult memo/useMemo/useCallback. Measure first unless referential stability is semantically required.
Next.js 16
Turbopack is default. Do not add custom webpack config unless proven unsupported.
Cache Components (cacheComponents: true): dynamic rendering is default; cache only what you explicitly mark with use cache + cacheLife + cacheTag.
Never cache user/session-specific data without explicit user-scoped cache key.
Server Actions: validate input server-side, authorize against the resource, revalidate affected cache tags.
Modern CSS
Prefer native CSS before JS layout observers or animation libraries:
Container queries for component-level responsive layout (not viewport)
:has() for parent/sibling state selection — keep selectors narrow
CSS nesting for modularity — keep shallow, avoid specificity tunnels
Subgrid when nested content must align to outer grid
View Transitions for meaningful state continuity — respect prefers-reduced-motion
Modern units: dvh/svh/lvh over 100vh, logical properties over left/right
Tailwind v4: CSS-first configuration, use theme variables over hardcoded values
Build Tools
Vite 8 (verified 2026-07-02): Rolldown/Oxc is the integrated default bundler (rolldown-vite is only a Vite 7 migration bridge). Node 20.19+/22.12+; Baseline target Chrome/Edge 111, Firefox 114, Safari 16.4. Detect Vite 7 vs 8 before editing config.
Agent-visible runtime diagnostics (DEFAULT): prefer dev servers that surface browser/runtime errors to the CLI/agent — Vite 8 forwards browser console to the dev server (auto-activates for coding agents); Next 16 ships DevTools MCP. Wire these before debugging rendered behavior.
Do not introduce Webpack-era config unless the existing app is already Webpack-bound
State Classification
Before adding state, classify it:
State type
Owner
Default tool
render-local UI
nearest component
useState / useReducer
derived
render calculation
expression / useMemo if expensive
form draft
form boundary
native form, React Hook Form, TanStack Form
server/cache
server/cache layer
RSC, Next cache, TanStack Query, SWR
URL/navigation
router
path params, search params
global client UI
external store
Zustand, Jotai, context
optimistic mutation
mutation boundary
useOptimistic, mutation library
AI stream
conversation boundary
append-only message model + stream status
Rules: Do not store derived state just to sync with Effect. Do not put server state in Zustand. Do not put URL-shareable state only in component state. Keep optimistic state reversible.
Design System Detection (MANDATORY — before creating tokens)
Before inventing design tokens, check:
Does the project have an installed design system? (grep -r "material-ui\|@mui\|carbon-components\|@carbon\|@fluentui\|govuk-frontend\|uswds" package.json)
Does the project have existing tokens? (find . -name "tokens.*" -o -name "theme.*" -o -name "design-system*")
Does the brief name a specific design system?
If YES to any: use the official package. Do not recreate CSS by hand.
System
Package
Import
Material
@mui/material
import { Button } from '@mui/material'
Carbon
@carbon/react
import { Button } from '@carbon/react'
Fluent
@fluentui/react
import { Button } from '@fluentui/react-components'
GOV.UK
govuk-frontend
import 'govuk-frontend/dist/govuk/all.scss'
USWDS
@uswds/uswds
import '@uswds/uswds/css/uswds.css'
If NO: proceed with ima2-uiux/references/design-system-bootstrap.md.
shadcn/ui and AI-Assisted UI
Inspect existing installed components before adding new ones
Use project's components.json, aliases, tokens, and registry conventions
Do not hallucinate design-system components; verify against local source
Remove demo-only copy and unused variants
For AI-native interfaces (chat, agent, copilot), design explicit states: empty → prompt ready → submitted → streaming → tool call → result → complete → feedback. Never fake streaming, citations, or tool calls.
13. Error Boundaries
React Error Boundary pattern:
Wrap each major section (not the entire app) in an Error Boundary
Checklist items apply to production surfaces (the work classifier shared definition); prototypes,
spikes, and internal demos are exempt unless the user asks for production polish.
Before delivering:
Domain-correct direction chosen and committed
Product surface, locale, density, asset need, soft 3D gate, and motion intensity classified
Required assets are real, semantic, rendered, and not generic decoration
Korean-first UI follows CJK typography and Korean UX writing rules
Soft 3D/miniature/character assets pass domain and semantic gates
Mobile layout collapse guaranteed with per-section-type rules (see layout-discipline.md § Responsive Transforms)
Full-height sections use min-h-[100dvh] not h-screen
Page containment: max-w-[1400px] mx-auto wrapper present (see responsive-viewport.md)
Tested at 768px (tablet) and 1024px (split-screen) in addition to mobile/desktop
Touch targets ≥ 44px on mobile; no hover-only interactions (see mobile-ux.md)
Responsive images use srcset/sizes or <picture> for art direction (see responsive-viewport.md)
Safe area padding for notched devices: env(safe-area-inset-*) on fixed elements
Loading, empty, and error states provided
State classified before adding store/Context/Effect/cache (§12)
Effects sync with external systems; derived state is not Effect-synced
Container queries considered before viewport-query or JS layout workarounds
View transitions respect reduced motion
shadcn components follow local registry and token conventions
AI UI states are honest: no fake streaming, citations, or tool calls
Forms validate with schema and show field-level errors (§10)
…(truncated)
1---2name: ima2-front3description: Frontend implementation skill for ima2 users. Use for any frontend, web UI, or visual implementation work — building, styling, or redesigning pages/components, responsive layouts, motion, component architecture, and production-surface polish. Pairs with ima2-uiux: load it first when design direction is vague; this skill implements the chosen direction. Triggers: 'frontend', 'UI', 'component', 'CSS', 'responsive', 'animation', 'React', 'Vue', 'Svelte', 'Tailwind', 'layout', 'styling', 'redesign', 'mockup', 'anti-slop', '프론트엔드', 'UI 작업', '반응형', '디자인 수정'.4---56# ima2 Frontend — Domain-Correct Frontend Engineering78## Setup910```bash11npm install -g ima2-gen # install globally (Node.js >= 20)12ima2 setup # first-time auth (GPT OAuth recommended)13ima2 serve # start local server14ima2 ping # verify15ima2 capabilities --json # check models, limits, providers16ima2 defaults --json # inspect default model/reasoning17```1819**Agent bootstrap:** `ima2 ping` first. If unreachable: `ima2 serve &`. If not20installed: `npm install -g ima2-gen && ima2 setup`. Use `ima2 skill path` to21locate the skills directory; read `../ima2-uiux/SKILL.md` for design direction22and `../ima2-front/SKILL.md` (this file) for implementation.2324Build production-grade frontend implementations from an established product/design direction.25This skill owns HTML/CSS/component/runtime implementation, responsive behavior, accessibility26wiring, visual verification, and frontend platform rules.2728> **Role separation:** For design judgment — typography/color/layout direction, UX decision29> gates, product personalities, or vague visual briefs — load `ima2-uiux` first. This30> skill implements the chosen direction; `ima2-uiux` makes the design decisions.31> Implementation anti-slop enforcement stays here; design taste/pattern judgment lives there.3233> **C0/C1 work (small local patches):** For small patches, skip the full reference chain.3435## Modular References3637> **Loading references via CLI:**38> **Recommended: install skills to your agent's skill directory.**39> ```bash40> ima2 skill install --dir <agent-skill-path> # agent provides its own path41> ima2 skill install --tmp # ephemeral fallback42> ```43> The agent determines its own skill directory (e.g. `~/.codex/skills/`,44> `./skills/`, etc.) and passes it via `--dir`. After install, SKILL.md and45> `references/` are on disk — the agent reads them natively via relative paths.46>47> **Ad-hoc reading (without install):**48> ```bash49> ima2 skill front refs # list all reference modules with line counts50> ima2 skill front ref motion # print one module (basename match)51> ima2 skill front ref stacks/react # print a nested module52> ```5354| File | When to Read | What It Covers |55| ----------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------- |56| `references/crud-ui.md` | C2 list/detail/form product screens | State coverage (loading/empty/error/permission), forms, objective UX gates |57| `references/anti-slop.md` | New components or UI redesign | 2026 AI slop patterns, Korean slop, oversized text, fake assets, default UI smells |58| `references/aesthetics.md` | Implementing an established visual direction | Domain-correct typography, color, composition, serif three-role system, expressive/functional layers, AI-brand grammar |59| `references/product-density.md` | Apps, tools, dashboards | Density profiles for landing, consumer app, SaaS, ops, finance, devtools |60| `references/asset-requirements.md` | Any public/product/visual surface | Required screenshots, images, diagrams, charts, generated bitmaps, or 3D assets, mockup production pipeline |61| `references/visual-verification.md` | Changes affecting rendered layout | Screenshot, viewport, text fit, state, asset, and motion verification |62| `references/korea-2026.md` | Korean-first or Korea-facing UI | Korean service patterns, CJK typography, formats, mobile flows, Korean serif/myeongjo display |63| `references/ux-writing-ko.md` | Korean UI copy | Natural Korean labels, error messages, tone, spacing, punctuation |64| `references/soft-3d-asset-gates.md` | 3D/miniature/character-like visuals | Toss-style soft 3D vs generic cute asset slop, domain gates |65| `references/motion.md` | Motion/animation needed | CSS animations, Framer Motion, CSS scroll-driven timelines, pointer-proximity chip motion (magnetic/dock), View Transitions, domain gates, organic bg + capsule label, product-led hero motion |66| `references/liquid-glass.md` | Translucent materials, glass chrome, pill-chip surfaces | Liquid Glass layer discipline, named material states (pill-at-top/pill-scrolled/media-overlay/clear), FE-PILL-NEST-01, blur-free pill alternative, perf + a11y gates |67| `references/top-bar.md` | Top/nav bar composition, sticky chrome | Top-bar grammar: geometry, slots, scroll-state contract (FE-TOPBAR-STATE-01), hover-surface contract (FE-TOPBAR-HOVER-01), domain gate, mobile collapse |68| `references/iterative-design.md` | Multi-round design | LLM convergence problem, Diverge→Kill→Mutate process, upgrade techniques |69| `references/prototype-variants.md` | Runnable design variants | `?variant=` switchers, structurally distinct options, cleanup after winner selection |70| `references/typography-wrapping.md` | Heading/descriptor text changes | `text-wrap: balance/pretty`, natural phrase breaks at any width, dynamic-viewport verification, `ch` units, Korean keep-all/orphan rules (verified 2026-07-07) |71| `references/logo-sections.md` | Integration/partner logo display | Marquee CSS, static grid, orphan cell fix, grayscale treatment, no individual hover |72| `references/brand-asset-sourcing.md` | Brand logos in UI | Simple Icons/SVGL sourcing, AI agent strategy, placeholder hierarchy, legal guide |73| `references/reference-capture.md` | Cloning/analyzing other sites | HTML+asset capture mechanics (pageAssets/curl), analysis-only legal line, provenance manifest, never-ship gate |74| `references/section-level-sourcing.md` | Section-level design work (hero, pricing, testimonials, etc.) | Per-section-type reference sources from Land-book, One Page Love, and Lapa.ninja |75| `../ima2-uiux/references/compositional-patterns.md` | Implementing an award-informed composition | Canonical hero, navigation, motion, and content-structure patterns with implementation gates |76| `../ima2-uiux/references/design-award-sources.md` | Sourcing real-world design references | Tiered award/gallery source guide and search tactics |77| `../ima2-uiux/references/design-trends.md` | Implementing a dated trend or checking whether a technique is stable | 2026-07-14 prevalence, maturity, signature status, risks, and re-crawl rules |78| `references/dropdown-layer.md` | Dropdowns, selects, menus, pickers | Unified dropdown design layer (FE-DROPDOWN-LAYER-01): one skin over headless primitives, DS-detection precedence, scope table, mobile sheet |79| `references/layout-discipline.md` | Landing/marketing pages | Hero, eyebrow, section repetition, bento, zigzag, per-section responsive transforms, hero composition grammar (2026) |80| `references/consistency-locks.md` | Any multi-section page | Color, shape, theme consistency per page |81| `references/responsive-viewport.md` | Layout or breakpoint changes | Canonical breakpoints, page containment, container queries, responsive images, safe area, split-screen |82| `references/mobile-ux.md` | Consumer/landing pages with mobile traffic | Thumb zone, touch targets, sticky CTA, mobile section composition, bottom sheet, portrait media |83| `references/seo-baseline.md` | Public-facing sites, SSR/SSG | SEO meta, JSON-LD, robots.txt, GEO strategies, OG/Twitter cards |84| `references/a11y-patterns.md` | Interactive widgets, modals, forms | ARIA patterns, focus management, keyboard nav, screen reader testing |85| `references/performance-budget.md` | Launch / audit | CWV targets, bundle budgets, font loading, image optimization, build gates |86| `references/theme-switching.md` | Dark mode / theme | CSS custom properties toggle, FOWT prevention, transition, component checklist |87| `references/color-system.md` | Color tokens, palettes wiring, theme-ready CSS | Token layering, `oklch()` + fallback discipline, `color-mix()`, `light-dark()`, Tailwind v4/shadcn wiring, contrast gates (verified 2026-07-07) |88| `references/i18n-global.md` | Multi-language / RTL | RTL layout, pluralization, Intl API, locale switching, content expansion |89| See also: `ima2-uiux` skill | Vague requests, onboarding, UX states | Intent discovery, design isms, product personalities, onboarding/empty/error patterns |90| `references/stacks/react.md` | React projects | Server Components, hooks, state, TanStack Query, shadcn/ui, performance |91| `references/stacks/nextjs.md` | Next.js projects | App Router, RSC, image optimization, data fetching, middleware |92| `references/stacks/vanilla.md` | HTML+CSS+JS (no framework) | Zero-dependency, viewport fitting, responsive CSS, progressive enhancement |93| `references/stacks/svelte.md` | Svelte/SvelteKit projects | Svelte 5 Runes, SvelteKit 2 routing/actions, snippets, migration from Svelte 4 |94| `references/stacks/mobile-native.md` | Native mobile app development | RN/Expo current pairing, Flutter 3.44, KMP, Swift 6, framework selection |95| `references/stacks/astro.md` | Astro projects | Islands architecture, multi-framework shell, content collections, SSG/SSR/hybrid |9697Start with `anti-slop.md`, `aesthetics.md`, `responsive-viewport.md`, and `visual-verification.md`. Add domain/locale/stack references only when relevant.98For C2 ordinary app screens (form/table/list/detail), `crud-ui.md` alone suffices; add the style references above for marketing/visual surfaces or C3+ work.99100When frontend choices depend on current framework, design-system, browser API,101library behavior, browser-rendered source evidence, or package/source freshness,102read the active `search` skill and follow its source-fetch and evidence-status103rules before treating external material as proof.104105### Verification grounding106107**STRICT:** For render/executable artifacts (HTML, SVG, games, UI, charts),108run the real renderer: headless browser, screenshot, canvas check, or equivalent.109Observe the actual output yourself, fix what observation reveals, then re-run.110Static parsing confirms well-formed files; it does not prove the artifact is111visually or interactively correct. One clean observation is enough for unchanged112state; do not re-render unchanged output just to repeat evidence.113114---115116## 0. Frontend Routing117118Before designing or coding, classify the work:119120| Decision | Options | Why It Matters |121| --- | --- | --- |122| Product surface | landing, app, dashboard, AI tool, public service, education, game, creative | Sets density, typography scale, asset requirements |123| Locale | Korean-first, global/i18n, English-only | Sets CJK typography, copy, date/number formats |124| Density | campaign, consumer app, productivity, SaaS, ops, finance, developer console | Prevents landing-page composition inside repeated-work tools |125| Asset need | none, screenshot, product photo, diagram, chart, illustration, soft 3D, game asset | Prevents asset-free gradient/card UI |126| Soft 3D/character gate | not allowed, subtle, primary | Prevents generic cute 3D/mascot slop |127| Motion intensity | static, feedback-only, expressive, cinematic | Prevents cinematic motion in utility workflows |128129Default rules:130- For apps/tools/dashboards, build the actual working surface first, not a marketing hero.131- For Korean-first work, read `korea-2026.md` and `ux-writing-ko.md`.132- For any soft 3D miniature, mascot, chibi, toy-like object, or character-like asset, read `soft-3d-asset-gates.md`.133- For product/brand/object/place/person pages, use concrete visual assets in the first viewport.134- For finance, government, B2B, admin, auth, security, and developer tools, keep visual warmth restrained and subordinate to clarity.135- Every user-facing decision point must justify its existence — defaults first, one primary action per screen, choices demoted to progressive disclosure (`ima2-uiux` UX-LAZY-01 owns the gate).136- For text-heavy surfaces (landing, marketing, editorial, public service), apply typography wrapping defaults — see `typography-wrapping.md`. Dashboard table cells are excluded.137138---139140## 1. Component Identification141142When the user describes UI in vague terms (e.g. "접히는 거", "팝업 같은 거"):1431. Recommend the best-fit component with reasoning: `<Name> — <what it does, why it fits>`1442. Confirm, then proceed145146If the user already names a specific component, skip this step.147Reference: [component.gallery/components](https://component.gallery/components/)148149For new React/Vue/Svelte/Next UI source files, prefer `.tsx` or typed component files when the repo supports TypeScript. Inherit `dev` TypeScript strict-compatibility rules.150If frontend structure is unclear, read existing source-of-truth docs first, then document pages, components, routes, state stores, and build commands in the repo's existing docs before broad implementation.151152---153154## 1.5 Objective Gates vs Style Samples155156Two different kinds of rules live in this skill (see the work classifier):157- **Objective UX gates (STRICT/DEFAULT)** — accessibility baseline (§7, §11), state coverage158 (loading/empty/error/permission), keyboard operability, visible focus, contrast. Missing159 these are review findings.160- **Style direction (STYLE_SAMPLE)** — design direction intake (§2), aesthetics, density profiles,161 product personalities, preset tokens, and the concrete values in §4-§5 (palettes, font162 choices, pixel max-widths). These illustrate acceptable choices; they are NOT163 requirements, must not override an existing design system (Design System Detection stays164 MANDATORY), and must never be enforced as universal taste (UX-STYLE-01).165## 2. Design Direction Intake166167> When the user cannot articulate a clear design direction, load `ima2-uiux` to168> discover intent and choose a direction before implementing here.169170Before coding, commit to a domain-correct direction:171- **Purpose**: What problem does this interface solve? Who uses it?172- **Surface**: Is this a working tool, dashboard, public service, AI workflow, game, landing page, or editorial surface?173- **Tone**: Pick a specific direction. For product tools this often means quiet, dense, trustworthy, and fast rather than loud.174- **Constraints**: Framework, performance budget, accessibility requirements.175- **Signature**: What ONE thing will make this unforgettable? (the signature176 moment; supporting scroll reveals may exist alongside it per177 `motion.md` FE-MOTION-BUCKET-01)178179When user intent is vague ("깔끔하게", "모던하게", "just make it look good"), read the `ima2-uiux` skill and run the User Intent Discovery Protocol before making routing decisions.180If the user cannot answer these questions, use the `ima2-uiux` skill's structured preference elicitation flow. Offer product references ("Notion 느낌? Linear 느낌?") and visual comparisons.181182**Concept pass before code (stub — canonical: `ima2-uiux` §2.5 UX-CONCEPT-GEN-01):**183for a C2+ new/redesigned expressive or brand-visible surface (page, hero, key184chrome like a top bar) with open design direction — probe `ima2 status`, attempt185`ima2 serve` if down, then run `ima2 models --kind image` and configure186`ima2 defaults set image <lane>/<model>` before any bare `ima2 gen`; use the187native image generator only as a true fallback — then188generate 5 highly specific candidate mockups of ONE locked concept, then SYNTHESIZE the189best elements across all 5 (NOT pick a single winner) into DESIGN.md and implement from190that synthesis — do not start coding the layout blind.191192Intentionality over intensity. Bold maximalism, refined minimalism, dense utility, and friendly consumer UI can all work when they match the domain.193194---195196## 3. Baseline Configuration197198Adjust these dials based on what's being built. Present to user if unclear.199200| Dial | Default | Range | Meaning |201| ---------------- | :-----: | :---: | ------------------------------------ |202| DESIGN_VARIANCE | 5 | 1-10 | 1=symmetric utility, 10=asymmetric art |203| MOTION_INTENSITY | 4 | 1-10 | 1=static, 10=cinematic choreography |204| VISUAL_DENSITY | 5 | 1-10 | 1=art gallery airy, 10=cockpit dense |205206After Design Read, set dials per `ima2-uiux` §2 Dial Setting.207208Product density profile (D1-D8 in `references/product-density.md`) sets component class; VISUAL_DENSITY (1-10) sets spacing within that class. These are orthogonal axes.209210Adapt dynamically based on user requests. Dashboard → density up. Portfolio → variance up. Data tool → motion down.211Korean app/tool surfaces usually need higher density and clearer hierarchy, not oversized hero text.212213---214215## 4. Implementation216217Read `references/aesthetics.md` for full guidelines. Summary:218219- **Typography**: Use domain-appropriate typography. For Korean-first UIs, prioritize CJK-safe stacks before Latin display fonts. Apply `text-wrap: balance` on all headings **AND short descriptors** (hero subtitle, card description, caption — anything 1-3 lines). Use `text-wrap: pretty` only on body paragraphs (4+ lines). `pretty` has no effect on short text and will leave Korean orphans like "합니다." or "화." on a line alone. See `typography-wrapping.md` for full rules.220- **Color**: Max 1 accent. Use neutral bases (Zinc/Slate) with singular high-contrast accent — avoid purple-on-white.221- **Layout**: Match the product surface. Avoid centered-card/hero patterns in repeated-use tools.222- **Motion**: See `references/motion.md`. One signature moment + a few223 supporting reveals > 10 scattered effects; landing-bucket floor/ceiling per224 FE-MOTION-BUCKET-01.225- **Assets**: Use screenshots, product images, diagrams, charts, illustrations, generated bitmaps, or soft 3D only when they add product meaning. When a real bitmap is needed (icon, hero, illustration), generate it with `ima2` — probe `ima2 status`, attempt `ima2 serve` if down, inspect `ima2 models --kind image`, and set `ima2 defaults set image <lane>/<model>` before using bare generation — falling back to the native `imagegen` tool only when ima2 is truly unavailable; never ship a placeholder. `ima2` is preferred because it supports reference images, multi-candidate generation (`-n N`, multimode, independent CLI parallel — see `asset-requirements.md` FE-ASSET-PARALLEL-01), a backend-selectable prompt builder, raster-to-vector tracing (`ima2 vectorize` and Canvas trace — see `asset-requirements.md` Raster vs real vector), session style sheets, provider routing (GPT/Grok/Gemini — see `asset-requirements.md` FE-ASSET-PROVIDER-01), variant selection with element-ledger synthesis (`asset-requirements.md` FE-ASSET-SELECT-01), cutout asset background strategy (`asset-requirements.md` FE-ASSET-BG-01), and video (`ima2 video` — see `motion.md` FE-MOTION-VIDEO-01) for motion assets. For parallel generation, monitor with `ima2 ps --json` and cancel unwanted jobs with `ima2 cancel <id>`. Write **very explicit long prompts** (subject, composition, palette, lighting, style, aspect) per `asset-requirements.md`; prefer real/generated image or video assets over CSS gradient washes. Read any design reference or captured screenshot back into context with `view_image` before matching it. Third-party captures follow `reference-capture.md` (analysis-only, provenance manifest).226- **Visual verification**: after UI changes, exercise the flow per visual verification (screenshot -> view_image) — `browser:control-in-app-browser` on the dev server, screenshot, `view_image` — instead of claiming visual correctness from code alone.227228### Cutout Asset Generation (FE-ASSET-BG-01 surface — STRICT)229230GPT Image 2 cannot produce transparent backgrounds. Requesting "transparent231background" or "PNG with alpha" yields checkerboard artifacts or solid fills.232**Every cutout asset** (icons, product shots, 3D objects, illustrations, stickers,233UI elements that float over arbitrary backgrounds) MUST use the solid-background-234then-remove pipeline. Full rules and recipes: `references/asset-requirements.md`235§ Asset Background Strategy.236237**Quick reference — generation template:**238239```bash240# Reflective/metallic/glass subjects → PURE BLACK bg241ima2 gen "3D render of [subject], [material/style details], [composition]. \242 Floating on a PURE SOLID BLACK background. The background must be 100% flat \243 pure black hex #000000. No checkerboard, no transparency pattern, no gradient, \244 no floor plane, no shadow, no vignette, no ambient glow on the background." \245 --model oauth/luna --quality high --size 1024x1024 --mode direct -o asset.png246247# Dark/opaque subjects → PURE WHITE bg248ima2 gen "[subject description], centered, floating. PURE SOLID WHITE background \249 hex #ffffff. No shadow, no gradient, no surface, no reflection plane." \250 --model oauth/luna --quality high --size 1024x1024 --mode direct -o asset.png251252# Known destination color → match it exactly253ima2 gen "[subject description], centered. PURE SOLID background hex #[target]. \254 No gradient, no texture, no shadow." \255 --model oauth/luna --quality medium --size 512x512 --mode direct -o asset.png256```257258**Quick reference — CSS removal (zero post-processing):**259260| Source bg | Target page | CSS rule |261|-----------|-------------|----------|262| Black | Light | `mix-blend-mode: screen` |263| White | Dark | `mix-blend-mode: multiply` |264| Any | Any | `isolation: isolate` on container to prevent bleed |265266For programmatic removal (build pipelines): `sharp`, ImageMagick, or `rembg`.267For interactive cleanup: ima2 Canvas Mode. For targeted fix: `ima2 edit`.268269---270271## 5. Anti-Slop Enforcement272273Rule classes (dev §0.2): items below are DEFAULT — deviate with a stated reason; concrete274values and palettes are STYLE_SAMPLE (§1.5); the emoji-as-UI-icon ban is the only STRICT item.275276Read `references/anti-slop.md` for full rules. Key standards:277278### Hero discipline (FE-HERO-01)279280- First viewport must fit: hero content leaves a hint of the next section on mobile and desktop.281- Keep hero copy to ~4 text elements max: headline, subhead, primary CTA, one proof/context line.282- Do not put trust strips, pricing teasers, feature bullets, or mini dashboards inside the hero.283- Logo walls belong below the hero, not as hero filler.284- Plan font scale with image/product scale so neither crushes the other.285286- Treat unexamined default typography as a slop signal. Choose a domain-appropriate stack; Korean-first UI should use CJK-safe fonts and system fallbacks deliberately.287- **Gradient budget (FE-GRADIENT-01)**: gradient soup is the 2026 #1 anti-slop signal; max 1 ambient gradient per viewport and no gradients on 3+ sibling cards — see `anti-slop.md § Gradient Budget`288- **One-note theme ban (FE-ONENOTE-01)**: full-page single-hue dark washes (terminal green, cyber cyan, CRT amber) are the current dark-mode tell — see `anti-slop.md § One-Note Theme Ban`289- **No self-describing meta copy (FE-METACOPY-01)**: UI text must explain the product/user job, never narrate the mockup, layout, responsive behavior, or agent process — see `anti-slop.md § Self-Describing Meta Copy`290- Use neutral or intentional color palettes — purple gradients on white are now the old tell; gradient overuse and one-note single-hue themes are the current tell291- Use asymmetric or purposeful layouts — centered-everything reads as template292- Vary card sizes, spans, and groupings — equal 3-card grids read as generic293- **Bento composition (FE-BENTO-01)**: bento grids must read as one interlocking slab with aligned row edges, a dominant cell, content-weighted spans, and no orphan tail — see `layout-discipline.md § Bento Composition`294- Avoid oversized bold hero text inside tools, dashboards, admin, finance flows, and public services295- **Hero composition (FE-HERO-SPLIT-01)**: never build a split hero (left bold headline + right boxed screenshot/mockup card) unless the user explicitly requests one — the product visual is the stage (full-width, background, or interactive demo), never a right-column card; paid-conversion LPs are the one context to propose it — see `layout-discipline.md § Hero Composition Grammar`296- Avoid asset-free UI: abstract blobs/gradients do not replace real visual evidence297- Avoid generic soft 3D icon packs; soft 3D must be semantic, brand-consistent, and restrained298- **NEVER use emoji as UI visual elements** (feature icons, card icons, section markers, buttons) — emoji in production UI is the #1 AI slop signal. Use SVG icons (Lucide/Phosphor/Heroicons). See `anti-slop.md § Emoji Slop`299- Warm beige/cream backgrounds with brass/clay accents are banned as defaults for premium-consumer briefs — see `anti-slop.md § Premium-Consumer Palette Ban`300- Layout monotony (same family repeated, 3+ zigzag sections, overused eyebrows) — see `references/layout-discipline.md`301- Color, shape, and theme must be locked per-page and audited before shipping — see `references/consistency-locks.md`302- Use off-black (`#0a0a0a`, `#111`) — pure `#000000` lacks depth303- **Responsive enforcement**: every multi-column section must declare its mobile/tablet collapse behavior — "it'll work at mobile" is not a plan. See `responsive-viewport.md`304- **Page containment required**: `max-w-[1400px] mx-auto` or equivalent wrapper. Content stretching to viewport edges on wide monitors is a layout bug305- **Mobile is a different product**: section composition, CTA placement, and interaction model change on mobile — it is NOT just "desktop stacked vertically." See `mobile-ux.md`306- Use realistic, specific names and brands in placeholder content307- Write original copy — avoid "Elevate", "Seamless", "Next-Gen" and similar clichés308- Treat uncontrolled heading line breaks (orphaned single word, no `text-wrap`, no `max-width` in `ch`) as a slop signal — see `typography-wrapping.md`309- Treat short descriptors (hero subtitle, card description, caption) using `text-wrap: pretty` instead of `balance` as a slop signal — `pretty` does nothing on 1-3 line text, especially Korean310- Treat Korean orphan fragments ("합니다.", "화.", "입니다." alone on a line) as a slop signal — always verify Korean text breaks at target viewports311- Treat generic stroke icons as brand logo substitutes as a slop signal — use actual brand SVGs from Simple Icons, SVGL, or press kits. See `brand-asset-sourcing.md`312- When NO design brief exists, do not invent a generic default: apply the domain-gated no-brief kit owned by `ima2-uiux` §1 UX-DEFAULT-ISM-01 and state the assumption313314### Do not ship these tells (FE-AI-TELL-01)315316Version labels in heroes, numbered eyebrows, middle-dot overuse, duplicate image reuse, monospace uppercase card labels, fake social-proof headers, decorative scroll cues, weather/status strips with no product purpose, photo-credit captions in UI chrome, and generic "trusted by teams worldwide" claims are AI-default tells. Full catalog: `references/anti-slop.md` + `references/layout-discipline.md`.317318---319320## 6. Performance Guardrails321322- Animate `transform` and `opacity` only — layout properties (`top`, `left`, `width`, `height`) cause jank323- Grain/noise filters → fixed pseudo-elements only, keep off scrolling containers324- `will-change` sparingly — remove after animation completes325- Z-index only for systemic layers (navbar, modal, overlay)326- Memoize perpetual animations in isolated components327328### Browser Connection Limits329330| Protocol | Limit |331|---|---|332| HTTP/1.1 | 6 connections per domain (Chrome/Firefox) |333| HTTP/2 | 1 TCP connection, 100 concurrent streams |334| WebSocket | Shares the HTTP/1.1 connection pool |335336Rules:337- Never open >2 SSE/WebSocket connections to the same origin from one page338- Use connection multiplexing (single WebSocket with channel/topic routing) over multiple connections339- If >6 parallel requests needed: use HTTP/2, batch API endpoints, or domain sharding (last resort)340- Preflight OPTIONS requests count against the connection limit; consolidate CORS-heavy calls341342Banned:343- Opening unbounded WebSocket connections per component instance344- Polling from multiple components independently (centralize into one subscription, fan out via state)345- Creating new SSE connections on every remount without cleanup346347---348349## 7. Accessibility Baseline350351- Semantic HTML (`<button>`, `<nav>`, `<main>`)352- Keyboard navigation for all interactive elements353- WCAG AA minimum (4.5:1 normal text, 3:1 large text)354- Visible focus indicators (`focus-visible:ring-2`)355- `prefers-reduced-motion` support356- Skip link or equivalent bypass for repeated navigation357- Focus must not be hidden by sticky headers, sticky bottom bars, sheets, or overlays358- Icon-only buttons need accessible names (`aria-label`, visible text, or labelled-by)359- Charts, status messages, loading progress, and AI streaming states need screen-reader labels or live regions where appropriate360- Do not encode meaning by color alone361- Modals, menus, comboboxes, bottom sheets, and command palettes must have a complete keyboard path362- Stress-test Korean long labels and screen-reader names; clipped Hangul is a failure363- Pointer targets follow WCAG 2.2 AA target-size rules; 44×44px is a conservative product baseline, not the only legal minimum364365### A11y polish (FE-A11Y-POLISH-01)366367- CTA text fits on one line at target breakpoints; if it wraps, shorten the label or change the layout.368- Inputs need visible boundaries against their background in default, focus, error, and disabled states.369- Duplicate CTA intent on the same screen should merge or clearly differ by outcome.370- Button contrast is checked during visual review, not left to palette intent.371372---373374## 8. Custom Hooks375376Create a custom hook only when it owns reusable behavior, not just because code is a few lines long.377378Good hook candidates: subscription lifecycle, reusable async state machine, form-field behavior shared across components, media/query/observer integration, keyboard/focus behavior, external store wrapper.379380Avoid hooks that are merely thin aliases for `useState`, `useToggle`, `useDebounce`, or one-off component logic unless the repo already standardizes them.381382Hook rules:383- The hook name describes behavior, not implementation384- Inputs are explicit and stable; return shape is small385- Side effects are justified by an external system; cleanup is correct386- Dependencies are honest; use `useEffectEvent` for non-reactive callbacks inside Effects387- Do not hide server state, router state, or form ownership inside a generic hook388389---390391## 9. React Performance392393Default performance strategy: keep components pure, keep state local, classify state ownership correctly, use server rendering/caching boundaries, split expensive client islands, measure before memoizing.394395| Tool | Use when |396|------|----------|397| `memo` | child render is expensive and props are stable |398| `useMemo` | calculation is expensive or identity is required |399| `useCallback` | callback identity is required by memoized child or external API |400| `useTransition` | interaction should stay responsive while non-urgent work completes |401| `useOptimistic` | mutation UX benefits from reversible optimistic state |402| `Activity` | hidden UI should preserve state without active Effects |403| `Suspense` | dynamic/async boundary needs isolated loading behavior |404405If React Compiler is enabled, remove defensive memoization unless measurement or semantics justify it. Split at route boundaries and heavy components (charts, editors, 3D).406407---408409## 10. Form Handling410411For simple forms, use controlled components with schema validation (Zod). For complex forms (multi-step, dynamic fields), use `react-hook-form` + Zod resolver. Always show field-level errors with `role="alert"`.412413---414415## 11. Accessibility Quick-Wins416417Beyond the baseline (§7):418- Focus management: trap focus in modals, restore on close, handle Escape419- Arrow keys navigate lists and menus; Enter/Space activate buttons and links420- Tab order follows visual flow421- `aria-expanded`, `aria-haspopup`, `aria-activedescendant` on composite widgets422- Test with screen reader and keyboard-only navigation423424---425426## 12. 2026 Frontend Platform Rules427428Use this section when modernizing or creating React/Next/Vite frontends. Prefer project conventions first.429430### React 19.2+431432- **Activity**: Use `<Activity>` for state-preserving hidden UI (tabs, drawers, route shells). Do not use for security hiding or active subscriptions.433- **useEffectEvent**: For non-reactive logic inside Effects that needs latest props/state without resubscribing. Never call during render or pass to children.434- **Partial Pre-rendering**: Design pages as static shell + explicit dynamic holes + Suspense boundaries. No `Date.now()`, `Math.random()`, or request-specific data in the pre-rendered shell.435- **React Compiler**: Do not cargo-cult `memo`/`useMemo`/`useCallback`. Measure first unless referential stability is semantically required.436437### Next.js 16438439- Turbopack is default. Do not add custom webpack config unless proven unsupported.440- **Cache Components** (`cacheComponents: true`): dynamic rendering is default; cache only what you explicitly mark with `use cache` + `cacheLife` + `cacheTag`.441- Never cache user/session-specific data without explicit user-scoped cache key.442- Server Actions: validate input server-side, authorize against the resource, revalidate affected cache tags.443444### Modern CSS445446Prefer native CSS before JS layout observers or animation libraries:447- **Container queries** for component-level responsive layout (not viewport)448- **`:has()`** for parent/sibling state selection — keep selectors narrow449- **CSS nesting** for modularity — keep shallow, avoid specificity tunnels450- **Subgrid** when nested content must align to outer grid451- **View Transitions** for meaningful state continuity — respect `prefers-reduced-motion`452- **Modern units**: `dvh/svh/lvh` over `100vh`, logical properties over `left/right`453- **Tailwind v4**: CSS-first configuration, use theme variables over hardcoded values454455### Build Tools456457- **Vite 8** (verified 2026-07-02): Rolldown/Oxc is the integrated default bundler (`rolldown-vite` is only a Vite 7 migration bridge). Node 20.19+/22.12+; Baseline target Chrome/Edge 111, Firefox 114, Safari 16.4. Detect Vite 7 vs 8 before editing config.458- **Agent-visible runtime diagnostics (DEFAULT)**: prefer dev servers that surface browser/runtime errors to the CLI/agent — Vite 8 forwards browser console to the dev server (auto-activates for coding agents); Next 16 ships DevTools MCP. Wire these before debugging rendered behavior.459- Do not introduce Webpack-era config unless the existing app is already Webpack-bound460461### State Classification462463Before adding state, classify it:464465| State type | Owner | Default tool |466|---|---|---|467| render-local UI | nearest component | `useState` / `useReducer` |468| derived | render calculation | expression / `useMemo` if expensive |469| form draft | form boundary | native form, React Hook Form, TanStack Form |470| server/cache | server/cache layer | RSC, Next cache, TanStack Query, SWR |471| URL/navigation | router | path params, search params |472| global client UI | external store | Zustand, Jotai, context |473| optimistic mutation | mutation boundary | `useOptimistic`, mutation library |474| AI stream | conversation boundary | append-only message model + stream status |475476Rules: Do not store derived state just to sync with Effect. Do not put server state in Zustand. Do not put URL-shareable state only in component state. Keep optimistic state reversible.477478### Design System Detection (MANDATORY — before creating tokens)479480Before inventing design tokens, check:4811. Does the project have an installed design system? (`grep -r "material-ui\|@mui\|carbon-components\|@carbon\|@fluentui\|govuk-frontend\|uswds" package.json`)4822. Does the project have existing tokens? (`find . -name "tokens.*" -o -name "theme.*" -o -name "design-system*"`)4833. Does the brief name a specific design system?484485If YES to any: use the official package. Do not recreate CSS by hand.486487| System | Package | Import |488|--------|---------|--------|489| Material | @mui/material | `import { Button } from '@mui/material'` |490| Carbon | @carbon/react | `import { Button } from '@carbon/react'` |491| Fluent | @fluentui/react | `import { Button } from '@fluentui/react-components'` |492| GOV.UK | govuk-frontend | `import 'govuk-frontend/dist/govuk/all.scss'` |493| USWDS | @uswds/uswds | `import '@uswds/uswds/css/uswds.css'` |494495If NO: proceed with `ima2-uiux/references/design-system-bootstrap.md`.496497### shadcn/ui and AI-Assisted UI498499- Inspect existing installed components before adding new ones500- Use project's `components.json`, aliases, tokens, and registry conventions501- Do not hallucinate design-system components; verify against local source502- Remove demo-only copy and unused variants503504For AI-native interfaces (chat, agent, copilot), design explicit states: empty → prompt ready → submitted → streaming → tool call → result → complete → feedback. Never fake streaming, citations, or tool calls.505506---507508## 13. Error Boundaries509510React Error Boundary pattern:511- Wrap each major section (not the entire app) in an Error Boundary512- Error boundary renders: friendly message + retry button + report link513- Log error to monitoring service (Sentry, etc.) in componentDidCatch514- Never show stack traces to end users515516Error state hierarchy:5171. Field-level: inline validation message5182. Form-level: summary at top of form5193. Section-level: Error Boundary with retry5204. Page-level: `error.tsx` / error page5215. App-level: root Error Boundary → offline/crash page522523---524525## 14. Pre-Flight Checklist526527Checklist items apply to production surfaces (the work classifier shared definition); prototypes,528spikes, and internal demos are exempt unless the user asks for production polish.529530Before delivering:531- [ ] Domain-correct direction chosen and committed532- [ ] Product surface, locale, density, asset need, soft 3D gate, and motion intensity classified533- [ ] Anti-slop patterns enforced (§5)534- [ ] Hero discipline enforced: viewport fit, copy count, no in-hero trust/pricing/feature clutter (§5)535- [ ] Required assets are real, semantic, rendered, and not generic decoration536- [ ] Korean-first UI follows CJK typography and Korean UX writing rules537- [ ] Soft 3D/miniature/character assets pass domain and semantic gates538- [ ] Mobile layout collapse guaranteed with per-section-type rules (see layout-discipline.md § Responsive Transforms)539- [ ] Full-height sections use `min-h-[100dvh]` not `h-screen`540- [ ] Page containment: `max-w-[1400px] mx-auto` wrapper present (see responsive-viewport.md)541- [ ] Tested at 768px (tablet) and 1024px (split-screen) in addition to mobile/desktop542- [ ] Touch targets ≥ 44px on mobile; no hover-only interactions (see mobile-ux.md)543- [ ] Responsive images use `srcset`/`sizes` or `<picture>` for art direction (see responsive-viewport.md)544- [ ] Safe area padding for notched devices: `env(safe-area-inset-*)` on fixed elements545- [ ] Loading, empty, and error states provided546- [ ] State classified before adding store/Context/Effect/cache (§12)547- [ ] Effects sync with external systems; derived state is not Effect-synced548- [ ] Container queries considered before viewport-query or JS layout workarounds549- [ ] View transitions respect reduced motion550- [ ] shadcn components follow local registry and token conventions551- [ ] AI UI states are honest: no fake streaming, citations, or tool calls552- [ ] Forms validate with schema and show field-level errors (§10)553554555…(truncated)
Run npx skillmds@latest add lidge-jun/ima2-front in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Frontend implementation skill for ima2 users. Use for any frontend, web UI, or visual implementation work — building, styling, or redesigning pages/components, responsive layouts, motion, component architecture, and production-surface polish. Pairs with ima2-uiux: load it first when design direction is vague; this skill implements the chosen direction. Triggers: 'frontend', 'UI', 'component', 'CSS', 'responsive', 'animation', 'React', 'Vue', 'Svelte', 'Tailwind', 'layout', 'styling', 'redesign', 'mockup', 'anti-slop', '프론트엔드', 'UI 작업', '반응형', '디자인 수정'. It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
lidge-jun (@lidge-jun) published this skill. Their other Agent Skills are listed on their SkillMD profile.