/install style-transfer
style-transfer(风格迁移)
将目标网站的设计风格迁移到指定项目中
Workflow
Step 1 — Extract design from target website
npx designlang https://target-website.com/ --full
Or for faster extraction (no screenshots/interactions):
npx designlang https://target-website.com/
Output goes to ~/.designlang/{domain}.json and ~/.hermes-agent/workspace/design-extract-output/.
Step 2 — Detect project type
Inspect the project at the target path:
# Detect framework
ls /path/to/project/src/ # Vue/React
ls /path/to/project/ # Next.js (app/, pages/)
cat /path/to/project/package.json | grep -E "vue|react|next"
# Detect styling approach
ls /path/to/project/src/assets/styles/ # SCSS/CSS variables
cat /path/to/project/tailwind.config.js # Tailwind
cat /path/to/project/src/style.css # Plain CSS
cat /path/to/project/src/App.vue # Vue SFC styles
Step 3 — Read extracted design files
Key files to read from ~/.hermes-agent/workspace/design-extract-output/:
| File | Purpose |
|---|---|
*-design-tokens.json |
DTCG format tokens (primitive + semantic) |
*-tailwind.config.js |
Tailwind theme config |
*-shadcn-theme.css |
shadcn/ui CSS variables |
*-global.css / *-variables.css |
CSS custom properties |
*-design-language.md |
Full design doc (colors, fonts, spacing) |
*-gradients.css |
Brand gradients |
*-motion-tokens.json |
Animation tokens |
Step 4 — Apply styles based on project type
Vue 3 + Vite project
global.scss / main CSS — replace CSS variables:
// src/assets/styles/global.scss
// Replace :root variables with extracted tokens
:root {
--primary-color: #7f41ff; // from design-tokens.json
--bg-color: #fdfcff;
--text-primary: #261c3a;
--border-color: #d9bfe2;
--radius: 16px;
--shadow: 0 0 24px rgba(0,0,0,0.03);
--gradient-brand: linear-gradient(90deg, #7f41ff, #ab8ee8);
}
Add Google Fonts to index.html:
\x3Clink href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
Component styles — update \x3Cstyle> blocks:
- Replace button
backgroundwith--gradient-brand - Replace
border-radiusvalues with--radius - Replace shadows with
--shadow - Update tag styles to pill shape (
border-radius: 999px)
Next.js / React project
Tailwind config — merge extracted tokens:
// tailwind.config.js
colors: {
primary: '#7f41ff',
secondary: '#ab8ee8',
accent: '#d9bfe2',
}
globals.css:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--primary: #7f41ff;
--background: #fdfcff;
}
}
Plain HTML / Static site
Inject the *-variables.css content into \x3Cstyle> tag and add Google Fonts link.
Step 5 — Build and verify
cd /path/to/project
npm run build
# or
npm run dev
Check dist output for:
- CSS contains new color tokens (grep for primary hex)
- No build errors
- Font loaded correctly
Common Pitfalls
- npx designlang hangs — use without
--fullflag, timeout after 120s - Project has no src/styles — create
src/assets/styles/global.scssand import inmain.js/main.tsx - CSS variable conflicts — ensure new variables override old ones; check specificity
- Font not loading — verify Google Fonts URL in
\x3Chead>, check network - Tailwind purge removes new classes — ensure design tokens are in
content[]paths - Vue scoped styles — CSS vars defined in
:rootorglobal.scssleak into scoped styles correctly
Verification Commands
# Check CSS variables applied
grep -o "#[0-9a-fA-F]\{6\}" dist/assets/*.css | sort | uniq
# Check gradient applied
grep -c "gradient" dist/assets/*.css
# Check font loaded
grep "fonts.googleapis" dist/index.html
Project Path Resolution
If user says "my project" without specifying path:
- Check current working directory for
package.json - Check
../for project withsrc/directory - Ask user for explicit path if ambiguous
Example Conversation
User: "把 withlantern.com 的样式应用到我的 Vue 项目里"
npx designlang https://withlantern.com/→ extract design- Read
*-design-tokens.json→ get color palette - Read
*-global.css→ get CSS variables - Read project's
src/assets/styles/global.scss→ apply new variables - Add Google Fonts to
index.html - Update component button styles to use gradient
npm run build→ verify
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install style-transfer - 安装完成后,直接呼叫该 Skill 的名称或使用
/style-transfer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Style Transfer(风格迁移) 是什么?
提取目标网站的设计系统并应用到指定项目中(Vue/React/Next.js/Tailwind)。当用户说「把 XX 网站的样式应用到我的项目」或「用 Y 的风格重新设计」时使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 33 次。
如何安装 Style Transfer(风格迁移)?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install style-transfer」即可一键安装,无需额外配置。
Style Transfer(风格迁移) 是免费的吗?
是的,Style Transfer(风格迁移) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Style Transfer(风格迁移) 支持哪些平台?
Style Transfer(风格迁移) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Style Transfer(风格迁移)?
由 manniu(@babywhale)开发并维护,当前版本 v1.0.0。