返回顶部
z

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.zeplin.io screen link and wants a prompt-ready export for AI-driven UI implementation.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
176
下载量
0
收藏
概述
安装方式
版本历史

zeplin-to-prompt

# 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: ```bash printf '%s\n' "$INPUT" | grep -Eo 'https://app\.zeplin\.io/project/[^[:space:]]+' || true ``` If the output is empty, reply with: ```text 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: ```json { "projects": { "<project-id-1>": "eyJhbG...", "<project-id-2>": "eyJhbG..." } } ``` For each distinct `projectId` in the task list, run: ```bash 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 ```text 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: ```bash 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: ```bash 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: ```bash 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: ```bash 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 ```text 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...`

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 zeplin-to-prompt-1776094025 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 zeplin-to-prompt-1776094025 技能

通过命令行安装

skillhub install zeplin-to-prompt-1776094025

下载 Zip 包

⬇ 下载 zeplin-to-prompt v1.0.1

文件大小: 50.23 KB | 发布时间: 2026-4-15 15:11

v1.0.1 最新 2026-4-15 15:11
- Improves handling of Zeplin screen links: extracts valid screen URLs and prompts users for correct links if needed.
- Adds per-project token management, including automated token lookup, masked prompts for missing tokens, and secure storage.
- Supports exporting multiple Zeplin screens in one command and packages local assets and metadata into a zip file.
- Replies with clear export status and usage instructions, including a summary of successes and failures.
- Includes real-time progress updates when exporting multiple screens.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部