portable-text-serialization

portable-text-serialization is a skill for Claude Code, Codex from vercel/eve. It costs 80 tokens per session (1,152 once invoked), scanned A, original, Apache-2.0.

A guide to displaying Portable Text, a structured rich-text format, in React, Svelte, Vue, Astro, HTML, Markdown, or plain text. It explains how to map content blocks such as headings, lists, links, and custom types to output components.

In plain words
What is it for?
Use it to render Portable Text in a frontend, create custom renderers for special blocks, or turn it into HTML, Markdown, or plain text.
Why use it?
It removes the need to work out how Portable Text's blocks, text marks, and custom content should become usable output in each supported format.

Skill for Claude CodeCodex ✓ vendor

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

Good fit Use it to render Portable Text in a frontend, create custom renderers for special blocks, or turn it into HTML, Markdown, or plain text.

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

eve is a filesystem-first framework for building durable AI agents, with agent instructions, tools, and configuration kept in ordinary project files. It is for developers creating agents that can be inspected, extended, and operated through a conventional codebase. The catalogue add-ons support working with eve agents and their workflows.

vercel/eve · 6,115 stars · on GitHub · eve.dev

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/eve --skill portable-text-serialization
Clone the repo
git clone --depth 1 https://github.com/vercel/eve

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/eve/portable-text-serialization/github.svg)](https://agentmods.dev/skills/vercel/eve/portable-text-serialization)
Your own site
<a href="https://agentmods.dev/skills/vercel/eve/portable-text-serialization"><img src="https://agentmods.dev/badge/skills/vercel/eve/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/eve/portable-text-serialization"><img src="https://agentmods.dev/badge/skills/vercel/eve/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,152 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 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.1 $0.00080 $0.01152
Opus 5.5 $0.00032 $0.00461
Sonnet 5.5 $0.00016 $0.00230
Haiku 4.5 $0.00008 $0.00115

Measured 12d ago against content hash ebec8071ef11, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 12d 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

Copies of this mod

4 near-identical copies found in the catalogue:

apps/templates/sanity-copilot-eve-template/agent/skills/portable-text-serialization/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 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 —

Read the full file on GitHub · 109 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. 12d ago Changed · +3 lines ebec8071ef11
  2. 16d 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/eve (6,115 stars, last pushed today), licensed Apache-2.0. It adds 80 tokens to every session and 1,152 once invoked, about $0.0003 per session on Opus 5.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-11-14.

Related

portable-text-serialization compared with skills from other repositories

portable-text-serialization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
portable-text-serializationvercel/eveSkill6.1ktodayApache-2.0A80Claude Code, Codex
animated-github-profileranbot-ai/awesome-skillsSkill15todaynoneA51Claude Code, Codex
migrate-oxlintoxc-project/oxcSkill24ktodayMITA44Claude Code, Codex
build-with-tinybasetinyplex/tinybaseSkill5.2k11d agoMITA90Claude Code, Codex
resolving-ingestion-warningsPostHog/posthogSkill41ktodaynoneA191Claude Code, Codex
isolating-product-facade-contractsPostHog/posthogSkill41ktodaynoneA76Claude Code, Codex
triaging-merge-queue-failuresPostHog/posthogSkill41ktodaynoneA180Claude Code, Codex