Feature Flags
Flags reduce blast radius when designed with defaults, targeting, and a removal plan. Permanent flags are architecture; temporary flags need expiry.
Workflow
- Purpose: release, experiment, ops kill switch, or entitlement.
- Default (fail closed/open) and who is in the control path.
- Targeting: user, tenant, percentage, ring.
- Consistency: sticky assignment where UX requires it.
- Observability: metrics by flag state; kill switch path tested.
- Cleanup: owner, removal criteria, ticket for deletion.
Output format
## Flag plan: <name>
**Type:** release | experiment | ops | entitlement
**Default:** …
**Targeting:** …
**Kill switch:** …
**Metrics:** …
**Cleanup:** owner, date/criteria
**Code touchpoints:** …
Rules
- Name flags clearly; avoid
newThing2. - Never leave long-lived dead code paths without owners.
- Server-authoritative for security-sensitive entitlements.
- Document multi-flag dependencies (flag soup).
- Experiments need hypothesis and success metrics.
- Do not invent flag platform APIs; describe capabilities generically.
Edge cases
- Mobile: cached flag freshness and forced updates.
- Migrations: dual-write flags with explicit phases.
- B2B: tenant-level flags vs user-level.