AI-powered Content SDK development
Developing with the Content SDK has become increasingly streamlined with the introduction of AI-assisted workflows. The repository now features comprehensive guardrails and capability groupings designed specifically to guide AI agents in producing accurate, performant, and reliable code.
The foundation of this guidance lies in strict architectural boundaries and rules. The AI guidance emphasizes the separation between base SDK packages and the individual Next.js application templates (App Router and Pages Router). AI agents are instructed to respect these boundaries, ensuring they never modify core SDK code when working on an application, nor do they hallucinate APIs that do not exist in the platform.
Additionally, development tasks have been broken down into a structured Skills system located in .agents/skills directories. These capability groupings provide specialized rules for distinct tasks, such as handling GraphQL data fetching, editing-safe rendering, and component scaffolding. By leveraging these granular instructions, teams can effectively utilize AI agents to automate tedious workflows while maintaining strict adherence to Sitecore's architectural standards.
Agents and skills
The AGENTS.md file serves as a central guide for AI agents (like Claude, Copilot, or Cursor) working on the Sitecore Content SDK monorepo or scaffolded Next.js applications. It outlines project scope, repository structure, quick commands (like yarn build, yarn test-packages), code styles, DO/DON'T rules, boundaries (like never edit dist or .next folders), and example tasks to ensure AI-generated code aligns with SDK standards. Separate versions exist for the monorepo root and template-specific apps (App Router vs. Pages Router), preventing confusion between SDK package edits and head application development.
SKILLS.md introduces capability groupings to help AI tools and developers map tasks to specific SDK areas, such as component scaffolding, data fetching, or i18n. It lists groupings and links them to template-specific details (App Router vs. Pages Router) without duplicating content. This keeps a single source of truth in scaffolding templates for consistency across generated apps.
Individual skills (in .agents/skills/ folders) are granular SKILL.md files following the Agent Skills standard. Each skill specifies when to use, how to perform, hard rules, and stop conditions tailored for App Router and Pages Router apps. They enable AI tools to load and execute precise, context-aware instructions for tasks like multisite setup or troubleshooting preview issues.
Using Cursor
The repository contains comprehensive Cursor rules to improve development consistency and productivity across the Content SDK ecosystem. These rules provide Cursor with sufficient context to guide you through the project and answer questions about Sitecore development patterns.
Rule levels
There are two levels of rules included:
-
Repository-level rules - define architectural and stylistic standards across all SDK projects.
-
general.mdc- core coding principles and universal standards. -
javascript.mdc- JavaScript/TypeScript naming conventions and patterns. -
sitecore.mdc- Sitecore-specific development patterns for SitecoreAI. -
Additional rules - CLI usage, testing strategies, and project-specific guidance.
-
-
Template-level rules - Embedded in the Next.js starter template to guide developers building Sitecore apps.
These rules ensure that both the SDK development and user projects benefit from intelligent AI-assistance with a comprehensive understanding of Sitecore Content SDK patterns and architecture.
Applying cursor rules
Cursor rules are automatically applied when using Cursor for the following:
-
Content SDK repository - for SDK contributors and maintainers.
-
User generated projects - projects created with
npx create-content-sdk-appthat include the.cursor/rules/directory.
These rules provide the necessary context and knowledge to do the following:
-
Generate consistent code following established patterns.
-
Answer project-specific questions about Sitecore development.
-
Guide developers through Content SDK conventions and best practices.
-
Maintain code quality across team contributions.
Using Claude
The repository contains rules outlined in CLAUDE.md which is used by the AI agent to form explicit project boundaries and adhere to "vibe-coding" principles to maintain code quality across the repository. Claude is explicitly instructed to adhere to the separation of concerns, ensuring it understands the distinction between SDK packages and sample application code. It is also instructed to operate under strict TypeScript standards, prioritizing type safety, immutability, and functional programming paradigms. It is also configured to avoid hallucinating internal modules or Sitecore endpoints, ensuring it only interacts with established APIs like the GraphQL Edge endpoint or the Layout Service.
Using GitHub Copilot
Functionally identical in structure to the Claude guidelines, the Copilot instructions ensure that in-editor autocomplete and chat functionalities align perfectly with the project's architecture. The rules are outlined in the repository in copilot-instructions.md.