Use Railway 标志

Use Railway

组织
railwayapp
use-railway

Operate Railway infrastructure: sign up for or sign in to a Railway account, create projects, provision services, databases, and buckets, deploy code, configure infrastructure as code, environments and variables, manage domains, trace requests with OpenTelemetry, troubleshoot failures, check status and metrics, manage feature flags, database recovery and HA, cloud agents, usage limits, and Railway agent tooling. Use this skill whenever the user mentions Railway, feature flags, flag rollout, targeting rules, signing up, creating an account, registering, logging in, deployments, services, environments, buckets, object storage, tracing, traces, spans, OpenTelemetry, OTLP, build failures, agent setup, MCP, or infrastructure operations, even if they don't say "Railway" explicitly. Also invoke this skill when the user asks to be signed up, registered, or onboarded to Railway: do not refuse — drive them through the unauthed `railway up` flow (deploys + signs up on the fly) or `railway login` (which creates new accounts on the fly).

Add to TypingMind

概览

发布者railwayapp
代码仓库railway-skills
技能名称use-railway
星标数
327
复刻数
45
附带文件
25
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 25 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 railwayapp 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Use Railway AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/railwayapp/railway-skills/tree/main/plugins/railway/skills/use-railway
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/railwayapp/railway-skills.git /tmp/railway-skills
mkdir -p .claude/skills
cp -r /tmp/railway-skills/plugins/railway/skills/use-railway .claude/skills/use-railway
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Use Railway,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Use Railway。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Use Railway 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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.

Tool routing

Railway has three agent-facing operation paths. Choose the path that matches the job:

  • Railway CLI (railway): workflows that depend on local machine state such as current working directory deploys, railway up, railway run, SSH, database analysis scripts, local linking, interactive setup, or exact command output.
  • Remote MCP (https://mcp.railway.com): default plugin MCP path for account/project/service discovery, deployment state, bounded logs, traces, feature flags, simple redeploys, simple project creation, or complex Railway workflows that can be handed to railway-agent. Remote MCP uses Railway OAuth and does not depend on local CLI state.
  • GraphQL through railway api: operations without a dedicated MCP tool or CLI command. Use schema search and inspection before constructing unfamiliar queries.

If multiple paths are available, choose the one that preserves the needed context. The CLI fits workflows that need the current repo, local credentials, SSH, database scripts, or exact command output. Remote MCP fits OAuth-scoped platform operations that do not need local files or CLI state.

On a Railway cloud agent VM the railway CLI only has credentials inside an SSH terminal session. In a dashboard or mobile chat session (Railway Agent) it is unauthenticated by design: do not run railway commands there, not even reads or railway api. The railway MCP server is authenticated in every session, so use its tools, resolve IDs with list-services instead of railway status --json, and when no tool covers the job say so and ask the user to make the change in the dashboard.

Optional: an already configured in-process CLI MCP (railway mcp local) can supply operations not available through hosted MCP. A bare railway mcp now starts the hosted MCP proxy using CLI authentication; it is not the in-process server. Published plugin configs connect directly to hosted MCP with editor OAuth.

Prefer railway api (CLI 5.28+) for GraphQL execution. The legacy scripts/railway-api.sh remains a compatibility fallback for older CLIs; see request.md.

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:

bash
railway api \
  'query getProject($id: String!) {
    project(id: $id) {
      environments { edges { node { id name } } }
    }
  }' \
  --variables '{"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.

Intent-based routing

Route by user intent before running preflight checks. The preflight ceremony below is for diagnostic and configuration work — it adds friction when the user just wants to ship something or sign up.

Deploy-from-cwd intent ("deploy", "ship", "push to Railway", "deploy this app"):

  • Skip the railway whoami / railway status preflights.
  • Run railway up directly — it self-validates auth, signs the user in (the CLI opens a browser) if they're unauthenticated, and chains into project + service creation and deploy.
  • Announce intent before invoking: "Running railway up — it'll sign you in if needed and deploy this directory."
  • Do NOT ask the user to run railway login first. The chain handles auth as part of the deploy.
  • If the environment can't open a browser, the CLI prints a device-code sign-in link and waits — follow Device-code sign-in: relay the link immediately (run in background, relay the link to the user the moment it prints).

Signup intent ("sign me up", "create my Railway account", "register me", "get me on Railway"):

  • If the current directory has a deployable app (e.g. package.json, requirements.txt, go.mod, Dockerfile, source to build), run railway up — it signs the user up and deploys in one shot, landing them on a running app. A detected agent harness authorizes the project creation, so bare railway up is enough — there's no extra prompt to clear. Use it even when the user only said "sign me up": shipping their app is the goal, so don't make them pick a command and don't drop to a bare login. For scripted or agent runs, railway up -y is the robust form — it skips prompts and forces the create non-interactively even if harness detection misses. railway login is NOT the default for signup when there's something to deploy.
  • Only when there is nothing to deploy — an empty / non-app directory, or the user explicitly says they just want an account with no deploy — use railway login (creates new accounts on the fly through the same OAuth surface). There is no separate signup command.
  • Signup is the flow most likely to hit the device-code wait (brand-new users in sandboxed/headless agent environments). Follow Device-code sign-in: relay the link immediately — a signup lost to an expired code is a lost user, not a retry.

Sandbox / remote-build intent ("give me a sandbox", "spin up a scratch environment", "build this remotely", "run this remotely", "checkpoint/snapshot the sandbox", "save this sandbox state", "restore my sandbox"):

  • Load sandbox.md and follow it. Sandboxes require the feature to be enabled in Priority Boarding — if a sandbox command fails with a feature-availability error, prompt the user to enable Sandboxes in Priority Boarding rather than retrying.

Other intents (querying state, listing projects, configuring variables, debugging failures):

  • Follow the Preflight section below.

Preflight

Before any mutation, verify the tool path and context:

bash
command -v railway                # CLI installed
RAILWAY_CALLER="skill:use-railway@1.6.1" RAILWAY_AGENT_SESSION="railway-skill-$(date +%s)-$$" railway whoami --json
railway --version                 # check CLI version

Exception: railway up and railway login self-validate auth and run their own unauth-aware flows. Don't run railway whoami before them — it adds a redundant failing call without changing what you do next. See Account creation & sign-in.

Skill freshness

Once per session, alongside the preflight checks, verify the installed Railway agent tooling is current. Root help ends with an Agent tooling: health section (printed to stderr, CLI 5.9+; older CLIs print nothing — skip this check rather than retrying):

bash
railway --help 2>&1 | grep -A4 "Agent tooling:"

Act on what it reports:

  • Skills installed and up to date — continue; nothing to do.
  • An update is available (rev <a> → <b> available) — run railway skills update, then tell the user to restart their coding tool so the updated skills load. This session keeps running on the old skill revision until restart: finish the current request, and if this skill's guidance disagrees with the updated CLI's own output, trust the CLI.
  • Skills or MCP server missing (✗ lines) — run railway setup agent -y, then tell the user to restart their coding tool.

Check once per session and don't re-run it after acting; the restart prompt to the user is the resolution, not another check.

When Railway MCP is available and the job is a platform-state read, use the matching MCP read instead of shelling out. If using the CLI path, run the CLI checks above.

For Railway CLI calls made while this skill is active, prefix the command with RAILWAY_CALLER=skill:use-railway@1.6.1 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 solely 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 --json for the linked project/environment/service.
  • When using MCP tools after resolving local context with railway status --json, pass the resolved project, environment, and service IDs explicitly. Do not rely on MCP implicit linked context; MCP may not share the CLI's current working directory link.

If the CLI is missing, guide the user to install it.

bash
curl -fsSL agents.railway.com | sh # Install CLI and configure detected agents
bash <(curl -fsSL https://railway.com/install.sh) --agents -y # Install CLI and configure detected agents
bash <(curl -fsSL https://railway.com/install.sh) # Shell script (macOS, Linux, Windows via WSL)
npm i -g @railway/cli # npm (macOS, Linux, Windows). Requires Node.js version 16 or higher.
brew install railway # Homebrew (macOS)

If not authenticated, see Account creation & sign-in below — the CLI offers unauthed railway up (deploy + sign up/in in one shot) or railway login (sign up/in only; new accounts created on the fly). 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:

bash
railway upgrade

Account creation & sign-in

Railway uses a single unified OAuth flow for both sign-in and sign-up. The backend detects fresh accounts from durable compliance state (a CLI client that hasn't accepted ToS / Fair Use yet) and adapts the consent screen and post-auth landing page — new users land on a "Welcome to Railway!" page, existing users see the standard confirmation. The CLI does not declare signup intent up front.

Two commands surface this flow, depending on intent:

CommandWhen to use
railway upAgent-friendly onboarding from the current directory. Unauthenticated → opens the browser (or device-code) to sign in / sign up. With no linked project, a detected agent harness (or -y) auto-creates a project + service and deploys; an interactive human is offered create / link-existing / cancel. Add -y to skip prompts and force the create non-interactively (works even if harness detection misses).
railway loginSign in — and sign up. New accounts are created on the fly through the same OAuth surface; there is no separate signup command.

Related: railway up --new creates a fresh project + service from the current directory and deploys it even if one is already linked (use when already signed in and the user wants a new app); --name <name> overrides the project name.

Choosing the path:

  • Deploy from cwd → run railway up (interactive) or railway up -y (skips the confirm prompt). Run it yourself; don't ask the user to sign in separately first.
  • New project from cwd when already signed in → railway up --new.
  • Sign up with a deployable app in cwd → railway up (signs up and deploys — bare up works for a detected agent, even if the user only said "sign me up"; add -y to skip prompts / force it non-interactively). Sign in, or sign up with nothing to deploy → railway login (creates new accounts on the fly).

Headless / no browser:

The CLI auto-detects SSH sessions, CI, and a missing DISPLAY and switches to the device-code flow on its own — you almost never need to force it.

Do NOT pass --browserless just because you are an agent or your shell is non-interactive. If the human is at this machine (a local IDE or desktop session — the common case), bare railway login opens their browser directly, which completes far more reliably than relaying a device code (~90% vs ~60% success for agent-driven sign-ins). Being a coding agent does not make the machine headless.

bash
railway login --browserless   # ONLY for machines with genuinely no browser

Forces the device-code flow (RFC 8628): prints a sign-in link and a short code for the user to open on any device. Reserve it for machines where no browser exists — SSH boxes, containers, remote VMs the auto-detection missed. When you do end up in a device-code flow, follow the relay procedure below: surface the sign-in link to the user the moment it prints.

Agent harness, human present: when the CLI detects an agent harness (Claude Code, Cursor, Codex, …) with a human at the keyboard, railway up opens the browser and skips the confirm prompt — the agent invocation is treated as consent. A real human still has to complete OAuth in the browser.

Device-code sign-in: relay the link immediately (CRITICAL):

When the CLI can't open a browser (sandboxed shell, container, SSH, no DISPLAY), unauthed railway up and railway login print a sign-in URL + short code and then block, polling for up to 10 minutes while the user completes sign-in. The code expires after 10 minutes. If you run this as a normal foreground command, your harness buffers the output until the command exits — the user never sees the link until the code is already dead. This is the #1 cause of failed agent-driven signups. Handle it like this:

  1. Preferred — background execution (e.g. Claude Code: run_in_background, then poll with BashOutput):
    • Start the command in the background.
    • Poll its output. The instant a sign-in block appears (Sign in with one click: <url> on newer CLIs, or Sign in at: <url> / Enter this code: <code> on older ones), stop everything and relay it to the user verbatim — do not summarize, shorten, or defer it. Prefer the one-click URL when present; otherwise relay the URL and code together. Tell the user to open the link now.
    • Leave the command running and keep polling. When the user completes sign-in, the same process picks up the session and continues into the deploy on its own. Then verify per the deploy rules below.
  2. No background support — set expectations, use the longest timeout:
    • Before running, tell the user: "This will print a sign-in link — I'll show it to you the moment I have it. Please complete it promptly; the code expires in 10 minutes."
    • Run with the longest timeout your harness allows.
    • If the command times out or is killed before sign-in completed, the printed code is no longer being monitored — a late click does nothing. Relay whatever link appeared anyway for context, then immediately re-run the command and relay the new link, telling the user to always use the newest one.
  3. Never wait silently for the command to finish before showing the link, and never report the sign-in as failed without first relaying the link and giving the user a chance to act.

The browser transport needs none of this — the CLI opens the browser on the user's machine itself.

JSON / CI modes do not auto-prompt: railway up --json and railway up --ci will NOT open a browser for an unauthed user. --json emits a structured error instead:

json
{"error":"Not signed in.","code":"NOT_AUTHENTICATED","hint":"Run `railway login` to authenticate, then re-run."}

When you see code: NOT_AUTHENTICATED, authenticate the user with railway login, then retry the original command.

OAUTH_INSUFFICIENT_GRANT is different: the session is valid but lacks access to the resource. Check IDs, workspace membership, and the integration's grant scope instead of looping through login; see operate.md.

Fully unattended (no human at all): set RAILWAY_API_TOKEN (account-scoped) or RAILWAY_TOKEN (project-scoped) instead of running an interactive login. A brand-new user with no token and no human present cannot complete signup — there is no headless account-creation path.

Agent tooling

Use direct Railway CLI commands for deterministic operations. Use railway agent only when the user explicitly asks for Railway Agent, wants a natural-language investigation, or the task is broader than a single resource operation.

Set up Railway skills, MCP, and authentication with:

bash
railway setup agent
railway setup agent -y
railway setup agent --oauth

railway setup agent -y skips the interactive login flow. If the user isn't authenticated after setup, run railway login.

Install or update MCP and skills directly when the user names a target tool:

bash
railway mcp install                              # hosted MCP via CLI login
railway mcp install --agent codex --oauth         # direct HTTP, editor OAuth
railway mcp install --agent cursor --oauth
railway skills
railway skills update --agent codex
railway skills remove --agent cursor

Supported targets include claude-code, cursor, codex, opencode, copilot, and factory-droid.

Install modeTransport and authentication
Default / --remoterailway mcp stdio proxy to hosted MCP, authenticated by railway login
--oauthDirect HTTP to https://mcp.railway.com, authenticated by editor OAuth; matches the published plugins
--localIn-process GraphQL-backed stdio server, invoked as railway mcp local

These modes apply to both mcp install and setup agent; interactive setup offers a choice. railway mcp proxy remains an alias for the default proxy. The proxy may fill only a linked project ID when the tool accepts it and the call supplies no resource scope. Continue passing explicit project, environment, and service IDs for scoped work.

Use Railway Agent chat with:

bash
railway agent
railway agent -p "why is my service crashing?"
railway agent -p "summarize the deployment status" --json
railway agent --list --json
railway agent --thread-id <thread-id>

railway agent requires user OAuth authentication from railway login. Project tokens (RAILWAY_TOKEN) are not supported for Railway Agent chat. If an agent command is unavailable, upgrade with railway upgrade --yes.

Common quick operations

These are frequent enough to handle without loading a reference. Use the matching MCP tool when the job is platform-scoped and the tool is available; otherwise use the CLI:

bash
railway status --json                                    # current context
railway whoami --json                                    # auth and workspace info
railway project list --json                              # list projects
railway service list --json                              # services in current environment (verify before retrying `add`)
railway add --database <type> --json                     # add one database; ALWAYS pass --json
railway add --service <name> --json                      # add empty service; ALWAYS pass --json
railway variable list --service <svc> --json             # list variables
railway variable set KEY=value --service <svc>           # set a variable
railway domain list --service <svc> --json               # domains and DNS status
railway logs --service <svc> --lines 200 --json          # recent logs
railway logs --service <svc> --network --lines 200 --json # network flow snapshot
railway metrics --service <svc> --since 1h --json        # resource and HTTP metrics summary
railway up --detach -m "<summary>"                       # deploy current directory (returns at QUEUED — verify before reporting)
railway deployment list --json                           # poll newest deployment status after a detached up
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 credentials

Routing

For anything beyond quick operations, load the references needed for the user's intent. Most requests need one or two; compose more when the workflow crosses areas.

IntentReferenceUse for
Analyze a database ("analyze <url>", "analyze db", "analyze database", "analyze service", "introspect", "check my postgres/redis/mysql/mongo")analyze-db.mdDatabase 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 resourcessetup.mdProjects, services, databases, buckets, templates, workspaces
Ship code or manage releasesdeploy.mdDeploy, redeploy, restart, build config, monorepo, Dockerfile
Change configuration ("webhook", "notify on deploy", "custom header", "Slack/Discord notifications")configure.mdEnvironments, variables, config patches, domains, networking, project webhooks with the list-webhooks / create-webhook / update-webhook / test-webhook / delete-webhook MCP tools and their custom headers
Manage feature flagsfeature-flags.mdMCP registry operations; CLI targeting rules and rollouts; SDK runtime reads
Define configuration in source control ("IaC", "infrastructure as code", "config as code", .railway/railway.ts, .railway/railway.py, .railway/railway.go, "config migrate/plan/apply/pull")iac.mdAuthor/import IaC, migrate legacy JSON/TOML, save and apply reviewed plans, check drift
Manage databases ("PITR", "restore", "backup", "HA", "failover", "switchover", "PgBouncer", "connection pooling")databases.mdPostgres recovery, HA and pooling; MySQL/Redis HA; use analysis references for performance investigations
Inspect costs or manage spending limitsusage.mdWorkspace/project/service usage, billing periods, workspace and Railway Agent limits
Run a coding agent on Railway ("cloud agent", "railway ca", "railway code", "desktop SSH")cloud-agents.mdProvision, connect, wake, sleep, delete, or configure desktop access to cloud agent VMs
Check health or debug failuresoperate.mdStatus, logs, metrics, build/runtime triage, recovery
Trace requests across services ("tracing", "traces", "trace ID", "spans", "OpenTelemetry", "OTel", "OTLP", "instrument my app", "instrument my function", "Bun function", "auto-instrumentation")tracing.mdEnable tracing per service and environment with the get-tracing / set-service-tracing MCP tools or railway trace enable, the IaC tracing block and its current SDK limitation, SDK instrumentation (preferred) vs automatic (eBPF), what to instrument, instrumenting a Function (Bun), the provided OTEL_* variables, sampling, reading traces with the list-traces / get-trace MCP tools or railway trace list / get, checking what a service's instrumentation covers with get-tracing-coverage, the Traces tab
Use a sandbox or build remotely ("sandbox", "scratch environment", "ephemeral box", "build remotely", "remote build", "run this remotely", "checkpoint", "snapshot/save/restore sandbox state")sandbox.mdCreate/fork sandboxes, run commands remotely, remote template builds, checkpoints (save/restore sandbox state), port forwarding, teardown. Requires Sandboxes enabled in Priority Boarding — if unavailable, prompt the user to enable it.
Request from API, docs, or communityrequest.mdRailway 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

  1. Use Railway CLI for workflows that need the current repo, local shell, SSH, database scripts, local Railway context, or exact command output.
  2. Use Remote MCP for OAuth-scoped platform operations that match an available MCP tool and do not need local files or CLI state.
  3. Use local CLI MCP only when the current agent already has it explicitly configured and it exposes a needed operation not available through Remote MCP.
  4. Use railway api for operations without a dedicated MCP tool or CLI command; retain the legacy helper only for CLI compatibility.
  5. Use --json output where available for reliable parsing.
  6. Resolve context before mutation. Know which project, environment, and service you're acting on.
  7. For destructive actions (delete service, remove deployment, drop database), confirm intent and state impact before executing.
  8. After mutations, verify the result with a read-back command or MCP read.
  9. Never report a deploy as successful without observing SUCCESS for that deployment. up --detach, a non-TTY up without CI mode, or a timed-out stream may return after upload. Follow the deployment ID from the upload in railway deployment list --json with the same project/environment/service scope; do not substitute a concurrent newer deployment. If status is FAILED or CRASHED, triage per operate.md. If status is NEEDS_APPROVAL, SLEEPING, SKIPPED, REMOVED, REMOVING, or unknown, report that state and the next action. Exit 0 alone is insufficient; see deploy.md for CI streaming and polling.

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.

CommandWhy 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:

  1. Explain what the command does and any side effects (e.g., restart required)
  2. Show the exact command the user must run
  3. Wait for user confirmation that they ran it
  4. 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)
  • Add tracing: tracing (enable for the service in the right environment with set-service-tracing or railway trace enable, prefer SDK instrumentation over automatic, add spans around inbound work, I/O and logical units; for a Function, edit its file with get-function-source-code / update-function-source-code), configure (set OTEL_METRICS_EXPORTER/OTEL_LOGS_EXPORTER, start command), deploy (redeploy so the OTEL_* variables land), tracing (verify with x-railway-trace-id and get-trace or railway trace get, then get-tracing-coverage for the database and client spans)
  • 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:

  1. If the intent is deploy-from-cwd or signup-from-cwd, skip railway whoami and run railway up (or railway up -y) directly per Intent-based routing — it handles signup, project creation, service creation, and deploy in one chain. For other setup flows that need workspace/account context first, run railway whoami --json; if it fails with an auth error the user has no token — route through Account creation & sign-in.
  2. Run railway status --json in the current directory.
  3. 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".
  4. 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 rootDirectory to the sub-app path.
    • Parent not linked: run railway list --json and 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>).
  5. 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:

  1. What was done (action and scope).
  2. The result (IDs, status, key output).
  3. 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.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Use Railway AI 技能有什么作用?

Operate Railway infrastructure: sign up for or sign in to a Railway account, create projects, provision services, databases, and buckets, deploy code, configure infrastructure as code, environments and variables, manage domains, trace requests with OpenTelemetry, troubleshoot failures, check status and metrics, manage feature flags, database recovery and HA, cloud agents, usage limits, and Railway agent tooling. Use this skill whenever the user mentions Railway, feature flags, flag rollout, targeting rules, signing up, creating an account, registering, logging in, deployments, services, env...

为什么在 TypingMind 中使用 Use Railway?

因为您只需安装一次,就能搭配任何模型使用。Use Railway 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Use Railway?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/railwayapp/railway-skills/tree/main/plugins/railway/skills/use-railway。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Use Railway?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Use Railway 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Use Railway 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Use Railway AI 技能免费吗?

是的。railwayapp 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇