git clone https://github.com/clacky-ai/openclacky
T=$(mktemp -d) && git clone --depth=1 https://github.com/clacky-ai/openclacky "$T" && mkdir -p ~/.claude/skills && cp -r "$T/lib/clacky/default_skills/deploy" ~/.claude/skills/clacky-ai-openclacky-deploy && rm -rf "$T"
lib/clacky/default_skills/deploy/SKILL.mdRailway Deployment for Rails
Deploy a Rails application to the Clacky cloud platform (Railway backend).
When to invoke
Trigger this skill when the user says:
- "deploy", "/deploy", "deploy my app", "push to production"
- "部署", "上线", "发布"
How to run
Step 1 — Run the deploy script
bundle exec ruby <absolute-path-to-this-skill>/scripts/rails_deploy.rb
Timeout: set to at least 300 seconds (5 minutes).
The script prints each step as it runs. When it finishes it prints one of:
[DEPLOY] RESULT: SUCCESS (2m 34s) [DEPLOY] RESULT: FAILED (45s) — <error message>
Step 2 — Show the full output to the user
After the script exits, always show the complete stdout output to the user in a code block or verbatim. The output contains step-by-step logs they need to see. Do NOT summarise silently — show everything, then add your summary.
On success
After showing the output, report the deployed URL and any useful links.
On failure
After showing the output, show the error message and summarise the most likely cause in one sentence. Suggest next steps (e.g. fix the error shown, then re-run
/deploy).
What the script does internally
The script runs three phases automatically. Do not add any AI reasoning steps between phases — the script handles all logic internally.
Phase 0 — Cloud project binding
- Reads
for.clacky/openclacky.ymlproject_id- If file is missing → runs inline cloud project creation flow
(reuses
), writes the file, continuesnew/scripts/cloud_project_init.sh - If
is blank → hard-fail (corrupted file)project_id
- If file is missing → runs inline cloud project creation flow
(reuses
- Reads
for~/.clacky/clacky_cloud.ymlworkspace_key- If missing/empty → hard-fail with guidance to obtain key offline
- Calls
to verify the project existsGET /openclacky/v1/projects/:id- 404 → runs inline cloud project creation flow, continues
- Other error → hard-fail
Phase 1 — Subscription check
| Action |
|---|---|
| ✅ Continue |
| ⚠️ Warn, continue |
| ❌ Hard-fail |
/ / | Open payment page, poll for activation |
Payment polling: open
https://app.clacky.ai/dashboard/openclacky-project/<id>
in browser, poll GET /openclacky/v1/deploy/payment every 10 s for up to 180 s.
Phase 2 — Deployment (8 steps)
| Step | Action |
|---|---|
| 1 | → get , , |
| 2 | |
| 3 | Inject env vars: Rails defaults + Figaro production block + |
| 4 | Poll until DB middleware is → inject reference; call |
| 5 | → notify backend |
| 6 | Poll every 5 s (max 300 s) until or failure |
| 7 | ; seed if first deployment |
| 8 | HTTP health check on deployed URL; notify backend |
All
railway commands receive RAILWAY_TOKEN via Ruby ENV hash — no
clackycli wrapper is needed.
Important constraints
- Never modify source files before deploying.
- Never commit or push changes as part of this skill.
- Never prompt the user for Railway credentials — those come from the
Clacky platform (
is returned byplatform_token
).create-task - If
CLI is not installed, hard-fail with install instructions:railwaynpm install -g @railway/cli