with one click
ln-033-hex-relay-lifecycle
// Use when deploying, redeploying, verifying, migrating, or syncing users for the hex-relay Telegram/API control plane on a VPS.
// Use when deploying, redeploying, verifying, migrating, or syncing users for the hex-relay Telegram/API control plane on a VPS.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | ln-033-hex-relay-lifecycle |
| description | Use when deploying, redeploying, verifying, migrating, or syncing users for the hex-relay Telegram/API control plane on a VPS. |
| license | MIT |
| allowed-tools | Bash, Read, mcp__hex-ssh__remote-ssh, mcp__hex-ssh__ssh-read-lines, mcp__hex-ssh__ssh-write-chunk, mcp__hex-ssh__ssh-edit-block, mcp__hex-ssh__ssh-download |
Paths: File paths (
shared/,agents/hex-relay/,../ln-030-vps-bootstrap/references/) are relative to skills repo root. If not found at CWD, locate thisSKILL.mddirectory and go up one level for repo root.
Type: L3 Worker Category: 0XX Shared / Infrastructure
Manages hex-relay as a standalone product deployed into one project environment.
MANDATORY READ: Load shared/references/worker_runtime_contract.md, shared/references/coordinator_summary_contract.md, and shared/references/vps_runtime_contract.md
MANDATORY READ: Load ../ln-030-vps-bootstrap/references/hex_relay_deploy.md, ../ln-030-vps-bootstrap/references/verification_recipes.md, agents/hex-relay/README.md, agents/hex-relay/docs/redeploy.md, and agents/hex-relay/docs/telegram-operator-runbook.md
| Direction | Content |
|---|---|
| Input | mode, project/VPS variables, Telegram variables, optional declared users, optional dry_run, optional runId, optional summaryArtifactPath |
| Output | vps-hex-relay-lifecycle summary with status, changes, warnings, blockers, verification, and artifact paths |
If summaryArtifactPath is provided, write the same summary JSON there. If not provided, return the summary inline and write it to the standalone run-scoped path. Generate a standalone run_id when runId is absent.
| Mode | Behavior |
|---|---|
initial_deploy | Deploy agents/hex-relay/ into an existing project runtime |
redeploy | Replace source on VPS, rebuild, restart service, verify health |
verify_only | Inspect service, DB, hooks, Telegram command state without mutation |
sync_users | Reconcile declared Telegram users/roles through supported relay state |
Verify:
${PROJECT_NAME}, ${SERVICE_PREFIX}, ${PROJECT_DIR}, ${RELAY_HOOK_PORT} are set/etc/${PROJECT_NAME}/secrets.env exists but secret values are not printedagents/hex-relay/ source is available locallyUse hex_relay_deploy.md.
Detect old ${SERVICE_PREFIX}-relay-bot.service and /opt/${SERVICE_PREFIX}-relay-bot.
Rule:
${SERVICE_PREFIX}-hex-relay.serviceFor initial_deploy, install:
/opt/${SERVICE_PREFIX}-hex-relay${SERVICE_PREFIX}-hex-relay.serviceFor redeploy, follow agents/hex-relay/docs/redeploy.md:
node_modules or distnpm ci && npm run buildFor sync_users, reconcile declared users without exposing tokens.
Verify:
/new_session, /sessions, /tasks, /users, /usage command availabilityVerify:
${SERVICE_PREFIX}-hex-relay.serviceGET /healthrelay.db schemaWrite a vps-hex-relay-lifecycle summary artifact with deploy/redeploy/user-sync changes and health evidence.
hex-relay source is owned by agents/hex-relay/.dist/ on the VPS.node_modules/.dry_run=true and verify_only do not mutate remote state.agents/hex-relay/README.md.N/A: when disabled.relay-bot unit/path detected and disabled or reported before enabling hex-relay./opt/${SERVICE_PREFIX}-hex-relay source installed or verified.${SERVICE_PREFIX}-hex-relay.service active or planned.npm ci && npm run build for deploy/redeploy./health returns expected service and god-session fields.dry_run=true / verify_only performed no mutation.vps-hex-relay-lifecycle summary artifact written.Version: 1.0.0 Last Updated: 2026-05-05