跳到正文
TakoAPI
返回技能列表

pencil-to-code

由 jcwen 提供

Web & Frontend Development
867下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Export .pen design to React/Tailwind code.

描述

该技能的功能

Converts Pencil (.pen) design files to React components with Tailwind CSS. Takes a frame ID or file path as input and outputs typed TypeScript components plus a Tailwind theme configuration derived from .pen design variables. Handles the full property translation: layout, spacing, typography, colors, and border radius.

Covers the complete .pen-to-Tailwind translation table automatically, removing the need to manually look up class equivalents for every layout, color, and typography property.

何时使用

  • Exporting a finalized Pencil frame as a ready-to-use React component
  • Generating a Tailwind @theme config from .pen design variable definitions
  • Handing off UI designs from Pencil to a React/TypeScript codebase
  • Converting Pencil layout and spacing values to Tailwind utility classes
  • Validating generated code visually against the original .pen frame screenshot

示例工作流

输入

User asks: Export the 'hero-section' frame from dashboard.pen as a React component

智能体
  1. 1

    Read the frame tree from dashboard.pen at the specified frame ID with full depth and resolved instances

  2. 2

    Extract design variables from the .pen file and map them to Tailwind @theme CSS custom properties

  3. 3

    Classify each node by type and map it to the appropriate React element or component

  4. 4

    Generate a typed TypeScript component file with Tailwind utility classes reflecting the design properties

  5. 5

    Screenshot the original .pen frame for optional side-by-side visual validation

输出

HeroSection.tsx with Tailwind classes and a globals.css snippet containing the extracted theme tokens

前置要求

  • Pencil design application installed

安装

clawhub install jcwen/pencil-to-code

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接