Skip to content
Skillpedia
Deploy & cloud (DevOps)33k Β· #8909

railway-new

What it does

This skill creates Railway projects, services and databases, and links your local code to them. It is for developers starting a new app on Railway or adding a service to an existing project.

When to use it

  • βœ“When you want to deploy this project to Railway for the first time.
  • βœ“When you want to add a new backend service or API to an existing Railway project.
  • βœ“When you want to create a service from a GitHub repository.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/railway/new/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/railway/new/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œSet up my project on Railway as a new service, and deploy it from my GitHub repo.”

5 new skills a week. 1 minute to read.

How it works

The agent checks whether the folder is already linked, creates the project or service as needed, sets up the code source, and hands off deployment or database steps to the right skills.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

New Project / Service / Database

Create Railway projects, services, and databases with proper configuration.

When to Use

  • User says "deploy to railway" (add service if linked, init if not)
  • User says "create a railway project", "init", "new project" (explicit new project)
  • User says "link to railway", "connect to railway"
  • User says "create a service", "add a backend", "new api service"
  • User says "create a vite app", "create a react website", "make a python api"
  • User says "deploy from github.com/user/repo", "create service from this repo"
  • User says "add postgres", "add a database", "add redis", "add mysql", "add mongo"
  • User says "connect to postgres", "wire up the database", "connect my api to redis"
  • User says "add postgres and connect to the server"
  • Setting up code + Railway service together

Prerequisites

Check CLI installed:

command -v railway

If not installed:

Install Railway CLI:

npm install -g @railway/cli

or

brew install railway

Check authenticated:

railway whoami --json

If not authenticated:

Run railway login to authenticate.

Decision Flow

railway status --json (in current dir)
     β”‚
β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
Linked    Not Linked
  β”‚            β”‚
  β”‚       Check parent: cd .. && railway status --json
  β”‚            β”‚
  β”‚       β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
  β”‚    Parent      Not linked
  β”‚    Linked      anywhere
  β”‚       β”‚            β”‚
  β”‚   Add service   railway list
  β”‚   Set rootDir      β”‚
  β”‚   Deploy       β”Œβ”€β”€β”€β”΄β”€β”€β”€β”
  β”‚       β”‚      Match?  No match
  β”‚       β”‚        β”‚        β”‚
  β”‚       β”‚      Link    Init new
  β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
    User wants service?
           β”‚
     β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”
    Yes         No
     β”‚           β”‚
Scaffold code   Done
     β”‚
railway add --service
     β”‚
Configure if needed
     β”‚
Ready to deploy

Check Current State

railway status --json
  • If linked: Add a service to the existing project (see below)
  • If not linked: Check if a PARENT directory is linked (see below)

When Already Linked

Default behavior: "deploy to railway" = add a service to the linked project.

Do NOT create a new project unless user EXPLICITLY says:

  • "new project", "create a project", "init a project"
  • "separate project", "different project"

App names like "flappy-bird" or "my-api" are SERVICE names, not project names.

User: "create a vite app called foo and deploy to railway"
Project: Already linked to "my-project"

WRONG: railway init -n foo
RIGHT: railway add --service foo

Parent Directory Linking

Railway CLI walks up the directory tree to find a linked project. If you're in a subdirectory:

cd .. && railway status --json

If parent is linked, you don't need to init/link the subdirectory. Instead:

  1. Create service: railway add --service <name>
  2. Set rootDirectory to subdirectory path via environment skill
  3. Deploy from root: railway up

If no parent is linked, proceed with init or link flow.

Init vs Link Decision

Skip this section if already linked - just add a service instead.

Only use this section when NO project is linked (directly or via parent).

Check User's Projects

The output can be large. Run in a subagent and extract only:

  • Project id and name
  • Workspace id and name
railway list --json

Decision Logic

  1. User explicitly says "new project" β†’ Use railway init
  2. User names an existing project β†’ Use railway link
  3. Directory name matches existing project β†’ Ask: link existing or create new?
  4. No matching projects β†’ Use railway init
  5. Ambiguous β†’ Ask user

Create New Project

railway init -n <name>

Options:

  • -n, --name - Project name (auto-generated if omitted in non-interactive mode)
  • -w, --workspace - Workspace name or ID (required if multiple workspaces exist)

Multiple Workspaces

If the user has multiple workspaces, railway init requires the --workspace flag.

Get workspace IDs from:

railway whoami --json

The workspaces array contains { id, name } for each workspace.

Inferring workspace from user input: If user says "deploy into xxx workspace" or "create project in my-team", match the name against the workspaces array and use the corresponding ID:

# User says: "create a project in my personal workspace"
railway whoami --json | jq '.workspaces[] | select(.name | test("personal";
FAQ

What if my folder is already linked?

The skill adds a service to the linked project rather than creating a new one.

Can it add a database too?

The skill points database work to the railway-database skill.

Do I need the Railway CLI?

Yes. The skill checks for the Railway command-line tool and asks you to log in if needed.

Details

Original description by the author

Create Railway projects, services, and databases with proper configuration. Use when user says "setup", "deploy to railway", "initialize", "create project", "create service", or wants to deploy from GitHub. Handles initial setup AND adding services to existing projects. For databases, use railway-railway-database skill instead.

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#8909
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills