product-design
lobehub/lobehub · Agent Skill
使用真實的 LobeHub UI 堆疊建立互動式 HTML 原型,重點關注互動而非程式碼風格。
前往安裝 ↓總覽
| 發布者 | |
|---|---|
| 儲存庫 | lobehub/lobehub ↗ |
| 技能資料夾 | design-prototype |
| 星 | 82,305 |
| 附帶檔案 | 1 |
| 授權 | 未標示 — 請向作者確認 |
| 最近更新 | 2026年9月6日 |
| 連結 | 技能原始碼 ↗ · 儲存庫 ↗ |
Mozgi 檢查
我們在技能檔案中發現的內容。詳細資訊需訂閱。
安裝
技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。
把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。
Install the “product-design” skill from mozgi.io (https://mozgi.io/skills/product-design/) for me. 1. Download the archive: https://mozgi.io/skills/product-design/download If it fails, take the skill folder from the source: https://github.com/lobehub/lobehub/tree/canary/.agents/skills/design-prototype 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “product-design” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/product-design/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch canary https://github.com/lobehub/lobehub.git /tmp/lobehub mkdir -p .claude/skills cp -r /tmp/lobehub/.agents/skills/design-prototype .claude/skills/design-prototype
重新啟動 Claude Code — 技能就會出現在清單中,手動呼叫:/product-design。要套用到所有專案,請放在 ~/.claude/skills。
git clone --depth 1 --branch canary https://github.com/lobehub/lobehub.git /tmp/lobehub mkdir -p .agents/skills cp -r /tmp/lobehub/.agents/skills/design-prototype .agents/skills/design-prototype
Codex 會從目前資料夾往上到儲存庫根目錄,在 .agents/skills 中尋找技能;用 /skills 或 $product-design 呼叫。所有專案:~/.agents/skills。
git clone --depth 1 --branch canary https://github.com/lobehub/lobehub.git /tmp/lobehub mkdir -p .cursor/skills cp -r /tmp/lobehub/.agents/skills/design-prototype .cursor/skills/design-prototype
Cursor 啟動時會載入技能;在 Agent 聊天輸入「/」呼叫。Cursor 也會讀取 .claude/skills 與 .agents/skills。所有專案:~/.cursor/skills。
git clone --depth 1 --branch canary https://github.com/lobehub/lobehub.git /tmp/lobehub mkdir -p .gemini/skills cp -r /tmp/lobehub/.agents/skills/design-prototype .gemini/skills/design-prototype
任務符合時,Gemini CLI 會提議啟用技能,由你確認。所有專案:~/.gemini/skills。
安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。
SKILL.md 內容
作者原文 · 唯讀Design Prototype
One HTML file, double-click to open, fully interactive, rendered by the **actual
design system** (@lobehub/ui 5.x + antd 6 + antd-style tokens, exact versions from
this repo's node_modules) — while the source stays production-style React
(import { Block } from '@lobehub/ui', createStyles(({ css, token }) => …), hooks,
memo). Promotion to production is mostly "split into files", not "rewrite".
Prototype code may be quick-and-dirty (one file, no i18n, inline data) — but the
interaction must be complete: states, transitions, and affordances are the point
of a prototype, not its code style.
How it works
one-time (~2s, cached): scripts/build-runtime.sh → lobe-prototype-runtime.js (IIFE global)
+ vendored babel.min.js
per prototype (no build): single HTML = <script runtime> + babel-standalone
+ <script type="text/babel"> with production-style React
- The runtime bundles
react,react-dom/client,@lobehub/ui,@lobehub/ui/base-ui,
antd (curated subset), antd-style, lucide-react from the repo's own
node_modules — so tokens/components/versions match production, and react/emotion/
theme-context are singletons by construction.
- A 3-line
window.requireshim + babel'stransform-modules-commonjslets the
prototype keep real import statements.
ThemeProvider themeMode="auto"→ light/dark follow the OS.
> ⚠️ Don't re-attempt the pure-CDN route (esm.sh import maps). It was tried and
> rejected: esm.sh's CJS named-export analysis fails serially across antd's dep chain
> (@ant-design/fast-color → @ant-design/colors → @rc-component/qrcode → …), and
> ?bundle leaks an unversioned react-is 404. Whack-a-mole, not a foundation.
Quickstart
1. Build the runtime into the prototype's directory (any dir works; /tmp is fine):
```bash
bash .agents/skills/design-prototype/scripts/build-runtime.sh /tmp/my-proto
```
Skip if lobe-prototype-runtime.js + babel.min.js are already there and the
design-system versions haven't bumped.
2. Copy references/template.html ↗ into the same dir,
rename, and replace the sample App with the real surface. Keep the runtime shim
block untouched.
3. Open it (open /tmp/my-proto/xxx.html) — no server, no build.
Verify before delivering
Headless-check it renders with zero console errors (the repo's e2e Playwright works):
// node /tmp/check.mjs — adjust paths
import { chromium } from '<repo>/e2e/node_modules/playwright/index.mjs';
const b = await chromium.launch();
const p = await b.newPage();
const errs = [];
p.on('pageerror', (e) => errs.push(String(e)));
await p.goto('file:///tmp/my-proto/xxx.html');
await p.waitForSelector('#root *', { timeout: 30000 });
await p.screenshot({ path: '/tmp/proto.png' }); // Read the screenshot yourself
console.log('errors:', errs);
await b.close();
Then Read the screenshot — a prototype is a visual deliverable; don't ship it
sight-unseen. Check light + dark (emulate prefers-color-scheme) and a narrow
viewport if the surface has a mobile story.
What's in the runtime (extend freely)
See assets/entry.mjs ↗ — the single source of truth. Currently:
@lobehub/ui: ActionIcon, Alert, Avatar, Block, Button, Center, Collapse,
DraggablePanel, Drawer, DropdownMenu, Empty, Flexbox, Highlighter, Hotkey, Icon,
Image, Input, InputNumber, Markdown, Modal, NeuralNetworkLoading, Popover,
ScrollShadow, SearchBar, Segmented, Select, Skeleton, SortableList, Tabs, Tag,
Text, TextArea, ThemeProvider, Tooltip
@lobehub/ui/base-ui: full namespace (Select, Modal, DropdownMenu, Switch, Toast,
FloatingSheet, …)
antd: App, Badge, Checkbox, Divider, Dropdown, Progress, Radio, Slider, Space,
Steps, Table
antd-style,lucide-react,react,react-dom/client: full namespaces
Missing a component → add to entry.mjs, rerun the build script (\~2s). Sizes:
curated ≈ 16MB (fine from disk); a full export * from '@lobehub/ui' works too
(≈ 27MB) if you'd rather never curate.
Pitfalls
Switchlives in@lobehub/ui/base-ui, not the root package (as do the other
base-ui primitives). Importing it from the root fails the runtime build.
- Use
createStyles(runtime), notcreateStaticStyles— static extraction
needs a build step. This is the one sanctioned deviation from production style;
note it when handing the prototype to an implementer.
- babel must stay the raw UMD file (unpkg/jsdelivr). esm.sh rewrites it to ESM
and a classic <script src> chokes on export.
- The require shim throws with the module name when an import isn't in the runtime —
that's the "add to entry.mjs and rebuild" signal, not a template bug.
Text typeaccepts onlysecondary|success|warning|danger|info;Tag colorhas
no primary (DESIGN.md "Applying tokens in components").
Design bar (same as production surfaces)
A prototype is a surface — the ux checklists apply to what it
_demonstrates_:
- Show at least one non-happy-path state (empty / loading / error / in-progress),
ideally behind a state-toggle strip like the template's. A happy-path-only
prototype under-specifies the design and silently blesses missing states.
- Reuse the app's surface contracts: side panels are
DraggablePanel
(collapse + drag-resize come free), loading is skeleton/NeuralNetworkLoading
(never antd Spin), modals via createModal-style flows.
- Don't paint affordances you don't wire (
cursor: zoom-inwith no zoom, keycap
chips with no keys) — in an _interactive_ prototype a dead affordance is a spec bug.
- Walk the ux Quick review against the prototype before delivering; annotate
anything deliberately out of scope in an HTML comment so the implementer knows
it's a cut, not a decision.
常見問題
product-design 技能有什麼用途?
使用真實的 LobeHub UI 堆疊建立互動式 HTML 原型,重點關注互動而非程式碼風格。
如何安裝 product-design?
打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。
product-design 適用哪些 AI 模型?
技能是純 Markdown 指示(Agent Skills 格式),因此 product-design 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。
product-design 是免費的嗎?
此技能由 lobehub 公開發布。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。儲存庫未標示授權 — 商業使用前請向作者確認條款。
安裝技能安全嗎?
技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。
技能和 MCP 伺服器或外掛有何不同?
MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。