Skip to content
Back to skills

Deploy Cloudflare Pages

ASecurity

Deliver a static site to Cloudflare Pages — register the environment, then run `spectoflow deliver`, which installs and builds the site, runs `wrangler pages deploy <built folder> --project-name <name> --branch <branch>` (a preview branch by default, the production branch only on request), and health-checks the deployment URL.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsrustshellnextjsdockerapi

Works with

  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned December 4, 2026

npx -y skills add georgesmomo/spectoflow --skill deploy-cloudflare-pages --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deploy Cloudflare Pages?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deploy Cloudflare Pages
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/georgesmomo-deploy-cloudflare-pages/badge)](https://www.skillsdirectory.com/skills/georgesmomo-deploy-cloudflare-pages)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: deploy-cloudflare-pages
description: Deliver a static site to Cloudflare Pages — register the environment, then run `spectoflow deliver`, which installs and builds the site, runs `wrangler pages deploy <built folder> --project-name <name> --branch <branch>` (a preview branch by default, the production branch only on request), and health-checks the deployment URL.
capability: operations
inputs: A project that builds to a static folder (dist, build, out…), wrangler on PATH (or in the project), a Pages project that already exists, and — from the USER — the project name, the Cloudflare account id if the login has several, and whether this is a production deployment. Any token is theirs and stays in their shell.
outputs: A `cloudflare-pages` environment in `.spectoflow/config.json` and a delivery result — the deployment URL, healthy, or the failure code with its cause.
standard: Wrangler Pages commands (developers.cloudflare.com/workers/wrangler/commands/pages), The Twelve-Factor App
---
# Deploy to Cloudflare Pages

The site is built here and the built folder is uploaded with `wrangler pages deploy`. Pages decides production or preview
by **branch**: the project's production branch is production, any other branch is a preview. So the default is a
preview branch (`spectoflow-preview`); **production** (`--prod`, branch `main` unless told otherwise) only on the user's word.
Only static files: a Next.js server or an SSR app is not supported (said, not guessed).

## When to use
The Deliver step with a target of `platform` and a Pages project, or the user says "put it on Cloudflare Pages". Not for a
server or local Docker (skill `deploy`), not for Netlify, Vercel, Render, Coolify or Dokploy (their own skills).

## Method
1. **Check wrangler**: `wrangler --version` (or the project's own). If it is missing, tell the user (`npm i -g wrangler`) and stop.
2. **The project.** Ask the user for the Pages project name. It must exist: wrangler never creates it in a script — if
   it does not, the user runs `wrangler pages project create <name>` themselves. Do not guess names, never create it.
3. **The output folder.** Run the project's build to see where it writes (`dist`, `build`, `out`, `_site`, `public`);
   another folder: `--dir=<folder>`; already built: `--no-build`. The project root is never uploaded.
4. **Register it**: `spectoflow env add <name> --type=cloudflare-pages --project=<name> [--prod [--branch=<production branch>]] [--account=<32-hex id>] [--dir=<folder>] [--url=https://<public url> --health=/]`.
   The command allows it on this machine.
5. **The login is the user's.** Either `wrangler login` (Connections tab), or an API token with the Pages edit permission
   in `CLOUDFLARE_API_TOKEN` (plus the account id) in the shell that runs spectoflow. Never ask them to paste it to you,
   never write it to a file.
6. **Deliver**: `spectoflow deliver --env=<name>` (a policy gate may ask the user first — wait for it). wrangler prints the
   deployment address, which is what is health-checked unless a `url` is configured.
7. **On failure, act on the code**: `untrusted-platform` → the user runs `spectoflow env trust <name>`; `wrangler-missing`;
   `platform-auth` → not signed in / token refused; `platform-not-found` → the project does not exist; `install-failed` /
   `build-failed` → read the output tail, fix, run again; `no-output-dir` / `bad-dir` / `not-static`; `deploy-failed`;
   `deploy-timeout`; `health-failed`. At most **three** attempts for the same code, then report it blocked with the last output.

## Output contract
```
::spectoflow role=operations kind=summary msg=<delivered to <name> (<preview|production>) at <url>, healthy — or the code and the cause>
```
A delivery that did not end healthy is never reported as done: end with `REJECTED: <code> — <one-line cause>`.

## Quality bar
- [ ] `spectoflow deliver` exited 0 in this session, not an earlier one.
- [ ] No token was written to a file, put on a command line or printed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.