visual-edit-precision
它能做什么
这个工具可以帮你按照你指向的或在图片中展示的内容,对网站或应用做一些小修改。它只改你需要的部分,不会动其他地方。
适用场景
- ✓当你指向某个按钮,想改变它的颜色时。
- ✓当你发送一张图片,展示你希望网站某个部分呈现的样子时。
- ✓当你在某个元素上画一个箭头,表示需要修改它时。
技能链接
https://github.com/wshobson/agents/blob/main/plugins/skill-forge-essentials/skills/visual-edit-precision/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请按照图片中的样子,把这个按钮的颜色改成蓝色。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会识别你选中或画出的具体位置,找到对应的代码,并做出尽可能小的修改来达成你的需求,其他内容一律不动。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Visual Edit Precision
Overview
When visual context accompanies a change request (element selections, annotations, screenshots), make targeted, minimal edits. Precision over ambition: change exactly what was indicated, preserve everything else.
Process
When visual context is provided:
- IDENTIFY - What exact element(s) were indicated? Which component file owns them?
- SCOPE - Change ONLY what was pointed at. Don't refactor surrounding code.
- PRESERVE - Keep existing styles, classes, and behavior. Only modify what was asked.
- TARGETED - Make the minimal CSS/markup change that achieves the visual result.
- VERIFY - Confirm the change renders correctly without side effects.
Key Principles
Precision Over Ambition
Visual context gives a SPECIFIC element. Don't:
- Refactor the entire component when only one style was requested
- Change the component's API when only its appearance was pointed at
- Touch logic when only visuals were selected
Do:
- Find the exact file and line for the selected element
- Make the minimal edit that achieves the described visual change
- Preserve all existing behavior, event handlers, accessibility
Multiple Edits
When multiple visual edits arrive:
- Each targets its own element independently
- Don't wait for one to finish before processing another
- If two edits conflict (same element, different requests), handle the most recent
Common Mistakes
- Rewriting an entire component when the user pointed at one button
- Changing global config when only one element's color needs adjusting
- Breaking responsive behavior by adding fixed widths to match a selection
- Ignoring specificity (user indicated ONE card, agent changed ALL cards)
- Removing accessibility attributes (aria-*, role, tabindex) during visual edits
常见问题
如果我一次让它改很多东西,会怎样?
AI 会逐个处理每个请求。如果两个请求针对的是同一个地方,它会以最近的那个为准。
为什么不能多改?
只改你要求的部分,可以避免破坏网站或应用中其他已经正常运行的部分。
如果我只指向一个东西,AI 会把整个代码都改掉吗?
不会。它只修改你指定元素对应的代码,其余部分保持不变。
详情
作者的原始描述
Use when making UI/frontend changes guided by visual context, when the user selects elements visually, draws annotations, or provides screenshots alongside change requests. Also use when editing components where spatial context (element identity, DOM references, layout data) supplements text instructions.
repo: wshobson/agents
热度
- GitHub 星标
- 41k
- 排名
- #6790
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …