clacky-ai/openclacky/deploy
- community
Checking that the SKILL.md file is still in the repository.
Deploy Rails applications to Railway. Handles first-time setup and re-deploys idempotently using Railway CLI. Trigger on: "deploy", "deploy to railway", "railway deploy", "发布", "部署", "上线".
Install
npx vskill@latest install clacky-ai/openclacky/deploySKILL.md
Deploy Rails App to Railway
Deploy the current Rails project to Railway using the Railway CLI. Works for both first-time deploys and re-deploys.
Prerequisites Check
Before starting, verify:
If not logged in, instruct the user:
Step 0: Prepare for Linux Build
Railway runs on Linux. Ensure Gemfile.lock includes the linux platform:
If the project uses a Dockerfile builder (check railway.toml for builder = "DOCKERFILE"), no Procfile is needed — skip creating one.
Only create a Procfile if there is no Dockerfile:
Step 1: Check Link Status → Deploy Immediately if Already Linked
First: check if already linked:
If output contains `Project:` → project is already linked. Skip Steps 2–5 entirely and jump to Step 6 (Deploy).
If output contains "not linked" or an error → not linked yet. Try linking to an existing project first — list available projects:
If a matching project is found, link it:
Only if no existing project is found, init a new one:
The app-name should match the current directory name (e.g., my-rails-app).
⚠️ NEVER run `railway init` when already linked or when an existing project exists. It silently creates a brand-new Railway project. If this happens by mistake:
- Find the correct project name from
railway list - Re-link:
railway link --project <project-name> --service <service-name>
Step 2: Set Environment Variables
Set required Rails production variables. Use --skip-deploys to avoid triggering premature deploys:
If the project uses any other env vars (check .env.example or config/application.yml.example if they exist), prompt the user to provide values and set them too.
If the project uses config/application.yml (Figaro gem), read it and set all values as Railway variables:
Step 3: Ensure PostgreSQL Service (Idempotent)
Check if Postgres already exists:
Parse the JSON output. If a service with type postgres or name containing postgres/Postgres is already found, skip with: ✅ PostgreSQL already provisioned
⚠️ IMPORTANT: `railway add --database postgres` has a known CLI bug that always returns `Unauthorized`. Do NOT attempt to run this command. Instead, instruct the user to add PostgreSQL manually via the Railway Web UI:
- Open your Railway project:
https://railway.com/project/<project-id>
(Get the project ID from the Railway dashboard or cat .railway/config.json)
- Click "+ New" → "Database" → "PostgreSQL"
- Wait for the database to provision
- Come back and continue
After Postgres is provisioned, set the DATABASE_URL variable:
Step 4: Get Domain (Idempotent)
Check if a domain is already set:
If no domain exists yet:
Capture and display the domain URL to the user. Also set it as PUBLIC_HOST:
Step 5: Configure Storage Bucket (if needed)
Check if the project uses S3-compatible storage by reading config/storage.yml. If it contains an amazon or s3 service section, storage bucket configuration is required.
⚠️ Storage bucket requires Railway Hobby plan ($5/month minimum). Confirm with the user before proceeding.
Check if bucket env vars are already set:
If not set, create a bucket and configure the variables:
The credentials JSON will contain: accessKeyId, secretAccessKey, region, endpoint, bucketName.
Set them as environment variables:
⚠️ Missing these variables will cause a hard crash at boot (`Aws::Errors::MissingRegionError`) because the AWS SDK initializes at startup, not lazily.
If the project does not use S3 storage, skip this step entirely.
Step 6: Deploy
Upload and deploy the project:
Show the user the deployment is in progress and they can monitor it with:
No manual migration needed. The bin/docker-entrypoint script runs rails db:prepare automatically on container startup. Just wait for the deployment to complete.
Step 7: Verify Deployment
After deployment completes (wait ~30 seconds), verify the app is running:
If it returns 200, deployment is successful. If not, check logs:
Step 8: Done
Print a summary:
Notes
- Idempotency: Running this skill multiple times is safe. Each step checks current state before acting.
- Link detection: Use
railway statusto check if already linked — it's more reliable than checking.railway/config.json(works across machines and fresh clones). - Re-deploy: On subsequent runs, Steps 1–5 are all skipped or no-ops. Only Step 6 (upload) actually runs.
- Secret key: Only set
SECRET_KEY_BASEif not already set (check withrailway variable list). - Database migrations: Handled automatically by
bin/docker-entrypointviarails db:prepare— never runrailway run bundle exec rails db:migrateas Railway's internal DB IP is not accessible from local machine. - PostgreSQL CLI bug:
railway add --database postgresalways fails withUnauthorized— always use the Web UI instead.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinglib/clacky/default_skills/deploy/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/clacky-ai/openclacky/deploy)