What problem does it solve?
New user-facing features shipped without rollout controls can expose unfinished functionality to all users at once. This Skill documents the vm0 feature switch system and provides step-by-step instructions for gating features behind flags for gradual, controlled rollout.
Core Features & Use Cases
- Switch Registration: Add a key to the FeatureSwitchKey enum and register it in the FEATURE_SWITCHES record with maintainer, default state, and per-user, per-email, or per-org hash allowlists.
- Multi-Layer Gating Patterns: Apply gating in server-side API routes, client-side platform UI components, sidebar navigation, connector auth methods, and agent token capabilities.
- Override Layers: Understand the two-layer evaluation model combining the static core registry with database overrides stored per user or per org via the feature-switches API.
- Use Case: When adding a new sidebar page, register a switch with staff-only org hashes, gate the nav item by reading featureSwitch$, and later flip enabled to true for general availability.
Quick Start
Ask the AI to add a new feature switch named MyFeature and gate a new sidebar navigation item behind it following the feature-switch guide.