agentleFS
ElasticKnown publisherelastic/docs-builder/.claude/skills/feature-flag/SKILL.md

feature-flag

Skill25 starsChanged 19 days agoApache-2.0View on GitHub

Registers a feature flag as additive-only and verifies the flag-off path still matches the previous default. Use whenever adding or extending a feature flag, editing FeatureFlags.cs, changing feature_flags in assembler.yml, gating a code path behind a FEATURE_* environment variable, or enabling a flag in an environment. Do not skip this skill for flag work even if the user does not name it.

We split this skill into the rules it gives an agent

10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read this skill before you add any of these:

    line 18
  2. Very specific:

    Follow the test pattern in tests/Elastic.Documentation.Build.Tests/FeatureFlagsTests.cs

    line 32
  3. Distinctive:

    Do not move, hide, relocate, or delete existing output when you introduce the flag.

    line 40
  4. Very specific:

    Add a typed property on FeatureFlags.

    line 46
  5. Distinctive:

    Add YAML keys only in the environments that opt in.

    line 47
  6. Very specific:

    Do not turn the flag on in prod as part of creating it.

    line 48
  7. Very specific:

    Put the if (flag) around new code.

    line 52
  8. Distinctive:

    If anything that already shipped is missing, moved, or changed when the flag is off, stop.

    line 62
  9. Distinctive:

    Do not ship a flag whose existing behavior lives only on the new path.

    line 74
  10. Distinctive:

    Do not treat "the new path has it" as coverage for the old path.

    line 76

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Feature Flag Skill

A feature flag is additive. Flag off keeps the previous default. Flag on adds new behavior only.

When to use

Read this skill before you add any of these:

  • A typed flag on FeatureFlags
  • A feature_flags YAML key
  • A FEATURE_* environment override
  • An if (flag) around a code path

How flags work

  • Typed flags live in src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs
  • Keys normalize to kebab-case. The env override is FEATURE_<UPPER_SNAKE>
  • Per-environment YAML keys live under feature_flags in config/assembler.yml as UPPER_SNAKE
  • Flags stay off unless listed. Do not enable a new flag in prod when you create it
  • PublishEnvironment.ToFeatureFlags() in src/Elastic.Documentation.Configuration/Assembler/PublishEnvironment.cs loads YAML keys through Set()
  • Follow the test pattern in tests/Elastic.Documentation.Build.Tests/FeatureFlagsTests.cs

Steps

1. Additive means

Flag off equals the previous default in behavior. Flag on adds new behavior only.

Do not move, hide, relocate, or delete existing output when you introduce the flag.

New behavior is a new panel, a new build step, or a new field. It is not a relocated copy of something that already shipped.

2. Register the flag

  1. Add a typed property on FeatureFlags. The default stays false.
  2. Add YAML keys only in the environments that opt in.
  3. Do not turn the flag on in prod as part of creating it.

3. Gate only the new path

Put the if (flag) around new code. Leave the existing branch as it was.

Shared markup, layout, and data wiring that the old path still needs stay outside the flag.

4. Verify additivity before you finish

This step is required. Do not skip it.

  1. List every existing surface the change touches. Include render paths, CLI output, build steps, API payloads, mobile and desktop, and assembler vs isolated builds.
  2. For each surface, compare the flag-off branch to the pre-change code or output.
  3. If anything that already shipped is missing, moved, or changed when the flag is off, stop. Restore it on the default path.

5. Prove it with tests

  • The flag defaults to false.
  • Flag-off preserves existing behavior.
  • Flag-on shows the new behavior.
  • Sibling flags stay unchanged.
  • Prod, or the default environment, does not enable the new flag.

6. Stop conditions

Do not ship a flag whose existing behavior lives only on the new path.

Do not treat "the new path has it" as coverage for the old path.

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.