What problem does it solve?
When a Sanity config value can be supplied by both root config and plugins, it needs deterministic merge behavior. This Skill guides adding and reviewing config property reducers in packages/sanity/src/core/config so values resolve consistently across sources.
Core Features & Use Cases
- Reducer Pattern Guidance: Standardizes reducers that flatten config, reduce from an explicit initial value, ignore undefined entries, and throw typed errors for invalid values.
- Beta Flags and Default Plugin Gates: Covers adding beta flags under BetaFeatures and gating default plugin injection with reduced values computed early in prepareConfig.
- Type Exposure: Explains declaring input types in PluginOptions or WorkspaceOptions and exposing resolved values on Source or Workspace.
- Use Case: When adding a new feature flag like beta.feature.enabled that plugins can override, use this Skill to write the reducer, wire it into prepareConfig, and add tests for defaults, precedence, and invalid values.
Quick Start
Ask the assistant to add a new reduced Sanity config property, such as a beta feature flag, following the reducer pattern in packages/sanity/src/core/config.