This skill should be used when the user wants to add a database (Postgres, Redis, MySQL, MongoDB), says "add postgres", "add redis", "add database", "connect to database", or "wire up the database". For other templates (Ghost, Strapi, n8n, etc.), use the templates skill.
/plugin marketplace add railwayapp/railway-skills/plugin install railway@railway-claude-pluginThis skill is limited to using the following tools:
Add official Railway database services. These are maintained templates with pre-configured volumes, networking, and connection variables.
For non-database templates, see the templates skill.
ALWAYS check for existing databases FIRST before creating.
User mentions database
│
Check existing DBs first
(query env config for source.image)
│
┌────┴────┐
Exists Doesn't exist
│ │
│ Create database
│ (CLI or API)
│ │
│ Wait for deployment
│ │
└─────┬─────┘
│
User wants to
connect service?
│
┌─────┴─────┐
Yes No
│ │
Wire vars Done +
via env suggest wiring
skill
Before creating a database, check if one already exists.
For full environment config structure, see environment-config.md.
railway status --json
Then query environment config and check source.image for each service:
query environmentConfig($environmentId: String!) {
environment(id: $environmentId) {
config(decryptVariables: false)
}
}
The config.services object contains each service's configuration. Check source.image for:
ghcr.io/railway/postgres* or postgres:* → Postgresghcr.io/railway/redis* or redis:* → Redisghcr.io/railway/mysql* or mysql:* → MySQLghcr.io/railway/mongo* or mongo:* → MongoDB| Database | Template Code |
|---|---|
| PostgreSQL | postgres |
| Redis | redis |
| MySQL | mysql |
| MongoDB | mongodb |
Get project context:
railway status --json
Extract:
id - project IDenvironments.edges[0].node.id - environment IDGet workspace ID (not in status output):
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'query getWorkspace($projectId: String!) {
project(id: $projectId) { workspaceId }
}' \
'{"projectId": "PROJECT_ID"}'
SCRIPT
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'query template($code: String!) {
template(code: $code) {
id
name
serializedConfig
}
}' \
'{"code": "postgres"}'
SCRIPT
This returns the template's id and serializedConfig needed for deployment.
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation deployTemplate($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) {
projectId
workflowId
}
}' \
'{
"input": {
"templateId": "TEMPLATE_ID",
"serializedConfig": SERIALIZED_CONFIG,
"projectId": "PROJECT_ID",
"environmentId": "ENVIRONMENT_ID",
"workspaceId": "WORKSPACE_ID"
}
}'
SCRIPT
Important: serializedConfig is the exact object from the template query, not a string.
After deployment, other services connect using reference variables.
For complete variable reference syntax and wiring patterns, see variables.md.
Use the private/internal URL for server-to-server communication:
| Database | Variable Reference |
|---|---|
| PostgreSQL | ${{Postgres.DATABASE_URL}} |
| Redis | ${{Redis.REDIS_URL}} |
| MySQL | ${{MySQL.MYSQL_URL}} |
| MongoDB | ${{MongoDB.MONGO_URL}} |
Important: Frontends run in the user's browser and cannot access Railway's private network. They must use public URLs or go through a backend API.
For direct database access from frontend (not recommended):
${{MongoDB.MONGO_PUBLIC_URL}})Better pattern: Frontend → Backend API → Database
bash <<'SCRIPT'
# 1. Get context
railway status --json
# Extract project.id and environment.id
# 2. Get workspace ID
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'query { project(id: "proj-id") { workspaceId } }' '{}'
# 3. Fetch Postgres template
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'query { template(code: "postgres") { id serializedConfig } }' '{}'
# 4. Deploy template
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation deploy($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) { projectId workflowId }
}' \
'{"input": {"templateId": "...", "serializedConfig": {...}, "projectId": "...", "environmentId": "...", "workspaceId": "..."}}'
SCRIPT
Use environment skill to add the variable reference:
{
"services": {
"<backend-service-id>": {
"variables": {
"DATABASE_URL": { "value": "${{Postgres.DATABASE_URL}}" }
}
}
}
}
Successful deployment returns:
{
"data": {
"templateDeployV2": {
"projectId": "e63baedb-e308-49e9-8c06-c25336f861c7",
"workflowId": "deployTemplate/project/e63baedb-e308-49e9-8c06-c25336f861c7/xxx"
}
}
}
Each database template creates:
| Error | Cause | Solution |
|---|---|---|
| Template not found | Invalid template code | Use: postgres, redis, mysql, mongodb |
| Permission denied | User lacks access | Need DEVELOPER role or higher |
| Project not found | Invalid project ID | Run railway status --json for correct ID |
environment skill to stage: DATABASE_URL: { "value": "${{Postgres.DATABASE_URL}}" }DATABASE_URL=${{Postgres.DATABASE_URL}}"environment skill to add variable referencesservice skilldeployment skillApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.