agentleFS
anandartinanandartin/celestial-skills/skills/feature-flags-engineering/AGENTS.md

celestial-skills / feature-flags-engineering

AGENTS.md1 starsChanged 18 days agoApache-2.0View on GitHub

Ship code dark, roll it out in stages, switch it off in seconds, and delete the flag once the rollout is done. Generated from the Celestial engineering practice “Feature flags”.

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Never use a client-side flag to protect data or permissions.

    line 22
  2. Distinctive:

    Do not nest flags or make one flag depend on another.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
AGENTS.md

AGENTS.md — Feature flags

Ship code dark, roll it out in stages, switch it off in seconds, and delete the flag once the rollout is done.

How to do it

  1. Pick the flag type — Release flag (temporary, hides unfinished work), experiment flag (temporary, splits users for measurement), operational kill switch (long-lived, disables a costly or fragile path), or permission flag (long-lived, entitlement). Record the type when creating it.
  2. Create the flag with an owner and expiry — Name it area_change in snake_case, set the owner, the type, a removal date for temporary flags, and a safe default that is used when the flag service is unreachable.
  3. Evaluate at one decision point — Read the flag once per request near the edge and pass the result down. Keep both code paths tested; the off path must be today's behaviour.
  4. Roll out in stages — Internal users, then 1%, 10%, 50%, 100%, holding at each step long enough to see error rate, latency and the journey's key metric. Use sticky bucketing by user or account ID.
  5. Define the kill criteria in advance — Write which metric movement turns the flag off (e.g. error rate up 0.5 points or p95 latency up 20%) and who may flip it. Flipping off must not need a deploy.
  6. Remove the flag after full rollout — Within two weeks of 100%, delete the flag check, the old code path, its tests and the flag definition in one pull request. Archive the flag in the flag service last.

Checklist (before a pull request)

  • Flag has an owner, a type and, if temporary, a removal date
  • Default value is safe when the flag service is down
  • Tests cover both the on and off paths
  • Rollout stages and kill criteria are written in the pull request or ticket
  • Flag changes are audited: who changed what, when
  • No temporary flag is older than its removal date

Rules

  • Never use a client-side flag to protect data or permissions; enforce access on the server. (Client flags can be read and flipped by anyone with developer tools.)
  • Evaluate flags from a locally cached rule set; never make a network call per check. (Flag checks sit in hot paths and must not add latency or a new failure point.)
  • Do not nest flags or make one flag depend on another. (Combinations grow exponentially and untested paths reach production.)
  • Log flag variant with analytics events and traces for any flagged code path. (Lets you compare outcomes between variants and spot which one caused an incident.)
  • Database schema changes behind a flag use expand-then-contract so both paths work at once. (Turning a flag off must not break on data written by the other path.)

Checks

GateToolThresholdWhen
Stale flag checkCI script comparing flag definitions to code references and expiry dates0 temporary flags past removal date; 0 flags defined but unreferencedEvery pull request and weekly

Generated from the Celestial engineering practice “Feature flags”.

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.