feature-flag-ops
Skill1 starsChanged 9 months agoMITView on GitHub
Manages the full lifecycle of feature flags - creation, progressive rollout, kill switches, percentage ramps, user targeting, and cleanup. Use when releasing features behind flags, managing rollouts, or cleaning up stale flags.
In this repository48 other files it gives its agents.
- accessibilitySkill
- api-designSkill
- api-integrationSkill
- architectSkill
- async-patternsSkill
- best-practicesSkill
- bugSkill
- buildSkill
- cachingSkill
- ci-cdSkill
- config-managementSkill
- containerizeSkill
- database-designSkill
- data-modelingSkill
- data-pipelineSkill
- debug-latencySkill
- dependency-updateSkill
- deploySkill
- dev-setupSkill
- docsSkill
- error-handlingSkill
- estimateSkill
- git-recoverySkill
- i18nSkill
- iacSkill
- incidentSkill
- load-testingSkill
- loggingSkill
- migrateSkill
- monitoringSkill
- observability-debugSkill
- onboardSkill
- perfSkill
- phase-gateSkill
- pr-authorSkill
- qaSkill
- refactorSkill
- reviewSkill
- rollbackSkill
- schema-evolutionSkill
- scope-checkSkill
- security-auditSkill
- state-managementSkill
- tech-debtSkill
- tech-stackSkill
- telemetrySkill
- testingSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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
- Distinctive: line 16
Every flag should go through this lifecycle.
- Distinctive: line 28
Verify: feature works with flag ON
- Distinctive: line 29
Verify: existing behavior works with flag OFF
- Distinctive: line 45
Check support tickets (no new complaints)
- Distinctive: line 58
Set a cleanup date at creation time: If the flag is still alive 30 days after full rollout, it's tech debt.
- Distinctive: line 69
Most flags should be release flags: If you have > 10 permanent flags, audit them.
- Distinctive: line 73
Every feature behind a flag has an instant rollback mechanism.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.
Files
Feature Flag Operations
Feature flags decouple deployment from release. Deploy code any time. Release features when ready. Roll back without redeploying.
Flag Lifecycle
CREATE → TEST → RAMP → FULL ROLLOUT → CLEANUPEvery flag should go through this lifecycle. Flags that skip CLEANUP become permanent tech debt.
1. Create
FLAG NAME: enable_new_checkout
TYPE: release (temporary) / operational (permanent) / experiment (A/B test)
DEFAULT: false (OFF)
OWNER: [who's responsible for this flag]
CLEANUP DATE: [date to remove the flag - set it NOW]2. Test
- Verify: feature works with flag ON
- Verify: existing behavior works with flag OFF
- Both paths are tested in CI
3. Ramp (Progressive Rollout)
Day 1: 1% of users (canary - catch crashes)
Day 2: 5% of users (small sample - check metrics)
Day 3: 25% of users (moderate - verify at scale)
Day 5: 50% of users (large - final validation)
Day 7: 100% of users (full rollout)At each stage:
- Monitor error rate (should not increase)
- Monitor latency (should not degrade)
- Monitor business metrics (should not drop)
- Check support tickets (no new complaints)
4. Full Rollout
Flag is ON for 100% of users. Feature is fully released.
5. Cleanup (Critical - Don't Skip)
1. Remove the flag check from code (always return the "ON" path)
2. Remove the "OFF" code path entirely
3. Delete the flag from your flag management system
4. Merge cleanup PRSet a cleanup date at creation time. If the flag is still alive 30 days after full rollout, it's tech debt.
Flag Types
| Type | Lifetime | Example | Cleanup |
| Release flag | Days to weeks | New checkout flow | Remove after full rollout |
| Operational flag | Permanent | Maintenance mode, rate limit bypass | Keep (but review annually) |
| Experiment flag | Weeks | A/B test: button color | Remove after experiment concludes |
| Permission flag | Permanent | Premium features, beta access | Keep (tied to entitlements) |
Most flags should be release flags. If you have > 10 permanent flags, audit them.
Kill Switch
Every feature behind a flag has an instant rollback mechanism.
INCIDENT: New checkout causing payment failures
ACTION: Toggle enable_new_checkout → OFF
EFFECT: All users immediately get old checkout
TIME: < 1 minute (no deployment needed)Kill Switch Checklist
- Flag can be toggled in < 60 seconds (UI or CLI)
- Toggling OFF immediately disables the feature (no cache delay)
- On-call knows how to toggle flags
- Runbook documents which flags to kill for which symptoms
Targeting
Percentage Rollout
enable_new_checkout:
percentage: 25 # 25% of users see new checkout
sticky: true # Same user always gets same experienceSticky randomization: Hash(user_id + flag_name) determines bucket. Same user always gets the same result.
User Targeting
enable_new_checkout:
users:
- internal@company.com # Always ON for internal testing
- beta_user@gmail.com # Specific beta users
percentage: 0 # OFF for everyone elseAttribute Targeting
enable_new_checkout:
rules:
- if country IN ["US", "CA"]: percentage 50
- if plan == "enterprise": ON
- default: OFFCode Patterns
Simple Flag Check
# GOOD: Clean branching
if feature_flags.is_enabled("new_checkout", user):
return new_checkout_flow(cart)
else:
return old_checkout_flow(cart)Don't Nest Flags
# BAD: Combinatorial explosion
if flag_a and flag_b:
# path 1
elif flag_a and not flag_b:
# path 2
elif not flag_a and flag_b:
# path 3
else:
# path 4
# 4 code paths = 4x testing burdenKeep Flag Scope Small
# BAD: Flag wraps 500 lines of code
if feature_flags.is_enabled("new_flow"):
# ... 500 lines ...
else:
# ... 500 lines ...
# GOOD: Flag selects a strategy, both paths share most code
processor = NewProcessor() if feature_flags.is_enabled("new_flow") else OldProcessor()
result = processor.handle(request) # Same interfaceMonitoring Flags
| Metric | Alert |
| Total active flags | Alert if > threshold (flag sprawl) |
| Flag age | Alert if release flag > 30 days old (stale) |
| Flag without owner | Alert (orphaned flag) |
| Error rate per flag variant | Alert if ON variant has higher errors |
| Rollout percentage changes | Audit log (who changed what, when) |
Flag Hygiene
Monthly Flag Review
For each active flag:
- Is it still needed?
→ Release flag at 100%? CLEAN UP
→ Experiment concluded? CLEAN UP
→ Operational flag? Review if still relevant
- Does it have an owner?
→ No owner? Assign one or clean up
- Is it tested?
→ Both ON and OFF paths covered in tests?Maximum Active Flags
Set a team limit (e.g., max 15 active flags). When you hit the limit, clean up before creating new ones. This prevents flag sprawl.
Anti-Patterns
| Anti-Pattern | Problem | Fix |
| Flags never cleaned up | Code full of dead branches, combinatorial complexity | Set cleanup dates, enforce in reviews |
| Nested/dependent flags | Untestable combinations | One flag per feature, no nesting |
| Flag as permanent config | Bypasses proper config management | Use config for config, flags for rollout |
| No monitoring per variant | Can't tell if new path is broken | Monitor metrics split by flag variant |
| Manual percentage decisions | Inconsistent, risky | Follow standard ramp schedule |
| Testing only ON path | OFF path breaks, rollback fails | Test both paths in CI |
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
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.

