High-Fidelity Demo Creation Skill (demo-mirror)
Applicable Scenarios
- Customer on-site/remote presentations where it is inconvenient to show the real device or start the full environment — use a web page as a stand-in.
- External roadshows, investment pitches, or reports that require a static presentation of "full capability and performance runtime."
- Walkthrough and acceptance testing: freeze the UI state of a specific version as a demo.
Core Hard Rules (Violate Any and Rework)
- Mirror, not creation: Every page in the demo must correspond to a real page in the production code (real route, real component structure, real copy). Do not design interfaces that do not exist in production based on your own understanding.
- Fix production first, then mirror: If the demo requires a page that does not exist in production (missing page/entry), you must first add the page/endpoint in the production code, then mirror it in the demo. The demo must never be ahead of production.
- Three synchronous sources:
- Structure synchrony — the page skeleton, navigation, layout parameters (column width, border radius, spacing) are copied from production components.
- Visual synchrony — colors, fonts, shadows are copied from production design tokens; do not invent your own color scheme.
- Data synchrony — demo data is taken from production seeds/configurations (seed, bundle, preset, fencing rules, etc.); values on both terminals must match; avoid making up numbers.
- Two terminals, two formats: Fixed output of 4 items — PC HTML, mobile HTML, PC static PDF, mobile static PDF (PDF is synthesized by headless screenshots of HTML views, one page per view).
- Clickable: HTML demo navigation, tabs, approval gestures, and buttons must be clickable and provide state feedback (toast/state toggle); no static images.
Method (Fixed Six Steps)
Step 1 · Audit Real Render Surfaces (Must complete before writing any demo code)
- List all routes and pages of the production frontend (e.g., Route table in App.tsx).
- Read the shell components (layout, top bar, navigation, branding) and theme tokens (colors, semantic colors, font size scale).
- Read the area composition and key components of each page (messaging groups, cards, tables, gestures).
- Read data sources: seed scripts, bundle configurations, presets/fencing/skills lists, extract demo persona and workspace data.
Step 2 · Fill Production Gaps
- If the demo requires an interface that does not exist in production → first develop the production page and connect it to a real endpoint, register the route and entry point.
- Production changes must pass production's own typecheck/test gate before proceeding to the next step.
Step 3 · Mirror Page by Page (PC)
- Pure HTML+CSS+JS single file (no external dependencies, no CDN), hand-write CSS equivalent to production tokens.
- Page switches correspond to real routes; each view must be annotated with its production route source (e.g.,
P2 · /p2/:threadId). - Supports hash direct access (
#p1…#pN), enabling per-view screenshots and walkthrough.
Step 4 · Mirror Screen by Screen (Mobile)
- Base on the mobile-facing pages from production (not a scaled-down PC page).
- Phone frame + bottom tab; also supports hash direct access (
#xxx). - Data is fully synchronous with the PC terminal, values are consistent.
Step 5 · Verification (Machine-provable, not by feeling)
- Take per-view screenshots with a headless browser; manually check each for visual quality (layout, contrast, broken copy).
- Use
--dump-domto verify that each view's content is actually rendered (non-empty, key copy present). - Perform hash deduplication checks on multi-view screenshots to confirm that switches are truly effective.
- Check the console for no script errors; emoji rectangles and similar headless font issues must be identified (not bugs, do not rework).
Step 6 · Output and Archive
- Name the 4 deliverables:
{project}-demo-pc.html,{project}-demo-mobile.html,{project}-demo-pc.pdf,{project}-demo-mobile.pdf. - HTML files go into the repository under
docs/demo/and evolve with version; PDFs are one-time deliverables. - Maintenance discipline: When production adds a new page → the demo adds a mirror for it; when production changes design tokens → the demo updates its color values. The demo never evolves independently.
Delivery Contract
- Each delivery must include: a view-to-route mapping table, a data source description (which seed/configuration), and verification evidence (screenshot list).
- Prohibit delivering "capabilities that do not exist in production"; if the customer requests a feature that is not yet implemented, it must be explicitly marked as "in planning" rather than disguised as existing.
- PDF: each page = a full static screenshot of one view, ordered according to the user's real action flow.
Boundaries (What Not to Do)
- Do not create visually "flashier" elements unrelated to production.
- Do not fabricate business numbers beyond production data in the demo.
- Do not use screenshots to fake interactive interfaces (HTML must be clickable); do not use static images to fake videos.