agentleFS
railwayapprailwayapp/railway-skills/AGENTS.md

railway-skills

AGENTS.md326 starsChanged 6 months agoMITView on GitHub

Agent plugins for Railway. Interact with Railway through one orchestration skill and the Railway MCP server. The shared plugin payload lives in plugins/railway. Claude Code and Grok Build also use plugins/railway/hooks/hooks.json for the existing Railway CLI/API auto-approval hook. The hook command resolves ${GROK_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/hooks/auto-approve-api.sh. The plugin ships one Railway skill: use-railway is route-first. Routing rules and intent mapping live in SKILL.md. Choose the Railway operation path that matches the job.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 1 is common, 7 are distinctive, and 4 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Railway CLI for context-aware local operations.

    line 62
  2. Very specific:

    Prefer --json output where available.

    line 65
  3. Very specific:

    Keep plugins/railway/.mcp.json, plugins/railway/.cursor-plugin/mcp.json, and plugins/railway/.grok-plugin/mcp.json in sync.

    line 72
  4. Common:

    Do not store credentials in plugin MCP config.

    line 74
  5. Distinctive:

    Use GraphQL for operations without a dedicated command or MCP tool.

    line 79
  6. Distinctive:

    When editing this plugin:

    line 101
  7. Very specific:

    Keep SKILL.md focused on routing, preflight, composition, and common operations.

    line 103
  8. Distinctive:

    Keep references organized by information type (setup, deploy, configure, iac, operate, api).

    line 104
  9. Distinctive:

    Keep references action-oriented with reasoning.

    line 105
  10. Distinctive:

    Keep CLI behavior claims aligned with Railway docs and CLI source.

    line 106
  11. Distinctive:

    Keep a single "Validated against" block at the end of each reference.

    line 107
  12. Very specific:

    Keep plugin versions aligned across the Claude Code, Codex, Cursor, and Grok (plugins/railway/.grok-plugin/plugin.json) manifests when …

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Railway Agent Plugins

Agent plugins for Railway. Interact with Railway through one orchestration skill and the Railway MCP server.

Plugin model

The shared plugin payload lives in plugins/railway.

  • Claude Code: plugins/railway/.claude-plugin/plugin.json, plugins/railway/.mcp.json, and the repo marketplace at .claude-plugin/marketplace.json.
  • OpenAI Codex: plugins/railway/.codex-plugin/plugin.json, plugins/railway/.mcp.json, and the repo marketplace at .agents/plugins/marketplace.json.
  • Grok Build / xAI marketplace: resolves plugins/railway as the plugin by using a remote source subpath (source.path: "plugins/railway"). The shared payload therefore exposes plugins/railway/.grok-plugin/plugin.json, plugins/railway/.grok-plugin/mcp.json, plugins/railway/skills, and plugins/railway/hooks directly.
  • Cursor: plugins/railway/.cursor-plugin/plugin.json, plugins/railway/.cursor-plugin/mcp.json, and the repo marketplace at .cursor-plugin/marketplace.json.

Claude Code and Grok Build also use plugins/railway/hooks/hooks.json for the existing Railway CLI/API auto-approval hook. The hook command resolves ${GROK_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/hooks/auto-approve-api.sh.

Skill model

The plugin ships one Railway skill:

  • plugins/railway/skills/use-railway/SKILL.md

use-railway is route-first. Routing rules and intent mapping live in SKILL.md.

Reference loading pattern

  1. Read plugins/railway/skills/use-railway/SKILL.md.
  2. Choose the minimum reference set needed for the request.
  3. For multi-step requests, load multiple references and compose one response.

References:

IntentReferenceUse for
Create or connect resourcesreferences/setup.mdProjects, services, databases, buckets, templates, workspaces
Ship code or manage releasesreferences/deploy.mdDeploy, redeploy, restart, build config, monorepo, Dockerfile
Change configurationreferences/configure.mdEnvironments, variables, config patches, domains, networking, project webhooks and their custom headers
Manage feature flagsreferences/feature-flags.mdMCP registry operations; CLI targeting rules and rollouts; SDK runtime reads
Define configuration in source controlreferences/iac.mdTypeScript/Python/Go IaC, legacy migration, imports, saved plans, apply and drift checks
Manage database featuresreferences/databases.mdPostgres PITR, backups, HA and PgBouncer; MySQL/Redis HA
Inspect costs or manage limitsreferences/usage.mdWorkspace/project/service usage and workspace/agent spending limits
Run coding agents on Railwayreferences/cloud-agents.mdCloud agent lifecycle, harness launches, desktop SSH setup
Check health or debug failuresreferences/operate.mdStatus, logs, metrics, build/runtime triage, recovery
Trace requests across servicesreferences/tracing.mdEnable tracing per service and environment with the get-tracing / set-service-tracing MCP tools, railway trace or the IaC tracing block, SDK instrumentation (preferred) vs automatic (eBPF), what to instrument, instrumenting a Function (Bun), provided OTEL_* variables, sampling, reading traces with the list-traces / get-trace MCP tools or railway trace list / get, checking coverage with get-tracing-coverage
Use a sandbox or build remotelyreferences/sandbox.mdSandboxes: create/fork, remote exec, remote template builds, checkpoints, port forwarding (requires Priority Boarding)
Analyze databasesreferences/analyze-db.mdDatabase introspection and performance analysis, then DB-specific refs
Request from API, docs, or communityreferences/request.mdGraphQL mutations, metrics queries, Central Station, official docs

Architecture

Tool routing

Choose the Railway operation path that matches the job.

  • Railway CLI (railway): local-machine workflows such as current-directory deploys, railway up, railway run, SSH, database analysis scripts, local linking, interactive setup, and exact command output.
  • Remote MCP (https://mcp.railway.com): default plugin MCP path for account/project/service discovery, deployment status, feature flags, bounded logs, traces, simple redeploys, simple project creation, and complex workflows through 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, with live schema search and inspection.

Optional: an already configured in-process CLI MCP (railway mcp local) can supply operations not available through hosted MCP. Bare railway mcp starts the hosted proxy using CLI login; it is not the in-process server. Published plugin configs use direct hosted HTTP with editor OAuth.

Railway CLI

Use Railway CLI for context-aware local operations.

  • Command: railway
  • Prefer --json output where available.
  • Skill telemetry: prefix Railway CLI invocations with RAILWAY_CALLER=skill:use-railway@<plugin-version> and a stable RAILWAY_AGENT_SESSION; do not run separate telemetry-only export commands.

MCP

Published plugin MCP configs use Railway's hosted MCP server for single-click setup.

  • Keep plugins/railway/.mcp.json, plugins/railway/.cursor-plugin/mcp.json, and plugins/railway/.grok-plugin/mcp.json in sync.
  • Plugin MCP configs must point at https://mcp.railway.com with HTTP transport.
  • Do not store credentials in plugin MCP config. Remote MCP authentication uses Railway OAuth.
  • CLI installation defaults to the hosted proxy (railway mcp, with mcp proxy retained as an alias). railway mcp install --oauth selects direct HTTP/editor OAuth; --local selects railway mcp local. --remote is an alias for the proxy default. Published plugin configs keep direct HTTP transport.

GraphQL API

Use GraphQL for operations without a dedicated command or MCP tool. Prefer the CLI's authenticated API client.

  • Endpoint: https://backboard.railway.com/graphql/v2
  • CLI (5.28+): railway api, with search, describe, and schema for discovery.
  • Legacy helper: plugins/railway/skills/use-railway/scripts/railway-api.sh, retained for older CLI compatibility and still required by the database analysis scripts (dal.py, analyze-postgres.py). It attaches X-Railway-Skill-Id, X-Railway-Skill-Version, and X-Railway-Agent-Session headers.

API authentication

railway api uses normal CLI authentication and token refresh. The legacy helper reads only ~/.railway/config.json under user.token; it does not implement environment-token selection or OAuth refresh.

Example:

railway api \
  'query getEnv($id: String!) { environment(id: $id) { name } }' \
  --variables '{"id": "env-uuid"}'

API docs: https://docs.railway.com/api/llms-docs.md

Authoring guidance

When editing this plugin:

  • Keep SKILL.md focused on routing, preflight, composition, and common operations.
  • Keep references organized by information type (setup, deploy, configure, iac, operate, api).
  • Keep references action-oriented with reasoning. Explain why, not only what.
  • Keep CLI behavior claims aligned with Railway docs and CLI source.
  • Keep a single "Validated against" block at the end of each reference.
  • Keep plugin versions aligned across the Claude Code, Codex, Cursor, and Grok (plugins/railway/.grok-plugin/plugin.json) manifests when plugin behavior changes.
  • For Grok/xAI marketplace entries, use the remote source subpath plugins/railway instead of adding root-level symlinks or copies.
  • Bump version in plugins/railway/.claude-plugin/plugin.json in any PR that changes skill content or published plugin behavior. Claude Code uses this version to detect updates, and users will not receive changes without a bump.

References

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.