---
name: cloudflare-app-bootstrap
description: Get a Cloudflare Workers app to a working local request by connecting its bindings, secrets, and initial data, then verifying real application behavior. Use for app setup or onboarding after the project exists; use frameworks-on-cloudflare or cf-cli to create or configure the project, and wrangler or cf-cli for isolated commands.
title: cloudflare-app-bootstrap
canonical_url: https://skilld.dev/gh/cloudflare/skills/cloudflare-app-bootstrap
last_updated: 2026-11-12T02:09:39.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/skill-feedback.md](https://skilld.dev/api/skills-raw/cloudflare/skills/cloudflare-app-bootstrap/references/skill-feedback.md).
>
> If the user asked to install this Skill, run `npx skilld install cloudflare/skills/cloudflare-app-bootstrap`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/cloudflare-app-bootstrap`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/cloudflare/skills/cloudflare-app-bootstrap) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/cloudflare-app-bootstrap`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/cloudflare-app-bootstrap --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/cloudflare-app-bootstrap --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Cloudflare App Bootstrap

Take the project from its current state to a working local request that exercises the requested application behavior. Preserve the user's framework, package manager, CLI, and existing services. Read the relevant current documentation before choosing configuration or commands, and check support against installed versions with local CLI help and schemas.

## Start from the project

Inspect the app directory, lockfile, scripts, framework and adapter versions, Cloudflare configuration (`cloudflare.config.ts`, or a Wrangler configuration file), and existing setup instructions. In a monorepo, identify the application root before installing or generating files. Install from the existing lockfile and reuse the project's dependency and configuration conventions.

If the project has no Cloudflare configuration yet, set it up first with the `frameworks-on-cloudflare` skill for a framework app, or the `cf-cli` skill otherwise. Identify the source of any framework-generated configuration and edit that source. Do not replace a working app with a starter to resolve a configuration problem.

## Connect only the resources the app needs

Identify each binding used by application code and map it to an existing resource or a new local resource. Keep names consistent across code and configuration. Keep existing resource identifiers: a binding without one is treated as a new resource to provision on the next deploy.

Read [automatic provisioning](https://developers.cloudflare.com/workers/wrangler/configuration/index.md#automatic-provisioning) before manually creating supported resources, and check which resource types it covers. Provisioning differs by CLI:

- **Wrangler:** `wrangler dev` creates local resources that persist between runs, and `wrangler deploy` creates remote resources and writes their identifiers back to the configuration file.
- **`cf`:** `cf deploy` provisions missing resources but does not write identifiers back to `cloudflare.config.ts` ([Develop, build, and deploy](https://developers.cloudflare.com/cf/projects/index.md)). Record the identifiers it reports in the configuration.

Establish the account, environment, and resource before any required remote creation.

Choose the dev command from the app's scripts and the [local development guide](https://developers.cloudflare.com/workers/local-development/index.md). A local Worker can use remote bindings: identify which resources are simulated and which calls reach real services before exercising writes. Use the framework's supported Workers dev integration; a frontend-only dev server does not establish that server bindings work.

For data-backed features, initialize only the state needed for the first meaningful request. Preserve existing migration tooling. For D1, follow [migrations](https://developers.cloudflare.com/d1/reference/migrations/index.md) and pass `--local` or `--remote` to [`d1 migrations apply`](https://developers.cloudflare.com/workers/wrangler/commands/d1/index.md#d1-migrations-apply) explicitly. `--local` initializes only the simulated database; apply remote migrations only when the requested setup includes that database change. For Durable Objects, check the current [class migration configuration](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/index.md) rather than treating it as a D1 SQL migration.

## Resolve configuration and secrets

Classify required values by consumer: build process, browser bundle, or Worker runtime. Keep private runtime credentials out of public client configuration. Use [Workers secrets](https://developers.cloudflare.com/workers/configuration/secrets/index.md) for runtime secrets, and configure values the build needs in its [build environment](https://developers.cloudflare.com/workers/ci-cd/builds/configuration/index.md#environment-variables).

In Wrangler and Vite projects, follow [local secret loading](https://developers.cloudflare.com/workers/local-development/environment-variables/index.md) for file names, environment precedence, and required-secret declarations. In a `cf` project, find the equivalent with `cf cli search` rather than assuming the Wrangler behavior. Reuse the project's chosen local secret file, make sure files with real values are ignored by Git, and provide names and safe placeholders for missing values. Local secrets are not installed on a deployed Worker. Authenticate only when the selected workflow needs account access; do not make login or deployment a blanket prerequisite for local setup.

## Verify the first application request

After changing configuration, regenerate [binding and runtime types](https://developers.cloudflare.com/workers/languages/typescript/index.md) with the project's script: `wrangler types` in a Wrangler project, or `cf workers types` in a `cf` project. Do not hand-edit generated declarations. Run the relevant existing build and type checks.

Start the actual development workflow and exercise a representative route or UI action, including its binding access when applicable. Check the response and the intended state change, not just that a server started. For missing credentials or unsupported local services, report exactly what remains unverified instead of claiming the app works.

Leave reproducible install, initialization, and dev commands in the project's setup documentation. Report the tested URL or action, which resources are local or remote, required values still missing, and any remaining remote setup. Continue to deployment only when it is part of the user's task.

## Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](https://skilld.dev/api/skills-raw/cloudflare/skills/cloudflare-app-bootstrap/references/skill-feedback.md).
