ilovemajiaqi

Html2figma — Design skill for Claude Code

Design community

把 HTML 手机原型变成 Figma 可编辑、可点击、可滚动的原型|Agent Skill: HTML → Figma clickable prototype — editable layers, reactions, scrolling, persistent layers, pixel-parity checks.

How to install Html2figma

This entry records only its repository, not the path inside it, so there is no exact command to give. Open ilovemajiaqi/html2figma and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Html2figma does

把 HTML 手机原型变成 Figma 可编辑、可点击、可滚动的原型|Agent Skill: HTML → Figma clickable prototype — editable layers, reactions, scrolling, persistent layers, pixel-parity checks.

Alternatives in Design

  • Planning With Files — Claude Code skill implementing Manus-style persistent markdown planning — the workflow pattern behind the $2B 17.4k ★
  • Figma Implement Design — Translate Figma designs into production-ready code with pixel-perfect accuracy 14.6k ★
  • Design Present — Generate an interactive HTML presentation from Figma screens — annotated walkthrough with transitions, speaker 309 ★

README

html2figma

**简体中文** | [English](README.en.md)

**把 HTML 手机原型变成 Figma 里可编辑、可点击、可滚动的原型——没有 HTML 原型时,先按规范做出来并确认,再导入。**

Agent Skills 规范 · Figma 桌面端 · MIT

[![Agent Skills spec](https://img.shields.io/badge/Agent%20Skills-spec-6C5CE7)](https://agentskills.io/specification) [![Figma Desktop](https://img.shields.io/badge/Figma-desktop-1E1E1E?logo=figma&logoColor=white)](https://www.figma.com/) [![License: MIT](https://img.shields.io/badge/license-MIT-2EA043)](LICENSE) [![Version](https://img.shields.io/badge/version-1.1.1-0969DA)](CHANGELOG.md) [![Scripts](https://img.shields.io/badge/scripts-Windows%20%C2%B7%20optional-6E7781)](#%E4%BE%9D%E8%B5%96)


为什么做这个

把 HTML 导进 Figma 本身不难;**难的是让它像原型一样"能用"**。

常见的结果是每屏变成一张扁平长图:文字被 `-webkit-line-clamp` 截断却仍画到框外,底部导航落在 1800px 长图的末尾,页面不能滚动,所有跳转链接丢失。截图看着像,一按 Present 就露馅。

这个 skill 把整条路沉淀了下来——导入管线、字体命中、reaction 写入、视口重塑、Figma 插件的真实能力边界,以及证明结果正确的三层验收。

你会得到什么

  • 可编辑图层:每个元素都是 Frame / Text / Vector / 图片填充,不是切图。
  • 真实跳转:每个热区写成 ON_CLICK → NAVIGATE reaction,并用数量审计 + 回放双重校验。
  • 真实滚动:视口 Frame 带纵向滚动,行为和手机一致。
  • 真正常驻的常驻层:底栏、顶栏、FAB 该固定的固定。不写死 dock——skill 教 agent 如何判定什么该固定。
  • 像素级还原:导出 vs 参考的 MAE 比对,含阴影溢出裁剪与平移搜索。
  • 导入前的检查点:没有 HTML 原型时,先按规范产出一版、渲染全部屏幕、等用户确认,再碰 Figma。

工作方式

html2figma 管线:Phase 0 → 构建 → 交互 → 视口 → 验收

每个阶段都有独立验收,随时可以停下来检查。

安装

本仓库是一个 [Agent Skills](https://agentskills.io/specification) 包:`SKILL.md` + `references/` + `scripts/`。

git clone https://github.com/ilovemajiaqi/html2figma.git html2figma   # 或直接下载/复制这个文件夹
# 放进你的 agent 的 skills 目录,例如:
#   Claude Code:        ~/.claude/skills/html2figma
#   ZCode / 通用:       ~/.agents/skills/html2figma
#   项目级:             /.agents/skills/html2figma

任何实现 Agent Skills 规范的客户端都能加载。SKILL.md 正文以中文写成,description 同时包含中英文触发词。

依赖

| 组件 | 用途 | 说明 |