@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
@@ -5,7 +5,7 @@ argument-hint: "[feature-name]"
5
5
  context: fork
6
6
  agent: general-purpose
7
7
  user-invocable: false
8
- cliVersion: "4.21.0"
8
+ cliVersion: "4.22.0"
9
9
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
10
10
  ---
11
11
 
@@ -204,6 +204,7 @@ Read: .morph/features/{feature}/4-tasks/tasks.md
204
204
  + Read: .morph/features/{feature}/2-design/contracts.cs (or contracts.ts for TypeScript projects)
205
205
  + Read: .morph/config/config.json (→ architecture.style)
206
206
  + Read: .morph/features/{feature}/3-plan/plan.md
207
+ + Read: .morph/features/{feature}/1-ui/assets.md (if exists — image asset specs)
207
208
  ```
208
209
 
209
210
  ### 2. Detect architecture style
@@ -221,6 +222,80 @@ Otherwise → go directly to the task loop.
221
222
 
222
223
  Structure: `Features/{Entity}Feature/{Op}/` with Handler (+ Request/Response records) + Validator + Endpoint per slice. Everything `sealed`. `Guid.CreateVersion7()`. `result.Match()` in endpoints. No Application Service layer — handler accesses IRepository directly. Auto-discovery via reflection: do not manually register in Program.cs.
223
224
 
225
+ ### 3. UI Reference Loading (Stitch HTML)
226
+
227
+ > **Skip if:** `.morph/features/{feature}/1-ui/stitch-screen-map.json` does not exist.
228
+ > This section is OPTIONAL — only applies when the UI/UX phase used Stitch MCP.
229
+
230
+ If `stitch-screen-map.json` exists, this feature has Stitch HTML exports for visual fidelity:
231
+
232
+ 1. **Read the screen map and CSS mapping in parallel:**
233
+ ```
234
+ Read: .morph/features/{feature}/1-ui/stitch-screen-map.json
235
+ Read: .morph/features/{feature}/1-ui/stitch-html/stitch-css-map.json
236
+ ```
237
+
238
+ 2. **For each task that modifies a page/route:**
239
+ - Parse the task description for route references (e.g., `/dashboard`, `/settings`)
240
+ - Find the matching screen in `stitch-screen-map.json` by route
241
+ - Read the corresponding HTML file:
242
+ ```
243
+ Read: .morph/features/{feature}/1-ui/stitch-html/{screenId}.html
244
+ ```
245
+ - Include the HTML in the agent's context along with the CSS mapping
246
+
247
+ 3. **Translation rules for agents:**
248
+ When implementing from Stitch HTML, agents MUST:
249
+ - Replace Stitch inline color values with project CSS custom properties using `stitch-css-map.json`
250
+ - Preserve the **layout structure** (flex/grid hierarchy, element nesting) from Stitch HTML
251
+ - Preserve **typography hierarchy** (heading levels, font sizes, weights)
252
+ - Map Stitch HTML elements to the chosen UI library components (e.g., `<div class="card">` → shadcn `<Card>`)
253
+ - Respect the Stitch spacing proportions, mapping to project spacing tokens
254
+ - For unmapped values in `stitch-css-map.json`, add them as new tokens to `design-system.md`
255
+
256
+ > **Source of truth hierarchy:** The Stitch HTML is the visual source of truth. `mockups.md` describes
257
+ > behavior and states; the HTML describes exact visual structure. When they conflict, the HTML wins for
258
+ > layout/visual, mockups.md wins for behavior/states.
259
+
260
+ ### 4. Image Asset Generation (Gemini Image MCP)
261
+
262
+ > **Skip if:** `.morph/features/{feature}/1-ui/assets.md` does not exist.
263
+ > **Skip if:** Gemini Image MCP is not available.
264
+ > This section is OPTIONAL — only applies when the UI/UX phase created an assets.md spec.
265
+
266
+ If `assets.md` exists, this feature has image assets to generate during implementation:
267
+
268
+ 1. **Read the assets spec:**
269
+ ```
270
+ Read: .morph/features/{feature}/1-ui/assets.md
271
+ ```
272
+
273
+ 2. **When a task involves a component listed in assets.md:**
274
+ - Find the matching IMG-NNN entry by component name or route
275
+ - Invoke `/morph-gemini-image` with the asset spec:
276
+ - Pass the `Prompt` field as the generation prompt
277
+ - Pass the `Aspect Ratio` field
278
+ - Pass the `Output Path` field
279
+ - If the image needs refinement, use `edit_image` or `continue_editing`
280
+
281
+ 3. **Integrate the generated image into the component:**
282
+ ```tsx
283
+ import Image from 'next/image';
284
+
285
+ <Image
286
+ src="/images/{feature}/{name}.png"
287
+ alt="{descriptive alt text}"
288
+ width={width}
289
+ height={height}
290
+ priority // if above-the-fold
291
+ />
292
+ ```
293
+
294
+ 4. **Verify build compiles** after adding the image reference.
295
+
296
+ > **Important:** Generate images DURING the task that builds the component, not as a separate step.
297
+ > This keeps the image contextually linked to the component code.
298
+
224
299
  ---
225
300
 
226
301
  ## Workflow
@@ -252,6 +327,14 @@ Agent(subagent_type="morph-dotnet-senior", prompt="Implement tasks T001, T002 fo
252
327
  > **MANDATORY:** Use the exact `subagentType` value from `recommended`. Do NOT use `general-purpose` agents when a `subagentType` is available.
253
328
  >
254
329
  > The agent `.md` file contains the full expertise prompt, task routing, and key standards. No additional prompt injection needed — just provide the task assignment.
330
+ >
331
+ > **If Stitch HTML exists:** When dispatching frontend agents, read `stitch-screen-map.json` and include
332
+ > the relevant screen HTML for each agent's assigned tasks. Populate the `{{STITCH_CONTEXT}}` placeholder
333
+ > in `implementer-prompt.md` with the screen HTML and CSS mapping for the routes that agent is implementing.
334
+ >
335
+ > **If assets.md exists:** When dispatching frontend agents, read `assets.md` and include
336
+ > the relevant IMG-NNN entries for each agent's assigned routes. Populate the `{{ASSETS_CONTEXT}}`
337
+ > placeholder in `implementer-prompt.md` with the image specs for the routes that agent is implementing.
255
338
 
256
339
  5. After all subagents complete, validate integration: `morph-spec validate-feature $ARGUMENTS --phase implement`
257
340
 
@@ -361,6 +444,64 @@ await mcp__playwright__browser_console_messages({ level: 'error' });
361
444
  await mcp__playwright__browser_take_screenshot({ type: 'png' });
362
445
  ```
363
446
 
447
+ ### Step 5.5: Visual Verification against Stitch (Optional)
448
+
449
+ > **Skip if:** `.morph/features/$ARGUMENTS/1-ui/stitch-screen-map.json` does not exist.
450
+ > **Skip if:** Playwright MCP is not available.
451
+ > **Skip if:** Dev server is not running.
452
+ > This step is strongly recommended but not blocking — consistent with fail-open philosophy.
453
+
454
+ After implementing visual components, compare against the Stitch reference:
455
+
456
+ 1. **Load screen map:**
457
+ ```
458
+ Read: .morph/features/$ARGUMENTS/1-ui/stitch-screen-map.json
459
+ ```
460
+
461
+ 2. **For each screen that was implemented in the current task batch:**
462
+
463
+ a. **Screenshot the implemented page:**
464
+ ```
465
+ mcp__plugin_playwright_playwright__browser_navigate({ url: '{devServerUrl}{route}' })
466
+ mcp__plugin_playwright_playwright__browser_resize({ width: 1440, height: 900 })
467
+ mcp__plugin_playwright_playwright__browser_take_screenshot({})
468
+ ```
469
+
470
+ b. **Read the original Stitch screenshot:**
471
+ ```
472
+ Read: .morph/features/$ARGUMENTS/1-ui/stitch-screen-{index}.png
473
+ ```
474
+
475
+ c. **Compare visually** (multimodal comparison of both images):
476
+ - **Layout:** Grid/flex structure matching? Sections in correct positions?
477
+ - **Typography:** Heading sizes, weights, font families consistent?
478
+ - **Colors:** Mapped CSS tokens producing visually similar colors?
479
+ - **Spacing:** Margins and paddings proportionally similar?
480
+ - **Interactive elements:** Buttons, inputs, cards styled similarly?
481
+
482
+ d. **Document results** in `.morph/features/$ARGUMENTS/5-implement/visual-verification.md`:
483
+ ```markdown
484
+ # Visual Verification — {feature}
485
+
486
+ ## Screen: {title} ({route})
487
+
488
+ | Aspect | Match | Notes |
489
+ |--------|-------|-------|
490
+ | Layout | ✓/✗ | {notes} |
491
+ | Typography | ✓/✗ | {notes} |
492
+ | Colors | ✓/✗ | {notes} |
493
+ | Spacing | ✓/✗ | {notes} |
494
+ | Interactive | ✓/✗ | {notes} |
495
+
496
+ **Overall:** {PASS/NEEDS_WORK}
497
+ ```
498
+
499
+ e. **If NEEDS_WORK:** Fix the most impactful discrepancies (layout first, then colors,
500
+ then typography). Re-screenshot and re-compare. Maximum 2 iteration rounds to avoid
501
+ infinite loops.
502
+
503
+ 3. **Skip gracefully** if any prerequisite is missing (log warning, continue to Step 6).
504
+
364
505
  ### Step 6: Generate `recap.md`
365
506
 
366
507
  After ALL tasks completed:
@@ -471,10 +612,10 @@ Agent(subagent_type=morph-standards-architect, prompt=<filled prompts/code-quali
471
612
 
472
613
  ## Phase Outputs
473
614
 
474
- <!-- morph-outputs:implement -->
475
- | Output | Caminho |
476
- |--------|---------|
477
- | `recap` | `.morph/features/{feature}/5-implement/recap.md` |
615
+ <!-- morph-outputs:implement -->
616
+ | Output | Caminho |
617
+ |--------|---------|
618
+ | `recap` | `.morph/features/{feature}/5-implement/recap.md` |
478
619
  <!-- /morph-outputs -->
479
620
 
480
621
  ---
@@ -10,6 +10,14 @@ You are implementing tasks for the feature '{{FEATURE_NAME}}' as agent '{{AGENT_
10
10
  **Standards:** Read relevant files in `.morph/framework/standards/`
11
11
  **Code Templates:** Read `.morph/framework/templates/code/dotnet/feature/` (endpoint, handler, validator) — follow these patterns exactly
12
12
 
13
+ ## UI Reference (Stitch HTML)
14
+
15
+ {{STITCH_CONTEXT}}
16
+
17
+ ## Image Assets
18
+
19
+ {{ASSETS_CONTEXT}}
20
+
13
21
  ## Agent Briefing
14
22
 
15
23
  {{AGENT_BRIEFING}}
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 3 (Plan). Generates a detailed implementation plan
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.21.0"
7
+ cliVersion: "4.22.0"
8
8
  ---
9
9
 
10
10
  # MORPH Plan — Phase 3
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ord
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.21.0"
7
+ cliVersion: "4.22.0"
8
8
  ---
9
9
 
10
10
  # MORPH Tasks — Phase 4
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 2 (UI/UX). Creates design-system.md, mockups.md, c
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.21.0"
7
+ cliVersion: "4.22.0"
8
8
  ---
9
9
 
10
10
  # MORPH UI/UX Design - Phase 2
@@ -45,6 +45,7 @@ Conditional phase for features with front-end. Collects UI/UX requirements, gene
45
45
  | Trend research | **Context7 MCP** / **WebSearch** | — |
46
46
  | Generate AI screen designs | **Stitch MCP** `generate_screen_from_text()` + `fetch_screen_image()` | HTML mockup + Playwright (Step 3.5) |
47
47
  | Export design tokens from Stitch | **Stitch MCP** `fetch_screen_code()` | Manual design-system.md creation |
48
+ | Download Stitch HTML exports | **Stitch MCP** `fetch_screen_code()` → save to `stitch-html/` | Step 3.5.0.5 |
48
49
 
49
50
  **MCPs for this phase:** Playwright (preview, inspection, responsiveness), Context7 (component docs), Stitch (optional: AI screen generation, design.md export).
50
51
 
@@ -517,6 +518,109 @@ If Stitch MCP is available, present the user with a choice:
517
518
  > receives the actual component structure, CSS properties, and design tokens — not pixel approximations.
518
519
  > Use `react-components` or `shadcn-ui` companion skills to convert Stitch HTML into production React components.
519
520
 
521
+ #### 3.5.0.5 — Download Stitch HTML Exports (after screen approval)
522
+
523
+ > **Purpose:** Save the actual HTML/CSS from each Stitch screen so implementation agents can reference
524
+ > real structure and styles instead of relying solely on text descriptions in mockups.md.
525
+ > **Skip if:** Stitch path was not chosen, or no screens were approved.
526
+
527
+ 1. **Create stitch-html directory:**
528
+ ```bash
529
+ mkdir -p .morph/features/$ARGUMENTS/1-ui/stitch-html/
530
+ ```
531
+
532
+ 2. **For each approved screen**, fetch the full HTML:
533
+ ```
534
+ stitch__fetch_screen_code({ screenId: approvedScreenId })
535
+ ```
536
+ Save the returned HTML content to:
537
+ `.morph/features/$ARGUMENTS/1-ui/stitch-html/{screenId}.html`
538
+
539
+ > If `fetch_screen_code()` returns a structured object, extract the `.html` or `.code` field.
540
+
541
+ 3. **Auto-generate CSS mapping from design-system.md:**
542
+ Read `.morph/context/design-system.md` and extract all CSS custom properties (`--color-*`, `--font-*`, `--space-*`).
543
+ Scan each downloaded HTML file's `<style>` block for color literals, font families, and spacing values.
544
+ Produce a best-effort mapping file at `.morph/features/$ARGUMENTS/1-ui/stitch-html/stitch-css-map.json`:
545
+
546
+ ```json
547
+ {
548
+ "mappings": [
549
+ { "stitchValue": "#6366f1", "projectToken": "var(--color-primary)", "type": "color" },
550
+ { "stitchValue": "Inter", "projectToken": "var(--font-body)", "type": "font" }
551
+ ],
552
+ "unmapped": ["#ff0000"],
553
+ "source": ".morph/context/design-system.md"
554
+ }
555
+ ```
556
+
557
+ If no `design-system.md` exists, create the file with empty mappings:
558
+ ```json
559
+ { "mappings": [], "unmapped": [], "source": null, "note": "No design system found — use Stitch values directly" }
560
+ ```
561
+
562
+ 4. **Ask user for screen-to-route mapping:**
563
+ Use `AskUserQuestion` to map each screen to an app route. Present all screens in one call (up to 4 per call):
564
+
565
+ ```json
566
+ {
567
+ "questions": [{
568
+ "header": "Route Map",
569
+ "question": "Which app route does screen '{screenTitle}' correspond to?",
570
+ "multiSelect": false,
571
+ "options": [
572
+ { "label": "/{screenTitleLower}", "description": "Inferred from screen title" },
573
+ { "label": "/", "description": "Home/landing page" },
574
+ { "label": "Skip", "description": "This screen has no direct route" }
575
+ ]
576
+ }]
577
+ }
578
+ ```
579
+
580
+ For more than 4 screens, make sequential `AskUserQuestion` calls.
581
+
582
+ 5. **Create `stitch-screen-map.json`:**
583
+ Save to `.morph/features/$ARGUMENTS/1-ui/stitch-screen-map.json`:
584
+ ```json
585
+ {
586
+ "version": "1.0.0",
587
+ "projectId": "{stitchProjectId}",
588
+ "generatedAt": "{ISO timestamp}",
589
+ "screens": [
590
+ {
591
+ "screenId": "{screenId}",
592
+ "title": "{screenTitle}",
593
+ "route": "/dashboard",
594
+ "htmlFile": "stitch-html/{screenId}.html",
595
+ "screenshotFile": "stitch-screen-{index}.png",
596
+ "device": "desktop"
597
+ }
598
+ ],
599
+ "cssMapFile": "stitch-html/stitch-css-map.json"
600
+ }
601
+ ```
602
+
603
+ 6. **Update mockups.md** to reference downloaded HTML files.
604
+ Add a section at the top of `mockups.md`:
605
+
606
+ ```markdown
607
+ ## Stitch HTML Reference
608
+
609
+ This feature has Stitch HTML exports for implementation fidelity.
610
+ See `stitch-screen-map.json` for the full screen-to-route mapping.
611
+
612
+ | Screen | Route | HTML File |
613
+ |--------|-------|-----------|
614
+ | {title} | {route} | `stitch-html/{screenId}.html` |
615
+ ```
616
+
617
+ 7. **Mark output:**
618
+ ```bash
619
+ morph-spec state mark-output $ARGUMENTS stitchHtml
620
+ ```
621
+
622
+ ---
623
+
520
624
  **If "Use HTML mockup" selected:**
521
625
  → Proceed to 3.5.1 (existing workflow, unchanged)
522
626
 
@@ -682,7 +786,107 @@ Complete user flows:
682
786
  → Go back and complete the missing deliverable
683
787
 
684
788
  **If ALL checkboxes are checked:**
685
- → Proceed to accessibility validation
789
+ → Proceed to image assets spec (Step 4.5) or accessibility validation (Step 5)
790
+
791
+ ---
792
+
793
+ ### Step 4.5: Generate Image Assets Spec (`assets.md`)
794
+
795
+ > **Skip if:** Feature has no UI components, no mockups, no Stitch screens.
796
+ > **Skip if:** No images needed (pure data/form UI with no visual assets).
797
+ > **MCP:** Gemini Image MCP (optional — used for preview generation only).
798
+ > **Standard:** `frontend/design-system/ai-image-generation.md`
799
+
800
+ When the feature has UI components that need images (hero sections, brand panels, illustrations, empty states):
801
+
802
+ 1. **Identify image requirements:**
803
+ Scan these sources for image references:
804
+ - `mockups.md` — look for image placeholders, illustrations, photos
805
+ - `stitch-screen-map.json` (if exists) — Stitch designs reference Google-hosted images that need production replacements
806
+ - `components.md` — components listing image props or visual areas
807
+
808
+ 2. **Read design system context:**
809
+ ```
810
+ Read: .morph/context/design-system.md
811
+ ```
812
+ Extract: aesthetic direction, primary/accent/background colors, font pair.
813
+
814
+ 3. **Ask user to confirm image requirements:**
815
+
816
+ ```json
817
+ {
818
+ "questions": [{
819
+ "header": "Image Assets",
820
+ "question": "I identified these images needed for the feature. Which should we include in assets.md?",
821
+ "multiSelect": true,
822
+ "options": [
823
+ { "label": "{image1 purpose}", "description": "{route} — {aspect ratio}" },
824
+ { "label": "{image2 purpose}", "description": "{route} — {aspect ratio}" },
825
+ { "label": "None needed", "description": "Skip image asset generation entirely" }
826
+ ]
827
+ }]
828
+ }
829
+ ```
830
+
831
+ 4. **For each confirmed image**, ask for prompt refinement:
832
+
833
+ ```json
834
+ {
835
+ "questions": [{
836
+ "header": "IMG-001",
837
+ "question": "Prompt for {purpose}: '{auto-generated prompt based on design context}'. Adjust?",
838
+ "multiSelect": false,
839
+ "options": [
840
+ { "label": "Use as-is", "description": "The prompt looks good" },
841
+ { "label": "Adjust", "description": "I want to refine the prompt (Other)" }
842
+ ]
843
+ }]
844
+ }
845
+ ```
846
+
847
+ 5. **Generate `assets.md`:**
848
+ Write to `.morph/features/$ARGUMENTS/1-ui/assets.md`:
849
+
850
+ ```markdown
851
+ # Image Assets — {feature}
852
+
853
+ ## Design Context
854
+ - Aesthetic: {from design-system.md}
855
+ - Primary: {--color-primary value}
856
+ - Background: {--color-background value}
857
+ - Accent: {--color-accent value}
858
+ - Font pair: {display + body fonts}
859
+
860
+ ## Assets
861
+
862
+ ### IMG-001: {Descriptive Name}
863
+ - **Purpose:** {What this image represents in the UI}
864
+ - **Route:** {App route where it appears}
865
+ - **Component:** {React component name}
866
+ - **Aspect Ratio:** {1:1 | 3:2 | 16:9 | etc.}
867
+ - **Output Path:** `public/images/{feature}/{kebab-name}.png`
868
+ - **Prompt:** "{Narrative prompt with design system colors and aesthetic direction injected}"
869
+ - **Priority:** {high | medium | low}
870
+ ```
871
+
872
+ 6. **Optional — Generate preview images:**
873
+ If Gemini Image MCP is available, offer to generate preview images for user approval:
874
+
875
+ ```json
876
+ {
877
+ "questions": [{
878
+ "header": "Previews",
879
+ "question": "Gemini Image MCP is available. Want to generate preview images now for approval?",
880
+ "multiSelect": false,
881
+ "options": [
882
+ { "label": "Yes, generate previews", "description": "Generate images now for visual approval before implement phase" },
883
+ { "label": "Skip previews", "description": "Generate during implement phase instead" }
884
+ ]
885
+ }]
886
+ }
887
+ ```
888
+
889
+ If yes: invoke `/morph-gemini-image` for each asset, save previews to `1-ui/asset-previews/`, show to user for feedback. Iterate prompts if needed.
686
890
 
687
891
  ---
688
892
 
@@ -705,6 +909,8 @@ morph-spec state mark-output $ARGUMENTS ui-design-system
705
909
  morph-spec state mark-output $ARGUMENTS ui-mockups
706
910
  morph-spec state mark-output $ARGUMENTS ui-components
707
911
  morph-spec state mark-output $ARGUMENTS ui-flows
912
+ # Only if Stitch path was used (stitch-screen-map.json exists):
913
+ morph-spec state mark-output $ARGUMENTS stitchHtml
708
914
  ```
709
915
 
710
916
  > **Format note:** The `mark-output` commands accept BOTH kebab-case (`ui-design-system`)
@@ -774,13 +980,14 @@ Use `AskUserQuestion` to capture explicit approval before advancing:
774
980
 
775
981
  ## Phase Outputs
776
982
 
777
- <!-- morph-outputs:uiux -->
778
- | Output | Caminho |
779
- |--------|---------|
780
- | `uiDesignSystem` | `.morph/features/{feature}/1-ui/design-system.md` |
781
- | `uiMockups` | `.morph/features/{feature}/1-ui/mockups.md` |
782
- | `uiComponents` | `.morph/features/{feature}/1-ui/components.md` |
783
- | `uiFlows` | `.morph/features/{feature}/1-ui/flows.md` |
983
+ <!-- morph-outputs:uiux -->
984
+ | Output | Caminho |
985
+ |--------|---------|
986
+ | `uiDesignSystem` | `.morph/features/{feature}/1-ui/design-system.md` |
987
+ | `uiMockups` | `.morph/features/{feature}/1-ui/mockups.md` |
988
+ | `uiComponents` | `.morph/features/{feature}/1-ui/components.md` |
989
+ | `uiFlows` | `.morph/features/{feature}/1-ui/flows.md` |
990
+ | `stitchHtml` | `.morph/features/{feature}/1-ui/stitch-screen-map.json` |
784
991
  <!-- /morph-outputs -->
785
992
 
786
993
  ---
@@ -4,7 +4,7 @@ description: Guided workflow for mid-implementation scope escalation — analyze
4
4
  user-invocable: true
5
5
  argument-hint: "[feature-name]"
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.21.0"
7
+ cliVersion: "4.22.0"
8
8
  ---
9
9
 
10
10
  # Scope Escalation Workflow
@@ -1097,6 +1097,38 @@
1097
1097
  "stacks": [
1098
1098
  "*"
1099
1099
  ]
1100
+ },
1101
+ {
1102
+ "id": "frontend-design-system-ai-image-generation",
1103
+ "name": "AI Image Generation",
1104
+ "path": "frontend/design-system/ai-image-generation.md",
1105
+ "category": "frontend",
1106
+ "subcategory": "design-system",
1107
+ "tags": [
1108
+ "image",
1109
+ "gemini",
1110
+ "asset",
1111
+ "ai-generation",
1112
+ "placeholder",
1113
+ "mcp"
1114
+ ],
1115
+ "aliases": [
1116
+ "Image Generation",
1117
+ "AI Assets",
1118
+ "Gemini Images"
1119
+ ],
1120
+ "anchors": {
1121
+ "when-to-use": "#when-to-use-ai-generated-images",
1122
+ "prompt-patterns": "#prompt-engineering-patterns",
1123
+ "aspect-ratios": "#aspect-ratio-guide",
1124
+ "assets-md": "#assetsmd-format",
1125
+ "edit-workflows": "#iterative-editing-workflows"
1126
+ },
1127
+ "digest": "Guidelines for generating project images with Gemini Image MCP — prompt patterns, aspect ratios, design-system-aware prompts, iterative editing, and assets.md format.",
1128
+ "stacks": [
1129
+ "nextjs",
1130
+ "next"
1131
+ ]
1100
1132
  }
1101
1133
  ]
1102
1134
  }