agentleFS
itsmuskanagarwalitsmuskanagarwal/claude-pack/skills/feature-flag-change/SKILL.md

feature-flag-change

Skill0 starsChanged 4 months agoMITView on GitHub

Wrap a risky or user-visible change behind a feature flag with a working kill switch. Use whenever a change affects production behavior for existing users, when strangler-migration's per-slice checklist calls for a flag flip, or when the user asks for a "safe" or "gradual" rollout. Enforces "no flag = no risky merge.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check CLAUDE.md / existing code for the repo's flag library (LaunchDarkly, Unleash, a homegrown config table, etc.) first.

    line 11
  2. Distinctive:

    Every flag-wrapped change generates a follow-up ticket at creation time, not after: "Remove flag <name> once <rollout criterion> is met" …

    line 30
  3. Distinctive:

    Verify OFF state == prior behavior (run old suite with flag forced off).

    line 40
  4. Distinctive:

    Verify ON state via the new/changed tests.

    line 41
  5. Distinctive:

    Create the cleanup ticket with rollout criterion and removal owner filled in — not left as a placeholder.

    line 42
  6. Distinctive:

    Never scatter flag checks across more than the minimum call sites needed.

    line 49
  7. Distinctive:

    Never ship a flag whose OFF state was assumed equivalent to prior behavior without actually running the old suite against it.

    line 50
  8. Distinctive:

    Never skip the cleanup ticket — "no flag = no risky merge" only holds if flags don't become permanent by default.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- owner: Muskan, added: 2026-07-16, model: claude-sonnet-5, review: quarterly -->

Feature-Flag-Guarded Change

Flag wrap pattern (per stack — pick the one already used in this repo;

never introduce a second flagging mechanism into a repo that has one)

  • Check CLAUDE.md / existing code for the repo's flag library (LaunchDarkly, Unleash, a homegrown config table, etc.) first. Only propose a new mechanism if none exists, and flag that as a decision for the user, not something to silently pick.
  • Wrap at the narrowest point that fully gates the new behavior — a single entry point, not scattered if (flag) checks across many files. Scattered checks are exactly what makes flags hard to clean up later.

Kill-switch requirement (non-negotiable)

  • The flag's OFF state must map to the exact previous behavior, verified by running the old test suite with the flag forced off after the change lands — not assumed from reading the diff.
  • The kill switch must be flippable without a deploy (config/remote-flag service, not a hardcoded constant requiring a rebuild) for anything touching production traffic. If the repo's flag mechanism can't do this, say so before proceeding — it changes the risk profile of the whole change.

Cleanup ticket (required, not optional)

Every flag-wrapped change generates a follow-up ticket at creation time, not after: "Remove flag <name> once <rollout criterion> is met" with the flag name, both code paths' locations, and the removal owner. A flag with no cleanup ticket is exactly how flag debt accumulates — do not skip this step even for a change that "will obviously get cleaned up."

Procedure

  1. Confirm the repo's flag mechanism (see above).
  2. Wrap the new behavior at the narrowest single point; old path stays the default until explicitly flipped.
  3. Verify OFF state == prior behavior (run old suite with flag forced off).
  4. Verify ON state via the new/changed tests.
  5. Create the cleanup ticket with rollout criterion and removal owner filled in — not left as a placeholder.
  6. Report both code paths' locations and the exact toggle mechanism (env var, config key, dashboard) so someone else can flip it without reading the diff.

Anti-patterns

  • Never scatter flag checks across more than the minimum call sites needed.
  • Never ship a flag whose OFF state was assumed equivalent to prior behavior without actually running the old suite against it.
  • Never skip the cleanup ticket — "no flag = no risky merge" only holds if flags don't become permanent by default.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.