# Profile fleet lifecycle Creating, renaming, re-modeling, and removing Hermes profiles when building a role-based agent fleet (one profile per role: web-dev, mobile-dev, game-dev, designer, image-artist, PM, librarian, personal-assistant, plus `default` as the manager). ## Create each role by cloning a configured base - `hermes profile create --clone-from --no-alias` copies config.yaml, .env, SOUL.md, and skills. Use it so guard hooks (the `pre_tool_call` shell guard) and the skill set carry into every role instead of hand-wiring each one. `--clone-channels` is deliberately NOT used — two profiles must not share one bot token; cloning leaves messaging channels behind. - Ids MUST be lowercase alphanumeric (e.g. ``, ``). A display label with capitals/spaces is only possible for `default` via `hermes profile rename default ` (id stays `default`, a display name is attached). - After cloning, two things still hold the BASE role's identity and must be overwritten per profile: 1. The model line — `hermes -p config set model.provider/default/api_mode/base_url` (see model-provider-fallback-wiring.md for the provider map). 2. `SOUL.md` — the clone carries the base role's text verbatim. Read it, then rewrite the role, workspace, worker delegation, and output contract for the new role. ## New project-PM profile checklist (Telegram-bound) 1. Clone from a sibling PM profile (`--clone-from `) with `--description`; do not pass `--clone-channels`. The clone may arrive without a `.env`: provider credentials then come from the global pool (same as other role profiles), and the bot token is written later into `~/.hermes/profiles//.env` (`TELEGRAM_BOT_TOKEN`, `TELEGRAM_ALLOWED_USERS=`). Never copy a sibling's `.env` wholesale: two profiles polling one bot token steal each other's updates. 2. Back up `config.yaml`, then drop fallback entries for providers the user no longer pays for (e.g. `fallback_providers: []` when GPT is cancelled); confirm `model.default/provider`. 3. Copy the project's global skill into the profile (`cp -R ~/.hermes/skills// ~/.hermes/profiles//skills//`); profiles do not see the default profile's skills. 4. Rewrite `SOUL.md` (read it fully first; write tools refuse an unread file): scope = one product, repo and permanent worktrees, existing cron loops it must not break, verification rule (every claim backed by repo or the product's PM), delegation target, approval gates, the user's text-style rules (no em dash). Keep the shared "Ortak başlangıç" and "Güvenlik" blocks verbatim. 5. Smoke test: `hermes -p chat -q "Tek cümleyle: kimsin, hangi repodan sorumlusun?" --oneshot -Q --max-turns 2 --run-budget 90`, then confirm `model=... provider=...` on the last `API call #` line of the profile's `logs/agent.log`. 6. Bot wiring: The user creates the bot in BotFather and sends the token. Back up the profile's `.env`, then add (or append to an existing `.env` without touching other keys) `TELEGRAM_BOT_TOKEN`, `TELEGRAM_ALLOWED_USERS=`, `TELEGRAM_HOME_CHANNEL=`, `chmod 600`. Check the token without echoing it and without reading `.env` in the agent (have the user run it, or run it where the variable is already in the environment): `curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getMe"` must return `ok: true` and the bot username. No gateway restart is needed: the multiplex gateway re-scans a profile after a `.env`/config change; confirm with `grep 'telegram connected (profile: )' ~/.hermes/logs/gateway.log` within ~30 s. Then tell the user to open `t.me/` and send `/start`. ## Assign models by workload, not one-size - Heavy code roles (web/mobile/game dev) → the strongest coding model (e.g. Claude Opus) with a code CLI (`claude`, Codex) as the delegated worker. - Design / PM / librarian / coordination-only roles → a mid model (e.g. Claude Sonnet). - An image role's CHAT layer is just coordination (Sonnet); real raster output comes from separate workers (Codex/GPT imagegen, `agy`/Gemini `generate_image`) that use their own CLI auth — do not make the profile's primary model a provider whose OAuth the profile does not hold, or every turn fails with "No credentials stored". A profile does NOT inherit another profile's provider OAuth even after cloning. ## Rename carries an identity migration - `hermes profile rename ` renames the folder AND rekeys session/routing identity (session keys, profile_name, heartbeats, routing/delivery rows). For a profile that carries a bot token + OAuth (personal assistant), the token JSON and google_token.json move with the folder — verify with `ls ~/.hermes/profiles//*.json` and a live `hermes -p config get model.default`. - If a stale entry for the OLD name lingers in `hermes profile list` (shows `—` for model, gateway still `running`), run `hermes profile migrate-identity ` to rekey the routing rows the gateway loaded before the rename. It is idempotent. ## Removing a stale profile folder without collateral damage - `hermes profile delete ` is INTERACTIVE (prompts you to type the id) and, under a multiplex gateway, warns "Gateway is running — it will be stopped." Do not run it non-interactively to clean up leftovers: a cancelled prompt does nothing, and confirming stops the shared gateway that serves every other profile. - To retire a leftover folder that no longer has a config (only old sessions/state remain), move it aside instead of deleting: `mv ~/.hermes/profiles/ ~/.hermes/profiles/.deleted--`. This drops it out of `hermes profile list` immediately, keeps the gateway up, and is reversible. Delete the archived folder only after the replacement is confirmed working.