next-sanity-starter copilot-instructions.md

Repository-specific instructions for GitHub Copilot working on a Next.js website, a Sanity content studio, and shared packages in one codebase.

In plain words
What is it for?
They guide work on editorial modules, Sanity schemas, React components, multilingual content, queries, and the required checks after schema changes.
Why use it?
They explain the project’s structure and rules so code suggestions reuse existing pieces and keep new content blocks connected across the website and editing system.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/backendforth/next-sanity-starter/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/backendforth/next-sanity-starter

Made for: GitHub Copilot.

Per session 979 This file is loaded in full into every session.
When invoked 979 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00979 $0.00979
Opus 5 $0.00490 $0.00490
Sonnet 5 $0.00196 $0.00196
Haiku 4.5 $0.00098 $0.00098

Measured 2d ago against content hash 5b761512add1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

next-sanity-starter copilot-instructions.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.

.github/copilot-instructions.md · 60 lines

How it starts

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

GitHub Copilot — repository instructions

Full guardrails live in AGENTS.md at the repo root. This file is a condensed mirror for inline suggestions.

Repo at a glance

  • pnpm monorepo: web (Next.js 16 App Router), studio (Sanity v5), shared packages/*.
  • Editorial content is rendered via the module pattern: every content block is a paired module.<name> Sanity object + Module<Name>.tsx React component, wired in 8 places.
  • Multilingual content uses @sanity/internationalized-array. Locale is resolved at render time via web/sanity/utils/sanityLocalizedText.ts, never inside GROQ.

Top rules

  1. Reuse before invention — check studio/schemas/objects/modules/, web/src/components/modules/, web/sanity/queries/snippets/, web/sanity/utils/ first.
  2. New content block → it is a module. Touch all 8 wiring points or revert:
    • studio/schemas/objects/modules/module<Name>.ts
    • studio/schemas/index.ts
    • studio/schemas/objects/editors/richTextMedia.ts
    • studio/schemas/fields/modulesArrayField.ts
    • web/src/components/modules/Module<Name>.tsx
    • web/src/components/modules/index.ts (+ register in ModulesRenderer.tsx)
    • web/sanity/queries/components/modules/<name>.ts (+ barrel)
    • web/sanity/types/modules/<name>.ts (+ barrel)
  3. After every schema edit: pnpm studio:generate, then pnpm typecheck, then pnpm format.
  4. Never edit studio/sanity.types.gen.ts or studio/schema.json — generated.
  5. web/sanity/types/* are hand-maintained — update them when schema fields change.
  6. Locale-aware always: use pickLocalizedString(field, locale, siteLocale) or parseLocalizedText({ value, locale, siteLocale, as }). Never field[0].value or field.find(t => t.language === locale). Never coalesce(field[language==$locale].value, ...) in GROQ.
  7. Add a new language only via the siteLanguageSettings Studio singleton (offline fallback: web/src/i18n/fallbackSiteLocales.ts). No schema, query, or component change.
  8. No hardcoded locale codes outside web/src/i18n/.
  9. No imports from studio/ inside web/ (or vice versa). Share via packages/*.

Read the full file on GitHub · 60 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 First seen · 60 lines · 979 tokens per session scan A 5b761512add1

Subscribe to this mod's changes

next-sanity-starter copilot-instructions.md is an instructions file published in the GitHub repository backendforth/next-sanity-starter (4 stars, last pushed 26d ago), licensed ISC. It adds 979 tokens to every session, about $0.0049 per session on Opus 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.