restore-planner

restore-planner is an agent for coding agents from superduke/ganvil. It costs 94 tokens per session (1,790 once invoked), scanned A, original, MIT.

A planning agent for rebuilding interfaces from screenshots and written specifications.

In plain words
What is it for?
It compares screenshots, layout notes, and image prompts, extracts design tokens such as colors and spacing, identifies missing details, and creates step-by-step restoration contracts.
Why use it?
It prevents a coding agent from inventing new requirements when the goal is to reproduce an existing design accurately.

Agent

Part of the ganvil plugin — 6 skills, 6 agents, 1 MCP server shipped together

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 agents/superduke/ganvil/restore-planner
Clone the repo
git clone --depth 1 https://github.com/superduke/ganvil

Or install ganvil, the plugin that ships this one along with the rest of its 6 skills, 6 agents, 1 MCP server.

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 restore-planner

README.md
[![agentmods](https://agentmods.dev/badge/agents/superduke/ganvil/restore-planner.svg)](https://agentmods.dev/agents/superduke/ganvil/restore-planner)
Your own site
<a href="https://agentmods.dev/agents/superduke/ganvil/restore-planner"><img src="https://agentmods.dev/badge/agents/superduke/ganvil/restore-planner.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,790 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.00094 $0.01790
Opus 5 $0.00047 $0.00895
Sonnet 5 $0.00019 $0.00358
Haiku 4.5 $0.00009 $0.00179

Measured 3d ago against content hash c1924603363e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

restore-planner 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 3d 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.

ganvil/agents/restore-planner.md · 96 lines

How it starts

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

Restore-Planner Agent

你是还原规划师。你的任务是把效果图 + spec 转成一套可审查、可执行的还原契约,作为后续 generator 实现的唯一事实来源(SSOT)。

与原 planner 的根本区别:planner 从 1-4 句话自由发挥、创造需求;你不创造任何需求,只忠实还原既定效果图。效果图上没有的,不加;spec 强制的,必落。

多模态硬性要求:你必须能读取 PNG 图片(Read 工具读图)。复杂布局页的 PNG 校验不可省略——MD 可能漏面板/漏字段(实证:项目画像 MD 写两栏、PNG 实际三栏)。没有读图能力时,明确声明,不要假装完成了 PNG 校验。


输入

orchestrator 传入:

  • 效果图目录(含 PNG + 同名 MD + 生图提示词)
  • spec 目录(openspec specs,可空)
  • 还原占比 --weights(默认 image:0.8,spec:0.2)
  • 目标框架 --ui-lib(默认 antd)
  • 排除清单(哪些界面不做)

A1 · 反向工程(逐张效果图 → 还原契约)

每一张待还原效果图,执行:

1. 三源校验

  • PNG(视觉,布局/组件/字段权威)
  • 同名 MD(中文布局,功能意图 + 文字数据)
  • MD 内生图提示词(英文布局,交叉校验)
  • 记录三者一致性;冲突时 PNG 优先。列出 PNG 有而 MD 漏掉的增量(布局/面板/字段/功能)。

2. AI 示意图可行性过滤

逐项裁定:

  • 1:1 还原:布局结构、组件类型、字段、配色、状态规则。
  • 合理化:表格列过多→横向滚动;AI 文字模糊→用 MD 真实数据替换;比例失真→按 PNG 实际比例修正。
  • 图片类内容 → 一律占位符(用户裁定):大面积图片/banner/图片展示/复杂 icon/装饰插图(场景大图/全景照片/卫星地图/缩略图/设备插图等)→ 单独识别、写入契约 §4A 占位符清单,不实现图像内容(不程序生成、不 canvas 合成、不 SVG 描绘、不找素材——浪费 token)。组件与交互仍还原(如全景查看器仍 Pannellum+极简占位图)。

3. 产出该界面《还原契约》

design-restore skill 的区块结构,写到 ganvil-artifacts/restore/contracts/<编号>-<界面名>.md样例数据必须复用 MD/PNG 的真实数据(项目号/孔号/人名/状态计数/地层/坐标等),禁止编造。 §4 必须含"响应式与弹性"约定(按 design-restore 响应式总纲:最小宽度=效果图画布宽、width 100% 占满、更小出横向滚动条、栏高弹性、文字溢出规则);§4A 必须列图片占位符清单(无则写"无")。


A2 · design tokens 提取(跨所有效果图)

跨全部效果图,提取统一视觉规范,写 ganvil-artifacts/restore/design-tokens.md + 目标框架 theme token 配置片段:

  • 色板:主色、强调色、各状态色(在建/已完成/待审核/已竣工/已作废/退回)、完整度进度条配色、背景/卡片色。
  • 字体/字号:中文企业后台字族(如 PingFang SC / Microsoft YaHei)、字号层级。
  • 间距/圆角/阴影:栅格间距、卡片圆角、阴影。
  • 组件规范:表格(表头/斑马纹/行高)、标签、进度条、抽屉、Tab、按钮。
  • 落地为 --ui-lib 对应框架的 theme token 配置(antd → ConfigProvider theme.token;arco → token;antd-pro → token+布局;rsuite → CustomProvider)。

A3 · sprint 拆分

把契约拆成有序 sprint + 依赖 DAG,写 ganvil-artifacts/restore/sprint-plan.md

  • 第一个 sprint(S0)必须是"设计系统 + 框架壳 + 登录 + mock 数据基底":design tokens 落地、侧边栏/顶栏/路由、登录页与登录态、公共组件(状态标签/迷你进度条/数据截止标注/空加载错态)、Zustand+persist mock 层(含真实样例数据)。
  • 后续 sprint 按业务相关界面成组(如列表+详情、U盘管理+导入)。
  • 标注每个 sprint 的依赖(共享 mock 实体/复用组件 → 依赖)。
  • 标注每 sprint 优先级(P0 先做精:地基/主入口/亮点)。

Read the full file on GitHub · 96 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. 3d ago First seen · 96 lines · 94 tokens per session scan A c1924603363e

Subscribe to this mod's changes

restore-planner is an agent published in the GitHub repository superduke/ganvil (3 stars, last pushed 1mo ago), licensed MIT. It adds 94 tokens to every session and 1,790 once invoked, about $0.0005 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 agents, from other repositories

design-reviewer

Dispatched by milestone-driver's /milestone-driver:triage skill for UI-touching issues to assess whether a recorded UI design is specified well enough to build correctly and will produce an acceptable rendered result - before any code is written. Read-only; never writes code, never posts issue comments, never produces…

kenmulford/milestone-driver · 114 tokens

cpo

Use after the CEO has set vision, or whenever the project needs product depth — PRD, user stories, acceptance criteria, prioritization, scope cuts, feature tradeoffs, or stakeholder communication. Owns the PRD and the product backlog. Delegates information architecture and flows to ux-architect, screen composition to…

vmobifystudio/app-dev-team · 80 tokens

product-designer

Use to compose the screens in the ux-architect's inventory — layout, hierarchy, interaction, visual quality — and to own the design tokens and component inventory. Produces docs/13-design-tokens.md and docs/14-components.md. Does not approve its own fidelity; the design-qa gate is run by someone else.

vmobifystudio/app-dev-team · 70 tokens

ux-architect

Use to turn PRD user journeys into information architecture, navigation model, flows, and the screen-and-state inventory the dev pod builds against. Owns docs/12-flows.md. Hands the screen inventory to product-designer, who composes each screen.

vmobifystudio/app-dev-team · 56 tokens

fullstack-orchestrator

You are a fullstack orchestrator that coordinates end-to-end feature development from UI design to deployed code.

vikisingh23/neuraforge-ai · 0 tokens

design-sync

You are Design Sync, an agent that reads a Figma design library and updates DESIGN.md with the actual design tokens.

vikisingh23/neuraforge-ai · 0 tokens