name: 'step-02w-nb-compose-prompt' description: 'Translate page specification into an effective AI image generation prompt for Nano Banana'
nextStepFile: './step-03-review-integrate.md' workflowFile: '../workflow.md'
Translate a page specification into an effective AI image generation prompt that balances creative exploration with spec adherence.
Reference: Load ../data/guides/NANO-BANANA-PROMPT-GUIDE.md for compression strategy and examples.
{communication_language}Create an agent experience file to track this visual generation session.
File location: {output_folder}/_progress/agent-experiences/
Naming: {date}-visual-{page-name}.md
Example: 2026-02-19-visual-1.1-hem.md
# Visual Generation: {page-name}
## Inputs
- **Page spec:** {path to page spec}
- **Visual direction:** {path or "not available"}
- **Design tokens:** {path or "not available"}
## Image Descriptions Extracted
{filled in step B}
## Creative Direction
{filled in step C -- user overrides recorded here}
## Generation Log
{each generation appended here in step H}
If a previous generation log exists for this page, read it for context — previous creative direction, successful prompts, and lessons learned.
{output_folder}/C-UX-Scenarios/ (or equivalent){output_folder}/A-Product-Brief/ (if available){output_folder}/D-Design-System/ (if available)Scan the page specification for all objects that contain image descriptions in their Content fields. These are natural prompt seeds.
Look for patterns like:
**Content:**
- **Image:** [description of what the image shows]
Collect each as a prompt seed:
For each image object found:
- Object ID: {id}
- Section: {section name}
- Image description: {the Content > Image text}
- Alt text: {the primary language alt text}
Present to user:
I found {N} image descriptions in the spec:
1. [{section}] {object_id}
"{image description}"
2. [{section}] {object_id}
"{image description}"
...
Present the extracted image descriptions and ask for overrides or enhancements.
Would you like to adjust any of these image descriptions before generation?
You can:
- Override: Replace the description entirely ("make it a dramatic sunset")
- Enhance: Add to the description ("...with warm golden light")
- Accept: Use as-is from the spec
Which images would you like to adjust?
Record any overrides. The final image description = spec description + user modifications.
What would you like to generate?
[P] Full page mockup -- All sections in one image (layout overview)
[S] Section focus -- One section at high detail (e.g., just the hero)
[I] Image asset -- A single image described in the spec (e.g., hero photo, season card)
[W] Wireframe -- Clean digital wireframe from spec (recommended first step)
Scope determines prompt strategy:
| Scope | Prompt content | Best for |
|---|---|---|
| Full page | All sections compressed, layout focus | Understanding overall flow |
| Section focus | One section expanded, full detail | Detailed design of key areas |
| Image asset | Single image description + style context | Generating actual visual assets |
| Wireframe | Layout structure only, grayscale boxes | Layout validation, pipeline step 1 |
Recommended pipeline for full-page mockups:
If the user selects [P], recommend the two-step wireframe pipeline (see NANO-BANANA-PROMPT-GUIDE.md):
Set expectations with user: NB mockups are for layout exploration and mood visualization only. All text will be garbled, logos will be approximate, and some wireframe labels may leak through. For production-quality output, use the approved layout as reference for HTML/CSS prototypes or Figma.
Do you have reference images for visual conditioning? (up to 3)
These help Nano Banana understand the visual context:
- Workshop photos (actual facility)
- Brand logo
- Sketches or wireframes
- Mood board images
- Competitor screenshots
Provide file paths, or skip:
Map provided paths to input_image_path_1, input_image_path_2, input_image_path_3.
Slot priority for edit mode:
Auto-detect sketches: Check {output_folder}/C-UX-Scenarios/[scenario]/[page]/Sketches/ for hand-drawn wireframes. If found, offer to use as reference.
How much creative freedom should the AI have?
[F] Faithful -- Clean UI mockup, close to spec layout and content
[E] Expressive -- Follows structure, takes creative liberties with visual treatment
[V] Vision -- Artistic concept, captures mood and brand essence
Follow the compression strategy from NANO-BANANA-PROMPT-GUIDE.md.
Assembly order:
Compose system_instruction (max 512 chars):
Set parameters:
| Parameter | Value |
|---|---|
aspect_ratio |
Full page scroll: 9:16, Desktop viewport: 16:9, Tablet: 3:4, Image asset: per spec. CRITICAL in edit mode: always pin this or model may change it and lose content |
model_tier |
pro for first generation and wireframes, flash for quick iterations |
mode |
generate for new images/wireframes, edit for wireframe->mockup or refinement |
negative_prompt |
Generate: "lorem ipsum, placeholder, watermark". Edit from wireframe: "wireframe style, gray boxes, placeholder text, section labels" |
output_path |
{output_folder}/D-Design-System/01-Visual-Design/design-concepts/ |
Verify: Total prompt must be under 8192 characters. If over:
Call mcp__nanobanana__generate_image with the assembled prompt, system instruction, parameters, and reference images.
Present the result to the user.
Log to agent experience file:
### Generation {N} -- {timestamp}
**Scope:** {Full page / Section focus / Image asset}
**Creative mode:** {Faithful / Expressive / Vision}
**Aspect ratio:** {ratio}
**Model tier:** {flash / pro}
**Reference images:** {paths or "none"}
**System instruction:**
{the composed system instruction}
**Prompt:**
{the composed prompt}
**Output:** {path to generated image}
**User feedback:** {filled after review}
Update the agent experience file.
How does this look?
[A] Accept -- Save and proceed to review
[R] Refine -- Adjust the prompt and regenerate
[E] Edit -- Send this image back with targeted changes (edit mode)
[M] Mode change -- Try a different creative mode (F/E/V)
[S] Scope change -- Switch scope (full page / section / image asset / wireframe)
[N] New direction -- Start over with different creative direction
On [R] Refine: Ask what to change, update prompt, regenerate from scratch.
On [E] Edit: Use the generated image as input_image_path_1 in edit mode with targeted instructions. Follow these rules:
aspect_ratio to match the current image -- omitting it causes content lossOn [M] Mode change: Recompose with new mode preamble, regenerate. On [S] Scope change: Return to step D, recompose prompt for new scope. On [N] New direction: Return to step C for new creative overrides.
For projects with many similar pages (e.g., 11 vehicle type pages, 6 service pages, 4 seasonal articles), batch mode generates visuals across a page sequence.
When to Use Batch Mode:
When NOT to Use Batch Mode:
Display: "Select an Option: [C] Continue to Review & Integrate | [M] Return to Activity Menu"
ONLY WHEN the user has accepted a generated visual and selected an option from the menu will you proceed to the next step or return as directed.
Master Rule: Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.