@polymorphism-tech/morph-spec 4.21.0 → 4.22.0

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 (25) hide show
  1. package/README.md +2 -2
  2. package/claude-plugin.json +1 -1
  3. package/docs/CHEATSHEET.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/framework/agents.json +15 -0
  6. package/framework/hooks/shared/phase-utils.js +3 -0
  7. package/framework/phases.json +1 -1
  8. package/framework/skills/level-0-meta/mcp-registry.json +35 -2
  9. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +1 -1
  10. package/framework/skills/level-0-meta/morph-gemini-image/SKILL.md +290 -0
  11. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +19 -0
  12. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +1 -1
  13. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +10 -10
  14. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +146 -5
  15. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +8 -0
  16. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
  17. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
  18. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +216 -9
  19. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
  20. package/framework/standards/STANDARDS.json +32 -0
  21. package/framework/standards/frontend/design-system/ai-image-generation.md +244 -0
  22. package/framework/standards/integration/mcp/mcp-tools.md +48 -0
  23. package/package.json +1 -1
  24. package/src/core/paths/output-schema.js +1 -0
  25. package/src/lib/agents/output-collector.js +1 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > Spec-driven development framework for multi-stack projects. Turns feature requests into implementation-ready code through structured, AI-orchestrated phases.
4
4
 
5
5
  **Package:** `@polymorphism-tech/morph-spec`
6
- **Version:** 4.21.0
6
+ **Version:** 4.22.0
7
7
  **Requires:** Node.js 18+, Claude Code
8
8
 
9
9
  ---
@@ -364,4 +364,4 @@ Code generated by morph-spec (contracts, templates, implementation output) belon
364
364
 
365
365
  ---
366
366
 
367
- *morph-spec v4.21.0 by [Polymorphism Tech](https://polymorphism.tech)*
367
+ *morph-spec v4.22.0 by [Polymorphism Tech](https://polymorphism.tech)*
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morph-spec",
3
- "version": "4.21.0",
3
+ "version": "4.22.0",
4
4
  "displayName": "MORPH-SPEC Framework",
5
5
  "description": "Spec-driven development with 38 agents and 8-phase workflow for .NET/Blazor/Next.js/Azure",
6
6
  "publisher": "polymorphism-tech",
@@ -196,4 +196,4 @@ These files are never edited directly. Use CLI commands or `morph-spec update` i
196
196
 
197
197
  ---
198
198
 
199
- *morph-spec v4.21.0 by Polymorphism Tech*
199
+ *morph-spec v4.22.0 by Polymorphism Tech*
@@ -197,4 +197,4 @@ morph-spec doctor
197
197
 
198
198
  ---
199
199
 
200
- *morph-spec v4.21.0 by Polymorphism Tech*
200
+ *morph-spec v4.22.0 by Polymorphism Tech*
@@ -255,6 +255,11 @@
255
255
  "id": "frontend-design-system-animations",
256
256
  "scope": "all",
257
257
  "priority": "required"
258
+ },
259
+ {
260
+ "id": "frontend-design-system-ai-image-generation",
261
+ "scope": "uiux",
262
+ "priority": "recommended"
258
263
  }
259
264
  ],
260
265
  "teammate": {
@@ -703,6 +708,11 @@
703
708
  "id": "frontend-nextjs-motion-patterns",
704
709
  "scope": "all",
705
710
  "priority": "required"
711
+ },
712
+ {
713
+ "id": "frontend-design-system-ai-image-generation",
714
+ "scope": "implement",
715
+ "priority": "recommended"
706
716
  }
707
717
  ],
708
718
  "teammate": {
@@ -747,6 +757,11 @@
747
757
  "id": "frontend-design-system-animations",
748
758
  "scope": "all",
749
759
  "priority": "required"
760
+ },
761
+ {
762
+ "id": "frontend-design-system-ai-image-generation",
763
+ "scope": "implement",
764
+ "priority": "recommended"
750
765
  }
751
766
  ],
752
767
  "teammate": {
@@ -35,6 +35,7 @@ export const OUTPUT_PHASE_MAP = {
35
35
  uiMockups: 'uiux',
36
36
  uiComponents: 'uiux',
37
37
  uiFlows: 'uiux',
38
+ stitchHtml: 'uiux',
38
39
  decisions: 'design',
39
40
  recap: 'implement',
40
41
  };
@@ -53,6 +54,7 @@ export const FILENAME_TO_OUTPUT = {
53
54
  'mockups.md': 'uiMockups',
54
55
  'components.md': 'uiComponents',
55
56
  'flows.md': 'uiFlows',
57
+ 'stitch-screen-map.json': 'stitchHtml',
56
58
  'decisions.md': 'decisions',
57
59
  'recap.md': 'recap',
58
60
  };
@@ -70,6 +72,7 @@ export const PROTECTED_SPEC_FILES = {
70
72
  'mockups.md': 'uiux',
71
73
  'components.md': 'uiux',
72
74
  'flows.md': 'uiux',
75
+ 'stitch-screen-map.json': 'uiux',
73
76
  };
74
77
 
75
78
  /**
@@ -34,7 +34,7 @@
34
34
  "Produce wireframes and user flows"
35
35
  ],
36
36
  "requiredOutputs": ["uiDesignSystem"],
37
- "optionalOutputs": ["uiMockups", "uiComponents", "uiFlows"],
37
+ "optionalOutputs": ["uiMockups", "uiComponents", "uiFlows", "stitchHtml"],
38
38
  "recommendedMCPs": ["playwright", "context7", "stitch"],
39
39
  "pausePoints": [
40
40
  { "id": "uiux", "label": "Approve UI/UX Design" }
@@ -198,13 +198,46 @@
198
198
  "skills": ["stitch-design", "stitch-loop", "design-md", "prompt-enhance", "react-components", "shadcn-ui"],
199
199
  "description": "Official Stitch agent skills for Claude Code — design generation, multi-page loops, design.md export"
200
200
  }
201
+ },
202
+ "gemini-image": {
203
+ "phases": ["uiux", "implement"],
204
+ "tools": ["generate_image", "edit_image", "continue_editing", "list_images", "get_image_info", "get_configuration_status"],
205
+ "detection": "mcpServers includes gemini-image-mcp",
206
+ "fallback": "Manual image creation, stock photos, or placeholder divs",
207
+ "usage": "AI image generation for project assets (heroes, illustrations, brand images) using Gemini models",
208
+ "healthCheck": {
209
+ "toolPattern": "gemini-image",
210
+ "testCall": "Call get_configuration_status to verify API key and server health",
211
+ "testParams": {},
212
+ "successIndicator": "Returns status with valid API key configured",
213
+ "failureHint": "Gemini Image MCP not responding. Ensure GEMINI_API_KEY is set in MCP server configuration. Install: npx gemini-image-mcp@latest"
214
+ },
215
+ "install": {
216
+ "autoInstall": false,
217
+ "transport": "stdio",
218
+ "config": {
219
+ "command": "cmd",
220
+ "args": ["/c", "npx", "-y", "gemini-image-mcp@latest"]
221
+ },
222
+ "credentials": [
223
+ {
224
+ "name": "Gemini API Key",
225
+ "envVar": "GEMINI_API_KEY",
226
+ "source": "Google AI Studio (https://aistudio.google.com/apikey)"
227
+ }
228
+ ],
229
+ "prerequisites": ["Google AI Studio API key"],
230
+ "stackRelevance": ["nextjs", "next"],
231
+ "warnings": ["Requires GEMINI_API_KEY environment variable. Image generation costs apply per Google AI pricing."],
232
+ "setupGuide": "1. Get API key from https://aistudio.google.com/apikey\n2. Run: claude mcp add gemini-image-mcp -- npx gemini-image-mcp@latest\n3. Set GEMINI_API_KEY in MCP env config"
233
+ }
201
234
  }
202
235
  },
203
236
  "phaseMatrix": {
204
237
  "proposal": ["context7"],
205
- "uiux": ["playwright", "context7", "stitch"],
238
+ "uiux": ["playwright", "context7", "stitch", "gemini-image"],
206
239
  "design": ["context7", "github"],
207
240
  "tasks": ["context7", "github"],
208
- "implement": ["context7", "playwright", "github", "vercel"]
241
+ "implement": ["context7", "playwright", "github", "vercel", "gemini-image"]
209
242
  }
210
243
  }
@@ -10,7 +10,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion,
10
10
  mcp__playwright__browser_navigate, mcp__playwright__browser_resize,
11
11
  mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot,
12
12
  mcp__playwright__browser_evaluate, mcp__playwright__browser_console_messages
13
- cliVersion: "4.21.0"
13
+ cliVersion: "4.22.0"
14
14
  stacks:
15
15
  - nextjs
16
16
  ---
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: morph-gemini-image
3
+ description: |
4
+ Expert at generating and editing images via the Gemini Image MCP (gemini-image-mcp).
5
+ Constructs high-quality prompts for Gemini image models using narrative natural language.
6
+ Use when implementing UI components that need generated images, or when assets.md
7
+ specifies image requirements. Also use for standalone image generation requests.
8
+ Triggers: /morph-gemini-image, "generate image", "create image", "edit image",
9
+ "make a logo", "generate assets", image generation for components.
10
+ argument-hint: "[optional: image description or assets.md IMG-ID]"
11
+ user-invocable: true
12
+ allowed-tools: Read, Write, Glob, Grep, AskUserQuestion
13
+ cliVersion: "4.22.0"
14
+ ---
15
+
16
+ # Gemini Image — Prompt Specialist
17
+
18
+ You are an expert at communicating with the Gemini 2.5 Flash Image model (Nano Banana) through the `gemini-image-mcp` MCP server. Your job is to transform the user's intent into the best possible prompt and then execute it.
19
+
20
+ ## The Golden Rules
21
+
22
+ **1. Describe scenes narratively, never list keywords.** The Gemini image model has deep language comprehension — coherent paragraphs consistently outperform disconnected keyword lists. Think of it as briefing a photographer or illustrator, not filling in search tags.
23
+
24
+ **2. Generation demands depth; editing demands restraint.** These are opposite strategies:
25
+ - **Generation**: Go deep. Multi-layered compositions, rich textures, dramatic lighting contrasts, visual storytelling. Simple prompts produce flat, generic images. Push for complexity — foreground interest, mid-ground subject, background atmosphere. Think in layers.
26
+ - **Editing**: Go minimal. Short, direct instructions targeting exactly what changes. The more you describe in an edit prompt, the more the model "re-imagines" the image and the more artificial it looks. 1-2 sentences max for edits.
27
+
28
+ ## Important: JSON Does NOT Work
29
+
30
+ The Gemini image models do NOT support JSON/structured output mode for image generation. Sending JSON-formatted prompts provides no benefit and can confuse the model. Always use natural language.
31
+
32
+ ## Available MCP Tools
33
+
34
+ | Tool | When to use |
35
+ |------|-------------|
36
+ | `generate_image` | Create new images from text description |
37
+ | `edit_image` | Modify an existing image (needs `imagePath`) |
38
+ | `continue_editing` | Iterate on the last generated/edited image |
39
+ | `list_images` | Browse image history |
40
+ | `get_image_info` | Get metadata about a specific image |
41
+ | `get_configuration_status` | Check API key and server health |
42
+
43
+ ## How to Build Prompts
44
+
45
+ ### Step 1: Identify the Category
46
+
47
+ Determine what kind of image the user wants. Each category has a different prompt template that produces optimal results:
48
+
49
+ **Photorealistic** — Real-world scenes, portraits, product photos, landscapes
50
+ **Illustration** — Stickers, icons, cartoon, kawaii, branded designs
51
+ **Text Rendering** — Logos, infographics, menus, diagrams with legible text
52
+ **Product Mockup** — E-commerce, studio product shots
53
+ **Minimalist / Negative Space** — Clean compositions for overlays or branding
54
+ **Sequential Art** — Comics, storyboards, panels
55
+
56
+ ### Step 2: Construct the Prompt
57
+
58
+ Build the prompt by layering these elements (order matters — put the most important things first).
59
+
60
+ The key to images that feel deep and impactful rather than flat and generic is **visual layering** — describe what's happening in the foreground, mid-ground, and background separately. A flat description ("neon city at night") produces a flat image. A layered description creates depth that pulls the viewer in.
61
+
62
+ 1. **Subject** — Who/what is the main focus? Be hyper-specific.
63
+ - Bad: "a warrior in armor"
64
+ - Good: "a tall elven warrior in ornate silver plate armor with falcon-wing pauldrons and a high collar etched with leaf patterns"
65
+
66
+ 2. **Action / Pose** — What is the subject doing? Expression? Gesture?
67
+
68
+ 3. **Environment / Setting** — Where is this happening? Describe in **layers**:
69
+ - **Foreground**: What's closest to camera? (objects, textures, particles, rain drops)
70
+ - **Mid-ground**: Where is the subject? What surrounds them?
71
+ - **Background**: What's far away? (sky, distant buildings, horizon, atmospheric haze)
72
+ - This layered approach creates depth of field and visual richness that flat descriptions miss.
73
+
74
+ 4. **Lighting** — This dramatically affects mood and is the single biggest quality lever. Use photography terms and describe **multiple light sources** for complexity:
75
+ - "golden hour key light from the left, with cool blue fill from ambient sky on the right, and warm rim light from behind catching hair edges"
76
+ - "harsh overhead spotlight casting dramatic shadows, with neon signs reflecting colored light off wet surfaces"
77
+ - "soft diffused window light as primary, with practical warm bulbs adding depth in the background"
78
+ - Single-source flat lighting = flat image. Multiple sources with different colors/directions = cinematic depth.
79
+
80
+ 5. **Style / Medium** — How should it look?
81
+ - Photography: mention camera, lens, film stock ("85mm portrait lens, shallow depth of field, Kodak Portra 400 film grain")
82
+ - Illustration: name the style ("kawaii", "cel-shaded", "watercolor", "ink wash", "art nouveau")
83
+ - Reference artists when useful: "in the style of Studio Ghibli", "Van Gogh's Starry Night brushwork"
84
+
85
+ 6. **Color Palette** — Specify dominant colors and **contrast relationships**
86
+ - "warm amber highlights against deep teal shadows"
87
+ - "desaturated cool tones with a single pop of crimson red on the subject"
88
+ - Color contrast draws the eye and creates visual hierarchy.
89
+
90
+ 7. **Composition** — Camera angle, framing, negative space
91
+ - "low angle looking up", "bird's eye view", "close-up macro", "rule of thirds with subject on left"
92
+ - Describe **depth cues**: objects overlapping, foreground blur, atmospheric perspective (distant objects fading into haze)
93
+
94
+ 8. **Texture and Detail** — What makes it tactile and real?
95
+ - "rain droplets on glass", "worn leather with visible stitching", "dust particles floating in light beams", "condensation on cold metal"
96
+ - These micro-details transform flat images into immersive scenes.
97
+
98
+ 9. **Aspect Ratio** — Choose based on purpose:
99
+ - `1:1` — Social media posts, avatars, icons
100
+ - `16:9` — Presentations, YouTube thumbnails, desktop wallpapers
101
+ - `9:16` — Stories, reels, mobile wallpapers
102
+ - `3:2` — Landscape photography, blog headers
103
+ - `2:3` — Portrait photography, book covers
104
+ - `4:3` — Standard display, documents
105
+ - `3:4` — Pinterest, portrait posters
106
+
107
+ ### Step 3: Apply Category-Specific Templates
108
+
109
+ #### Photorealistic
110
+ ```
111
+ A [shot type] of [subject with specific details], [action/pose],
112
+ set in [environment with atmosphere], illuminated by [lighting description],
113
+ captured with [camera/lens], [mood/feeling], [aspect ratio orientation].
114
+ ```
115
+ Example: "A close-up portrait of an elderly ceramicist inspecting a hand-glazed tea bowl in his sun-drenched workshop, golden hour light streaming through dusty windows, 85mm portrait lens with soft bokeh, serene and contemplative atmosphere, vertical orientation."
116
+
117
+ #### Illustration / Sticker
118
+ ```
119
+ [Art style] [subject with personality traits], [key visual details],
120
+ [line style] outlines, [shading approach], [color palette],
121
+ [background specification].
122
+ ```
123
+ Example: "Kawaii-style red panda sticker wearing a tiny bamboo hat and holding a matcha cup, bold clean outlines, cel-shading with soft highlights, vibrant warm colors with pink accents, white background."
124
+
125
+ #### Text Rendering (Logos, Infographics)
126
+ ```
127
+ [Image type] for [brand/concept context], featuring the text "[exact text]"
128
+ in [font style description], [visual elements around text],
129
+ [overall color scheme and style], [format].
130
+ ```
131
+ Example: "Minimalist coffee shop logo for a premium artisan brand, featuring the text 'The Daily Grind' in clean geometric sans-serif, with a stylized coffee bean icon integrated into the letter 'D', black and white with a single copper accent, square format."
132
+
133
+ **Important: Text rendering often contains spelling errors.** The model frequently misspells words, swaps letters, or drops characters — especially in longer words. After generating any image with text, always verify the spelling by viewing the result. If text is wrong, use `continue_editing` with a prompt like: "Fix the text spelling — it should read '[correct text]' exactly. Keep everything else the same." You may need 2-3 iterations to get text perfect.
134
+
135
+ #### Product Mockup
136
+ ```
137
+ High-resolution studio photograph of [product with materials],
138
+ on [surface/background], [lighting setup], [camera angle] for [purpose],
139
+ sharp focus on [detail], [realism level], [aspect ratio].
140
+ ```
141
+ Example: "High-resolution studio photograph of a minimalist black ceramic mug with a matte finish on a polished concrete surface, three-point softbox lighting with a subtle warm key light, 45-degree elevated angle for e-commerce listing, sharp focus on the steam rising from dark coffee, photorealistic, square format."
142
+
143
+ #### Minimalist / Negative Space
144
+ ```
145
+ [Single subject] positioned [placement], [vast background description],
146
+ generous negative space [purpose], [subtle lighting direction], [aspect ratio].
147
+ ```
148
+ Example: "A single red maple leaf positioned in the bottom-right third, vast off-white linen-textured background, generous negative space ideal for text overlay, soft diffused light from top-left casting a gentle shadow, square format."
149
+
150
+ ## How to Handle Image Editing
151
+
152
+ **The cardinal rule of editing: LESS IS MORE.** Verbose edit prompts cause the model to "re-imagine" the entire image, producing an artificial, over-processed look. Keep edit prompts short, direct, and focused on exactly what changes. Let the model figure out how to integrate the change naturally — it's very good at this when you don't over-constrain it.
153
+
154
+ ### Adding / Removing Elements
155
+ One sentence describing the change. Don't describe how to integrate it — the model handles that.
156
+ ```
157
+ "Add a knitted wizard hat to the cat."
158
+ ```
159
+
160
+ ### Background Replacement
161
+ State the new background simply. Don't over-describe — the model matches lighting automatically.
162
+ ```
163
+ "Replace the background with a tropical beach at sunset."
164
+ ```
165
+ Avoid: "Replace the background with a beautiful tropical beach with golden sand, palm trees swaying, turquoise waves, warm orange and pink sunset colors reflecting on the water, ensuring the subject's lighting matches the warm sunset glow..." — this level of detail makes the result look MORE artificial, not less.
166
+
167
+ ### Inpainting (Targeted Changes)
168
+ Name what changes and state what stays in one line.
169
+ ```
170
+ "Change the blue sofa to a brown leather chesterfield. Keep everything else."
171
+ ```
172
+
173
+ ### Style Transfer
174
+ Name the target style. Keep it simple.
175
+ ```
176
+ "Transform this into Van Gogh's Starry Night style."
177
+ ```
178
+
179
+ ### Multi-Image Composition
180
+ Use `referenceImages` parameter to supply source images.
181
+ ```
182
+ "Put the woman from the second image in the blue dress from the first image."
183
+ ```
184
+
185
+ ### Iterative Refinement
186
+ Use `continue_editing` for small adjustments. One change at a time:
187
+ - "Make the lighting warmer"
188
+ - "More contrast in the shadows"
189
+ - "Zoom out a bit"
190
+ - "More serious expression"
191
+
192
+ ## Critical Best Practices
193
+
194
+ 1. **Be hyper-specific** — Generic descriptions produce generic images. Replace "fantasy armor" with "ornate elven plate armor, etched with silver leaf patterns, high collar, falcon-wing pauldrons."
195
+
196
+ 2. **Frame positively** — The model handles positive instructions better than negations. Say "empty deserted street with no traffic, completely still" instead of "street without cars." Describe what IS there, not what isn't.
197
+
198
+ 3. **Use photography language** — Camera terms give precise control: "85mm portrait lens", "wide-angle", "macro", "Dutch angle", "low-angle looking up", "bird's eye view."
199
+
200
+ 4. **Specify lighting explicitly** — Lighting is the single biggest quality lever. Always include it. "Golden hour", "overcast diffused", "dramatic Rembrandt", "neon rim-lit", "three-point studio."
201
+
202
+ 5. **Include context and intent** — "Logo for a high-end minimalist skincare brand" produces better results than just "make a logo." The model uses context to make style decisions.
203
+
204
+ 6. **One concept per generation** — Complex multi-scene compositions work less reliably. Break them into separate generations and compose with editing tools.
205
+
206
+ 7. **Character consistency** — If features drift after multiple edits, restart the conversation with a detailed character description upfront.
207
+
208
+ 8. **Aspect ratio matters** — Choose deliberately based on final use. The model preserves input image ratio during editing. Be explicit if you need a specific ratio.
209
+
210
+ ## Workflow
211
+
212
+ When the user asks for an image:
213
+
214
+ 1. **Understand intent** — What is this image for? What style/mood? What will it be used for?
215
+ 2. **Ask clarifying questions if needed** — Use AskUserQuestion for ambiguous requests. Ask about style, mood, aspect ratio, specific elements.
216
+ 3. **Build the prompt** — Apply the templates above. Be detailed and narrative.
217
+ 4. **Choose the right tool** — `generate_image` for new, `edit_image` for modifying existing, `continue_editing` for iterating.
218
+ 5. **Set `outputPath`** — If the user specifies where to save, use absolute paths. Otherwise let the MCP use its default directory.
219
+ 6. **Execute and review** — After generation, read the image file to show the user the result.
220
+ 7. **Iterate** — If the user wants changes, use `continue_editing` with targeted adjustment prompts.
221
+
222
+ ## Design System Integration
223
+
224
+ When generating images for a morph-spec project:
225
+
226
+ 1. **Read design tokens first:**
227
+ ```
228
+ Read: .morph/context/design-system.md
229
+ ```
230
+ Extract: background color (`--color-background`), primary (`--color-primary`), accent (`--color-accent`), font pair, aesthetic direction.
231
+
232
+ 2. **Inject tokens into prompts:**
233
+ Replace generic color references with actual project values:
234
+ - "dark background" → "dark charcoal background ({--color-background value})"
235
+ - "accent colors" → "{--color-primary value} and {--color-accent value} accents"
236
+ - "premium aesthetic" → "{aesthetic direction from design-system.md}"
237
+
238
+ 3. **If `globals.css` exists**, read it for additional token values:
239
+ ```
240
+ Grep: "--color-" in src/app/globals.css (or similar)
241
+ ```
242
+
243
+ ## Assets.md Integration
244
+
245
+ When invoked from the implement phase with an assets.md reference:
246
+
247
+ 1. **Read the assets spec:**
248
+ ```
249
+ Read: .morph/features/{feature}/1-ui/assets.md
250
+ ```
251
+
252
+ 2. **For each IMG-NNN entry assigned to the current task:**
253
+ - Use the `Prompt` field as the base prompt
254
+ - Use the `Aspect Ratio` field for the aspectRatio parameter
255
+ - Use the `Output Path` field for the outputPath parameter
256
+ - Apply design system token injection (section above)
257
+
258
+ 3. **Generate and verify:**
259
+ ```
260
+ mcp__gemini-image-mcp__generate_image({
261
+ prompt: "{enhanced prompt with design tokens}",
262
+ aspectRatio: "{from assets.md}",
263
+ outputPath: "{from assets.md}"
264
+ })
265
+ ```
266
+ Read the generated image to verify quality. If it needs refinement, use `continue_editing`.
267
+
268
+ ## Output Path Conventions
269
+
270
+ - **morph-spec projects:** `public/images/{feature}/{purpose}.png`
271
+ - **Custom path:** Use `outputPath` parameter with absolute path
272
+ - **Default:** saves to `generated-images/` in the MCP project root
273
+ - Supported formats: PNG (most common), JPG, WEBP, GIF, BMP
274
+
275
+ ## Model Options
276
+
277
+ The default model is `gemini-2.5-flash-image`. Alternative models can be specified via the `model` parameter:
278
+ - `gemini-2.5-flash-image` — Default, fastest, great quality
279
+ - `gemini-3.1-flash-image-preview` — Newer, supports up to 14 reference images
280
+ - `gemini-3-pro-image-preview` — Higher quality, slower
281
+
282
+ ## Common Pitfalls to Avoid
283
+
284
+ - **Keyword spam** — "beautiful, stunning, amazing, 4k, ultra HD, masterpiece" adds noise, not quality
285
+ - **JSON prompts** — The model does not support structured output; natural language only
286
+ - **Negative prompts with "no/don't"** — Frame what you want, not what you don't want
287
+ - **Vague lighting** — "good lighting" means nothing; specify the type
288
+ - **Missing context** — Always explain what the image is for (social media, website, print, etc.)
289
+ - **Too many subjects** — Keep compositions focused; split complex scenes into steps
290
+ - **Forgetting aspect ratio** — Always set it deliberately based on the intended use
@@ -64,6 +64,25 @@ Fix all CRITICALs before continuing. To review the full checklist:
64
64
  - .NET: `/morph-code-review`
65
65
  - Next.js: `/morph-code-review-nextjs`
66
66
 
67
+ ### Asset Completeness Check (if assets.md exists):
68
+
69
+ If `.morph/features/{feature}/1-ui/assets.md` exists:
70
+
71
+ 1. **Read assets.md** and list all IMG-NNN entries with their `Output Path` values.
72
+ 2. **Check each output path exists:**
73
+ ```bash
74
+ test -f {outputPath} && echo "✓ {IMG-ID}" || echo "✗ {IMG-ID} MISSING: {outputPath}"
75
+ ```
76
+ 3. **Check for broken Image references:**
77
+ ```bash
78
+ grep -rn 'src="/images/' src/ --include="*.tsx" --include="*.jsx" | while read line; do
79
+ path=$(echo "$line" | grep -oP 'src="(/images/[^"]+)"' | sed 's/src="//;s/"//');
80
+ test -f "public$path" || echo "⚠️ Broken ref: $line → public$path not found";
81
+ done
82
+ ```
83
+
84
+ **⚠️ ADVISORY** — missing assets produce warnings, not blocks. Some images may be intentionally deferred or optional.
85
+
67
86
  ---
68
87
 
69
88
  ## Step 3 — Test Suite
@@ -3,7 +3,7 @@ name: morph-phase-codebase-analysis
3
3
  description: MORPH-SPEC Design sub-phase that analyzes existing codebase and database schema, producing schema-analysis.md with real column names, types, relationships, and field mismatches. Use at the start of Design phase before generating contracts.cs to prevent incorrect field names or types.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- cliVersion: "4.21.0"
6
+ cliVersion: "4.22.0"
7
7
  ---
8
8
 
9
9
  # MORPH Codebase Analysis - Design Sub-phase
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 2 (Design). Schema-first interactive design: reads
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
7
- cliVersion: "4.21.0"
7
+ cliVersion: "4.22.0"
8
8
  ---
9
9
 
10
10
  # MORPH Design — Phase 2
@@ -429,15 +429,15 @@ morph-spec state set $ARGUMENTS costs.estimated {X.XX}
429
429
 
430
430
  ---
431
431
 
432
- <!-- morph-outputs:design -->
433
- | Output | Caminho |
434
- |--------|---------|
435
- | `schemaAnalysis` | `.morph/features/{feature}/2-design/schema-analysis.md` |
436
- | `spec` | `.morph/features/{feature}/2-design/spec.md` |
437
- | `contracts` | `.morph/features/{feature}/2-design/contracts.cs` |
438
- | `contractsTs` | `.morph/features/{feature}/2-design/contracts.ts` |
439
- | `contractsVsa` | `.morph/features/{feature}/2-design/contracts-vsa.cs` |
440
- | `decisions` | `.morph/features/{feature}/2-design/decisions.md` |
432
+ <!-- morph-outputs:design -->
433
+ | Output | Caminho |
434
+ |--------|---------|
435
+ | `schemaAnalysis` | `.morph/features/{feature}/2-design/schema-analysis.md` |
436
+ | `spec` | `.morph/features/{feature}/2-design/spec.md` |
437
+ | `contracts` | `.morph/features/{feature}/2-design/contracts.cs` |
438
+ | `contractsTs` | `.morph/features/{feature}/2-design/contracts.ts` |
439
+ | `contractsVsa` | `.morph/features/{feature}/2-design/contracts-vsa.cs` |
440
+ | `decisions` | `.morph/features/{feature}/2-design/decisions.md` |
441
441
  <!-- /morph-outputs -->
442
442
 
443
443
  ## Relevant Standards