{"success":true,"name":"brimind-maps-photos","description":"Take a business's own photos off its Google Maps listing with the repo's abstract browser (browser-opener) and put them on its site as a real gallery — the hero shot plus a lightbox section. Use when building or improving any client site, when a page looks like a template, when asked for \"their images\", \"photos from Maps\", \"a gallery\", or when scraping a listing for anything at all.","category":"unitary","path":"unitary/brimind-maps-photos/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-maps-photos\ndescription: Take a business's own photos off its Google Maps listing with the repo's abstract browser (browser-opener) and put them on its site as a real gallery — the hero shot plus a lightbox section. Use when building or improving any client site, when a page looks like a template, when asked for \"their images\", \"photos from Maps\", \"a gallery\", or when scraping a listing for anything at all.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/s3a/skills/brimind-maps-photos`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# The listing's photos, on the client's site\n\nA site built from a Google listing has exactly one asset no template can fake:\nthe pictures the business and its customers already put online. One flat colour\nhero reads as a template; their own room, their own van, their own counter reads\nas **their page**. This skill is how those images get from Maps onto the site,\nonce, for every site — present and future.\n\nEverything here goes through **`browser-opener`**, the repo's abstract browser\ndriver. Never hand-roll a fetch of `maps.google.com`: only that driver opens the\ngallery, walks it, and filters out account avatars and surrounding map imagery.\n\n## The one command\n\n```bash\nnode agents/method/photos.mjs <slug>                     # dry run — what the listing has\nnode agents/method/photos.mjs <slug> --write             # download + patch site.config.js\nnode agents/method/photos.mjs <slug> --write --caption   # + the line under each photo\nnode agents/method/photos.mjs <slug> --write --recaption # rewrite the lines already there\nnode agents/method/photos.mjs --all --write              # backfill every delivered site\n```\n\nIt reads `clients/projects/<slug>/site.config.js`, asks the listing for its\ngallery, writes `public/photos/<slug>.jpg` (the hero) and `<slug>-2.jpg`,\n`<slug>-3.jpg` … , then rewrites `business.photos`:\n\n```js\nphotos: [\n  { src: '/photos/marina-garden.jpg',   alt: 'Marina Garden à Wavre' },\n  { src: '/photos/marina-garden-2.jpg', alt: 'Marina Garden à Wavre — photo 2' },\n],\n```\n\nIdempotent, and it never shrinks a gallery: anything already in `public/photos/`\nstays in the config whatever this run managed to read. Maps' gallery walk is not\ndeterministic (the same listing gave 2 photos one minute and 1 the next), so\n**running it twice is the cheapest way to grow a thin gallery**. Expect 1–4\nphotos per listing today, not the whole album.\n`photos: []` is a valid answer — the gallery section then renders **nothing**,\nwhich is the correct outcome for a Street View-only listing, not a bug to fix.\n\n## The line under each photo\n\n`--caption` shows the thumbnails to an agent (through `scripts/agent.js`, never a\ndirect API call) and asks for one sentence each that **announces what the house\noffers** — the prestation or equipment that photo proves, plus what the client\ngets from it. It is not a description of the picture: the visitor can see the\npicture, and \"les bougies baignent la salle d'une lumière calme\" sells nothing.\n\"Hammam en mosaïque, panneau sculpté et lumière tamisée pour la détente\" does.\n\n`parseCaptions()` throws away anything that reads like a claim we have not\nchecked: a price, \"offert\" / \"gratuit\" / \"inclus\" / \"garanti\", an exclamation\nmark, a link, and any answer of the wrong length or count. It also survives the\nagent's own `[[Claude Web web]]` marker wherever it lands in the answer — twice\nthat marker silently ate a perfectly good set of captions.\n\n**A photo with no caption shows no caption.** No \"Photo 3\", no fallback sentence,\nnothing — that is the rule the feature is built around, and it is why the blurred\nvideo frame on `maison-du-bien-etre` is the one slide with no text on it.\n\n## How it reaches the page\n\n`components/Gallery.jsx` lives in the template (`clients/projects/js-auto`) and\nis copied to every site by `node clients/sync-template.mjs --write`. It is\nalready wired into `app/page.jsx` between the rating proof and the services, and\nits words come from `copy.gallery` in each site's config. **Nothing per-site to\nwrite** — fill `business.photos` and the section appears.\n\n**Why a filmstrip and not a grid.** A grid decides how big a photo is before it\nknows what the photo is, so a 448px listing shot lands in an 800px cell and ships\nblurred, and four photos eat two screens. The rail is one height (300px, the\nheight of Google's own thumbnails) and each slide is only as *wide* as its own\naspect ratio — small photo, small slide, nothing upscaled, a third of the page.\n\nThe rest of the rules, so no future site re-litigates them: native scroll so the\nswipe is the browser's own gesture; arrows beside the title, never on the photo;\nevery slide a real `<button>` with a focus ring; a lightbox with Esc / ← / →, a\nfocus trap, scroll lock, and focus returned to the slide that opened it; ~40 KB\nthumbnails in the rail and the full file only in the lightbox; width/height on\nevery image; a distinct `alt` per shot; motion dropped under\n`prefers-reduced-motion`.\n\n## Gotchas paid for already\n\n- **`business.placeRef` is often not a place_id.** MÉTHODE 03 stores the `0x…:0x…`\n  *feature id*; Maps answers that with a search page and the driver times out.\n  `photos.mjs` prefers a `ChIJ…` ref, then the listing URL. Do the same anywhere else.\n- **Street View is not a photo of the business.** URLs on\n  `streetviewpixels-pa.googleapis.com` are dropped. A grey street is not a gallery.\n- **Take `large`, not `url`.** `url` is the original — several MB. A 3 MB image on\n  a phone is a worse site, not a better one.\n- **A 403 on a photo URL is not a dead photo.** See the `browser-opener` section of\n  `USAGE.md`: those endpoints refuse anything that announces itself as a script.\n  Send a plain `Mozilla/5.0` User-Agent.\n- **Never edit a site's `app/page.jsx` or `components/Gallery.jsx` by hand.** Fix\n  the template in `js-auto`, run `node clients/sync-template.mjs --write`.\n\n## New sites get it for free\n\n`agents/method/rail03.mjs` now asks the listing for 8 photos, keeps up to 6, and\nwrites both `business.photo` and `business.photos` as it builds. `deliver.mjs\ncheck <slug>` refuses a `photos` entry whose file is missing or whose `alt` is\nempty, and warns when a site has fewer than two (no gallery). So: build, and the\ngallery is there. Only a hand-built or older site needs `photos.mjs` run at it.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}