← 返回 Skills 市场
babywhale

Style Transfer(风格迁移)

作者 manniu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
33
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install style-transfer
功能描述
提取目标网站的设计系统并应用到指定项目中(Vue/React/Next.js/Tailwind)。当用户说「把 XX 网站的样式应用到我的项目」或「用 Y 的风格重新设计」时使用。
使用说明 (SKILL.md)

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 background with --gradient-brand
  • Replace border-radius values 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

  1. npx designlang hangs — use without --full flag, timeout after 120s
  2. Project has no src/styles — create src/assets/styles/global.scss and import in main.js / main.tsx
  3. CSS variable conflicts — ensure new variables override old ones; check specificity
  4. Font not loading — verify Google Fonts URL in \x3Chead>, check network
  5. Tailwind purge removes new classes — ensure design tokens are in content[] paths
  6. Vue scoped styles — CSS vars defined in :root or global.scss leak 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 with src/ directory
  • Ask user for explicit path if ambiguous

Example Conversation

User: "把 withlantern.com 的样式应用到我的 Vue 项目里"

  1. npx designlang https://withlantern.com/ → extract design
  2. Read *-design-tokens.json → get color palette
  3. Read *-global.css → get CSS variables
  4. Read project's src/assets/styles/global.scss → apply new variables
  5. Add Google Fonts to index.html
  6. Update component button styles to use gradient
  7. npm run build → verify
安全使用建议
Before installing, use it only on a project you are comfortable modifying, confirm the exact project path, expect network access through `npx designlang` and Google Fonts, and review the resulting diff before committing changes.
能力评估
Purpose & Capability
The stated purpose is to extract a target website's design system and apply it to Vue, React, Next.js, Tailwind, or static projects; the instructed file edits, design-token reads, font link insertion, and build checks fit that purpose.
Instruction Scope
The skill directs broad style changes to project files and may infer a project path from the current or parent directory, but it also says to ask when the path is ambiguous and does not request unrelated authority.
Install Mechanism
There is no packaged executable or install script in the artifact, but runtime use of `npx designlang` and Google Fonts involves external network/package access that users should understand.
Credentials
Reading project files, writing style changes, and running `npm run build` or `npm run dev` are proportionate for a frontend style migration, though they can affect the user's working tree.
Persistence & Privilege
No elevated privileges, background workers, credential access, autostart, or durable persistence are requested; the only persistent outputs described are design extraction files under user home directories and normal project edits.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install style-transfer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /style-transfer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of style-transfer — extract and apply design systems from websites to Vue/React/Next.js/Tailwind projects. - Added workflow for extracting design tokens and system from any website using `npx designlang`. - Guides for detecting project frameworks and styling methods. - Instructions for mapping extracted tokens (colors, gradients, CSS vars, Tailwind config) into various frontend project types. - Common troubleshooting tips for build and style integration. - Verification steps to confirm styles are correctly applied. - Example conversation for converting a website design onto a user's project.
元数据
Slug style-transfer
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论