cms

por openai

Orientação de integração com CMS headless — Sanity (Vercel Marketplace nativo), Contentful, DatoCMS, Storyblok e Builder.io. Abrange configuração do studio, modelagem de conteúdo,…

npx skills add https://github.com/openai/plugins --skill cms

Headless CMS Integration

You are an expert in integrating headless CMS platforms with Vercel-deployed applications — covering Sanity (native Vercel Marketplace), Contentful, DatoCMS, Storyblok, and Builder.io.

Sanity (Native Vercel Marketplace Integration)

Sanity is the primary CMS integration on the Vercel Marketplace with first-class Visual Editing support.

Install via Marketplace

# Install Sanity from Vercel Marketplace (auto-provisions env vars)
vercel integration add sanity

Auto-provisioned environment variables:

  • SANITY_PROJECT_ID — Sanity project identifier
  • SANITY_DATASET — dataset name (usually production)
  • SANITY_API_TOKEN — read/write API token
  • NEXT_PUBLIC_SANITY_PROJECT_ID — client-side project ID
  • NEXT_PUBLIC_SANITY_DATASET — client-side dataset name

SDK Setup

# Install Sanity packages for Next.js
npm install next-sanity @sanity/client @sanity/image-url

# For embedded studio (optional)
npm install sanity @sanity/vision

Client Configuration

// lib/sanity.ts
import { createClient } from "next-sanity";

export const client = createClient({
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!,
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET!,
  apiVersion: "2026-03-01",
  useCdn: true,
});

Content Schema

// schemas/post.ts
import { defineType, defineField } from "sanity";

export const post = defineType({
  name: "post",
  title: "Post",
  type: "document",
  fields: [
    defineField({ name: "title", type: "string" }),
    defineField({ name: "slug", type: "slug", options: { source: "title" } }),
    defineField({ name: "body", type: "array", of: [{ type: "block" }] }),
    defineField({ name: "mainImage", type: "image", options: { hotspot: true } }),
    defineField({ name: "publishedAt", type: "datetime" }),
  ],
});

Embedded Studio (App Router)

// app/studio/[[...tool]]/page.tsx
"use client";
import { NextStudio } from "next-sanity/studio";
import config from "@/sanity.config";

export default function StudioPage() {
  return <NextStudio config={config} />;
}
// sanity.config.ts
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { visionTool } from "@sanity/vision";
import { post } from "./schemas/post";

export default defineConfig({
  name: "default",
  title: "My Studio",
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!,
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET!,
  plugins: [structureTool(), visionTool()],
  schema: { types: [post] },
});

Live Content with defineLive() (next-sanity v12)

Use defineLive() for automatic real-time content updates without manual revalidation. In next-sanity v11+, defineLive must be imported from the next-sanity/live subpath:

// lib/sanity.ts
import { createClient } from "next-sanity";
import { defineLive } from "next-sanity/live";

const client = createClient({
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!,
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET!,
  apiVersion: "2026-03-01",
  useCdn: true,
});

export const { sanityFetch, SanityLive } = defineLive({
  client,
  // Required for draft content in Visual Editing — use a Viewer role token
  serverToken: process.env.SANITY_API_TOKEN,
  // Optional but recommended for faster live preview
  browserToken: process.env.SANITY_BROWSER_TOKEN,
});
// app/page.tsx
import { sanityFetch, SanityLive } from "@/lib/sanity";

export default async function Page() {
  const { data: posts } = await sanityFetch({ query: `*[_type == "post"]` });
  return (
    <>
      {posts.map((post) => <div key={post._id}>{post.title}</div>)}
      <SanityLive />
    </>
  );
}

Breaking change in v12: defineLive({fetchOptions: {revalidate}}) has been removed. defineLive({stega}) is deprecated.

Visual Editing (Presentation Mode)

Sanity Visual Editing lets content editors click-to-edit content directly on the live site preview. Requires Sanity Studio v5+ (React 19.2) and @sanity/visual-editing v5+.

npm install @sanity/visual-editing

In next-sanity v11+, VisualEditing must be imported from the next-sanity/visual-editing subpath:

// app/layout.tsx
import { VisualEditing } from "next-sanity/visual-editing";
import { draftMode } from "next/headers";

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const { isEnabled } = await draftMode();
  return (
    <html>
      <body>
        {children}
        {isEnabled && <VisualEditing />}
      </body>
    </html>
  );
}

On-Demand Revalidation Webhook

// app/api/revalidate/route.ts
import { revalidateTag } from "next/cache";
import { parseBody } from "next-sanity/webhook";

export async function POST(req: Request) {
  const { isValidSignature, body } = await parseBody<{
    _type: string;
    slug?: { current?: string };
  }>(req, process.env.SANITY_REVALIDATE_SECRET);

  if (!isValidSignature) {
    return Response.json({ message: "Invalid signature" }, { status: 401 });
  }

  if (body?._type) {
    revalidateTag(body._type);
  }

  return Response.json({ revalidated: true, now: Date.now() });
}

Configure the webhook in Sanity at Settings → API → Webhooks pointing to https://your-site.vercel.app/api/revalidate.

Contentful

npm install contentful
// lib/contentful.ts
import { createClient } from "contentful";

export const contentful = createClient({
  space: process.env.CONTENTFUL_SPACE_ID!,
  accessToken: process.env.CONTENTFUL_ACCESS_TOKEN!,
});

Fetching Entries

// app/page.tsx
import { contentful } from "@/lib/contentful";

export default async function Page() {
  const entries = await contentful.getEntries({ content_type: "blogPost" });
  return (
    <ul>
      {entries.items.map((entry) => (
        <li key={entry.sys.id}>{entry.fields.title as string}</li>
      ))}
    </ul>
  );
}

Draft Mode (Preview)

All CMS integrations should use Next.js Draft Mode for preview:

// app/api/draft/route.ts
import { draftMode } from "next/headers";

export async function GET(req: Request) {
  const { searchParams } = new URL(req.url);
  const secret = searchParams.get("secret");

  if (secret !== process.env.DRAFT_SECRET) {
    return Response.json({ message: "Invalid token" }, { status: 401 });
  }

  const draft = await draftMode();
  draft.enable();

  const slug = searchParams.get("slug") ?? "/";
  return Response.redirect(new URL(slug, req.url));
}

Environment Variables

VariableScopeCMSDescription
SANITY_PROJECT_ID / NEXT_PUBLIC_SANITY_PROJECT_IDServer / ClientSanityProject identifier
SANITY_DATASET / NEXT_PUBLIC_SANITY_DATASETServer / ClientSanityDataset name
SANITY_API_TOKENServerSanityRead/write token
SANITY_REVALIDATE_SECRETServerSanityWebhook secret for revalidation
CONTENTFUL_SPACE_IDServerContentfulSpace identifier
CONTENTFUL_ACCESS_TOKENServerContentfulDelivery API token
CONTENTFUL_PREVIEW_TOKENServerContentfulPreview API token
DATOCMS_API_TOKENServerDatoCMSRead-only API token

Cross-References

  • Marketplace install and env var provisioning⤳ skill: marketplace
  • On-demand revalidation and caching⤳ skill: runtime-cache
  • Draft mode and middleware patterns⤳ skill: routing-middleware
  • Environment variable management⤳ skill: env-vars
  • Image optimization⤳ skill: nextjs

Official Documentation

Mais skills de openai

user-context
openai
Carregar ou gerenciar as preferências de roteamento de origem duráveis, a lógica de integração, o progresso de configuração e o registro da camada semântica do plugin Data Analytics.
official
notion-research-documentation
openai
Pesquise conteúdo do Notion e sintetize em briefs estruturados, relatórios ou comparações com citações. Pesquise e busque páginas do Notion usando consultas direcionadas, depois organize os achados por tema com citações inline das fontes e uma seção de referências. Escolha entre quatro formatos de saída (brief rápido, resumo de pesquisa, comparação, relatório abrangente) com base no escopo e no objetivo do usuário. Crie e atualize páginas do Notion usando modelos integrados; vincule fontes diretamente e acompanhe alterações à medida que novas informações chegam...
official
rcsb-pdb-skill
openai
Enviar solicitações compactas do RCSB PDB para metadados principais, consultas da API de busca e downloads FASTA. Use quando um usuário desejar resumos concisos do RCSB; salve JSON bruto ou…
official
pdf
openai
We need to translate the given text from English to Brazilian Portuguese. The text describes a skill related to PDF handling. The name "pdf" is to be preserved, but it appears in the text as "PDF" (uppercase). The instruction says "Do not include the name unless it appears in the source text." Since "PDF" appears multiple times, we should keep it as is. Also preserve technical terms like "Poppler", "pdftoppm", "reportlab", "pdfplumber", "pypdf", "ASCII". The translation should be natural in Brazilian Portuguese. Let's break down the text: "PDF reading, creation, and validation with visual rendering and programmatic generation. Render PDF pages to PNG for visual inspection of layout, spacing, and typography before delivery using Poppler ( pdftoppm ) Generate PDFs programmatically with reportlab for reliable formatting; extract text and metadata with pdfplumber or pypdf Enforce quality standards: no clipped text, overlapping elements, broken tables, or rendering artifacts; ASCII hyphens only, human
official
test-coverage-improver
openai
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
official
playwright
openai
Automação de navegador via terminal com snapshots de elementos e fluxos de UI interativos. Opera através do script wrapper playwright-cli (requer npx); suporta modos headless e headed para depuração visual. Fluxo principal: abrir página, capturar snapshot para referências estáveis de elementos, interagir usando referências, recapturar snapshot após navegação ou mudanças no DOM. Inclui preenchimento de formulários, cliques, digitação, gerenciamento de múltiplas abas, captura de screenshot/PDF e gravação de trace para depuração de fluxos. Referências de elementos (ex.: e3, e15)...
official
ukb-topmed-phewas-skill
openai
Busque resumos compactos de PheWAS UKB-TOPMed para variantes únicas, aceitando entrada rsID, GRCh37 ou GRCh38 e resolvendo para a consulta GRCh38 necessária. Use quando um…
official
code-review-context
openai
Contexto visível do modelo
official