sanity-plugin-authoring

Create and configure Sanity Studio plugins using the public plugin and tool APIs.

6.3k|550|Updated Jan 18, 2017
One-click install
npx skills add https://github.com/sanity-io/sanity --skill sanity-plugin-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanity-plugin-authoring
Source: https://github.com/sanity-io/sanity/tree/main/.agents/skills/sanity-plugin-authoring
Command: npx skills add https://github.com/sanity-io/sanity --skill sanity-plugin-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers extending Sanity Studio often struggle to understand what a plugin can configure, how to structure configurable options, and how to add tools, locale resources, and component overrides correctly through the public plugin API.

Core Features & Use Cases

  • Plugin Authoring Guidance: Explains how to define plugins with definePlugin(), stable names, and extensible option shapes.
  • Tool and Component Integration: Covers adding Studio tools through plugins, controlling tool menu order, and using studio.components middleware with renderDefault.
  • Localization Support: Shows how to register i18n locale resource bundles so plugin UI text is translatable instead of hard-coded.
  • Use Case: When building a preview URL plugin that resolves production URLs from document slugs, this Skill provides the exact definePlugin pattern, configuration surface, and registration steps.

Quick Start

Ask the agent to create a Sanity Studio plugin that adds a custom tool and document production URL resolver using definePlugin.

Frequently Asked Questions about sanity-plugin-authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Sanity Studio plugin?

Create a Sanity Studio plugin by calling definePlugin with a stable unique name and a configuration object covering properties like document, form, tools, or schema. Register it in the Studio's plugins array to activate it.

How do I make a Sanity plugin configurable with options?

Pass a function to definePlugin that accepts an options object and returns the plugin configuration. Prefer extensible object shapes like {feature: {enabled: true}} over direct booleans so future settings can be added without breaking changes.

What configuration properties can a Sanity plugin provide?

Plugins can provide document actions and badges, form customizations, nested plugins, tools, schema types, studio component overrides, i18n bundles, a title, and onUncaughtError handlers. They cannot set workspace-owned settings like dataset, projectId, auth, or theme.

How do I add a tool to Sanity Studio through a plugin?

Add the tool through the plugin's tools property with a stable name, title, component, and router when needed. Visual order follows tool registration order, and changing the default opened tool requires the top-level tools reducer pattern.

How do I add translations to a Sanity plugin UI?

Define an i18n locale resource bundle with a namespace, locale, and lazy resources import, then register it in the plugin's i18n.bundles array. This avoids hard-coding user-facing strings in plugin components.