/memstack:memstack-deployment-railway-deployfrom memstack
Validates project configuration and deploys Node.js, Python, or Docker apps to Railway with environment variables, custom domains, and monitoring. Runs pre-flight checks to catch common deploy failures.
Ships in memstack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Validates project configuration, environment variables, and deployment readiness before pushing to Railway.
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 |
| 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. |
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
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:
package.json must have start script or main fieldrequirements.txt or pyproject.toml with dependenciesFlag if missing: No build configuration found. Recommend adding railway.toml or Dockerfile.
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= -f1
Check 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:
.env.example, verify it's configured in Railway dashboard.env.example: add to RailwayRemind user: "Set these in Railway dashboard → Variables tab. Never commit actual values."
# 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:
npm run build → dist/ or .next/)dev or nodemon)process.env.PORT or os.environ["PORT"]: Railway assigns this dynamicallyFlag if: Start command uses hardcoded port (e.g., app.listen(3000) without PORT env fallback).
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 containerFlag if: Any hardcoded localhost or 127.0.0.1 database URLs found.
# 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
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 up
After deployment completes:
curl https://[app].up.railway.app/healthNODE_ENV=production is activeRollback plan:
railway rollbackIf deploy fails:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cwinvestments/memstack --plugin memstack87 skills in this plugin
/memstack-seo-ai-search-visibilityUse this skill when the user says 'AI search', 'AI visibility', 'ChatGPT ranking', 'Perplexity optimization', 'GEO', 'generative engine optimization', or needs to optimize content for AI-powered search engines and LLM citations. Do NOT use for traditional SEO audits or Google Ads./memstack-security-api-auditUse this skill when the user says 'audit API', 'check API security', 'API routes security', 'endpoint audit', 'check my routes', or needs to verify API route protection. Reviews API endpoints for authentication, authorization, and input validation gaps. Do NOT use for frontend security headers or dependency scanning./memstack-development-api-designerUse this skill when the user says 'design API', 'API endpoints', 'REST API', 'API designer', 'route structure', 'API architecture', or is designing RESTful API routes, request/response schemas, and endpoint organization. Do NOT use for API security audits or database design.Other plugins' skills for the same job