Jim Liu 宝玉 4e0910fbeb Add host-driven dc-op flow and UI fixes
Move rail mutations to a host-driven dc-op model and add several UI/print/interaction improvements.

- deck-stage: replace local "deckchange" emissions with a `dc-op` CustomEvent and implement _emitDcOp to emit ops (setAttr/removeAttr/move/remove/duplicate) while supporting optimistic index updates and a rail lock until the host acknowledges via {__dc_op_ack, applied}.
- Deck rail: add Duplicate action/UI, guard mutations with _railLock, and adapt live mutation observer to treat host-driven data-deck-skip updates (update thumb badge, print bookkeeping, and postMessage) without re-cloning slides.
- Print: add beforeprint/afterprint handlers and stylesheet tweaks to force animations/transitions to end-state for reliable printing; set data-deck-active on slides during print.
- Rework slide ops: implement duplication, guarded delete/move/skip logic that emits dc-op or falls back to local mutation when no dc-runtime is present.
- design-canvas: persist/restore viewport transform with a visibility backstop that resets transforms if the restored pan/zoom leaves content off-screen; add wheel passthrough so nested deck-stage rail keeps native scroll behavior.
- tweaks-panel: add a TweakSuggestionBar UI with a typewriter suggestions cycler and chat-post helper for edit-mode suggestions.
- image-slot: small comment wording fix.

These changes prepare the component to work with an external dc-runtime/editor host that owns light DOM mutations while preserving standalone HTML behavior.
2026-06-15 00:49:28 -05:00
2026-06-06 20:16:18 -05:00
2026-06-11 12:09:12 -05:00

baoyu-design

Run Claude Design on your own local agent — Cursor, Claude Code, Claude Desktop, or any filecapable coding agent.

English · 简体中文 · Changelog

License: MIT Best with Opus 4.8 Harness

baoyu-design packages Claude Design — the design engine behind claude.ai/design — as a portable Agent Skill. Drop it into a local agent and you get most of what the website does, right inside your editor: polished UI mockups, interactive prototypes, wireframes, landing pages, dashboards, mobile apps, and slide decks — all produced as selfcontained HTML.

No website, no separate subscription, no upload step. The agent already on your machine does the work, and every artifact stays in your repo.


Screenshots

The same Reader Mac App prompt was used in Cursor, Codex, Claude, and Claude Design.

Cursor Codex Claude Claude Design
Cursor running baoyu-design Codex running baoyu-design Claude running baoyu-design Claude Design running the same Reader Mac App prompt
Prompt used for all screenshots
Build a Reader Mac app that helps me read and save articles better. All data is stored locally.

## Information collection

1. Manual adding
Support manually adding different types of information:
- URL: enter a URL and automatically fetch content and images
- Attachments: upload PDFs, videos, and images
- Markdown editing: like publishing a blog post, enter the title, body, and cover image
- Other

2. Automatic subscriptions
- RSS feeds
- Social media accounts: X, Weibo, YouTube
- Other

## Editing and organization

1. Tags
Every item can have tags.

2. Categories and folders
Create tree-structured folders and place content in different categories.

3. Favorites
Users can click to favorite an item.

4. Editing
Every item can be edited with a built-in Markdown editor.

## AI assistance

1. Automatic translation
Support translation across different languages.

2. Summaries and abstracts
Generate summaries for captured content.

3. Derivative creation
Create new work based on one or more pieces of content.

4. Integrated AI Chat
Use AI Chat to call AI Agents that help process content.

Why run it locally

  • Free yourself from the website. You get the vast majority of claude.ai/design's capabilities without ever leaving your editor — same methodology, same craft standards, same output format.
  • Best with Opus 4.8. The skill is a long, demanding design brief; the stronger the model, the better the result. Pair it with Claude Opus 4.8 for the best output, and it still works well on other capable models.
  • Iterate by pointing, not describing. Because the deliverable is plain HTML served on localhost, you can lean on your agent's builtin browser preview and elementannotation tools (Cursor Browser / DevTools, Claude Preview, or Codex Browser). Point at a button in the live preview, say what you want changed, and the agent edits the underlying source — a tight, visual secondpass editing loop that's hard to get on a website.
  • Everything is yours. Output lands in designs/<project>/ as selfcontained HTML you can version, fork, export, or ship.

What it can make

The skill drives a full design process — clarifying questions → gathering design context → producing one or more HTML deliverables → previewing and verifying. It ships a deep bench of builtin skills and a set of readymade component scaffolds.

Area Builtin skills
Core design Hifi design · Interactive prototype · Wireframe · Frontend aesthetic direction
Decks Make a deck · Speaker notes
Mobile & motion Mobile prototype · Animated video · Sound effects
Design systems Create design system · Use design system · Design system preview · Design Components (.dc.html) · Make tweakable
Import sources Figma .fig (offline decode) · GitHub repo · Existing HTML/CSS
Export & handoff Standalone HTML · PDF · PPTX (editable) · PPTX (screenshots) · Send to Figma · Send to Canva · Handoff to Claude Code
AI assets & integration Gemini image generation · Call Claude from prototypes · Read PDF

Starter components (in starter-components/) save the agent from handrolling the basics: iOS / Android / macOS / browser frames, a panzoom design canvas, a slidedeck stage, a timeline animation engine, a tweaks panel, and a fillable image slot.


How it works

The skill is plain Markdown plus a few JSX/JS scaffolds — no build step, no runtime.

skills/baoyu-design/
├── SKILL.md              # Entry point — orchestrates the whole flow
├── system-prompt.md      # The design methodology & craft standards (source of truth)
├── references/
│   ├── claude.md         # Tool map for Claude Code
│   ├── cursor.md         # Tool map for Cursor
│   └── codex.md          # Tool map for Codex Agent
├── built-in-skills/      # Specialized prompts (decks, mobile, import, export, …)
└── starter-components/   # Device frames, deck stage, canvas, animation engine, …

When you ask for a design, the agent reads SKILL.md, loads the core methodology from system-prompt.md, detects whether it's running in Cursor, Claude Code, Codex Agent, or a generic filecapable harness, and reads the matching reference doc when one exists. It then pulls in only the builtin skill(s) the task needs. The split keeps craft rules harnessindependent while each environment resolves its own tools for asking questions, previewing, screenshotting, and verifying.


Quick start

Prerequisites

  • A local agent — Cursor, Claude Code, Codex, or any of the 70+ agents the installer supports (Cline, Roo Code, GitHub Copilot…). Cursor, Claude Code, and Codex have firstclass tool references inside the skill.
  • Claude Opus 4.8 selected as the model, for best results.
  • Node.js (to run the npx installer below). Python 3 is also handy for the local preview server.

Install

Recommended — the skills CLI. npx skills (from Vercel Labs) reads this repo, finds skills/baoyu-design/, and drops it into the right folder for whatever agent it detects:

# Install into the current project (autodetects your agent)
npx skills add JimLiu/baoyu-design

# …or install globally, for every project
npx skills add JimLiu/baoyu-design -g

# Target a specific agent explicitly
npx skills add JimLiu/baoyu-design --agent claude-code
npx skills add JimLiu/baoyu-design --agent cursor
npx skills add JimLiu/baoyu-design --agent codex

# Just list what's in the repo first
npx skills add JimLiu/baoyu-design --list

It installs to .claude/skills/ for Claude Code and .agents/skills/ for Cursor/Codex-style agents (add -g for the ~/level user install).

Alternative — hand the repo URL to your agent. Don't want to install anything? Paste the URL into chat and let the agent fetch the skill itself:

Read https://github.com/JimLiu/baoyu-design and follow its skills/baoyu-design/SKILL.md to design a settings screen for a meditation app.

The agent clones or fetches the repo, loads SKILL.md, and proceeds — perfect for a oneoff.

Use it

Once the skill is installed (or fetched), just describe a design task in plain language — it autoactivates from its description:

Design 3 hifi variations of a settings screen for a meditation app.

In Claude Code you can also trigger it explicitly with /baoyu-design; in Codex, mention $baoyu-design when skills are available. The agent asks a few clarifying questions, builds the HTML under designs/, and previews it over localhost. Point at any element in the live preview and say what to change — the agent edits the underlying source for a fast, visual second pass.

Preview server

Deliverables are previewed over HTTP (multifile prototypes won't load from file://). The agent normally starts this for you; to run it by hand:

python3 -m http.server 4311 --directory designs
# then open http://localhost:4311/<project>/<file>.html

Design systems

Beyond oneoff mockups, the skill can hold a whole project to a design system — a versioned bundle of a brand's tokens, fonts, components, and full UI kits. Systems live next to your projects under designs/: author one with the Create design system builtin skill, drop in a prebuilt one, or import one from a Figma .fig file (see the next section). Once a system exists, two flows let any project consume it.

Import an existing design system

When you start a design, the agent asks where to save it and which design system(s) to use — it discovers every system under designs/ and lists them, so you can pick none (free design), one, or several. Name one up front and it skips the menu:

Design a settings screen using the Fluent 2 design system.

For each system you choose, the agent syncs a selfcontained, versionpinned copy into your project at _ds/<slug>/, wires its CSS and component bundle into the page, and records the binding in the project's _d_meta.json. That local copy is what keeps the project portable and reproducible — nothing reaches outside the folder, and rerunning the import is how you pull updates later. Choose several systems and one becomes primary — it owns the overall look and wins any token collision, while the others lend specific components.

Use an imported design system

Once a system is bound it acts as a binding visual contract, not a loose suggestion: every screen is built from the system's real tokens, type, spacing, and components, and the agent won't invent offsystem colors or styles. If the system ships starting points — readymade screens or components — you can seed a new design from one instead of starting blank.

The binding travels with the project. Reopen it later and the agent reads _d_meta.json, reloads the system, and keeps designing instyle — no need to repick. From there you can refresh a system to pull updates, add another, swap which one is primary, or remove one entirely.


Import design sources

Real context beats description. Three builtin import skills turn material you already have into design ground truth the agent works from directly:

  • Figma .fig files — decoded fully offline. Export any Figma file as .fig (or grab a community kit), point the agent at it, and a vendored decoder reads it right on your machine — no Figma account, API token, or MCP server. The agent inventories pages, components, and variables, confirms scope with you, then either cherrypicks components as React code or emits the whole kit as a design system: components regrouped semantically, curated token CSS, real SVG/PNG assets extracted from the file (copied, never redrawn), guideline cards, and a brandguide README.
  • GitHub repos. Hand it a repo URL as a design source. The agent browses the tree with gh api before cloning anything, sparsecheckouts only the paths it needs into a scratch dir outside your project, and records the repo URL as provenance.
  • Existing HTML/CSS. Saved pages or a local codebase work as a design reference: the agent reads the real stylesheets instead of squinting at screenshots, lifts exact values (colors, type, spacing, radii, shadows, interaction states) into your project's own custom properties, and copies referenced assets out.

Anything imported as a design system compiles into a single selfcontained, interactive preview.html. This is the community Chakra UI Figma Kit .fig after one import conversation — 28 components in semantic groups, 400+ curated tokens, guideline cards, and a selfauthored showcase, all browsable in one file:

preview.html of a design system imported from the Chakra UI Figma Kit .fig

Example prompts

  • "Design 3 hifi variations of a pricing page using the brand in this screenshot."
  • "Prototype a working onboarding flow — real state, transitions, form validation."
  • "Make a 10slide deck from this PRD for an engineering allhands."
  • "Wireframe a few layout ideas for a mobile expensetracker home screen."
  • "Recreate the composer UI from this codebase, then export it as standalone HTML."
  • "Turn this UI kit .fig into a design system, then build a dashboard with it."
  • "Build a dashboard using our design system, starting from its analytics screen."

For best results, give it design context — a screenshot, a UI kit, a Figma .fig export, or a codebase. Starting from real context is the single biggest lever on quality; the skill will ask for it if you don't provide it.


Credits & license

This project repackages Claude Design, the design skill by Anthropic that powers claude.ai/design, so it can run on local agents. It is an independent, community effort and is not affiliated with or endorsed by Anthropic.

Repackaged and maintained by Jim Liu 宝玉. Released under the MIT License.

S
Description
baoyu-design: Create polished design artifacts as self-contained HTML: UI mockups, interactive prototypes, wireframes, landing pages, dashboards, app screens, mobile apps,…; release-skills: Universal release workflow. Auto-detects version files and changelogs. Supports Node.js, Python, Rust, Claude Plugin, GitHub Releases, annotated tags,…
Readme MIT 8.2 MiB
Languages
JavaScript 80.6%
TypeScript 18.8%
HTML 0.6%