feature-flags
Skill9 starsChanged 8 months agoMITView on GitHub
Feature flag strategies, rollout patterns, kill switches and flag lifecycle management
- Reads credentials
24 other projects use a version of this.
Adopted by
Most recently taken up by
- rshankras/claude-code-apple-skillstheir own version, first seen Nov 29, 2026
- getsentry/sentrytheir own version, first seen Nov 27, 2026
- hi-donwi/Donwi-Skillstheir own version, first seen Nov 22, 2026
- XData-si/xdata-agenthubtheir own version, first seen Nov 22, 2026
- growthbook/skillstheir own version, first seen Nov 18, 2026
- travissmithv1/claude-skillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use background-jobs, rate-limiting and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
YepAPISkillbackground-jobs
Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.
Also in 4 projects that use this
harperaaSkillrate-limiting
Implement rate limiting to prevent brute force attacks, spam, and resource abuse. Use this skill when you need to protect endpoints from automated attacks, prevent API abuse, limit request frequency, or control infrastructure costs. Triggers include "rate limiting", "rate limit", "brute force", "prevent spam", "API abuse", "resource exhaustion", "DoS", "withRateLimit", "too many requests", "429 error".
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 5 projects that use this
wpankSkillcaching
Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.
Also in 3 projects that use this
Microsoft AzureSkillrelease-management
Prepares and validates AI Landing Zone semantic releases. Use for changelog entries, manifest versions, release branches, tags, GitHub Releases, and post-release branch reconciliation.
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 7 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- react/react★ 253ksame name
- facebook/react★ 253ksame name
- getsentry/sentry★ 46ksame name
- BuilderIO/agent-native★ 7.8ksame name
- macro-inc/macro★ 6.6ksame name
- primer/react★ 3.9ksame name
- marcus/sidecar★ 1.1ksame name
- rshankras/claude-code-apple-skills★ 915same name
- kid-sid/claude-spellbook★ 190same name
- irahardianto/awesome-agv★ 157same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- adrSkill
- ai-ml-engineeringSkill
- api-documentationSkill
- api-gateway-patternsSkill
- architecture-review-boardSkill
- backend-reviewSkill
- chaos-engineeringSkill
- code-reviewSkill
- compliance-reviewSkill
- cost-optimizationSkill
- csharp-dotnet-reviewSkill
- database-reviewSkill
- data-engineeringSkill
- design-patternsSkill
- developer-experienceSkill
- devops-infraSkill
- domain-modelingSkill
- elixir-reviewSkill
- engineering-budgetSkill
- engineering-metricsSkill
- event-driven-architectureSkill
- flutter-reviewSkill
- frontend-reviewSkill
- full-reviewSkill
- git-flowSkill
- go-reviewSkill
- graphql-reviewSkill
- health-checkSkill
- incident-postmortemSkill
- kubernetes-reviewSkill
- migration-strategySkill
- multi-tenancySkill
- observabilitySkill
- on-call-designSkill
- one-on-oneSkill
- pentestSkill
- performance-profilingSkill
- pr-descriptionSkill
- python-reviewSkill
- quality-standardSkill
- rust-reviewSkill
- security-reviewSkill
- sprint-planningSkill
- swift-reviewSkill
- systematic-debuggingSkill
- team-scalingSkill
- tech-debt-prioritizationSkill
- technical-interviewSkill
- tech-specSkill
- terraform-iacSkill
- testing-strategySkill
- ux-reviewSkill
- vendor-evaluationSkill
The file
Files
Feature Flags
When to Use
- Gradual rollout of new features (canary, percentage)
- A/B testing
- Kill switch for risky features in production
- Trunk-based development (merge without releasing)
- Customer-specific feature enablement
Flag Types
| Type | Purpose | Lifespan | Example |
| Release | Control feature rollout | Short (days-weeks) | ENABLE_NEW_BILLING_UI |
| Experiment | A/B testing | Medium (weeks) | EXPERIMENT_CHECKOUT_V2 |
| Ops | Kill switch | Permanent | ENABLE_EXTERNAL_PAYMENTS |
| Permission | Per-customer features | Permanent | PREMIUM_ANALYTICS |
Implementation
Simple (Config-based)
// Feature flags from environment/config
const FLAGS = {
ENABLE_NEW_BILLING: process.env.FF_NEW_BILLING === 'true',
ENABLE_DARK_MODE: process.env.FF_DARK_MODE === 'true',
};
// Usage
if (FLAGS.ENABLE_NEW_BILLING) {
return this.newBillingService.process(order);
} else {
return this.legacyBillingService.process(order);
}Advanced (Database-backed)
@Entity('feature_flags')
class FeatureFlag {
@PrimaryColumn()
key: string; // 'ENABLE_NEW_BILLING'
@Column({ default: false })
enabled: boolean; // Global toggle
@Column({ type: 'int', default: 0 })
rollout_percentage: number; // 0-100
@Column({ type: 'simple-array', nullable: true })
allowed_tenants: string[]; // Specific tenants
@Column({ type: 'simple-array', nullable: true })
allowed_users: string[]; // Specific users
@Column({ type: 'timestamp', nullable: true })
expires_at: Date; // Auto-disable date
}
@Injectable()
export class FeatureFlagService {
constructor(
@InjectRepository(FeatureFlag) private repo: Repository<FeatureFlag>,
private cache: CacheManager,
) {}
async isEnabled(
key: string,
context: { userId?: string; tenantId?: string },
): Promise<boolean> {
const flag = await this.getFlag(key);
if (!flag || !flag.enabled) return false;
// Check expiration
if (flag.expires_at && flag.expires_at < new Date()) return false;
// Check specific tenant
if (flag.allowed_tenants?.includes(context.tenantId)) return true;
// Check specific user
if (flag.allowed_users?.includes(context.userId)) return true;
// Check percentage rollout (deterministic by userId)
if (flag.rollout_percentage > 0 && context.userId) {
const hash = this.hashUserId(context.userId);
return (hash % 100) < flag.rollout_percentage;
}
// No specific rules + globally enabled
return flag.allowed_tenants?.length === 0 && flag.allowed_users?.length === 0;
}
private hashUserId(userId: string): number {
let hash = 0;
for (let i = 0; i < userId.length; i++) {
hash = ((hash << 5) - hash) + userId.charCodeAt(i);
hash |= 0;
}
return Math.abs(hash);
}
}Rollout Strategy
10% → 25% → 50% → 100%
│ │ │ │
└─ Monitor metrics for 24h at each stage
If error rate increases → rollback to previous %
If stable → advance to next %Rollout Checklist
- Feature flag created with
enabled: false - Internal testing (allowed_users: [team])
- Staging validation
- 10% rollout (canary)
- Monitor for 24h (error rate, latency, user feedback)
- 50% rollout
- Monitor for 24h
- 100% rollout
- Remove flag code after 2 weeks of 100%
Flag Lifecycle
Created → Testing → Canary → Rollout → Full → CLEANUP
│
└── Remove flag code
Remove from database
Delete from config
CRITICAL: Flags without cleanup become tech debt!
Schedule cleanup date at creation.Anti-Patterns
- ❌ Nested flags (
if (flagA && flagB && !flagC)) - ❌ Flags that never get cleaned up (> 3 months old)
- ❌ Testing only with flags ON (also test OFF)
- ❌ Using flags for permanent business logic (use permissions)
- ❌ Too many flags (> 20 active = confusion)
Quality Gates
- Every flag has an owner and expiration date
- Cleanup task created when flag reaches 100%
- Dashboard showing all active flags and their rollout %
- Alert if flag is > 90 days old without cleanup
- Both flag-on and flag-off paths tested
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.

