Skills Agentes

Flagship

Construye, depura o revisa código que use feature flags de Cloudflare Flagship desde Workers, SDKs de OpenFeature, la API de evaluación o Wrangler.

Oficial
Estrellas
3.5k

en todo el repo

Actividad
60

0–100, la ruta de este skill

Actualizado
hace 5 días

último commit aquí

Commits
1

últimos 90 días

Contexto
2.1k tok

71 tok en reposo

Paquete
2 archivos

11 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add cloudflare/skills --skill flagship --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Guía la escritura y revisión de código que usa Cloudflare Flagship (feature flags) desde Workers, SDKs de OpenFeature, la API de evaluación o Wrangler
  • Prioriza consultar la documentación oficial y los tipos generados antes de escribir código, en vez de fiarse del conocimiento previo
  • Señala errores habituales: bucketing inestable, orden de reglas, propagación de hasta 30 segundos, tienda local de flags vacía
  • Orienta sobre tokens de API, bindings y cómo depurar valores inesperados con reason y errorCode

Úsalo cuando

  • Vas a construir, depurar o revisar código que usa el binding de Flagship, SDKs de OpenFeature, la API de evaluación o Wrangler
  • Necesitas configurar targeting rules, rollouts por porcentaje o splits A/B
  • Trabajas con kill switches, tiendas locales de flags o tokens de API relacionados con flags

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • “Ayúdame a configurar un rollout por porcentaje con Flagship en mi Worker”
    • “¿Por qué mi flag siempre devuelve el valor por defecto en wrangler dev?”
    • “Revisa este código que usa el binding de Flagship y OpenFeatureServerProvider”
    • “Quiero crear un kill switch para este flag con Wrangler”

    SKILL.md

    En inglés

    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 defaultValue for known failures such as a missing flag, type mismatch, or invalid context. Unexpected runtime failures can still throw, and get() without a defaultValue throws on known failures. Other clients differ: the Rust SDK returns a Result, and the evaluation API POST returns 400 for invalid context. Pick a default that is the safe, existing behavior, and use the matching *Details method to see reason and errorCode when a value looks wrong.
    • Local development starts with an empty flag store. wrangler dev, the Vite plugin, the Vitest integration, and cf dev evaluate against a local store, so every flag returns its default until you seed it. Run npx wrangler flagship flags pull <APP_ID>, create flags with --local, or set "remote": true on the binding. pull overwrites local flags with matching keys and writes to .wrangler/state, which wrangler dev and the Vite plugin 1.x use. cf dev and the Vite plugin 2.0 use .cloudflare/state, so for them pass --persist-to .cloudflare/state to pull, or every flag still returns its default. cf cannot copy flags from the remote app, so seed it with wrangler flagship flags pull. On flag commands other than pull, --persist-to requires --local. Check Configuration for the minimum tool versions.
    • Rollouts need a stable bucketing value. The bucketing attribute defaults to targetingKey. If it is missing or null, 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 use targetingKey with 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, and split replace every rule. rollout and split overwrite the flag's entire rule set with the rules they generate, and prompt first only when existing rules have conditions; --force skips the prompt. Use --add-rule to append, or rules update and rules delete to 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 Date values 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 as not_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.

    Reproducido de cloudflare/skills bajo licencia Apache-2.0. Leer esta página en markdown.

    Archivos

    2 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Necesitas un binding de Flagship configurado en Wrangler o un token de API (Evaluate, Read o Write) según el SDK y entorno usados.

    Detalles

    Creador
    cloudflare
    Licencia
    Apache-2.0
    Recursos incluidos
    referencias
    Código fuente
    Ver SKILL.md

    Etiquetas

    Más de cloudflare/skills

    Este repo incluye 24 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack skills entero y su comando de instalación

    Descubre y elige productos Cloudflare para apps, APIs, agentes IA, almacenamiento, redes y seguridad; también ayuda a diagnosticar errores de un sitio proxied por Cloudflare.

    Costo de contexto al activarse
    8.1k tok
    Tamaño del paquete
    130 archivos
    Última actualización
    hace 5 días
    Oficialdevops infraestructura

    Buenas prácticas de Cloudflare Workers para aplicaciones en producción. Úsala al escribir, revisar o configurar Workers.

    Costo de contexto al activarse
    1.6k tok
    Tamaño del paquete
    5 archivos
    Última actualización
    hace 20 días
    Oficialdevops infraestructura

    Crea, depura o revisa código de Cloudflare Durable Objects para estado persistente y coordinación.

    Costo de contexto al activarse
    1.6k tok
    Tamaño del paquete
    5 archivos
    Última actualización
    el mes pasado
    Oficialdesarrollo apis

    Ejecuta o depura comandos de la CLI Wrangler en proyectos con wrangler.jsonc, wrangler.json o wrangler.toml: desarrollo local, Previews, despliegue y gestión de recursos.

    Costo de contexto al activarse
    3k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    el mes pasado
    Oficialdevops infraestructura

    Diseña, configura, soluciona problemas o revisa despliegues de Cloudflare One Zero Trust y SASE. También útil cuando un agente, script o crawler necesita acceder a una web o API protegida por Cloudflare Access.

    Costo de contexto al activarse
    6.6k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 23 días
    Oficialdevops infraestructura

    Construye, depura o revisa aplicaciones de Cloudflare Agents SDK usando el paquete agents.

    Costo de contexto al activarse
    3.1k tok
    Tamaño del paquete
    21 archivos
    Última actualización
    el mes pasado
    Oficialherramientas desarrollo

    Skills relacionados

    Descubre y elige productos Cloudflare para apps, APIs, agentes IA, almacenamiento, redes y seguridad; también ayuda a diagnosticar errores de un sitio proxied por Cloudflare.

    Costo de contexto al activarse
    8.1k tok
    Tamaño del paquete
    130 archivos
    Última actualización
    hace 5 días
    Oficialdevops infraestructura

    Implementa o depura integraciones de Cloudflare Email Sending y Email Routing, junto con su configuración de entrega.

    Costo de contexto al activarse
    1.7k tok
    Tamaño del paquete
    7 archivos
    Última actualización
    el mes pasado
    Oficialdevops infraestructura

    Diseña, configura, soluciona problemas o revisa despliegues de Cloudflare One Zero Trust y SASE. También útil cuando un agente, script o crawler necesita acceder a una web o API protegida por Cloudflare Access.

    Costo de contexto al activarse
    6.6k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 23 días
    Oficialdevops infraestructura