# AppScreenDesign > AppScreenDesign (https://appscreendesign.com) is an AI agent-native 3D App Store and Google Play screenshot studio with a curated library of editable templates, real browser-and-server 3D hardware rendering, 50 store localizations, and a first-party Remote MCP Server (`https://appscreendesign.com/mcp`) + REST Editor API with $0 AI token markup. ## Quick Facts & Pricing - **Product:** Interactive 3D Visual Studio in the browser + Remote Streamable HTTP MCP Server + Scoped REST Editor API. - **Templates & Scenes:** Ready-made editable 2D, 3D, handheld and connected panoramic compositions. Every scene stays editable as structured text, device, image, vector and 3D lighting layers (`SceneDoc`) — never flattened AI pixels. - **Store Coverage:** 19 export families across iPhone 6.9", iPhone Duo (outer & inner), iPad Pro 13" (portrait & landscape), Apple Watch, Mac, Apple Vision Pro, Google Play phones/tablets, and 1024 × 500 Google Play Feature Graphics. - **Localization:** 50 App Store Connect & Google Play locales including RTL (Arabic, Hebrew) and CJK (Japanese, Korean, Simplified/Traditional Chinese) with independent per-locale copy, captures and layout overrides. - **Pricing ($0 AI Token Markup):** - **Free ($0 / forever):** Full 3D Visual Studio, ready-made template library, Remote MCP access to test AI agents, unlimited draft projects & screens, watermarked preview exports. - **Pro ($69 / year — $5.75/mo, or $19 / month):** Watermark-free store PNG/ZIP exports, unlimited projects & screens, full Remote MCP & Editor API, 50 locales, 1,000 renders/mo, own-app commercial license. - **Scale ($179 / year — $14.90/mo, or $39 / month):** Client & agency commercial license, 10,000 renders/mo, priority 3D WebGL render queue, multi-app CI/CD automation. ## Connect an AI Agent (Remote MCP & Skill) - **Remote MCP Endpoint (OAuth 2.1 + PKCE S256):** `https://appscreendesign.com/mcp` - **Claude Code Quick Connect:** `claude mcp add --transport http appscreendesign https://appscreendesign.com/mcp` - **OAuth Discovery:** `https://appscreendesign.com/.well-known/oauth-protected-resource/mcp` and `https://appscreendesign.com/.well-known/oauth-authorization-server` - **Agent Skill Bundle:** [SKILL.md](https://appscreendesign.com/downloads/appscreendesign-agent/SKILL.md) · [ZIP Archive](https://appscreendesign.com/downloads/appscreendesign-agent.zip) - **Complete LLM Reference:** [llms-full.txt](https://appscreendesign.com/llms-full.txt) ## Free Browser Tools (Zero Upload, Runs Locally) - [Screenshot Size & Alpha Channel Checker](https://appscreendesign.com/tools/screenshot-size-checker/): Verify iPhone, iPad, Watch, Mac, Vision Pro & Google Play dimensions and strip PNG alpha channels locally. - [Google Play Feature Graphic Generator](https://appscreendesign.com/tools/google-play-feature-graphic-generator/): Build and export 24-bit opaque 1024 × 500 Play Store banners with safe-zone overlays. - [App Store Preview Simulator](https://appscreendesign.com/tools/app-store-preview-simulator/): Preview iOS Search Results (first 3 portrait screens) and Product Page carousels in Light and Dark mode. - [iPhone, iPad & Mac Mockup Generator](https://appscreendesign.com/tools/iphone-mockup-generator/): Frame raw screenshots inside titanium iPhone, handheld, iPhone Duo, iPad Pro 13" and MacBook Air bezels. - [Panoramic Screenshot Splitter](https://appscreendesign.com/tools/panoramic-screenshot-splitter/): Slice wide 2x–10x canvases into store-ready 1320 × 2868 or 2064 × 2752 panels. ## Core Documentation, Templates & Specifications - [Platform Features & Capabilities](https://appscreendesign.com/features/) - [Pricing, Quotas & Commercial Licenses](https://appscreendesign.com/pricing/) - [Editable Template Library](https://appscreendesign.com/templates/) - [Reference Image to Editable Screenshots](https://appscreendesign.com/reference-to-app-store-screenshots/) - [Remote MCP Server Guide](https://appscreendesign.com/app-store-screenshot-mcp/) - [REST API Reference](https://appscreendesign.com/docs/api/) - [OpenAPI 3.1 Specification](https://appscreendesign.com/openapi.json) - [AI App Store Screenshot Generator](https://appscreendesign.com/ai-app-store-screenshot-generator/) - [2026 App Store & Google Play Screenshot Statistics & Specs](https://appscreendesign.com/app-store-screenshot-statistics/) - [Store Screenshot Size Specifications](https://appscreendesign.com/sizes/) - [iPhone Duo Outer & Inner Screenshot Sizes](https://appscreendesign.com/sizes/iphone-duo-screenshot-sizes/) - [50-Language App Store Localization](https://appscreendesign.com/localization/) - [Migrate from Figma or Fastlane Frameit](https://appscreendesign.com/migrate-from-figma-fastlane/) - [Screenshot Tool Comparisons & Alternatives](https://appscreendesign.com/compare/) - [Engineering & Workflow Guides](https://appscreendesign.com/guides/) - [About AppScreenDesign](https://appscreendesign.com/about/) - [Privacy Policy](https://appscreendesign.com/privacy/) - [Terms of Service](https://appscreendesign.com/terms/) --- ## Supported Export Families (19 Targets) - **iPhone 6.9"** (`iphone`): `1320 × 2868` px - **iPad 13"** (`ipad`): `2064 × 2752` px - **iPhone Duo (outer)** (`iphone-duo-outer`): `1398 × 2034` px - **iPhone Duo (inner)** (`iphone-duo-inner`): `2007 × 2853` px - **iPhone 6.9" landscape** (`iphone-landscape`): `2868 × 1320` px - **iPad 13" landscape** (`ipad-landscape`): `2752 × 2064` px - **Apple Watch 46mm** (`watch`): `416 × 496` px - **Mac 16:10** (`mac`): `2560 × 1600` px - **Apple Vision Pro** (`visionos`): `3840 × 2160` px - **Google Play feature graphic** (`google-feature-graphic`): `1024 × 500` px - **Android phone (portrait)** (`android-phone`): `1080 × 1920` px - **Android phone (landscape)** (`android-phone-landscape`): `1920 × 1080` px - **Android phone 1242 × 2208** (`android-phone-1242`): `1242 × 2208` px - **Android tablet (portrait)** (`android-tablet`): `1440 × 2560` px - **Android tablet (landscape)** (`android-tablet-landscape`): `2560 × 1440` px - **Android tablet 10-inch** (`android-tablet-10`): `1536 × 2048` px - **Mockup (4:3)** (`mockup-4-3`): `1920 × 1440` px - **Mockup (9:16)** (`mockup-9-16`): `1080 × 1920` px - **Mockup (16:9)** (`mockup-16-9`): `1920 × 1080` px ## Supported Store Localizations (50 Locales) Arabic (`ar-SA`), Bangla (`bn`), Catalan (`ca`), Chinese (Simplified) (`zh-Hans`), Chinese (Traditional) (`zh-Hant`), Croatian (`hr`), Czech (`cs`), Danish (`da`), Dutch (`nl-NL`), English (Australia) (`en-AU`), English (Canada) (`en-CA`), English (U.K.) (`en-GB`), English (U.S.) (`en-US`), Finnish (`fi`), French (`fr-FR`), French (Canada) (`fr-CA`), German (`de-DE`), Greek (`el`), Gujarati (`gu`), Hebrew (`he`), Hindi (`hi`), Hungarian (`hu`), Indonesian (`id`), Italian (`it`), Japanese (`ja`), Kannada (`kn`), Korean (`ko`), Malay (`ms`), Malayalam (`ml`), Marathi (`mr`), Norwegian (`no`), Odia (`or`), Polish (`pl`), Portuguese (Brazil) (`pt-BR`), Portuguese (Portugal) (`pt-PT`), Punjabi (`pa`), Romanian (`ro`), Russian (`ru`), Slovak (`sk`), Slovenian (`sl`), Spanish (Mexico) (`es-MX`), Spanish (Spain) (`es-ES`), Swedish (`sv`), Tamil (`ta`), Telugu (`te`), Thai (`th`), Turkish (`tr`), Ukrainian (`uk`), Urdu (`ur`), Vietnamese (`vi`) --- --- name: appscreendesign-agent description: Create, recreate and revise editable AppScreenDesign App Store screenshot projects from briefs, source screenshots or visual references through the AppScreenDesign REST API, SDK or MCP. Use when the task involves AppScreenDesign projects, templates, panels, editable layers, previews or exports. metadata: short-description: Build editable AppScreenDesign projects with MCP --- # AppScreenDesign Agent Use AppScreenDesign as an editable scene API. Choose transport based on what the agent has: - **REST API or SDK:** preferred when agent has `APPSCREENDESIGN_API_URL` and `APPSCREENDESIGN_API_KEY`. Read [REST API](references/rest-api.md), call documented `/v1/*` endpoints with `Authorization: Bearer`, and author complete `SceneDoc` objects. - **MCP:** preferred when host already exposes AppScreenDesign tools or when tool discovery and structured tool schemas are useful. MCP is an adapter over the same project, scene and render API; local stdio uses an API key and remote `/mcp` uses OAuth. API key authenticates requests. It does not itself teach an agent the design workflow. This skill supplies that workflow; REST endpoint schemas live in [REST API](references/rest-api.md), SDK contracts in `packages/sdk`, and MCP tool schemas in `apps/mcp/src/server.ts`. Do not upload a flattened reference or bypass editable scenes. Read only references needed for current task: - [Connection and tool map](references/tool-map.md) for MCP setup, discovery and permissions. - [REST API](references/rest-api.md) for API-key authentication, endpoint mapping and direct scene editing. - [Authoring and scene schema](references/scene-authoring.md) for editable layers and scene JSON. - [Task workflows](references/workflows.md) for template, reference, source capture and localization choices. - [Validation and recovery](references/validation.md) before previewing, exporting or handling errors. ## Routing Classify user inputs before mutating state: 1. **Visual reference only:** reproduce composition as editable layers. Do not upload reference or crops derived from it unless user explicitly requests that use. Use shapes, text, elements, devices and user-authorized artwork/captures. 2. **App screenshots supplied:** upload actual captures with REST `POST /v1/projects/:id/assets`, SDK `uploadAsset`, or MCP `upload_screenshot` / `upload_asset`, then bind them to device or image layers. Keep decorative composition editable. 3. **Existing project:** read it with `get_project`, `get_project_inputs` or `get_panel`, preserve scene metadata, then apply guarded edits. 4. **Template comparison:** use REST candidate routes/SDK comparison methods or MCP `compare_templates`, `get_candidates`, `preview_candidates` and `apply_candidate`. Comparison images are review artifacts, not final exports. 5. **Localization:** use REST localization routes/SDK methods or MCP localization tools and `locale` on each applicable read, write, upload, preview and export. Never overwrite another locale by omitting its locale. ## Required lifecycle 1. Authenticate and inspect access with REST `GET /v1/auth/me` or MCP `get_access`; never print the key. 2. Discover output requirements with REST `GET /v1/families` or MCP `list_families`. Discover templates with REST `GET /v1/templates?family=...` or MCP `list_templates`, inspect complete multi-panel template sequences with REST `GET /v1/templates/:id?family=...&panelIndex=...`, and inspect required inputs with REST `GET /v1/templates/:id/inputs?family=...` or MCP `get_template_inputs`. Discover typography, stickers, bundled artwork, and 3D/text controls via REST `GET /v1/fonts`, `GET /v1/elements`, `GET /v1/artwork`, `GET /v1/controls/text`, `GET /v1/controls/3d` (or MCP `list_fonts`, `list_elements`, `list_artwork`, `get_text_controls`, `get_3d_controls`). 3. Create or select project. Use REST `POST /v1/projects` or MCP `create_project` (or delete obsolete projects with `DELETE /v1/projects/:id` / MCP `delete_project`, and refresh pinned templates with `POST /v1/projects/:id/templates/refresh` / MCP `refresh_templates`). Use `blank-canvas` for custom layered composition; use ready template when it already expresses requested structure. 4. Establish ordered panels with REST `PUT /v1/projects/:id/panels` or MCP `set_panels`. MCP `organize_panels` handles `move`, `duplicate`, `delete`, `detach`, `connect` and `reconnect`; REST callers can also connect adjacent panels into panoramic spans with `POST /v1/projects/:id/panels/connect` or span an image across adjacent panels with `PUT /v1/projects/:id/shared-image`. Manage project assets with `GET /v1/projects/:id/assets` (`list_assets`) and `DELETE /v1/projects/:id/assets/:key` (`delete_asset`). A panel can be designed with `asset_key: null`. 5. Read each target scene with REST `GET /v1/projects/:id/panels/:position/scene` or MCP `get_panel`. Preserve `version`, `canvas`, `family`, `background`, `backgroundLayers`, `panorama`, `studio` and existing layer IDs unless task explicitly changes them. 6. Author complete scenes with REST `PUT /v1/projects/:id/panels/:position/scene` or MCP `save_panel`. Focused MCP helpers (`set_layer`, `transform_layers`, `set_background`, `set_background_layers`, `set_studio`, `set_copy`, `format_text_range`) map to REST scene/project writes; use the equivalent endpoint described in [REST API](references/rest-api.md) when MCP is unavailable. 7. Preview every panel with REST `POST /v1/projects/:id/panels/:position/preview` or MCP `preview_panel`. Fix missing images, missing copy, clipping, overlap warnings, unreadable contrast and unsafe text before export. 8. If delivery/export is requested, export with REST `POST /v1/projects/:id/render` or MCP `export_project`, using `reuse: true` and latest revision. Poll REST `GET /v1/renders/:id` or MCP `get_render`, inspect every panel using the authenticated panel route or MCP `preview_render`, then provide ZIP URL or final project link. ## Invariants - Use latest `revision` from REST project/scene responses, SDK responses, `get_project`, `get_panel` or previous mutation. REST `PATCH /v1/projects/:id`, `PUT /v1/projects/:id/panels` and `PUT /v1/projects/:id/panels/:position/scene` require `expectedRevision`. MCP focused tools may read and guard it internally. Stale writes require rereading and reconciling. - Use normalized canvas geometry for `box`: `x`, `y`, `width`, `height`. Ordinary boxes use `0..1`; layer boxes may bleed within schema bounds. Keep image source crops bounded to `0..1`. - Layer order is paint order: earlier layers are behind later layers. Build from background to frame, device/artwork, accents and text. - Keep layer IDs stable and unique. Use readable IDs such as `background`, `device-main`, `headline`, `subtitle`, `badge`, `separator`; never identify a layer by array index after edits. - Keep copy placeholders such as `{{caption.1}}` when localization or template copy should remain editable. REST `PATCH /v1/projects/:id` or MCP `set_copy` updates project copy; REST scene writes or MCP `set_layer` / `format_text_range` edit literal layer text. - Do not invent ratings, awards, product claims, testimonials, app features or source screenshots. Use verified user copy and supplied assets. If reference omits or crops content, state fidelity limit and build visible structure. - Never expose API keys, OAuth tokens, upload tickets or credential-bearing URLs in chat, logs or project text. - Treat successful save with preview error as saved. Inspect with `preview_panel` using returned revision instead of repeating mutation. ## Completion standard For a requested screenshot set, work is complete when project is saved, each requested panel has an editable scene and previews have been inspected. When final export is requested, export validation must pass and render must reach `done`. Report project ID/link, device family, locale, panel count, render ID/ZIP when applicable, and remaining fidelity limitations. --- # MCP Connection & Tool Map (tool-map.md) # Connection And Tool Map ## MCP instructions versus Codex skill The MCP server includes runtime `instructions` plus per-tool descriptions in `apps/mcp/src/server.ts`. A compliant MCP client receives those instructions after connecting and can discover schemas through `listTools`. That is guidance attached to one MCP server connection; it is not the same artifact as Codex's persistent `SKILL.md`. This skill is deliberately transport-agnostic so an API-key agent can follow the same design workflow through REST/SDK even when no MCP server is installed. ## Local stdio Local stdio describes where MCP process runs, not where AppScreenDesign API runs. MCP child process can run on customer computer and call hosted API: ```sh APPSCREENDESIGN_API_URL=https://appscreendesign.com \ APPSCREENDESIGN_API_KEY=YOUR_KEY \ node --import tsx apps/mcp/src/index.ts ``` `http://127.0.0.1:3210` is local development API default. Customer installs should use deployed HTTPS origin. Local MCP uses API key through REST calls. Remote `/mcp` uses OAuth and rejects API keys. Standalone package: `pnpm --filter @keymaker/mcp release`; Node 22+; binary `appscreendesign-mcp`. Keep key in environment variable or client secret store. Never place key in URL, project text, prompt output or logs. ## Calling tools when client has no connected MCP server First prefer AppScreenDesign tools already exposed by the host. If absent and this repository, Node dependencies, API origin and a user-authorized key are available, use a real MCP SDK client over stdio. Launch from `apps/mcp`; the child connects to the hosted API and the parent discovers tools. Configure the two `APPSCREENDESIGN_*` variables securely in the process environment. This read-only example performs no project mutation: ```js import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; const transport = new StdioClientTransport({ command: process.execPath, args: ['--import', 'tsx', 'src/index.ts'], env: { ...process.env }, }); const client = new Client({ name: 'appscreendesign-agent', version: '1.0.0' }); try { await client.connect(transport); const { tools } = await client.listTools(); console.log(tools.map(({ name }) => name)); const access = await client.callTool({ name: 'get_access', arguments: {} }); if (access.isError) throw new Error('AppScreenDesign access check failed'); } finally { await client.close(); } ``` Use returned `inputSchema` to build calls. A tool response may contain both `text` and base64 `image` content blocks; check `isError`, parse text as JSON, and inspect images without printing their base64. For edits, use the same session to call tools with arguments from discovered schemas. Never log process environment or credentials. The repository's `apps/mcp/scripts/drive.mjs` is an acceptance driver that creates and modifies projects; it is not a read-only connection check. If neither connected tools nor a runnable local server are available, report the connection limitation instead of pretending a REST call executed an MCP tool. ## Discovery tools | Tool | Purpose | | --- | --- | | `get_access` | Account, scopes, selected project IDs, expiry. | | `list_projects` | Existing projects visible to key. | | `list_families` | Output families and native canvas sizes. | | `list_templates` | Search templates by family, status or query. | | `get_template_inputs` | Sequence panels, slots, copy tokens, frame sizes, hero groups and initial panels. | | `list_frames` | Frame IDs, variants, screen sizes and 3D support. | | `list_fonts` | Self-hosted fonts, weights and text directions. | | `get_text_controls` | Outline, shadow and character-range rules. | | `get_3d_controls` | Device pose, camera, lighting, depth planes and studio constraints. | | `list_elements` | Editable catalogue elements such as stars, badges, ribbons and arrows. | | `list_artwork` | Bundled artwork, licenses and attribution. | Use `family` filters in `list_templates`. Renderer compatibility does not equal visual approval; inspect family-specific `status` and `readyFamilies`. ## Project and scene tools Use `set_shared_image` for an image crossing two adjacent independent panels. Provide a first-panel box crossing x=1 and the observed revision; the tool derives the second slice. Reapply the tool to change both slices. Existing connected panoramas use their single shared scene instead. | Tool | Use | | --- | --- | | `create_project` | New project with name, optional template, families and main locale. | | `get_project` | Project bundle, revision, panels, assets, copy and pinned templates. | | `delete_project` | Delete a project and remove its stored assets and render artifacts. | | `refresh_templates` | Re-pin a project's template snapshots to the latest published definitions. | | `get_project_inputs` | Saved requirements and assignments after edits. | | `list_assets` | List uploaded image assets and current panel bindings for a project. | | `delete_asset` | Delete an unused uploaded image asset by key from a project. | | `set_panels` | Replace ordered panel identities and per-panel edit/background data atomically. | | `organize_panels` | Move, duplicate, delete, detach, connect or reconnect stable panel units. | | `get_panel` | Complete editable `SceneDoc` for one panel plus revision and missing inputs. | | `save_panel` | Complete scene save with optional draft preview. | | `set_copy` | Positional titles and named values for a locale. | | `set_layer` | Focused patch/remove on one layer. | | `transform_layers` | Move, scale or rotate several layers together. | | `set_background` | Project/panel base background. | | `set_background_layers` | Up to eight ordered background overlays. | | `set_studio` | Shared 3D camera, lighting, shadows and studio. | | `format_text_range` | Character-level formatting using displayed UTF-16 ranges. | | `apply_template` | Switch family template while restoring saved variants. | | `apply_panel_template` | Switch one panel template and remember its variant. | ## Assets and comparisons Use `upload_screenshot` for local PNG/JPEG/static SVG actual captures or authorized artwork. Use `upload_asset` for client-hosted attachments. Use `prepare_upload` when client can POST bytes to its single-use ticket. Use `assign_asset_slot` only for slots returned by input discovery. Use `compose_image_grid` only for a declared grid recipe. Reference image itself is design input. Do not upload it or crops derived from it when recreating an editable design unless user explicitly requests that use. Actual app captures supplied separately may be uploaded and placed in device/image layers. - `compare_templates` creates immutable candidate jobs without editing saved project. - `get_candidates` polls candidate status. - `preview_candidates` returns contact sheet or exact candidate panel. - `apply_candidate` adopts successful pinned candidate atomically. - Candidate previews cannot become final store exports. ## Rendering - `preview_panel`: draft PNG; no export job; neutral defaults for missing copy. - `export_project`: immutable server export. Use `reuse: true` for current content, or stable `requestId` for one exact retry. Never combine both. - `get_render`: poll; done render includes native dimensions, SHA-256, panel URLs and ZIP path. - `preview_render`: exact stored native PNG from completed render. - `render_set` and `export_zip`: local-only rendering/writing. - `render_on_server`: server rendering for clients without local renderer. ## Permission matrix - Read project/template: `projects:read`. - Draft preview: `projects:read`, `assets:read`, `renders:create`. - Create project: `projects:create` plus all-project access. - Edit scenes/panels/copy: `projects:write`. - Upload/replace assets: `assets:write`. - Compare: `candidates:create`; apply candidate also needs `candidates:read`. - Export: `renders:create`; read/download artifacts: `renders:read`. - Selected-project keys cannot create projects. Key management requires signed-in Agent access. ## Source of truth Runtime schemas and descriptions are authoritative. In repository: `apps/mcp/src/server.ts`, `packages/schema/src/scene.ts`, `packages/schema/src/common.ts`, `docs/API.md`. Do not infer fields from generic MCP conventions. --- # REST Editor API Reference (rest-api.md) # Direct REST API And SDK ## Authentication Use the hosted API origin, never `/mcp`, for API-key calls: ```text https://appscreendesign.com ``` Every API request sends: ```http Authorization: Bearer USER_API_KEY ``` The key is a credential. Keep it in `APPSCREENDESIGN_API_KEY`, a secret manager or process environment. Never put it in a URL, browser-delivered code, scene text, logs or final response. Check access first: ```sh curl -fsS \ -H "Authorization: Bearer $APPSCREENDESIGN_API_KEY" \ https://appscreendesign.com/v1/auth/me ``` The response exposes `access.scopes`, `access.projectIds` and `access.expiresAt`. Required scopes are independent: project reads use `projects:read`; project creation uses `projects:create` and all-project access; scene edits use `projects:write`; uploads use `assets:write`; comparison creation uses `candidates:create`; server export uses `renders:create`; render reads/downloads use `renders:read`. ## REST-to-MCP mapping | Design operation | Direct API | MCP equivalent | | --- | --- | --- | | Access | `GET /v1/auth/me` | `get_access` | | Families | `GET /v1/families` | `list_families` | | Templates | `GET /v1/templates?family=iphone` | `list_templates` | | Template detail & sequence | `GET /v1/templates/:id?family=iphone&panelIndex=0` | `get_template` | | Template inputs | `GET /v1/templates/:id/inputs?family=iphone` | `get_template_inputs` | | Font catalog (17 families) | `GET /v1/fonts` | `list_fonts` | | Element/sticker catalog (17 kinds) | `GET /v1/elements` | `list_elements` | | Builtin SVG artwork catalog | `GET /v1/artwork` | `list_artwork` | | Rich text styling controls | `GET /v1/controls/text` | `get_text_controls` | | 3D hardware & studio controls | `GET /v1/controls/3d` | `get_3d_controls` | | List projects | `GET /v1/projects` | `list_projects` | | Create project | `POST /v1/projects` | `create_project` | | Read project | `GET /v1/projects/:id` | `get_project` | | Delete project | `DELETE /v1/projects/:id` | `delete_project` | | Refresh pinned templates | `POST /v1/projects/:id/templates/refresh` | `refresh_templates` | | Read saved inputs | `GET /v1/projects/:id/inputs?family=iphone` | `get_project_inputs` | | List uploaded assets | `GET /v1/projects/:id/assets` | `list_assets` | | Delete unused asset | `DELETE /v1/projects/:id/assets/:key` | `delete_asset` | | Compose mosaic image grid | `POST /v1/projects/:id/image-grid` | `compose_image_grid` | | Set panels | `PUT /v1/projects/:id/panels` | `set_panels` | | Connect adjacent panels into panorama | `POST /v1/projects/:id/panels/connect` | `organize_panels` (`action: "connect"`) | | Update project copy/background | `PATCH /v1/projects/:id` | `set_copy` / `set_background` | | Read scene | `GET /v1/projects/:id/panels/:position/scene` | `get_panel` | | Save scene | `PUT /v1/projects/:id/panels/:position/scene` | `save_panel` | | Place one image across two independent panels | `PUT /v1/projects/:id/shared-image` | `set_shared_image` | | Draft preview | `POST /v1/projects/:id/panels/:position/preview` | `preview_panel` | | Final export | `POST /v1/projects/:id/render` | `export_project` | | List project exports | `GET /v1/projects/:id/renders` / `GET /v1/renders` | `list_renders` | | Poll export | `GET /v1/renders/:id` | `get_render` | | Final PNG | `GET /v1/renders/:id/panels/:position` | `preview_render` | | Final ZIP | `GET /v1/renders/:id/zip` | `preview_render` metadata / download | Further routes: `POST /v1/projects/:id/template/apply` applies a template; `POST /v1/projects/:id/panels/:position/template` changes one panel (`sceneIndex` selects a panel from `sequence`); `POST /v1/projects/:id/candidates` starts a comparison; `GET /v1/candidates/:id` polls it; `POST /v1/projects/:id/candidates/:candidateId/apply` saves a choice. `GET/POST /v1/projects/:id/localizations` and `GET/PUT /v1/projects/:id/localizations/:locale` manage locales. Account management routes (session-authenticated) include `POST /v1/auth/password/change` and `DELETE /v1/auth/me`. Use the current repository `docs/API.md` for complete schemas and additional routes. MCP convenience tools do not create a separate design system. They validate, transform and route the same project and scene data. When using REST, replace convenience tools with a guarded project or complete scene write; do not invent a different JSON model. For an image spanning two adjacent independent panels, send `expectedRevision`, `family`, `startPosition` and an `image` layer to `PUT /v1/projects/:id/shared-image`. Set the image box in first-panel units, for example `{"x":0.8,"y":0.25,"width":0.6,"height":0.7}`. The API calculates the second slice and commits both together. Reapply the operation to move or resize both; individual edits do not propagate. For already connected panorama panels, edit their shared scene instead. Preview both sides and inspect their joined edges. ## Discovery Before creating a project: ```sh BASE="${APPSCREENDESIGN_API_URL:-https://appscreendesign.com}" AUTH=(-H "Authorization: Bearer $APPSCREENDESIGN_API_KEY") curl -fsS "${AUTH[@]}" "$BASE/v1/families" curl -fsS "${AUTH[@]}" "$BASE/v1/templates?family=iphone" curl -fsS "${AUTH[@]}" "$BASE/v1/templates/headline-device/inputs?family=iphone" ``` Use the selected template's `compatibleFamilies`, family-specific `status`, `readyFamilies`, `tokens`, `heroPanels`, `uses3d` and `initialPanels`. Do not assume a template is visually approved because it is renderer-compatible. Do not guess capture slot names or device frame IDs. ## Create project and panels Create a custom project: ```sh curl -fsS "${AUTH[@]}" -X POST "$BASE/v1/projects" \ -H 'content-type: application/json' \ -d '{"name":"Your app — Editable Set","templateId":"blank-canvas","families":["iphone"],"mainLocalization":"en-US"}' ``` The response contains `id` and initial `revision`. A blank project can contain designed panels with no screenshot. Save ordered panel identity rows with `PUT /v1/projects/:id/panels`: ```json { "expectedRevision": 0, "panels": [ {"position": 1, "family": "iphone", "screen": "Feature", "asset_key": null, "theme": "light", "template_id": "blank-canvas", "edits": {}}, {"position": 2, "family": "iphone", "screen": "Result", "asset_key": null, "theme": "light", "template_id": "blank-canvas", "edits": {}} ] } ``` Preserve returned panel IDs, `scene_index`, `hero_group`, `slots`, `template_id`, `edits`, `background` and `family` when updating an existing panel list. Use `organize_panels` through MCP or the corresponding panel transformation logic rather than rebuilding a saved list from current catalog discovery. ## Editable scene API Read a scene: ```http GET /v1/projects/:projectId/panels/:position/scene?family=iphone&locale=en-US ``` The response provides `scene`, `revision`, `linkedPositions`, `copy`, `previewCopy`, `missingCopy` and `missingImages`. Modify only intended scene fields and save the complete `scene`: ```http PUT /v1/projects/:projectId/panels/:position/scene Authorization: Bearer USER_API_KEY Content-Type: application/json { "expectedRevision": 3, "family": "iphone", "locale": "en-US", "scene": { "version": 1, "canvas": {"width": 1320, "height": 2868}, "family": "iphone", "background": {"type": "solid", "color": "#FFFFFF"}, "layers": [] } } ``` Use the actual returned SceneDoc. Preserve `backgroundLayers`, `panorama`, `studio`, existing layer properties and asset bindings. The server rejects invalid fields and stale revisions before changing state. `PUT /panels/:position/scene` updates linked hero slices atomically where applicable. For a focused edit without MCP's `set_layer`, reread the scene, locate layer by stable `id`, merge the intended patch in agent code, then write the complete scene with the same guard. Do not patch a project-level `edits` field; layer edits belong to panel scenes. ## Preview and final render Draft preview: ```http POST /v1/projects/:projectId/panels/:position/preview Content-Type: application/json {"expectedRevision":3,"family":"iphone","locale":"en-US","maxSide":900} ``` The response is PNG bytes. Verify `X-Content-SHA256`; inspect URL-decoded `X-Preview-Metadata` for revision, dimensions, missing inputs and warnings. Draft defaults in `previewCopy` do not become saved copy. Final export: ```http POST /v1/projects/:projectId/render Content-Type: application/json {"family":"iphone","locale":"en-US","reuse":true,"expectedRevision":3} ``` Poll `GET /v1/renders/:id` until `status` is `done` or `failed`. For a done render, download authenticated `/panels/:position` and `/zip`, verify each panel SHA-256 against manifest and inspect every native PNG. `reuse: true` is for current content; a stable `requestId` retries one exact immutable snapshot. Never send both. ## Actual captures and upload tickets Upload only actual app captures or authorized artwork: ```http POST /v1/projects/:projectId/assets?key=capture.home&screen=Home&theme=dark Authorization: Bearer USER_API_KEY Content-Type: application/octet-stream ``` For a client that cannot send bytes with the API key, call `POST /v1/projects/:id/upload-ticket`; POST raw bytes once to returned single-use URL. The ticket expires after ten minutes and failed validation consumes it. A reference image used only to guide recreation is not a capture asset; build its structure with layers. ## SDK option For TypeScript agents, `@keymaker/sdk` wraps the same API and verifies image hashes. Core mapping: ```ts import { KeymakerClient } from '@keymaker/sdk'; const client = new KeymakerClient({ baseUrl: process.env.APPSCREENDESIGN_API_URL!, apiKey: process.env.APPSCREENDESIGN_API_KEY!, }); const templates = await client.templates({ family: 'iphone' }); const created = await client.createProject({ name: 'Your app', templateId: 'blank-canvas', families: ['iphone'] }); const panel = await client.panelScene(created.id, 1, 'iphone'); panel.scene.background = { type: 'solid', color: '#E7F5EF' }; const saved = await client.savePanelScene(created.id, 1, panel.revision, panel.scene, 'iphone'); const draft = await client.previewPanel(created.id, 1, saved.revision, { family: 'iphone' }); const job = await client.exportProject(created.id, { family: 'iphone', reuse: true, expectedRevision: saved.revision }); const render = await client.waitForRender(job.id); const png = await client.downloadPanel(render, 1); ``` This changes only the background to demonstrate an editable scene write; add the requested editable text, shapes, devices and other layers before treating a design as complete. Inspect the draft and final PNG visually. Use SDK `listProjects`, `deleteProject`, `getTemplate`, `listFonts`, `listElements`, `listArtwork`, `getTextControls`, `get3dControls`, `project`, `projectInputs`, `templateInputs`, `setPanels`, `connectPanels`, `setSharedImage`, `refreshTemplates`, `patchProject`, `uploadAsset`, `listAssets`, `deleteAsset`, `composeImageGrid`, `prepareUpload`, `compareTemplates`, `applyCandidate`, `localization*`, `listRenders`, `waitForRender`, `downloadPanel` and `downloadZip` for larger agents. SDK does not remove revision guards; it makes request construction and hash verification safer. The repository SDK package is private and, at the time of the repository documentation, is not published to npm. Use an existing installed package or build an installable tarball with `pnpm --filter @keymaker/sdk release`; do not assume registry availability. --- # Editable SceneDoc & Layer Schema (scene-authoring.md) # Scene Authoring For direct REST access, replace `get_panel` with `GET /v1/projects/:id/panels/:position/scene` and `save_panel` with `PUT` to that same route. REST and MCP use the same `SceneDoc`. See [REST API](rest-api.md) for payloads and preview/export endpoints. Discover fonts, elements, bundled artwork, text controls and 3D controls via REST (`GET /v1/fonts`, `GET /v1/elements`, `GET /v1/artwork`, `GET /v1/controls/text`, `GET /v1/controls/3d`) or MCP (`list_fonts`, `list_elements`, `list_artwork`, `get_text_controls`, `get_3d_controls`). ## Read before editing `get_panel` returns `scene`, `revision`, `linkedPositions`, `copy`, `previewCopy`, `missingCopy` and `missingImages`. Modify returned scene, preserve its metadata and send complete scene to `save_panel` with current `expectedRevision`. Canvas, family, version and panorama metadata cannot be changed through this endpoint. Linked hero slices can update together. Layers paint in array order, first behind later layers. Layer `box` uses canvas fractions: x/width relative to canvas width; y/height relative to canvas height. Layer boxes can bleed beyond canvas; source crops and clip boxes remain bounded. IDs must be stable and unique within the scene. ## Shape Use editable shapes for color fields, borders, curves and separators. `kind` accepts `rect`, `rounded-rect`, `ellipse`, `line`, `path`. `fill` takes a color; `fillGradient` takes a gradient, radial or corners background. `strokeWidth` is a fraction of canvas width; rounded-rectangle `radius` is a fraction of box height. A path starts with an `M` command and supports `L`, `C`, `Z` in local box coordinates. ```json { "type": "shape", "id": "bottom-band", "name": "Bottom band", "kind": "rounded-rect", "box": {"x": 0, "y": 0.70, "width": 1, "height": 0.30}, "radius": 0.06, "fill": "#147A4D" } ``` ## Text & Rich Text Styling Use text layers for editable headlines, subtitles, labels and callouts. `style.size` is a fraction of canvas height. Discover available fonts and weights with `GET /v1/fonts` or `list_fonts`; use `GET /v1/controls/text` or `get_text_controls` for outlines, shadows, highlights and character emphasis. `align` is `left`, `center`, `right`; `valign` is `top`, `middle`, `bottom`; `fit` is `none`, `shrink`, `wrap`. ### Font Catalog (17 Font Families) Self-hosted font families and their supported weights (discoverable via `GET /v1/fonts` / `list_fonts`): | Font Family / Slug | Category | Weights | Italic | Notes | | --- | --- | --- | --- | --- | | `Inter` (`inter`) | sans | `400, 500, 600, 700, 800` | no | Clean UI & body sans | | `Plus Jakarta Sans` (`plus-jakarta-sans`) | sans | `500, 600, 700, 800` | no | Modern geometric sans | | `DM Sans` (`dm-sans`) | sans | `400, 500, 700` | no | Friendly humanist sans | | `Space Grotesk` (`space-grotesk`) | display | `500, 700` | no | Technical display sans | | `Outfit` (`outfit`) | sans | `400, 600, 700, 800` | no | Geometric display sans | | `Sora` (`sora`) | sans | `400, 600, 700, 800` | no | Crisp contemporary sans | | `Bricolage Grotesque` (`bricolage-grotesque`) | display | `600, 700, 800` | no | Expressive editorial grotesque | | `Syne` (`syne`) | display | `700, 800` | no | Wide avant-garde display | | `Fraunces` (`fraunces`) | serif | `600, 700` | yes | Soft old-style display serif | | `Instrument Serif` (`instrument-serif`) | serif | `400` | yes | High-contrast editorial serif | | `Playfair Display` (`playfair-display`) | serif | `600, 700, 800` | yes | Classic luxury serif | | `Cormorant Garamond` (`cormorant-garamond`) | serif | `500, 600, 700` | yes | Classical literary serif | | `Newsreader` (`newsreader`) | serif | `500, 600, 700` | yes | Editorial publication serif | | `JetBrains Mono` (`jetbrains-mono`) | mono | `500, 700` | no | Developer & metric monospace | | `Lilita One` (`manrope` / `urbanist` / `unbounded` display slots) | display | `400` | no | Bold playful headline display | | `Fredoka` | display | `600, 700` | no | Rounded friendly display | | `Titan One` | display | `400` | no | Heavy poster display | *(Catalog identifiers referenced across templates and skills also include `manrope`, `inter`, `plus-jakarta-sans`, `dm-sans`, `space-grotesk`, `outfit`, `sora`, `urbanist`, `fraunces`, `instrument-serif`, `playfair-display`, `cormorant-garamond`, `newsreader`, `syne`, `unbounded`, `bricolage-grotesque`, and `jetbrains-mono`; always verify exact `family` names via `GET /v1/fonts`.)* ### Rich Text Controls - **`style.highlight`**: `{ background, color?, radius?, paddingX?, paddingY? }` draws a rounded pill behind wrapped lines (`highlightRadius`, `highlightPaddingX`, `highlightPaddingY` in font-size units `0..1`). - **`style.outline`**: `{ color, width }` strokes glyphs cleanly behind the fill (`width` `0..24`). - **`style.shadow`**: `{ color, blur, offsetX, offsetY }` adds a drop shadow behind glyphs. - **`layer.emphasis`**: array of `{ start, end, color?, weight?, italic?, underline?, highlightColor?, highlightRadius?, highlightPaddingX?, highlightPaddingY?, scale? }` styles UTF-16 character ranges (`start` inclusive, `end` exclusive) within a single text layer without splitting a sentence into separate layers. - **`style.letterSpacing`**: tracking in pixels (`-10..60`). - **`style.uppercase`**: boolean transforming resolved text before layout. - **`allowOverlapWith`**: array of layer IDs (e.g. `["device-main"]`) permitting intentional editorial overlap while keeping validation strict. ```json { "type": "text", "id": "headline", "name": "Headline", "content": "{{caption.1}}", "box": {"x": 0.08, "y": 0.08, "width": 0.84, "height": 0.16}, "style": { "fontFamily": "Plus Jakarta Sans", "size": 0.056, "weight": 800, "color": "#FFFFFF", "lineHeight": 1.04, "letterSpacing": -1, "uppercase": false, "highlight": {"background": "#1F4BD8", "color": "#FFFFFF", "radius": 18, "paddingX": 18, "paddingY": 8}, "outline": {"color": "#0A1022", "width": 4}, "shadow": {"color": "#00000066", "blur": 20, "offsetX": 0, "offsetY": 8} }, "emphasis": [ {"start": 0, "end": 7, "color": "#FBBF24", "weight": 800, "italic": true, "underline": false, "highlightColor": "#1E293B", "scale": 1.05} ], "allowOverlapWith": ["device-main"], "align": "center", "valign": "middle", "fit": "shrink" } ``` Preserve tokenized content when copy should remain localized. Literal text is appropriate for independent fixed reference text. Use `set_copy` for positional titles and named values. `format_text_range` uses zero-based UTF-16 offsets in displayed text after token substitution, with end exclusive. ## Image & Builtin Screen Artwork Image layers use `src`, `box` and `fit` (`cover`, `contain`, `stretch`, `tile`); optional fields include `crop` (`{x, y, width, height}` in `0..1`), `radius` (corner radius), `rotation`, `tint`, `shadow` (`{color, blur, offsetX, offsetY}`) and `allowOverlapWith`. `src` identifies an uploaded asset key or a bundled `builtin:*` SVG artwork key. ### Builtin SVG Artwork Keys (`GET /v1/artwork` / `list_artwork`) Selectable commercial-safe `builtin:*` SVG artwork keys (11+ bundled keys): 1. `builtin:analytics-surge` — Analytics Surge card backdrop 2. `builtin:aurora-glass` — Aurora Glass mesh backdrop 3. `builtin:coral-sunrise` — Coral Sunrise warm gradient field 4. `builtin:cobalt-grid` — Cobalt Grid technical backdrop 5. `builtin:emerald-waves` — Emerald Waves layered curves 6. `builtin:editorial-paper` — Editorial Paper warm grain field 7. `builtin:noir-spotlight` — Noir Spotlight dark radial stage 8. `builtin:prism-ribbon` — Prism Ribbon glass waves 9. `builtin:sunset-dunes` — Sunset Dunes warm horizon waves 10. `builtin:badge-apple-design` — Award Seal vector graphic 11. `builtin:sticker-new` — "NEW" Pill vector sticker *(Preview-only placeholder keys `builtin:icon-spark`, `builtin:logo-placeholder`, `builtin:avatar-duo` must be replaced with uploaded or selectable artwork before final export.)* ## Device & 3D Studio Schema Device layers use `type: "device"`, `kind: "frame"` or `"3d"` (corresponding to conceptual `device.renderer: 'procedural-2d' | '3d'`), discovered `frame`, `screen` asset key, optional `variant`, and `screenFit: "cover"` or `"contain"`. Use `list_frames` or `GET /v1/controls/3d` to find frame IDs, variants and 3D hardware support. ### 3D Device & Studio Fields (`GET /v1/controls/3d` / `get_3d_controls`) - **Renderer / Mode**: `kind: "3d" | "frame"` (or `renderer: "3d" | "procedural-2d"`). - **Pose & Perspective (`rotate3d` / `pose`)**: - `rotate3d`: `{ pitch: -55..55, yaw: -55..55, roll: -45..45 }` (pose angles in degrees). - `fov`: perspective field of view `18..55` (default `28`). - `depthScale`: extrusion thickness multiplier `0.4..2.2` (default `1`). - `lidAngle`: `70..135` degrees (default `112`, for articulated MacBook Pro 3D hardware). - **Body & Material (`material` / `body`)**: - `material`: `{ finish: "metallic" | "matte" | "gloss" | "titanium" | "glass" | "clay", bodyColor?, rimColor?, tint?: 0..1, metalness?: 0..1, roughness?: 0..1, clearcoat?: 0..1, reflectivity?: 0..1 }`. - `bezelColor`: hex color override for device bezel, `bezelWidth`: `0.25..2.5` multiplier. - Conceptual body customization also maps `finish`, `tint`, `bezelColor`, `rimColor`, `backColor`, `caseStyle`, `caseColor`, and `customFrameAssetId`. - **Per-Device Lighting & Contact Shadow**: - `keyLight`: `{ azimuth: -180..180, elevation: 5..85, intensity: 0..2.5, color }`. - `ambientIntensity`: `0..1.5`, `rimIntensity`: `0..2`, `environmentIntensity`: `0..2`. - `contactShadow`: `{ opacity: 0..0.95, blur: 0..160, scale: 0.3..1.8, offsetX: -0.35..0.35, offsetY: -0.35..0.35, color }`. - **Shared Scene Studio (`scene.studio`)**: - `preset`: `"soft-studio" | "dramatic-rim" | "warm-editorial" | "cool-key" | "high-key"`. - `keyLight`, `fillLight`, `rimLight`: `{ azimuth, elevation, intensity, color }`. - `ambientIntensity`, `environmentIntensity`. - `shadow`: `{ opacity, blur, scale, offsetX, offsetY, color }` (plus studio lighting & backdrop configuration). - Shared studio devices and graphic/text `studioPlane` layers must be consecutive in layer order. To show a person holding an editable iPhone, use `iphone-18-pro-max-handheld` with `variant: "black"`, `kind: "frame"` and the screenshot asset key in `screen`. ## Element / Sticker Catalog (17 Kinds) Use `GET /v1/elements` or `list_elements` to discover editable vector elements. An element layer uses `type: "element"`, `element`, `box`, `fill`, `accentFill`, `stroke`, and optional `label`, `labelSize`, `labelColor`, `labelStyle`, `labelAlign`, `labelEmphasis`, plus laurel customization props (`spread`, `density`): | Element ID | Semantic Kind / Alias | Category | Description & Special Props | | --- | --- | --- | --- | | `stars-5` | `star-rating` | rating | Five five-pointed rating stars in a row | | `laurel-award` | `laurel-wreath` / `editors-choice` | award | Award laurel wreath with center label area (supports laurel `spread` and `density` styling) | | `seal-burst` | `award-seal` | award | Multi-point serrated award seal | | `crown` | `award-crown` | award | Three-peak editorial crown | | `shield-check` | `trust-shield` | award | Trust and security shield with checkmark | | `badge-pill` | `trust-pill` / `notification-pill` | badge | Rounded capsule callout badge | | `ribbon-banner` | `editorial-ribbon` | badge | Folded ribbon banner for callouts | | `check-circle` | `check-badge` | badge | Circular verification badge with checkmark | | `number-ring` | `stat-card` | badge | Ring badge for step numbers (`1`, `2`, `3`) or KPI stats | | `arrow-curve` | `arrow-flourish` | pointer | Curved hand-drawn callout arrow | | `arrow-straight` | `arrow-pointer` | pointer | Clean directional arrow | | `sparkle-4` | `sparkle-burst` | accent | Four-point editorial star / AI sparkle cluster | | `quote-mark` | `quote-card` | accent | Large editorial opening quotation mark | | `heart-burst` | `social-heart` | accent | Rounded heart for social proof | | `bolt` | `speed-bolt` | accent | Lightning bolt for speed/instant actions | | `globe-grid` | `global-grid` | accent | Latitude/longitude globe for localization | | `waveform` | `audio-waveform` | accent | Symmetric audio/voice bar waveform | ## Concrete Visual Recipes ### 1. Custom Colored Device Bezel Place a `rounded-rect` `shape` layer directly behind the `device` layer (earlier in `scene.layers[]`, i.e., `zIndex: device.zIndex - 1`) with `allowOverlapWith: [device.id]`, or set `bezelColor` and `bezelWidth` directly on the `device` layer: ```json [ { "type": "shape", "id": "custom-bezel-halo", "kind": "rounded-rect", "box": {"x": 0.125, "y": 0.215, "width": 0.75, "height": 0.73}, "radius": 0.085, "fill": "#38BDF8", "allowOverlapWith": ["device-main"] }, { "type": "device", "id": "device-main", "kind": "3d", "frame": "iphone-16-pro-max", "screen": "capture.home", "bezelColor": "#0F172A", "bezelWidth": 1.15, "allowOverlapWith": ["custom-bezel-halo"] } ] ``` ### 2. Floating UI Cards / Screen Crop Cutouts Create an `image` layer referencing an uploaded capture (`src: "capture.home"`), crop to the UI widget (`crop: {x, y, width, height}` in `0..1`), round its corners (`radius`), add a deep elevation `shadow`, and declare `allowOverlapWith: ["device-main"]` so it floats cleanly above the phone hardware: ```json { "type": "image", "id": "floating-stat-cutout", "name": "Floating KPI Card", "src": "capture.home", "fit": "cover", "box": {"x": 0.52, "y": 0.56, "width": 0.42, "height": 0.16}, "crop": {"x": 0.06, "y": 0.28, "width": 0.88, "height": 0.22}, "radius": 28, "shadow": {"color": "#00000055", "blur": 36, "offsetX": 0, "offsetY": 18}, "allowOverlapWith": ["device-main"] } ``` ### 3. Multi-Panel Panoramic Connected Spans 1. Connect adjacent panels (e.g. panels 1 and 2) using REST `POST /v1/projects/:id/panels/connect` (`{"expectedRevision": rev, "family": "iphone", "positions": [1, 2], "groupId": "hero-span"}`) or MCP `organize_panels` (`action: "connect"`, `positions: [1, 2]`). 2. Or span an image layer across two adjacent independent panels using REST `PUT /v1/projects/:id/shared-image` (or SDK `setSharedImage` / MCP `set_shared_image`): ```json { "expectedRevision": 4, "family": "iphone", "startPosition": 1, "image": { "type": "image", "id": "panoramic-hero-shot", "src": "capture.wide", "fit": "cover", "box": {"x": 0.55, "y": 0.24, "width": 0.90, "height": 0.64}, "radius": 24 } } ``` ### 4. Using Multi-Panel Templates (`sequence`) 1. Inspect the full multi-panel template sequence with `GET /v1/templates/:id?family=iphone` (or SDK `client.getTemplate(id, 'iphone')`). 2. Inspect `sequence[]` (each entry includes `panelIndex`, resolved `scene`, and `validation`) and `connectGroups`. 3. Apply a specific template panel index to a project screen with `POST /v1/projects/:id/panels/:position/template` (`{"expectedRevision": rev, "locale": "en-US", "family": "iphone", "templateId": id, "sceneIndex": panelIndex}`) or apply the whole template with `POST /v1/projects/:id/template/apply`. --- # Agent Design & Localization Workflows (workflows.md) # Task Workflows The tool names below describe the MCP interface. When using an API key directly, use the REST/SDK equivalents in [REST API](rest-api.md); MCP does not need to be installed. For focused scene changes, REST callers read the complete scene, edit it, then save the complete scene with `expectedRevision`. MCP-only helpers such as `organize_panels` have no single REST tool endpoint and require equivalent careful panel-list transformations. ## New editable project from visual reference 1. Inspect reference at sufficient resolution. Record visible panel count, output family, orientation, each panel's color, frame, image region, typography, exact visible copy and intentional overlaps. Note partial or obscured panels separately. 2. Separate reference from actual app captures. If user supplied captures as separate intended inputs, upload them. If reference is the only image, do not upload it or derived crops for an editable recreation unless user explicitly requests that use. 3. Call `get_access`, `list_families`, `list_templates` with target family, then `get_template_inputs`. Choose a ready template only if its structure fits; use blank canvas for custom compositions. 4. Call `create_project`. Use `set_panels` for independent ordered panels with meaningful screen names; `asset_key: null` supports designed panels without a screenshot. 5. Establish proportions from reference: estimate normalized positions and dimensions for frame, image, separator, caption and card. Discover fonts and editable elements. Use vector paths for curved boundaries, not rectangular substitutes when curve is central to design. 6. Call `get_panel` for each position. Build separate shapes, text, elements and optional device/image layers. Preserve scene metadata. Use stable, meaningful IDs. If no original captures are available, leave a clearly identified screen placeholder or omit missing content; never represent crude invented gameplay as an exact recreation. 7. Save and preview one representative panel first. Compare its geometry, crop, colors and type to reference, refine, then propagate shared decisions across other panels. Save each scene using latest revision; inspect every preview and correct geometry, text, layer order, clipping and contrast. 8. Export and inspect final PNGs if final deliverables are part of request. Report source fidelity limits, including incomplete reference panels and missing original captures. ## Project from actual app captures 1. Discover exact capture slots, frame screen dimensions, panel count and linked groups using `get_template_inputs`. 2. Create project with chosen template/family. Upload each actual capture under stable keys such as `capture.home` and `capture.features`. 3. Bind captures through discovered slots using `assign_asset_slot`, `set_panels` or `apply_template`. Do not guess slot names. 4. Use `get_panel` to edit composition and text while preserving device `screen` bindings. Set copy with `set_copy`. 5. Preview every panel, resolve missing inputs and export if requested. ## Template comparison 1. Read project and revision; discover compatible candidates and each candidate's input contract. 2. Use authorized owned capture keys. Call `compare_templates` with `expectedRevision`, stable `requestId`, family, locale, ordered capture keys and 1–8 candidates. 3. Poll same candidate ID via `get_candidates`. Inspect contact sheet with `preview_candidates`, then exact panels for finalists. 4. Apply only a successful choice using `apply_candidate` and expected revision. If project or source assets changed, make a fresh comparison. Candidate previews cannot be delivered as store exports. ## Existing project edit 1. Read project or target panel immediately before editing; identify target by stable layer ID, not layer array position. 2. Use `set_layer` for one-layer edits, `transform_layers` for coordinated geometry, `format_text_range` for character formatting and `save_panel` for broader scene edits. 3. Preserve unrelated panels, assets, copy, locale and linked hero members. Preview affected panels. ## Localization 1. Call `list_localizations`; inspect existing locales. Add with `add_localizations`, optionally `fillFromMain` for one-time copy. 2. Read with `get_localization` or `get_localization_documents`. Translate supplied copy without inventing claims. Keep design and image bindings unless locale requires a change. 3. Upload authorized locale-specific captures with locale metadata. Save with `save_localization` or `save_localization_documents` using current revision. 4. Preview and export with locale explicitly passed. Fill does not maintain live inheritance or translate automatically. ## Panel organization & multi-panel recipes Use `organize_panels` to move, duplicate, delete, detach, connect or reconnect panels while preserving identities and bindings (or REST `POST /v1/projects/:id/panels/connect` to connect adjacent panels into a panoramic span). Use `set_panels` for a complete ordered panel list or initializing independent panels. Panorama hero members are linked and must remain consecutive in original viewport order unless deliberately detached. ### Visual Recipes Quick Reference 1. **Custom Colored Device Bezel:** Place a `rounded-rect` `shape` layer immediately before the `device` layer in `scene.layers[]` (`zIndex: device.zIndex - 1`) with `allowOverlapWith: [device.id]`, or configure `bezelColor` and `bezelWidth` on the `device` layer. 2. **Floating UI Cards / Screen Crop Cutouts:** Add an `image` layer referencing a screen capture (`src`), set normalized `crop` (`{x, y, width, height}`), round corners with `radius`, add `shadow`, and set `allowOverlapWith: [device.id]`. 3. **Multi-Panel Panoramic Connected Spans:** Connect adjacent panels via `POST /v1/projects/:id/panels/connect` (or MCP `organize_panels` with `action: "connect"`), or span a single image across two adjacent independent panels via `PUT /v1/projects/:id/shared-image` (`set_shared_image`). 4. **Using Multi-Panel Templates:** Call `GET /v1/templates/:id?family=iphone` (`get_template`) to inspect `sequence[]` (each panel's `panelIndex`, `scene`, and `validation`) and `connectGroups`, then apply individual sequence screens via `POST /v1/projects/:id/panels/:position/template` (`apply_panel_template` with `sceneIndex`) or apply the full sequence via `POST /v1/projects/:id/template/apply` (`apply_template`). --- # Validation, Preview & Export Rules (validation.md) # Validation And Recovery Tool names below are MCP names; REST and SDK callers use the matching endpoints/methods in [REST API](rest-api.md). REST save responses and draft previews are separate calls. ## Preview loop After each coherent edit batch: 1. Read current revision if another operation may have changed project. 2. Save scene or focused edit with expected revision. 3. Call `preview_panel` for every affected position, with `maxSide` between 240 and 1600. 4. Inspect metadata: revision, dimensions, missing copy, missing images and warnings. 5. Inspect image: text wrapping, device crop, margins, contrast, borders, divider continuity, layer order and intended overlap. 6. Fix problems and preview again. Draft PNGs are review images, not proof of final native bytes. ## Export loop 1. Confirm requested panels and family count are valid. Complete or deliberately omit unresolved copy and missing assets. 2. Call `export_project` with `reuse: true`, family, locale and latest expected revision. 3. Poll same render ID via `get_render` until `done` or `failed`. 4. If `done`, inspect every panel with `preview_render`. Native PNG hash matches same render ID's ZIP member. Deliver project link and, when useful, authenticated ZIP URL; do not substitute draft or comparison URL. ## Common failures - `401`: key missing, expired, revoked or wrong password (`invalid_credentials`). Inspect access without printing key. - `403 origin_forbidden`: browser-session mutating request came from an untrusted `Origin` or cross-site context. - `403 scope_forbidden`: key lacks scope; owner must grant required access. - `403 project_scope_forbidden`: selected-project key cannot create projects. - `404`: resource absent or outside allowed ownership/project selection. - `409 revision_conflict`: reread project or panel; reconcile intended change on fresh scene. Do not blindly replay a stale full scene. - `428 revision_required`: send latest revision as `expectedRevision`. - `400 invalid`: inspect field path and runtime schema; fix payload before retry. - `409 request_id_conflict`: use a new ID for deliberately changed candidate input; same ID is only for retrying same snapshot. - `429`: respect `Retry-After`; retry preview or polling without repeating a committed write. - `422 render_failed`: read failure details, fix named panel/layer/missing input (or add `allowOverlapWith` for intentional editorial overlaps), then export current revision again. `save_panel` can return `saved: true` plus `previewError`. This means write succeeded; call `preview_panel` with returned revision instead of repeating save. If a mutation times out and its outcome is uncertain, reread project and reconcile before any retry. ## Visual and fidelity review Check text collisions, clipped content, unresolved tokens, image warnings, transparency, device/frame compatibility, studio ordering and panel continuity. Fix underlying composition; do not merely suppress warnings or delete desired content. Separate design fidelity (palette, spacing, typography, borders and hierarchy) from source fidelity (exact app pixels, illustrations and logos). A reference alone can guide design, but exact source fidelity requires actual source captures/artwork. State limitations honestly.