agentsclimarketplace

Nuxt sanity

Skill display-design-studio/skills/skills/nuxt-sanity

@nuxtjs/sanity module integration best practices for Nuxt 3 apps connected to Sanity CMS (there is no separate `@sanity/nuxt` package). Covers useSanityQuery, useLazySanityQuery, useSanity, SanityImage, SanityContent (Portable Text), visual editing / live preview with stega, TypeScript typegen, named clients, and Nitro server routes. Also covers starter architecture with cached Nitro endpoints, preview-switch composables, Netlify CDN caching, and cache tag invalidation. Use when the user mentions @nuxtjs/sanity, nuxt-sanity, useSanityQuery, SanityImage in Nuxt, or is building a Nuxt app that fetches data from Sanity.From its SKILL.md

Install
npx -y skills add display-design-studio/skills --skill nuxt-sanity

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.4 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Nuxt + Sanity Integration Best Practices

Best-practices guide for the @nuxtjs/sanity module (Nuxt 3). Covers module setup, composables, SSR data fetching, image handling, Portable Text, visual editing, TypeScript, and Nitro server routes.

Also load the nuxt skill for Nuxt core patterns and sanity-best-practices for GROQ query optimization and schema design. This skill covers the integration layer only.

ROUTING: Which rule file to load

IF setting up the module or configuring nuxt.config.ts: → Read rules/core-module-setup.md

IF using useSanityQuery, useLazySanityQuery, or useSanity composables: → Read rules/core-composables.md

IF writing Nitro server routes that query Sanity: → Read rules/core-server-routes.md

IF working with the SanityImage component or building image URLs programmatically: → Read rules/features-sanity-image.md

IF rendering Portable Text with SanityContent: → Read rules/features-sanity-content.md

IF implementing visual editing, live preview, stega, or the Presentation tool: → Read rules/features-visual-editing.md

IF following the Display Starter architecture or adding a new document type: → Read rules/arch-starter-pattern.md then rules/arch-extension-pattern.md

IF configuring CDN caching, cache tags, or webhook cache invalidation: → Read rules/perf-cdn-caching.md

IF experiencing stale CDN content after a Sanity publish (not query-level cache): → Read rules/perf-cdn-caching.md

IF experiencing stale data, cache misses, or reactive query bugs: → Read rules/perf-query-keys-and-caching.md

IF debugging CORS errors, auth token issues, or hydration mismatches: → Read rules/debug-common-errors.md

IF generating a dynamic sitemap from Sanity routes (works, case studies, etc.): → Read rules/features-sitemap.md

Rule index

TopicDescriptionFile
Sections overviewCategories and reading orderrules/_sections.md
Module setupInstallation, nuxt.config.ts options, env varsrules/core-module-setup.md
ComposablesuseSanityQuery, useLazySanityQuery, useSanity usage, preview-switch patternrules/core-composables.md
Server routesNitro server routes with useSanity, validateSanityQueryrules/core-server-routes.md
Starter architectureDirectory layout, data-flow, GROQ conventions, i18nrules/arch-starter-pattern.md
Extension pattern4-step recipe: GROQ query → endpoint → composable → pagerules/arch-extension-pattern.md
CDN cachingTwo-layer caching, preview bypass, cache tagging, webhook invalidationrules/perf-cdn-caching.md
SanityImageSanityImage component, @sanity/image-url builder, @nuxt/image integrationrules/features-sanity-image.md
SanityContentPortable Text rendering, custom componentsrules/features-sanity-content.md
Visual editingStega, live preview, Presentation tool, draft moderules/features-visual-editing.md
Caching (queries)Query key stability, reactive params, cache invalidationrules/perf-query-keys-and-caching.md
DebugCORS, auth tokens, hydration errors, common pitfallsrules/debug-common-errors.md
SitemapDynamic sitemap sources, defineSitemapEventHandler, stegaClean on slugsrules/features-sitemap.md

Quick access by priority

PriorityWhen you need itFile
🔴 FIRSTSetting up or configuring the modulecore-module-setup.md
🔴 FIRSTUnderstanding data flow & architecturearch-starter-pattern.md
🔴 FIRSTAdding a new content typearch-extension-pattern.md
🟠 OFTENFetching data with useSanityQuerycore-composables.md
🟠 OFTENCache strategy (ISR vs SWR, purge)perf-cdn-caching.md
🟡 SOMETIMESVisual editing & stegafeatures-visual-editing.md
🟡 SOMETIMESSEO meta tagsfeatures-seo-meta.md
🟡 SOMETIMESDynamic sitemap with i18nfeatures-sitemap-i18n.md
🔵 TROUBLESHOOTCaching misses or stale dataperf-query-keys-and-caching.md
🔵 TROUBLESHOOTCORS, hydration, or other bugsdebug-common-errors.md

Coverage and maintenance

What ships with it: 16 files

83.2 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.