Skip to content
cccskills
FreePublished on GitHubEnglish overview

design-prototype

Use this guide to create a fully interactive, single-file HTML prototype with the repository’s actual LobeHub UI components and styles. It explains the runtime setup, theming, and interaction checks so teams can explore screen behavior before production implementation.

OriginalShow the original description

Use for interactive HTML prototypes (交互原型) with the real LobeHub UI stack. Excludes production UI implementation.

lobehub/lobehub83,504 stars(GitHub 83,504 + cccskills 0)
Works withPlaywright

Run score Not tested

See how to install

Good for

  • Prototyping an interactive product screen
  • Trying light and dark themes with real UI components
  • Demonstrating loading, empty, or error states
  • Checking interactions before production implementation

Overview

What it does

This guide explains how to create an interactive, single-file HTML prototype using LobeHub’s actual UI components and styles. It uses dependencies from the repository to prepare a runtime, then describes screens and interactions in React-style code. Themes can follow the operating system’s light or dark setting, or be specified directly. The HTML can be opened for review without running a build or server. The guide emphasizes functional controls, state changes, and transitions after actions. It also describes checking for console errors and reviewing screenshots, including a narrow viewport when relevant.

When it helps

Use it to explore screen hierarchy and interaction flows with UI that closely matches the real product. It is useful when people need to review empty, loading, or error states along with the normal state, before the production screen is implemented.

Example requests

  • “Turn this screen concept into an HTML prototype using LobeHub UI components.”
  • “Create an interactive screen I can review in both light and dark themes.”
  • “Prepare a prototype that can switch between empty and error states.”

Notes

Runtime setup uses the repository’s node_modules. On the first run, babel.min.js is downloaded from unpkg. This skill creates prototypes, not production UI implementations.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Document check

AI checked the SKILL.md for operations that need care and for setup requirements. The score comes only from actually running the skill (hands-on test).

SafetyAre sending data, deleting files, and running commands disclosed?
BPartly lackingIt runs scripts and downloads from unpkg on first use, without describing content verification.
Easy setupDoes it need few tools or API keys, and are they documented?
BPartly lackingIt requires repository node_modules and a first-run babel.min.js download.

Not counted in the score. Rated by AI (OpenAI Codex) as of Oct 26, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (5)

  • SKILL.md8.1 KB
  • assets/.gitignore66 B
  • assets/entry.mjs858 B
  • references/template.html3.6 KB
  • scripts/build-runtime.sh1.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Design Prototype

One HTML file, double-click to open, fully interactive, rendered by the actual design system (@lobehub/ui 6.x components, compiled style.css, --lobe-* theme tokens — exact versions from this repo's node_modules) — while the source stays production-style React (import { Block } from '@lobehub/ui', createStaticStyles(({ css, cssVar }) => …), 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)
                                                       + lobe-prototype-runtime.css
                                                       + vendored babel.min.js
per prototype (no build): single HTML  =  <link css> + <script runtime> + babel-standalone
                          + <script type="text/babel"> with production-style React
  • The runtime bundles react, react-dom/client, the full @lobehub/ui namespace, lucide-react and motion from the repo's own node_modules — so tokens/components/ versions match production, and react/emotion/theme-scope are singletons by construction.
  • entry.mjs also imports @lobehub/ui/theme.css + global.css + style.css (the same three the app loads in src/layout/GlobalProvider/AppTheme.tsx); esbuild emits them as lobe-prototype-runtime.css, linked from the template's <head>.
  • A 3-line window.require shim + babel's transform-modules-commonjs lets the prototype keep real import statements.
  • Theming is CSS attributes, not a provider: the template's head script calls setLobeTheme({ appearance }) from prefers-color-scheme (and on change), so light/dark follow the OS before first paint. Force a theme with setLobeTheme({ appearance: 'dark' }), or <ThemeScope appearance="dark"> for an island. The React tree is wrapped in <ConfigProvider motion={motion}> like the app's AppTheme (motion for Button, Drawer, Modal, …, plus fonts, focus ring and the popup portal host) and <ToastHost /> for toast.

⚠️ Don't re-attempt the pure-CDN route (esm.sh import maps). It was tried and rejected: esm.sh's CJS named-export analysis failed serially across the dep chain and ?bundle leaked an unversioned react-is 404. Bundling from the repo's own node_modules is the only way to match production versions exactly.

Quickstart

  1. Build the runtime into the prototype's directory (any dir works; /tmp is fine):

    bash .agents/skills/design-prototype/scripts/build-runtime.sh /tmp/my-proto
    

    Skip if lobe-prototype-runtime.{js,css} + babel.min.js are already there and the design-system versions haven't bumped. The first run downloads babel.min.js from unpkg (pinned); later runs reuse it.

  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: full namespace — every component (Button, Input, Modal, createModal, confirmModal, Table, Switch, Checkbox, Radio, Badge, Progress, Slider, Steps, Divider, DropdownMenu, Accordion, Collapsible, Spin, Skeleton, DraggablePanel, FloatingSheet, …) plus toast / ToastHost, MotionProvider, setLobeTheme, ThemeScope, useThemeMode, useTheme, and the styling API createStaticStyles, cssVar, cx, css, keyframes, responsive, useResponsive
  • @lobehub/icons: Amp, ClaudeCode, Codex, HermesAgent, OpenClaw, OpenCode
  • lucide-react, motion/react, motion/react-m, react, react/jsx-runtime, react-dom, react-dom/client: full namespaces

Not included: @lobehub/ui/form, @lobehub/ui/pro-table, @lobehub/ui/chat and the other subpaths — add import * as x from '@lobehub/ui/<sub>' + a '@lobehub/ui/<sub>': x entry and rebuild (~2s). Size ≈ 17MB JS + 0.3MB CSS (fine from disk).

Picking the v6 equivalent

  • Feedback: toast.success(…) + <ToastHost />; dialogs: Modal, createModal, confirmModal.
  • Menus: DropdownMenu items={…} (opens on click); context menus: ContextMenuTrigger.
  • Layout: Flexbox horizontal gap={…} / Center / Grid — there is no Space.
  • Disclosure: Accordion for several sections, Collapsible for one region.
  • Badge, Checkbox, Divider, Progress, Radio, Slider, Steps, Switch, Table (columns / dataSource / rowSelection) are root exports.
  • Unsure about a name → check node_modules/@lobehub/ui/es/index.d.mts rather than guessing; an unknown import is undefined at runtime, not a build error.

Pitfalls

  • Style with createStaticStyles + cssVar.* exactly as production does — it is emotion-backed and inserts at call time, so it needs no build step. Tokens resolve to var(--lobe-*) and flip with the theme; never hardcode light/dark colors.
  • Component styles live in cascade layers (lobe-base, lobe-popup, lobe-ui), so any unlayered CSS in the prototype's <style> beats them. Override through className / style / classNames / styles slot props, not global selectors like button { … }.
  • Keep the <link> to lobe-prototype-runtime.css — without it components render unstyled and --lobe-* tokens are undefined.
  • 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 type accepts only secondary|success|warning|danger|info; Tag color has 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 follows the ux skill's feedback §4.1 scenario table (Skeleton / Spin, variant="network" only for AI work), modals via createModal-style flows.
  • Don't paint affordances you don't wire (cursor: zoom-in with 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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

acceptance

FreeSummary

Use this skill to verify a delivery by exercising the real product through a suitable surface such as a CLI, web app, desktop app, or iOS Simulator. It helps create or find a verification plan, capture evidence, and publish an acceptance report.

  • Verifying a completed product change
  • Collecting screenshots or other evidence
  • Creating a verification plan and report
lobehub/lobehub83.5KUpdated Oct 26, 2026

Use this skill to add an AI model provider to LobeHub across runtime integration, model cards, settings, branding, documentation, and acceptance checks. It also covers provider documentation updates and distinguishes new providers from models added to an existing provider.

  • Integrating a new AI model provider into LobeHub
  • Updating setup or usage documentation for a provider
  • Checking whether a model needs a new provider integration
lobehub/lobehub83.5KUpdated Oct 26, 2026

add-setting-env

FreeSummary

Use this skill to add a server-side environment variable that sets a default for a user setting. It walks through validation, server configuration and store merging, plus updating the example environment file and self-hosting documentation.

  • Adding an environment variable for a setting default
  • Wiring a new setting domain into server config
  • Documenting a new variable for self-hosting
lobehub/lobehub83.5KUpdated Oct 26, 2026

Provides guidance for registering hooks around an agent’s execution steps, tool calls, human approvals, context compression, and sub-agent calls. Hooks can observe events, supply local mock tool results, or use webhooks to allow or deny tool results under configured policies.

  • Observing agent steps and tool errors
  • Mocking tool results during local execution
  • Requiring webhook decisions before or after a tool call
lobehub/lobehub83.5KUpdated Oct 26, 2026

agent-signal

FreeSummary

Build event-driven background workflows for agents by defining sources, interpreting them as signals, and running actions through policies. It also guides asynchronous handoffs, deduplication, scoped execution, completion receipts, and observability.

  • Adding a new event source to an agent workflow
  • Routing interpreted signals to concrete background actions
  • Enqueuing work for asynchronous processing
lobehub/lobehub83.5KUpdated Oct 26, 2026

Use this skill to run end-to-end acceptance checks for bot channels in real desktop chat apps. It drives apps such as Discord, Slack, Telegram, WeChat, Lark, and QQ to send a message, wait for a response, and capture the result.

  • Checking a bot response in a real Discord channel
  • Testing chat behavior through Slack or Telegram
  • Capturing a bot interaction in a native macOS app
lobehub/lobehub83.5KUpdated Oct 26, 2026

See all skills by lobehub

Report a problem with this skill