rpi5/hermes/skills/immich-random-album-photo/SKILL.md
Use when sending a random photo from a named Immich album.
npx skillsauth add nsimonfr/nic-os immich-random-album-photoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use when Nico asks for a random photo from an Immich album, especially to send it in Telegram.
/run/agenix/immich-api-key inside a script; never print it.curl -fsS -H "x-api-key: $API_KEY" \
'http://127.0.0.1:2283/api/albums?withAssets=false'
albumId is ignored by the metadata endpoint; use albumIds:curl -fsS -X POST -H "x-api-key: $API_KEY" -H 'Content-Type: application/json' \
-d '{"albumIds":["<album-id>"],"size":250}' \
'http://127.0.0.1:2283/api/search/metadata'
Read candidates from .assets.items. Confirm .assets.total matches the album's assetCount when practical.
Randomly choose only an item where type == "IMAGE", using secrets.choice / SystemRandom, not a seeded PRNG. If no image exists, say so; do not send video.
Do not retain a local copy. For Telegram delivery, stream the preview bytes directly from Immich to the Telegram Bot API as an in-memory multipart upload. Read the bot token from /run/agenix/telegram-bot-token; never print it and never write the image to disk.
Routing: always send to the current conversation using $HERMES_SESSION_CHAT_ID. Never use a hard-coded personal/home-DM chat ID. If that variable is unavailable, stop and ask rather than guessing. This preserves group/topic delivery. Verify the Telegram response result.chat.id equals $HERMES_SESSION_CHAT_ID as well as HTTP success.
If direct Telegram delivery is unavailable, ask before using a temporary local file. Do not use MEDIA: by default because it requires a local file. If the user explicitly approves a temporary file, delete it immediately after confirmed delivery.
Do not disclose API keys, bot tokens, or private filesystem paths.
GET /api/albums/<id>?withAssets=true may return only album metadata on this Immich version. Use POST /api/search/metadata with albumIds.albumId (singular) can silently return the entire library. Only albumIds restricts results.assets.total == album assetCount).result.chat.id equals $HERMES_SESSION_CHAT_ID.development
Geocode, POIs, routes, timezones via OpenStreetMap/OSRM.
tools
Use when planning departure for the next calendar event.
databases
Yuanbao (元宝) groups: @mention users, query info/members.
tools
Write desktop app plugins that add UI panes and commands.