๐Ÿ“
AI EngineeringJavaScript

Portable Text Conversion

by sanity-io

Portable Text Conversion is an AI Engineering skill for Claude Code, published by sanity-io in agent-toolkit.

181 stars28 forkson sanity-io/agent-toolkitAdded 2026/09/07+1% in starsRepository updated 2026/09/04
agent-rulesai-rulesclaude-codeclaude-code-plugincursor-aimcpmcp-servervs-code
Install in seconds
Install Portable Text Conversion
Copy Portable Text Conversion into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/sanity-io/agent-toolkit/tree/main/skills/portable-text-conversion ~/.claude/skills/portable-text-conversion

Requires Node.js. Downloads this skill only โ€” not the rest of the repository โ€” into your Claude Code skills folder.

Without Node.js

git clone https://github.com/sanity-io/agent-toolkit.git

Clones the whole repository, then copy the skillโ€™s own directory into your skills folder yourself.

In this catalog

Source file
skills/portable-text-conversion/SKILL.md in sanity-io/agent-toolkit
Installs to
~/.claude/skills/portable-text-conversion
Collection
One of 7 skills cataloged from this repository
Category
AI Engineering โ€” 3475 skills

What Portable Text Conversion does

Portable Text Conversion turns HTML and Markdown into Sanity Portable Text blocks. Use it when migrating content, importing rich text, or building pipelines that create Portable Text programmatically.

Portable Text Conversion is cataloged under AI Engineering on DirSkills. Portable Text Conversion comes from a repository tagged agent-rules, ai-rules, claude-code, claude-code-plugin and cursor-ai.

Documentation

README

Portable Text Conversion

Convert external content (HTML, Markdown) into Portable Text for Sanity. Three main approaches:

  1. markdownToPortableText โ€” Convert Markdown directly using @portabletext/markdown (recommended for Markdown)
  2. htmlToBlocks โ€” Parse HTML into PT blocks using @portabletext/block-tools (for HTML migration)
  3. Manual construction โ€” Build PT blocks directly from any source (APIs, databases, etc.)

Portable Text Specification

Understand the target format before converting. PT is an array of blocks:

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Portable Text Conversion

  • What else does sanity-io publish alongside Portable Text Conversion?

    Portable Text Conversion is one of 7 skills that DirSkills catalogs from sanity-io/agent-toolkit, the repository it ships in. Its siblings there include Content Experimentation Best Practices, Content Modeling Best Practices and Portable Text Serialization. Each one is a separate skill with its own page in this directory, installs the same way Portable Text Conversion does, and is maintained by sanity-io in that same repository. The rest of the collection is listed on the sanity-io/agent-toolkit page.

  • How does Portable Text Conversion compare to other AI Engineering skills?

    Portable Text Conversion ranks #3088 by stars among the 3475 AI Engineering skills in this catalog. The most-starred ones next to it are Architecture Decision Records, AI-First Engineering and Agentic OS. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Portable Text Conversion against them. Open each page to compare what they document and how they install.

More from sanity-io/agent-toolkit

Portable Text Conversion is one of 7 skills cataloged on DirSkills from sanity-io/agent-toolkit.

See all 7 skills โ†’
๐Ÿงช
2h ago

Content Experimentation Best Practices

Content Experimentation Best Practices gives guidance for designing A/B and multivariate tests, choosing metrics, and interpreting results. Use it when planning experiments, setting up CMS-managed variants, or avoiding common analysis mistakes.
SEO
18128
๐Ÿงฉ
2h ago

Content Modeling Best Practices

Content Modeling Best Practices guides structured content decisions for schemas, reuse, references, and taxonomies. Use it when designing or refactoring content models in Sanity or another headless CMS.
Frontend
18128
๐Ÿ“
2h ago

Portable Text Serialization

Portable Text Serialization renders and serializes Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text. Use it when building Portable Text renderers, custom serializers, or troubleshooting marks, blocks, lists, and custom types.
Frontend
18128
๐Ÿ”Ž
2h ago

SEO & AEO Best Practices

SEO & AEO Best Practices covers metadata, sitemaps, robots.txt, hreflang, JSON-LD, and EEAT. Use it when optimizing pages for search engines and AI answer surfaces like ChatGPT or Perplexity.
SEO
18128
๐Ÿงฉ
2h ago

Sanity Best Practices

Sanity Best Practices covers schema design, GROQ queries, Studio structure, TypeGen, Visual Editing, localization, migrations, Functions, and framework integrations. Use it when building or reviewing Sanity projects and content workflows.
AI Engineering
18128
๐Ÿ—„๏ธ
2h ago

Sanity Migration

Sanity Migration plans and reviews CMS-to-Sanity migrations from exports, APIs, and databases. Use it to map content, convert rich text and assets, set redirects, and validate cutover.
AI Engineering
18128