| name | add-photos |
| description | Add new photos to the wrangell.dog repo — rename to dog-N.jpeg convention, generate captions via vision, update captions.js. Use when the user says "add photos", "I added images", "new photos", or when untracked image files appear in public/images/. |
| metadata | {"scope":"project","category":"content"} |
Add Photos
Handles the full photo intake workflow: rename → caption → update captions.js → stage for commit.
What this skill does
- Finds any untracked or newly-added image files in
public/images/ that don't follow the dog-N.jpeg naming convention
- Renames them sequentially from the next available number
- Views each image directly and writes a caption in the established style
- Appends entries to
captions.js and updates the header comment
- Stages everything — images + updated
captions.js — ready to commit
Step 1 — Find and rename
Run git status to find untracked files in public/images/. List existing dog-N.jpeg files to find the highest N.
Rename each new file to dog-<next>.jpeg in order. The order doesn't matter for site correctness (the homepage rotation is date-seeded and any order works), so process in whatever order git status lists them.
Step 2 — Generate captions
Read each new image directly with the Read tool (you can view images). For each one, write a caption following this style:
Caption rules:
- 2–5 words
- No articles (a, an, the)
- Wry and observational — describe what's actually happening, not what you wish were happening
- Must read standalone — no "again", "also", "same", or any word that implies context from another photo
- Present tense participial phrases or compressed noun phrases work best
- One strong specific detail beats a generic description
Examples of the style:
- "Ice cream, overhead" (not "Dog balancing ice cream sandwich on head")
- "His bed now" (not "A man sharing the dog bed")
- "Two tongues, one autumn" (not "Two happy dogs outside in fall")
- "Teeth, briefly visible" (not "Someone squeezing a dog's snout")
- "Turbaned, briefly" (not "Dog with a towel on its head")
After generating all captions, present them to the user as a numbered list with the image filename before asking to proceed. This lets the user tweak any before they're committed.
Step 3 — Update captions.js
public/captions.js structure:
window.WRANGELL_CAPTIONS = [
"Caption for dog-1",
...
"Caption for dog-N"
];
- Append new caption strings to the array (one per line, comma-separated, matching existing formatting)
- Update the header comment to reflect the new last image number
- The array index is 0-based:
captions[0] = dog-1, captions[N-1] = dog-N
Step 4 — Stage
git add public/images/dog-*.jpeg public/captions.js
Report what was added: N new photos (dog-X through dog-Y), N captions written. Leave the commit to the user unless they ask you to commit.
How the photos are used
Understanding these keeps you from breaking things:
Gallery (gallery.html): Uses captions.length as the total plate count. Generates images/dog-${n}.jpeg for n = 1..total. Adding a photo without a caption means the gallery will try to load an image that doesn't exist at that index — always keep images and captions in sync.
Homepage (index.html): Picks today's photo via (year*10000 + month*100 + day) % captions.length + 1. Every time photos are added, the rotation shifts for all future dates. That's expected and fine.
Service worker (sw.js): captions.js is in the app shell and served network-first. Images are cache-first (immutable). No action needed here.
Pre-commit hook (.githooks/pre-commit): Runs scripts/caption-new-images.js, which calls the Claude API if ANTHROPIC_API_KEY is set. Since you're handling captions manually in this skill, the hook will report "captions: up to date" and pass cleanly without the key.
Edge cases
- If the user drops files that are already named
dog-N.jpeg correctly, skip renaming — just check they have captions.
- If a photo already has a caption entry (e.g., the array was manually extended), skip it.
- If an image number would create a gap (e.g., dog-103 exists but dog-104 doesn't and the user dropped dog-106), fill sequentially from the first gap — never skip numbers.
- HEIC, PNG, or other formats: rename to
.jpeg extension only if the file is actually JPEG-encoded; otherwise note to the user that the file needs conversion first. Most iPhone exports are already JPEG regardless of original extension.