Hermes project avatar
Make the agent's own Telegram bot wear the associated project's CURRENT branding, never a stale file. One canonical skill for the whole fleet; never per-profile copies.
Non-negotiables
- Find the real current logo first. A
logo.svg/logo.pngat the repo root is often stale. Trace what the live frontend actually renders: the header/brand component source, inline<svg>in JSX/TSX, favicon,manifest.jsonicons, and branding assets. When a site is served locally (e.g. a docker container), fetch the rendered HTML and confirm which markup is served. Prefer the exact inline SVG the header component uses, with fills resolved from the CSS custom properties / design tokens it references. - The bot's identity is its own. Call
getMeand confirm the bot id AND username match the profile's registered bot (role.yaml / registry row). Never run against a shared/default token because the right one was missing. - Secrets never surface. The token is an
op://reference in the profile'sconfig.yamlsecrets.onepassword.env.TELEGRAM_BOT_TOKEN. Read it inside a subprocess (e.g.op readcaptured into a variable), never print the token, request URL, full exception text, or argv containing it. Use urllib in-process; no third-party HTTP libs needed. - No repeat uploads. Check a receipt before uploading; write one after
(see Receipts). Verification of an existing avatar is read-only
(
getUserProfilePhotos+getFiledownload), never a re-upload "to test". - Bulk changes are out of scope. This skill sets the avatar of the RUNNING agent's own bot only. Fleet-wide sweeps, new bots, or reactivating disabled/dead bots require explicit operator authority (agent-fleet-operations).
Holocene is the universal setter
Every agent has ONE avatar, owned by the Holocene API and mirrored both ways with its Telegram bot:
- Set or replace it: https://holocene.delo.sh/settings (upload, crop, save), or
curl -X PUT -H 'Content-Type: image/jpeg' --data-binary @avatar.jpg http://127.0.0.1:4000/api/modules/avatars/<agent-id>(a square JPEG, ideally 1024px). Holocene stores it, pushes it to the bot with the profile's own token, reads it back and writes this skill's receipt. - Changed on Telegram (e.g. by this skill's upload step): Holocene's 10-minute sync pulls it in. Last writer wins.
- No avatar yet: the sync takes the bot's current photo.
- The Agent Pad and the hub canvas read Holocene's copy, so every surface follows.
So: steps 1-3 below (find the real logo, persona gate, convert) are still this skill's job. For step 4, prefer the
Holocene PUT over a direct setMyProfilePhoto; it does the upload, verification and receipt in one call and keeps
Holocene in sync immediately instead of on the next pass. Status per agent: GET /api/modules/avatars.
A receipt written by Holocene (source: "holocene settings ...", content_hash = sha256 of the uploaded JPEG)
records what the bot wears, but it never satisfies this skill's no-op rule below: that rule needs a hash of a fresh
SVG conversion, which a Holocene upload does not have. After a Holocene upload, re-running this skill re-uploads.
Workflow
1. Resolve the project and its branding
- The associated project is the profile's project (
.project.json, role.yaml, or the Skillex profile receipt'sprojectfield). - Gather candidates in order: inline SVG in the header/brand component →
favicon / manifest icons → static branding assets → root logo files. Record
file paths + last-commit dates as evidence; a root
logo.svgmonths older than the brand component is presumptively stale. - Rendered-page proof beats filename:
curlthe served page and match the inline SVG markup against component source before choosing.
2. Persona check — BEFORE any replacement
Run this gate before converting or replacing anything, on every request, not only when no logo exists:
- If the bot has an intentional named/persona branding (check the profile's role.yaml / registry row / prior receipts) that deliberately differs from the project's branding, PRESERVE the persona. Do not silently replace it with project branding.
- Only when there is a genuine, unintended conflict (persona looks stale, project branding was rebranded, or the persona was never intentional) ask ONE clarifying question; never unbounded back-and-forth.
- An explicit request to upload a specific EXISTING logo is authorized as-is.
3. Convert to a square raster
scripts/telegram_avatar.py is a CONVERTER ONLY — it renders an SVG to a circle-safe, centered, square RGB JPEG on a requested background. It is NOT a Telegram upload pipeline: it never touches a bot token, uploads nothing, and verifies nothing. Upload and read-only verification below are performed by the agent per the documented API.
The converter reads the mark's real viewBox (override with --viewbox),
pads it symmetrically so an inscribed circular crop keeps the mark intact,
preserves aspect ratio for non-square marks, and prints one JSON line whose
content_hash covers the source bytes plus every render parameter
(viewBox, pad, background, size). That hash is what makes receipt gating
sound: a NEW design written to the SAME file path produces a DIFFERENT hash.
Regression tests live in tests/test_telegram_avatar.py; run them with an
interpreter that has Pillow + pytest (e.g. /usr/bin/python3 -m pytest).
Inspect the result visually before uploading.
4. Upload and verify
- Endpoint:
POST https://api.telegram.org/bot<token>/setMyProfilePhoto, multipart with fieldphotowhose value is JSON{"type":"static","photo":"attach://avatar"}and file partavatarholding the JPEG bytes. - Verify:
getUserProfilePhotos(<bot_user_id>, limit=1)shows a NEW uniquefile_unique_id(compare against the pre-upload value), thengetFile+ download and visually compare the returned image.result: truealone is NOT verification. Verification is READ-ONLY (these two getters plus a download); never re-upload or call setters "to test".
5. Receipt
Write <profile>/cache/avatar-telegram.json (create cache/ if needed):
{
"bot_id": 8297904211,
"bot_username": "@HolocenePMBot",
"source": "apps/web/app/hub/hub-app.tsx Brand() inline SVG (hub.css tokens)",
"content_hash": "sha256:…",
"render": {"pad": 5, "background": "#f1f0eb", "size": 1024},
"checked_at": "2026-10-16T…Z",
"photo_file_unique_id": "…",
"verified_download": "/…/cache/scratch/<name>-telegram-avatar-verified.jpg"
}
No-op only when ALL of these match, verified fresh this run:
- Identity:
getMereturns the same bot id AND username as the receipt (the running profile's own bot — not a shared token's bot). - Content: the receipt's
content_hashequals the hash from a FRESHconvertrun of the current source (same bytes AND same render parameters). Same source PATH alone is NOT enough — a new design written to the same file path must change the hash and trigger a re-upload. A receipt missingcontent_hashfails this check closed. - Remote state:
getUserProfilePhotosright now returns the samefile_unique_idas the receipt. A photo id recorded from a past run with no fresh readback does not gate anything.
Only when all three hold, report "already set" and skip the upload. Anything else — different hash, different live photo id, missing receipt fields, unreachable bot — means upload (or a truthful blocker). Never fabricate a receipt retroactively: it is written only after an actual upload and verification this run.
Missing creds or a disabled/dead bot is a truthful blocker, never a reason to use another token or reactivate anything.
No-logo branch — make it a priority, don't stall
When the project genuinely has no logo, do not stop at a placeholder:
- Create/reuse a high-priority scoped design task on the project's board via
its board tools (project-lifecycle / pilot
px), respecting WIP limits. - Gather existing product/design context from the repo.
- Propose a small concrete set of concepts (2–4) to the user; iterate on feedback until one is accepted. No unbounded retries.
- Save the accepted design as the canonical source through the authorized worker, then run steps 3–5 above (convert, upload, verify, receipt).
- Distinguish "waiting on user feedback" (task stays open) from "complete". New branding is selected WITH the user, never silently replacing site identity. Persona conflicts are already handled by the step-2 gate; if this branch is reached, no intentional persona branding exists.
Evidence
Report receipts without secrets: bot id/username, source file + line, converted raster path, Telegram photo file_unique_id, and verification download path. Output counts, not tokens.