design
Original:🇺🇸 English
Translated
Design UI pages in Subframe. Use when building new UI, iterating on existing UI, exploring design options, or to get a visual starting point to refine in the Subframe design tool. Don't write UI code directly - design first, then implement with /subframe:develop.
6installs
Sourcesubframeapp/subframe
Added on
NPX Install
npx skill4agent add subframeapp/subframe designTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Design pages using the and MCP tools. creates AI-generated design variations that the user can preview and select. applies direct code edits to an existing Subframe page. Both produce designs the user can refine visually in the Subframe editor and then implement in code.
design_pageedit_pagedesign_pageedit_pageDon't write UI code directly. Subframe generates production-ready React/Tailwind code that matches the design system. Design first, then implement with .
/subframe:developWhen to Use This
Use when the user:
/subframe:design- Needs UI while coding
- Wants to explore design options
- Has codebase context that should inform the design
- Wants a starting point to refine in a design tool
- Is collaborating on designs with a team
- Wants to modify an existing page
The key value: and bridge coding and design. They work in both directions — create designs while coding and then ensure your code exactly reflects your design.
/subframe:design/subframe:developMCP Authentication
If you cannot find the tool (or any Subframe MCP tools), the MCP server likely needs to be authenticated. Ask the user to authenticate the Subframe MCP server. If the user is using Claude Code, instruct them to run to view and authenticate their MCP servers, and then say "done" when they're finished.
design_page/mcpSubframe Basics
- Components (buttons, inputs, cards): Synced via CLI. Source of truth in Subframe. Don't modify locally.
- Pages (screens): Designed via AI or editor. Exported via MCP. Add business logic after export.
Subframe knows about the design system and theme. Your job is to provide context from the user's codebase.
Workflow
You do not have to run before designing. The MCP tool works independently — it only needs a and an authenticated MCP server. Local project setup ( folder, synced components, Tailwind config) is not required to design pages.
/subframe:setupdesign_pageprojectId.subframe/- Understand the request — If vague, ask clarifying questions. What data? What actions? Who uses it?
- Find the projectId — Check if it exists. If there is no
.subframe/sync.jsonor no projectId found, ask the user to go to.subframe/sync.jsonto get a project ID.https://app.subframe.com/cli/auth - Decide: or
design_page? Then call the respective MCP tool:edit_page- → Creating something new, exploring multiple directions, or redesigning existing UI where the user wants options to choose from
design_page - → Making targeted changes to a Subframe page that was just created in this session (via
edit_page) or that the user provided via an MCP linkdesign_page
- Present the review URL — This is the primary output. The user will preview and choose next steps.
design_page
— New Pages & Redesigns
design_pageUse when:
design_page- Creating a new page from scratch
- Redesigning or rethinking existing UI — even if there's an existing implementation in code, use when the user wants to explore multiple design directions or start fresh
design_page - The user wants options to choose from (multiple variations)
Context and Variations
How much context to gather and how many variations to generate depends on the task:
| Task | Context | Variations |
|---|---|---|
| New page (open-ended) | Data types ( | 4 — explore the design space |
| New page (with reference pages) | Reference pages ( | 1-2 — stay close to the reference pages |
| Redesigning existing UI | The current page ( | 2-4 — depending on how open-ended |
Always include when available:
- Similar existing pages (the single most valuable context). Use for Subframe pages — pass the
additionalPagesreturned bypageId, or the page ID from a pasted MCP link. Usedesign_pagefor pages that only exist in the codebase.codeContext - Components or patterns the user refers to or explicitly mentions (via )
codeContext - Data types/interfaces for what the page will display (via )
codeContext
Variations
Each variation is a prompt that drives a unique design direction.
When you have reference pages (), use fewer variations (1-2) and keep them grounded in the reference. The variations should refine or extend the existing design, not diverge from it. For example:
additionalPages- "Follow the same layout as the reference page but adapted for [new content]"
- "Same structure with a more compact data-dense layout"
When starting from scratch (no ), use more variations (4) to explore the design space:
additionalPages- "Compact data table with inline actions and bulk operations"
- "Card-based layout with visual hierarchy and quick filters"
- "Minimal single-column design focused on the primary action"
- "Split-panel layout with sidebar navigation and detail view"
More variations = more exploration. Fewer = more focused. Default to fewer when strong context exists.
Multi-Page Requests
When designing multiple related pages (flows, CRUD, etc.):
- Design the primary page first with more variations to establish the direction
- After user selects a variation, design remaining pages passing the relevant pages via as context
additionalPages - Use the same to group related pages together
flowName
edit_page
— Editing a Subframe Page with Code
edit_pageUse when making targeted edits to a specific Subframe page by providing updated TSX code directly.
edit_pageCode Rules
Subframe pages are static TSX that gets parsed back into Subframe's visual model. The code you provide must follow these rules:
- Raw TSX only — No import statements, no function definitions, no export statements. Just the JSX body starting from the root element (e.g. or
<DefaultPageLayout>). Note:<div>returns the full file with imports — you must strip those and only send the JSX body toget_page_info.edit_page - No business logic — No , hooks, API calls, event handlers, or any dynamic behavior. Pages are purely visual; business logic is added after export.
useState - No loops or dynamic code — No ,
.map(),.forEach(), or any iteration. Every element must be written out explicitly..filter() - Match the existing code style exactly — Preserve how flex, gap, padding, and other layout properties are structured. The code will be parsed back into the Subframe editor, so the structure matters.
- Tailwind classes only — No attribute. Use
stylewith Tailwind classes for all styling. If you need a custom value, use Tailwind's bracket syntax (e.g.className).bg-[#ff0000] - Only use components from the Subframe project and standard HTML tags — Use or
list_componentsto see what's available. Allowed HTML tags:get_component_info,div,span,img,p-h1,h6,nav,header,main,article,section,aside. Don't use arbitrary React components or HTML elements beyond these.footer - No nested text elements — Text tags (,
span,p-h1) can only contain plain text strings, not other elements.h6 - No omitted code or placeholders — Output the complete page code. No or
// ...rest of code...comments.{/* TODO */} - Preserve attributes — Never change or remove these IDs; they're critical for the Subframe editor.
data-subframe-node-id
Workflow
- Get the current code — Call to get the page's current TSX code. Always refetch immediately before editing — do not reuse code from earlier in the conversation, as the page may have been modified in the Subframe editor.
get_page_info - Modify the code — Make the desired changes following the code rules above
- Call with:
edit_page- Page identifier: ,
id, orname— same asurl. Useget_page_infoto find existing pages if needed.list_pages - : The full updated TSX code for the page
code - : A short description of what changed (shown in the AI tab)
description
- Page identifier:
- If the code fails to parse — Fix the errors based on the error message and retry
- Present the — The user opens the design editor with the AI tab open to review and apply the edit
editUrl
When to use edit_page
vs design_page
edit_pagedesign_page- : You know exactly what code changes to make. You provide the updated TSX directly. Fast, precise, no AI generation.
edit_page - : You want AI-generated design variations. The user picks a direction. Better for new pages or exploring options.
design_page
When NOT to use : If the user has existing UI in their codebase but no corresponding Subframe page, or if they want to explore multiple design options, use instead. is for iterating on a known Subframe page with specific code changes.
edit_pagedesign_pageedit_pageAfter Designing
For , present the as a clickable markdown link. The user will:
design_pagereviewUrl- Preview variations — See each design option rendered in Subframe
- Select a variation — Choose the one that best fits their needs
- Open in editor — Refine visually in Subframe's full design editor
From there, the user may continue refining in Subframe or return here and ask you to implement the design in code. Do NOT ask the user which variation they prefer or present variation options as a multiple choice in chat. Variation selection happens in the Subframe editor, not here. Simply present the review URL and let them know they can ask you to implement the design once they're ready.
For , present the as a clickable markdown link. The user opens the design editor with the AI tab showing the edit, where they can apply it or undo.
edit_pageeditUrlInternally track the from the response — you'll need it for , for future designs, or for future edits — but don't mention it to the user.
pageId/subframe:developadditionalPagesedit_pageIterating on Variations
After calling , you can use with the returned to retrieve the generated variations and the current state of the page. This lets the user discuss and iterate on designs conversationally — for example, "I like the layout from variation 1 but the color scheme from variation 3", or "keep the header from the current page but use the card layout from variation 2."
design_pageget_variationspageIdget_variations- — The current page code if the user has already accepted a variation for this page, or
currentPageCodeif no variation has been accepted yet. This reflects the live state of the page, including any edits the user made in the Subframe editor.null - — The generated design variations from the most recent
variationscall.design_page
Important: The variations can be very token-heavy. After calling , extract from the response first — it determines your next step.
get_variationscurrentPageCode- exists — The user already has a page. Use
currentPageCodewithedit_pageas the starting point, incorporating ideas from the variations or the user's feedback. You don't need to deeply analyze every variation — just reference the ones the user mentions.currentPageCode - is null — The user hasn't accepted any variation yet. Use
currentPageCodeto iterate, passing the relevant variation code viadesign_pagealong with the user's feedback in the description. Note: this creates a newcodeContext— use it for subsequentpageIdcalls.get_variations