{
  "schemaVersion": "1",
  "revision": "22ce5d34dbcb5a78",
  "id": "factory-design-variations-practice",
  "slug": "design-variations-practice",
  "title": "Generate to diverge, code to converge — prompts and exercises",
  "summary": "Complete reusable prompts, setup recipes, success checks, and caveats for generate to diverge, code to converge.",
  "category": "Planning",
  "tags": [
    "prompts",
    "exercises",
    "design-variations"
  ],
  "sources": [
    {
      "label": "Generate to diverge, code to converge",
      "url": "https://indigo-kayak-2zw8.here.now/"
    },
    {
      "label": "Public setup contract",
      "url": "https://indigo-kayak-2zw8.here.now/agent.md"
    }
  ],
  "sourceUnits": [
    "07-variations/index.html#Quick start",
    "07-variations/index.html#Prompt library",
    "07-variations/index.html#Set it up (agent guide)",
    "07-variations/index.html#Attachments — install the page skill",
    "07-variations/index.html#Codex — 9x wildly different website mockups",
    "07-variations/index.html#agy (Antigravity) — 9x wildly different mobile mockups",
    "07-variations/index.html#JSON status contract — for scripting image gen at scale",
    "07-variations/index.html#Converge — rebuild the winner as real code",
    "07-variations/agent.md"
  ],
  "collection": "factory",
  "categoryId": "planning",
  "wordCount": 3702,
  "url": "/topics/factory-design-variations-practice/",
  "markdownUrl": "/markdown/factory-design-variations-practice.md?raw=1&v=22ce5d34dbcb5a78",
  "jsonUrl": "/api/v1/documents/factory-design-variations-practice.json",
  "headings": [
    {
      "id": "quick-start",
      "text": "Quick start",
      "level": 2
    },
    {
      "id": "prompt-library",
      "text": "Prompt library",
      "level": 2
    },
    {
      "id": "codex-9x-wildly-different-website-mockups",
      "text": "Codex — 9x wildly different website mockups",
      "level": 3
    },
    {
      "id": "agy-antigravity-9x-wildly-different-mobile-mockups",
      "text": "agy (Antigravity) — 9x wildly different mobile mockups",
      "level": 3
    },
    {
      "id": "json-status-contract-for-scripting-image-gen-at-scale",
      "text": "JSON status contract — for scripting image gen at scale",
      "level": 3
    },
    {
      "id": "converge-rebuild-the-winner-as-real-code",
      "text": "Converge — rebuild the winner as real code",
      "level": 3
    },
    {
      "id": "set-it-up-agent-guide",
      "text": "Set it up (agent guide)",
      "level": 2
    },
    {
      "id": "attachments-install-the-page-skill",
      "text": "Attachments — install the page skill",
      "level": 2
    },
    {
      "id": "complete-reusable-setup-contract",
      "text": "Complete reusable setup contract",
      "level": 2
    },
    {
      "id": "variations-9x-mockups-from-one-prompt-agent-setup-guide",
      "text": "Variations: 9x Mockups from One Prompt — agent setup guide",
      "level": 2
    },
    {
      "id": "prerequisites",
      "text": "Prerequisites",
      "level": 2
    },
    {
      "id": "steps",
      "text": "Steps",
      "level": 2
    },
    {
      "id": "success-check",
      "text": "Success check",
      "level": 2
    },
    {
      "id": "notes-for-agents",
      "text": "Notes for agents",
      "level": 2
    },
    {
      "id": "attachment-the-here-now-workshop-page-skill-multi-file",
      "text": "Attachment: the here-now-workshop-page skill (multi-file)",
      "level": 2
    }
  ],
  "markdown": "# Generate to diverge, code to converge — prompts and exercises\n\nComplete reusable prompts, setup recipes, success checks, and caveats for generate to diverge, code to converge.\n\n## Quick start\n\nFastest possible taste — 9 website mockups landing in `./mockups/` (needs the Codex CLI; the agy version is in the prompt library):\n\n**Before you run it:** this launches Codex — a paid agent — with sandboxing and approval prompts disabled (`--dangerously-bypass-approvals-and-sandbox`). Read the command first and run it only in a project where you're comfortable with the cost and with an unsandboxed agent writing files.\n\n``` text\nmkdir -p mockups\ncodex exec --dangerously-bypass-approvals-and-sandbox 'Use the $imagegen skill to generate 9 WILDLY different website homepage mockups for a landing page for an indie coffee roaster. The subject stays identical in all 9 - ONLY the visual style varies. One built-in image_gen call per mockup. After each image completes, copy it from $CODEX_HOME/generated_images/ into ./mockups/ as mockup-01.png ... mockup-09.png. Announce progress after each one.'\nls mockups/\n```\n\n## Prompt library\n\nThe first two prompts use a `{{SUBJECT}}` placeholder — replace it before pasting, or let the run scripts (below) substitute it for you. Keep the subject identical across all 9; that's what makes the results comparable.\n\n### Codex — 9x wildly different website mockups\n\n- Agent: Codex CLI (\\$imagegen skill)\n- Working directory: your project root\n- Expected result: mockups/mockup-01.png … mockup-09.png + 9 named style directions\n\n``` text\nUse the $imagegen skill to generate 9 WILDLY different website homepage mockups\nfor {{SUBJECT}}.\n\nRules:\n- The SUBJECT stays identical in all 9 — same product, same page type\n  (homepage), same rough content (hero, nav, one CTA). ONLY the visual style\n  varies. This is what makes them comparable.\n- Pick 9 maximally divergent directions, e.g.: swiss/international typographic,\n  neo-brutalist, glassmorphic dark, editorial magazine, retro terminal,\n  playful memphis, luxury minimal, bento-grid dashboard, hand-drawn zine.\n  Name each direction before generating.\n- One built-in image_gen call per mockup (do NOT drop to the CLI fallback).\n- Desktop aspect, full homepage visible, legible headline text.\n- After each image completes, copy it from $CODEX_HOME/generated_images/\n  into ./mockups/ as mockup-01.png ... mockup-09.png (match the direction\n  order you announced).\n- Announce progress after each one — never go silent.\n- When all 9 exist, list the 9 directions next to their filenames.\n```\n\n### agy (Antigravity) — 9x wildly different mobile mockups\n\n- Agent: agy (Google Antigravity CLI)\n- Working directory: your project root\n- Expected result: mockups/mockup-01.png … mockup-09.png, phone aspect, 9 named directions\n\n``` text\nGenerate 9 WILDLY different mobile app UI mockups for {{SUBJECT}} using your\ngenerate_image tool.\n\nRules:\n- SUBJECT is constant across all 9 — same app, same home screen (listing feed,\n  search, one primary action). ONLY the visual style varies.\n- 9 divergent directions, e.g.: iOS glass minimal, material-you expressive,\n  neo-brutalist, dark luxury, pastel neumorphic, retro pixel, editorial serif,\n  cyberpunk neon, paper-collage tactile. Name each before generating.\n- One generate_image call per mockup with ImageName mockup_01 ... mockup_09.\n- Phone aspect ratio (9:19-ish), single screen per image.\n- After each generation, use run_command to copy the artifact into\n  ./mockups/ as mockup-01.png ... mockup-09.png.\n- If you hit an image quota error, report it immediately with the reset time\n  instead of retrying silently.\n- Announce progress after each image.\n```\n\n### JSON status contract — for scripting image gen at scale\n\n- Agent: any image-gen agent driven from bash\n- Working directory: append to your generation prompt\n- Expected result: one parseable JSON line per run — this is how inspiration-board loops over 200 styles unattended\n\n``` text\nRespond with ONLY a JSON object (no markdown, no explanation):\n- Success:     {\"status\":\"ok\",\"path\":\"<output_path>\"}\n- Quota error: {\"status\":\"quota_exhausted\",\"reset_seconds\":<N>,\"reset_time\":\"<ISO8601>\"}\n- Other error: {\"status\":\"error\",\"message\":\"<description>\"}\n```\n\n### Converge — rebuild the winner as real code\n\n- Agent: Codex or Claude Code\n- Working directory: project root, after picking a winner (replace 0N)\n- Expected result: winner/index.html — real text and layout, no bitmap backgrounds\n\n``` text\nmockup-0N.png is the winner. Rebuild it as a real single-file HTML/CSS page at\n./winner/index.html, using the image strictly as a visual reference — real\ntext, real layout, no bitmap backgrounds.\n```\n\n## Set it up (agent guide)\n\n1.  Create the Codex prompt file. The run script extracts its first fenced block and substitutes the subject.\n\n    ```` text\n    # Codex prompt — 9x wildly different website mockups\n\n    Replace `{{SUBJECT}}` with the site you're designing (keep it constant across all 9!).\n\n    ```\n    Use the $imagegen skill to generate 9 WILDLY different website homepage mockups\n    for {{SUBJECT}}.\n\n    Rules:\n    - The SUBJECT stays identical in all 9 — same product, same page type\n      (homepage), same rough content (hero, nav, one CTA). ONLY the visual style\n      varies. This is what makes them comparable.\n    - Pick 9 maximally divergent directions, e.g.: swiss/international typographic,\n      neo-brutalist, glassmorphic dark, editorial magazine, retro terminal,\n      playful memphis, luxury minimal, bento-grid dashboard, hand-drawn zine.\n      Name each direction before generating.\n    - One built-in image_gen call per mockup (do NOT drop to the CLI fallback).\n    - Desktop aspect, full homepage visible, legible headline text.\n    - After each image completes, copy it from $CODEX_HOME/generated_images/\n      into ./mockups/ as mockup-01.png ... mockup-09.png (match the direction\n      order you announced).\n    - Announce progress after each one — never go silent.\n    - When all 9 exist, list the 9 directions next to their filenames.\n    ```\n\n    ## Follow-up (converge on a winner)\n\n    ```\n    mockup-0N.png is the winner. Rebuild it as a real single-file HTML/CSS page at\n    ./winner/index.html, using the image strictly as a visual reference — real\n    text, real layout, no bitmap backgrounds.\n    ```\n    ````\n\n2.  Create the agy prompt file (same pattern, mobile mockups, plus the scripted status contract).\n\n    ```` text\n    # agy (Antigravity) prompt — 9x wildly different mobile mockups\n\n    Replace `{{SUBJECT}}` with the app you're designing. Historical workshop subject:\n    \"a mobile app for selling houses\".\n\n    ```\n    Generate 9 WILDLY different mobile app UI mockups for {{SUBJECT}} using your\n    generate_image tool.\n\n    Rules:\n    - SUBJECT is constant across all 9 — same app, same home screen (listing feed,\n      search, one primary action). ONLY the visual style varies.\n    - 9 divergent directions, e.g.: iOS glass minimal, material-you expressive,\n      neo-brutalist, dark luxury, pastel neumorphic, retro pixel, editorial serif,\n      cyberpunk neon, paper-collage tactile. Name each before generating.\n    - One generate_image call per mockup with ImageName mockup_01 ... mockup_09.\n    - Phone aspect ratio (9:19-ish), single screen per image.\n    - After each generation, use run_command to copy the artifact into\n      ./mockups/ as mockup-01.png ... mockup-09.png.\n    - If you hit an image quota error, report it immediately with the reset time\n      instead of retrying silently.\n    - Announce progress after each image.\n    ```\n\n    ## Scripted status contract (from the inspiration-board pipeline)\n\n    When driving agy from bash at scale, demand machine-readable status:\n\n    ```\n    Respond with ONLY a JSON object (no markdown, no explanation):\n    - Success:     {\"status\":\"ok\",\"path\":\"<output_path>\"}\n    - Quota error: {\"status\":\"quota_exhausted\",\"reset_seconds\":<N>,\"reset_time\":\"<ISO8601>\"}\n    - Other error: {\"status\":\"error\",\"message\":\"<description>\"}\n    ```\n\n    This is the exact contract `generate.sh` in the inspiration-board pipeline uses\n    to loop over 200 styles unattended, with a skip-if-exists guard (file > 100KB).\n    ````\n\n3.  Create the Codex run script.\n\n    ``` text\n    #!/bin/bash\n    # Fire Codex $imagegen: 9 wildly different website mockups for one subject.\n    # Usage: ./scripts/run-codex-mockups.sh \"a landing page for an indie coffee roaster\"\n    set -euo pipefail\n\n    SUBJECT=\"${1:?usage: $0 \\\"<subject, e.g. a landing page for an indie coffee roaster>\\\"}\"\n    DIR=\"$(cd \"$(dirname \"$0\")/..\" && pwd)\"\n    mkdir -p \"$DIR/mockups\"\n\n    # Extract the first fenced block from the prompt file, substitute the subject.\n    PROMPT=\"$(sed \"s/{{SUBJECT}}/$(printf '%s' \"$SUBJECT\" | sed 's/[&/\\]/\\\\&/g')/g\" \"$DIR/prompts/codex-9x-website.md\" \\\n      | awk '/^```/{f++;next} f==1')\"\n\n    echo \"── codex \\$imagegen → 9 mockups for: $SUBJECT\"\n    echo \"── output: $DIR/mockups/mockup-0{1..9}.png (watch mockups/index.html)\"\n\n    cd \"$DIR\"\n    codex exec --dangerously-bypass-approvals-and-sandbox \"$PROMPT\"\n    ```\n\n4.  Create the agy run script (note it raises `--print-timeout` to 15m — the 5m default is too short for 9 images).\n\n    ``` text\n    #!/bin/bash\n    # Fire agy (Google Antigravity CLI): 9 wildly different mobile mockups for one subject.\n    # Usage: ./scripts/run-agy-mockups.sh \"a mobile app for selling houses\"\n    set -euo pipefail\n\n    SUBJECT=\"${1:?usage: $0 \\\"<subject, e.g. a mobile app for selling houses>\\\"}\"\n    DIR=\"$(cd \"$(dirname \"$0\")/..\" && pwd)\"\n    mkdir -p \"$DIR/mockups\"\n\n    # Extract the first fenced block from the prompt file, substitute the subject.\n    PROMPT=\"$(sed \"s/{{SUBJECT}}/$(printf '%s' \"$SUBJECT\" | sed 's/[&/\\]/\\\\&/g')/g\" \"$DIR/prompts/agy-9x-mobile.md\" \\\n      | awk '/^```/{f++;next} f==1')\"\n\n    echo \"── agy generate_image → 9 mobile mockups for: $SUBJECT\"\n    echo \"── output: $DIR/mockups/mockup-0{1..9}.png (watch mockups/index.html)\"\n\n    cd \"$DIR\"\n    agy -p \"$PROMPT\" --dangerously-skip-permissions --print-timeout 15m\n    ```\n\n5.  Create the contact-sheet gallery. It polls every 5 seconds, so tiles fill in live while the run generates.\n\n    ``` text\n    <!doctype html>\n    <html lang=\"en\">\n    <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <title>9x Mockup Contact Sheet</title>\n    <style>\n      :root { color-scheme: dark; }\n      body { margin: 0; font: 14px/1.4 ui-sans-serif, system-ui; background: #0d0f12; color: #e8e6e1; }\n      header { padding: 20px 24px 8px; display: flex; align-items: baseline; gap: 12px; }\n      h1 { font-size: 18px; margin: 0; letter-spacing: .02em; }\n      header span { color: #8a8f98; font-size: 12px; }\n      .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 24px 32px; }\n      figure { margin: 0; background: #16191e; border: 1px solid #262b33; border-radius: 10px; overflow: hidden; }\n      .frame { aspect-ratio: 4 / 3; display: grid; place-items: center; background:\n        repeating-conic-gradient(#14171c 0% 25%, #101318 0% 50%) 50% / 24px 24px; }\n      .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }\n      .frame .empty { color: #4a5058; font-size: 12px; text-align: center; padding: 12px; }\n      figcaption { padding: 8px 12px; color: #b8bdc4; font-size: 12px; display: flex; justify-content: space-between; }\n      figcaption b { color: #e8e6e1; font-weight: 600; }\n      .frame img:hover { cursor: zoom-in; }\n      dialog { border: 0; padding: 0; background: transparent; max-width: 92vw; }\n      dialog img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }\n      dialog::backdrop { background: rgba(0,0,0,.8); }\n    </style>\n    </head>\n    <body>\n    <header>\n      <h1>9x Wildly Different Mockups</h1>\n      <span>same subject · nine styles · auto-refreshes every 5s while generating</span>\n    </header>\n    <div class=\"grid\" id=\"grid\"></div>\n    <dialog id=\"zoom\"><img id=\"zoomimg\" alt=\"\"></dialog>\n    <script>\n      const grid = document.getElementById('grid');\n      const zoom = document.getElementById('zoom');\n      const zoomimg = document.getElementById('zoomimg');\n      for (let i = 1; i <= 9; i++) {\n        const n = String(i).padStart(2, '0');\n        const fig = document.createElement('figure');\n        fig.innerHTML = `\n          <div class=\"frame\" data-n=\"${n}\"><div class=\"empty\">mockup-${n}.png<br>waiting…</div></div>\n          <figcaption><b>#${n}</b><span class=\"dir\" data-n=\"${n}\"></span></figcaption>`;\n        grid.appendChild(fig);\n      }\n      function tryLoad() {\n        document.querySelectorAll('.frame').forEach(frame => {\n          if (frame.querySelector('img')) return;\n          const n = frame.dataset.n;\n          const img = new Image();\n          img.src = `mockup-${n}.png?t=${Date.now()}`;\n          img.onload = () => {\n            frame.innerHTML = '';\n            frame.appendChild(img);\n            img.addEventListener('click', () => { zoomimg.src = img.src; zoom.showModal(); });\n          };\n        });\n      }\n      zoom.addEventListener('click', () => zoom.close());\n      tryLoad();\n      setInterval(tryLoad, 5000);\n    </script>\n    </body>\n    </html>\n    ```\n\n6.  Make the scripts executable and fire a run (background it — 9 images take a few minutes):\n\n    ``` text\n    chmod +x scripts/run-codex-mockups.sh scripts/run-agy-mockups.sh\n    ./scripts/run-codex-mockups.sh \"a landing page for an indie coffee roaster\"\n    # or, for mobile:\n    ./scripts/run-agy-mockups.sh \"a mobile app for selling houses\"\n    ```\n\n**Success check:** nine numbered PNGs exist and the gallery shows nine tiles — same subject, nine styles.\n\n``` text\nls mockups/mockup-0*.png\nopen mockups/index.html   # macOS; use xdg-open on Linux\n```\n\n``` text\nmockups/mockup-01.png  mockups/mockup-02.png  mockups/mockup-03.png\nmockups/mockup-04.png  mockups/mockup-05.png  mockups/mockup-06.png\nmockups/mockup-07.png  mockups/mockup-08.png  mockups/mockup-09.png\n```\n\n## Attachments — install the page skill\n\nThis is the exact `here-now-workshop-page` skill — with the Elo-voted Instrument Panel theme — that built every page in this workshop, published on this site byte-for-byte (SKILL.md plus its four `templates/` files). Download all five, then `npx skills` copies the whole folder into your project's `.agents/skills/`, `templates/` included. Two tested gotchas are baked in: `.md` URLs on here.now serve an HTML viewer, so the two markdown files must be fetched with `?raw`; and the download is staged in `./page-skill/`, not `./skills/` — the installer treats an existing `./skills/` as an agent's project skill dir and will clobber your download with a symlink.\n\n``` text\nmkdir -p page-skill/here-now-workshop-page/templates\ncurl -fsSL -o page-skill/here-now-workshop-page/SKILL.md \"https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/SKILL.md?raw\"\ncurl -fsSL -o page-skill/here-now-workshop-page/templates/agent.md \"https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/agent.md?raw\"\ncurl -fsSL -o page-skill/here-now-workshop-page/templates/index.html \"https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/index.html\"\ncurl -fsSL -o page-skill/here-now-workshop-page/templates/styles.css \"https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/styles.css\"\ncurl -fsSL -o page-skill/here-now-workshop-page/templates/app.js \"https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/app.js\"\nnpx skills add ./page-skill --skill here-now-workshop-page -y\n```\n\n## Complete reusable setup contract\n\n## Variations: 9x Mockups from One Prompt — agent setup guide\n\nFollowing this file sets up: a 9x design-mockup generator in the user's current project — two prompt files, two run scripts, and a live-updating contact-sheet gallery. One command then generates nine wildly different mockups (same subject, nine styles) into `mockups/`.\n\nPlaceholders used below: `<project-root>` = the project you are working in. All other paths are literal and relative to `<project-root>`.\n\n## Prerequisites\n\nCheck each before starting:\n\n```bash\ncommand -v codex && codex --version\ncommand -v agy && agy --version\n```\n\nExpected: at least ONE of the two prints a version. `codex` (OpenAI Codex CLI) drives the website-mockup script; `agy` (Google Antigravity CLI) drives the mobile-mockup script. If both are missing, stop and tell your user what to install. Also confirm you are in `<project-root>` and it is writable.\n\n## Steps\n\n1. Create `prompts/codex-9x-website.md` with exactly this content (the run script extracts the first fenced block and substitutes the subject):\n\n````markdown\n# Codex prompt — 9x wildly different website mockups\n\nReplace `{{SUBJECT}}` with the site you're designing (keep it constant across all 9!).\n\n```\nUse the $imagegen skill to generate 9 WILDLY different website homepage mockups\nfor {{SUBJECT}}.\n\nRules:\n- The SUBJECT stays identical in all 9 — same product, same page type\n  (homepage), same rough content (hero, nav, one CTA). ONLY the visual style\n  varies. This is what makes them comparable.\n- Pick 9 maximally divergent directions, e.g.: swiss/international typographic,\n  neo-brutalist, glassmorphic dark, editorial magazine, retro terminal,\n  playful memphis, luxury minimal, bento-grid dashboard, hand-drawn zine.\n  Name each direction before generating.\n- One built-in image_gen call per mockup (do NOT drop to the CLI fallback).\n- Desktop aspect, full homepage visible, legible headline text.\n- After each image completes, copy it from $CODEX_HOME/generated_images/\n  into ./mockups/ as mockup-01.png ... mockup-09.png (match the direction\n  order you announced).\n- Announce progress after each one — never go silent.\n- When all 9 exist, list the 9 directions next to their filenames.\n```\n\n## Follow-up (converge on a winner)\n\n```\nmockup-0N.png is the winner. Rebuild it as a real single-file HTML/CSS page at\n./winner/index.html, using the image strictly as a visual reference — real\ntext, real layout, no bitmap backgrounds.\n```\n````\n\n2. Create `prompts/agy-9x-mobile.md` with exactly this content:\n\n````markdown\n# agy (Antigravity) prompt — 9x wildly different mobile mockups\n\nReplace `{{SUBJECT}}` with the app you're designing. Historical workshop subject:\n\"a mobile app for selling houses\".\n\n```\nGenerate 9 WILDLY different mobile app UI mockups for {{SUBJECT}} using your\ngenerate_image tool.\n\nRules:\n- SUBJECT is constant across all 9 — same app, same home screen (listing feed,\n  search, one primary action). ONLY the visual style varies.\n- 9 divergent directions, e.g.: iOS glass minimal, material-you expressive,\n  neo-brutalist, dark luxury, pastel neumorphic, retro pixel, editorial serif,\n  cyberpunk neon, paper-collage tactile. Name each before generating.\n- One generate_image call per mockup with ImageName mockup_01 ... mockup_09.\n- Phone aspect ratio (9:19-ish), single screen per image.\n- After each generation, use run_command to copy the artifact into\n  ./mockups/ as mockup-01.png ... mockup-09.png.\n- If you hit an image quota error, report it immediately with the reset time\n  instead of retrying silently.\n- Announce progress after each image.\n```\n\n## Scripted status contract (from the inspiration-board pipeline)\n\nWhen driving agy from bash at scale, demand machine-readable status:\n\n```\nRespond with ONLY a JSON object (no markdown, no explanation):\n- Success:     {\"status\":\"ok\",\"path\":\"<output_path>\"}\n- Quota error: {\"status\":\"quota_exhausted\",\"reset_seconds\":<N>,\"reset_time\":\"<ISO8601>\"}\n- Other error: {\"status\":\"error\",\"message\":\"<description>\"}\n```\n\nThis is the exact contract `generate.sh` in the inspiration-board pipeline uses\nto loop over 200 styles unattended, with a skip-if-exists guard (file > 100KB).\n````\n\n3. Create `scripts/run-codex-mockups.sh` with exactly this content:\n\n```bash\n#!/bin/bash\n# Fire Codex $imagegen: 9 wildly different website mockups for one subject.\n# Usage: ./scripts/run-codex-mockups.sh \"a landing page for an indie coffee roaster\"\nset -euo pipefail\n\nSUBJECT=\"${1:?usage: $0 \\\"<subject, e.g. a landing page for an indie coffee roaster>\\\"}\"\nDIR=\"$(cd \"$(dirname \"$0\")/..\" && pwd)\"\nmkdir -p \"$DIR/mockups\"\n\n# Extract the first fenced block from the prompt file, substitute the subject.\nPROMPT=\"$(sed \"s/{{SUBJECT}}/$(printf '%s' \"$SUBJECT\" | sed 's/[&/\\]/\\\\&/g')/g\" \"$DIR/prompts/codex-9x-website.md\" \\\n  | awk '/^```/{f++;next} f==1')\"\n\necho \"── codex \\$imagegen → 9 mockups for: $SUBJECT\"\necho \"── output: $DIR/mockups/mockup-0{1..9}.png (watch mockups/index.html)\"\n\ncd \"$DIR\"\ncodex exec --dangerously-bypass-approvals-and-sandbox \"$PROMPT\"\n```\n\n4. Create `scripts/run-agy-mockups.sh` with exactly this content:\n\n```bash\n#!/bin/bash\n# Fire agy (Google Antigravity CLI): 9 wildly different mobile mockups for one subject.\n# Usage: ./scripts/run-agy-mockups.sh \"a mobile app for selling houses\"\nset -euo pipefail\n\nSUBJECT=\"${1:?usage: $0 \\\"<subject, e.g. a mobile app for selling houses>\\\"}\"\nDIR=\"$(cd \"$(dirname \"$0\")/..\" && pwd)\"\nmkdir -p \"$DIR/mockups\"\n\n# Extract the first fenced block from the prompt file, substitute the subject.\nPROMPT=\"$(sed \"s/{{SUBJECT}}/$(printf '%s' \"$SUBJECT\" | sed 's/[&/\\]/\\\\&/g')/g\" \"$DIR/prompts/agy-9x-mobile.md\" \\\n  | awk '/^```/{f++;next} f==1')\"\n\necho \"── agy generate_image → 9 mobile mockups for: $SUBJECT\"\necho \"── output: $DIR/mockups/mockup-0{1..9}.png (watch mockups/index.html)\"\n\ncd \"$DIR\"\nagy -p \"$PROMPT\" --dangerously-skip-permissions --print-timeout 15m\n```\n\n5. Create `mockups/index.html` with exactly this content (it polls every 5 seconds so tiles fill in live during generation):\n\n```html\n<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>9x Mockup Contact Sheet</title>\n<style>\n  :root { color-scheme: dark; }\n  body { margin: 0; font: 14px/1.4 ui-sans-serif, system-ui; background: #0d0f12; color: #e8e6e1; }\n  header { padding: 20px 24px 8px; display: flex; align-items: baseline; gap: 12px; }\n  h1 { font-size: 18px; margin: 0; letter-spacing: .02em; }\n  header span { color: #8a8f98; font-size: 12px; }\n  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 24px 32px; }\n  figure { margin: 0; background: #16191e; border: 1px solid #262b33; border-radius: 10px; overflow: hidden; }\n  .frame { aspect-ratio: 4 / 3; display: grid; place-items: center; background:\n    repeating-conic-gradient(#14171c 0% 25%, #101318 0% 50%) 50% / 24px 24px; }\n  .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }\n  .frame .empty { color: #4a5058; font-size: 12px; text-align: center; padding: 12px; }\n  figcaption { padding: 8px 12px; color: #b8bdc4; font-size: 12px; display: flex; justify-content: space-between; }\n  figcaption b { color: #e8e6e1; font-weight: 600; }\n  .frame img:hover { cursor: zoom-in; }\n  dialog { border: 0; padding: 0; background: transparent; max-width: 92vw; }\n  dialog img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }\n  dialog::backdrop { background: rgba(0,0,0,.8); }\n</style>\n</head>\n<body>\n<header>\n  <h1>9x Wildly Different Mockups</h1>\n  <span>same subject · nine styles · auto-refreshes every 5s while generating</span>\n</header>\n<div class=\"grid\" id=\"grid\"></div>\n<dialog id=\"zoom\"><img id=\"zoomimg\" alt=\"\"></dialog>\n<script>\n  const grid = document.getElementById('grid');\n  const zoom = document.getElementById('zoom');\n  const zoomimg = document.getElementById('zoomimg');\n  for (let i = 1; i <= 9; i++) {\n    const n = String(i).padStart(2, '0');\n    const fig = document.createElement('figure');\n    fig.innerHTML = `\n      <div class=\"frame\" data-n=\"${n}\"><div class=\"empty\">mockup-${n}.png<br>waiting…</div></div>\n      <figcaption><b>#${n}</b><span class=\"dir\" data-n=\"${n}\"></span></figcaption>`;\n    grid.appendChild(fig);\n  }\n  function tryLoad() {\n    document.querySelectorAll('.frame').forEach(frame => {\n      if (frame.querySelector('img')) return;\n      const n = frame.dataset.n;\n      const img = new Image();\n      img.src = `mockup-${n}.png?t=${Date.now()}`;\n      img.onload = () => {\n        frame.innerHTML = '';\n        frame.appendChild(img);\n        img.addEventListener('click', () => { zoomimg.src = img.src; zoom.showModal(); });\n      };\n    });\n  }\n  zoom.addEventListener('click', () => zoom.close());\n  tryLoad();\n  setInterval(tryLoad, 5000);\n</script>\n</body>\n</html>\n```\n\n6. Make the scripts executable:\n\n```bash\nchmod +x scripts/run-codex-mockups.sh scripts/run-agy-mockups.sh\n```\n\n7. Ask your user for a subject if they haven't given one (one sentence, naming the page type and its content — the subject must stay constant across all 9 mockups). **Warning — confirm before firing:** both scripts launch a paid external agent with sandboxing and approval prompts disabled (`--dangerously-bypass-approvals-and-sandbox` for codex, `--dangerously-skip-permissions` for agy). Show your user the command and make sure they are comfortable with the cost and permissions before running. Then fire a run. Prefer running it in the background and narrating progress; a full run takes several minutes.\n\n```bash\n# website mockups via Codex:\n./scripts/run-codex-mockups.sh \"a landing page for an indie coffee roaster\"\n# OR mobile mockups via agy:\n./scripts/run-agy-mockups.sh \"a mobile app for selling houses\"\n```\n\n## Success check\n\nRun:\n\n```bash\nls mockups/mockup-0*.png\nopen mockups/index.html   # macOS; use xdg-open on Linux\n```\n\nExpected observable result: nine files, `mockups/mockup-01.png` through `mockups/mockup-09.png`, and the gallery page shows nine filled tiles — the same subject rendered in nine different visual styles.\n\nReport to your user: the subject used, the nine style directions the generating agent announced, the success-check output, and anything you had to adapt.\n\n## Notes for agents\n\n- **Codex saves images to the wrong place by default.** Built-in `image_gen` output lands under `$CODEX_HOME/generated_images/`. The prompt explicitly orders a copy into `./mockups/` — if tiles stay empty but the run \"succeeded\", look there and copy manually.\n- **agy's `--print-timeout` defaults to 5 minutes** — too short for 9 images. The run script already passes `--print-timeout 15m`; keep it if you modify the script.\n- **Quota errors are real on agy.** If a run reports `quota_exhausted`, report the reset time to your user instead of retrying silently. For scripted loops, demand the JSON status contract shown at the bottom of `prompts/agy-9x-mobile.md`.\n- **Never go silent.** A prior run stalled without output and the user had to ask \"hello? What is happening?\" — narrate progress after each image, or background the run and poll.\n- **Subject drift ruins comparability.** If a mockup comes back as a different page type, regenerate that one; do not compare it.\n- **Converge afterwards.** When the user picks a winner, rebuild it with: \"mockup-0N.png is the winner. Rebuild it as a real single-file HTML/CSS page at ./winner/index.html, using the image strictly as a visual reference — real text, real layout, no bitmap backgrounds.\"\n\n## Attachment: the here-now-workshop-page skill (multi-file)\n\nThe skill that built this page — SKILL.md plus its `templates/` folder, carrying the Elo-voted Instrument Panel theme — is published on this site byte-for-byte. Gotcha: bare `.md` URLs serve here.now's HTML viewer; the two markdown files MUST be fetched with `?raw` (the .html/.css/.js files serve raw bytes as-is):\n\n- https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/SKILL.md?raw\n- https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/agent.md?raw\n- https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/index.html\n- https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/styles.css\n- https://indigo-kayak-2zw8.here.now/skills/here-now-workshop-page/templates/app.js\n\nTo install it in a project: download all five into `./page-skill/here-now-workshop-page/` (keeping the `templates/` subfolder), then run `npx skills add ./page-skill --skill here-now-workshop-page -y` — it copies the whole folder, templates included, into `./.agents/skills/here-now-workshop-page/`. Do NOT stage the download in `./skills/` — the installer treats an existing `./skills/` as an agent's project skill dir and overwrites the staged folder with a symlink, leaving an empty install (verified empirically). The exact command block is on the guide page under \"Attachments — install the page skill\".\n\n---\n\nHuman-readable version of this guide: https://indigo-kayak-2zw8.here.now/\n\nPresentation companions (for humans; no setup steps beyond this file):\n\n- https://indigo-kayak-2zw8.here.now/replay.html — Session Replay: an annotated transcript of the real sessions behind this workflow (diverge → pick with eyes → converge).\n- https://indigo-kayak-2zw8.here.now/dialogue.html — Socratic Dialogue: skeptical Q&A that lands the same prompts where each question demands them."
}
