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
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Deploy Cloudflare Pages?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/georgesmomo-deploy-cloudflare-pages)
---
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.