Skip to content

Commit 767b4e6

Browse files
tyethclaude
andcommitted
Fix skill: don't hardcode image range end number
The CDN image numbering isn't fixed at 04 — increment from 00 until a 404 instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a6ae706 commit 767b4e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.agents/skills/add-component-v1/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ The definition.json must validate against `components/i2c/schema.json`. Key cons
251251
- **USE THIS:** `https://cdn-shop.adafruit.com/original/<PID>-NN.jpg`
252252
- NOT: `https://cdn-shop.adafruit.com/970x728/<PID>-NN.jpg`
253253
- NOT: `https://cdn-shop.adafruit.com/640x480/<PID>-NN.jpg`
254-
- Where `NN` is the image number (`01` = default, `00`-`04` are common variants)
254+
- Where `NN` is the image number (`01` = default, `00` and up are common variants)
255255
- If you scraped a URL from the product page or API, replace the resolution part
256256
(e.g. `970x728`, `640x480`) with `original` before downloading
257-
3. **Check all available shots** by testing `00` through `04` — pick the slight-angle / isometric
257+
3. **Check all available shots** by incrementing from `00` until you get a 404 — pick the slight-angle / isometric
258258
close-up of the breakout board with a plain background (this is the standard Adafruit product
259259
photo style, typically image `00`). Avoid lifestyle shots, shots with other boards or
260260
accessories in the frame, or images where the board is very small in the frame.
@@ -390,7 +390,7 @@ import urllib.request, io, os
390390

391391
# 1. Download original resolution source (best quality)
392392
PID = '<product_id>'
393-
IMAGE_NUM = '01' # try 00-04 to find best shot
393+
IMAGE_NUM = '01' # try 00, 01, 02, ... until 404 to find best shot
394394
url = f'https://cdn-shop.adafruit.com/original/{PID}-{IMAGE_NUM}.jpg'
395395
data = urllib.request.urlopen(url).read()
396396
img = Image.open(io.BytesIO(data))

0 commit comments

Comments
 (0)