Agent Skills: Sanity CMS and blog workflow

>-

cmsID: petrilahdelma/digitaltableteur/dt-sanity-cms

Install this agent skill to your local

pnpm dlx add-skill https://github.com/PetriLahdelma/digitaltableteur/tree/HEAD/.claude/skills/dt-sanity-cms

Skill Files

Browse the full folder contents for dt-sanity-cms.

Download Skill

Loading file tree…

.claude/skills/dt-sanity-cms/SKILL.md

Skill Metadata

Name
dt-sanity-cms
Description
>-

Sanity CMS and blog workflow

Instructions

Step 1: Load context

Read references/area-guide.md and digitaltableteur-blog/AGENTS.md.

Schema types: digitaltableteur-blog/schemaTypes/

Step 2: Publish content

npm run sanity:dev          # optional local studio preview
npm run sanity:publish      # publish + refresh manifest

Alternative: scripts/publish-from-sanity.sh

Expected: updates to nextjs-app/shared/data/blogManifest.ts and/or app/blog/postMetadata.ts.

Step 3: After publish

  1. Inspect git diff for generated manifest files
  2. Commit generated changes if intentional
  3. Verify routes locally:
npm run dev
# /blog, /blog/[slug], /blog/authors/[slug]

Step 4: Schema changes

When editing schemaTypes/:

  1. Update app TypeScript types if referenced
  2. npm run sanity:dev — confirm studio loads
  3. Republish sample content to validate GROQ queries

CRITICAL: never hand-edit generated manifest files.


Examples

Example 1: New blog post live

User says: "I published an article in Sanity, make it show on the site"

Actions:

  1. Run npm run sanity:publish
  2. Commit manifest diff if changed
  3. Verify /blog/[slug] renders with correct metadata and OG image

Example 2: Author page OG wrong

User says: "Author OG uses old logo"

Actions:

  1. Check app/blog/authors/[slug]/ for opengraph-image.tsx
  2. Prefer profile photo; fallback to generated card
  3. Remove any hardcoded logo512.png from metadata

Troubleshooting

Build fails: missing post in manifest

Cause: manifest not regenerated after CMS publish.

Solution: npm run sanity:publish or node scripts/generate-blog-manifest.mjs

Studio won't start

Cause: missing Sanity env vars or wrong project ID.

Solution: ask user to verify .env.local Sanity credentials; do not commit them.

Slug 404 after publish

Cause: post not in manifest or visibility flag excludes it.

Solution: check getVisiblePosts() / manifest entry and post status in Sanity.


Boundaries

  • MUST NOT hand-edit blogManifest.ts or postMetadata.ts
  • Ask before bulk delete or destructive CMS operations