use-railway
Skill28 starsChanged 36 days agoMITView on GitHub
Operate Railway infrastructure: create projects, provision services and databases, manage object storage buckets, deploy code, configure environments and variables, manage domains, troubleshoot failures, check status and metrics, and query Railway docs. Use this skill whenever the user mentions Railway, deployments, services, environments, buckets, object storage, build failures, or infrastructure operations, even if they don't say "Railway" explicitly.
- Deletes or force-pushes
- Installs packages
8 other projects use a version of this, 8 of them edited.
Adopted by
Most recently taken up by
- yuan-alex/cedaredited, first seen Nov 8, 2026
- artivilla/agent-skillsedited, first seen Nov 8, 2026
- NiazMorshed2007/jcredited, first seen Sep 20, 2026
- FournyP/postgres-mcp-railway-templateedited, first seen Sep 18, 2026
- FournyP/aws-s3-mcp-railway-templateedited, first seen Sep 18, 2026
- sameerhimati/claude-code-kitedited, first seen Aug 14, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 8
- vobase/vobase★ 6099% same
- cline/skills★ 3520% same
- NiazMorshed2007/jcr★ 1917% same
- sameerhimati/claude-code-kit★ 119% same
- artivilla/agent-skills★ 017% same
- FournyP/aws-s3-mcp-railway-template★ 017% same
- FournyP/postgres-mcp-railway-template★ 017% same
- yuan-alex/cedar★ 096% 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 repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- gallery/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- website/CLAUDE.mdCLAUDE.md
- webjsSkill
- pr-reviewSkill
- webjs-blog-writeSkill
- webjs-doc-syncSkill
- webjs-file-issueSkill
- webjs-instagram-postSkill
- webjs-list-todosSkill
- webjs-ready-for-devSkill
- webjs-research-recordSkill
- webjs-scaffold-syncSkill
- webjs-start-workSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 1 is common, 10 are distinctive, and 12 are very specific to this project.
1
Common
Most of the 8 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Before any mutation, verify context:
- Very specific: line 66
If the user provides a Railway URL, extract IDs from it.
- Very specific: line 67
If no URL is given, fall back to railway status --json for the linked project/environment/service.
- Common: line 69
If the CLI is missing, guide the user to install it.
- Very specific: line 77
If not authenticated, run railway login.
- Very specific: line 79
If a command is not recognized (for example, railway environment edit), the CLI may be outdated.
- Distinctive: line 103
When using these commands from the skill, keep the command shape but prefix the Railway invocation with the telemetry env, for example:
- Distinctive: line 122
If the request spans two areas (for example, "deploy and then check if it's healthy"), load both references and compose one response.
- Very specific: line 126
Prefer Railway CLI. Fall back to scripts/railway-api.sh for operations the CLI doesn't expose.
- Very specific: line 127
Use --json output where available for reliable parsing.
- Distinctive: line 130
After mutations, verify the result with a read-back command.
- Distinctive: line 145
When these operations are needed:
- Distinctive: line 148
Wait for user confirmation that they ran it
- Distinctive: line 149
Verify the result with a read-only query
- Distinctive: line 161
When composing, return one unified response covering all steps.
- Distinctive: line 165
When the user wants to create or deploy something, determine the right action from current context:
- Very specific: line 167
Run railway status --json in the current directory.
- Very specific: line 168
If linked: add a service to the existing project (railway add --service <name>).
- Very specific: line 169
If not linked: check the parent directory (cd ..
- Very specific: line 171
Parent not linked: run railway list --json and look for a project matching the directory name.
- Very specific: line 173
No match: create a new project (railway init --name <name>).
- Very specific: line 174
When multiple workspaces exist, match by name from railway whoami --json.
- Distinctive: line 185
Keep output concise. Include command evidence only when it helps the user understand what happened.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use Railway
Railway resource model
Railway organizes infrastructure in a hierarchy:
- Workspace is the billing and team scope. A user belongs to one or more workspaces.
- Project is a collection of services under one workspace. It maps to one deployable unit of work.
- Environment is an isolated configuration plane inside a project (for example,
production,staging). Each environment has its own variables, config, and deployment history. - Service is a single deployable unit inside a project. It can be an app from a repo, a Docker image, or a managed database.
- Bucket is an S3-compatible object storage resource inside a project. Buckets are created at the project level and deployed to environments. Each bucket has credentials (endpoint, access key, secret key) for S3-compatible access.
- Deployment is a point-in-time release of a service in an environment. It has build logs, runtime logs, and a status lifecycle.
Most CLI commands operate on the linked project/environment/service context. Use railway status --json to see the context, and --project, --environment, --service flags to override.
Parsing Railway URLs
Users often paste Railway dashboard URLs. Extract IDs before doing anything else:
https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>?environmentId=<ENV_ID>
https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>The URL always contains projectId and serviceId. It may contain environmentId as a query parameter. If the environment ID is missing and the user specifies an environment by name (e.g., "production"), resolve it:
scripts/railway-api.sh \
'query getProject($id: String!) {
project(id: $id) {
environments { edges { node { id name } } }
}
}' \
'{"id": "<PROJECT_ID>"}'Match the environment name (case-insensitive) to get the environmentId.
Prefer passing explicit IDs to CLI commands (--project, --environment, --service) and scripts (--project-id, --environment-id, --service-id) instead of running railway link. This avoids modifying global state and is faster.
Preflight
Before any mutation, verify context:
command -v railway # CLI installed
RAILWAY_CALLER="skill:use-railway@1.2.0" RAILWAY_AGENT_SESSION="railway-skill-$(date +%s)-$$" railway whoami --json
railway --version # check CLI versionFor Railway CLI calls made while this skill is active, prefix the command with RAILWAY_CALLER=skill:use-railway@1.2.0 and a stable RAILWAY_AGENT_SESSION reused for the current user request. Generate the session id once per user request, then reuse that exact value for later Railway CLI calls in the same workflow. Do not run a separate export preflight just for telemetry; inline env prefixes keep the shell output concise and avoid leaking setup steps into every response.
Context resolution — URL IDs always win:
- If the user provides a Railway URL, extract IDs from it. Do NOT run
railway status --json— it returns the locally linked project, which is usually unrelated. - If no URL is given, fall back to
railway status --jsonfor the linked project/environment/service.
If the CLI is missing, guide the user to install it.
bash <(curl -fsSL cli.new) # Shell script (macOS, Linux, Windows via WSL)
brew install railway # Homebrew (macOS)
npm i -g @railway/cli # npm (macOS, Linux, Windows). Requires Node.js version 16 or higher.If not authenticated, run railway login. If not linked and no URL was provided, run railway link --project <id-or-name>.
If a command is not recognized (for example, railway environment edit), the CLI may be outdated. Upgrade with:
railway upgradeCommon quick operations
These are frequent enough to handle without loading a reference:
railway status --json # current context
railway whoami --json # auth and workspace info
railway project list --json # list projects
railway service status --all --json # all services in current context
railway variable list --service <svc> --json # list variables
railway variable set KEY=value --service <svc> # set a variable
railway logs --service <svc> --lines 200 --json # recent logs
railway up --detach -m "<summary>" # deploy current directory
railway bucket list --json # list buckets in current environment
railway bucket info --bucket <name> --json # bucket storage and object count
railway bucket credentials --bucket <name> --json # S3-compatible credentialsWhen using these commands from the skill, keep the command shape but prefix the Railway invocation with the telemetry env, for example:
RAILWAY_CALLER="skill:use-railway@1.2.0" RAILWAY_AGENT_SESSION="railway-skill-20260508-1234" railway status --jsonRouting
For anything beyond quick operations, load the reference that matches the user's intent. Load only what you need, one reference is usually enough, two at most.
| Intent | Reference | Use for |
| Analyze a database ("analyze <url>", "analyze db", "analyze database", "analyze service", "introspect", "check my postgres/redis/mysql/mongo") | analyze-db.md | Database introspection and performance analysis. analyze-db.md directs you to the DB-specific reference. This takes priority over the status/operate routes when a Railway URL to a database service is provided alongside "analyze". |
| Create or connect resources | setup.md | Projects, services, databases, buckets, templates, workspaces |
| Ship code or manage releases | deploy.md | Deploy, redeploy, restart, build config, monorepo, Dockerfile |
| Change configuration | configure.md | Environments, variables, config patches, domains, networking |
| Check health or debug failures | operate.md | Status, logs, metrics, build/runtime triage, recovery |
| Request from API, docs, or community | request.md | Railway GraphQL API queries/mutations, metrics queries, Central Station, official docs |
If the request spans two areas (for example, "deploy and then check if it's healthy"), load both references and compose one response.
Execution rules
- Prefer Railway CLI. Fall back to
scripts/railway-api.shfor operations the CLI doesn't expose. - Use
--jsonoutput where available for reliable parsing. - Resolve context before mutation. Know which project, environment, and service you're acting on.
- For destructive actions (delete service, remove deployment, drop database), confirm intent and state impact before executing.
- After mutations, verify the result with a read-back command.
User-only commands (NEVER execute directly)
These commands modify database state and require the user to run them directly in their terminal. Do NOT execute these with Bash. Instead, show the command and ask the user to run it.
| Command | Why user-only |
python3 scripts/enable-pg-stats.py --service <name> | Modifies shared_preload_libraries, may restart database |
python3 scripts/pg-extensions.py --service <name> install <ext> | Installs database extension |
python3 scripts/pg-extensions.py --service <name> uninstall <ext> | Removes database extension |
ALTER SYSTEM SET ... | Changes PostgreSQL configuration |
DROP EXTENSION ... | Removes database extension |
CREATE EXTENSION ... | Installs database extension |
When these operations are needed:
- Explain what the command does and any side effects (e.g., restart required)
- Show the exact command the user should run
- Wait for user confirmation that they ran it
- Verify the result with a read-only query
Composition patterns
Multi-step workflows follow natural chains:
- Add object storage: setup (create bucket), setup (get credentials), configure (set S3 variables on app service)
- First deploy: setup (create project + service), configure (set variables and source), deploy, operate (verify healthy)
- Fix a failure: operate (triage logs), configure (fix config/variables), deploy (redeploy), operate (verify recovery)
- Add a domain: configure (add domain + set port), operate (verify DNS and service health)
- Docs to action: request (fetch docs answer), route to the relevant operational reference
When composing, return one unified response covering all steps. Don't ask the user to invoke each step separately.
Setup decision flow
When the user wants to create or deploy something, determine the right action from current context:
- Run
railway status --jsonin the current directory. - If linked: add a service to the existing project (
railway add --service <name>). Do not create a new project unless the user explicitly says "new project" or "separate project". - If not linked: check the parent directory (
cd .. && railway status --json).- Parent linked: this is likely a monorepo sub-app. Add a service and set
rootDirectoryto the sub-app path. - Parent not linked: run
railway list --jsonand look for a project matching the directory name.- Match found: link to it (
railway link --project <name>). - No match: create a new project (
railway init --name <name>).
- Match found: link to it (
- Parent linked: this is likely a monorepo sub-app. Add a service and set
- When multiple workspaces exist, match by name from
railway whoami --json.
Naming heuristic: app names like "flappy-bird" or "my-api" are service names, not project names. Use the directory or repo name for the project.
Response format
For all operational responses, return:
- What was done (action and scope).
- The result (IDs, status, key output).
- What to do next (or confirmation that the task is complete).
Keep output concise. Include command evidence only when it helps the user understand what happened.
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.

