Sanity singleton documents
Sets up settings, navigation and footer documents in Sanity Studio, so editors edit them in place, no duplicates.
Claude's review
8/10 Detailed Sanity singleton registry and structure traps with version requirements
We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.
In detail
Configure singleton documents in a Sanity Studio using the document.singletons registry. Use when a developer wants a fixed-id document (settings, navigation, footer) edited in place, hidden from the default content list, with no "create new" or "duplicate" affordances — or when migrating a userland singleton implementation or a third-party singleton plugin (e.g. sanity-plugin-singleton-management) to the first-class API.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: sanity-singletons
description: Configure singleton documents in a Sanity Studio using the document.singletons registry. Use when a developer wants a fixed-id document (settings, navigation, footer) edited in place, hidden from the default content list, with no "create new" or "duplicate" affordances — or when migrating a userland singleton implementation or a third-party singleton plugin (e.g. sanity-plugin-singleton-management) to the first-class API.
---
# Sanity Singletons
A "singleton" is a document with a fixed id that can be created exactly once. Common examples: site settings, navigation, footer content. Studio supports singletons as a first-class primitive via the `document.singletons` configuration registry plus a small set of Structure Tool helpers.
**Requires `sanity` 6.17.0 or later.** Check the installed version in the lockfile before using this API. On older Studios, either upgrade first or use the userland pattern (fixed `documentId` in a custom structure, plus manual `newDocumentOptions` and `duplicate` filtering) described in `sanity-best-practices` → `studio-structure`.
## When to use this skill
- A developer asks how to create a "settings document" or "singleton".
- A studio configuration needs a `document.singletons` registry entry.
- Structure Tool needs to render a singleton as a list item or document pane.
- You're migrating an existing userland singleton implementation to the first-class API.
- You're migrating from a third-party singleton plugin such as `sanity-plugin-singleton-management` (or its predecessor `sanity-plugin-singleton-tools`).
## Registering a singleton
Singletons are registered in configuration, **not** on the schema type. A singleton definition binds a _definition id_ to a _document id_ and a _schema type_:
```ts
import {defineConfig, defineSingleton} from 'sanity'
export default defineConfig({
schema: {
types: [/* siteSettings and campaign are ordinary document types */],
},
document: {
singletons: [
// String shorthand — expands to
// {id: 'siteSettings', documentId: 'siteSettings', schemaType: 'siteSettings'}
'siteSettings',
// Definition object. `defineSingleton` is an optional typed identity
// helper; a plain object literal works too. `id` is omitted here, so it
// inherits each `documentId`.
defineSingleton({
...From sanity-io's repository, MIT licence.
Related skills
-
Checked
TinyBase app builder
Scaffolds and extends local first JavaScript apps with TinyBase, including schemas, persistence and sync.
7/101 credit -
Checked
ComfyUI custom node UI
Adds widgets, sidebar tabs, commands and dialogs to ComfyUI custom nodes, so your node feels built in.
8/101 credit -
Checked
Scrolling menu upgrade
Finds outdated react-horizontal-scrolling-menu code and rewrites it for version 8 so the menu works again.
7/101 credit -
Checked
Scroll Menu Testing and SSR
Gets react-horizontal-scrolling-menu working in Next.js and tested in Jest and Playwright without flicker.
7/101 credit -
Checked
Screenshot to React code
Rebuilds a screenshot or mockup as React, TypeScript and Tailwind code that closely matches the design.
7/101 credit -
Checked
Map location picker
Adds a map pin picker to a web form, so users can choose and submit one exact spot like a delivery address.
7/101 credit