fal-redesign
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesefal-redesign
fal-redesign
Runtime: Self-contained Node runtime under(runtime/). Does things genmedia CLI cannot (puppeteer screenshotting, multi-vision pipeline, file orchestration). First-time setup:runtime/bin/fal-site.mjs. Override the runtime path withcd runtime && npm install.FAL_SITE_RUNTIME=/abs/path
fal-redesignyour index.html → screenshot (1920×1200)
screenshot + brand → opus-4.7 writes a redesign prompt
screenshot + prompt → fal-ai/gpt-image-2/edit → after.png
after.png → opus-4.7 writes Markdown build-spec + tokens.json
→ returned to Claude Code / CodexThe agent reads + + , applies the spec to the real HTML, refreshes, optionally runs for a residual pixel-fix pass.
after.pngchanges.mdtokens.jsoniterateRuntime: 独立的Node运行时位于目录下(runtime/)。它能完成genmedia CLI无法实现的功能(puppeteer截图、多视觉模型流水线、文件编排)。首次设置:runtime/bin/fal-site.mjs。可通过cd runtime && npm install覆盖运行时路径。FAL_SITE_RUNTIME=/abs/path
fal-redesignyour index.html → screenshot (1920×1200)
screenshot + brand → opus-4.7 writes a redesign prompt
screenshot + prompt → fal-ai/gpt-image-2/edit → after.png
after.png → opus-4.7 writes Markdown build-spec + tokens.json
→ returned to Claude Code / CodexAgent会读取 + + ,将规范应用到真实HTML中,刷新页面,还可选择运行模式进行残留像素修复。
after.pngchanges.mdtokens.jsoniterateWhen to invoke
调用时机
- User has a local or a running dev server and asks to improve the design, make it world-class, redesign, polish, or run a design review.
index.html - User describes a brand/product in freeform text and asks for a fresh site (greenfield mode → ).
generate
Do NOT invoke for:
- Copy-only edits (the skill is visual-design focused).
- Backend, build config, or infra tasks.
- 用户拥有本地或正在运行的开发服务器,并要求改进设计、达到世界级水准、重新设计、优化或进行设计评审时。
index.html - 用户用自由文本描述品牌/产品,并要求创建全新网站时(全新模式→)。
generate
请勿在以下场景调用:
- 仅需文案编辑的需求(该工具聚焦于视觉设计)。
- 后端、构建配置或基础设施相关任务。
Commands
命令
All four modes are subcommands of the Node runtime. Invoke directly:
四种模式均为Node运行时的子命令,可直接调用:
upgrade
: redesign a coded site
upgradeupgrade
: 重新设计已编码的网站
upgradebash
node runtime/bin/fal-site.mjs upgrade --target <path-or-url> [--context "..."] [--variants N] [--out <dir>]Pass (2-8) to fan out into N distinct design directions in parallel. You get , , plus a to compare them side-by-side. Pick one, then run on the chosen PNG to produce its build-spec.
--variants Nafter-01-<slug>.pngafter-02-<slug>.pnggallery.htmldescribeOutputs in :
<out>/- : current-site screenshot.
before.png - : redesigned reference image.
after.png - : transformation prompt fed to gpt-image-2.
edit-prompt.txt - : Markdown build-spec with a leading "Hard constraints" section (also echoed to stdout).
changes.md - : design tokens (colors, typography clamps, grid, buttons).
tokens.json
bash
node runtime/bin/fal-site.mjs upgrade --target <path-or-url> [--context "..."] [--variants N] [--out <dir>]传入(2-8)可并行生成N种不同的设计方向。你将获得、,以及用于并排对比的。选择其中一种设计后,对选中的PNG运行命令以生成对应的构建规范。
--variants Nafter-01-<slug>.pngafter-02-<slug>.pnggallery.htmldescribe<out>/- : 当前网站的截图。
before.png - : 重新设计的参考图。
after.png - : 传入gpt-image-2的转换提示词。
edit-prompt.txt - : 包含开头「硬约束」章节的Markdown构建规范(同时会输出到标准输出)。
changes.md - : 设计令牌(颜色、排版约束、网格、按钮样式)。
tokens.json
describe
: re-run the build-spec on an existing after.png
describeafter.pngdescribe
: 基于已有的after.png
重新生成构建规范
describeafter.pngUseful if the first spec was noisy or if you want to iterate on the spec without regenerating the image.
bash
node runtime/bin/fal-site.mjs describe --after <path/to/after.png> [--out <dir>]如果首次生成的规范存在冗余,或你想在不重新生成图片的前提下迭代规范,该命令非常实用。
bash
node runtime/bin/fal-site.mjs describe --after <path/to/after.png> [--out <dir>]iterate
: residual pixel-fix pass
iterateiterate
: 残留像素修复
iterateAfter the agent has implemented the spec, screenshot the live site and emit a delta-spec vs the reference.
bash
node runtime/bin/fal-site.mjs iterate --target <path-or-url> --reference <path/to/after.png> [--out <dir>]Outputs + .
current.pngdelta.mdAgent完成规范实现后,对实时网站截图并生成与参考图对比的增量规范。
bash
node runtime/bin/fal-site.mjs iterate --target <path-or-url> --reference <path/to/after.png> [--out <dir>]输出内容为 + 。
current.pngdelta.mdgenerate
: greenfield (brief → site)
generategenerate
: 全新生成(需求简述→网站)
generatebash
node runtime/bin/fal-site.mjs generate --context "<freeform context>" [--variants 4] [--out <dir>]bash
node runtime/bin/fal-site.mjs generate --context "<freeform context>" [--variants 4] [--out <dir>]Required environment
必要环境配置
bash
export FAL_KEY=... # https://fal.ai/dashboard/keysModels used:
- : via
anthropic/claude-opus-4.7andopenrouter/router(overridable withopenrouter/router/vision).FAL_SITE_MODEL - : greenfield hero + mockup renders.
fal-ai/gpt-image-2 - : screenshot-to-redesign transformation.
fal-ai/gpt-image-2/edit
bash
export FAL_KEY=... # https://fal.ai/dashboard/keys使用的模型:
- : 通过
anthropic/claude-opus-4.7和openrouter/router调用(可通过openrouter/router/vision覆盖)。FAL_SITE_MODEL - : 全新生成模式下的首屏图及模型图渲染。
fal-ai/gpt-image-2 - : 截图转重新设计的转换。
fal-ai/gpt-image-2/edit
Usage pattern for agents
Agent使用流程
- Check . If unset, ask the user to export it and stop.
FAL_KEY - Pick the mode.
- If the user references a file path that exists or a URL () →
http://localhost:....node runtime/bin/fal-site.mjs upgrade - Otherwise → .
node runtime/bin/fal-site.mjs generate
- Run the script. Each pass takes 60–180s (1 screenshot + 2 vision calls + 1 image-edit). Emit a brief status to the user before calling.
upgrade - Surface the result.
- Open (Read tool) so the user sees the new design.
after.png - Paste in the chat (or the highlights).
changes.md - Ask: "Want me to implement these changes in now?"
<file>
- If yes, implement. Read the current file. Apply the spec section by section, obeying the verbatim and pulling exact values from
Hard constraints. For imagery in the result grid, look attokens.jsondirectly and either useafter.pngplaceholders at the matching aspect ratio or source stock that matches the mood.<img> - Optional iterate. After implementation, offer for a residual delta-spec. Apply deltas, refresh.
node runtime/bin/fal-site.mjs iterate --target <file> --reference <after.png>
- 检查。若未设置,请求用户导出该密钥并停止后续操作。
FAL_KEY - 选择模式。
- 如果用户提及存在的文件路径或URL()→ 执行
http://localhost:...。node runtime/bin/fal-site.mjs upgrade - 其他情况→ 执行。
node runtime/bin/fal-site.mjs generate
- 运行脚本。每次流程耗时60–180秒(1次截图 + 2次视觉模型调用 + 1次图片编辑)。调用前向用户发送简短状态提示。
upgrade - 展示结果。
- 打开(通过Read工具)让用户查看新设计。
after.png - 在聊天中粘贴(或其重点内容)。
changes.md - 询问用户:「需要我现在在中实现这些修改吗?」
<file>
- 若用户同意则实现。读取当前文件,逐部分应用规范,严格遵循「硬约束」内容,并从中提取精确值。对于结果网格中的图像,直接参考
tokens.json,要么使用匹配宽高比的after.png占位符,要么选择符合风格的素材图。<img> - 可选迭代。实现完成后,提供命令以生成残留增量规范。应用增量修改并刷新页面。
node runtime/bin/fal-site.mjs iterate --target <file> --reference <after.png>
Model notes
模型说明
- Opus 4.7 handles multi-image reasoning and produces precise design specs. For 3× cheaper runs with near-parity on this task, set .
FAL_SITE_MODEL=anthropic/claude-sonnet-4.6 - is the right primitive because it edits an existing screenshot while preserving legible in-image text, avoid substituting other image models here.
gpt-image-2/edit
- Opus 4.7可处理多图像推理并生成精准的设计规范。若想以三分之一的成本获得近乎一致的效果,可设置。
FAL_SITE_MODEL=anthropic/claude-sonnet-4.6 - 是合适的基础模型,因为它能编辑现有截图同时保留图像内清晰的文本,请勿替换为其他图像模型。
gpt-image-2/edit
Runtime details
运行时细节
The skill ships a small Node 18+ runtime under (, , ). First-time setup: . Override the runtime path with .
runtime/puppeteer@fal-ai/clientsharpcd runtime && npm installFAL_SITE_RUNTIME=/abs/path该工具附带一个小型Node 18+运行时,位于目录下(依赖、、)。首次设置:。可通过覆盖运行时路径。
runtime/puppeteer@fal-ai/clientsharpcd runtime && npm installFAL_SITE_RUNTIME=/abs/path