ima2-gen 2.0.15 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +30 -0
  2. package/bin/commands/skill.js +336 -17
  3. package/bin/ima2.js +22 -2
  4. package/bin/lib/doctor-checks.js +6 -4
  5. package/config.js +1 -0
  6. package/docs/CLI.md +25 -3
  7. package/docs/PROMPT_STUDIO.ko.md +29 -0
  8. package/docs/PROMPT_STUDIO.md +31 -0
  9. package/docs/migration/runtime-test-inventory.md +7 -1
  10. package/lib/agentImageVideoGen.js +8 -0
  11. package/lib/agentQueueStore.js +36 -10
  12. package/lib/agentQueueWorker.js +79 -7
  13. package/lib/agentRuntime.js +2 -0
  14. package/lib/assetLifecycle.js +40 -8
  15. package/lib/canvasVersionStore.js +86 -0
  16. package/lib/cardNewsGenerator.js +37 -3
  17. package/lib/cardNewsJobStore.js +10 -0
  18. package/lib/cardNewsManifestStore.js +6 -12
  19. package/lib/cardNewsPath.js +25 -0
  20. package/lib/db.js +2 -0
  21. package/lib/generatePipeline.js +474 -0
  22. package/lib/generationInputValidation.js +32 -0
  23. package/lib/grokImageCore.js +18 -1
  24. package/lib/historyIndex.js +11 -4
  25. package/lib/historyList.js +3 -0
  26. package/lib/imageMetadata.js +3 -0
  27. package/lib/inflight.js +30 -3
  28. package/lib/multimodePipeline.js +462 -0
  29. package/lib/nodeGeneration.js +440 -0
  30. package/lib/nodeValidation.js +23 -0
  31. package/lib/oauthProxy/generators.js +3 -246
  32. package/lib/oauthProxy/multimodeGenerators.js +251 -0
  33. package/lib/routeHelpers.js +9 -2
  34. package/package.json +2 -2
  35. package/routes/agent.js +4 -4
  36. package/routes/canvasVersions.js +21 -1
  37. package/routes/cardNews.js +2 -1
  38. package/routes/edit.js +25 -9
  39. package/routes/events.js +5 -1
  40. package/routes/generate.js +2 -481
  41. package/routes/keys.js +31 -39
  42. package/routes/multimode.js +2 -502
  43. package/routes/nodes.js +3 -448
  44. package/routes/video.js +12 -3
  45. package/routes/videoExtended.js +19 -4
  46. package/server.js +53 -1
  47. package/skills/ima2/SKILL.md +204 -0
  48. package/skills/ima2-front/SKILL.md +611 -0
  49. package/skills/ima2-front/references/a11y-patterns.md +134 -0
  50. package/skills/ima2-front/references/aesthetics.md +327 -0
  51. package/skills/ima2-front/references/anti-slop.md +241 -0
  52. package/skills/ima2-front/references/asset-requirements.md +431 -0
  53. package/skills/ima2-front/references/brand-asset-sourcing.md +122 -0
  54. package/skills/ima2-front/references/color-system.md +132 -0
  55. package/skills/ima2-front/references/consistency-locks.md +20 -0
  56. package/skills/ima2-front/references/crud-ui.md +53 -0
  57. package/skills/ima2-front/references/dropdown-layer.md +110 -0
  58. package/skills/ima2-front/references/i18n-global.md +104 -0
  59. package/skills/ima2-front/references/iterative-design.md +90 -0
  60. package/skills/ima2-front/references/korea-2026.md +174 -0
  61. package/skills/ima2-front/references/layout-discipline.md +161 -0
  62. package/skills/ima2-front/references/liquid-glass.md +181 -0
  63. package/skills/ima2-front/references/logo-sections.md +194 -0
  64. package/skills/ima2-front/references/mobile-ux.md +144 -0
  65. package/skills/ima2-front/references/performance-budget.md +106 -0
  66. package/skills/ima2-front/references/preflight-full.md +58 -0
  67. package/skills/ima2-front/references/product-density.md +53 -0
  68. package/skills/ima2-front/references/prototype-variants.md +54 -0
  69. package/skills/ima2-front/references/reference-capture.md +120 -0
  70. package/skills/ima2-front/references/responsive-viewport.md +139 -0
  71. package/skills/ima2-front/references/seo-baseline.md +123 -0
  72. package/skills/ima2-front/references/soft-3d-asset-gates.md +70 -0
  73. package/skills/ima2-front/references/stacks/astro.md +204 -0
  74. package/skills/ima2-front/references/stacks/mobile-native.md +281 -0
  75. package/skills/ima2-front/references/stacks/nextjs.md +219 -0
  76. package/skills/ima2-front/references/stacks/react.md +264 -0
  77. package/skills/ima2-front/references/stacks/svelte.md +235 -0
  78. package/skills/ima2-front/references/stacks/vanilla.md +226 -0
  79. package/skills/ima2-front/references/theme-switching.md +82 -0
  80. package/skills/ima2-front/references/top-bar.md +126 -0
  81. package/skills/ima2-front/references/typography-wrapping.md +270 -0
  82. package/skills/ima2-front/references/ux-writing-ko.md +62 -0
  83. package/skills/ima2-front/references/visual-verification.md +102 -0
  84. package/skills/ima2-uiux/SKILL.md +477 -0
  85. package/skills/ima2-uiux/references/anti-slop-judgment.md +39 -0
  86. package/skills/ima2-uiux/references/color-system.md +80 -0
  87. package/skills/ima2-uiux/references/design-isms.md +194 -0
  88. package/skills/ima2-uiux/references/design-read-example.md +33 -0
  89. package/skills/ima2-uiux/references/design-system-bootstrap.md +133 -0
  90. package/skills/ima2-uiux/references/favicon-logo.md +355 -0
  91. package/skills/ima2-uiux/references/form-patterns.md +118 -0
  92. package/skills/ima2-uiux/references/intent-discovery-ladder.md +86 -0
  93. package/skills/ima2-uiux/references/korean-design-vocabulary.md +52 -0
  94. package/skills/ima2-uiux/references/layout-macrostructures.md +54 -0
  95. package/skills/ima2-uiux/references/logo-trust-sections.md +96 -0
  96. package/skills/ima2-uiux/references/mobile-native-ux.md +207 -0
  97. package/skills/ima2-uiux/references/product-personalities.md +118 -0
  98. package/skills/ima2-uiux/references/responsive-nav.md +66 -0
  99. package/skills/ima2-uiux/references/typography-line-breaks.md +193 -0
  100. package/skills/ima2-uiux/references/ux-preflight.md +65 -0
  101. package/skills/ima2-uiux/references/ux-states.md +197 -0
  102. package/skills/ima2-uiux/references/visual-hierarchy.md +115 -0
  103. package/ui/dist/.vite/manifest.json +13 -13
  104. package/ui/dist/assets/AgentWorkspace-CtYt4SF5.js +3 -0
  105. package/ui/dist/assets/{CardNewsWorkspace-Cdxn1ohU.js → CardNewsWorkspace-DN5cVqG5.js} +1 -1
  106. package/ui/dist/assets/GenerationRequestLogPanel-DnmUQdKR.js +1 -0
  107. package/ui/dist/assets/{NodeCanvas-C67sLboA.js → NodeCanvas-CxpfIBI0.js} +1 -1
  108. package/ui/dist/assets/PromptBuilderPanel-C2R3ObtR.js +2 -0
  109. package/ui/dist/assets/{PromptImportDialog-DeQXsEEv.js → PromptImportDialog-BIxz_yEx.js} +2 -2
  110. package/ui/dist/assets/PromptImportDiscoverySection-BQTlPMME.js +1 -0
  111. package/ui/dist/assets/PromptImportFolderSection-Ds_Th9O3.js +1 -0
  112. package/ui/dist/assets/{PromptLibraryPanel-Db3xEPM_.js → PromptLibraryPanel-Rs4l45pV.js} +2 -2
  113. package/ui/dist/assets/{SettingsWorkspace-BDk_1W-V.js → SettingsWorkspace-p1AZ6uT9.js} +1 -1
  114. package/ui/dist/assets/index-0-_vgFGs.js +4 -0
  115. package/ui/dist/assets/index-Dm3pFxV4.js +23 -0
  116. package/ui/dist/assets/index-J8yDF3Ch.css +1 -0
  117. package/ui/dist/index.html +2 -2
  118. package/ui/dist/assets/AgentWorkspace-DAg_7zpY.js +0 -3
  119. package/ui/dist/assets/GenerationRequestLogPanel-C_qvEUi2.js +0 -1
  120. package/ui/dist/assets/PromptBuilderPanel-DjvVdAie.js +0 -2
  121. package/ui/dist/assets/PromptImportDiscoverySection-CrwyUKYI.js +0 -1
  122. package/ui/dist/assets/PromptImportFolderSection-CToGMqYE.js +0 -1
  123. package/ui/dist/assets/index-2oG6in1i.css +0 -1
  124. package/ui/dist/assets/index-CoxMOXAU.js +0 -23
  125. package/ui/dist/assets/index-p8egnGHk.js +0 -4
@@ -0,0 +1,241 @@
1
+ # Anti-Slop — Banned AI Design Patterns (2026)
2
+
3
+ Specific patterns that mark output as "AI-generated." Comprehensive audit checklist
4
+ for any frontend surface built with ima2 assets.
5
+
6
+ ---
7
+
8
+ ## Typography Slop Signals
9
+ - Unexamined default typography: browser defaults, framework defaults, or "Inter everywhere" without a reason
10
+ - Latin-first font choices applied to Hangul without testing CJK rhythm, line-height, and fallback
11
+ - Space Grotesk as the automatic "anti-Inter" choice
12
+ - System stacks as a shortcut instead of a deliberate product typography decision
13
+
14
+ **Allowed when intentional**: `system-ui`, `-apple-system`, Pretendard, SUIT, Noto Sans KR, Apple SD Gothic Neo.
15
+
16
+ **Do instead**: choose a domain-appropriate stack. Korean-first: CJK-safe product stack. Latin display: Geist, Outfit, Cabinet Grotesk, Satoshi, Clash Display, GT America, or Neue Machina.
17
+
18
+ ## Typography Audit
19
+ - **Inter everywhere** -> deliberate stack for product and locale
20
+ - **Headlines lack presence** -> increase size, tighten letter-spacing, reduce line-height
21
+ - **Body too wide** -> limit to ~65ch, increase line-height
22
+ - **Only 400 + 700** -> introduce 500, 600, or extremes (100 vs 900)
23
+ - **Proportional numbers in data** -> `font-variant-numeric: tabular-nums`
24
+ - **Missing letter-spacing** -> negative for large headers, positive for small caps
25
+ - **All-caps everywhere** -> sentence case, small-caps, or lowercase italic
26
+ - **Orphaned words** -> `text-wrap: balance` or `text-wrap: pretty`
27
+ - **No `text-wrap`** -> apply `balance` globally to h1-h6 (see `typography-wrapping.md`)
28
+ - **No `max-width` in `ch`** -> h1: 50ch, h2: 55ch, p: 65ch
29
+ - **Heading breaks mid-phrase** -> review at 390px, 768px, 1440px
30
+ - **Body exceeding 75 chars** -> `max-width: 65ch`
31
+
32
+ ---
33
+
34
+ ## Banned Color Patterns
35
+ - Gradient soup: the 2026 #1 AI tell. Layered gradient washes, gradient cards, gradient borders, and glow soup
36
+ - Purple gradient on white background
37
+ - Blue-to-indigo gradient buttons
38
+ - Oversaturated neon accents (saturation < 80%)
39
+ - Equally distributed pastel rainbows
40
+ - Pure black `#000000` -> off-black (`#0a0a0a`, Zinc-950)
41
+ - Mixing warm and cool grays in same project
42
+ - Generic box-shadow -> tint shadows to background hue
43
+
44
+ **Do instead**: Zinc/Slate neutral base + ONE high-contrast accent.
45
+
46
+ ## Gradient Budget (FE-GRADIENT-01, DEFAULT)
47
+
48
+ - Max 1 ambient gradient per viewport
49
+ - No gradients on 3+ sibling cards
50
+ - Background + card gradients + gradient borders + glow stacked = gradient soup
51
+ - Radial glows behind dark heroes are decorative filler unless they model a real light source
52
+ - Every gradient must encode something: depth, light, state, or one brand moment
53
+
54
+ ### Opaque Functional Surfaces (FE-GRADIENT-02, DEFAULT)
55
+
56
+ Tinted gradient wash on an OPAQUE functional panel (cards, panels, sidebars,
57
+ badges, buttons inside tools) is product-UI gradient soup. It reads as dated
58
+ marketing chrome: color as decoration, contrast varies top-to-bottom.
59
+
60
+ Decision rule:
61
+ - Ambient/expressive/translucent -> gradient allowed for mood/light/depth/material
62
+ - Opaque + functional (cards, panels, task UI) -> NO gradient. Emphasize with
63
+ ONE channel: flat tint | 1px border | accent bar | elevation shadow | status token
64
+
65
+ ## One-Note Theme Ban (FE-ONENOTE-01, DEFAULT)
66
+
67
+ Full-page single-hue theming where bg, borders, text, badges, glows, and imagery
68
+ all resolve to one hue family.
69
+
70
+ - Terminal green / Matrix hacker = #1 dark-mode tell
71
+ - Cyber cyan, retro CRT amber, synthwave magenta
72
+ - Check: sample 5 random UI elements; if 4+ share one hue +/-30 deg = one-note
73
+ - Generated imagery color-matched to theme hue compounds the problem
74
+
75
+ **Do instead**: neutral dark (Zinc-950/`#0a0a0a`) + ONE accent at <10% surface area.
76
+
77
+ ## Premium-Consumer Palette Ban (DEFAULT)
78
+
79
+ For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage):
80
+
81
+ **Banned backgrounds**: `#f5f1ea` `#f7f5f1` `#fbf8f1` `#efeae0` `#faf7f1`
82
+ **Banned accents**: `#b08947` `#b6553a` `#9a2436` `#9c6e2a`
83
+ **Banned text**: `#1a1714` `#1b1814`
84
+
85
+ Override ONLY when the brand brief explicitly names warm beige/cream.
86
+
87
+ ---
88
+
89
+ ## Banned Layouts
90
+ - Everything centered with uniform padding
91
+ - Oversized bold hero inside tools, dashboards, admin, finance
92
+ - 3 equal cards in a row (the "feature row" cliche)
93
+ - Uniform rounded corners on every element
94
+ - Centered hero + gradient background + Inter heading
95
+ - Card-heavy dashboards where every metric is boxed
96
+ - Complex flexbox calc -> CSS Grid
97
+ - `height: 100vh` -> `min-height: 100dvh`
98
+ - No max-width -> `max-w-7xl mx-auto`
99
+ - Cards forced to equal height -> allow variable or masonry
100
+ - Dashboard always left sidebar -> try top nav, command menu, collapsible
101
+ - Symmetrical vertical padding -> bottom often needs slightly larger (optical)
102
+
103
+ ## 2026 Product Slop
104
+ - Asset-free pages: gradients, blobs, generic icons where product/screenshot/diagram needed
105
+ - Use `ima2 gen` to create real visual assets instead of CSS gradient washes
106
+ - Fake dashboards with random numbers
107
+ - Landing-page composition inside repeated-work tools
108
+ - AI tool surfaces without pending, cancel, retry, undo, provenance states
109
+ - Trust-heavy domains using playful visuals without purpose
110
+ - Soft 3D miniatures from generic icon packs without brand adaptation
111
+ - Giant centered Korean headlines as decoration rather than hierarchy
112
+
113
+ ## AI Tell Patterns
114
+
115
+ - Version labels in heroes (V0.6, BETA, INVITE-ONLY)
116
+ - Section-number eyebrows (001 - Capabilities)
117
+ - Middle-dot overuse: max 1 per metadata line
118
+ - "Quietly trusted by" social-proof headers
119
+ - Weather/locale strips unless genuinely place-focused
120
+ - Scroll cues ("scroll to explore")
121
+ - Decorative dots before nav items
122
+ - Photo-credit captions on AI-generated images
123
+ - Fake product previews from styled divs
124
+ - Version footers on marketing pages
125
+ - Same generated image used twice on one page
126
+ - Monospace uppercase micro-labels on every card
127
+
128
+ ### Self-Describing Meta Copy (FE-METACOPY-01, DEFAULT)
129
+
130
+ UI copy must describe the product/user job, never the mockup, layout, or
131
+ responsive behavior.
132
+
133
+ - "벤토 보드에 겹쳐 보여주는 목업" = meta copy (banned)
134
+ - "작은 화면에서 단일 열로 접힙니다" = meta copy (banned)
135
+ - Cards named after design artifacts (VIEWPORT MATRIX) = meta copy (banned)
136
+
137
+ **Test**: could a real user say what job this element does for them?
138
+
139
+ ---
140
+
141
+ ## Emoji Slop (STRICT)
142
+
143
+ Emoji as visual elements is the strongest AI tell in 2026. Human designers
144
+ never ship emoji as feature icons or section markers in production UI.
145
+
146
+ | Context | Verdict | Do Instead |
147
+ |---------|---------|------------|
148
+ | Feature card icons | **BANNED** | Lucide/Phosphor/Heroicons SVG |
149
+ | Section headers | **BANNED** | Typographic hierarchy or icon |
150
+ | Button labels | **BANNED** | Text only, or SVG + text |
151
+ | Chat/messaging content | Allowed | User-generated content exempt |
152
+ | CLI output | Allowed | Functional indicators OK |
153
+
154
+ ---
155
+
156
+ ## Banned Logo/Integration Patterns
157
+ - Generic stroke icons as brand logos -> use actual SVGs from Simple Icons, SVGL, or press kits (see `brand-asset-sourcing.md`)
158
+ - Individual hover on non-clickable logo walls -> trust signals, not navigation
159
+ - Grid with orphan cells -> flexbox center or marquee
160
+ - Static grid for 8+ logos -> CSS marquee (30-40s, linear)
161
+ - Missing `prefers-reduced-motion` on marquee
162
+ - Missing edge fade on marquee
163
+
164
+ ## Korean Slop
165
+ - Translationese: "원활한 경험을 제공합니다", "혁신적인 솔루션"
166
+ - Bureaucratic labels where simple Korean works
167
+ - Korean text clipped in fixed-width buttons
168
+ - Negative letter-spacing on Hangul without testing
169
+ - Cute visuals as Korean default (domain decision, not locale decision)
170
+ - Oversized ultra-bold Hangul hero: 100px+ / 800-900 weight on Korean reads as heavy mass
171
+ Korean premium: 56-72px / 700 / line-height 1.25-1.4
172
+ - Split-hero template (FE-HERO-SPLIT-01): left headline + right boxed screenshot is exhausted
173
+ Default: product visual is the stage, not a right-column card
174
+ - "Tasteslop" serif shortcut: serif purely as AI-premium signal without editorial structure
175
+
176
+ ---
177
+
178
+ ## Banned Interaction Patterns
179
+ - Generic circular spinners -> skeleton loaders matching layout
180
+ - Default browser focus rings -> `focus-visible:ring-2`
181
+ - Custom cursors (outdated, a11y issue)
182
+ - Neon/outer glow box-shadow
183
+ - No hover states -> add background shift, scale, or translate
184
+ - No pressed feedback -> `scale(0.98)` or `translateY(1px)`
185
+ - Zero-duration transitions -> 200-300ms
186
+ - Dead `#` links -> real destinations or visually disable
187
+ - Scroll jumping -> `scroll-behavior: smooth`
188
+ - Animations using top/left/width/height -> transform+opacity
189
+
190
+ ## Banned Content ("Jane Doe" Effect)
191
+ - Generic names: "John Doe", "Sarah Chan"
192
+ - Generic companies: "Acme", "Nexus", "SmartFlow"
193
+ - Predictable numbers: `99.99%`, `$9.99`
194
+ - AI copywriting: "Elevate", "Seamless", "Unleash", "Next-Gen", "Delve"
195
+ - Exclamation in success messages -> confident, not loud
196
+ - "Oops!" errors -> "Connection failed. Please try again."
197
+ - Lorem Ipsum -> write real draft copy
198
+ - Title Case On Every Header -> sentence case
199
+
200
+ ## Banned Component Defaults
201
+ - shadcn in default state -> customize radii, colors, shadows
202
+ - Default Tailwind blue as primary
203
+ - Lucide egg avatar -> picsum.photos or SVG UI Avatars
204
+ - 3-card carousel testimonials -> masonry, embedded social, rotating quote
205
+ - Modals for everything -> inline editing, slide-over, expandable
206
+ - Sun/moon dark mode toggle -> dropdown or system preference
207
+ - 4-column footer link farm -> simplify
208
+
209
+ ## Soft 3D / Character Asset Slop
210
+ Not banned by default, but must pass `soft-3d-asset-gates.md`.
211
+
212
+ Slop: generic pack, random cute object, inconsistent lighting, low-polish AI
213
+ output, decorative overload, asset competing with headline.
214
+
215
+ ---
216
+
217
+ ## Strategic Omissions (What AI Forgets)
218
+ - No legal links in footer
219
+ - No "back" navigation (dead ends)
220
+ - No custom 404 page
221
+ - No form validation
222
+ - No skip-to-content link
223
+ - Random dark sections in light page -> commit to one theme
224
+
225
+ ## Anti-Convergence Rule
226
+
227
+ Each generation MUST be visually distinct from the last:
228
+ - Different font pairing
229
+ - Different aesthetic archetype
230
+ - Alternate light/dark themes
231
+ - Vary layout patterns
232
+
233
+ ## Redesign Fix Priority
234
+
235
+ 1. **Font swap** (biggest instant improvement)
236
+ 2. **Color palette cleanup**
237
+ 3. **Hover + active states**
238
+ 4. **Layout + spacing**
239
+ 5. **Replace generic components**
240
+ 6. **Add loading/empty/error states**
241
+ 7. **Polish typography scale**
@@ -0,0 +1,431 @@
1
+ # Asset Requirements
2
+
3
+ Visual surfaces need real visual evidence. Abstract backgrounds, blobs, and generic icons are not enough when users need to understand a product, place, object, workflow, game, or state.
4
+
5
+ ## Asset Decision Table
6
+
7
+ | Surface | Required Asset Type |
8
+ | --- | --- |
9
+ | Product / object / venue / person page | real or generated bitmap showing the subject |
10
+ | Marketing / landing page | concrete product, scene, screenshot, or generated hero image |
11
+ | Dashboard / tool | real state preview, chart, table, workflow screenshot, or diagram |
12
+ | AI tool | process state, provenance, result preview, permission boundary, or diagram |
13
+ | Education / kids / community | illustration, character, or guided visual allowed |
14
+ | Fintech / gov / B2B | restrained screenshot, data view, trust visual, or high-polish semantic 3D |
15
+ | Game | game assets mandatory |
16
+ | Documentation | screenshots or diagrams when they clarify a task |
17
+
18
+ ## What Does Not Count
19
+
20
+ - abstract gradient mesh
21
+ - decorative blob/orb
22
+ - generic icon row
23
+ - fake dashboard with random numbers
24
+ - low-polish AI image
25
+ - stock photo unrelated to the task
26
+ - public 3D icon pack used without brand adaptation
27
+ - integration/partner logo wall using generic icons instead of brand SVGs (see `brand-asset-sourcing.md`)
28
+
29
+ ## Asset Sourcing Workflow
30
+
31
+ This source-priority list applies to CONTENT assets used in builds: photos,
32
+ illustrations, textures, motion clips, screenshots, diagrams, charts, and
33
+ brand-safe SVGs. The concept-mockup pass in `ima2-uiux` is a process
34
+ step outside this sourcing order; when its trigger fires, it runs before code
35
+ even though its outputs are not shippable UI pixels.
36
+
37
+ For build assets, try each source in order. Stop at the first that produces a
38
+ usable asset.
39
+
40
+ | Priority | Source | When to Use |
41
+ |----------|--------|-------------|
42
+ | 1 | Project existing assets | `images/`, `public/`, `assets/` in the repo |
43
+ | 2 | `ima2` CLI (canonical) or `ima2 gen` skill fallback | Hero images, product shots, custom illustrations, textures, and motion assets. Probe `ima2 status`; if unavailable, attempt `ima2 serve` and re-check before falling back. Use `ima2 gen`, `ima2 edit`, or `ima2 video` with a detailed prompt per § Agent Image Prompt Protocol. Fall back to `ima2 gen` only when ima2 is truly unavailable |
44
+ | 3 | Stock photo API | `source.unsplash.com/800x600/?coffee`, Pexels. Always include `alt` text and credit |
45
+ | 4 | CSS device frame + screenshot | App mockup heroes (Toss/카카오 style). Pure CSS phone/laptop frame wrapping a real screenshot or UI |
46
+ | 5 | Placeholder service (last resort) | `picsum.photos/800/600`, `placehold.co`. Mark as TODO for replacement |
47
+
48
+ ### Korean Service Patterns
49
+
50
+ Korean product pages almost always use concrete visual evidence in the first viewport:
51
+
52
+ | Pattern | Example | Implementation |
53
+ |---------|---------|---------------|
54
+ | Device mockup hero | Toss, 카카오뱅크, 당근 | CSS device frame (`border-radius: 40px`, `box-shadow`) + app screenshot inside |
55
+ | Real product photo | 배민, 무신사, 마켓컬리 | Full-bleed or contained product image, not a gradient placeholder |
56
+ | App screenshot carousel | 토스, 네이버 | Horizontal scroll of actual app screens |
57
+ | Data visualization hero | 토스증권, 뱅크샐러드 | Real (or realistic) chart/graph as primary visual |
58
+
59
+ Never ship a Korean-facing product page with only SVG icons and text. If no image source is available, state the gap explicitly rather than filling with gradients or decorative shapes.
60
+
61
+ ## Mockup Production Pipeline (verified 2026-07-09)
62
+
63
+ When a product/device mockup asset is required (product-led heroes, app
64
+ screenshots in scenes):
65
+
66
+ - **Device-mockup tools** (Rotato, MockRocket, Shots, Smartmockups, Figma
67
+ mockup plugins): map a real screenshot onto a 3D device render; stills and
68
+ short movies, no 3D skills needed.
69
+ - **AI scene + real screenshot compositing**: generate the environment/scene
70
+ image, then composite the actual product UI screenshot into or above it;
71
+ never AI-generate the shipped product UI itself - the interface pixels must
72
+ be real in shipped assets.
73
+ - **Frame extraction**: for scroll-driven playback, render the mockup motion
74
+ to video and extract frames (see motion.md § Frame Sequence Format Guide).
75
+
76
+ The screenshot inside any mockup must be a real, current capture of the
77
+ product; a fabricated UI in a real frame is still a fake asset.
78
+
79
+ ### Concept Mockup Boundary (FE-ASSET-CONCEPT-01, DEFAULT)
80
+
81
+ Generated CONCEPT mockups of a page or component, including `ima2` concept
82
+ passes and mockup references, are exploration artifacts. They are legal and
83
+ encouraged before code when the concept-pass trigger fires, but they must never
84
+ ship as UI pixels.
85
+
86
+ The "never AI-generate the product UI itself" rule is scoped to shipped
87
+ assets. It does not ban pre-code concept exploration, and it does not ban
88
+ generated photographic, texture, illustration, or motion CONTENT assets in real
89
+ builds. Those content assets are not product UI pixels; they may ship when
90
+ they satisfy provenance, licensing, accessibility, performance, and visual QA
91
+ requirements.
92
+
93
+ ## Rules
94
+
95
+ - Use the repo's existing asset system first.
96
+ - If no asset exists and the surface needs one, follow the sourcing workflow above.
97
+ - For external or generated assets, record provenance/licensing in the dev note, PR description, or project asset manifest when one exists.
98
+ - For captured third-party reference material, use `reference-capture.md` and keep the required manifest next to the capture. Captured assets never move into shipped project assets.
99
+ - Make the first viewport identify the product/place/object when relevant.
100
+ - Do not obscure text or primary actions with visuals.
101
+ - Verify assets render on mobile and desktop.
102
+ - Verify intrinsic dimensions, aspect ratio, crop, alt text, and loading behavior.
103
+ - Optimize heavy media; do not ship huge 3D/video assets without a reason.
104
+ - Ship gate: no captured third-party asset may appear in the shipped build.
105
+
106
+ ## Agent Image Prompt Protocol
107
+
108
+ ### Long Prompt and Motion Rule (FE-ASSET-PROMPT-01, DEFAULT)
109
+
110
+ When an AI agent generates image prompts (for `ima2 gen`, `ima2 multimode`,
111
+ `ima2 edit`, `ima2 video`, or the `ima2 gen` fallback), the prompt must be
112
+ **exhaustively detailed**. Vague one-liners produce generic, unusable output.
113
+ Write every prompt as if you are briefing a senior photographer, illustrator,
114
+ or motion designer who cannot ask follow-up questions.
115
+
116
+ Image assets need very explicit long prompts covering subject, composition,
117
+ palette, lighting, style or medium, materials, aspect ratio, constraints, and
118
+ avoid-list. When motion is wanted, use `ima2 video` rather than simulating
119
+ richness with static CSS washes. Prefer real photographic, generated bitmap,
120
+ texture, illustration, or video assets over CSS gradient backgrounds; gradients
121
+ remain scarce semantic devices under `anti-slop.md` FE-GRADIENT-01.
122
+
123
+ ### Required Spec Fields
124
+
125
+ Every agent-authored prompt MUST include all applicable fields below. Omit a
126
+ field only when it genuinely does not apply (e.g. no text in the image).
127
+
128
+ ```text
129
+ Use case: <taxonomy slug from imagegen skill>
130
+ Asset type: <where the asset will be used: hero, OG image, card, avatar, icon, texture, etc.>
131
+ Primary request: <one clear sentence describing the desired image>
132
+ Scene/backdrop: <specific environment, not "nice background">
133
+ Subject: <main subject with identifying details — material, color, shape, posture, expression>
134
+ Style/medium: <exact style: editorial photography, flat illustration, 3D render, watercolor, etc.>
135
+ Composition/framing: <camera angle, crop, subject placement, negative space intent>
136
+ Lighting/mood: <light source, direction, color temperature, mood, time of day>
137
+ Color palette: <specific colors or named palette — not "modern colors">
138
+ Materials/textures: <surface details: matte plastic, brushed steel, linen, weathered wood, etc.>
139
+ Text (verbatim): "<exact text to render>" with font style, size, placement
140
+ Dimensions: <target pixel dimensions and aspect ratio>
141
+ Constraints: <must-keep invariants>
142
+ Avoid: <explicit negative constraints>
143
+ ```
144
+
145
+ ### Specificity Rules
146
+
147
+ | Bad (vague) | Good (specific) |
148
+ |---|---|
149
+ | "a nice hero image" | "wide landscape product shot of a matte black thermos on a wet granite countertop, soft morning window light from the left, shallow depth of field, warm neutral tones, negative space on the right for headline overlay" |
150
+ | "modern background" | "soft radial gradient from #f8f9fa center to #e9ecef edges, subtle paper grain texture at 3% opacity, no objects, no patterns" |
151
+ | "Korean food photo" | "overhead flat-lay of budae-jjigae in a black stone pot, surrounded by small banchan dishes on a dark wood table, steam visible, warm tungsten lighting, editorial food photography style" |
152
+ | "logo on white" | "centered geometric mark: two interlocking triangles forming a hexagonal negative space, flat #1a1a2e on #ffffff, no gradients, strong silhouette at 32px, generous padding" |
153
+ | "a dashboard screenshot" | "realistic SaaS dashboard UI: top nav with avatar, left sidebar with 6 nav items, main area showing a line chart (3 series, 12 months) and a 4-column data table with 8 rows, light theme, Inter font, compact density" |
154
+
155
+ ### Quality and Size Selection
156
+
157
+ | Asset Purpose | Quality | Size |
158
+ |---|---|---|
159
+ | Quick draft / iteration | `low` | `1024x1024` |
160
+ | Final hero / product shot | `high` | `1536x1024` (landscape) or target aspect |
161
+ | OG / social card | `high` | `1200x630` (round to nearest 16px multiple) |
162
+ | Mobile hero | `high` | `1024x1536` (portrait) |
163
+ | Print / 4K | `high` | `3840x2160` or `2160x3840` |
164
+ | Texture / tile | `medium` | `1024x1024` |
165
+ | Icon / avatar | `medium` | `512x512` or `256x256` |
166
+
167
+ ### Multi-Candidate Strategy
168
+
169
+ For important visual assets (hero images, key illustrations), generate multiple
170
+ candidates and select the best:
171
+
172
+ ```bash
173
+ # Generate 4 candidates in one request
174
+ ima2 gen "<detailed prompt>" -n 4 -d ./candidates --quality high
175
+
176
+ # Or use multimode for structurally different directions
177
+ ima2 multimode "<detailed prompt>" --max-images 4 -d ./candidates
178
+ ```
179
+
180
+ After generation, inspect every candidate with `view_image` before selecting.
181
+ Do not blindly use the first result.
182
+
183
+ ### Parallel Generation Patterns (FE-ASSET-PARALLEL-01, DEFAULT)
184
+
185
+ ima2 supports three parallel generation strategies. Choose by intent:
186
+
187
+ | Strategy | Command | When to Use | Server Behavior |
188
+ |----------|---------|-------------|-----------------|
189
+ | **Single-request batch** | `ima2 gen "<prompt>" -n 4 -d ./out` | Same prompt, want quick variations | One request, server returns N images |
190
+ | **Multimode** | `ima2 multimode "<prompt>" --max-images 4` | Same prompt, want structurally different directions | SSE streaming, slot-by-slot progress, each slot is an independent generation |
191
+ | **Independent CLI parallel** | Multiple `ima2 gen` in background | Different prompts, or mixed providers/models | Each is a separate server request, fully independent |
192
+
193
+ **Single-request batch** is fastest for same-prompt variations. **Multimode**
194
+ is better when you want to see each candidate arrive and potentially cancel
195
+ early. **Independent CLI parallel** is for concept exploration with different
196
+ prompts or provider/model mixes.
197
+
198
+ #### Independent CLI Parallel Recipe
199
+
200
+ ```bash
201
+ # Launch 3 different prompts concurrently
202
+ ima2 gen "editorial hero with serif headline" --quality high -o ./out/editorial.png &
203
+ ima2 gen "product-led hero with device mockup" --quality high -o ./out/product.png &
204
+ ima2 gen "abstract gradient hero with floating shapes" --quality high -o ./out/abstract.png &
205
+
206
+ # Monitor active jobs
207
+ ima2 ps --json
208
+
209
+ # Cancel a job if a better candidate arrives first
210
+ ima2 cancel <requestId>
211
+
212
+ # Wait for all to finish
213
+ wait
214
+ ```
215
+
216
+ #### Monitoring and Cancellation
217
+
218
+ For long-running generation (high quality, large size, video), monitor with:
219
+
220
+ ```bash
221
+ # List active jobs with phase and elapsed time
222
+ ima2 ps --json
223
+
224
+ # Output: requestId, kind, phase, startedAt, prompt (truncated)
225
+ # Cancel a stuck or unwanted job
226
+ ima2 cancel <requestId>
227
+ ```
228
+
229
+ #### Capacity Guard
230
+
231
+ The ima2 server enforces a concurrent job limit (default: 24). When exceeded,
232
+ requests return `TOO_MANY_JOBS` (HTTP 429) with `Retry-After: 5`. Agent
233
+ pattern: check `ima2 ps --json` before launching a batch; if active job count
234
+ is near the limit, wait or cancel low-priority jobs first.
235
+
236
+ #### `ima2 gen` Fallback
237
+
238
+ When ima2 is unavailable, the `ima2 gen` tool generates one image per call.
239
+ For parallel exploration, generate sequentially and inspect each before the
240
+ next. Multimode and independent CLI parallel have no `ima2 gen` equivalent;
241
+ degrade to single-image iteration with prompt refinement between rounds.
242
+
243
+ ### Variant Selection Workflow (FE-ASSET-SELECT-01, DEFAULT)
244
+
245
+ After generating multiple candidates (via `-n`, multimode, or independent
246
+ parallel), select using a two-stage process:
247
+
248
+ **Stage 1 — Exploration (broad):** Generate 3-5 candidates with different
249
+ directions. Inspect all with `view_image`. Do not select yet.
250
+
251
+ **Stage 2 — Synthesis (not winner-picking):** Do NOT pick one winner. Build
252
+ an element ledger — for each design token (palette, composition, type
253
+ treatment, hero visual, stat row, section rhythm), note WHICH candidate did
254
+ it best and WHY. The final direction is assembled from the best elements
255
+ across all candidates. This mirrors `ima2-uiux` UX-CONCEPT-GEN-01 step 3.
256
+
257
+ #### Selection Scorecard
258
+
259
+ Rate each candidate on these axes before synthesizing:
260
+
261
+ | Axis | What to Check |
262
+ |------|---------------|
263
+ | Subject fidelity | Does the main subject match the brief? |
264
+ | Composition | Framing, negative space, visual weight balance |
265
+ | Palette | Color harmony, brand alignment, contrast |
266
+ | Text render | Korean/English text legibility (if applicable) |
267
+ | Asset-type fit | Right dimensions, crop safety, overlay space |
268
+ | Technical quality | No artifacts, correct lighting, clean edges |
269
+
270
+ #### `ima2 gen` Fallback
271
+
272
+ With `ima2 gen`, generate 1-2 candidates, inspect with `view_image`, refine
273
+ the prompt based on what is wrong, and iterate. The synthesis step still
274
+ applies when comparing across iteration rounds.
275
+
276
+ ### Provider Routing (FE-ASSET-PROVIDER-01, DEFAULT)
277
+
278
+ When ima2 is available with multiple providers configured, choose by asset type:
279
+
280
+ | Asset Type | Recommended Provider | Why |
281
+ |-----------|---------------------|-----|
282
+ | Product hero, editorial, UI mockup | GPT OAuth (`--provider oauth`) | Best composition, text rendering, style control |
283
+ | Trending/cultural reference needed | Grok (`--provider grok`) | Mandatory web search grounds the generation |
284
+ | Budget draft, quick iteration | Gemini (`--provider gemini-api`) | Cheapest per-image cost |
285
+ | High-fidelity product photo | GPT OAuth + `--quality high` | Best detail, lighting, material rendering |
286
+ | Korean text in image | GPT OAuth + `--mode direct` | Best Hangul rendering with exact-text prompts |
287
+
288
+ Override per-request only: `ima2 gen "prompt" --provider grok --model grok-imagine-image-quality`
289
+
290
+ #### `ima2 gen` Fallback
291
+
292
+ The `ima2 gen` tool uses a single provider (the Codex-native image generation
293
+ path). No provider routing is needed; quality and style are controlled through
294
+ prompt detail and the `quality` parameter alone.
295
+
296
+ ### Reference Image Workflow
297
+
298
+ When a design reference, brand guide, or existing asset exists, always attach it:
299
+
300
+ ```bash
301
+ # Style reference
302
+ ima2 gen "<prompt>" --ref style-guide.png --quality high
303
+
304
+ # Multiple references (composition + style)
305
+ ima2 gen "<prompt>" --ref layout-ref.png --ref brand-colors.png --quality high
306
+ ```
307
+
308
+ Label each reference's role in the prompt text: "Use Image 1 as composition
309
+ reference. Use Image 2 as color/style reference."
310
+
311
+ ### Korean Text in Images
312
+
313
+ When generating images with Korean text:
314
+ - Write the exact Korean string in quotes: `"오늘의 추천"`, not "some Korean text"
315
+ - Specify font style: `고딕체 (Gothic/Sans)` or `명조체 (Myeongjo/Serif)`
316
+ - Specify placement and approximate size relative to the canvas
317
+ - For mixed Korean + English, specify which script appears where
318
+ - Verify rendered text after generation — garbled Hangul is common and must be caught
319
+
320
+ ### Asset Background Strategy (FE-ASSET-BG-01, DEFAULT)
321
+
322
+ GPT Image 2 does not reliably produce true transparent (alpha) backgrounds.
323
+ Requesting "transparent background" or "PNG with alpha" yields unpredictable
324
+ results — sometimes a faint checkerboard pattern, sometimes a solid color
325
+ pretending to be transparent. Use the solid-background-then-remove strategy:
326
+
327
+ **Generation: pure solid background.**
328
+
329
+ For cutout assets (icons, product shots, 3D objects, illustrations, logos,
330
+ stickers, UI elements that must float over arbitrary backgrounds):
331
+
332
+ ```bash
333
+ # Pure black background — best for light/reflective subjects (chrome, glass, metal)
334
+ ima2 gen "3D render of a liquid chrome splash blob, organic starburst shape, \
335
+ mirror-polished surface with iridescent cyan and gold reflections. \
336
+ Floating on a PURE SOLID BLACK background. The background must be 100% flat \
337
+ pure black hex #000000. No checkerboard, no transparency pattern, no gradient, \
338
+ no floor plane, no shadow, no vignette, no ambient glow on the background." \
339
+ --quality high --size 1024x1024 --mode direct -o chrome-splash.png
340
+
341
+ # Pure white background — best for dark/opaque subjects (products, dark UI elements)
342
+ ima2 gen "Clean product photo of a matte black wireless earbud, centered, \
343
+ floating at slight angle. PURE SOLID WHITE background hex #ffffff. \
344
+ No shadow, no gradient, no surface, no reflection plane." \
345
+ --quality high --size 1024x1024 --mode direct -o earbud-cutout.png
346
+
347
+ # Solid brand color background — when the target surface color is known
348
+ ima2 gen "Flat illustration of a coffee cup with steam, centered. \
349
+ PURE SOLID background hex #f5f0eb (exact match required). \
350
+ No gradient, no texture, no shadow." \
351
+ --quality medium --size 512x512 --mode direct -o coffee-icon.png
352
+ ```
353
+
354
+ **Background prompt rules:**
355
+ - State the exact hex code and repeat the constraint: "PURE SOLID [color] background hex #XXXXXX"
356
+ - Explicitly ban common AI additions: "No checkerboard, no transparency pattern, no gradient, no floor plane, no shadow, no vignette, no ambient glow"
357
+ - Use `--mode direct` to prevent server-side prompt rewriting that might soften the constraint
358
+ - Black works best for reflective/metallic/glass subjects; white for dark/matte subjects
359
+ - Match the target page background color when the destination is known
360
+
361
+ **Post-processing: background removal.**
362
+
363
+ | Method | When to Use | How |
364
+ |--------|-------------|-----|
365
+ | **CSS `mix-blend-mode`** | Black bg → light page | `mix-blend-mode: screen` makes black transparent, keeps light content |
366
+ | **CSS `mix-blend-mode`** | White bg → dark page | `mix-blend-mode: multiply` makes white transparent, keeps dark content |
367
+ | **ima2 Canvas Mode** | Interactive cleanup | Open in Canvas Mode → background cleanup → export with alpha or matte |
368
+ | **Programmatic removal** | Build pipeline | `sharp` / ImageMagick / rembg for batch processing |
369
+ | **ima2 edit** | Targeted fix | `ima2 edit asset.png --prompt "remove the background completely, keep only the [subject]"` |
370
+
371
+ **CSS blend-mode recipe (zero post-processing):**
372
+
373
+ ```css
374
+ /* Black background asset on a light page */
375
+ .chrome-asset {
376
+ mix-blend-mode: screen; /* black → transparent, light content preserved */
377
+ }
378
+
379
+ /* White background asset on a dark page */
380
+ .product-asset {
381
+ mix-blend-mode: multiply; /* white → transparent, dark content preserved */
382
+ }
383
+
384
+ /* For arbitrary backgrounds, layer with isolation */
385
+ .asset-container {
386
+ isolation: isolate; /* prevent blend from leaking to parent */
387
+ }
388
+ ```
389
+
390
+ **`ima2 gen` fallback:** same solid-background prompting strategy applies.
391
+ No Canvas Mode available; use CSS blend modes or programmatic removal only.
392
+
393
+ **Anti-pattern:** requesting "transparent background" or "PNG with alpha channel"
394
+ directly in the prompt. The model will often produce a fake checkerboard pattern
395
+ burned into the image, or ignore the request entirely. Always use the
396
+ solid-background strategy above.
397
+
398
+ ### Prompt Iteration
399
+
400
+ - Start with one high-detail prompt. Inspect the result with `view_image`.
401
+ - On the next iteration, make ONE targeted change and re-specify all constraints.
402
+ Do not rewrite the entire prompt from scratch.
403
+ - Repeat invariants every iteration to prevent drift.
404
+ - If the model consistently fails on a detail, try rephrasing or breaking the
405
+ request into a base generation + edit pass.
406
+
407
+ ### Frontend Asset Quick Recipes
408
+
409
+ **Hero image (landing page):**
410
+ ```bash
411
+ ima2 gen "Use case: product-mockup. Asset type: landing page hero. A premium wireless headphone floating at a slight angle against a soft warm-gray studio backdrop. Matte black finish with brushed aluminum accents. Soft three-point studio lighting, key light from upper-left. Shallow depth of field. Wide composition with generous negative space on the right for headline overlay. No text, no logos, no watermark." \
412
+ --quality high --size 1536x1024 -o hero.png
413
+ ```
414
+
415
+ **OG / social share image:**
416
+ ```bash
417
+ ima2 gen "Use case: ads-marketing. Asset type: social share card. Clean product flat-lay of a notebook, pen, and ceramic mug on a white marble desk. Overhead shot. Soft diffused daylight. Space in the upper third for title overlay. Warm neutral palette. No text, no logos, no watermark." \
418
+ --quality high --size 1200x640 -o og-image.png
419
+ ```
420
+
421
+ **App screenshot mockup background:**
422
+ ```bash
423
+ ima2 gen "Use case: stylized-concept. Asset type: hero background for device mockup. Soft abstract gradient from #f0f4f8 to #dbeafe with subtle geometric shapes at 5% opacity. Clean, modern, minimal. No objects, no patterns, no text." \
424
+ --quality medium --size 1920x1088 -o mockup-bg.png
425
+ ```
426
+
427
+ **Avatar / profile placeholder:**
428
+ ```bash
429
+ ima2 gen "Use case: stylized-concept. Asset type: user avatar. Friendly stylized portrait of a young professional, neutral expression, looking slightly left. Flat illustration style with subtle shadows. Solid #e5e7eb background. Circular crop safe. No text." \
430
+ --quality medium --size 512x512 -o avatar.png
431
+ ```