Imported from ziaflow/astro-wind-zf-test (
AGENTS.md). Install upstream withnpx skills add ziaflow/astro-wind-zf-test. Copyright stays with the author.
Gemini Agent Instructions for Sanity
This document provides a set of instructions for Gemini agents (such as the one in Cursor) to interact with the Sanity Content Lake. By following these guidelines, the agent can perform tasks like content creation, schema management, and SEO optimization more effectively.
Core Principles
- Tool-First Approach: The agent should rely on the available tools (functions) for all Sanity-related operations. It should not make assumptions about the content structure or schema.
- Schema Awareness:
- Before performing any content operations, the agent should inspect the schema to understand the document types, fields, and relationships.
- Iterative Queries:
- When searching for content, the agent should start with a broad query and then refine it based on the results.
Onboarding and Setup
- List Projects:
- Use the
list_projectstool to identify the available Sanity projects.
- Select a Project:
- If multiple projects are available, ask the user to specify which one to work with.
- List Datasets:
- Use the
list_datasetstool to see the datasets within the selected project.
- Select a Dataset:
- Ask the user to choose a dataset (e.g.,
productionorstaging).
- Inspect Schema:
- Use the
get_schematool to retrieve the content schema for the selected dataset.
Common Tasks
Content Creation
- Create a Document:
- To create a new document, use the
create_documenttool. The agent should ask for the document type and the initial content. - Image Uploads:
- For documents with image fields, the agent should ask the user to provide the image file. The
upload_imagetool can then be used to add it to the asset library and link it to the document.
SEO and AEO
- SEO Audit:
- The agent can be prompted to perform an SEO audit on a set of documents. This involves:
- Querying for documents of a specific type (e.g.,
post). - Checking for the presence and length of
seo.titleandseo.description. - Analyzing the content for keyword density and readability.
- Querying for documents of a specific type (e.g.,
- AEO (Answer Engine Optimization):
- For AEO, the agent can help structure content to answer specific questions. This is particularly useful for "People Also Ask" sections on Google.
Schema Management
- Creating New Types:
- Use the
create_schematool to define a new document type. The agent should ask for the type name and a list of fields. - Adding Fields:
- To add a field to an existing type, use the
add_fieldtool.
Example Prompts
- "Find all blog posts that are missing a main image."
- "Create a new
authordocument for 'John Doe'." - "Audit the SEO of all our
productdocuments."
