Index of every page on this site: llms.txt
All skills
launchdarkly avatar

/should-flag-change

@f0ee110 official
Run it yourself

Decide whether a committed code change should ship behind a LaunchDarkly feature flag. Use when a developer asks whether a change should be behind a flag, when reviewing a diff or pull request, or when running in CI on a PR. Runs a fixed decision tree over the change and the code around it, with checked evidence, and emits a structured advisory recommendation. Run it on every change, including test-only, docs, dependency and already-flagged ones: those finish in a minute or two, and its verdict, not your own read of the diff, is the decision. Read-only: it never creates or modifies flags.

Use this Skill: https://skilld.dev/gh/launchdarkly/ai-tooling/should-flag-change

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesLAUNCHDARKLY.md

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

Supplying LaunchDarkly flag state

Some of the check's questions are about flags that already exist: is the code around the change behind a flag that's still off for real users? Is there an existing flag this change should reuse? Those are answered mechanically from each flag's current state in LaunchDarkly.

  • With your LaunchDarkly tools: ld-factory.pyz exits 7 and prints the list of flags it needs, one <project> <key> per line, with the environments to read. The same list is in RUN/launchdarkly-needed.txt. Fetch each with whatever LaunchDarkly tools you have and write it as below, then run the same command again. It may ask for a few more on the next run (a flag's prerequisites, or a flag an answer pointed at); repeat until it stops asking.
  • No way to read LaunchDarkly at all: run again with --no-launchdarkly. Questions about flag state then come back unclear, which sends the result to a person only when it depends on them.

The project's environments

When the repo's profile doesn't say which environments serve real users (a profile derived from the repo never does), the check uses the ones LaunchDarkly marks critical: of those, the ones with prod in their key when there are any (a critical environment that isn't, such as a dogfood instance, is still read but doesn't count as real users), else all of them. The first request for a flag asks for them too (a change that needs no flag never asks): list the project's environments with your LaunchDarkly tools and write RUN/launchdarkly/environments.json, every environment with its key and whether it's critical:

[{"key": "production", "critical": true},
 {"key": "eu-production", "critical": true},
 {"key": "staging", "critical": false}]

Then fetch each flag in every environment marked critical. Without either, flag state is read in production only, and the report says so.

The file

One file per flag: RUN/launchdarkly/<project>__<key>.json (two underscores), in the shape of LaunchDarkly's REST API GET /api/v2/flags/{project}/{key}. Only these fields are read; include every environment listed in launchdarkly-needed.txt that the flag has:

{
  "key": "new-checkout",
  "archived": false,
  "variations": [{"value": true}, {"value": false}],
  "environments": {
    "production": {
      "on": true,
      "offVariation": 1,
      "fallthrough": {"rollout": {"variations": [
        {"variation": 0, "weight": 10000},
        {"variation": 1, "weight": 90000}]}},
      "rules": [
        {"variation": 0, "disabled": false,
         "clauses": [{"op": "segmentMatch", "values": ["internal-staff"], "negate": false}]}
      ],
      "targets": [{"variation": 0, "values": ["user-123"]}],
      "contextTargets": [],
      "prerequisites": [{"key": "checkout-platform", "variation": 0}]
    }
  }
}
  • Variations are indexes into variations, everywhere: offVariation, fallthrough.variation, a rule's variation, a target's variation, a prerequisite's variation. If your tool reports variation values or names, convert each to its index.
  • Fallthrough and rules have either "variation": <index> or "rollout": {"variations": [{"variation": <index>, "weight": <w>}]}, with weights out of 100000 (a 10% rollout is 10000).
  • Rules: keep every clause; op, values and negate are what's read. A rule targeting only internal audiences (segments named like internal or staff) counts as not reaching real users. Keep each rule's disabled: a disabled rule serves nobody, and dropping the field makes it read as live.
  • Prerequisites are fetched as flags of their own. A prerequisite that's off fails for everyone, so the flag serves its off variation.
  • A flag that doesn't exist in that project: {"key": "<key>", "not_found": true}. Don't guess at another project.
  • An environment the flag doesn't have: leave it out.
  • Write what the tool returned. Never fill in a field you didn't read: a missing field reads as "unknown", which is safe; an invented one is not.

Where to get it

  • The LaunchDarkly MCP server's get-flags tool, with projectKey, flagKey and env: one call per flag and environment, all made together. Each result is this shape for its one environment: keep the first whole, and add each other environment's entry under its environments.

  • A get-flag-targeting tool (the Factory runtime's launchdarkly_get_flag_targeting): one call per flag and environment, all made together. Write its results in as they came, under the environment each was for, keeping the tool's field names (on, off_variation, fallthrough, rules with clauses, serves and disabled, targets, context_targets, prerequisites). Keep each rule's disabled: dropped, a disabled rule reads as live. Keep one result's variations as returned, each with its index: the tool may list them out of index order, and values alone would then bind the wrong indexes (write bare values only in index order). ld-factory.pyz converts this to the shape above itself, so don't reshape it. A variation can be just its index ("off_variation": 1). A result the tool marked as an error leaves that environment out:

    {"key": "new-checkout", "variations": [true, false],
     "environments": {"production": {"on": true, "off_variation": 1,
       "fallthrough": {"type": "variation", "variation": 0},
       "rules": [], "targets": [], "context_targets": [], "prerequisites": []}}}
  • Any other tool that reads a flag's targeting per environment: one call per flag and environment, assembled into the shape above. Check that the project key you pass is the one the needed file names.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alerttoday3 checks · Risk MEDIUM
  • Gen Agent Trust Hubtoday

    This skill utilizes a bundled executable that contains hidden Unicode characters, which could be used for malicious steganography, and it analyzes untrusted data from repositories and pull requests, making it susceptible to indirect prompt injection.

  • Sockettoday

    1 alert: gptSecurity

  • Snyktoday

    Risk: CRITICAL · 2 issues

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

Last checked against GitHub yesterday.

Activeupdated 2 days ago
metadata
{
  "author": "launchdarkly",
  "version": "0.5.3",
  "graph": "07355490e985"
}
Other metadata
compatibility
Advisory and read-only. Needs a git checkout with the change committed (shallow is fine; a --filter partial clone is filled in from its remote), a shell, git and Python 3.10+ (no packages). Reads LaunchDarkly flag state through your LaunchDarkly tools when available, and works without them. When it can't run (no shell, no checkout), it decides by judgment instead, from references/NO_CHECKOUT.md. Returns a structured verdict as a `recommend-flag` block.

README badge

README badge for launchdarkly/ai-tooling/should-flag-change