kim-ui2code

kim-ui2code is a command for Claude Code from KimYx0207/Claudecode-Codex-Gemini. It costs 25 tokens per session (2,988 once invoked), scanned A, original, MIT.

A command workflow that turns a UI screenshot or design into working frontend code using image analysis, technical planning, code generation, and code review by different AI tools.

In plain words
What is it for?
Use it to analyze screenshots, produce a frontend specification, generate the corresponding code, review that code, and save the stages in a dedicated working directory.
Why use it?
It provides a staged path from visual reference to implementation and includes checks for whether the required image-analysis and coding tools are available.

Command for Claude 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.

agentmods
npx agentmods add commands/kimyx0207/claudecode-codex-gemini/kim-ui2code
Clone the repo
git clone --depth 1 https://github.com/KimYx0207/Claudecode-Codex-Gemini

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/claudecode-codex-gemini/kim-ui2code.svg)](https://agentmods.dev/commands/kimyx0207/claudecode-codex-gemini/kim-ui2code)
Your own site
<a href="https://agentmods.dev/commands/kimyx0207/claudecode-codex-gemini/kim-ui2code"><img src="https://agentmods.dev/badge/commands/kimyx0207/claudecode-codex-gemini/kim-ui2code.svg" alt="Measured on agentmods" 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 2,988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00025 $0.02988
Opus 5 $0.00013 $0.01494
Sonnet 5 $0.00005 $0.00598
Haiku 4.5 $0.00003 $0.00299

Measured 4d ago against content hash 492350469d23, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

.claude/commands/kim-ui2code.md · 395 lines

How it starts

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

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

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

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

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

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

Claude Code的Write工具要求:写入文件前必须先读取它。对于新文件:

# 创建新文件的标准流程:
1. 用 Bash 创建目录和空文件:mkdir -p 目录 && echo "" > 文件路径
2. 用 Read 读取该文件
3. 用 Write 写入实际内容

执行流程

阶段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:初始化工作目录

mkdir -p .kim-orchestrator/ui2code && echo "" > .kim-orchestrator/ui2code/phase1_vision.json && echo "" > .kim-orchestrator/ui2code/phase2_spec.json && echo "" > .kim-orchestrator/ui2code/phase3_code.md && echo "" > .kim-orchestrator/ui2code/phase4_review.md && echo "" > .kim-orchestrator/ui2code/result.md

然后读取这些文件:

  • 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 · 395 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. 4d ago First seen · 395 lines · 25 tokens per session scan A 492350469d23

Subscribe to this mod's changes

kim-ui2code is a command published in the GitHub repository KimYx0207/Claudecode-Codex-Gemini (119 stars, last pushed 22d ago), licensed MIT. It adds 25 tokens to every session and 2,988 once invoked, about $0.0001 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-30.