annotate-screenshots
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnnotating screenshots
截图标注
When to annotate
何时进行标注
Add annotations when a screenshot needs to draw the reader's eye somewhere
specific — a new element, a bug, a diff — rather than leaving them to find it
in the caption. A plain before/after pair is often enough; reach for
annotation when "look at the top-right corner" is easier to say with an
arrow than with words, or when a screenshot contains a secret that must be
hidden before it's shared anywhere (uploads.sh URLs are public).
Two commands, same underlying spec format:
| Command | Input | Targeting |
|---|---|---|
| captures a live page | CSS selectors (preferred) or pixel coordinates |
| an existing PNG/JPEG file | pixel coordinates only — selectors are rejected |
Prefer selectors, resolved live, over guessing pixel coordinates. An
agent estimating /// by eye is unreliable — it's easy to point at
the wrong element or clip a box awkwardly.
resolves a CSS selector against the real DOM at capture time (local backend
only in v1 — rejects selector-bearing specs up front), so use
it whenever you're capturing the page yourself. Fall back to pixel
coordinates with only when you're marking up an image you
already have and there's no live page to query — a screenshot someone else
took, a photo, a diagram exported from elsewhere.
xywhuploads screenshot --annotate--via remoteuploads annotate当截图需要引导读者关注特定位置时添加标注——比如新元素、Bug、差异内容——而非让他们从说明文字中自行查找。通常一组简单的前后对比图就足够;当“看右上角”用箭头比文字更易表达,或者截图包含必须隐藏的敏感信息(uploads.sh的URL为公开链接)时,就可以使用标注功能。
两个命令,遵循相同的底层规范格式:
| 命令 | 输入 | 定位方式 |
|---|---|---|
| 捕获实时页面 | CSS选择器(优先推荐)或像素坐标 |
| 已有的PNG/JPEG格式文件 | 仅支持像素坐标——选择器会被拒绝 |
**优先选择实时解析的选择器,而非猜测像素坐标。**人工估算///坐标并不靠谱——很容易指向错误元素或框选区域位置尴尬。会在捕获时针对真实DOM解析CSS选择器(v1版本仅支持本地后端——会直接拒绝包含选择器的规范),因此只要是自行捕获页面,就优先使用该命令。只有当你需要标注他人提供的截图、照片或其他来源导出的图表,且没有可查询的实时页面时,才退而求其次使用的像素坐标方式。
xywhuploads screenshot --annotate--via remoteuploads annotateThe spec format
规范格式
A spec is a JSON document: .
is a non-empty array; each entry has a plus fields for
that type. House style (color, stroke weight, sketchy roughness, font) is
fixed and not configurable — the one style knob is a per-annotation
override.
{ "version": 1, "annotations": [...] }annotationstypecolorAnnotation types:
| Type | Required fields | Notes |
|---|---|---|
| | outlines a region |
| | |
| | a callout bubble with a leader line to |
| | freeform stroke, pixel-only, no selector support |
| | hides a region (default |
| | escape hatch, injected verbatim |
Rules: a geometric annotation (///) takes either
pixel geometry or , never both — supplying both is rejected as
ambiguous. and never take a selector. Every type accepts an
optional override.
boxarrowlabelredactselectordrawsvgcolor规范是一个JSON文档:。为非空数组;每个条目包含字段以及对应类型的专属字段。样式(颜色、线条粗细、手绘粗糙感、字体)为固定不可配置——唯一的样式可选项是为单个标注设置覆盖默认值。
{ "version": 1, "annotations": [...] }annotationstypecolor标注类型:
| 类型 | 必填字段 | 说明 |
|---|---|---|
| | 勾勒出一个区域 |
| | 通过选择器解析时, |
| | 带引线的标注气泡,指向 |
| | 自由线条,仅支持像素坐标,不支持选择器 |
| | 遮蔽指定区域(默认样式为 |
| | 自定义扩展入口,会直接注入原始内容 |
规则:几何类标注(///)只能选择像素坐标或中的一种,同时提供两者会因歧义被拒绝。和类型不支持选择器。所有类型都接受可选的覆盖字段。
boxarrowlabelredactselectordrawsvgcolorWorked example — selector mode (preferred)
示例——选择器模式(优先推荐)
Point at a specific element on a live page, label it, and redact a nearby
API key, then capture and annotate in one call:
json
{
"version": 1,
"annotations": [
{ "type": "box", "selector": "#save-button" },
{ "type": "label", "text": "New: bulk save", "selector": "#save-button" },
{ "type": "redact", "selector": "[data-testid=api-key]", "style": "solid" }
]
}bash
uploads screenshot http://localhost:4321/settings --via local \
--annotate ./callouts.json --out settings.png指向实时页面上的特定元素,添加标签,并遮蔽附近的API密钥,一步完成捕获和标注:
json
{
"version": 1,
"annotations": [
{ "type": "box", "selector": "#save-button" },
{ "type": "label", "text": "新增:批量保存", "selector": "#save-button" },
{ "type": "redact", "selector": "[data-testid=api-key]", "style": "solid" }
]
}bash
uploads screenshot http://localhost:4321/settings --via local \
--annotate ./callouts.json --out settings.pngWorked example — pixel mode (existing image only)
示例——像素模式(仅适用于已有图像)
Annotating a screenshot you already have — no live page to query, so
geometry is given directly:
json
{
"version": 1,
"annotations": [
{ "type": "box", "x": 120, "y": 84, "w": 220, "h": 48, "color": "#2563eb" },
{ "type": "arrow", "from": [520, 60], "to": [360, 108] },
{
"type": "draw",
"points": [
[40, 400],
[80, 380],
[120, 420],
[160, 390]
]
}
]
}bash
uploads annotate ./before.png --spec ./callouts.json --out ./before.marked.pngCoordinates are in image pixels, not CSS/viewport pixels — for a capture at
the image is 2560x1600, so pixel-mode geometry must
be scaled accordingly. This is exactly why selector mode is preferable
whenever a live page is available: the resolver handles device-scale
conversion for you.
--viewport 1280x800@2xRead a spec from stdin with :
-bash
cat ./callouts.json | uploads annotate ./shot.png --spec -标注已有的截图——无实时页面可查询,因此直接提供坐标:
json
{
"version": 1,
"annotations": [
{ "type": "box", "x": 120, "y": 84, "w": 220, "h": 48, "color": "#2563eb" },
{ "type": "arrow", "from": [520, 60], "to": [360, 108] },
{
"type": "draw",
"points": [
[40, 400],
[80, 380],
[120, 420],
[160, 390]
]
}
]
}bash
uploads annotate ./before.png --spec ./callouts.json --out ./before.marked.png坐标为图像像素,而非CSS/视口像素——如果以捕获,图像分辨率为2560x1600,因此像素模式下的坐标必须相应缩放。这也是为什么只要有实时页面就优先选择选择器模式的原因:解析器会自动帮你处理设备缩放转换。
--viewport 1280x800@2x通过从标准输入读取规范:
-bash
cat ./callouts.json | uploads annotate ./shot.png --spec -Redacting secrets
遮蔽敏感信息
Every uploads.sh object is public once uploaded — see the github-screenshots
skill's "Cautions" section. Before capturing or attaching a screenshot that
shows an API key, token, password, session cookie, or other secret, add a
annotation with over it. Always use for
secrets — blurred text can be recoverable, so reserve for
non-sensitive visual cleanup where the surrounding shape should stay
legible, never for credentials. Do this at
capture time with when possible — it's one less
chance to forget before the image goes anywhere public.
redactstyle: "solid"solidstyle: "blur"screenshot --annotate所有uploads.sh上传的对象一旦上传即为公开——可查看github-screenshots技能的“注意事项”部分。在捕获或附加包含API密钥、令牌、密码、会话Cookie或其他敏感信息的截图前,添加标注并设置覆盖敏感区域。敏感信息必须始终使用样式——模糊处理的文本仍可能被恢复,因此仅用于非敏感的视觉清理(需保留周围形状可读性的场景),绝不能用于凭证遮蔽。尽可能在捕获时使用完成遮蔽——减少图像公开前遗忘遮蔽的风险。
redactstyle: "solid"solidstyle: "blur"screenshot --annotateWorkflow: capture, annotate, attach
工作流:捕获、标注、附加
- Capture and annotate together when there's a live page:
. This is one call — no separate "capture then annotate" round-trip.
uploads screenshot <url> --via local --annotate ./spec.json ... - Annotate an existing image with when there's no live page (an image from elsewhere, or a second annotation pass on something already captured).
uploads annotate <image> --spec ... - Attach the result to a PR or issue — this skill stops at producing the
annotated PNG. Hand off to the github-screenshots skill for hosting,
embedding, and the managed attachments comment (,
uploads attach, before/after tables, etc.).uploads put --pr
Invalid specs fail fast with per-annotation error messages
(); a selector that matches nothing on the page
fails the command naming the selector rather than silently skipping it. See
/ for the full flag
reference, including (deterministic sketchy rendering) and
.
annotations[i]: <reason>uploads annotate --helpuploads screenshot --help--seed--format json- 当有实时页面时,同步完成捕获与标注:。一步完成操作——无需分开执行“捕获后再标注”的往返步骤。
uploads screenshot <url> --via local --annotate ./spec.json ... - 当无实时页面时,标注已有图像:使用(比如来自其他渠道的图像,或对已捕获图像进行二次标注)。
uploads annotate <image> --spec ... - 将结果附加到PR或Issue中——本技能仅负责生成标注后的PNG图像。如需托管、嵌入以及生成托管附件评论(、
uploads attach、前后对比表格等),请交给github-screenshots技能处理。uploads put --pr
无效规范会快速抛出针对单个标注的错误信息();页面上未匹配到任何元素的选择器会直接导致命令失败,而非静默跳过。查看 / 获取完整的参数参考,包括(确定性手绘渲染)和。
annotations[i]: <原因>uploads annotate --helpuploads screenshot --help--seed--format json