Agent skill
cloudflare-workers
Install this agent skill to your Project
npx add-skill https://github.com/JoernStoehler/ai-forecasting-hackathon/tree/main/.claude/skills/cloudflare-workers
SKILL.md
Cloudflare Workers Deployment
Quick reference for deploying Cloudflare Workers in this project.
Project Structure
- Worker code:
packages/share-worker/ - Config:
packages/share-worker/wrangler.toml - Uses wrangler v4 (NOT v3)
Key Commands
# Login to Cloudflare (interactive, opens browser)
npm run worker:login
# Local development
npm run worker:dev
# Deploy to production
npm run worker:deploy
First-Time Setup
- Login:
npm run worker:login- opens browser for OAuth - Register workers.dev subdomain: Visit https://dash.cloudflare.com/?to=/:account/workers-and-pages and click "Change" next to "Your subdomain"
- Create KV namespace (if needed):
bash
npx wrangler kv namespace create NAMESPACE_NAME npx wrangler kv namespace create NAMESPACE_NAME --preview - Update wrangler.toml with the returned KV IDs
- Deploy:
npm run worker:deploy
Official Documentation
Essential pages (always check these for current info):
- Wrangler CLI: https://developers.cloudflare.com/workers/wrangler/
- Wrangler Commands: https://developers.cloudflare.com/workers/wrangler/commands/
- Configuration (wrangler.toml): https://developers.cloudflare.com/workers/wrangler/configuration/
- workers.dev Routing: https://developers.cloudflare.com/workers/configuration/routing/workers-dev/
- KV Storage: https://developers.cloudflare.com/kv/
- Environment Variables: https://developers.cloudflare.com/workers/configuration/environment-variables/
Production Worker
URL: https://share-worker.joern-stoehler.workers.dev
CORS Policy
The worker allows all origins because:
- It only stores/retrieves game state (no sensitive data)
- The game may run from various hosts (AI Studio, Claude/ChatGPT artifacts, localhost)
- Game state has 30-day TTL and is not authentication-protected
Common Issues
"You need to register a workers.dev subdomain"
Run npx wrangler deploy - it will prompt you or auto-register.
KV namespace not found
Create namespaces with npx wrangler kv namespace create and update wrangler.toml with the IDs.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
orchestrate-subagents
Orchestrate parallel and/or sequential subagents working in separate git worktrees to deliver PR(s). Use when bundling multiple related GitHub issues into a single task, running best-of-3 identical attempts, monitoring runs, selecting the best PR, and closing/cleaning up the rest.
git-worktrees
Create, list, and remove git worktrees for parallel agent work. Use when you need isolated workdirs, new worktree branches, or safe cleanup workflows.
write-skills
Create or update SKILL.md files for this repo. Use when authoring skills in .claude/skills/.
write-gh-issues-prs
[DEPRECATED] This skill is no longer used. Feature tracking has migrated to PROJECT.md.
maintain-environment
Maintain the repo devcontainer environment and related workflow files. Use when changing .devcontainer or environment setup scripts.
ui-development
Autonomous screenshot-based UI development workflow for React/Tailwind webapps. Use when (1) implementing new UI components or pages, (2) modifying existing visual elements or styles, (3) fixing visual bugs or dark mode issues, (4) updating layouts or responsive design, (5) changing colors, typography, or spacing. Always triggers for CSS/styling work and React component visual changes.
Didn't find tool you were looking for?