lanhu-design-to-code

lanhu-design-to-code is a skill for Codex from andyjin5/lanhu-schema-mcp. It costs 116 tokens per session (1,598 once invoked), scanned A, original, MIT.

A workflow for reading Lanhu design projects and turning their design data into user-interface code. Lanhu is a design collaboration tool; the workflow uses its read-only design interface and checks the result against the design.

In plain words
What is it for?
Use it to inspect design lists, previews, nodes, schemas, and exported slices, then build or review the matching page or component in an existing codebase.
Why use it?
It helps developers implement a design without guessing about layout, text, assets, or component relationships, while keeping design facts separate from product behavior.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions AGENTS.md.

Good fit Use it to inspect design lists, previews, nodes, schemas, and exported slices, then build or review the matching page or component in an existing codebase.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add andyjin5/lanhu-schema-mcp --skill lanhu-design-to-code
Clone the repo
git clone --depth 1 https://github.com/andyjin5/lanhu-schema-mcp

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lanhu-design-to-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code/github.svg)](https://agentmods.dev/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code)
Your own site
<a href="https://agentmods.dev/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code"><img src="https://agentmods.dev/badge/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lanhu-design-to-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code"><img src="https://agentmods.dev/badge/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,598 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00116 $0.01598
Opus 5 $0.00058 $0.00799
Sonnet 5 $0.00023 $0.00320
Haiku 4.5 $0.00012 $0.00160

Measured 9d ago against content hash 85709a188282, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

lanhu-design-to-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lanhu-design-to-code/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

蓝湖设计转代码

把蓝湖 MCP 返回的内容作为设计证据,再结合目标仓库的规则完成实现。始终区分设计事实、产品行为和工程实现,不把静态设计稿中没有的信息当成确定需求。

确认任务范围

  1. 修改代码前,先读取目标仓库的 AGENTS.md、贡献指南和目标模块约定。
  2. 从用户请求和仓库上下文中确认目标平台、页面或组件路径、目标设计图、允许修改的范围和验收命令。
  3. 新建结构前,先检查附近页面、公共组件、样式变量和资源管线能否复用。
  4. 确认 lanhu-schema MCP 的工具可调用。工具未配置时,引导用户阅读 MCP 安装说明,不要让用户在对话中粘贴 Cookie。

不得输出、索取或持久化真实蓝湖 Cookie。未经用户明确确认可以公开,不得提交真实设计导出、项目标识、带签名的资源 URL 或私有设计截图。

获取设计证据

除非用户已经准确指定某张设计图,否则按以下顺序调用工具:

  1. 使用蓝湖地址调用 lanhu_get_designs,取得稳定的设计图 id、名称和 index。
  2. 选择用户要求的设计图。如果多张设计图都可能匹配,先给出简短候选列表,再开始实现。
  3. 遇到大型设计稿或目标节点不明确时,先调用 lanhu_search_design_nodes,再通过 node_ids 获取目标子树。
  4. 常规实现调用 lanhu_get_design_schema,使用 detail=full。只有 full 缺少 transform、origin、矢量路径或变量绑定等字段时,才使用 detail=exact
  5. 设计中存在图片或图标资源时,调用 lanhu_get_design_slices
  6. 调用 lanhu_get_design_preview 核对整体构图和切图内容。不得从预览图读取精确几何或颜色。

选择工具、解释字段或处理 warning 时,读取 references/design-ir.md

准确解释设计数据

  • meta.canvas 作为设计画布尺寸的唯一权威来源,不得使用列表或预览图尺寸进行单位换算。
  • frame 视为旋转前的画布绝对逻辑几何,把 rel 视为相对父节点的关系证据;需要视觉占位、求交或对齐时使用 visualFrame ?? frame。根据节点关系和目标平台约定组织生产布局,不要把整个页面机械地改成绝对定位。
  • 文本节点以 text.content 为准;混排文本没有顶层内容时,按顺序拼接 text.runs[].content。图层 name 只用于定位,不得覆盖实际文案。
  • 把可选的 component 视为设计系统组件身份和状态线索;设计没有组件身份是合法情况,也不得假设代码库中一定存在同名组件。
  • IR 中存在明确数据时,应保持文案、可见状态、字体、填充、边框、圆角、阴影和资源意图。
  • 预览图只作为视觉证据;可量化的数值以 Design IR 和 slices 字段为准。
  • 所有可能影响实现的 warning 都要处理或报告,不得静默忽略截断、缺失、非 Figma、隐藏、零尺寸或画布外信息。
  • 不得从静态设计稿猜测循环、响应式规则、导航、异步行为、校验、埋点或动态数据。优先从需求和现有代码找证据;只有缺失选择会实质改变结果时才向用户确认。

按目标仓库实现

  1. 复用已有布局组件、公共组件、设计变量、资源管线和命名约定。
  2. 按目标仓库已有规则,把设计逻辑单位换算成目标平台单位。
  3. 使用生产布局系统实现响应式和动态行为,不要照抄 Figma 坐标生成难以维护的结构。
  4. 只有用户允许修改代码和资源时才下载或转换切图。使用 position + logical_size 直接放置已经应用旋转的资源,不得按节点 rotation 二次旋转;使用稳定文件名、保持宽高比,并区分逻辑尺寸和存储像素尺寸。
  5. 同一资源 URL 被多个切图节点引用时,在下载、上传或缓存层复用文件;保留所有切图节点及其各自位置,不得为去重删除节点。
  6. 把改动限制在选定设计和用户要求的行为内,避免顺手重构无关代码。
  7. 保持仓库已有的无障碍、本地化、加载、错误和空状态约定。

验证结果

  1. 运行范围最小且相关的格式化、类型检查、测试和构建命令。
  2. 本地工具允许时,启动或渲染修改后的 UI。
  3. 用预览图比较整体构图,用 Design IR 比较可量化数值。
  4. 检查文案换行、滚动、安全区、响应式宽度、交互状态和导出资源。
  5. 向用户报告设计 warning、未支持行为、所做假设、验证结果和仍存在的视觉差异。

Read the full file on GitHub · 74 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 74 lines · 116 tokens per session scan A 85709a188282

Subscribe to this mod's changes

lanhu-design-to-code is a skill published in the GitHub repository andyjin5/lanhu-schema-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 116 tokens to every session and 1,598 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

visual-ralph

Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ralph with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.

Yeachan-Heo/oh-my-codex · 50 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

A clickable, high-fidelity web product prototype with navigation, a hero section, feature cards, steps, social proof, and optional pricing. It is designed to resemble a finished landing page while remaining a prototype.

nexu-io/html-anything · 24 tokens

animation-principles

Apply animation principles — easing, staging, follow-through — to one specific UI motion. Use when tuning how an animation feels. For product-wide duration and easing tokens use motion-system (design-systems); for a full interaction spec use micro-interaction-spec.

Owl-Listener/designer-skills · 59 tokens

refactoring-ui

Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions "my UI looks off" (or amateur/unprofessional), "fix the design", "Tailwind styling", "color palette", "visual hierarchy", "design system", "spacing scale", or "component styling". Also trigger when building consistent…

wondelai/skills · 132 tokens