npx skills add https://github.com/subframeapp/subframe --skill design使用 design_page 和 edit_page MCP 工具来设计页面。design_page 创建 AI 生成的设计变体,用户可以预览和选择。edit_page 直接对现有的 Subframe 页面应用有针对性的更改。两者都会生成设计,用户可以在 Subframe 编辑器中直观地进行细化,然后在代码中实现。使用 edit_theme 更新整个项目的主题。
不要直接编写 UI 代码。 Subframe 会生成与设计系统匹配、可用于生产环境的 React/Tailwind 代码。先设计,然后使用 /subframe:develop 来实现。
当用户出现以下情况时,使用 /subframe:design:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
核心价值:/subframe:design 和 /subframe:develop 连接了编码和设计。它们双向工作——在编码时创建设计,然后确保你的代码完全反映你的设计。
如果找不到 design_page 工具(或任何 Subframe MCP 工具),MCP 服务器可能需要认证。请用户对 Subframe MCP 服务器进行认证。如果用户使用的是 Claude Code,请指导他们运行 /mcp 来查看和认证他们的 MCP 服务器,完成后说“完成”。
Subframe 了解设计系统和主题。你的工作是提供来自用户代码库的上下文。
设计前不必运行 /subframe:setup。design_page MCP 工具独立工作——它只需要一个 projectId 和一个经过认证的 MCP 服务器。设计页面不需要本地项目设置(.subframe/ 文件夹、同步的组件、Tailwind 配置)。
.subframe/sync.json。如果没有 .subframe/sync.json 或找不到 projectId,则调用 list_projects 以获取可用项目。每个项目都包含 projectId、name、teamId 和 teamName。
teamName 以消除歧义。如果用户已经提到了特定的团队或项目名称,请将其与 teamName 和 name 字段进行匹配——但在继续之前仍需确认。当存在多个项目时,切勿静默地选择一个项目。design_page 还是 edit_page? 然后调用相应的 MCP 工具:
design_page → 创建新内容、探索多个方向,或重新设计现有 UI 且用户希望有选项可供选择edit_page → 对在本会话中刚刚创建(通过 design_page)或用户通过 MCP 链接提供的 Subframe 页面进行有针对性的更改design_page — 新页面和重新设计在以下情况下使用 design_page:
design_page收集多少上下文以及生成多少变体取决于任务:
| 任务 | 上下文 | 变体 |
|---|---|---|
| 新页面(开放式) | 数据类型 (codeContext) | 4 — 探索设计空间 |
| 新页面(有参考页面) | 参考页面(如果在 Subframe 中则用 additionalPages,否则用 codeContext),数据类型 (codeContext) | 1-2 — 贴近参考页面 |
| 重新设计现有 UI | 当前页面(如果在 Subframe 中则用 additionalPages,否则用 codeContext;在描述中注明要保留与更改的内容) | 2-4 — 取决于开放程度 |
| 重新创建现有 UI | 当前页面的确切标记和样式 (codeContext) | 1 - 精确地从代码重新创建 UI |
在可用时始终包含:
additionalPages——传递 design_page 返回的 pageId,或从粘贴的 MCP 链接中获取的页面 ID。对于仅存在于代码库中的页面,使用 codeContext。codeContext)codeContext)在 codeContext 中包含代码时,区分 Subframe 组件和非 Subframe 组件:
.subframe/sync.json 中配置——通常是 @/ui 或 src/ui)或从 @subframe/core 导入的。按原样包含这些——Subframe 理解其自身的组件。codeContext 中。如果展开的标记内部使用了 Subframe 组件,请保持这些 Subframe 引用不变。例如,如果一个页面使用了 <LoginForm /> 并且它不是来自 Subframe 目录,请将其展开为表单的 JSX 标记(输入框、按钮、布局、Tailwind 类),而不是传递 <LoginForm />。
每个变体都是一个驱动独特设计方向的提示。
当你有参考页面时(additionalPages),使用较少的变体(1-2)并使其基于参考。变体应改进或扩展现有设计,而不是偏离它。例如:
当从头开始时(没有 additionalPages),使用更多的变体(4)来探索设计空间:
变体越多 = 探索性越强。变体越少 = 越专注。当存在强上下文时,默认使用较少的变体。
在设计多个相关页面(流程、CRUD 等)时:
additionalPages 作为上下文传递flowName 将相关页面分组在一起edit_page — 对现有页面进行有针对性的编辑使用 edit_page 对特定的 Subframe 页面进行有针对性的更改。提供页面标识符和更改描述——Subframe 会处理其余部分。
description:描述要更改的内容。为了精确,你可以包含代码片段,但这不是必需的。id、name 或 url。如果需要,使用 list_pages 查找现有页面。编辑会立即应用。将返回的 pageUrl 展示给用户,以便他们可以在 Subframe 中查看更新后的页面。
edit_page 与 design_pageedit_page:对现有 Subframe 页面进行有针对性的更改。快速且精确。design_page:新页面、重新设计或探索多个设计方向。何时不使用 edit_page:如果用户的代码库中有现有 UI 但没有相应的 Subframe 页面,或者他们想要探索多个设计选项,请改用 design_page。
对于 design_page,将 reviewUrl 展示为可点击的 markdown 链接。用户将:
之后,用户可能会继续在 Subframe 中细化,或者返回这里并要求你在代码中实现设计。不要询问用户更喜欢哪个变体,或在聊天中将变体选项作为多项选择展示。变体选择发生在 Subframe 编辑器中,而不是这里。只需展示审查 URL,并让他们知道一旦准备好,可以要求你实现设计。
对于 edit_page,编辑会立即应用。将返回的 pageUrl 展示为可点击的 markdown 链接,以便用户可以在 Subframe 中查看更新后的页面。如果需要,用户可以在编辑器中撤销编辑。
内部跟踪响应中的 pageId——你将需要它用于 /subframe:develop、未来设计的 additionalPages 或未来编辑的 edit_page——但不要向用户提及它。
在 design_page 之后,不要主动调用 get_variations。用户在 Subframe 编辑器中审查和选择变体,而不是在聊天中。只有当用户返回并明确要求迭代或组合设计时才调用 get_variations——例如,“我喜欢变体 1 的布局,但喜欢变体 3 的配色方案”,或者“保留当前页面的页眉,但使用变体 2 的卡片布局”。
get_variations 返回:
currentPageCode — 如果用户已为此页面接受了某个变体,则为当前页面代码;如果尚未接受任何变体,则为 null。这反映了页面的实时状态,包括用户在 Subframe 编辑器中所做的任何编辑。variations — 最近一次 design_page 调用生成的设计变体。重要提示: 变体可能非常消耗令牌。调用 get_variations 后,首先从响应中提取 currentPageCode——它决定了你的下一步。
currentPageCode 存在 — 用户已经有一个页面。使用 edit_page,并在描述中融入来自变体或用户反馈的想法。你不需要深入分析每个变体——只需引用用户提到的那些。currentPageCode 为 null — 用户尚未接受任何变体。使用 design_page 进行迭代,通过 codeContext 传递相关的变体代码,并在描述中包含用户的反馈。注意:这会创建一个新的 pageId——将其用于后续的 get_variations 调用。如果用户指出其主题存在问题并要求更改,请使用 edit_theme 工具在 Subframe 中更新主题。Subframe 中的设计随后将反映这些更改。edit_theme 能够更新颜色、边框、圆角、阴影令牌以及排版。在制定更改之前,使用 get_theme 来了解当前主题。
description 参数应描述你想要对主题进行的更改。如果需要,它可以包含确切的令牌值。
如果你当前正在与用户一起处理某个页面,你应该将该页面信息传递给 edit_theme 工具调用。
如果提供了页面,该工具将返回一个 URL,用户可以在其中审查和应用主题更改。如果未提供页面,该工具将返回一个 URL,用户可以在其中查看更新后的项目主题。在这种情况下,用户无法在应用前审查主题更改,因此最好在有任何可用页面标识符时提供。
重要提示: 主题会影响项目中的所有页面,因此在使用 edit_theme 之前,始终让用户确认他们想要更新整个项目。如果用户只想更新特定页面,则应改用 edit_page。
每周安装量
319
代码仓库
GitHub 星标数
379
首次出现
2026年2月6日
安全审计
安装于
cursor229
codex135
opencode59
github-copilot57
claude-code56
gemini-cli54
Design pages using the design_page and edit_page MCP tools. design_page creates AI-generated design variations that the user can preview and select. edit_page applies targeted changes directly to an existing Subframe page. Both produce designs the user can refine visually in the Subframe editor and then implement in code. Update the theme for the entire project using edit_theme.
Don't write UI code directly. Subframe generates production-ready React/Tailwind code that matches the design system. Design first, then implement with /subframe:develop.
Use /subframe:design when the user:
The key value: /subframe:design and /subframe:develop bridge coding and design. They work in both directions — create designs while coding and then ensure your code exactly reflects your design.
If you cannot find the design_page 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 /mcp to view and authenticate their MCP servers, and then say "done" when they're finished.
Subframe knows about the design system and theme. Your job is to provide context from the user's codebase.
You do not have to run /subframe:setup before designing. The design_page MCP tool works independently — it only needs a projectId and an authenticated MCP server. Local project setup (.subframe/ folder, synced components, Tailwind config) is not required to design pages.
.subframe/sync.json if it exists. If there is no .subframe/sync.json or no projectId found, call list_projects to get the available projects. Each project includes a projectId, name, teamId, and teamName.
teamName to disambiguate. If the user already mentioned a specific team or project name, match it against the and fields — but still confirm before proceeding. Never silently pick a project when multiple exist.design_page — New Pages & RedesignsUse design_page when:
design_page when the user wants to explore new design directions or add new featuresHow much context to gather and how many variations to generate depends on the task:
| Task | Context | Variations |
|---|---|---|
| New page (open-ended) | Data types (codeContext) | 4 — explore the design space |
| New page (with reference pages) | Reference pages (additionalPages if in Subframe, codeContext if not), data types (codeContext) | 1-2 — stay close to the reference pages |
| Redesigning existing UI | The current page (additionalPages if in Subframe, codeContext if not; note what to keep vs change in the description) |
Always include when available:
additionalPages for Subframe pages — pass the pageId returned by design_page, or the page ID from a pasted MCP link. Use codeContext for pages that only exist in the codebase.codeContext)codeContext)When including code in codeContext, distinguish between Subframe components and non-Subframe components:
.subframe/sync.json — typically @/ui or src/ui) or from @subframe/core. Include these as-is — Subframe understands its own components.codeContext. If the expanded markup uses Subframe components internally, keep those Subframe references intact.For example, if a page uses <LoginForm /> and it's not from the Subframe directory, expand it into the form's JSX markup (inputs, buttons, layout, Tailwind classes) rather than passing <LoginForm />.
Each variation is a prompt that drives a unique design direction.
When you have reference pages (additionalPages), 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:
When starting from scratch (no additionalPages), use more variations (4) to explore the design space:
More variations = more exploration. Fewer = more focused. Default to fewer when strong context exists.
When designing multiple related pages (flows, CRUD, etc.):
additionalPages as contextflowName to group related pages togetheredit_page — Targeted Edits to an Existing PageUse edit_page for targeted changes to a specific Subframe page. Provide a page identifier and a description of the changes — Subframe handles the rest.
description : Describe what to change. You can include code snippets for precision, but it's not required.id, name, or url. Use list_pages to find existing pages if needed.The edit is applied immediately. Present the returned pageUrl to the user so they can view the updated page in Subframe.
edit_page vs design_pageedit_page : Targeted changes to an existing Subframe page. Fast and precise.design_page : New pages, redesigns, or exploring multiple design directions.When NOT to useedit_page: If the user has existing UI in their codebase but no corresponding Subframe page, or if they want to explore multiple design options, use design_page instead.
For design_page, present the reviewUrl as a clickable markdown link. The user will:
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 edit_page, the edit is applied immediately. Present the returned pageUrl as a clickable markdown link so the user can view the updated page in Subframe. The user can undo the edit in the editor if needed.
Internally track the pageId from the response — you'll need it for /subframe:develop, additionalPages for future designs, or edit_page for future edits — but don't mention it to the user.
Do NOT proactively call get_variations after design_page. The user reviews and selects variations in the Subframe editor, not in chat. Only call get_variations when the user comes back and explicitly asks to iterate on or combine designs — 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."
get_variations returns:
currentPageCode — The current page code if the user has already accepted a variation for this page, or null if no variation has been accepted yet. This reflects the live state of the page, including any edits the user made in the Subframe editor.variations — The generated design variations from the most recent design_page call.Important: The variations can be very token-heavy. After calling get_variations, extract currentPageCode from the response first — it determines your next step.
currentPageCode exists — The user already has a page. Use edit_page with a description 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 design_page to iterate, passing the relevant variation code via codeContext along with the user's feedback in the description. Note: this creates a new pageId — use it for subsequent get_variations calls.If the user indicates an issue with their theme and requests changes, use the edit_theme tool to update the theme in Subframe. The designs in Subframe will then reflect those changes. edit_theme is able to update color, border, corner, and shadow tokens as well as typography. Use get_theme to understand the current theme before formulating your changes.
The description parameter should describe what changes you want to make to the theme. It can include exact token values if needed.
If you are currently working on a page with the user, you should pass that page information into the edit_theme tool call.
If a page is provided, the tool will return a URL where the user can review and apply the theme changes. If no page is provided, the tool will return a URL where the user can see the updated project theme. The user cannot review the theme changes prior to application in this case, so it is best to provide a page identifier if any is available.
Important: The theme affects all pages in the project, so always make the user confirm that they want to update the whole project before using edit_theme. If the user only wants to update a particular page, you should use edit_page instead.
Weekly Installs
319
Repository
GitHub Stars
379
First Seen
Feb 6, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor229
codex135
opencode59
github-copilot57
claude-code56
gemini-cli54
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
105,000 周安装
teamNamenamedesign_page or edit_page? Then call the respective MCP tool:
design_page → Creating something new, exploring multiple directions, or redesigning existing UI where the user wants options to choose fromedit_page → Making targeted changes to a Subframe page that was just created in this session (via design_page) or that the user provided via an MCP link| 2-4 — depending on how open-ended |
| Recreating an existing UI | The current page's exact markup and styles (codeContext) | 1 - recreate the UI from code exactly |