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.
npx skills add andyjin5/lanhu-schema-mcp --skill lanhu-design-to-codegit clone --depth 1 https://github.com/andyjin5/lanhu-schema-mcpWrote 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.
[](https://agentmods.dev/skills/andyjin5/lanhu-schema-mcp/lanhu-design-to-code)<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.
<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>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00116 | $0.01598 |
| Opus 5.5 | $0.00046 | $0.00639 |
| Sonnet 5.5 | $0.00023 | $0.00320 |
| Haiku 4.5 | $0.00012 | $0.00160 |
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 2mo 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.
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 返回的内容作为设计证据,再结合目标仓库的规则完成实现。始终区分设计事实、产品行为和工程实现,不把静态设计稿中没有的信息当成确定需求。
确认任务范围
- 修改代码前,先读取目标仓库的
AGENTS.md、贡献指南和目标模块约定。 - 从用户请求和仓库上下文中确认目标平台、页面或组件路径、目标设计图、允许修改的范围和验收命令。
- 新建结构前,先检查附近页面、公共组件、样式变量和资源管线能否复用。
- 确认
lanhu-schemaMCP 的工具可调用。工具未配置时,引导用户阅读 MCP 安装说明,不要让用户在对话中粘贴 Cookie。
不得输出、索取或持久化真实蓝湖 Cookie。未经用户明确确认可以公开,不得提交真实设计导出、项目标识、带签名的资源 URL 或私有设计截图。
获取设计证据
除非用户已经准确指定某张设计图,否则按以下顺序调用工具:
- 使用蓝湖地址调用
lanhu_get_designs,取得稳定的设计图 id、名称和 index。 - 选择用户要求的设计图。如果多张设计图都可能匹配,先给出简短候选列表,再开始实现。
- 遇到大型设计稿或目标节点不明确时,先调用
lanhu_search_design_nodes,再通过node_ids获取目标子树。 - 常规实现调用
lanhu_get_design_schema,使用detail=full。只有full缺少 transform、origin、矢量路径或变量绑定等字段时,才使用detail=exact。 - 设计中存在图片或图标资源时,调用
lanhu_get_design_slices。 - 调用
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、隐藏、零尺寸或画布外信息。
- 不得从静态设计稿猜测循环、响应式规则、导航、异步行为、校验、埋点或动态数据。优先从需求和现有代码找证据;只有缺失选择会实质改变结果时才向用户确认。
按目标仓库实现
- 复用已有布局组件、公共组件、设计变量、资源管线和命名约定。
- 按目标仓库已有规则,把设计逻辑单位换算成目标平台单位。
- 使用生产布局系统实现响应式和动态行为,不要照抄 Figma 坐标生成难以维护的结构。
- 只有用户允许修改代码和资源时才下载或转换切图。使用
position + logical_size直接放置已经应用旋转的资源,不得按节点rotation二次旋转;使用稳定文件名、保持宽高比,并区分逻辑尺寸和存储像素尺寸。 - 同一资源 URL 被多个切图节点引用时,在下载、上传或缓存层复用文件;保留所有切图节点及其各自位置,不得为去重删除节点。
- 把改动限制在选定设计和用户要求的行为内,避免顺手重构无关代码。
- 保持仓库已有的无障碍、本地化、加载、错误和空状态约定。
验证结果
- 运行范围最小且相关的格式化、类型检查、测试和构建命令。
- 本地工具允许时,启动或渲染修改后的 UI。
- 用预览图比较整体构图,用 Design IR 比较可量化数值。
- 检查文案换行、滚动、安全区、响应式宽度、交互状态和导出资源。
- 向用户报告设计 warning、未支持行为、所做假设、验证结果和仍存在的视觉差异。
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.
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.
- 2mo ago First seen · 74 lines · 116 tokens per session scan A 85709a188282
lanhu-design-to-code is a skill published in the GitHub repository andyjin5/lanhu-schema-mcp (0 stars, last pushed 3mo ago), licensed MIT. It adds 116 tokens to every session and 1,598 once invoked, about $0.0005 per session on Opus 5.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.
lanhu-design-to-code compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| lanhu-design-to-codeandyjin5/lanhu-schema-mcp | Skill | 0 | 3mo ago | MIT | A | 116 | Codex |
| webgl-holographic-foilnexu-io/open-design | Skill | 107k | today | Apache-2.0 | A | 41 | Claude Code, Codex |
| html-ppt-hermes-cyber-terminalnexu-io/open-design | Skill | 107k | today | Apache-2.0 | A | 53 | Claude Code, Codex |
| html-ppt-taste-brutalistnexu-io/open-design | Skill | 107k | today | Apache-2.0 | A | 78 | Claude Code, Codex |
| visual-ralphYeachan-Heo/oh-my-codex | Skill | 34k | today | MIT | A | 52 | Codex |
| glance-canonical-layoutsandroid/skills | Skill | 10k | 2d ago | Apache-2.0 | A | 56 | Claude Code |
| accessibilitymicrosoft/hve-core | Skill | 1.6k | yesterday | MIT | A | 47 | Claude Code |