Official agent skill

Sanity Config Reducers

by sanity-io in sanity-io/sanity

Add and review Sanity config properties that are reduced across root config and plugins.

OfficialMITAuto-check passedFrontend & Design

Install Sanity Config Reducers

skills CLI
$ npx skills add sanity-io/sanity --skill sanity-config-reducers -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sanity-io/sanity sanity-config-reducers --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/sanity-config-reducers .claude/skills/sanity-config-reducers && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sanity-config-reducers
GitHub stars
6.4k
Token cost
~957 tokens
SKILL.md length
372 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Add and review Sanity config properties that are reduced across root config and plugins.

  • Works in 6 steps: Call flattenConfig(config, []). → Reduce from an explicit initialValue. → Read the property from each innerConfig. → …
  • Adding beta flags
  • SKILL.md covers Start Here, Reducer Pattern, Types And Exposure and Default Plugin Gates, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Sanity Config Reducers is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Add and review Sanity config properties that are reduced across root config and plugins. Use when adding beta flags, feature config, workspace/source options, default plugin gates, or resolved Source fields in packages/sanity/src/core/config.

Its SKILL.md is about 960 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering State management. The repository describes itself as: Sanity Studio – Rapidly configure content workspaces powered by structured content. The licence is MIT.

When your agent uses it

  • Adding beta flags
  • Workspace/source options
  • Default plugin gates
  • Resolved Source fields in packages/sanity/src/core/config

Example prompts

  • “/sanity-config-reducers”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Call flattenConfig(config, []).
  2. Reduce from an explicit initialValue.
  3. Read the property from each innerConfig.
  4. Ignore undefined.
  5. Accept only the documented type.
  6. Throw with getPrintableType(value) for invalid values.

What it can do on your machine

Read from SKILL.md and the folder at commit efa15fb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sanity Config Reducers loads about 957 tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 372 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~957

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sanity-io/sanity at commit efa15fb, republished under its MIT licence (© sanity-io). 372 words, ~957 tokens.

Download SKILL.mdSave it as .claude/skills/sanity-config-reducers/SKILL.md (or your agent's skills folder).
name
sanity-config-reducers
description
Add and review Sanity config properties that are reduced across root config and plugins. Use when adding beta flags, feature config, workspace/source options, default plugin gates, or resolved Source fields in packages/sanity/src/core/config.

Sanity Config Reducers

Start Here

Use this skill when a config value can be supplied by root config or plugins and needs deterministic merge behavior.

Inspect these files first:

  • packages/sanity/src/core/config/types.ts
  • packages/sanity/src/core/config/configPropertyReducers.ts
  • packages/sanity/src/core/config/prepareConfig.tsx
  • packages/sanity/src/core/config/flattenConfig.ts
  • packages/sanity/src/core/config/resolveDefaultPlugins.ts if the config gates default plugin injection.

Reducer Pattern

Reducers usually:

  1. Call flattenConfig(config, []).
  2. Reduce from an explicit initialValue.
  3. Read the property from each innerConfig.
  4. Ignore undefined.
  5. Accept only the documented type.
  6. Throw with getPrintableType(value) for invalid values.

Config namespaces should usually be objects, even when they initially only contain one flag. This keeps room for future options without changing the public shape. For booleans, prefer feature.enabled and follow this shape:

ts
export const featureEnabledReducer = (opts: {
  config: PluginOptions
  initialValue: boolean
}): boolean => {
  const {config, initialValue} = opts
  const flattenedConfig = flattenConfig(config, [])

  return flattenedConfig.reduce((acc, {config: innerConfig}) => {
    const enabled = innerConfig.feature?.enabled

    if (typeof enabled === 'undefined') return acc
    if (typeof enabled === 'boolean') return enabled

    throw new Error(
      `Expected \`feature.enabled\` to be a boolean, but received ${getPrintableType(enabled)}`,
    )
  }, initialValue)
}

Root config is flattened after plugin config, so root values usually win when a reducer overwrites with the latest defined value.

Types And Exposure

When adding a config property:

  • Declare the public or internal input type in PluginOptions, WorkspaceOptions, or the relevant nested type in types.ts.
  • Prefer extensible object namespaces such as beta.feature.enabled over direct booleans such as beta.feature.
  • If runtime code needs the resolved value, expose it on Source, Workspace, or the relevant prepared object in prepareConfig.tsx.
  • Keep raw config access through source.__internal.options as an implementation detail, not the primary runtime API.
Show full SKILL.md (169 more words)Show less

Default Plugin Gates

Default plugin lists are computed before full source resolution. If a config value controls default plugin injection:

  • Compute the reduced value early enough in prepareConfig.tsx, before calling getDefaultPlugins.
  • Thread that reduced value into getDefaultPluginsOptions or the options passed to getDefaultPlugins.
  • Use the same reducer later when exposing the resolved runtime value, so gating and runtime context agree.
  • Add tests for default false/true behavior and invalid values.

Beta Flags

Beta flags live under BetaFeatures in types.ts and resolved runtime values under source.beta.

Prefer a dedicated reducer when:

  • Plugins can set or override the flag.
  • Invalid values should produce helpful errors.
  • The flag gates default plugin injection.

Do not special-case beta flags in components by reading raw config if a resolved value can be exposed instead.

Verification

Add focused config tests for:

  • Default value.
  • Root config value.
  • Plugin-provided value.
  • Root-over-plugin precedence when relevant.
  • Invalid namespace object error message when the top-level config is malformed.
  • Invalid nested property error message, for example when enabled is not the documented type.

© sanity-io, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/sanity-config-reducers of sanity-io/sanity.

Open the folder on GitHubat commit efa15fb

Compare with similar skills

Sanity Config Reducers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sanity Config Reducers compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sanity Config Reducers this skillsanity-io/sanity6.4k—~957Automated safety check: PassMIT
Svelte Core Best Practicesrilldata/rill2.9k4 repos~1.8kAutomated safety check: PassApache-2.0
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
React State Managementinvolvex/youtube-music-cli45613 repos~3kAutomated safety check: PassMIT
Pierre Theming Librarypierrecomputer/pierre6.3k—~661Automated safety check: PassApache-2.0
Frontend Patternskurealnum/dotfiles29019 repos~3.7kAutomated safety check: PassNone

Similar skills

  • Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.

    2.9k GitHub starsUsed in 4 repos~1.8k tokens
    Frontend & DesignAuto-check passed
  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • React State Management

    involvex/youtube-music-cli

    Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.

    456 GitHub starsUsed in 13 repos~3k tokens
    Frontend & DesignAuto-check passed
  • Pierre Theming Library

    pierrecomputer/pierre

    Explains how to use the @pierre/theming package to list, resolve, select, switch and persist themes, with controller, color and React references.

    6.3k GitHub stars~661 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Frontend Patterns

    kurealnum/dotfiles

    Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

    290 GitHub starsUsed in 19 repos~3.7k tokens
    Frontend & DesignAuto-check passed
  • Explains how LobeHub client code fetches data through services, SWR store hooks and cache keys, and when to avoid useEffect fetching or duplicated state.

    83k GitHub stars~1.8k tokensUpdated today
    Frontend & DesignAuto-check passed

More from sanity-io/sanity

All 34 skills in this repo
  • Playwright CLI

    sanity-io/sanity

    Official

    Automates browser interactions for web testing, form filling, screenshots, and data extraction.

    6.4k GitHub starsUsed in 18 repos~1.9k tokens
    Auto-check passed
  • Find Skills

    sanity-io/sanity

    Official

    Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities.

    6.4k GitHub starsUsed in 67 repos~1.2k tokens
    Auto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 129 repos~1.6k tokens
    Auto-check passed
  • Before And After

    sanity-io/sanity

    Official

    Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block.

    6.4k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • React Devtools

    sanity-io/sanity

    Official

    React DevTools CLI for AI agents. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Auto-check passed

Questions about Sanity Config Reducers

What does Sanity Config Reducers do?

Add and review Sanity config properties that are reduced across root config and plugins. Sanity Config Reducers is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Add and review Sanity config properties that are reduced across root config and plugins.

When should I use Sanity Config Reducers?

Sanity Config Reducers fits situations like: adding beta flags; workspace/source options; default plugin gates; resolved Source fields in packages/sanity/src/core/config.

How do I install Sanity Config Reducers in Claude Code?

Run `npx skills add sanity-io/sanity --skill sanity-config-reducers -a claude-code`. Or copy the skill folder (.agents/skills/sanity-config-reducers in sanity-io/sanity) into .claude/skills/sanity-config-reducers in your project. Claude Code loads it when a task matches its description.

How do I install Sanity Config Reducers in Codex?

Run `npx skills add sanity-io/sanity --skill sanity-config-reducers -a codex`. Or copy the skill folder (.agents/skills/sanity-config-reducers in sanity-io/sanity) into .agents/skills/sanity-config-reducers in your project. Codex loads it when a task matches its description.

Can I use Sanity Config Reducers in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sanity-io/sanity --skill sanity-config-reducers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sanity-config-reducers, .gemini/skills/sanity-config-reducers, .github/skills/sanity-config-reducers and .opencode/skills/sanity-config-reducers in your project.

What does Sanity Config Reducers need to run?

SKILL.md names no scripts, command-line tools or credentials: Sanity Config Reducers is instructions for the agent only.

Does Sanity Config Reducers access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sanity Config Reducers safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sanity Config Reducers use?

Sanity Config Reducers is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sanity Config Reducers use?

About 957 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sanity Config Reducers?

Skills that share tags, products or a category with Sanity Config Reducers: Svelte Core Best Practices (rilldata/rill, 2.9k stars), Dify Component Writing Guide (langgenius/dify, 158k stars), React State Management (involvex/youtube-music-cli, 456 stars) and Pierre Theming Library (pierrecomputer/pierre, 6.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sanity Config Reducers?

sanity-io (a GitHub organization, an official publisher) maintains it in sanity-io/sanity, which has 6,352 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 9, 2026.

Source: sanity-io/sanity on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.