worca-railway
Operate a hosted worca on Railway behind Cloudflare Access — status, logs, upgrade/rollback to a released image, deploy the current branch as a test image, set or remove service variables (Claude token, mock mode, GitHub App/tokens, clone allowlist) without exposing values, verify an instance end to end (Access, bypass refusal, agent isolation, GitHub credential, optional clone), and ssh into it. Triggers on "worca-railway", "deploy worca to railway", "upgrade the hosted worca", "verify the deployment", "set the Claude token on railway", "turn mock off on railway", or any request to operate, debug, configure or validate a hosted worca instance.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 56
- Forks
- 28
01 前言 Front Matter
- name
- worca-railway
- description
- Operate a hosted worca on Railway behind Cloudflare Access — status, logs, upgrade/rollback to a released image, deploy the current branch as a test image, set or remove service variables (Claude token, mock mode, GitHub App/tokens, clone allowlist) without exposing values, verify an instance end to end (Access, bypass refusal, agent isolation, GitHub credential, optional clone), and ssh into it. Triggers on "worca-railway", "deploy worca to railway", "upgrade the hosted worca", "verify the deployment", "set the Claude token on railway", "turn mock off on railway", or any request to operate, debug, configure or validate a hosted worca instance.
03 SKILL.md 正文
Operate a hosted worca on Railway
Everything runs through one generic tool, tools/railway/worca-railway.mjs. It knows
nothing about any particular deployment: every id, hostname and key path comes from a
target file on the operator's machine, ~/.config/worca/targets/<name>.env
(template: tools/railway/targets.example.env). The reference for what each step
means is docs/deploy-railway.md ("Operate your deployment"); read it when something
here does not fit, and do not restate it to the user.
Usage: /worca-railway [<target>] [<action> …]. No target named: run targets,
and ask which one if there is more than one. No action: run status.
Hard rules
- Never read, print or paste a secret. Do not open target secret files,
*.envfiles the user keeps secrets in, or any file a*_FILEentry points to. Never runrailway variable listwithout--json,railway variables,railway variable list --kv, or anything else that prints values. The tool lists names only. - Values reach Railway only through stdin. For a secret, ask the user to run the
command themselves with the value piped in (below), or use
--from-file <path>with a path they give you. Never put a value on a command line, and never type one into a file you create. - Every change needs the user's go-ahead in chat, then
--yes. Upgrade, rollback, deploy-branch, redeploy, set, unset and mock all restart the service; running agents pause and must be resumed. Say what will restart before asking. - Always through the tool, never bare
railwaycommands: the tool passes--service/--environment/--projectexplicitly, so a folder linked to the cloudflared service can never receive the worca service's variables. - Targets belong to their owner. Do not create or edit a target file for a deployment the user has not described, and never commit one. Access to a deployment is controlled by Railway and Cloudflare membership, not by this skill.
Actions
Run from the repository root: node tools/railway/worca-railway.mjs <command> <target> …
| Goal | Command |
|---|---|
| What is deployed, is it healthy, which variables exist | status <t> |
| Recent log lines (redacted) | logs <t> [--lines 200] |
| Upgrade to a released version | upgrade <t> 1.5.0 --yes (or a full registry/repo:tag; :latest is refused) |
| Undo the last upgrade | rollback <t> --yes (uses ~/.config/worca/targets/<t>.history) |
| Test the current checkout on the instance | deploy-branch <t> --tag <tag> --yes (builds linux/amd64, pushes to BRANCH_IMAGE_REPO, deploys; needs docker login to that registry) |
| Restart without changes | redeploy <t> --yes |
| Mock mode | mock <t> off --yes / mock <t> on --yes |
| A non-secret variable | printf %s 'github.com/acme/*' | node tools/railway/worca-railway.mjs set <t> WORCA_CLONE_ALLOW --yes |
| Remove a variable | unset <t> KEY --yes |
| Several changes, one restart | add --skip-deploys to each set/unset, then redeploy <t> --yes |
| Check everything | verify <t> --in-container (add --clone https://github.com/<owner>/<repo> to test a real clone) |
| A shell or one command in the container | ssh <t> prints the command; ssh <t> -- <command> runs one |
Secrets: the user runs these
Give the user the exact command and let them run it in their own terminal (the value never enters the conversation):
- Claude token (real runs; agents run as
worca-agentand need it as a variable):claude setup-token, then paste it intonode tools/railway/worca-railway.mjs set <t> CLAUDE_CODE_OAUTH_TOKEN --yes(the tool reads it from stdin). Thenmock <t> off --yes. - GitHub App key (new or rotated):
base64 < app.private-key.pem | tr -d '\n' | node tools/railway/worca-railway.mjs set <t> WORCA_GH_APP_KEY_B64 --yes, plusWORCA_GH_APP_ID/WORCA_GH_APP_INSTALLATION_IDthe same way. - Tokens instead of an App:
set <t> GH_TOKEN, orWORCA_GH_READ_TOKENandWORCA_GH_WRITE_TOKEN, thenunsettheWORCA_GH_APP_*variables.
After any secret: remind them to seal it in the Railway dashboard (the CLI has no
seal option), and run status <t>: a variable whose value Railway no longer returns shows
(sealed). If a secret the user sealed is not marked, say so and ask them to check it in the
dashboard.
With a credential broker
A target with RAILWAY_BROKER_SERVICE, RAILWAY_BROKER_SERVICE_ID and KEYS_URL has a
second service holding the model keys (docs/credential-broker.md). Then:
upgrade,rollbackanddeploy-branchmove both services to the same image, the broker first; if the broker does not come up, worca is left alone.logs,redeploy,setandunsettake--service broker.- Model keys never go on worca:
set <t> ANTHROPIC_API_KEY(or the OAuth token, OpenAI, OpenRouter) is refused. In multi mode each person adds their own key on the key page; in single mode it isWORCA_BROKER_KEY_ANTHROPICon--service broker. - The broker's secrets, set by the user from stdin on BOTH services where named:
WORCA_BROKER_SECRET(worca and broker, the same value) andWORCA_BROKER_VAULT_KEY(broker only).docker run --rm <image> worca broker secretsprints fresh ones. statusshows the broker's image (and warns when it differs from worca's) and its variable names;verifyadds the key page checks (behind Access, the broker answers, worca names it) and, with--in-container, that no model key is in worca's environment, the broker refuses an agent with no token, and one person's agent user cannot read another's processes.
Procedures
- Upgrade:
status→ confirm the version with the user →upgrade … --yes→verify <t> --in-container→ tell them to resume paused runs. On a failed deploy:logs, then offerrollback. - Test a branch:
deploy-branch <t> --tag <branch-or-pr>-<n> --yes→verify <t> --in-container. Say that the instance now runs an unreleased image and thatupgrade <t> <version>returns it to a release. - Debug:
status,logs, thenverify <t> --in-container; the probe's FAIL lines name the broken layer (Access, bypass refusal, users, agent isolation, GitHub). Match the symptom against the troubleshooting table indocs/deploy-railway.md. - New target: have the user copy
tools/railway/targets.example.envto~/.config/worca/targets/<name>.env(chmod 600) and fill it in; ids come from the Railway dashboard URL orrailway status --json. The Access service token goes in its own 0600 file (two lines,CF_ACCESS_CLIENT_ID=/CF_ACCESS_CLIENT_SECRET=), which the user writes. Thenstatus <name>andverify <name> --in-container.
Report results plainly: what changed, the deployment status, the verify summary, and anything the user must do by hand (seal a variable, resume runs, add a person in the Access policy).
04 同仓库更多 Skills
gamma
Ships a plugin manifest a skill must not have.
delta-plugin-root
Calls a helper that lives elsewhere in its plugin.
beta-scripts
Collects build facts with a script and summarizes them.
alpha
Writes a short status note for the current branch.
mock-skill
Trivial helper skill shipped by the mock-source fixture plugin. Runs helper.sh.
worca
Run the node-graph multi-agent orchestrator over a software task in the current project. Triggers on "/worca", "/worca <prompt>", "/worca --ui", and on requests to orchestrate, run the orchestration pipeline, or drive plan/refine/implement/review for a task.