What problem does it solve?
Adding a feature flag in Webiny touches many files across multiple packages, and missing one step causes flags to silently fail or bypass license gating. This Skill provides the complete procedure for wiring a flag through the DTO type, KnownFeatureFlag union, toDto(), Zod schema, and WCP license decorators.
Core Features & Use Cases
- Simple Boolean Flags: Step-by-step instructions for adding a flag to IFeatureFlagsDto, KnownFeatureFlag, toDto(), and the Zod validation schema.
- Nested Flag Groups: Guidance for flags with sub-options using union types and dot-path resolution like myFeature.subFeatureA.
- License Gating: Explains the LICENSE_CHECKS decision flow and how to wire flags into all three license decorators at API, build, and config levels.
- Use Case: When building a new gated capability, use this Skill to gate it at the config level with FeatureFlag.CanUse, at admin runtime with useFeatureFlags().isEnabled(), and at the API level via the FeatureFlags abstraction.
Quick Start
Add a new feature flag called myNewFeature to the Webiny system and gate my extension component with it.