setup-cloudflare-pr-previews
Installation
SKILL.md
Set Up Cloudflare PR Previews
Create a reusable deployment topology while adapting names, build output, migrations, runtime URL variables, and explicitly shared resources to the target project.
Start With the Contract
- Inspect repository instructions,
package.json, lockfiles,wrangler.jsonc, build configuration, generated Worker output, migration layout, existing CI, and deployment documentation. When present, also inspect Better Auth environment handling and Prisma schema/configuration. - Read
references/architecture.mdcompletely before changing files. - If the repository uses
@cloudflare/vite-plugin, also readreferences/vite-plugin-integration.mdcompletely. - Identify these values before rendering templates:
- application/resource prefix;
- production and preview Worker names;
- production branch or branches;
- D1 binding and migrations directory;
- deployable built Wrangler config path;
- stable production and preview URLs;
- every runtime variable that must equal the active deployment URL;
- resources isolated per branch versus deliberately shared.
- Run the bundled renderer into a scratch directory, never over the repository: