一键导入
worker-deployment
Use when deploying or updating the worker on Cloudflare and validating production health and auth behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when deploying or updating the worker on Cloudflare and validating production health and auth behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when deploying pigeon code changes across all machines after merging to main
Use when you need to understand worker architecture, endpoint flow, and command routing behavior before making changes
Use when you need to understand daemon route flow, storage model, worker connectivity, and command injection architecture before making changes
Use when you need to understand the OpenCode plugin event lifecycle, session state transitions, and daemon API contracts
Use when developing or refactoring OpenCode plugin handlers, tests, and daemon integration payloads
Use when you need to understand the swarm IPC subsystem — tables, routes, the per-target arbiter, the session→directory registry, and the wire envelope — before changing it
| name | worker-deployment |
| description | Use when deploying or updating the worker on Cloudflare and validating production health and auth behavior |
Use this skill when releasing worker changes or validating production deploy safety.
~/projects/pigeonpackages/workerCLOUDFLARE_API_TOKEN)On devbox, prefer:
export CLOUDFLARE_API_TOKEN="$(cat /run/secrets/cloudflare_api_token)"
cd ~/projects/pigeon
npm run --workspace @pigeon/worker deploy
The worker requires an R2 bucket named pigeon-media for media relay. This is a one-time setup:
npx wrangler r2 bucket create pigeon-media
The binding is configured in wrangler.toml:
[[r2_buckets]]
binding = "MEDIA"
bucket_name = "pigeon-media"
If the bucket doesn't exist, deploy will succeed but media upload/download will fail at runtime.
The worker uses D1 (Cloudflare's serverless SQLite) for state. The database pigeon-router is configured in wrangler.toml.
Schema is at packages/worker/src/d1-schema.sql. To apply schema changes:
npx wrangler d1 execute pigeon-router --remote --file=packages/worker/src/d1-schema.sql
To inspect production data:
npx wrangler d1 execute pigeon-router --remote --command "SELECT * FROM machines"
curl -s https://ccr-router.jonathan-mohrbacher.workers.dev/health
Expected: ok
curl -s -H "Authorization: Bearer $(cat /run/secrets/ccr_api_key)" \
"https://ccr-router.jonathan-mohrbacher.workers.dev/sessions"
Note:
TELEGRAM_WEBHOOK_SECRETis a worker-only Cloudflare secret, not in sops. Set it manually:export TELEGRAM_WEBHOOK_SECRET="<value>"before running.
curl -s -o /tmp/webhook-auth-check.txt -w "%{http_code}" \
-X POST \
-H "Content-Type: application/json" \
-H "X-Telegram-Bot-Api-Secret-Token: $TELEGRAM_WEBHOOK_SECRET" \
"https://ccr-router.jonathan-mohrbacher.workers.dev/webhook/telegram/parity" \
--data '{"update_id":999999001}'
Expected: HTTP 200.
Run these in order:
curl -s https://ccr-router.jonathan-mohrbacher.workers.dev/health
curl -s -o /tmp/deploy_sessions.json -w "%{http_code}" -H "Authorization: Bearer $(cat /run/secrets/ccr_api_key)" "https://ccr-router.jonathan-mohrbacher.workers.dev/sessions"
Expected:
ok/sessions returns HTTP 200Also verify the cron trigger is active (visible in deploy output as schedule: 0 * * * *). This runs hourly R2 media cleanup.