All skills
launchdarkly avatar

/launchdarkly-flag-create

@3039201 official

Create and configure LaunchDarkly feature flags in a way that fits the existing codebase. Use when the user wants to create a new flag, wrap code in a flag, add a feature toggle, or set up an experiment. Guides exploration of existing patterns before creating.

Use this Skill: https://skilld.dev/gh/launchdarkly/agent-skills/launchdarkly-flag-create

This session only. Nothing lands on disk.

referencesflag-types.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Flag Types and Patterns

A reference for choosing the right flag type and configuring it properly.

Flag Kinds

Boolean Flags

The most common type. Two variations: true and false.

When to use:

  • Feature toggles (show/hide a feature)
  • Kill switches (disable a feature in emergencies)
  • Gradual rollouts (serve true to a percentage of traffic)
  • Simple A/B tests (control vs treatment)

Configuration:

{
  "kind": "boolean",
  "variations": [
    {"value": true},
    {"value": false}
  ]
}

Convention: Variation 0 is true (the new/enabled behavior), variation 1 is false (the old/disabled behavior). The offVariation should point to false.

Multivariate Flags (String)

Multiple string values. Use for text variants, feature versions, or named configurations.

When to use:

  • A/B/C tests with different copy or UI variants
  • Feature version selection ("v1", "v2", "v3")
  • Named configuration modes ("basic", "advanced", "enterprise")

Configuration:

{
  "kind": "multivariate",
  "variations": [
    {"value": "control", "name": "Control"},
    {"value": "variant-a", "name": "Variant A"},
    {"value": "variant-b", "name": "Variant B"}
  ]
}

Multivariate Flags (Number)

Numeric values. Use for thresholds, limits, or quantities.

When to use:

  • Rate limits
  • Timeout durations
  • Feature limits (max items, max size)
  • Numeric configuration that varies by audience

Configuration:

{
  "kind": "multivariate",
  "variations": [
    {"value": 10, "name": "Default"},
    {"value": 50, "name": "Increased"},
    {"value": 100, "name": "Maximum"}
  ]
}

Multivariate Flags (JSON)

Complex objects. Use for structured configuration.

When to use:

  • Configuration objects with multiple fields
  • UI layout configurations
  • Feature bundles (multiple settings in one flag)

Configuration:

{
  "kind": "multivariate",
  "variations": [
    {"value": {"theme": "light", "density": "comfortable"}, "name": "Default"},
    {"value": {"theme": "dark", "density": "compact"}, "name": "Dark Compact"}
  ]
}

Naming Conventions

Flag Keys

Flag keys are immutable identifiers. Choose carefully.

Common conventions:

Convention Example When used
kebab-case new-checkout-flow Most common, LaunchDarkly default
snake_case new_checkout_flow Common in Python/Ruby codebases
camelCase newCheckoutFlow Sometimes in JS/TS codebases
dot.notation checkout.new-flow Hierarchical organization

Always check the existing codebase for which convention is in use before creating a new flag.

Good key practices:

  • Descriptive but concise: new-checkout-flow not the-new-checkout-flow-feature
  • Feature-oriented: dark-mode not jira-1234
  • Avoid dates: new-pricing not new-pricing-2025

Flag Names

The human-readable display name in the LaunchDarkly UI. Can be changed later (unlike keys).

Good name practices:

  • Use title case: "New Checkout Flow"
  • Be descriptive: "Dark Mode Toggle" not "DM"
  • Include context: "Checkout V2 (Q1 Experiment)" can be helpful

Temporary vs Permanent

Temporary Flags (default)

  • Expected to be removed after the feature is fully rolled out
  • LaunchDarkly tracks these for cleanup reminders
  • Most feature toggles and release flags are temporary

Permanent Flags

  • Long-lived configuration that should NOT be cleaned up
  • Kill switches, ops toggles, plan-based feature gating
  • Only mark as permanent when the user explicitly says the flag is long-lived

Tags

Tags help organize flags in LaunchDarkly. Suggest tags based on:

Category Example tags
Team team-checkout, team-platform
Feature area payments, onboarding, search
Flag purpose experiment, release, ops
Lifecycle q1-2025, migration

Best Practices for Variations

Boolean Flags

  • Name variations: true -> "Enabled" / "New behavior", false -> "Disabled" / "Old behavior"
  • Set offVariation to false (index 1)

Multivariate Flags

  • Always include a "control" or "default" variation
  • Give every variation a descriptive name
  • Consider what the offVariation should be: typically the control/default
  • Order variations with the default/control first

Default Values in Code

  • The default value (fallback) in your code should ALWAYS be the safe/existing behavior
  • For boolean flags: default to false (feature off) unless the feature is already live
  • For multivariate: default to the control/existing variation
  • This ensures graceful degradation if LaunchDarkly is unreachable

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides guidelines and instruction on creating and managing LaunchDarkly feature flags, relying entirely on the official LaunchDarkly MCP server tools and following standard developer practices.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    2/5 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3039201. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 months ago
compatibility
Requires the remotely hosted LaunchDarkly MCP server
metadata
{
  "author": "launchdarkly",
  "version": "1.1.0-experimental"
}

README badge

README badge for launchdarkly/agent-skills/launchdarkly-flag-create

Creates and configures LaunchDarkly feature flags by first exploring the codebase for existing flag patterns, then applying those conventions to create the flag and add evaluation code. Works with the LaunchDarkly MCP server to handle flag creation and metadata updates.

Generated from the current SKILL.md.

Does this skill handle flag targeting and rollouts?
No. This skill creates and configures flags. To toggle flags on, set up rollout rules, or target specific users, use the flag targeting skill.
What happens if LaunchDarkly is unreachable when my code evaluates a flag?
The SDK falls back to the default value you specify in code. That's why the skill guides you to use the existing/safe behavior as the default—it ensures the feature stays off if LaunchDarkly is down.
Can I change a flag's key after creating it?
No. Flag keys are immutable once created, so the skill helps you choose the right key upfront by examining your codebase's naming conventions.
Do I need the LaunchDarkly MCP server to use this skill?
Yes. The skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment to create and verify flags.
Does this skill work with all LaunchDarkly SDKs?
The skill guides flag creation for any SDK and helps you match existing patterns in your codebase, whether you're using the Node, React, Python, Go, Java, or other LaunchDarkly SDK.

Generated from the current SKILL.md. These answers refresh after source changes.