name: Railway Deploy description: Skill for deploying Gravity Claw to Railway with the standard pause → test → deploy → verify cycle.
Railway Deploy Skill
Overview
Gravity Claw is deployed to Railway using Docker. The Railway CLI manages deployments, environment variables, and logs.
Key Rules
- Always pause Railway before local testing. Two bot instances polling the same Telegram token will fight over messages.
- Always type-check before deploying. Run
npx tsc --noEmitto catch errors. - Railway filesystem is ephemeral. The
data/directory (dashboard settings, activity logs) resets on every deploy. Use environment variables for persistent config.
Deployment Commands
| Task | Command |
|---|---|
| Pause live bot | railway down |
| Start local dev | npm run dev |
| Type-check | npx tsc --noEmit |
| Deploy | railway up --detach |
| View logs | railway logs --lines 100 |
| Set env var | railway variables set KEY="value" |
| List env vars | railway variables |
| Open dashboard | railway open |
Environment Variables Required
These must be set on Railway (not committed to code):
TELEGRAM_BOT_TOKEN— from @BotFatherGROQ_API_KEY— from console.groq.comALLOWED_USER_IDS— comma-separated Telegram user IDs
Deployment Workflow
Use the /deploy workflow command to run the full cycle:
1. railway down (pause live service)
2. npx tsc --noEmit (type-check)
3. railway up --detach (deploy)
4. railway logs --lines 40 (verify)
Troubleshooting
| Problem | Solution |
|---|---|
| Build failed | Check railway logs --lines 100 for npm/TypeScript errors |
| Bot crashes on startup | Missing env vars — run railway variables |
| Messages going to wrong place | Two instances running — railway down first |
| Need rollback | Fix locally, then railway up --detach again |
Files Deployed (via Dockerfile)
src/, tsconfig.json, package.json, package-lock.json
Files NOT Deployed (via .dockerignore)
.env, node_modules/, data/, .agent/, .git/