
Draw Ui
Generate landing-page and screen mockups with image tools, then reconstruct screenshots into HTML/CSS when validating UI direction.
Install
npx skills add https://github.com/oil-oil/draw-ui --skill draw-uiWhat is this skill?
- Prefers built-in image generation when available; ZenMux + GPT Image 2 via ask_draw.sh as fallback or scripted local pat
- Onboarding questions: page purpose, existing screenshots, and protected UI regions before generating
- Reference-image strategy table: no refs for exploration, crop chrome for layout-only consistency, full refs when matchin
- Triggers: 生成图片, design UI, landing page, 设计稿还原, screenshot-to-HTML replication
- Comparison note: built-in generation matched landing-page quality vs ZenMux in author testing
Adoption & trust: 1 installs on skills.sh; 192 GitHub stars; 1/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Visual prototypes belong on Validate before full Build so solo founders test layout and brand feel without committing frontend implementation. Prototype subphase is the canonical home for mockups, reference-image strategy, and screenshot-to-markup experiments.
Common Questions / FAQ
Is Draw Ui safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Draw Ui
# Draw UI Skill Prefer the built-in image generation tool when it is available in the current agent/runtime. It is usually simpler, avoids provider drift, and produced landing page mockups at the same quality level as ZenMux in our comparison. Use `scripts/ask_draw.sh` only when built-in image generation is unavailable, when the user explicitly asks to use ZenMux, or when you need scripted local output paths. The script uses ZenMux. Default model: `openai/gpt-image-2`. --- ## Onboarding:开始前先问用户这些问题 如果用户只是泛泛地说“设计一个页面”,先用下面的问题引导用户,收集到足够信息再动手。用户已经给出明确页面、风格或参考图时,可以直接执行,不要为了流程感反复追问。 ### 必问(缺少任何一项都会影响质量) > **1. 你想设计哪个页面?这个页面的核心功能是什么?** > 不能只靠页面名称猜功能——业务理解错了,AI 会画出完全错误的东西。 > **2. 你有现有的 App 截图或设计稿可以上传吗?** > 有截图 → 可以保持导航/侧边栏的视觉一致性。没有也可以生成,但每次结果会有差异。 > **3. 如果有截图,里面有没有你不希望 AI 改动的区域(比如侧边栏、顶部导航)?** > 这决定了用哪种参考图策略(见下方)。 ### 选问(根据情况) > **你偏向什么风格?** 比如:分析型工具、温暖品牌感、极简、游戏感…… > **需要生成多张保持一致的屏幕吗?** --- ## 根据用户回答,选择参考图策略 **核心原则:参考图里有什么内容,AI 就会倾向于模仿什么——包括你不想让它模仿的部分。** | 用户情况 | 策略 | |---------|------| | 没有截图,纯创意探索 | 不传参考图,完全自由生成 | | 有截图,但只想锁定导航/侧边栏 ⭐ | 让用户提供或制作**纯净边框图**(把内容区涂成纯色),只传边框 | | 有截图,需要整体风格精准对齐 | 传完整截图,但告知用户内容区创意会受影响 | **纯净边框图怎么做**:截一张 App 刚打开时内容区为空白的截图,或用任意工具把内容区覆盖为纯色。 如果需要生成多张一致的屏幕:**必须串行执行**(一张完成后再开始下一张),不能并行。 --- ## 设计稿还原为 HTML 的素材策略 当用户想把生成图、截图或设计稿还原成 HTML/CSS 时,先读取 `references/html-reconstruction.md`。核心原则:页面结构优先代码化;logo、品牌符号、复杂插画、3D/玻璃质感、半透明渐变等难复刻视觉元素要素材化。裁图只作为图生图参考和定位依据,最终放进 HTML 的复杂资产要用图生图重绘,再裁边、抠图和清理边缘。 透明素材策略:厂商 logo、深色 wordmark、小号深色图标优先生成大尺寸纯白底素材,再用保守白底转 alpha;复杂彩色插画、hero 装饰、产品图优先绿幕或真实透明输出。不要把小 logo 和大插画塞进同一张素材板。 --- ## 构建提示词 ### 两种经过验证有效的写法 **类比法(创意效果最好)** 说"这个工具像什么",让 AI 借用那个参照物的设计语言,而不是描述布局。 ``` 像乐谱一样解码爆款视频——Think Notion's calm focus meets a music producer's session notes. ``` **清单法(最稳定,适合需要准确落地的页面)** 列出页面上有哪些信息,不说怎么排,让 AI 自己决定布局。 ``` 页面包含:用户名和头像、近30天数据趋势图、活跃 Campaign 列表(名称/状态/触达数)、快捷操作入口。 ``` ### 质量规则 - **不写排版规格**(像素、列数、padding)— 描述越具体,AI 越像在执行指令而不是做设计,结果反而更差 - **给真实示例数据**,不用 placeholder — `"2.3M views, 180K saves"` 比 `"显示播放量"` 效果好十倍 - **颜色用 HEX**,不用 HSL — `#f9f5f0` 比 `hsl(28 25% 97%)` 对模型更准确 - 如果传了参考图,在 prompt 开头明确说明哪些区域需要保持不变 - **Prompt 控制在 800 字以内** — 超长会导致 server disconnect --- ## 执行命令 优先级: 1. 有内置生图工具时,优先直接使用内置生图工具。 2. 用户明确要求 ZenMux,或需要脚本化批量生成、本地固定输出路径时,再使用 `scripts/ask_draw.sh`。 3. 内置工具和 ZenMux 质量接近时,选择内置工具,减少额外 provider 依赖。 ```bash # 无参考图 scripts/ask_draw.sh --type wide --name "screen-name" --prompt "..." # 传参考图(--frame 自动作为第一个参考) scripts/ask_draw.sh \ --frame /path/to/reference.png \ --type wide \ --name "screen-name" \ --prompt "..." ``` **多张屏幕**:必须串行执行(一张完成再开下一张),不能并行。偶发 disconnect 属正常,重试即可。 --- ## Options | Flag | 说明 | 默认 | |------|------|------| | `--type` | `wide`(16:9) / `square`(1:1) / `portrait`(3:4) / `classic`(4:3) | `wide` | | `--prompt` | 提示词 | 必填 | | `--frame` | 参考图路径 | — | | `--ref` | 额外参考图(可重复)| — | | `--name` | 输出文件名 | auto | | `-o` | 自定义输出路径 | `~/.local/share/draw/outputs/YYYY-MM-DD/` | 成功输出:`output_path=<path>` API Key 查找顺序:`ZENMUX_API_KEY` 环境变量 → `.env.local`(当前目录往上找)→ `~/.config/see/api_key` # draw-ui — AI UI Design Skill A universal AI skill that generates UI design mockups and helps reconstruct generated UI screenshots into HTML/CSS. Prefer the runtime's built-in image generation when available; use **GPT Image 2** via the ZenMux API for scripted local outputs. --- ## What it does - Generates high-quality UI mockups from natural language descriptions - Locks navigation/sidebar consistency across multiple screens using a reference image - Uses proven prompt techniques (analogy-style or inventory-st