memstack-deployment-railway-deploy
Skill425 starsChanged 5 months agoMITView on GitHub
Use this skill when the user says 'deploy to Railway', 'Railway setup', 'railway-deploy', or needs to deploy a Node.js, Python, or Docker application to Railway with environment variables, custom domains, and monitoring. Do NOT use for Netlify, Vercel, or Hetzner deployments.
- Reads credentials
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- vbrevik/claude_code_skillsedited, first seen Mar 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- vbrevik/claude_code_skills★ 056% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository87 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- memstack-automation-api-integrationSkill
- memstack-automation-content-pipelineSkill
- memstack-automation-cron-schedulerSkill
- memstack-automation-hosted-mcp-catalogSkill
- memstack-automation-n8n-workflow-builderSkill
- memstack-automation-webhook-designerSkill
- memstack-business-client-onboardingSkill
- memstack-business-contract-templateSkill
- memstack-business-financial-modelSkill
- memstack-business-freelancer-toolkitSkill
- memstack-business-gdprSkill
- memstack-business-invoice-generatorSkill
- memstack-business-licensingSkill
- memstack-business-proposal-writerSkill
- memstack-business-scope-of-workSkill
- memstack-business-sop-builderSkill
- compressSkill
- memstack-content-blog-postSkill
- memstack-content-email-sequenceSkill
- memstack-content-landing-page-copySkill
- memstack-content-newsletterSkill
- memstack-content-product-descriptionSkill
- memstack-content-tiktok-scriptSkill
- memstack-content-twitter-threadSkill
- memstack-content-youtube-scriptSkill
- memstack-deployment-ci-cd-pipelineSkill
- memstack-deployment-docker-setupSkill
- memstack-deployment-domain-sslSkill
- memstack-deployment-hetzner-setupSkill
- memstack-deployment-netlify-deploySkill
- memstack-development-api-designerSkill
- memstack-development-changelog-generatorSkill
- memstack-development-code-reviewerSkill
- memstack-development-mentorSkill
- memstack-development-migration-plannerSkill
- memstack-development-performance-auditSkill
- memstack-development-refactor-plannerSkill
- memstack-development-test-writerSkill
- memstack-development-webapp-testingSkill
- diarySkill
- echoSkill
- familiarSkill
- forgeSkill
- goalSkill
- governorSkill
- grimoireSkill
- humanizeSkill
- memstack-marketing-competitor-analysisSkill
- memstack-marketing-facebook-adSkill
- memstack-marketing-google-adSkill
- memstack-marketing-launch-planSkill
- memstack-marketing-lead-magnetSkill
- memstack-marketing-marketplace-submitSkill
- memstack-marketing-pricing-strategySkill
- memstack-marketing-sales-funnelSkill
- memstack-marketing-webinar-scriptSkill
- memstack-product-feature-specSkill
- memstack-product-feedback-analyzerSkill
- memstack-product-mvp-scoperSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 13 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When this skill activates, output:
- Distinctive: line 60
Verify Railway can build the project:
- Distinctive: line 74
If none exist, check that nixpacks can auto-detect:
- Very specific: line 78
Flag if missing: No build configuration found.
- Distinctive: line 89
Check for these common categories:
- Very specific: line 121
Flag if: Start command uses hardcoded port (e.g., app.listen(3000) without PORT env fallback).
- Distinctive: line 125
If the project uses a database:
- Distinctive: line 147
If no health endpoint exists, recommend adding one:
- Distinctive: line 160
Run the build locally to catch errors before deploying:
- Distinctive: line 200
Logs: Check Railway dashboard → Deployments → View Logs for startup errors
- Distinctive: line 201
Database: Verify migrations ran (check logs for migration output)
- Distinctive: line 209
Check build logs first, dependency or build script errors
- Distinctive: line 210
Check runtime logs, missing env vars show as undefined/null errors
- Distinctive: line 211
Check health check timeout, app may be starting slowly (increase timeout in Settings)
- Distinctive: line 212
Verify Railway service is connected to correct GitHub branch
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
🚂 Railway Deploy: Pre-flight check and deploy to Railway...
Validates project configuration, environment variables, and deployment readiness before pushing to Railway.
Activation
When this skill activates, output:
🚂 Railway Deploy: Running pre-flight checks...
Then execute the protocol below.
| Context | Status |
| User says "deploy to railway" or "railway deploy" | ACTIVE |
| User says "ship it" or "deploy backend" with a Railway project | ACTIVE |
| Preparing a backend/fullstack app for production | ACTIVE |
| Deploying to Netlify, Vercel, or other non-Railway platform | DORMANT |
| Discussing Railway pricing or features generally | DORMANT |
Anti-patterns
| Trap | Reality Check |
"I'll just railway up and see what happens" | Pre-flight catches 90% of deploy failures. Check first. |
| "Environment vars are probably fine" | Missing vars are the #1 cause of Railway deploy failures. Verify every one. |
| "It works locally so it'll work on Railway" | localhost URLs, SQLite paths, and file:// references all break in production. |
| "I'll fix the Dockerfile later" | Railway's nixpacks auto-detect fails on monorepos and custom setups. Define build explicitly. |
| "The database connection works" | Railway internal networking uses *.railway.internal hostnames. External URLs add latency and cost. |
Protocol
Step 1: Detect Project Type
Identify the project framework and runtime:
# Check for framework indicators
ls package.json pyproject.toml requirements.txt Cargo.toml go.mod 2>/dev/null| Indicator | Project Type |
package.json with next | Next.js |
package.json with express/fastify/hono | Node.js API |
pyproject.toml or requirements.txt | Python (Django/Flask/FastAPI) |
Cargo.toml | Rust |
go.mod | Go |
Report: Detected: [type] project
Step 2: Check Deployment Files
Verify Railway can build the project:
# Check for explicit build configuration
ls Dockerfile Procfile nixpacks.toml railway.toml 2>/dev/null| File | Purpose | Required? |
Dockerfile | Explicit container build | Recommended for complex projects |
Procfile | Process start command | Optional if start script exists |
nixpacks.toml | Nixpacks build config | Optional: auto-detected |
railway.toml | Railway-specific settings | Optional: build/deploy overrides |
If none exist, check that nixpacks can auto-detect:
- Node.js:
package.jsonmust havestartscript ormainfield - Python: Must have
requirements.txtorpyproject.tomlwith dependencies
Flag if missing: No build configuration found. Recommend adding railway.toml or Dockerfile.
Step 3: Verify Environment Variables
Cross-reference what the app needs vs what Railway has:
# Find required env vars
cat .env.example .env.sample 2>/dev/null | grep -v '^#' | grep '=' | cut -d= -f1Check for these common categories:
| Category | Variables to Verify |
| Database | DATABASE_URL, POSTGRES_URL, REDIS_URL, MONGODB_URI |
| Auth | JWT_SECRET, SESSION_SECRET, NEXTAUTH_SECRET, NEXTAUTH_URL |
| External APIs | STRIPE_SECRET_KEY, SENDGRID_API_KEY, AWS_ACCESS_KEY_ID |
| App Config | NODE_ENV=production, PORT (Railway sets this automatically) |
| URLs | FRONTEND_URL, BACKEND_URL, CORS_ORIGIN |
Output: List each variable with status:
- ✅ Set in
.env.example, verify it's configured in Railway dashboard - ⚠️ Referenced in code but not in
.env.example: add to Railway - ❌ Hardcoded value found: extract to environment variable
Remind user: "Set these in Railway dashboard → Variables tab. Never commit actual values."
Step 4: Verify Build and Start Commands
# Node.js
cat package.json | grep -A2 '"scripts"' | grep -E '"(build|start|dev)"'
# Python
cat Procfile 2>/dev/null || cat pyproject.toml 2>/dev/null | grep -A5 '\[tool.poetry.scripts\]'Verify:
- Build command exists and produces output (e.g.,
npm run build→dist/or.next/) - Start command uses production mode (not
devornodemon) - Port reads from
process.env.PORToros.environ["PORT"]: Railway assigns this dynamically
Flag if: Start command uses hardcoded port (e.g., app.listen(3000) without PORT env fallback).
Step 5: Verify Database Connection Strings
If the project uses a database:
# Search for connection patterns
grep -r "localhost:5432\|localhost:3306\|localhost:6379\|127.0.0.1" --include="*.ts" --include="*.js" --include="*.py" --include="*.env*" .Railway internal networking rules:
- ✅
${{Postgres.DATABASE_URL}}: Railway reference variable - ✅
*.railway.internal:5432, internal hostname (no egress cost) - ❌
localhost:5432, won't resolve in Railway container - ❌ Public Railway URL with port, adds latency, uses egress bandwidth
Flag if: Any hardcoded localhost or 127.0.0.1 database URLs found.
Step 6: Check Health Check Endpoint
# Search for common health check patterns
grep -rn "\/health\|\/healthz\|\/api\/health\|\/readyz" --include="*.ts" --include="*.js" --include="*.py" .If no health endpoint exists, recommend adding one:
// Express/Fastify pattern
app.get('/health', (req, res) => {
res.status(200).json({ status: 'ok', timestamp: new Date().toISOString() });
});Configure in Railway: Settings → Deploy → Health Check Path → /health
Step 7: Pre-Deploy Checklist
Run the build locally to catch errors before deploying:
# Build test
npm run build # or equivalent
# Search for localhost references
grep -rn "localhost\|127\.0\.0\.1" --include="*.ts" --include="*.js" --include="*.py" . | grep -v node_modules | grep -v .git| Check | Command | Pass Criteria |
| Build passes | npm run build | Exit code 0, no errors |
| No hardcoded URLs | grep for localhost | Zero matches in source |
| Production env vars | Review .env.example | All vars documented |
| Port configuration | grep for PORT | Reads from env, not hardcoded |
| Node version | Check engines in package.json | Specified if needed |
| Git clean | git status | All changes committed |
Output pre-deploy summary:
🚂 Railway Deploy: Pre-flight Complete
Project: [name] ([type])
Build: ✅ passes
Env vars: ✅ 12 documented, verify in Railway dashboard
Database: ✅ uses Railway internal networking
Health check: ✅ /health endpoint configured
Localhost refs: ✅ none found
Port: ✅ reads from process.env.PORT
Ready to deploy. Run: railway upStep 8: Post-Deploy Verification
After deployment completes:
- Health check:
curl https://[app].up.railway.app/health - Logs: Check Railway dashboard → Deployments → View Logs for startup errors
- Database: Verify migrations ran (check logs for migration output)
- Environment: Confirm
NODE_ENV=productionis active
Rollback plan:
- Railway keeps previous deployments. Go to Deployments → click previous successful deploy → Rollback
- Or via CLI:
railway rollback
If deploy fails:
- Check build logs first, dependency or build script errors
- Check runtime logs, missing env vars show as undefined/null errors
- Check health check timeout, app may be starting slowly (increase timeout in Settings)
- Verify Railway service is connected to correct GitHub branch
Level History
- Lv.1: Base: Project detection, env var verification, build validation, database connection checks, health endpoint, pre/post-deploy checklists. Based on AdminStack, DeedStack, AlgoStack, and EpsteinScan Railway deployments. (Origin: MemStack Pro v3.2, Mar 2026)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

