flagship
Build, debug, or review code that uses Cloudflare Flagship feature flags from Workers, OpenFeature SDKs, the evaluation API, or Wrangler. Use for the Flagship binding, targeting rules, percentage rollouts and A/B splits, kill switches, local flag stores, and flag-related API tokens.
- 01Installs
- New
- 02Files scanned
- 2
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 78b6a2b15c375180… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Cloudflare Flagship
Flagship is Cloudflare's feature flag service: apps group flags, flags have typed variants and ordered targeting rules, and evaluation runs at the edge against propagated configuration. Your knowledge of the Flagship API may be outdated or missing. Prefer retrieval over pre-training: read the matching page below before writing code or commands, and treat the docs and generated types as the source of truth over this skill.
Documentation
| Task | Docs | Check for |
|---|---|---|
| Understand the model | Concepts | Apps, flags, variant types, rule order, evaluation context, propagation |
| Evaluate flags in a Worker | Get started, Configuration, Binding methods, Types | Binding config, typed and *Details methods, context value types |
| Evaluate outside Workers or through OpenFeature | OpenFeature SDK, TypeScript server, TypeScript client, Python, Go, Rust | Package names, provider options, caching, minimum versions for structured context |
| Evaluate over HTTP without an SDK | Evaluation API | GET for scalar context, POST for structured context, token permissions |
| Target users or roll out gradually | Targeting rules, Operators, Percentage rollouts | Rule shape, nested attribute paths, bucketing attribute, cumulative A/B thresholds |
| Manage flags from the CLI | Wrangler commands | --rule syntax, rollout, split, enable/disable, --local, --json |
| Manage flags over HTTP | API reference | Apps, flags, and flag changelog endpoints; rules live on the flag object. Update flag is a PUT that clears omitted fields, so read the flag before writing |
| Create tokens for SDKs or automation | API tokens | Account-wide vs app-scoped tokens, Evaluate vs Read vs Write |
| Debug unexpected values | Evaluation reasons and error codes | reason and errorCode values |
| Plan rollouts and cleanup | Best practices, Limits | Rollout steps, flag removal order, key and context limits |
For the full page list, read Flagship llms.txt. After adding a binding, run npx wrangler types and read the Flagship declarations in the generated worker-configuration.d.ts; they match the installed Wrangler version.
Gotchas
These follow from the pages above and are the usual causes of flags that look broken but are working as documented.
- Use the binding inside Workers. It authenticates automatically and needs no API token. Outside Workers, use an OpenFeature provider with an Evaluate token; local evaluation in any server SDK needs a Read token instead. Only the TypeScript server provider accepts the binding: in a Worker that wants OpenFeature APIs, pass the binding to
FlagshipServerProvider. Do not ship the TypeScript client provider in public-facing apps: it requires an API token that would be visible in client code. - Known evaluation failures return your default silently. The typed binding methods return
defaultValuefor known failures such as a missing flag, type mismatch, or invalid context. Unexpected runtime failures can still throw, andget()without adefaultValuethrows on known failures. Other clients differ: the Rust SDK returns aResult, and the evaluation APIPOSTreturns400for invalid context. Pick a default that is the safe, existing behavior, and use the matching*Detailsmethod to seereasonanderrorCodewhen a value looks wrong. - Local development starts with an empty flag store.
wrangler dev, the Vite plugin, the Vitest integration, andcf devevaluate against a local store, so every flag returns its default until you seed it. Runnpx wrangler flagship flags pull <APP_ID>, create flags with--local, or set"remote": trueon the binding.pulloverwrites local flags with matching keys and writes to.wrangler/state, whichwrangler devand the Vite plugin 1.x use.cf devand the Vite plugin 2.0 use.cloudflare/state, so for them pass--persist-to .cloudflare/statetopull, or every flag still returns its default.cfcannot copy flags from the remote app, so seed it withwrangler flagship flags pull. On flag commands other thanpull,--persist-torequires--local. Check Configuration for the minimum tool versions. - Rollouts need a stable bucketing value. The bucketing attribute defaults to
targetingKey. If it is missing ornull, each evaluation gets a random bucket, so the same user can flip between values. Pass the same stable identifier under the same attribute name on every call, and usetargetingKeywith OpenFeature SDKs. - Rules are ordered and rollout misses fall through. The first matching rule wins. A context that matches a rule's conditions but falls outside its rollout percentage continues to the next rule. Put specific rules before broad ones, and use cumulative thresholds that end at 100 for API-managed A/B/n splits, or
wrangler flagship flags split, which calculates them. - Changes take up to 30 seconds to propagate. Do not expect the next evaluation to reflect an update immediately; for scripted checks, allow for the propagation window.
flags update --rule,rollout, andsplitreplace every rule.rolloutandsplitoverwrite the flag's entire rule set with the rules they generate, and prompt first only when existing rules have conditions;--forceskips the prompt. Use--add-ruleto append, orrules updateandrules deleteto change one rule by priority. Wrangler commands take the app ID as an argument and do not read it from the Worker binding.- Keep context small and JSON-only. Send only attributes that rules or bucketing use, and no sensitive data. Serialize
Datevalues to ISO 8601 strings for the binding in TypeScript. A condition whose attribute is absent from the context never matches, including with negative operators such asnot_equals. Evaluate a flag once per request and reuse the value instead of calling it in a loop. - Disabling a flag is the kill switch. A disabled flag always serves its default variant, regardless of targeting rules.
- Delete flags last. Disable the flag, watch for problems, remove the evaluation code, deploy, then delete the flag. A deleted flag that is still evaluated silently returns its default.
Skill feedback
If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.
Files
2- SKILL.md
5ed54edad58.3 KB - references/skill-feedback.md
ba22f62ffa2.7 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from cloudflare/skills8
Build, debug, or review Cloudflare Agents SDK applications using the agents package.
Build, debug, or review code that uses Cloudflare Artifacts, Git-compatible versioned storage, from Workers, the REST API, or Git clients. Use for the env.ARTIFACTS binding, creating, forking, or importing repositories, repo-scoped tokens, and pushing commits from a Worker.
Build and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL. Use for streaming data into R2 Iceberg tables, managing catalogs, or querying those tables; also use for requests using the former Data Platform, Pipelines, R2 Data Catalog, or R2 SQL name
Cloudflare's official cf CLI (beta) for the public Cloudflare API and Workers projects. Use for finding and running Cloudflare commands from the terminal — sign-in and profiles, cf cli search, cf schema, cf deploy/dev/build, resource commands for DNS, zones, D1, KV, and R2 — and for choosing between
Discover and choose Cloudflare products for apps, APIs, AI agents, storage, networking, and security. Use for architecture and product selection, including when the user describes a need without naming a Cloudflare product; then find the relevant skill or documentation. Also use when a Cloudflare-pr
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 o
Implement or troubleshoot Cloudflare Email Sending and Email Routing integrations and their delivery configuration.
Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors. Also use when an agent, script, crawler, or other non-browser client needs to reach a webpage or API protected by Cloudflare Access.
Related backend skillsscan passed
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Report browser/API/CLI/job/worker/webhook bugs. Use for: qa report only, just report bugs, test but dont fix. (gstack)
Configures Google Cloud API Gateway to act as a remote Model Context Protocol (MCP) server (Public Preview) that exposes REST APIs as agent tools over HTTP (POST /mcp). Use when migrating OpenAPI 2.0 specs to OpenAPI 3.x for MCP, annotating specs with x-google-api-management.mcp and x-google-mcp-too
This skill should be used when the user asks to "build an MCP server", "create an MCP", "make an MCP integration", "wrap an API for Claude", "expose tools to Claude", "make an MCP app", or discusses building something with the Model Context Protocol. It is the entry point for MCP server development
Calibrate a new dataset from live RTSP camera streams via the AutoMagicCalib REST API. Use when the user provides RTSP URLs or asks to calibrate live cameras; VIOS records clips, AMC ingests them, then runs calibration.
PostHog error tracking for Ruby on Rails