npx skills add https://github.com/subframeapp/subframe --skill setup在项目中设置 Subframe,以便在本地开发环境中完美渲染 Subframe 中设计的页面。
目标状态:开发服务器运行,且 Subframe 页面渲染与设计完全一致。
如果找不到任何 Subframe MCP 工具(如 get_theme 等),则 MCP 服务器可能需要认证。请要求用户认证 Subframe MCP 服务器。如果用户使用的是 Claude Code 或 Codex,请指导他们运行 /mcp 来查看并认证他们的 MCP 服务器,完成后说“完成”。
用户可能会粘贴从 Subframe 复制的安装提示。提取:
app.subframe.com/<PROJECT_ID>/...)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如果用户未提供凭证,请使用 MCP 工具自动获取凭证 — 无需询问用户:
list_projects 获取项目列表。每个项目都包含 projectId、name、teamId 和 teamName。
* 一个项目:自动使用它。
* 多个项目:始终询问用户要使用哪个项目。展示每个项目及其 teamName 以消除歧义。如果用户已经提到了特定的团队或项目名称,请将其与 teamName 和 name 字段进行匹配 — 但在继续之前仍需确认。当存在多个项目时,切勿静默选择项目。teamId 调用 generate_auth_token。不要使用其他项目的 teamId。备用方案:如果 MCP 工具不可用(例如,MCP 服务器未认证),请要求用户访问 https://app.subframe.com/cli/auth 以获取其认证令牌和项目 ID。
检查当前目录中是否存在 package.json 和 .subframe/ 文件夹:
| 条件 | 项目类型 | 路径 |
|---|---|---|
没有 package.json | 新项目 | 新项目 |
有 package.json 且有 .subframe/ 文件夹 | 已设置 | 已设置 |
有 package.json 但没有 .subframe/ 文件夹 | 现有非 Subframe 项目 | 询问用户,然后选择新项目或现有项目 |
如果当前目录有 package.json 但没有 .subframe/ 文件夹,请向用户提示两个选项:
如果项目已有 package.json 和 .subframe/ 文件夹,则 Subframe 已初始化。询问用户想要做什么:
/subframe:design 或 /subframe:develop。除非用户确认要重新安装,否则不要继续设置。
这是最理想的路径。CLI 将搭建一个预先配置好 Subframe 的完整项目。
提示用户选择:
subframe-app)。名称不能与现有目录冲突 — 在运行 CLI 之前检查目录是否已存在。tailwind) 或 v4 (tailwind-v4)此命令必须在沙箱外部运行,以便正确设置所有必需的文件。直接传递所有参数以避免交互式提示:
npx @subframe/cli@latest init \
--name {PROJECT_NAME} \
--auth-token {TOKEN} \
-p {PROJECT_ID} \
--template {FRAMEWORK} \
--css-type {TAILWIND_VERSION} \
--dir ./src/ui \
--alias "@/ui/*" \
--tailwind \
--css-path {CSS_PATH} \
--install \
--sync
其中:
{PROJECT_NAME} 是项目目录名称(例如,subframe-app){FRAMEWORK} 是 nextjs、vite 或 astro{TAILWIND_VERSION} 是 tailwind (v3) 或 tailwind-v4{CSS_PATH} 是全局 CSS 文件路径:
src/index.csssrc/app/globals.csssrc/styles/global.css重要:必须显式传递所有参数以避免交互式提示,这可能导致 CLI 在非交互式运行时静默退出。
CLI 将:
.subframe/sync.json请参阅下面的配置字体 — 即使对于新项目,这也是必需的。
请参阅下面的验证设置。
现有项目可能需要更多配置。CLI 处理大部分设置,但某些项目需要手动修复。
检查框架指示器:
| 框架 | 指示器 |
|---|---|
| Next.js | package.json 依赖项中有 next,存在 next.config.* 文件 |
| Vite | package.json devDependencies 中有 vite,存在 vite.config.* 文件 |
| Astro | package.json 依赖项中有 astro,存在 astro.config.* 文件 |
验证项目是否具有所需的依赖项:
package.json 中有 reactpackage.json 中有 tailwindcsspackage.json 中有 typescript如果缺少任何一项,请在继续之前告知用户。
此命令必须在沙箱外部运行,以便正确设置所有必需的文件。直接传递所有参数以避免交互式提示:
npx @subframe/cli@latest init \
--auth-token {TOKEN} \
-p {PROJECT_ID} \
--dir ./src/ui \
--alias "@/ui/*" \
--install \
--sync
重要:必须显式传递所有参数以避免交互式提示,这可能导致 CLI 在非交互式运行时静默退出。
CLI 将尝试:
.subframe/sync.json@subframe/core初始化后,验证所有内容是否已正确设置。如果 CLI 遗漏了某些内容(在非标准设置中常见),请应用手动修复。
检查.subframe/sync.json 是否存在,并包含 directory、importAlias 和 projectId。
检查 Tailwind 配置:
Tailwind v3 — tailwind.config.js 应包含 Subframe 预设:
presets: [require("./src/ui/tailwind.config")],
并且 content 数组应包含 Subframe 目录:
content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"],
Tailwind v4 — 全局 CSS 文件应导入主题:
@import "tailwindcss";
@import "./ui/theme.css";
检查导入别名 — @/* 应能正确解析。如果不起作用:
baseUrl 和 paths 添加到 tsconfig.app.json,并将 resolve.alias 添加到 vite.config.tsbaseUrl 和 paths 添加到 tsconfig.jsontsconfig.json如果出现问题,请使用 SearchSubframeDocs MCP 工具查找解决方案:
SearchSubframeDocs({ query: "tailwind configuration troubleshooting" })
SearchSubframeDocs({ query: "manual installation" })
文档包含全面的手动安装指南,用于故障排除。
请参阅下面的配置字体。
请参阅下面的验证设置。
CLI 不配置字体。使用 get_theme MCP 工具获取字体信息:
get_theme({ projectId: "PROJECT_ID" })
主题配置包括引用 Google Fonts 的 fontFamily 条目。添加相应的 <link> 标签:
Vite / Astro — 添加到 index.html 的 <head> 中:
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Font+Name:wght@400;500;600;700&display=swap" rel="stylesheet" />
Next.js (App Router) — 添加到 app/layout.tsx 的 <head> 中:
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Font+Name:wght@400;500;600;700&display=swap" rel="stylesheet" />
</head>
Next.js (Pages Router) — 添加到 pages/_document.tsx 中的 <Head> 组件内。
字体链接格式:
+(例如,Inter+Tight)wght@ 参数中包含主题中的权重(用分号分隔)<link>,但只需一组预连接链接配置完成后,验证 Subframe 页面是否正确渲染。
询问用户:“您是否已有在 Subframe 中设计的页面想要测试?”
/subframe:develop 来实现它并验证渲染/subframe:design 设计一个页面,或者直接启动开发服务器以确认没有错误npm run dev
回顾已设置的内容:
.subframe/sync.json 已配置src/ui/(或配置的目录)提及后续步骤:
/subframe:design — 使用 AI 设计新页面/subframe:develop — 在您的代码库中实现 Subframe 设计SearchSubframeDocs MCP 工具来解决任何设置问题。每周安装量
317
仓库
GitHub 星标数
379
首次出现
2026年2月6日
安全审计
安装于
cursor228
codex133
opencode57
github-copilot56
claude-code55
gemini-cli53
Set up Subframe in a project so that pages designed in Subframe render pixel-perfect in the local development environment.
Goal state : Dev server runs and Subframe pages render exactly as designed.
If you cannot find any Subframe MCP tools (like get_theme, etc.), the MCP server likely needs to be authenticated. Ask the user to authenticate the Subframe MCP server. If the user is using Claude Code or Codex, instruct them to run /mcp to view and authenticate their MCP servers, and then say "done" when they're finished.
The user may paste in an installation prompt copied from Subframe. Extract:
app.subframe.com/<PROJECT_ID>/...)If the user doesn't provide credentials, use the MCP tools to get credentials automatically — no need to ask the user:
list_projects to get the list of 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 teamName and name fields — but still confirm before proceeding. Never silently pick a project when multiple exist.generate_auth_token with the from the user's selected project. Do not use a from a different project.Fallback : If the MCP tools are not available (e.g., MCP server is not authenticated), ask the user to go to https://app.subframe.com/cli/auth to get their auth token and project ID.
Check for package.json and .subframe/ folder in the current directory:
| Condition | Project Type | Path |
|---|---|---|
No package.json | New project | New Project |
Has package.json AND has .subframe/ folder | Already setup | Already Setup |
Has package.json but NO .subframe/ folder | Existing non-Subframe project | Ask user, then New Project or Existing Project |
If the current directory has a package.json but no .subframe/ folder, prompt the user with two options:
If the project already has both package.json and a .subframe/ folder, Subframe has already been initialized. Ask the user what they'd like to do:
/subframe:design or /subframe:develop.Do not proceed with setup unless the user confirms they want to reinstall.
This is the happy path. The CLI will scaffold a complete project with Subframe pre-configured.
Prompt the user to choose:
subframe-app). The name cannot conflict with an existing directory — check that the directory doesn't already exist before running the CLI.tailwind) or v4 (tailwind-v4)This command must be run outside of a sandbox, so it can correctly setup all the necessary files. Pass all arguments directly to avoid interactive prompts:
npx @subframe/cli@latest init \
--name {PROJECT_NAME} \
--auth-token {TOKEN} \
-p {PROJECT_ID} \
--template {FRAMEWORK} \
--css-type {TAILWIND_VERSION} \
--dir ./src/ui \
--alias "@/ui/*" \
--tailwind \
--css-path {CSS_PATH} \
--install \
--sync
Where:
{PROJECT_NAME} is the project directory name (e.g., subframe-app){FRAMEWORK} is nextjs, vite, or astro{TAILWIND_VERSION} is tailwind (v3) or tailwind-v4{CSS_PATH} is the global CSS file path:
src/index.cssImportant : All arguments must be passed explicitly to avoid interactive prompts, which can cause the CLI to exit silently when run non-interactively.
The CLI will:
.subframe/sync.jsonSee Configure Fonts below — this is required even for new projects.
See Verify Setup below.
Existing projects may require more configuration. The CLI handles most setup, but some projects need manual fixes.
Check for framework indicators:
| Framework | Indicators |
|---|---|
| Next.js | next in package.json dependencies, next.config.* file |
| Vite | vite in package.json devDependencies, vite.config.* file |
| Astro | astro in package.json dependencies, file |
Verify the project has required dependencies:
react in package.jsontailwindcss in package.jsontypescript in package.jsonIf any are missing, let the user know before proceeding.
This command must be run outside of a sandbox, so it can correctly setup all the necessary files. Pass all arguments directly to avoid interactive prompts:
npx @subframe/cli@latest init \
--auth-token {TOKEN} \
-p {PROJECT_ID} \
--dir ./src/ui \
--alias "@/ui/*" \
--install \
--sync
Important : All arguments must be passed explicitly to avoid interactive prompts, which can cause the CLI to exit silently when run non-interactively.
The CLI will attempt to:
.subframe/sync.json@subframe/coreAfter init, verify everything was set up correctly. If the CLI missed something (common with non-standard setups), apply manual fixes.
Check.subframe/sync.json exists with directory, importAlias, and projectId.
Check Tailwind configuration:
Tailwind v3 — tailwind.config.js should have the Subframe preset:
presets: [require("./src/ui/tailwind.config")],
And the content array should include the Subframe directory:
content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"],
Tailwind v4 — Global CSS file should import the theme:
@import "tailwindcss";
@import "./ui/theme.css";
Check import aliases — @/* should resolve correctly. If not working:
baseUrl and paths to tsconfig.app.json, and add resolve.alias to vite.config.tsbaseUrl and paths to tsconfig.jsontsconfig.jsonIf issues arise, use the SearchSubframeDocs MCP tool to find solutions:
SearchSubframeDocs({ query: "tailwind configuration troubleshooting" })
SearchSubframeDocs({ query: "manual installation" })
The docs include a comprehensive manual installation guide for troubleshooting.
See Configure Fonts below.
See Verify Setup below.
The CLI does not configure fonts. Use the get_theme MCP tool to get font information:
get_theme({ projectId: "PROJECT_ID" })
The theme config includes fontFamily entries referencing Google Fonts. Add the corresponding <link> tags:
Vite / Astro — Add to <head> in index.html:
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Font+Name:wght@400;500;600;700&display=swap" rel="stylesheet" />
Next.js (App Router) — Add to <head> in app/layout.tsx:
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Font+Name:wght@400;500;600;700&display=swap" rel="stylesheet" />
</head>
Next.js (Pages Router) — Add to pages/_document.tsx inside the <Head> component.
Font link formatting:
+ in font names (e.g., Inter+Tight)wght@ parameter (semicolon-separated)<link> per font family, but only one set of preconnect linksAfter configuration, verify that Subframe pages render correctly.
Ask the user: "Do you have a page already designed in Subframe that you'd like to test with?"
/subframe:develop to implement it and verify rendering/subframe:design, or simply start the dev server to confirm no errorsnpm run dev
Recap what was set up:
.subframe/sync.json configuredsrc/ui/ (or configured directory)Mention next steps:
/subframe:design — Design new pages with AI/subframe:develop — Implement Subframe designs in your codebaseSearchSubframeDocs MCP tool for troubleshooting any setup issues.Weekly Installs
317
Repository
GitHub Stars
379
First Seen
Feb 6, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
cursor228
codex133
opencode57
github-copilot56
claude-code55
gemini-cli53
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
105,000 周安装
Kubernetes架构师专家:云原生基础设施、GitOps工作流与大规模容器编排解决方案
308 周安装
gh-issues:基于AI子代理自动修复GitHub Issues的开源自动化工具
308 周安装
Botchan:Base区块链智能体消息层,实现无需许可的链上通信
308 周安装
Worktrunk CLI 工具:高效管理 Git Worktree,自动化开发工作流
308 周安装
viem 集成指南:为 TypeScript/JavaScript 应用连接 EVM 区块链
308 周安装
Appwrite TypeScript SDK 使用指南 - 客户端与服务器端开发教程
309 周安装
teamIdteamIdsrc/app/globals.csssrc/styles/global.cssastro.config.*