kim-ui2code

kim-ui2code is a command for Claude Code from KimYx0207/Kim_Service. It costs 25 tokens per session (3,096 once invoked), scanned A, original, MIT.

A workflow that turns a UI screenshot or design into frontend code by combining image analysis, technical planning, code generation, and review.

In plain words
What is it for?
Use it to analyse a design or screenshot, plan its frontend structure, generate the code, and have the result reviewed.
Why use it?
It gives developers a structured way to move from a visual reference to an implementation instead of coding from the image alone.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Codex.

Good fit Use it to analyse a design or screenshot, plan its frontend structure, generate the code, and have the result reviewed.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kimyx0207/kim_service/kim-ui2code
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.

Clone the repo
git clone --depth 1 https://github.com/KimYx0207/Kim_Service

Made for: Claude Code.

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 kim-ui2code

README.md
[![agentmods](https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-ui2code/github.svg)](https://agentmods.dev/commands/kimyx0207/kim_service/kim-ui2code)
Your own site
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-ui2code"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-ui2code/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 kim-ui2code

Your own site · 80×15
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-ui2code"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-ui2code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,096 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.00025 $0.03096
Opus 5.5 $0.00010 $0.01238
Sonnet 5.5 $0.00005 $0.00619
Haiku 4.5 $0.00003 $0.00310

Measured 1mo ago against content hash 933b9dabbfb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kim-ui2code 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 1mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

tools/claudecode-codex-gemini/host/claude/commands/kim-ui2code.md · 393 lines

How it starts

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

Kim Service 执行门(必须先执行)

  1. 先复述原始用户意图,并列出本次计划调用的 MCP 工具、目标目录和拟新增或修改的文件;不要把本命令扩展成 Router 或自动验收流程。
  2. 任何项目写入、依赖安装、外部访问或环境变更都必须先获得对应的人类批准。未批准时只分析并展示计划。
  3. 写入前读取现有目标;目标已存在时不得用重定向、空文件或整文件覆盖。只做受管更新,遇到冲突停止并展示差异。
  4. 新文件只能在已批准的项目根目录内安全创建;不得写用户级配置。MCP 仅使用本 Tool 的 cli.mjs mcp codex 或 cli.mjs mcp gemini 运行时及其已注册工具。

Kim截图转代码命令(四阶段三引擎)

公众号:老金带你玩AI | 微信:xun900207 | 备注AI加入AI交流群

你现在要协调3个AI工具,将UI设计稿/截图转换为可运行的前端代码:$ARGUMENTS

核心流程:Gemini(看图) → Claude(分析) → Codex(生成) → Gemini(审查)

⚠️ 文件写入规则(必须遵守)

先展示 .kim-orchestrator/ui2code/ 和实际前端代码的完整目标清单,获得项目写入批准后再操作。已有目标必须先读并受管更新,新文件安全创建,禁止重定向清空。

执行流程

阶段0.1:健康检查

参考 .claude/skills/kim-orchestrator/prompts/health-check.md 执行MCP健康检查。

本命令必须同时使用Gemini和Codex:

  1. 检测 mcp__gemini__gemini (图像识别必需)
  2. 检测 mcp__codex__codex (代码生成必需)

根据检测结果:

  • ✅ 全部可用 → 继续执行完整流程
  • ❌ Gemini不可用 → 无法执行(核心能力缺失,无法看图)
  • ⚠️ Codex不可用 → 询问是否用Claude降级生成(质量可能下降)

阶段0.2:初始化工作目录

批准后安全创建 .kim-orchestrator/ui2code/;逐个检查五个目标文件,存在则读取,不存在才创建。不要覆盖已有内容。

然后读取这些文件:

  • Read .kim-orchestrator/ui2code/phase1_vision.json
  • Read .kim-orchestrator/ui2code/phase2_spec.json
  • Read .kim-orchestrator/ui2code/phase3_code.md
  • Read .kim-orchestrator/ui2code/phase4_review.md
  • Read .kim-orchestrator/ui2code/result.md

阶段0.3:获取截图

根据用户输入类型处理:

情况1:本地文件路径

如果 $ARGUMENTS 是本地文件路径(如 ./design.png, C:\screenshots\ui.jpg)
→ 使用 Read 工具读取图片文件
→ 将图片内容传递给Gemini

情况2:URL链接

如果 $ARGUMENTS 是URL(如 https://example.com/design.png)
→ 直接将URL传递给Gemini

情况3:用户未提供

→ 询问用户提供截图路径或URL
→ 或者让用户直接粘贴图片到对话中

阶段1:视觉分析(Gemini)

调用 mcp__gemini__gemini 分析截图:

Prompt模板:

请仔细分析这张UI设计截图,提取以下信息:

## 1. 整体布局
- 页面类型(登录页/列表页/详情页/表单页/Dashboard等)
- 整体布局结构(顶部导航+侧边栏+主内容区等)
- 响应式设计要求(移动端/PC端/自适应)

## 2. 组件清单
列出所有可识别的UI组件:
- 按钮(样式、状态、位置)
- 输入框(类型、placeholder、验证)
- 卡片/列表项
- 导航栏/菜单
- 图标/图片
- 表格/数据展示
- 弹窗/模态框
- 其他组件

## 3. 样式信息
- 主色调和配色方案
- 字体大小层级
- 间距规律
- 圆角/阴影等视觉效果

## 4. 交互暗示
- 可点击元素
- 悬停效果暗示
- 表单验证提示
- 状态切换

请以结构化JSON格式输出分析结果。

将Gemini的响应保存到 .kim-orchestrator/ui2code/phase1_vision.json

Read the full file on GitHub · 393 lines

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. 1mo ago First seen · 393 lines · 25 tokens per session scan A 933b9dabbfb6

Subscribe to this mod's changes

kim-ui2code is a command published in the GitHub repository KimYx0207/Kim_Service (175 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 3,096 once invoked, about $0.0001 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-09-14.