launchdarkly
What it does
This skill describes how server and browser code in an Agent-Native app read flags from LaunchDarkly. Every read falls back to a default value if LaunchDarkly is unset or unreachable. It is for developers who already use LaunchDarkly for their flags.
When to use it
- βWhen an action, plugin or component needs to read a flag stored in LaunchDarkly.
- βWhen you are setting up the LaunchDarkly key for an app.
- βWhen you must choose between LaunchDarkly and the built-in flag system.
Skill link
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/launchdarkly/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you read our LaunchDarkly flag for the new export feature in this app, with a safe default if it is unreachable?β
5 new skills a week. 1 minute to read.
How it works
The app reads the flag through the LaunchDarkly helper on the server or in the browser, and it uses the default value whenever LaunchDarkly cannot answer.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
LaunchDarkly
Rule
LaunchDarkly flags are read through @agent-native/core/launchdarkly on the
server and @agent-native/core/client/launchdarkly in the browser. Every read
fails closed to a caller-supplied default β LaunchDarkly being unconfigured,
unreachable, or slow is never an availability dependency for the caller.
LaunchDarkly vs. the built-in feature-flags skill
This repo already has its own rollout system (defineFeatureFlag,
isFeatureFlagEnabled, useFeatureFlag β see the feature-flags skill),
managed from the Analytics fleet control plane with no external dependency.
Use that system for a flag whose definition and targeting rules should live in
this codebase and be manageable from Analytics.
Use LaunchDarkly instead when the flag's definition and targeting genuinely need to live in the LaunchDarkly dashboard β for example, a flag shared with non-Agent-Native systems, or targeting rules (percentage experiments, multi-variate values, scheduled changes) beyond what the built-in system offers. Don't wire the same rollout through both systems.
Setup
Set LAUNCHDARKLY_SDK_KEY to a server-side SDK key from the agent-native
LaunchDarkly project's active environment. Unset, every read falls back to its
default value and LaunchDarkly is never contacted β there is no broken state
to debug, only an inactive one.
No client-side ID or LaunchDarkly JS SDK is used. Browser code reads evaluated
flags through the get-launchdarkly-flags action instead, so the SDK key never
reaches a bundle and no LaunchDarkly network connection opens from the browser.
Server usage
import { isLaunchDarklyFlagEnabled } from "@agent-native/core/launchdarkly";
run: async (args, ctx) => {
const enabled = await isLaunchDarklyFlagEnabled("new-checkout-flow", {
userEmail: ctx.userEmail,
orgId: ctx.orgId,
});
if (!enabled) throw new Error("New checkout flow is not enabled.");
// guarded operation
};
For a non-boolean flag (string/number/JSON variation), use
getLaunchDarklyVariation(key, actor, defaultValue) β the return type matches
defaultValue's type. getAllLaunchDarklyFlags(actor) returns every flag
LaunchDarkly currently evaluates for that context; prefer the single-flag
functions when only a few keys matter.
actor is { userEmail?, orgId?, anonymousId? }. A signed-in caller evaluates
by userEmail. A caller with neither userEmail nor anonymousId falls back
to one shared "anonymous" context β every such caller gets the same
variation from a percentage rollout, since LaunchDarkly buckets by context key.
Pass a stable anonymousId (a device or session id) when an unauthenticated
caller needs its own bucket.
Client usage
import { useLaunchDarklyFlag } from "@agent-native/core/client/launchdarkly";
function CheckoutButton() {
const enabled = useLaunchDarklyFlag("new-checkout-flow");
if (!enabled) return null;
return <Button>Checkout</Button>;
}
useLaunchDarklyFlag(key, defaultValue = false) calls the mounted
get-launchdarkly-flags action for the current session and requires a real
session β like useFeatureFlag, it never fires for a signed-out visitor and
resolves to defaultValue instead. useLaunchDarklyFlags(keys, defaultValue)
evaluates several keys in one request.
get-launchdarkly-flags action
Auto-mounted for every app (like get-feature-flags) β no plugin or
registration needed. Gateable per app via
frameworkTools.launchDarkly (see framework-tools.ts) if an app wants to
remove it from the agent's tool surface; the HTTP route stays mounted either
way so useLaunchDarklyFlag keeps working.
run("get-launchdarkly-flags", { keys: ["new-checkout-flow"], defaultValue: false })
// => { flags: { "new-checkout-flow": true } }
Never do this
- Never import
@agent-native/core/launchdarkly(the server module) from client/browser code β it pulls in the LaunchDarkly Node SDK. Use@agent-native/core/client/launchdarklyinstead. - Never treat a LaunchDarkly read as required for an operation to complete β
every function here already fails closed; don't wrap calls in retries or
turn a
false/default result into a thrown error unless the flag itself is an authorization gate the caller must respect. - Never put
LAUNCHDARKLY_SDK_KEYinagent-native.config.tsor any client-visible config β it is server-only.
Related skills
- feature-flags β the framework's own rollout system; read this first to
FAQ
What happens if LaunchDarkly is not configured?
Every read returns its default value, and LaunchDarkly is never contacted.
Should I use this or the built-in flags?
The skill says to use the built-in system for flags managed in this codebase, and LaunchDarkly when rules must live in its dashboard.
Which key is needed?
The skill says to set one server-side SDK key from the active environment of the project.
Details
Original description by the author
Server-side and client-side LaunchDarkly flag evaluation (project key `agent-native`). Use when reading a LaunchDarkly flag from an action, plugin, or component, or when wiring `LAUNCHDARKLY_SDK_KEY`. Distinct from the framework's own `feature-flags` system.
repo: BuilderIO/agent-native
Popularity
- GitHub stars
- 7.6k
- Ranking position
- #13166
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
design-exploration
7.6kHelps your agent explore several UI design directions side by side, let you pick one, and then refine the chosen design.
visual-edit
7.6kHelps your agent open a running local app in a visual editor so you can review and edit its real screens together.
turn-into-app
7.6kTurns a workflow, spreadsheet or project into a polished visual app, with populated screens and an agent working behind the controls.
visual-plan
7.6kTurns a plain text plan into an interactive visual plan with diagrams, file maps, code snippets and open questions.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.