← 返回
开发者工具 Key 中文

Zeplin to Prompt

Export one or more Zeplin screen URLs into a structured layer tree with local assets and package the result as a zip file. Use when a user shares an app.zepl...
将一个或多个 Zeplin 屏幕 URL 导出为带本地资源的结构化图层树,并打包为 ZIP。用于用户分享 app.zepl... 时。
sullivangu
开发者工具 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 489
下载
💾 7
安装
1
版本
#latest

概述

Zeplin Export Skill

Export Zeplin designs into a structured layer tree plus local assets, then package the result as a zip file. Multiple screen links are supported.

Execution Flow

Step 1: Extract URLs and build the screen task list

Run the following Bash command to extract all Zeplin URLs from the user message:

printf '%s\n' "$INPUT" | grep -Eo 'https://app\.zeplin\.io/project/[^[:space:]]+' || true

If the output is empty, reply with:

Please provide one or more Zeplin Screen links, for example:
/zeplin-to-prompt https://app.zeplin.io/project/xxx/screen/aaa
https://app.zeplin.io/project/xxx/screen/bbb

Then stop.

For each extracted URL, use the regex /\/project\/([^\/]+)\/screen\/([^\/?#]+)/ to extract projectId and screenId:

  • If it matches a screen URL, add it to the task list: [{url, projectId, screenId}, ...]
  • If it does not include /screen/ and is only a project URL, ask the user to provide a screen URL instead and skip that URL

Step 2: Look up a token for each project

Tokens are stored in ~/.zeplin-skill-config.json as a projectId -> token mapping:

{
  "projects": {
    "<project-id-1>": "eyJhbG...",
    "<project-id-2>": "eyJhbG..."
  }
}

For each distinct projectId in the task list, run:

node -e "
const fs = require('fs');
const p = process.env.HOME + '/.zeplin-skill-config.json';
try {
  const cfg = JSON.parse(fs.readFileSync(p, 'utf8'));
  const t = (cfg.projects || {})[process.env.PROJECT_ID];
  if (t) { process.stdout.write(t); process.exit(0); }
} catch {}
process.exit(1);
" PROJECT_ID="<projectId>" 2>/dev/null
  • Exit code 0: use that token for all screens under the project
  • Exit code 1: reply with
No access token was found for project {projectId_masked}.

Please provide a Zeplin Personal Access Token for this project:
1. Open Zeplin -> avatar menu -> Profile Settings
2. Open Personal access tokens -> Create new token
3. Copy the token and send it back

After receiving the token, save it with:

node -e "
const fs = require('fs');
const p = process.env.HOME + '/.zeplin-skill-config.json';
let cfg = {};
try { cfg = JSON.parse(fs.readFileSync(p, 'utf8')); } catch {}
cfg.projects = cfg.projects || {};
cfg.projects[process.env.PROJECT_ID] = process.env.TOKEN;
fs.writeFileSync(p, JSON.stringify(cfg, null, 2), {mode: 0o600});
" PROJECT_ID="<projectId>" TOKEN="<user-provided-token>"

Then continue exporting.

Step 3: Export each screen

For each screen task, run:

ZEPLIN_TOKEN="<token for this projectId>" \
node "${CLAUDE_SKILL_DIR}/export_screen.mjs" \
  "<url>" \
  --no-open \
  --quiet
  • Capture the workdir from stdout, in the form -> workdir: /path/to/xxx
  • On success, add that workdir to the result list
  • On failure, record the reason and continue with the next screen

Step 4: Create a zip package

For a single screen:

EXPORT_DIR="<workdir>"
EXPORT_DIR="${EXPORT_DIR%/}"
ZIP_PATH="${EXPORT_DIR}.zip"
cd "$(dirname "$EXPORT_DIR")" && zip -r "$ZIP_PATH" "$(basename "$EXPORT_DIR")" -x "*.DS_Store" -q

For multiple screens:

TIMESTAMP=$(date +%Y%m%d_%H%M%S)
ZIP_PATH="${CLAUDE_SKILL_DIR}/build/export_${TIMESTAMP}.zip"
cd "${CLAUDE_SKILL_DIR}/build"
zip -r "$ZIP_PATH" <dir1> <dir2> ... -x "*.DS_Store" -q

Step 5: Reply to the user

Export completed (N screens)

File: <ZIP_PATH>
Export summary:
  OK ScreenName1
  OK ScreenName2
  FAILED ScreenName3: <reason>

How to use:
1. Download and unzip the package
2. Open the generated layers_tree.html in a browser
3. Double-click or right-click layers to copy node JSON for AI usage

Notes

  • Match each screen to a token that has access to its project
  • Never print tokens in the conversation
  • When exporting multiple screens, keep the user updated with progress such as Exporting screen X/N...

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-19 23:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

EVA STYLE UI DESIGN SKILL

sullivangu
当创建、审查或扩展受《新世纪福音战士》监控器、战术屏幕及控制室美学启发的界面时使用此技能。
★ 1 📥 677
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,151
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,166