skills/cloudflare-pages/SKILL.md
Deploy static sites to Cloudflare Pages with custom domains and CI/CD. Use when the user wants to deploy a site to Cloudflare Pages, add a custom domain to a Pages project, set up GitHub Actions CI/CD for Cloudflare Pages, roll back a deployment, or verify deployment status. Triggers on "deploy to Cloudflare", "Cloudflare Pages", "add custom domain", "pages deploy", or any Cloudflare Pages hosting workflow.
npx skillsauth add baphomet480/claude-skills cloudflare-pagesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploy any static site to Cloudflare Pages — create projects, attach custom domains, wire up CI/CD, and verify deployments. Framework-agnostic: works with Hugo, Astro, Next.js, Nuxt, SvelteKit, or any build tool that produces static output.
| Requirement | How to get it |
|---|---|
| wrangler CLI | npm i -g wrangler then wrangler login (opens browser OAuth) |
| Cloudflare account | dash.cloudflare.com — free tier works |
| Account ID | Dashboard → any zone → Overview sidebar, or wrangler whoami |
| API Token (CI/CD) | Dashboard → API Tokens → "Edit Cloudflare Workers" template (includes Pages) |
| DNS API Token | Dashboard → API Tokens → Custom → Zone:DNS:Edit (only if adding custom domains via API) |
| Zone ID | Dashboard → your domain → Overview sidebar (only for custom domains) |
For a one-off manual deploy when CI/CD isn't set up yet:
# 1. Build your site
<your-build-command> # e.g. hugo --minify, npm run build
# 2. Deploy output directory
wrangler pages deploy <output-dir> --project-name <project-name>
Each deploy gets a unique preview URL. The latest deploy on production branch becomes the live site at <project>.pages.dev.
bash scripts/setup-pages-project.sh <project-name> "<build-command>" <output-dir> [branch]
This runs wrangler pages project create and prints the resulting *.pages.dev URL. The branch argument defaults to main.
Manual alternative:
wrangler pages project create <project-name> --production-branch main
Build and deploy:
<your-build-command>
wrangler pages deploy <output-dir> --project-name <project-name>
# Set required environment variables
export CLOUDFLARE_ACCOUNT_ID="<your-account-id>"
export CLOUDFLARE_API_TOKEN="<pages-edit-token>"
export CLOUDFLARE_ZONE_ID="<your-zone-id>"
export CLOUDFLARE_DNS_TOKEN="<dns-edit-token>" # optional, falls back to API_TOKEN
bash scripts/add-custom-domain.sh <custom-domain> <project-name>
The script performs two operations:
<project>.pages.devBoth operations are idempotent — safe to re-run.
See references/ci-cd-templates.md for complete GitHub Actions workflows for Hugo, Astro, Next.js, and generic npm builds.
Required GitHub Secrets:
| Secret | Value |
|---|---|
| CLOUDFLARE_API_TOKEN | API token with "Edit Cloudflare Workers" permissions |
| CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID |
Set these at: Repository → Settings → Secrets and variables → Actions → New repository secret
# List recent deployments
wrangler pages deployment list --project-name <project-name>
# Rollback: checkout previous commit, rebuild, redeploy
git checkout <commit-hash>
<your-build-command>
wrangler pages deploy <output-dir> --project-name <project-name>
# Return to latest
git checkout main
export CLOUDFLARE_ACCOUNT_ID="<your-account-id>"
export CLOUDFLARE_API_TOKEN="<your-token>"
bash scripts/verify-deployment.sh <project-name> [custom-domain]
Shows: latest deployment status (color-coded), last 5 deployments table, custom domain SSL status, and HTTP 200 check on *.pages.dev.
| Script | Purpose | Required env vars |
|---|---|---|
| setup-pages-project.sh | Create Pages project via wrangler | CLOUDFLARE_ACCOUNT_ID |
| add-custom-domain.sh | Register domain + create CNAME | CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID |
| verify-deployment.sh | Check deploy status, SSL, HTTP | CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN |
| Operation | Token needed | Scope | Where used |
|---|---|---|---|
| wrangler pages deploy | Wrangler OAuth | Automatic via wrangler login | Local CLI, CI/CD |
| Register custom domain on Pages | API Token | Account:Cloudflare Pages:Edit | add-custom-domain.sh |
| Create CNAME DNS record | DNS API Token | Zone:DNS:Edit | add-custom-domain.sh |
| CI/CD deploy (GitHub Actions) | API Token | "Edit Cloudflare Workers" template | GitHub Secrets |
| Query deployments | API Token | Account:Cloudflare Pages:Read | verify-deployment.sh |
Tip: For simpler setups, a single API token with both Pages:Edit and DNS:Edit scopes can be used — set CLOUDFLARE_API_TOKEN and omit CLOUDFLARE_DNS_TOKEN.
| Problem | Cause | Fix |
|---|---|---|
| wrangler: command not found | wrangler not installed | npm i -g wrangler |
| Authentication error | OAuth expired or wrong token | wrangler login (re-authenticate) |
| Custom domain stuck "pending" | Missing or wrong CNAME record | Check DNS: CNAME must point to <project>.pages.dev |
| SSL not provisioning | Domain not proxied through Cloudflare | Set CNAME proxy to "Proxied" (orange cloud) |
| 522 error on custom domain | DNS record exists but wrong target | Delete old record, re-run add-custom-domain.sh |
| Deploy succeeds but site 404s | Wrong output directory | Verify build output dir matches deploy path |
| CI/CD deploy fails | Missing GitHub secrets | Add CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID |
wrangler pages deploy for direct uploads. Git integration adds complexity with no benefit for this workflow.development
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
testing
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.