/specpin:number-ui-imagefrom specpin
Numbers visible components on a single UI image (PNG/JPG/JPEG/WEBP/SVG) in reading order and exports an annotated copy plus bbox JSON sidecar for the specshot editor in specpin.
Ships in specpin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Take one UI image and draw numbered boxes on every visible component, in reading order, then export an annotated copy. The numbering is produced by your own visual analysis of the image (there is no computer-vision detector in this skill) — so coordinates are best-effort and should be reviewed. The only executable code here just draws boxes from the JSON you write.
Usage: <image-or-svg-path> [--flat] [--legend] [--out <dir>]
Companion: the bbox JSON uses the exact {itemNo, position} shape consumed by the
specshot editor, so a user can auto-number here, then drag/fix boxes there. specshot lives
inside specpin (packages/specshot-core + specshot-react, hosted by the extension's
specshot.html page); the old standalone mark-number repo was retired on 2026-07-25. Both sides
of the contract now live in the specpin repository: it is documented at docs/mark-doc-schema.md,
and the enforcing twin of scripts/annotate-image-bboxes.py is
packages/specshot-core/src/model/mark-doc.ts.
Scope guard: this skill numbers and exports an image. It does NOT produce the 22-column component spec CSV — decline those requests and say so plainly.
.png, .jpg, .jpeg, .webp, or .svg.--flat — number items 1, 2, 3, … in strict reading order (no hierarchy). Default is
hierarchical (1, 1.1, 1.2, 2, …) where containment is visually explicit, max depth 3.--legend — also write a plain number → short label list (one line each). No spec fields.--out <dir> — output directory. Default: same folder as the source file.The bundled script needs Python 3 with Pillow (pip install Pillow); everything else it uses
is stdlib. Invoke it with whatever Python on the machine has Pillow available.
Resolve the source. Lock exactly one input file. Derive a stable slug from the file stem
(e.g. login-page).
Rasterize if SVG. If the input is .svg, render it to PNG at its native pixel size before
any analysis (all downstream work is in raster pixel space). Preferred command:
magick -density 96 -background white "<input.svg>" "<slug>-render.png"
If magick (ImageMagick) is unavailable, fall back to a headless-browser render (e.g. a
Puppeteer/Chrome screenshot at the SVG's width/height).
Confirm the rendered PNG opens and matches the SVG (read it back) before continuing.
Read the image. Open the raster image with the Read tool and study it. Record its exact
pixel width × height — every coordinate below is in that original pixel space.
Enumerate components in reading order (top→bottom, left→right). Follow
references/numbering-rules.md for what counts as one item,
how to nest, and how to assign itemNo.
Write the bbox JSON as <out>/<slug>-item-bboxes.json — a JSON array of
{ "itemNo": "…", "position": { "startX", "startY", "endX", "endY" } } objects, visual order,
pixel space, startX <= endX and startY <= endY, unique itemNo, max depth 3.
Draw the annotated image with the bundled script. Resolve
scripts/annotate-image-bboxes.py relative to this skill's own directory:
python3 <skill-dir>/scripts/annotate-image-bboxes.py \
"<render-or-source>.png" "<out>/<slug>-item-bboxes.json" \
"<out>/<slug>-numbered.png"
Optional style flags: --box-color, --label-color, --label-bg, --line-width, --font-size.
Review and self-correct. Read the annotated PNG back. If any box is clearly misplaced, overlapping the wrong element, or a label is cut off at an edge, fix those coordinates in the JSON and re-run step 6. Do not ship an annotation you have not looked at.
If --legend: write <out>/<slug>-legend.md — one - N. <short label> line per item,
labels from what is visibly on screen only. No invented behavior, validation, or DB fields.
Report the three (or fewer) artifacts produced with their paths, and state plainly that the coordinates are LLM-estimated and may need a manual pass in the editor web app.
<slug>-numbered.png — the annotated image (primary deliverable).<slug>-item-bboxes.json — editable coordinates (bridge to the editor web app).<slug>-render.png — only when the source was SVG.<slug>-legend.md — only with --legend.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ui-annotation, component-numbering, image-annotation, specshot, specpin
Other plugins' skills for the same job
npx claudepluginhub lamngockhuong/specpin --plugin specpin2 skills in this plugin