Agent skill
sanity-scaffold
Interactively scaffold a new Sanity Schema Document or Object type using best-practice templates. Use when user wants to create new content types.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/sanity-scaffold
SKILL.md
Schema Scaffolder
This skill guides the user to create a new Sanity document type, ensuring it follows the "Data > Presentation" philosophy and strict typing rules.
Procedure
-
Discovery
- Run
ls -R src/schemaTypes(orschemas) to understand the project structure. - Read
src/schemaTypes/index.ts(or equivalent) to see how schemas are registered.
- Run
-
Input Gathering
- Ask: "What is the name of the content type (e.g., 'blogPost', 'author')?"
- Ask: "Is this a Document (standalone) or an Object (embedded)?"
- Ask: "What are the key fields needed?"
-
Drafting (Template Based)
- Action: Read the template file:
templates/document.ts(ortemplates/object.ts/templates/singleton.ts). - Action: Create the new file content by replacing the
{{name}}and{{title}}placeholders in the template with the user's input. - Constraint: Ensure the
iconimport is preserved or updated to a relevant icon from@sanity/icons. - Singleton Note: If using
singleton.ts, remind user that singletons require Desk Structure configuration (see template comments). Offer to help set up the structure.
- Action: Read the template file:
-
Execution
- Write the generated file to the correct folder (e.g.,
src/schemaTypes/documents/). - Read
src/schemaTypes/index.ts. - Add the import line for the new schema.
- Add the new type to the export array.
- Write the generated file to the correct folder (e.g.,
-
Verification
- Run
npm run typegen(if available) to verify syntax. - Confirm success to the user.
- Run
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?