deploy-cloudflare
Skill0 starsChanged 9 months agoMITView on GitHub
Use this skill when the user asks to "deploy to Cloudflare", "deploy to Cloudflare Pages", "deploy to Cloudflare Workers", "host my site on Cloudflare", or when invoked by deploy-project for edge/static frontend deployment. Handles two modes: Cloudflare Pages (for SPAs, static sites, SSR) and Cloudflare Workers (for edge functions/serverless). Uses wrangler CLI. Free tier: Pages - unlimited requests; Workers - 10 million requests/month.
- Installs packages
- Sends data out
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ominou5/funnel-architect-plugintheir own version, first seen Feb 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ominou5/funnel-architect-plugin★ 86same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- deploy-logSkill
- deploy-neonSkill
- deploy-netlifySkill
- deploy-projectSkill
- deploy-renderSkill
- deploy-supabaseSkill
- deploy-upstashSkill
- deploy-vercelSkill
- scan-projectSkill
- setup-authSkill
- setup-cicdSkill
- verify-deploymentSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use Pages if ANY of:
- Very specific: line 37
Check in order: dist/, build/, .next/, out/, .svelte-kit/output/client/, public/.
- Distinctive: line 38
Use first directory that exists.
- Distinctive: line 85
If not present, create a minimal one:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy to Cloudflare
Two modes — detect which applies:
- Cloudflare Pages: for static sites, SPAs (React/Vite), and SSR frameworks (Next.js, SvelteKit, Astro)
- Cloudflare Workers: for edge functions, serverless API handlers, or projects with
wrangler.toml
Detect Mode
Use Pages if ANY of:
- No
wrangler.tomlexists AND project has frontend framework (React, Vite, Astro, SvelteKit) wrangler.tomlhas[pages]section
Use Workers if:
wrangler.tomlexists withmainfield pointing to a JS/TS entry file- Project has edge function patterns (no HTML entry, pure JS handler)
Prerequisites
- wrangler CLI installed:
wrangler --version(install:npm install -g wrangler) - Logged in:
wrangler whoami(run setup-auth if not)
Cloudflare Pages Deployment
1. Build the project
cd <frontend-dir>
npm run build # or detected build command2. Detect output directory
Check in order: dist/, build/, .next/, out/, .svelte-kit/output/client/, public/.
Use first directory that exists.
3. Deploy to Pages
PROJECT_NAME=$(basename $(pwd) | tr '[:upper:]' '[:lower:]' | tr '_' '-')
wrangler pages deploy <output-dir> \
--project-name "$PROJECT_NAME" \
--commit-dirty=true
# First deploy: creates the project automatically4. Set environment variables via Cloudflare API
wrangler CLI has limited env var support for Pages — use the API:
ACCOUNT_ID=$(wrangler whoami --json 2>/dev/null | python3 -c "
import sys,json
try: print(json.load(sys.stdin)['accounts'][0]['id'])
except: pass
")
# Use CLOUDFLARE_API_TOKEN env var (set by setup-auth or wrangler login)
CF_TOKEN="${CLOUDFLARE_API_TOKEN:-$(wrangler whoami --json 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('api_token',''))" 2>/dev/null)}"
if [ -z "$CF_TOKEN" ]; then
echo "⚠ CLOUDFLARE_API_TOKEN not set. Set it in your environment or run: wrangler login"
echo " Then export CLOUDFLARE_API_TOKEN=<your-token>"
exit 1
fi
curl -s -X PATCH \
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/$PROJECT_NAME" \
-H "Authorization: Bearer $CF_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"deployment_configs\":{\"production\":{\"env_vars\":{\"VITE_API_URL\":{\"value\":\"$BACKEND_URL\",\"type\":\"plain_text\"}}}}}"5. Get deployed URL
CF_URL="https://$PROJECT_NAME.pages.dev"
echo "✓ Deployed: $CF_URL"Cloudflare Workers Deployment
1. Ensure wrangler.toml exists
If not present, create a minimal one:
name = "<worker-name>"
main = "src/index.ts"
compatibility_date = "2024-01-01"2. Set secrets (interactive)
wrangler secret put DATABASE_URL
# Prompts for value — tell user what to paste3. Deploy
wrangler deploy4. Get worker URL
CF_URL=$(wrangler deploy 2>&1 | grep -oP 'https://[^\s]+\.workers\.dev' | head -1)
if [ -z "$CF_URL" ]; then
echo "⚠ Could not extract worker URL from deploy output. Check https://dash.cloudflare.com"
fi
echo "✓ Worker deployed: $CF_URL"Save and Export
cat >> DEPLOYMENT_DOCS/DEPLOYED_ENV.md << EOF
## Cloudflare
CF_URL=$CF_URL
CF_PROJECT_NAME=$PROJECT_NAME
EOF
chmod 600 DEPLOYMENT_DOCS/DEPLOYED_ENV.md 2>/dev/null || trueExport: CF_URL for CI/CD setup and env var wiring.
Free Tier Notes
- Cloudflare Pages: unlimited requests, 500 builds/month
- Cloudflare Workers: 10 million requests/month, 10ms CPU time per request
- Both are genuinely free with no credit card required for these limits
On Failure
- Pages deploy fails: verify the output directory exists and has an
index.html - Workers deploy fails: check
wrangler.tomlsyntax, verifymainfile exists - API env var set fails: verify ACCOUNT_ID and CF_TOKEN are correct
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

