add-studio-feature-flag
Installation
SKILL.md
Add a Studio feature flag
Studio flags live in web/packages/studio and are wired into the FastAPI Studio bundle via marker replacement at runtime. Follow every step that applies so local dev, FastAPI builds, and cluster deploys stay consistent.
For broader Studio context, see .cursor/skills/studio-dev/SKILL.md.
1. Choose flag shape
| Helper | TypeScript value | Use when |
|---|---|---|
previewFlag(envVar, default?) |
true | 'preview' | false |
User-facing features that may show the Early Preview badge ('preview') |
booleanFlag(envVar, default?) |
boolean |
Internal toggles (no preview mode) |
stringFlag / numberFlag |
string / number | Rare; see web/packages/studio/src/constants/featureFlags/utils.ts |
Preview behavior: true and 'preview' are both truthy for if (featureFlags.myFlag). Only 'preview' triggers FeatureFlagBadge (see step 6).
Naming