platform-ui
Skill0 starsChanged 6 months agoMITView on GitHub
使用 shadcn、Tailwind CSS v4 与 registry 机制为新平台或 greenfield Web 工作台执行从 0 到 1 的开发工序。仅在用户明确要做 shadcn 平台、组件源码直出、registry 组装、运营后台/工具站/工作台时触发;antd 存量项目、antd-mobile 项目、需要 SSR/SEO 的路线不适用。
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- letern1ty/claude-skillsword for word, first seen Oct 25, 2026
Other versions1 project uses a version of this.
Word for word · 1
- letern1ty/claude-skills★ 0100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- hello-worldSkill
The file
Files
platform-ui
版本假设
- Tailwind CSS v4。
- shadcn CLI 3.x。
- registry item schema 以
https://ui.shadcn.com/schema/registry-item.json当前版本为准。 - 所有命令以
npx shadcn --help实测结果为准。
输入契约
| 类别 | 信息项 | 缺失时处理 |
| 必填 | 平台一句话定位 | 追问,不得脑补 |
| 必填 | 核心页面清单,或至少 2 个关键场景 | 追问,不得脑补 |
| 必填 | 运行环境:纯 CSR 是否足够,是否需要 SSR/SEO | 追问一轮;无回应按默认 CSR→Vite 继续(该项不计入 P0 两轮门槛);用户明确需要 SSR/SEO 时判定不适用并走 P0 |
| 可选 | 品牌主色或参考图 | 默认 Radix Blue |
| 可选 | 权限角色 | 默认单角色 |
| 可选 | 数据实体草图 | 无则按页面反推最小字段模型 |
| 可选 | 目标浏览器 | 默认桌面优先的现代浏览器 |
| 可选 | 数据接口现状 | 默认无 API,走 MSW mock |
追问只针对必填项,顺序固定为:页面清单 → SSR 与否。可选项缺失一律直接取默认值,不追问。"两轮"按同一必填项计数:对同一必填项累计两轮追问仍无有效回应时,立即进入 P0,交付文档后终止,不得继续 P1(SSR 项按上表规则默认 CSR,不计入该门槛)。
执行顺序约定:只读适用性检测(P1 检测程序)先于输入契约追问——若目标目录已可判定不适用(如存量 antd 项目),直接进入 P0 退出,不浪费用户的追问轮次。目标目录以用户指定为准,未指定时取当前工作目录;检测与生成均以该目录为根。
P0 方案分支
- 进入:连续两轮拿不到输入契约必填项,或用户确认需要 SSR/SEO,或 P1 检测判定不适用。
- 必读:本文件的输入契约、适用性矩阵、P1 检测程序。
- 产出(按进入原因分场景):
- 必填项缺失 → 基于已知信息的《页面结构与选型建议》文档。
- 需要 SSR/SEO → 不适用说明 + Next.js 方向迁移建议。
- 存量 antd / 其他 UI 库项目 → 不适用说明 + 分流建议:确有需要时可在新目录另起独立 greenfield 项目继续使用本 skill,不建议在存量仓库内混用。
- 完成判定:文档交付完成后立即终止流程。
- 降级:无。P0 本身就是显式退出路径,不得从 P0 续跑工程。
适用性矩阵
| 项目起点 | 是否适用 | 处理 |
空目录或仅 git init | 适用 | 完整执行 P1→P6 |
已有空壳脚手架,src/ 仅模板初始文件 | 适用 | 跳过脚手架创建,从 P1 检测后接 P2 |
| 明确需要 SSR/SEO 的新平台 | 不适用 | 输出 Next.js 迁移建议并终止 |
| monorepo 新增子应用 | 有条件适用 | 仅在子应用目录内执行,并确认 Tailwind 与 tsconfig 继承关系 |
| 已有 Tailwind 项目局部引入 shadcn | 有条件适用 | 先做 shadcn init 兼容检查;若 Tailwind v3/v4 冲突,则列升级项待确认 |
| 存量 antd 或 antd-mobile 项目 | 不适用 | 退出并说明不适用 |
| 存量其他 UI 库项目,如 MUI、Chakra | 不适用 | 退出并提示混用风险,建议人工评估 |
P1 检测程序
- 读取
package.json;若依赖包含antd、antd-mobile、@ant-design/*,判定不适用,进入 P0 产出"不适用说明 + 另起独立项目分流建议"后终止;@mui/*、@chakra-ui/*同理。不适用的统一出口是 P0,不做无产出的裸退出。 - 若无
package.json且目录为空,或仅存在配置文件,则判定为 greenfield。 - 若存在
tailwindcss依赖,则走“已有 Tailwind”分支;若存在pnpm-workspace.yaml或turbo.json,则走 monorepo 分支。 - 兜底:存在
package.json但前 3 步均不命中时,不得静默继续。先提示混用风险,再询问用户是否确认引入 shadcn;空壳脚手架仅在src/只含模板文件时才按适用处理,含业务代码的存量项目默认走询问分支。
六阶段工序
P1 初始化
- 进入:输入契约必填项齐全,且未落入 P0。
- 必读:本文件的适用性矩阵与 P1 检测程序。
产出:适用性结论;脚手架
pnpm create vite <app> --template react-ts;Tailwind v4;npx shadcn init;TypeScript strict;补齐package.jsonscripts(Vite 模板默认没有 typecheck/lint,必须显式补齐):{ "typecheck": "tsc --noEmit", "lint": "eslint .", "build": "tsc -b && vite build" }- 完成判定:
pnpm install && pnpm build成功;components.json存在;pnpm typecheck与pnpm lint可运行。 - 降级:
shadcn init失败时,输出 Tailwind 兼容排查与手动初始化步骤;安装失败或依赖缺失时,检查.npmrcregistry 指向(公司私有源可能拿不到公共依赖),参见references/registry-guide.md的项目级.npmrc覆盖节;不适用项目直接退出。
P2 设计 Token
- 进入:P1 完成判定通过。
- 必读:
references/design-tokens.md。 - 产出:
src/styles/tokens.css或 Tailwind v4@theme块,包含--background、--foreground、--primary、--primary-foreground、--secondary、--secondary-foreground、--muted、--muted-foreground、--accent、--accent-foreground、--border、--input、--ring、--card、--card-foreground、--popover、--popover-foreground、--radius等变量,并补全.dark映射。 - 完成判定:shadcn 约定变量在亮色与暗色两套中全部赋值完成。
- 降级:无品牌色时,使用
Radix Blue + Slate。
P3 组件安装
- 进入:P2 完成。
- 必读:
references/component-map.md;涉及第三方源时额外读取references/registry-guide.md。 - 产出:基础组件与按页面清单反推的场景组件;
lucide-react;必要时完成 registry 拉取或手动复制源码。 - 完成判定:
pnpm typecheck通过;components/ui/中的组件与页面清单需要一致。 - 降级:registry 网络失败时,按
registry-guide.md的手动复制源码方案处理。
P4 应用骨架
- 进入:P3 完成。
- 必读:
references/component-map.md的布局与数据层约定。 - 产出:App Shell;侧边导航、顶栏、内容区;按需接入
react-resizable-panels;React Router 或文件路由骨架;TanStack Query Provider;Vite 开发环境下的 MSW 初始化。 - 完成判定:
pnpm dev下所有导航项可达占位页;MSW 能拦截至少一条示例请求。 - 降级:无多栏需求时跳过
react-resizable-panels。
P5 页面组装
- 进入:P4 完成。
- 必读:
references/component-map.md中匹配当前页面类型的章节。 - 产出:列表页、表单页、详情页、看板页按固定顺序组装;每页配齐成功、空、错误三类 MSW handler;必要时接入可选的 AI 对话模块。
- 完成判定:每页三态都能通过切换 MSW handler 复现;
pnpm typecheck && pnpm lint通过。 - 降级:页面类型超出四类范式时,按最接近范式实现,并在注释或交付说明中标注偏离点。
P6 质量关卡
- 进入:全部页面完成 P5。
- 必读:
assets/quality-checklist.md。 - 产出:可直接粘贴到 PR 描述的核验记录。
- 完成判定:删除
node_modules后pnpm install可干净复装,pnpm typecheck、pnpm lint、pnpm build全部通过;暗色模式、375/768/1280三断点、键盘可达与焦点环、对比度、空/加载/错误三态、console 无错误全部核验完成。 - 降级:任何单项不过都必须列入问题清单,禁止静默放行。
轻量路径
- 仅加组件:直接执行 P3,并按需读取
references/component-map.md与references/registry-guide.md。 - 仅调主题:直接执行 P2,并只读取
references/design-tokens.md。 - 仅补三态 mock:执行 P4 的数据层初始化与 P5 的 MSW handler 范式。
- 轻量路径不强制补跑全流程,但必须满足当前阶段的完成判定。
必读资源导航
- 设计变量、字体、间距、圆角、暗色模式:
references/design-tokens.md - 场景到组件的安装与代码范式:
references/component-map.md - 多 registry 配置、拉取命令、失败降级:
references/registry-guide.md - 最终工程与视觉验收:
assets/quality-checklist.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

