feature-flags
O que ela faz
Esta skill explica como declarar feature flags em um aplicativo Agent-Native e ativá-las para usuários, organizações ou percentuais escolhidos. Cobre também a remoção de flags antigas. É para desenvolvedores que lançam funcionalidades de forma gradual.
Quando usar
- ✓Quando você quer lançar uma nova funcionalidade para poucos usuários primeiro e ampliá-la depois.
- ✓Quando você precisa ativar uma funcionalidade para organizações específicas sem um novo deploy.
- ✓Quando uma chave de compilação deve virar uma flag de execução que possa ser alterada com segurança.
Link da skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/feature-flags/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Pode acrescentar uma flag para que o novo construtor de relatórios fique ativo apenas para os clientes do piloto, e eu possa ativá-lo para todos depois?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente declara a flag no código compartilhado, verifica-a no servidor antes das actions protegidas e gerencia o estado da liberação pelo plano de controle do Analytics.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Feature Flags
A feature flag is a boolean declared in app code, evaluated locally by Core, and managed from the Analytics fleet control plane. Code owns whether a flag exists. Runtime settings own only its rollout state.
Flags let an app deploy dormant code and turn it on in the real environment without another deployment. They are not experiments: do not add variants, hypotheses, conversion metrics, exposure tracking, or lifecycle states.
When to use one
Use a flag for a reversible rollout of a user-facing capability whose dormant code is safe to deploy. Flags are useful for production dogfooding, exact-user or organization pilots, and deterministic percentage rollouts.
Do not use a flag for authentication, authorization, secrets, audit enablement, SSR cache behavior, or another security boundary. Client hiding is presentation only; every guarded server action must evaluate the same registered flag.
Agent workflow
1. Declare
Keep definitions in a shared TypeScript module so server and client code use the same stable key. Flags are boolean and default-off.
import { defineFeatureFlag } from "@agent-native/core/feature-flags/registry";
export const FULL_APP_BUILDING = defineFeatureFlag({
key: "full-app-building",
displayName: "Full app building",
description: "Create and edit Fusion-backed applications.",
});
Never import defineFeatureFlag from @agent-native/core/feature-flags.
That barrel is server evaluation (isFeatureFlagEnabled) plus store code;
Vite will follow it into the browser and crash the page. Plugin and A2A auth
helpers live on @agent-native/core/server (or
@agent-native/core/feature-flags/server).
Keys are immutable, never reused, and contain only letters, numbers, dots, underscores, or hyphens. Prefer a concise app-owned name. Do not create flag definitions or rollout rows from Analytics.
2. Register
Register app definitions from a Nitro plugin before actions are discovered. Do not add app-specific flags to a Core registry.
import { createFeatureFlagsPlugin } from "@agent-native/core/server";
import { FULL_APP_BUILDING } from "../../shared/feature-flags.js";
export default createFeatureFlagsPlugin({ flags: [FULL_APP_BUILDING] });
Definitions live in one process-wide registry (a globalThis symbol in
feature-flags/registry.ts, like the labs registry). In local dev the plugin
can load core from source while actions load the built package; a
module-local map gave each copy its own registry, so get-feature-flags saw
no definitions and every flag read as off. Keep the shared registry when
touching that module.
3. Guard server and client
The server action is the enforcement boundary:
import { isFeatureFlagEnabled } from "@agent-native/core/feature-flags";
run: async (args, ctx) => {
if (!(await isFeatureFlagEnabled(FULL_APP_BUILDING, ctx))) {
throw new Error("Full app building is not enabled for this account.");
}
// guarded operation
}
Use the client hook only to hide or reveal hydrated UI:
import { useFeatureFlag } from "@agent-native/core/client/feature-flags";
const enabled = useFeatureFlag(FULL_APP_BUILDING.key);
return enabled ? <FullAppOption /> : null;
The client hook intentionally returns false while loading or for an unknown
flag. Never replace that fail-closed behavior with app-local bucketing or a
compile-time fallback. When the flag-off UI must not flash before the answer
arrives (a whole page swaps on the flag), use useFeatureFlagState(key): it
returns
{ status: "loading" | "ready" | "unavailable", enabled }, so the surface can
hold a layout-matching skeleton while status is "loading". Never evaluate personalized flags in the public SSR
shell; it is shared and cached for every visitor.
4. Verify and roll out
- Verify the off path before changing rollout state.
- Confirm the registered flag appears in Analytics → Feature flags for the app and is Off by default.
- Use Enable for me for initial production dogfood.
- Expand to exact emails, organization IDs, or a percentage only from Analytics.
- Confirm the client presentation and authoritative server action agree.
Management contract
Core mounts three actions in registered apps:
| Action | Purpose |
|---|---|
get-feature-flags |
Return the current caller's evaluated boolean values. |
list-feature-flags |
Return definitions and rollout metadata to an authorized operator. |
| `set-fea |
Perguntas frequentes
Uma flag pode proteger recursos de segurança?
Não. A skill diz que flags não devem proteger autenticação, autorização, segredos ou configurações de auditoria.
Flags são o mesmo que experimentos?
Não. A skill diz que flags são chaves de ligar e desligar, e não experimentos com variantes ou métricas.
Ocultar um botão na interface desliga a funcionalidade?
Não. A skill diz que ocultar no cliente é apenas apresentação, e o servidor deve verificar a mesma flag.
Detalhes
Descrição original do autor
Declare, evaluate, manage, and remove framework feature flags. Use when shipping a capability gradually, targeting users or organizations, or replacing a compile-time rollout switch with a production-safe runtime flag.
repo: BuilderIO/agent-native
Popularidade
- Estrelas no GitHub
- 7,6 mil
- Posição no ranking
- #13159
- Licença
- MIT
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
design-exploration
7,6 milAjuda seu agente a explorar várias direções de design de interface lado a lado, deixar você escolher uma e depois refinar o design escolhido.
visual-edit
7,6 milAjuda seu agente a abrir um aplicativo local em execução em um editor visual, para que você possa revisar e editar as telas reais juntos.
turn-into-app
7,6 milTransforma um fluxo de trabalho, uma planilha ou um projeto em um aplicativo visual bem acabado, com telas preenchidas e um agente trabalhando por trás dos controles.
visual-plan
7,6 milTransforma um plano em texto simples em um plano visual interativo, com diagramas, mapas de arquivos, trechos de código e perguntas em aberto.
Skills parecidas
openclaw-update
394 milAjuda seu agente a atualizar um OpenClaw Gateway existente, escolhendo o método que combina com a instalação e mantendo sua sessão funcionando.
diagnose-gateway
394 milAjuda seu agente a descobrir por que seu OpenClaw Gateway está falhando, verificando configurações, canais e portas sem alterar nada.
crabbox-apps
394 milAjuda seu agente a abrir e executar um app em uma máquina temporária na nuvem e depois mostrar a visualização dele no painel lateral do seu chat.