portable-text-serialization

portable-text-serialization is a skill for Claude Code, Codex from vercel-labs/sanity-copilot-eve-template. It costs 80 tokens per session (1,113 once invoked), scanned A, a copy of portable-text-serialization, MIT.

Tools and patterns for turning Portable Text—a structured format made of text blocks, styles, lists, links, and custom blocks—into displayed or serialized content.

In plain words
What is it for?
Use it to render or convert Portable Text in React, Svelte, Vue, Astro, HTML, Markdown, or plain text, including custom blocks and links.
Why use it?
It avoids writing separate conversion logic for every frontend or output format and lets each framework decide how content elements appear.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to render or convert Portable Text in React, Svelte, Vue, Astro, HTML, Markdown, or plain text, including custom blocks and links.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization
About the project

Sanity Copilot eve Template is a Slack-based assistant that lets team members query and edit Sanity content, inspect schemas, manage drafts and releases, and send long-form drafts to Notion. Teams use it to work on Sanity projects through Slack with each person's permissions and approval controls for sensitive actions. The catalogue add-ons support this agent workflow.

vercel-labs/sanity-copilot-eve-template · 5 stars · on GitHub · vercel.com

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.

Any agent
npx skills add vercel-labs/sanity-copilot-eve-template --skill portable-text-serialization
Clone the repo
git clone --depth 1 https://github.com/vercel-labs/sanity-copilot-eve-template

Made for: Claude Code, Codex.

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 portable-text-serialization

README.md
[![agentmods](https://agentmods.dev/badge/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization/github.svg)](https://agentmods.dev/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization)
Your own site
<a href="https://agentmods.dev/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization"><img src="https://agentmods.dev/badge/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization/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 portable-text-serialization

Your own site · 80×15
<a href="https://agentmods.dev/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization"><img src="https://agentmods.dev/badge/skills/vercel-labs/sanity-copilot-eve-template/portable-text-serialization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod 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.00080 $0.01113
Opus 5 $0.00040 $0.00557
Sonnet 5 $0.00016 $0.00223
Haiku 4.5 $0.00008 $0.00111

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

Security

Grade A, and why

portable-text-serialization 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 10d 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.

Origin

This is a copy

94% identical to portable-text-serialization — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

agent/skills/portable-text-serialization/SKILL.md · 106 lines

How it starts

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

Portable Text Serialization

Render Portable Text content across frameworks using the @portabletext/* library family. Each library follows the same component-mapping pattern: you provide a components object that maps PT node types to framework-specific renderers.

Portable Text Structure (Quick Reference)

PT is an array of blocks. Each block has _type, optional style, children (spans), markDefs, listItem, and level.

Root array
├── block (_type: "block")
│   ├── style: "normal" | "h1" | "h2" | "blockquote" | ...
│   ├── children: [span, span, ...]
│   │   └── span: { _type: "span", text: "...", marks: ["strong", "<markDefKey>"] }
│   ├── markDefs: [{ _key, _type: "link", href: "..." }, ...]
│   ├── listItem: "bullet" | "number" (optional)
│   └── level: 1, 2, 3... (optional, for nested lists)
├── custom block (_type: "image" | "code" | any custom type)
└── ...more blocks

Marks come in two forms:

  • Decorators: string values in marks[] like "strong", "em", "underline", "code"
  • Annotations: keys in marks[] referencing entries in markDefs[] (e.g., links, internal references)

Component Mapping Pattern (All Frameworks)

Every @portabletext/* library accepts a components object with these keys:

Key Renders Props/Data
types Custom block/inline types (image, code, CTA) value (the block data)
marks Decorators + annotations children + value (mark data)
block Block styles (h1, normal, blockquote) children
list List wrappers (ul, ol) children
listItem List items children
hardBreak Line breaks within a block

Framework-Specific Rules

Read the rule file matching your framework:

  • React / Next.js: rules/react.md@portabletext/react or next-sanity
  • Svelte / SvelteKit: rules/svelte.md@portabletext/svelte
  • Vue / Nuxt: rules/vue.md@portabletext/vue
  • Astro: rules/astro.mdastro-portabletext
  • HTML (server-side): rules/html.md@portabletext/to-html
  • Markdown: rules/markdown.md@portabletext/markdown
  • Plain text extraction: rules/plain-text.md@portabletext/toolkit

Read the full file on GitHub · 106 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 106 lines · 80 tokens per session scan A 6ebb0904478a

Subscribe to this mod's changes

portable-text-serialization is a skill published in the GitHub repository vercel-labs/sanity-copilot-eve-template (5 stars, last pushed 21d ago), licensed MIT. It adds 80 tokens to every session and 1,113 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to portable-text-serialization, differing in 8 lines, and is treated as a copy.

Related

Other skills, from other repositories

site-architecture

Use when planning or restructuring what pages a site has and how they connect: hierarchy, navigation, URL patterns, breadcrumbs, and internal linking. Not for XML sitemaps, which are in seo-audit.

vercel-labs/marketing-team-eve-template · 42 tokens

fullstack-ai-app-builder

A method for building and launching complete AI-powered web applications, from requirements and technical planning through the front end, back end, AI integration, and deployment. It is aimed at people who want to create an application without a back-end engineer.

LX-Director/claude_fullstack-ai-builder · 201 tokens

design-taste-frontend

Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.

Leonxlnx/taste-skill · 61 tokens

html-artifacts

Author the HTML for a plan artifact, dashboard iframe, or Slack attachment — structure, design plan, available runtime, theming, and craft. Read this before writing HTML for saveplan, outputiframe, or slackattachhtml.

langchain-ai/open-swe · 51 tokens

image-to-code

Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards…

Leonxlnx/taste-skill · 116 tokens

minimalist-ui

Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.

Leonxlnx/taste-skill · 34 tokens