@cleocode/cleo 2026.3.2 → 2026.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/cli/index.js +7381 -3507
- package/dist/cli/index.js.map +4 -4
- package/dist/mcp/index.js +5792 -2097
- package/dist/mcp/index.js.map +4 -4
- package/package.json +4 -4
- package/packages/ct-skills/index.js +1 -1
- package/packages/ct-skills/package.json +0 -2
- package/packages/ct-skills/profiles/core.json +1 -1
- package/packages/ct-skills/profiles/full.json +4 -5
- package/packages/ct-skills/profiles/minimal.json +3 -3
- package/packages/ct-skills/profiles/recommended.json +2 -2
- package/packages/ct-skills/provider-skills-map.json +97 -0
- package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
- package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
- package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
- package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-grade/SKILL.md +214 -0
- package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
- package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
- package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
- package/packages/ct-skills/skills/manifest.json +217 -947
- package/packages/ct-skills/skills.json +244 -3
- package/templates/CLEO-INJECTION.md +37 -0
- package/templates/README.md +4 -4
- package/templates/cleo-gitignore +3 -11
- package/templates/git-hooks/pre-commit +1 -1
- package/packages/ct-skills/protocols/agent-protocol.md +0 -260
- package/packages/ct-skills/protocols/artifact-publish.md +0 -587
- package/packages/ct-skills/protocols/consensus.md +0 -309
- package/packages/ct-skills/protocols/contribution.md +0 -375
- package/packages/ct-skills/protocols/decomposition.md +0 -352
- package/packages/ct-skills/protocols/implementation.md +0 -344
- package/packages/ct-skills/protocols/provenance.md +0 -600
- package/packages/ct-skills/protocols/release.md +0 -635
- package/packages/ct-skills/protocols/research.md +0 -248
- package/packages/ct-skills/protocols/specification.md +0 -287
- package/packages/ct-skills/protocols/testing.md +0 -346
- package/packages/ct-skills/protocols/validation.md +0 -229
- package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
- package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
- package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
- package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
- package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
- package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
- package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
- package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
- package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
- package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
- package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
- package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
- package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
- package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
- package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
- package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
- package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
- package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
- package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
- package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
- package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
- package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
- package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
- package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
- package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
- package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
- package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
- package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
- package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: railway-platform
|
|
3
|
-
description: Deploy and manage applications on Railway platform. Use for creating projects, deploying services (Node.js, Python, Go, Docker, static sites), managing databases (Postgres, Redis, MySQL, MongoDB), configuring domains, environment variables, volumes, cron jobs, and networking. Integrates with GitHub for auto-deploys. Supports monorepos, private networking, and Railway Metal infrastructure.
|
|
4
|
-
version: 1.0.0
|
|
5
|
-
tier: 3
|
|
6
|
-
core: false
|
|
7
|
-
category: specialist
|
|
8
|
-
protocol: null
|
|
9
|
-
dependencies: []
|
|
10
|
-
sharedResources: []
|
|
11
|
-
compatibility:
|
|
12
|
-
- claude-code
|
|
13
|
-
- cursor
|
|
14
|
-
- windsurf
|
|
15
|
-
- gemini-cli
|
|
16
|
-
license: MIT
|
|
17
|
-
metadata:
|
|
18
|
-
author: Railway Skills Collective
|
|
19
|
-
updated: "2025-02-17"
|
|
20
|
-
repository: https://github.com/railwayapp/railway-skills
|
|
21
|
-
allowed-tools: Bash(railway:*), Bash(jq:*), Bash(curl:*), Read, Write
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
# Railway Platform
|
|
25
|
-
|
|
26
|
-
Railway is a deployment platform that builds and runs your code with minimal configuration. This skill provides comprehensive management of Railway resources.
|
|
27
|
-
|
|
28
|
-
## When to Use This Skill
|
|
29
|
-
|
|
30
|
-
- **Creating projects:** Initialize new Railway projects or link existing ones
|
|
31
|
-
- **Deploying code:** Push local code or connect GitHub repositories
|
|
32
|
-
- **Managing services:** Create, configure, and monitor services
|
|
33
|
-
- **Adding databases:** Deploy Postgres, Redis, MySQL, or MongoDB
|
|
34
|
-
- **Configuring domains:** Set up custom domains with SSL
|
|
35
|
-
- **Environment setup:** Variables, build commands, and configuration
|
|
36
|
-
- **Advanced features:** Volumes, cron jobs, private networking, Railway Functions
|
|
37
|
-
|
|
38
|
-
## Quick Start
|
|
39
|
-
|
|
40
|
-
### Deploy Current Directory
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
railway up --detach -m "Initial deploy"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Check Status
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
railway status --json
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### View Logs
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
railway logs --lines 100
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Installation & Setup
|
|
59
|
-
|
|
60
|
-
See [01-getting-started.md](references/01-getting-started.md) for:
|
|
61
|
-
- CLI installation
|
|
62
|
-
- Authentication
|
|
63
|
-
- Project linking
|
|
64
|
-
- Troubleshooting
|
|
65
|
-
|
|
66
|
-
Quick check:
|
|
67
|
-
```bash
|
|
68
|
-
railway status --json
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Decision Trees
|
|
72
|
-
|
|
73
|
-
### Decision: New Project vs Existing
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
railway status --json
|
|
77
|
-
│
|
|
78
|
-
┌────┴────┐
|
|
79
|
-
Linked Not Linked
|
|
80
|
-
│ │
|
|
81
|
-
│ Check parent directory
|
|
82
|
-
│ │
|
|
83
|
-
│ ┌────┴────┐
|
|
84
|
-
│ Linked Not linked
|
|
85
|
-
│ │ │
|
|
86
|
-
│ Use parent List projects
|
|
87
|
-
│ project or init new
|
|
88
|
-
│ │ │
|
|
89
|
-
Add Set root Link or
|
|
90
|
-
service dir init
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Decision: Deploy Strategy
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
Local code GitHub repo
|
|
97
|
-
│ │
|
|
98
|
-
railway up Connect in UI
|
|
99
|
-
│ │
|
|
100
|
-
Detach Auto-deploys
|
|
101
|
-
or CI │
|
|
102
|
-
│ On push to
|
|
103
|
-
Monitor main
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Decision: Database Setup
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
Need database?
|
|
110
|
-
│
|
|
111
|
-
┌──┴──┐
|
|
112
|
-
Yes No
|
|
113
|
-
│ │
|
|
114
|
-
Check Skip
|
|
115
|
-
existing
|
|
116
|
-
│
|
|
117
|
-
┌──┴──┐
|
|
118
|
-
Exists New
|
|
119
|
-
│ │
|
|
120
|
-
Skip Deploy
|
|
121
|
-
│ template
|
|
122
|
-
│ │
|
|
123
|
-
Wire Done
|
|
124
|
-
vars
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Core Workflows
|
|
128
|
-
|
|
129
|
-
### Workflow 1: New Project from Scratch
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
# 1. Create project
|
|
133
|
-
railway init -n my-project
|
|
134
|
-
|
|
135
|
-
# 2. Add service
|
|
136
|
-
railway add --service web
|
|
137
|
-
|
|
138
|
-
# 3. Deploy
|
|
139
|
-
railway up --detach -m "Initial deploy"
|
|
140
|
-
|
|
141
|
-
# 4. Add domain (optional)
|
|
142
|
-
railway domain
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Workflow 2: Connect to Existing Project
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# 1. List projects
|
|
149
|
-
railway list --json
|
|
150
|
-
|
|
151
|
-
# 2. Link to project
|
|
152
|
-
railway link -p project-name
|
|
153
|
-
|
|
154
|
-
# 3. Check status
|
|
155
|
-
railway status
|
|
156
|
-
|
|
157
|
-
# 4. Deploy
|
|
158
|
-
railway up
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Workflow 3: Add Database + Wire Service
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
# 1. Deploy database template
|
|
165
|
-
# See database reference for template deployment
|
|
166
|
-
|
|
167
|
-
# 2. Wire connection
|
|
168
|
-
# Set DATABASE_URL via environment reference
|
|
169
|
-
|
|
170
|
-
# 3. Deploy with connection
|
|
171
|
-
railway up
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Workflow 4: Monorepo Setup
|
|
175
|
-
|
|
176
|
-
**First, detect type:**
|
|
177
|
-
```bash
|
|
178
|
-
# Check for workspace files
|
|
179
|
-
ls pnpm-workspace.yaml turbo.json nx.json 2>/dev/null
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Isolated monorepo (no shared code):**
|
|
183
|
-
```bash
|
|
184
|
-
railway add --service frontend
|
|
185
|
-
# Set rootDirectory: /frontend
|
|
186
|
-
|
|
187
|
-
railway add --service backend
|
|
188
|
-
# Set rootDirectory: /backend
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Shared monorepo (workspace tools):**
|
|
192
|
-
```bash
|
|
193
|
-
railway add --service frontend
|
|
194
|
-
# Build: pnpm --filter frontend build
|
|
195
|
-
# Watch: /packages/frontend/**, /packages/shared/**
|
|
196
|
-
|
|
197
|
-
railway add --service backend
|
|
198
|
-
# Build: pnpm --filter backend build
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**See [12-monorepo.md](references/12-monorepo.md) for detailed patterns.**
|
|
202
|
-
|
|
203
|
-
## Command Reference
|
|
204
|
-
|
|
205
|
-
### Project Commands
|
|
206
|
-
|
|
207
|
-
| Command | Purpose | When to Use |
|
|
208
|
-
|---------|---------|-------------|
|
|
209
|
-
| `railway init -n <name>` | Create new project | Starting fresh |
|
|
210
|
-
| `railway link -p <name>` | Link to existing | Joining existing project |
|
|
211
|
-
| `railway status --json` | Check current state | Before any operation |
|
|
212
|
-
| `railway list --json` | List all projects | Finding project ID |
|
|
213
|
-
| `railway unlink` | Remove link | Switching projects |
|
|
214
|
-
|
|
215
|
-
### Deployment Commands
|
|
216
|
-
|
|
217
|
-
| Command | Purpose | When to Use |
|
|
218
|
-
|---------|---------|-------------|
|
|
219
|
-
| `railway up --detach` | Deploy without streaming | Most deployments |
|
|
220
|
-
| `railway up --ci` | Deploy with log streaming | Debugging builds |
|
|
221
|
-
| `railway up -m "msg"` | Deploy with message | Always recommended |
|
|
222
|
-
| `railway redeploy -y` | Redeploy latest | Restarting service |
|
|
223
|
-
| `railway restart -y` | Restart container | External changes |
|
|
224
|
-
| `railway down -y` | Remove deployment | Taking service offline |
|
|
225
|
-
|
|
226
|
-
### Service Commands
|
|
227
|
-
|
|
228
|
-
| Command | Purpose | When to Use |
|
|
229
|
-
|---------|---------|-------------|
|
|
230
|
-
| `railway add --service <name>` | Create service | Adding to project |
|
|
231
|
-
| `railway service link` | Link to service | Switching services |
|
|
232
|
-
| `railway service status` | Check service health | Monitoring |
|
|
233
|
-
| `railway scale` | Adjust replicas | Scaling workloads |
|
|
234
|
-
|
|
235
|
-
### Debugging Commands
|
|
236
|
-
|
|
237
|
-
| Command | Purpose | When to Use |
|
|
238
|
-
|---------|---------|-------------|
|
|
239
|
-
| `railway logs --lines 100` | View deploy logs | Debugging runtime |
|
|
240
|
-
| `railway logs --build --lines 100` | View build logs | Debugging builds |
|
|
241
|
-
| `railway logs --latest` | Latest deployment | Failed deploys |
|
|
242
|
-
| `railway logs --since 1h` | Recent logs | Time-based debugging |
|
|
243
|
-
| `railway ssh` | Access container | Interactive debugging |
|
|
244
|
-
| `railway connect` | Database shell | Database access |
|
|
245
|
-
|
|
246
|
-
## Configuration
|
|
247
|
-
|
|
248
|
-
### Via CLI
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# Set variable
|
|
252
|
-
railway variables set KEY=value
|
|
253
|
-
|
|
254
|
-
# List variables
|
|
255
|
-
railway variables --json
|
|
256
|
-
|
|
257
|
-
# Add domain
|
|
258
|
-
railway domain example.com
|
|
259
|
-
|
|
260
|
-
# Switch environment
|
|
261
|
-
railway environment staging
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Via Environment Config (Advanced)
|
|
265
|
-
|
|
266
|
-
For complex configuration, use the environment staging API. See [06-environments.md](references/06-environments.md) for:
|
|
267
|
-
- Complex variable sets
|
|
268
|
-
- Build command overrides
|
|
269
|
-
- Health check configuration
|
|
270
|
-
- Replica count
|
|
271
|
-
- Watch paths
|
|
272
|
-
|
|
273
|
-
## Project Types
|
|
274
|
-
|
|
275
|
-
### Supported Languages & Frameworks
|
|
276
|
-
|
|
277
|
-
Railway auto-detects and builds:
|
|
278
|
-
|
|
279
|
-
| Type | Detected By | Notes |
|
|
280
|
-
|------|-------------|-------|
|
|
281
|
-
| **Next.js** | `next.config.*` | SSR and static supported |
|
|
282
|
-
| **Vite** | `vite.config.*` | Static sites |
|
|
283
|
-
| **Express/Fastify** | `package.json` | Node.js APIs |
|
|
284
|
-
| **FastAPI** | `main.py` | Python APIs |
|
|
285
|
-
| **Django** | `manage.py` | Python web apps |
|
|
286
|
-
| **Go** | `go.mod` | Compiled binaries |
|
|
287
|
-
| **Rust** | `Cargo.toml` | Compiled binaries |
|
|
288
|
-
| **Docker** | `Dockerfile` | Custom containers |
|
|
289
|
-
| **Static** | `index.html` | Simple sites |
|
|
290
|
-
|
|
291
|
-
### Build Configuration
|
|
292
|
-
|
|
293
|
-
**Default builds work for most projects.** Override when needed:
|
|
294
|
-
|
|
295
|
-
```json
|
|
296
|
-
{
|
|
297
|
-
"services": {
|
|
298
|
-
"my-service": {
|
|
299
|
-
"build": {
|
|
300
|
-
"buildCommand": "npm run build:prod",
|
|
301
|
-
"startCommand": "node dist/server.js"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**See [06-environments.md](references/06-environments.md) for detailed build configuration.**
|
|
309
|
-
|
|
310
|
-
## Advanced Features
|
|
311
|
-
|
|
312
|
-
### Progressive Disclosure
|
|
313
|
-
|
|
314
|
-
This SKILL.md covers common workflows. Load references for detailed guides:
|
|
315
|
-
|
|
316
|
-
| # | Feature | Reference | Load When |
|
|
317
|
-
|---|---------|-----------|-----------|
|
|
318
|
-
| 01 | **Getting Started** | [01-getting-started.md](references/01-getting-started.md) | Installation, auth |
|
|
319
|
-
| 02 | **Projects** | [02-projects.md](references/02-projects.md) | Project management |
|
|
320
|
-
| 03 | **Services** | [03-services.md](references/03-services.md) | Service operations |
|
|
321
|
-
| 04 | **Deployments** | [04-deployments.md](references/04-deployments.md) | Deploy, logs, rollback |
|
|
322
|
-
| 05 | **Databases** | [05-databases.md](references/05-databases.md) | Postgres, Redis, MySQL, Mongo |
|
|
323
|
-
| 06 | **Environments** | [06-environments.md](references/06-environments.md) | Variables, config, staging |
|
|
324
|
-
| 07 | **Domains** | [07-domains.md](references/07-domains.md) | Custom domains & SSL |
|
|
325
|
-
| 08 | **Volumes** | [08-volumes.md](references/08-volumes.md) | Persistent storage |
|
|
326
|
-
| 09 | **Networking** | [09-networking.md](references/09-networking.md) | Private networking, TCP |
|
|
327
|
-
| 10 | **Cron** | [10-cron.md](references/10-cron.md) | Scheduled jobs |
|
|
328
|
-
| 11 | **Functions** | [11-functions.md](references/11-functions.md) | Railway Functions |
|
|
329
|
-
| 12 | **Monorepo** | [12-monorepo.md](references/12-monorepo.md) | Workspace patterns |
|
|
330
|
-
| 13 | **Troubleshooting** | [13-troubleshooting.md](references/13-troubleshooting.md) | Common errors & fixes |
|
|
331
|
-
| 14 | **Railway Metal** | [14-railway-metal.md](references/14-railway-metal.md) | Migration guide |
|
|
332
|
-
|
|
333
|
-
### Databases
|
|
334
|
-
|
|
335
|
-
Railway provides managed databases via templates:
|
|
336
|
-
|
|
337
|
-
| Database | Template Code | Connection Variable |
|
|
338
|
-
|----------|---------------|-------------------|
|
|
339
|
-
| **PostgreSQL** | `postgres` | `DATABASE_URL` |
|
|
340
|
-
| **Redis** | `redis` | `REDIS_URL` |
|
|
341
|
-
| **MySQL** | `mysql` | `MYSQL_URL` |
|
|
342
|
-
| **MongoDB** | `mongodb` | `MONGO_URL` |
|
|
343
|
-
|
|
344
|
-
**See [05-databases.md](references/05-databases.md) for deployment and wiring patterns.**
|
|
345
|
-
|
|
346
|
-
### Networking
|
|
347
|
-
|
|
348
|
-
**Public networking:**
|
|
349
|
-
- Automatic HTTPS via Railway domains
|
|
350
|
-
- Custom domains with SSL
|
|
351
|
-
- No bandwidth limits
|
|
352
|
-
|
|
353
|
-
**Private networking:**
|
|
354
|
-
- Service-to-service communication
|
|
355
|
-
- No egress charges
|
|
356
|
-
- Uses `RAILWAY_PRIVATE_DOMAIN`
|
|
357
|
-
|
|
358
|
-
**See networking reference for configuration.**
|
|
359
|
-
|
|
360
|
-
## Troubleshooting
|
|
361
|
-
|
|
362
|
-
### Common Issues
|
|
363
|
-
|
|
364
|
-
**"No project linked"**
|
|
365
|
-
```bash
|
|
366
|
-
# Solution: Link or initialize
|
|
367
|
-
railway link -p project-name
|
|
368
|
-
# or
|
|
369
|
-
railway init -n new-project
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
**"Build failed"**
|
|
373
|
-
```bash
|
|
374
|
-
# Check build logs
|
|
375
|
-
railway logs --build --lines 100
|
|
376
|
-
|
|
377
|
-
# Common fixes:
|
|
378
|
-
# - Missing dependencies: check package.json/requirements.txt
|
|
379
|
-
# - Wrong build command: see railpack reference
|
|
380
|
-
# - Out of memory: add NODE_OPTIONS="--max-old-space-size=4096"
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
**"Service crashed"**
|
|
384
|
-
```bash
|
|
385
|
-
# Check runtime logs
|
|
386
|
-
railway logs --lines 100
|
|
387
|
-
|
|
388
|
-
# Common causes:
|
|
389
|
-
# - Port not using $PORT env var
|
|
390
|
-
# - Missing start command
|
|
391
|
-
# - Runtime dependencies missing
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
**"Database connection refused"**
|
|
395
|
-
```bash
|
|
396
|
-
# Verify:
|
|
397
|
-
# 1. Database service is running
|
|
398
|
-
# 2. Using correct DATABASE_URL reference
|
|
399
|
-
# 3. Both services in same environment
|
|
400
|
-
# 4. Database finished initializing
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
### Error Reference
|
|
404
|
-
|
|
405
|
-
| Error | Meaning | Solution |
|
|
406
|
-
|-------|---------|----------|
|
|
407
|
-
| `cli_missing` | Railway CLI not installed | `npm install -g @railway/cli` |
|
|
408
|
-
| `not_authenticated` | Not logged in | `railway login` |
|
|
409
|
-
| `not_linked` | No project linked | `railway link` or `railway init` |
|
|
410
|
-
| `build_failed` | Build error | Check build logs |
|
|
411
|
-
| `deploy_failed` | Deploy error | Check service logs |
|
|
412
|
-
| `no_service` | Service not found | Check `railway status` |
|
|
413
|
-
|
|
414
|
-
## Scripts & Utilities
|
|
415
|
-
|
|
416
|
-
This skill includes shared utilities in `_shared/scripts/`:
|
|
417
|
-
|
|
418
|
-
### railway-api.sh
|
|
419
|
-
|
|
420
|
-
GraphQL API helper for advanced operations:
|
|
421
|
-
|
|
422
|
-
```bash
|
|
423
|
-
# Usage
|
|
424
|
-
source _shared/scripts/railway-api.sh
|
|
425
|
-
|
|
426
|
-
# Make API call
|
|
427
|
-
railway_api '<query>' '<variables>'
|
|
428
|
-
|
|
429
|
-
# Get project context
|
|
430
|
-
get_project_context
|
|
431
|
-
|
|
432
|
-
# Fetch environment config
|
|
433
|
-
fetch_env_config
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
### railway-common.sh
|
|
437
|
-
|
|
438
|
-
Common CLI utilities:
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
# Usage
|
|
442
|
-
source _shared/scripts/railway-common.sh
|
|
443
|
-
|
|
444
|
-
# Preflight checks
|
|
445
|
-
railway_preflight
|
|
446
|
-
|
|
447
|
-
# Check if linked
|
|
448
|
-
check_railway_linked
|
|
449
|
-
|
|
450
|
-
# Detect project type
|
|
451
|
-
detect_project_type
|
|
452
|
-
|
|
453
|
-
# Detect monorepo type
|
|
454
|
-
detect_monorepo_type
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
## Best Practices
|
|
458
|
-
|
|
459
|
-
### 1. Always Use Commit Messages
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
# Good
|
|
463
|
-
railway up --detach -m "Fix user authentication bug"
|
|
464
|
-
|
|
465
|
-
# Bad (no context)
|
|
466
|
-
railway up --detach
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
### 2. Check Status Before Operations
|
|
470
|
-
|
|
471
|
-
```bash
|
|
472
|
-
# Always verify context first
|
|
473
|
-
railway status --json
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
### 3. Use References for Complex Config
|
|
477
|
-
|
|
478
|
-
Don't overload SKILL.md - load appropriate reference files for:
|
|
479
|
-
- Monorepo setup
|
|
480
|
-
- Complex environment configuration
|
|
481
|
-
- Database wiring
|
|
482
|
-
- Advanced networking
|
|
483
|
-
|
|
484
|
-
### 4. Progressive Loading
|
|
485
|
-
|
|
486
|
-
This skill uses progressive disclosure:
|
|
487
|
-
- **SKILL.md:** Common workflows (~500 lines)
|
|
488
|
-
- **Shared references:** Patterns used across skills
|
|
489
|
-
- **Skill-specific refs:** Detailed domain knowledge
|
|
490
|
-
- **Scripts:** Executable utilities
|
|
491
|
-
|
|
492
|
-
### 5. Keep Secrets Encrypted
|
|
493
|
-
|
|
494
|
-
```bash
|
|
495
|
-
# Set encrypted variable
|
|
496
|
-
railway variables set SECRET_KEY=value
|
|
497
|
-
# Mark as encrypted in dashboard
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
## Resources
|
|
501
|
-
|
|
502
|
-
- **Documentation:** https://docs.railway.com/api/llms-docs.md
|
|
503
|
-
- **Templates:** https://railway.com/llms-templates.md
|
|
504
|
-
- **Support:** https://station.railway.com
|
|
505
|
-
|
|
506
|
-
**Load appropriate references for specific domains rather than reading everything.**
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Railway GraphQL API Helper
|
|
3
|
-
# Shared utility for all Railway skills
|
|
4
|
-
# Usage: source _shared/scripts/railway-api.sh && railway_api '<query>' ['<variables-json>']
|
|
5
|
-
# Or: ${SKILL_ROOT}/_shared/scripts/railway-api.sh '<query>' ['<variables-json>']
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
RAILWAY_API_ENDPOINT="https://backboard.railway.com/graphql/v2"
|
|
10
|
-
RAILWAY_CONFIG_FILE="${HOME}/.railway/config.json"
|
|
11
|
-
|
|
12
|
-
# Check if jq is installed
|
|
13
|
-
check_jq() {
|
|
14
|
-
if ! command -v jq &>/dev/null; then
|
|
15
|
-
echo '{"error": "jq not installed. Install with: brew install jq or apt-get install jq"}' >&2
|
|
16
|
-
return 1
|
|
17
|
-
fi
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
# Get Railway token from config
|
|
21
|
-
get_railway_token() {
|
|
22
|
-
if [[ ! -f "$RAILWAY_CONFIG_FILE" ]]; then
|
|
23
|
-
echo '{"error": "Railway config not found. Run: railway login"}' >&2
|
|
24
|
-
return 1
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
local token
|
|
28
|
-
token=$(jq -r '.user.token // empty' "$RAILWAY_CONFIG_FILE" 2>/dev/null)
|
|
29
|
-
|
|
30
|
-
if [[ -z "$token" ]]; then
|
|
31
|
-
echo '{"error": "No Railway token found. Run: railway login"}' >&2
|
|
32
|
-
return 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
echo "$token"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# Make GraphQL API call
|
|
39
|
-
# Usage: railway_api '<graphql-query>' ['<variables-json>']
|
|
40
|
-
railway_api() {
|
|
41
|
-
local query="${1:-}"
|
|
42
|
-
local variables="${2:-{}}"
|
|
43
|
-
|
|
44
|
-
# Validate inputs
|
|
45
|
-
if [[ -z "$query" ]]; then
|
|
46
|
-
echo '{"error": "No GraphQL query provided"}' >&2
|
|
47
|
-
return 1
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
# Check dependencies
|
|
51
|
-
check_jq || return 1
|
|
52
|
-
|
|
53
|
-
local token
|
|
54
|
-
token=$(get_railway_token) || return 1
|
|
55
|
-
|
|
56
|
-
# Build payload
|
|
57
|
-
local payload
|
|
58
|
-
payload=$(jq -n --arg q "$query" --argjson v "$variables" '{query: $q, variables: $v}')
|
|
59
|
-
|
|
60
|
-
# Make API call
|
|
61
|
-
curl -s -f "$RAILWAY_API_ENDPOINT" \
|
|
62
|
-
-H "Authorization: Bearer $token" \
|
|
63
|
-
-H "Content-Type: application/json" \
|
|
64
|
-
-d "$payload" || {
|
|
65
|
-
echo '{"error": "API request failed"}' >&2
|
|
66
|
-
return 1
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
# Get project context from linked directory
|
|
71
|
-
get_project_context() {
|
|
72
|
-
if ! command -v railway &>/dev/null; then
|
|
73
|
-
echo '{"error": "Railway CLI not installed"}' >&2
|
|
74
|
-
return 1
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
railway status --json 2>/dev/null || {
|
|
78
|
-
echo '{"error": "No project linked. Run: railway link"}' >&2
|
|
79
|
-
return 1
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
# Extract project ID from context
|
|
84
|
-
get_project_id() {
|
|
85
|
-
local context
|
|
86
|
-
context=$(get_project_context) || return 1
|
|
87
|
-
echo "$context" | jq -r '.project.id'
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
# Extract environment ID from context
|
|
91
|
-
get_environment_id() {
|
|
92
|
-
local context
|
|
93
|
-
context=$(get_project_context) || return 1
|
|
94
|
-
echo "$context" | jq -r '.environment.id'
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
# Extract service ID from context
|
|
98
|
-
get_service_id() {
|
|
99
|
-
local context
|
|
100
|
-
context=$(get_project_context) || return 1
|
|
101
|
-
echo "$context" | jq -r '.service.id // empty'
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# Fetch environment configuration
|
|
105
|
-
fetch_env_config() {
|
|
106
|
-
local env_id
|
|
107
|
-
env_id=$(get_environment_id) || return 1
|
|
108
|
-
|
|
109
|
-
local query='
|
|
110
|
-
query environmentConfig($environmentId: String!) {
|
|
111
|
-
environment(id: $environmentId) {
|
|
112
|
-
id
|
|
113
|
-
config(decryptVariables: false)
|
|
114
|
-
serviceInstances {
|
|
115
|
-
edges {
|
|
116
|
-
node {
|
|
117
|
-
id
|
|
118
|
-
serviceId
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}'
|
|
124
|
-
|
|
125
|
-
railway_api "$query" "{\"environmentId\": \"$env_id\"}"
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
# Stage environment changes
|
|
129
|
-
stage_changes() {
|
|
130
|
-
local env_id="${1:-}"
|
|
131
|
-
local config="${2:-}"
|
|
132
|
-
|
|
133
|
-
if [[ -z "$env_id" || -z "$config" ]]; then
|
|
134
|
-
echo '{"error": "Environment ID and config required"}' >&2
|
|
135
|
-
return 1
|
|
136
|
-
fi
|
|
137
|
-
|
|
138
|
-
local query='
|
|
139
|
-
mutation stageEnvironmentChanges(
|
|
140
|
-
$environmentId: String!
|
|
141
|
-
$input: EnvironmentConfig!
|
|
142
|
-
$merge: Boolean
|
|
143
|
-
) {
|
|
144
|
-
environmentStageChanges(
|
|
145
|
-
environmentId: $environmentId
|
|
146
|
-
input: $input
|
|
147
|
-
merge: $merge
|
|
148
|
-
) {
|
|
149
|
-
id
|
|
150
|
-
}
|
|
151
|
-
}'
|
|
152
|
-
|
|
153
|
-
railway_api "$query" "{\"environmentId\": \"$env_id\", \"input\": $config, \"merge\": true}"
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
# Apply staged changes
|
|
157
|
-
apply_changes() {
|
|
158
|
-
local env_id="${1:-}"
|
|
159
|
-
local message="${2:-}"
|
|
160
|
-
|
|
161
|
-
if [[ -z "$env_id" ]]; then
|
|
162
|
-
echo '{"error": "Environment ID required"}' >&2
|
|
163
|
-
return 1
|
|
164
|
-
fi
|
|
165
|
-
|
|
166
|
-
local query='
|
|
167
|
-
mutation commitStaged($environmentId: String!, $message: String) {
|
|
168
|
-
environmentPatchCommitStaged(
|
|
169
|
-
environmentId: $environmentId
|
|
170
|
-
commitMessage: $message
|
|
171
|
-
)
|
|
172
|
-
}'
|
|
173
|
-
|
|
174
|
-
railway_api "$query" "{\"environmentId\": \"$env_id\", \"message\": \"$message\"}"
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
# Execute if called directly
|
|
178
|
-
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
179
|
-
railway_api "$@"
|
|
180
|
-
fi
|