Agent skill
Cloudflare
Deploy Cloudflare Workers/Pages. USE WHEN Cloudflare, worker, deploy, Pages, MCP server. SkillSearch('cloudflare') for docs.
Install this agent skill to your Project
npx add-skill https://github.com/Steffen025/pai-opencode/tree/main/.opencode/skills/Utilities/Cloudflare
SKILL.md
Customization
Before executing, check for user customizations at:
~/.opencode/PAI/USER/SKILLCUSTOMIZATIONS/Cloudflare/
If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.
🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)
You MUST send this notification BEFORE doing anything else when this skill is invoked.
-
Send voice notification:
bashcurl -s -X POST http://localhost:8888/notify \ -H "Content-Type: application/json" \ -d '{"message": "Running the WORKFLOWNAME workflow in the Cloudflare skill to ACTION"}' \ > /dev/null 2>&1 & -
Output text notification:
Running the **WorkflowName** workflow in the **Cloudflare** skill to ACTION...
This is not optional. Execute this curl command immediately upon skill invocation.
Cloudflare Skill
Deploy and manage Cloudflare Workers, MCP servers, and Pages.
Workflow Routing
When executing a workflow, output this notification directly:
Running the **WorkflowName** workflow in the **Cloudflare** skill to ACTION...
- Create MCP server or Worker →
Workflows/Create.md - Troubleshoot deployment issues →
Workflows/Troubleshoot.md
Quick Reference
- Account ID: Set via
CF_ACCOUNT_IDenvironment variable - Worker URL format:
https://[worker-name].[your-subdomain].workers.dev
Deployment Commands
Workers Deployment
# Unset tokens that interfere with wrangler login-based auth
(unset CF_API_TOKEN && unset CLOUDFLARE_API_TOKEN && wrangler deploy)
Pages Deployment
🚨 CRITICAL: ALL env tokens lack Pages permissions. MUST unset them to use OAuth:
# ALWAYS unset tokens for Pages - OAuth login works, tokens don't
(unset CF_API_TOKEN && unset CLOUDFLARE_API_TOKEN && npx wrangler pages deploy dist --project-name=PROJECT_NAME --commit-dirty=true)
Known Pages Projects:
| Project | Directory | Deploy Command |
|---|---|---|
| [project] | ~/Projects/[project] |
(unset CF_API_TOKEN && unset CLOUDFLARE_API_TOKEN && npx wrangler pages deploy dist --project-name=[project] --commit-dirty=true) |
Critical Notes
- Workers: Unset
CF_API_TOKENandCLOUDFLARE_API_TOKENbefore deploying - they interfere with wrangler login-based auth - Pages: 🚨 UNSET ALL TOKENS - None of the API tokens have Pages permissions. OAuth-based wrangler login is the ONLY method that works.
Examples
Example 1: Deploy a Worker
User: "deploy the MCP server to Cloudflare"
→ Invokes CREATE workflow
→ Unsets env tokens, runs wrangler deploy
→ "Deployed to https://mcp-server.[subdomain].workers.dev"
Example 2: Deploy Pages site
User: "deploy my-app to Cloudflare"
→ Builds dist/, unsets tokens
→ Runs wrangler pages deploy
→ "Deployed my-app to Cloudflare Pages"
Example 3: Fix deployment error
User: "Cloudflare deploy is failing with auth error"
→ Invokes TROUBLESHOOT workflow
→ Identifies token interference
→ "Fixed - tokens were overriding OAuth. Redeployed successfully."
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
PAI
USMetrics
US metrics, economic indicators and data tracking. USE WHEN US metrics, American data, statistics, demographics, GDP, inflation, unemployment, economic metrics, gas prices.
Research
Comprehensive research and content extraction. USE WHEN research, investigate, extract wisdom, analyze content. For OSINT use OSINT skill.
Agents
Dynamic agent composition. USE WHEN custom agents, agent personalities, traits, voices.
Investigation
Investigation and research skills. USE WHEN investigate, research person, company intel, due diligence, OSINT, background check.
OSINT
Open source intelligence gathering. USE WHEN OSINT, due diligence, background check, research person, company intel, investigate. SkillSearch('osint') for docs.
Didn't find tool you were looking for?