Purpose
Enable non-programmers to get production-grade frontend components from natural-language requirements.
This meta-skill coordinates three upstream skills and produces implementation-ready output, usually as one .tsx file plus concise setup notes.
It does not replace upstream skill logic and does not assume hidden dependencies are already installed.
Required Installed Skills
- -
frontend-design-ultimate (inspected latest: 1.0.0) - INLINECODE3 (inspected latest:
1.0.0) - INLINECODE5 (inspected latest:
0.1.0)
Install/update:
CODEBLOCK0
Verify:
CODEBLOCK1
OpenClaw Compatibility Notes
This skill is written to match OpenClaw skill-loading rules:
- -
SKILL.md with YAML frontmatter and Markdown body - single-line frontmatter keys
- INLINECODE8 encoded as a single-line JSON object
- no unsupported custom top-level frontmatter keys
If this file is edited later, keep those constraints intact.
Runtime Prerequisites
Minimum local stack:
- - Node.js 18+
- npm
- React + TypeScript project with Tailwind configured
Adjacent ecosystem dependencies (from inspected upstream skill content):
- -
tailwindcss (layout/styling baseline) - INLINECODE10 (icons used by many shadcn examples)
- INLINECODE11 (theme toggle patterns in shadcn guidance)
- INLINECODE12 ,
zod, @hookform/resolvers (form patterns) - optional:
framer-motion (motion patterns from frontend-design-ultimate) - optional:
recharts or equivalent if a real chart package is required
If user wants shadcn components and they are missing, include explicit setup commands in output:
CODEBLOCK2
Do not assume Next.js unless the user says Next.js.
Default to framework-agnostic React .tsx output that can run in Vite or Next.js with minimal adaptation.
Inputs the LM Must Collect First
- -
ui_goal (dashboard, landing page, admin panel, etc.) - INLINECODE19 (
dark, light, or system) - INLINECODE23 (for example revenue, MRR, growth)
- INLINECODE24 (line, bar, area; static or interactive)
- INLINECODE25 (
compact, balanced, spacious) - INLINECODE29 (colors, logo, typography constraints)
- INLINECODE30 (
vite-react, nextjs, or generic-react) - INLINECODE34 (
true/false)
If any critical input is missing, make explicit defaults and state them in Assumptions.
Tool Responsibilities
frontend-design-ultimate
Use for visual direction and anti-generic design decisions:
- - choose strong aesthetic direction
- define typographic hierarchy and color system
- enforce mobile-first responsiveness
- avoid boilerplate “AI-slop” layouts
From inspected upstream guidance:
- - commit to one clear tone
- include an unforgettable visual element
- prefer CSS variables and strong contrast
- avoid generic default fonts
shadcn-ui
Use for robust UI primitives and composition patterns:
- - cards, tabs, sheets, navigation, table, badges, dialogs
- theming conventions and dark mode compatibility
- predictable component structure for fast shipping
From inspected upstream guidance:
- - components are copied into the project (not a hosted runtime UI SDK)
- include install commands for any components you reference
- prefer composable primitives for layout and data display
react-expert
Use for behavioral correctness and maintainability:
- - state design and data flow
- strict TypeScript-first component patterns
- accessibility and predictable rendering behavior
- optional performance hardening for non-trivial UI
From inspected upstream guidance:
- - avoid state mutation and unstable keys
- use semantic structure and cleanup in effects
- ship clear typed interfaces for props/data
Canonical Causal Chain
Use this exact orchestration order.
- 1. INLINECODE38
- - Normalize user request into goals, constraints, and output contract.
- 2. INLINECODE39
- - Select one explicit aesthetic mode.
- Define palette, type scale, spacing, and page composition.
- Decide dark-mode token strategy.
- 3. INLINECODE40
- - Map UI blocks to component primitives (sidebar, card, tabs, table, badge).
- Declare required shadcn installs for referenced primitives.
- 4. INLINECODE41
- - Implement typed data models and render loops.
- Add local state/hooks where required.
- Keep logic simple and deterministic for copy-paste usability.
- 5. INLINECODE42
- - Produce one
.tsx file by default. - Include short
Setup section with required install commands. - Include
Assumptions and Adaptation Notes.
Output Contract
Default output must contain:
- exact npm/npx commands for missing dependencies
- shadcn component add commands used by generated code
- one self-contained React component in TypeScript
- imports listed at top
- mock data included inline unless user supplies real data source
- explicit defaults chosen due to missing input
- where to plug in real API data
- which imports to remove if a component is unavailable
No auxiliary script generation. No multi-file scaffolding unless user explicitly asks.
Chart Handling Rule
If chart library is not guaranteed in target project:
- - default to a semantic “chart-ready” card layout with placeholders, or
- use lightweight inline SVG chart logic in the same
.tsx.
Do not hallucinate unavailable chart components.
If using external chart lib (for example Recharts), include install command and clearly label as optional.
Scenario Mapping: Revenue Dashboard (Dark Mode)
For scenario:
"I need a dark-mode dashboard showing revenue metrics"
Execution:
- 1. frontend-design-ultimate defines dark palette, bold typography, and dashboard composition (sidebar + metric grid + chart area).
- shadcn-ui maps layout to
Card, Badge, Tabs, optional Sidebar primitives. - react-expert creates typed metric arrays and rendering loops for KPI tiles + trend view.
- final output returns one production-usable
.tsx component plus setup commands.
Quality Gates
Before finalizing output, ensure:
- - component compiles as TSX (no missing symbols in emitted code)
- design is intentional, not default-template generic
- dark mode tokens are coherent and readable
- mobile behavior is included (
sm/md/lg responsive strategy) - all referenced UI components are listed in setup commands
- no fake API calls presented as real integrations
If any gate fails, return Needs Revision with a concrete missing-items list.
Guardrails
- - Never claim “works out of the box” without listing dependency assumptions.
- Never emit components from libraries not declared in setup.
- Never hide unresolved decisions (state them under
Assumptions). - Prefer one high-quality component over broad but shallow scaffolding.
Failure Handling
- - Missing upstream skills: stop and report exact missing skills.
- Missing project context: output generic React version and mark adaptation points.
- Missing chart dependency: provide fallback rendering path and optional install command.
- Conflicting constraints (for example “single file” + “full app routing”): prioritize single-file contract and document tradeoff.
目的
使非编程人员能够通过自然语言需求获得生产级前端组件。
此元技能协调三个上游技能,并生成可直接实施的输出,通常为一个 .tsx 文件及简洁的设置说明。
它不替代上游技能逻辑,也不假设隐藏依赖已安装。
所需已安装技能
- - frontend-design-ultimate(已检查最新版本:1.0.0)
- shadcn-ui(已检查最新版本:1.0.0)
- react-expert(已检查最新版本:0.1.0)
安装/更新:
bash
npx -y clawhub@latest install frontend-design-ultimate
npx -y clawhub@latest install shadcn-ui
npx -y clawhub@latest install react-expert
npx -y clawhub@latest update --all
验证:
bash
npx -y clawhub@latest list
OpenClaw 兼容性说明
此技能遵循 OpenClaw 技能加载规则编写:
- - SKILL.md 包含 YAML 前置元数据和 Markdown 正文
- 单行前置元数据键
- metadata 编码为单行 JSON 对象
- 不支持的自定义顶级前置元数据键
如果后续编辑此文件,请保持这些约束不变。
运行时前提条件
最低本地环境要求:
- - Node.js 18+
- npm
- 配置了 Tailwind 的 React + TypeScript 项目
相关生态系统依赖(来自已检查的上游技能内容):
- - tailwindcss(布局/样式基础)
- lucide-react(许多 shadcn 示例使用的图标)
- next-themes(shadcn 指南中的主题切换模式)
- react-hook-form、zod、@hookform/resolvers(表单模式)
- 可选:framer-motion(来自 frontend-design-ultimate 的动画模式)
- 可选:recharts 或等效库(如果需要真实图表包)
如果用户需要 shadcn 组件但缺少它们,请在输出中包含明确的设置命令:
bash
npx shadcn@latest init
npx shadcn@latest add card button badge tabs table sheet sidebar
除非用户明确指定 Next.js,否则不要假设使用 Next.js。
默认输出框架无关的 React .tsx 文件,可在 Vite 或 Next.js 中通过最小适配运行。
LM 必须首先收集的输入
- - uigoal(仪表盘、落地页、管理面板等)
- thememode(dark、light 或 system)
- primarymetrics(例如收入、MRR、增长)
- chartexpectation(折线图、柱状图、面积图;静态或交互式)
- layoutdensity(compact、balanced、spacious)
- brandconstraints(颜色、Logo、排版约束)
- targetframework(vite-react、nextjs 或 generic-react)
- singlefile_strict(true/false)
如果缺少任何关键输入,请设置明确的默认值并在 Assumptions 中说明。
工具职责
frontend-design-ultimate
用于视觉方向和反通用设计决策:
- - 选择明确的美学方向
- 定义排版层级和颜色系统
- 强制执行移动优先响应式设计
- 避免模板化的“AI 垃圾”布局
根据已检查的上游指南:
- - 坚持一种清晰的风格
- 包含令人难忘的视觉元素
- 优先使用 CSS 变量和高对比度
- 避免通用的默认字体
shadcn-ui
用于稳健的 UI 原语和组合模式:
- - 卡片、标签页、面板、导航、表格、徽章、对话框
- 主题约定和深色模式兼容性
- 可预测的组件结构,便于快速交付
根据已检查的上游指南:
- - 组件被复制到项目中(不是托管的运行时 UI SDK)
- 包含所引用组件的安装命令
- 优先使用可组合原语进行布局和数据展示
react-expert
用于行为正确性和可维护性:
- - 状态设计和数据流
- 严格的 TypeScript 优先组件模式
- 可访问性和可预测的渲染行为
- 非平凡 UI 的可选性能优化
根据已检查的上游指南:
- - 避免状态突变和不稳定的键
- 在副作用中使用语义结构和清理
- 为 props/数据提供清晰的类型化接口
标准因果链
使用此精确编排顺序。
- 1. 需求解析
- 2. 设计方向(frontend-design-ultimate)
- - 选择一个明确的美学模式。
- 定义调色板、字号比例、间距和页面布局。
- 决定深色模式令牌策略。
- 3. 组件架构(shadcn-ui)
- - 将 UI 块映射到组件原语(侧边栏、卡片、标签页、表格、徽章)。
- 声明所引用原语所需的 shadcn 安装。
- 4. React 粘合逻辑(react-expert)
- - 实现类型化数据模型和渲染循环。
- 在需要的地方添加本地状态/钩子。
- 保持逻辑简单且确定性,便于复制粘贴使用。
- 5. 输出组装
- - 默认生成一个 .tsx 文件。
- 包含简短的 Setup 部分,列出所需的安装命令。
- 包含 Assumptions 和 Adaptation Notes。
输出契约
默认输出必须包含:
- 缺失依赖的精确 npm/npx 命令
- 生成代码使用的 shadcn 组件添加命令
- 一个自包含的 TypeScript React 组件
- 顶部列出导入
- 除非用户提供真实数据源,否则包含内联模拟数据
- 由于缺少输入而选择的明确默认值
- 在哪里接入真实 API 数据
- 如果某个组件不可用,应移除哪些导入
不生成辅助脚本。除非用户明确要求,否则不生成多文件脚手架。
图表处理规则
如果目标项目中不保证有图表库:
- - 默认使用带有占位符的语义化“图表就绪”卡片布局,或
- 在同一个 .tsx 中使用轻量级内联 SVG 图表逻辑。
不要虚构不可用的图表组件。
如果使用外部图表库(例如 Recharts),请包含安装命令并明确标记为可选。
场景映射:收入仪表盘(深色模式)
对于场景:
“我需要一个显示收入指标的深色模式仪表盘”
执行:
- 1. frontend-design-ultimate 定义深色调色板、粗体排版和仪表盘布局(侧边栏 + 指标网格 + 图表区域)。
- shadcn-ui 将布局映射到 Card、Badge、Tabs、可选的 Sidebar 原语。
- react-expert 为 KPI 磁贴和趋势视图创建类型化指标数组和渲染循环。
- 最终输出返回一个可投入生产的 .tsx 组件及设置命令。
质量门控
在最终确定输出前,确保:
- - 组件可作为 TSX 编译(发出的代码中没有缺失符号)
- 设计是有意为之的,不是默认模板的通用设计
- 深色模式令牌一致且可读
- 包含移动端行为(sm/md/lg 响应式策略)
- 所有引用的 UI 组件都列在设置命令中
- 没有将虚假 API 调用呈现为真实集成
如果任何门控失败,返回 Needs Revision 并附上具体缺失项列表。
防护措施
- - 不要在没有列出依赖假设的情况下声称“开箱即用”。
- 不要发出未在设置中声明的库中的组件。
- 不要隐藏未解决的决策(在 Assumptions 下说明)。
- 优先提供一个高质量的组件,而不是广泛但浅显的脚手架。
失败处理
- - 缺少上游技能:停止并报告确切缺失的技能。
- 缺少项目上下文:输出通用 React 版本并标记适配点。
- 缺少图表依赖:提供回退渲染路径和可选安装命令。
- 冲突约束(例如“单文件”+“完整应用路由”):优先满足单文件契约并记录权衡。