agentleFS
binay-pybinay-py/claude-skills/skills/cf-pages-deploy/SKILL.md

cf-pages-deploy

Skill1 starsChanged 6 days agoMITView on GitHub

Deploy a static site or single HTML file to Cloudflare Pages safely and verify it is live. Stages a clean copy (no .env, node_modules, README, keys), scans for secrets, creates the project if asked, deploys to production or a preview branch, then checks the live file matches byte for byte. Use for any "deploy/redeploy this to Cloudflare Pages / pages.dev" request.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run --dry-run and read the file list before the first deploy of any folder.

    line 20
  2. Very specific:

    Prefer --include for project folders that mix site and source files.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

cf-pages-deploy

scripts/deploy.mjs is zero-dependency Node 22+ and calls npx wrangler. Run npx wrangler whoami first; if it says you're not logged in, ask the user to run npx wrangler login.

node deploy.mjs --project my-site --dir ./public --dry-run     # ALWAYS first: shows exactly what goes live
node deploy.mjs --project my-site --dir ./public               # production (branch main), verified
node deploy.mjs --project my-site --dir . --include "index.html,*.css,*.js,assets/**"
node deploy.mjs --project my-site --dir dist --build "npm run build"
node deploy.mjs --project new-site --dir dist --create         # make the project if missing
node deploy.mjs --project my-site --dir dist --branch preview  # preview URL; production untouched

Rules

  • Run --dry-run and read the file list before the first deploy of any folder. Everything uploaded is public.
  • Prefer --include for project folders that mix site and source files. A single-file site is --include index.html.
  • Excluded by default: .git, node_modules, .wrangler, .env*, .dev.vars, keys/certs, *.md, package*.json, lockfiles, wrangler.*, OS junk, logs and databases. They stay out under --include too (*.js doesn't reach into node_modules) unless --include names the exact path, and --exclude still applies.
  • The secret scan reads every non-binary file that would go live, whatever its extension.
  • A secret found in a file that would go public stops the deploy. Never pass --allow-secrets unless the user confirms the value is meant to be public (e.g. a browser-restricted Maps key).
  • --create only when the user wants a NEW project. Look up existing names first with npx wrangler pages project list.
  • Production deploys replace the live site. Confirm with the user unless they asked for a deploy/redeploy.

Gotchas this script handles

  • Real URL ≠ project name. Pages may add a suffix (my-game-28c.pages.dev). The script reads the domain from wrangler pages project list --json; report that URL, not a guessed one.
  • wrangler 4.15x+ pages project create delegates to "Pages in Workers" and can fail ("Could not detect a directory containing static files") or create a Worker instead. The script passes the hidden --force flag to create a classic Pages project. Only creation needs it.
  • --branch main = production. Any other branch = preview deployment at https://<hash>.<project>.pages.dev.
  • Unknown paths return HTTP 200 with index.html (SPA fallback), so a 200 on /.env doesn't mean it leaked. Check the body.
  • Limits: 25 MiB per file, 20,000 files per deployment.
  • Redirects/headers: put _redirects / _headers files in the site root. They're deployed as-is.
  • Verification retries for ~60 s. If it still fails, the edge may be slow. Report the deployment URL and re-check; don't redeploy blindly.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.