railway-skills
AGENTS.md346 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. Antigravity does not load this hook: it only reads hooks.json at the plugin root, names its shell tool run_command, and expects a decision response instead of hookSpecificOutput. The plugin ships one Railway skill: use-railway is route-first. Routing…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 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.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 1 is common, 7 are distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 63
Use Railway CLI for context-aware local operations.
- Very specific: line 66
Prefer --json output where available.
- Very specific: line 73
Keep plugins/railway/.mcp.json, plugins/railway/.cursor-plugin/mcp.json, plugins/railway/.grok-plugin/mcp.json, and …
- Common: line 75
Do not store credentials in plugin MCP config.
- Distinctive: line 80
Use GraphQL for operations without a dedicated command or MCP tool.
- Distinctive: line 102
When editing this plugin:
- Very specific: line 104
Keep SKILL.md focused on routing, preflight, composition, and common operations.
- Distinctive: line 105
Keep references organized by information type (setup, deploy, configure, iac, operate, api).
- Distinctive: line 106
Keep references action-oriented with reasoning.
- Distinctive: line 107
Keep CLI behavior claims aligned with Railway docs and CLI source.
- Distinctive: line 108
Keep a single "Validated against" block at the end of each reference.
- Very specific: line 109
Keep plugin versions aligned across the Claude Code, Codex, Cursor, Grok (plugins/railway/.grok-plugin/plugin.json), and Antigravity …
- Very specific: line 110
Keep the use-railway skill description at or under 1024 characters.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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.
Files
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/railwayas the plugin by using a remote source subpath (source.path: "plugins/railway"). The shared payload therefore exposesplugins/railway/.grok-plugin/plugin.json,plugins/railway/.grok-plugin/mcp.json,plugins/railway/skills, andplugins/railway/hooksdirectly. - Cursor:
plugins/railway/.cursor-plugin/plugin.json,plugins/railway/.cursor-plugin/mcp.json, and the repo marketplace at.cursor-plugin/marketplace.json. - Google Antigravity:
plugins/railway/.antigravity-plugin/plugin.jsonandplugins/railway/mcp_config.json, withplugins/railway/README.mdrendered as the pre-install page andplugins/railway/assets/logo.svgas the Marketplace logo. Antigravity resolves every component path fromplugins/railway, so onlyplugin.jsonmay live in.antigravity-plugin/; skills, MCP config, and assets stay at the plugin root. Antigravity's MCP config usesserverUrlinstead oftype/url, and namespaces each server key as<plugin>-<key>(railway-mcp).
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. Antigravity does not load this hook: it only reads hooks.json at the plugin root, names its shell tool run_command, and expects a decision response instead of hookSpecificOutput.
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
- Read
plugins/railway/skills/use-railway/SKILL.md. - Choose the minimum reference set needed for the request.
- For multi-step requests, load multiple references and compose one response.
References:
| Intent | Reference | Use for |
| Create or connect resources | references/setup.md | Projects, services, databases, buckets, templates, workspaces |
| Ship code or manage releases | references/deploy.md | Deploy, redeploy, restart, build config, monorepo, Dockerfile |
| Change configuration | references/configure.md | Environments, variables, config patches, domains, networking, project webhooks and their custom headers |
| Manage feature flags | references/feature-flags.md | MCP registry operations; CLI targeting rules and rollouts; SDK runtime reads |
| Define configuration in source control | references/iac.md | TypeScript/Python/Go IaC, legacy migration, imports, saved plans, apply and drift checks |
| Manage database features | references/databases.md | Postgres PITR, backups, HA and PgBouncer; MySQL/Redis HA |
| Inspect costs or manage limits | references/usage.md | Workspace/project/service usage and workspace/agent spending limits |
| Run coding agents on Railway | references/cloud-agents.md | Cloud agent lifecycle, harness launches, desktop SSH setup |
| Check health or debug failures | references/operate.md | Status, logs, metrics, build/runtime triage, recovery |
| Trace requests across services | references/tracing.md | Enable tracing per service and environment with the get-tracing / set-service-tracing MCP tools, railway trace or the IaC tracing block, SDK instrumentation (automatic eBPF instrumentation is unavailable), 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 remotely | references/sandbox.md | Sandboxes: create/fork, remote exec, remote template builds, checkpoints, port forwarding (requires Priority Boarding) |
| Analyze databases | references/analyze-db.md | Database introspection and performance analysis, then DB-specific refs |
| Request from API, docs, or community | references/request.md | GraphQL 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 throughrailway-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
--jsonoutput where available. - Skill telemetry: prefix Railway CLI invocations with
RAILWAY_CALLER=skill:use-railway@<plugin-version>and a stableRAILWAY_AGENT_SESSION; do not run separate telemetry-onlyexportcommands.
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,plugins/railway/.grok-plugin/mcp.json, andplugins/railway/mcp_config.json(Antigravity'sserverUrlschema) in sync. - Plugin MCP configs must point at
https://mcp.railway.comwith 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, withmcp proxyretained as an alias).railway mcp install --oauthselects direct HTTP/editor OAuth;--localselectsrailway mcp local.--remoteis 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, withsearch,describe, andschemafor 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 attachesX-Railway-Skill-Id,X-Railway-Skill-Version, andX-Railway-Agent-Sessionheaders.
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.mdfocused 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, Grok (
plugins/railway/.grok-plugin/plugin.json), and Antigravity (plugins/railway/.antigravity-plugin/plugin.json) manifests when plugin behavior changes. - Keep the
use-railwayskilldescriptionat or under 1024 characters; Antigravity and the Agent Skills spec reject longer descriptions. - For Grok/xAI marketplace entries, use the remote source subpath
plugins/railwayinstead of adding root-level symlinks or copies. - Bump
versioninplugins/railway/.claude-plugin/plugin.jsonin 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
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.

