skills-catalog/ln-033-hex-relay-lifecycle/SKILL.md
Use when deploying, redeploying, verifying, migrating, or syncing users for the hex-relay Telegram/API control plane on a VPS.
npx skillsauth add levnikolaevich/claude-code-skills ln-033-hex-relay-lifecycleInstall 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.
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
testing
Checks runtime lifecycle and config validation: bootstrap, shutdown, probes, cleanup, env sync, and fail-fast startup. Use for runtime readiness.
testing
Checks races, deadlocks, async hazards, TOCTOU, blocking I/O, and shared resource contention. Use when auditing concurrency correctness.
testing
Checks diagnosability through structured logs, metrics, traces, correlation IDs, and useful log levels. Use when auditing incident visibility.
development
Finds code that can be safely deleted: unreachable, unused, obsolete compatibility, and commented-out code. Use when pruning dead code.