Communitygithub.com

LIKELION-CAPSULE/Landing_Page

根据Figma设计文件或设计图片构建UI,使其与设计完全匹配,并使用项目现有的令牌和组件。

Landing_Page 是什么?

此AI技能的核心功能是将Figma设计或设计截图转化为精确匹配的前端代码。它遵循严格的设计优先原则:所有数值必须源自设计文件,禁止引入个人偏好或主观调整。工作流程分为五个阶段:从设计源(Figma或图片)读取精确或估算的样式值;将设计值映射到项目现有的设计令牌和组件库,避免随意添加新令牌;仅实现设计稿中明确绘制的帧、断点和状态;将生成的UI截图与设计稿进行逐元素对比,找出并修正差异;最后输出一份包含匹配、舍入、偏差等状态的报告。该技能适用于Claude Code等AI编程代理,要求项目具备Figma MCP连接和设计令牌系统,最终输出高度保真的UI代码。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/LIKELION-CAPSULE/Landing_Page/tree/HEAD/.agents/skills/build-design

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

构建设计

本技能将设计转化为与之匹配的代码。它从源头读取设计,利用项目已有内容进行构建,然后将结果与设计进行比较,确认无误后完成。

设计决定一切。数值必须来自设计文件,绝不能来自你的品味或你在别处喜欢过的模式。设计中未显示的更改就是偏差,而偏差需要由用户决定。

它不拥有任何领域规则。如果设计违反了一条规则,就按设计构建,并报告冲突及其所属领域。对比度在 better-accessibility 中是要求,在 better-colors 中是测量值。焦点和语义属于 better-accessibility,字体属于 better-typography,间距和结构属于 better-layout。调色板属于 better-colors,文案属于 better-writing,而表面、图标和动效属于 better-ui。审查完成的工作属于 interface-review,探索替代方案属于 variant,压力测试组件属于 break。

1. 在源头读取设计

Figma 链接意味着使用 Figma MCP。在声称不可用之前,先搜索可用和已加载的工具中是否包含 figma,因为服务器通常位于你意想不到的名称下。一个仅列出 authenticate 工具的服务器表示已连接但未登录,因此请让用户进行身份验证。如果没有 Figma 工具,请让用户连接一个,在此期间不要凭记忆或猜测进行构建。figma.md 中记录了要调用哪些工具以及每个工具返回什么。

截图或导出的图片没有可读取的数值。尺寸是相对于截图的比率,因此请说明你假设的比例,并将每个度量视为估算值。如果存在 Figma 链接,请询问用户获取,因为它可以完全替代估算。

将工作范围限定在命名帧内。显示相同内容但宽度不同的帧,是同一组件的不同断点,而不是独立的组件。

此步骤完成时,你应持有范围内每个帧的截图及其间距、尺寸、圆角、颜色、字体以及所用组件的值。来自 Figma 文件时,这些值是精确的。来自图片时,这些值是你所说明比例下的估算值。

2. 将设计映射到项目

在编写任何代码之前,先阅读项目的令牌和组件库。然后将每个设计值映射到已存在的项:

在设计中在代码中
绑定的变量或样式具有相同名称或相同值的令牌
与令牌值相等的原始值该令牌
没有对应令牌的原始值最接近的现有令牌,在报告中列为已舍入
组件实例项目中具有该名称的组件,且带有设计显示的变体
项目中没有对应项的组件实例使用普通标记占位,列为偏差,并询问是否需要创建组件
单次使用的图层组使用普通标记占位,不作为新组件

永远不要为了匹配某个数值而添加令牌、组件变体或任意值。当舍入会明显改变设计时,停下来询问决定。这意味着间距或尺寸超过 2px,或颜色落在不同的阶梯上。

检查设计需要哪些数据,并将其连接到已有的数据。如果部分功能的后端尚不存在,则将该部分构建为由 props 驱动的 UI,并在报告中将其列为未连接。

3. 仅构建设计显示的内容

实现帧、帧定义的断点以及文件绘制的状态,例如悬停、空态或错误。文件未绘制的状态不是由你来设计的。将其保留为现有组件的默认状态,并将其列为缺失。

保持周围一切不变。不编辑邻近的文案,不替换图标,不进行“顺手”清理。比设计更宽的 diff 是此流程中最常见的错误。

4. 与设计进行比较

将构建结果在每个帧的宽度下,与设计截图并排渲染,并逐个元素进行检查。比较在 在源头读取设计 步骤中收集的属性。“间距为 12px,设计为 16px”是一个发现。“感觉有点紧”则不是。

如果有浏览器可用,截取每个宽度的截图并进行比较。如果没有,则将本地 URL 和需要检查的宽度交给用户,并说明比较结果未经核实。不要报告你未查看过的匹配。

修复你造成的每个不匹配,然后再次比较。此步骤完成时,所有剩余差异都应是舍入问题或待解决的问题。

5. 报告并停止

元素设计构建状态
卡片内边距20pxp-5匹配
标题大小15pxtext-sm, 14px舍入到令牌
徽章填充药丸文本标签偏差,已询问:不存在徽章组件

然后,逐行列出以下内容(如果列表为空则省略):

  • 未连接。 在后端存在之前,由 props 渲染的内容。
  • 缺失的状态。 设计未绘制的状态。
  • 领域冲突。 设计违反规则的地方,以及所属技能。

最后说明构建正在哪里运行以及你在哪些宽度下进行了比较。

完成之前

你注意到修复
搜索任何工具之前就写了“Figma 未连接”先搜索工具中是否包含 figma
代码中的值未出现在任何 Figma 响应中,仅出现在截图中从设计上下文中读取它们
diff 中出现任意工具类如 w-[343px] 或原始十六进制值将其映射到令牌,或询问是否可以舍入
在组件目录下为不是组件的帧创建了新文件将其内联为普通标记
设计从未绘制的加载或错误分支移除它,保留默认状态并列为缺失
diff 中包含了未在任何帧中使用的文件还原它们
设计未显示的对比度或焦点更改恢复设计并报告与所属领域的冲突
声明了比较结果但没有构建的截图渲染每个帧的宽度,或说明结果未经核实
硬编码的示例数据未在报告中提及将其列在 未连接 下

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

LIKELION-CAPSULE/Landing_Page

Reviews and fixes keyboard and focus behavior, ARIA, accessible names, forms, screen-reader announcements, motion and zoom in your project against WCAG 2.2.

LIKELION-CAPSULE/Landing_Page

Helps you build and check a color system for your project. It generates palettes, names semantic tokens, converts between formats and measures contrast.

LIKELION-CAPSULE/Landing_Page

Combines all of the `better-*` skills into a single review across accessibility, layout, writing, typography, color and UI polish.

LIKELION-CAPSULE/Landing_Page

Helps with grouping, alignment, reading order, responsive structure and room for translated text, so a layout holds up when it is resized, translated or mirrored.

LIKELION-CAPSULE/Landing_Page

Sets and reviews how text renders in your product, from the type scale and spacing to font features, wrapping, truncation and punctuation.

LIKELION-CAPSULE/Landing_Page

Polishes the surfaces, icons and motion in your project with exact values for border radius, optical alignment, shadows, icon states and animation.

LIKELION-CAPSULE/Landing_Page

Writes and reviews your interface copy, from labels and errors to empty states and confirmations, so it matches your product's voice and tells people what to do next.

LIKELION-CAPSULE/Landing_Page

Renders a component you choose under every scenario that can reach it on a temporary page and stress tests it.

LIKELION-CAPSULE/Landing_Page

Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.

LIKELION-CAPSULE/Landing_Page

Explains how a website, a visual effect or an animation was built, from a live URL or a screenshot.

LIKELION-CAPSULE/Landing_Page

Reviews a branch, pull request or uncommitted change for the interface problems it introduced or regressed, across accessibility, layout, writing, typography, color and UI.

LIKELION-CAPSULE/Landing_Page

Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.

LIKELION-CAPSULE/Landing_Page

Renders every state of a component you choose on a throwaway page, with mock data and a switcher, so you can work on each state.

LIKELION-CAPSULE/Landing_Page

Builds multiple variants of a component you're working on and helps you iterate and pick one.

相关技能