next-sanity-starter: Instructions file for Codex

AGENTS.md

next-sanity-starter AGENTS.md is an instructions file for Codex, OpenCode from backendforth/next-sanity-starter. It costs 9,015 tokens per session, scanned A, original, ISC.

The main repository rulebook for a pnpm monorepo, meaning one codebase containing multiple related apps and packages, including a Next.js site and Sanity studio.

In plain words
What is it for?
It guides code changes, new editorial modules, schema generation, type checking, formatting, and reuse of existing components, utilities, snippets, and queries.
Why use it?
It explains how the project’s reusable content modules and translations must be wired together, preventing incomplete changes and broken generated types.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

This is backendforth/next-sanity-starter's own configuration. It tells Codex and OpenCode how to work on next-sanity-starter itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything next-sanity-starter configures →

Reuse

Borrowing it

Nothing to install: this file belongs to backendforth/next-sanity-starter. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/backendforth/next-sanity-starter/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/backendforth/next-sanity-starter

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for next-sanity-starter AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/backendforth/next-sanity-starter/agents-md/github.svg)](https://agentmods.dev/instructions/backendforth/next-sanity-starter/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/backendforth/next-sanity-starter/agents-md"><img src="https://agentmods.dev/badge/instructions/backendforth/next-sanity-starter/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for next-sanity-starter AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/backendforth/next-sanity-starter/agents-md"><img src="https://agentmods.dev/badge/instructions/backendforth/next-sanity-starter/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,015 This file is loaded in full into every session.
When invoked 9,015 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.09015 $0.09015
Opus 5.5 $0.03606 $0.03606
Sonnet 5.5 $0.01803 $0.01803
Haiku 4.5 $0.00902 $0.00902

Measured 2d ago against content hash a559c33b0be5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

next-sanity-starter AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 413 lines

How it starts

The opening of the file, as written. The whole thing — 413 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — next-sanity-starter

This is the canonical guardrails file for AI coding assistants (Claude Code, Cursor, Windsurf, Codex, Copilot). Read this before writing or changing code. Subtree CLAUDE.md files, .cursor/rules/*.mdc and .github/copilot-instructions.md only point here and add local gotchas this file doesn't state — keep conventions here, not in them.

TL;DR

This is a pnpm monorepo with two apps (web Next.js 16 App Router, studio Sanity v6) and shared packages/*. Editorial content is rendered via a strict module pattern: every renderable content block is a paired module.<name> Sanity object plus a Module<Name>.tsx React component, wired in six places (inline use in rich text is opt-in). Multilingual content uses sanity-plugin-internationalized-array — locales are resolved at render time, never inside GROQ.

Before writing code:

  1. Search for an existing module, util, snippet, or query that already does what you need.
  2. If you need a new content block → it is a module; pnpm gen:module <Name> wires all 6 points.
  3. After any schema or query change → run pnpm generate, then pnpm typecheck, then pnpm format.

Principles (priority order — apply top-down when in doubt)

  1. Reuse before invention. Grep studio/schemas/objects/modules/, web/src/components/modules/, web/sanity/queries/snippets/, web/sanity/utils/ first.
  2. Pair or don't ship. A schema without its component (or vice versa) is a bug, not a partial commit.
  3. All 6 wiring points or revert. A partially wired module silently breaks the editor or the renderer. Atomic.
  4. Typegen is the only source of types for Sanity data. Never hand-edit the generated files. Web types come from defineQuery results via web/sanity/types.ts (ModuleOf<"module.x">, HomeDocument, …) — never write a Sanity-shaped type by hand.
  5. Locale-aware at render time, not query time. Never coalesce(field[language=="en"]...) in GROQ. Always resolve via pickLocalizedString / pickLocalizedPortableTextBlocks.
  6. READMEs are deep docs. Per-folder README.md files are authoritative for the local pattern — link to them, do not duplicate.

Read the full file on GitHub · 413 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +9 lines · +224 tokens per session a559c33b0be5
  2. 15d ago Changed · +2 lines · +154 tokens per session c7998ff7264b
  3. 16d ago Changed · +1 lines · +54 tokens per session 9684256aba33
  4. 17d ago Changed · +33 lines · +620 tokens per session 519d83eb51d6
  5. 22d ago Changed · +32 lines · +1,742 tokens per session a63b9a3c30ec
  6. 23d ago Changed · +17 lines · +709 tokens per session 2dea4fc96191
  7. 2mo ago First seen · 319 lines · 5,512 tokens per session scan A ac5eec698343

Subscribe to this mod's changes

next-sanity-starter AGENTS.md is an instructions file published in the GitHub repository backendforth/next-sanity-starter (4 stars, last pushed 2d ago), licensed ISC. It adds 9,015 tokens to every session, about $0.0361 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

next-sanity-starter AGENTS.md compared with instructions from other repositories

next-sanity-starter AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
next-sanity-starter AGENTS.mdbackendforth/next-sanity-starterInstructions file42d agoISCA9,015Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode