[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CXGTFPHR16YXEFTD8HCKDX":3,"skill-same:01M7CXGTFPHR16YXEFTD8HCKDX":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7CXGTFPHR16YXEFTD8HCKDX","portable-text-conversion",null,"Convert HTML and Markdown content into Portable Text blocks for Sanity. Use when migrating content from legacy CMSs, importing HTML or Markdown into Sanity, building content pipelines that ingest external content, converting rich text between formats, or programmatically creating Portable Text documents. Covers @portabletext\u002Fmarkdown (markdownToPortableText), @portabletext\u002Fblock-tools (htmlToBlocks), custom deserializers, and the Portable Text specification for manual block construction.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsanity-io-agent-toolkit\u002Fportable-text-conversion\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: portable-text-conversion\ndescription: Convert HTML and Markdown content into Portable Text blocks for Sanity. Use when migrating content from legacy CMSs, importing HTML or Markdown into Sanity, building content pipelines that ingest external content, converting rich text between formats, or programmatically creating Portable Text documents. Covers @portabletext\u002Fmarkdown (markdownToPortableText), @portabletext\u002Fblock-tools (htmlToBlocks), custom deserializers, and the Portable Text specification for manual block construction.\nlicense: MIT\nmetadata:\n  author: sanity\n  version: \"1.0.0\"\n---\n\n# Portable Text Conversion\n\nConvert external content (HTML, Markdown) into Portable Text for Sanity. Three main approaches:\n\n1. **`markdownToPortableText`** — Convert Markdown directly using `@portabletext\u002Fmarkdown` (recommended for Markdown)\n2. **`htmlToBlocks`** — Parse HTML into PT blocks using `@portabletext\u002Fblock-tools` (for HTML migration)\n3. **Manual construction** — Build PT blocks directly from any source (APIs, databases, etc.)\n\n## Portable Text Specification\n\nUnderstand the target format before converting. PT is an array of blocks:\n\n```json\n[\n  {\n    \"_type\": \"block\",\n    \"_key\": \"abc123\",\n    \"style\": \"normal\",\n    \"children\": [\n      {\"_type\": \"span\", \"_key\": \"def456\", \"text\": \"Hello \", \"marks\": []},\n      {\"_type\": \"span\", \"_key\": \"ghi789\", \"text\": \"world\", \"marks\": [\"strong\"]}\n    ],\n    \"markDefs\": []\n  },\n  {\n    \"_type\": \"block\",\n    \"_key\": \"jkl012\",\n    \"style\": \"h2\",\n    \"children\": [\n      {\"_type\": \"span\", \"_key\": \"mno345\", \"text\": \"A heading\", \"marks\": []}\n    ],\n    \"markDefs\": []\n  },\n  {\n    \"_type\": \"image\",\n    \"_key\": \"pqr678\",\n    \"asset\": {\"_type\": \"reference\", \"_ref\": \"image-abc-200x200-png\"}\n  }\n]\n```\n\n**Key rules:**\n- Every block and span needs `_key` (unique within the array)\n- `_type: \"block\"` is for text blocks; custom types use their own `_type`\n- `markDefs` holds annotation data; `marks` on spans reference `markDefs[*]._key` or are decorator strings\n- Lists use `listItem` (\"bullet\" | \"number\") and `level` (1, 2, 3...) on regular blocks\n\n## Conversion Rules\n\nRead the rule file matching your source format:\n\n- **Markdown → Portable Text**: `rules\u002Fmarkdown-to-pt.md` — `@portabletext\u002Fmarkdown` with `markdownToPortableText` (recommended)\n- **HTML → Portable Text**: `rules\u002Fhtml-to-pt.md` — `@portabletext\u002Fblock-tools` with `htmlToBlocks`\n- **Manual PT Construction**: `rules\u002Fmanual-construction.md` — build blocks programmatically from any source\n\n> **Note:** `@sanity\u002Fblock-tools` is the legacy package name. Always use `@portabletext\u002Fblock-tools` for new projects. The API is the same.\n","# Portable Text Conversion\n\nConvert external content (HTML, Markdown) into Portable Text for Sanity. Three main approaches:\n\n1. **`markdownToPortableText`** — Convert Markdown directly using `@portabletext\u002Fmarkdown` (recommended for Markdown)\n2. **`htmlToBlocks`** — Parse HTML into PT blocks using `@portabletext\u002Fblock-tools` (for HTML migration)\n3. **Manual construction** — Build PT blocks directly from any source (APIs, databases, etc.)\n\n## Portable Text Specification\n\nUnderstand the target format before converting. PT is an array of blocks:\n\n```json\n[\n  {\n    \"_type\": \"block\",\n    \"_key\": \"abc123\",\n    \"style\": \"normal\",\n    \"children\": [\n      {\"_type\": \"span\", \"_key\": \"def456\", \"text\": \"Hello \", \"marks\": []},\n      {\"_type\": \"span\", \"_key\": \"ghi789\", \"text\": \"world\", \"marks\": [\"strong\"]}\n    ],\n    \"markDefs\": []\n  },\n  {\n    \"_type\": \"block\",\n    \"_key\": \"jkl012\",\n    \"style\": \"h2\",\n    \"children\": [\n      {\"_type\": \"span\", \"_key\": \"mno345\", \"text\": \"A heading\", \"marks\": []}\n    ],\n    \"markDefs\": []\n  },\n  {\n    \"_type\": \"image\",\n    \"_key\": \"pqr678\",\n    \"asset\": {\"_type\": \"reference\", \"_ref\": \"image-abc-200x200-png\"}\n  }\n]\n```\n\n**Key rules:**\n- Every block and span needs `_key` (unique within the array)\n- `_type: \"block\"` is for text blocks; custom types use their own `_type`\n- `markDefs` holds annotation data; `marks` on spans reference `markDefs[*]._key` or are decorator strings\n- Lists use `listItem` (\"bullet\" | \"number\") and `level` (1, 2, 3...) on regular blocks\n\n## Conversion Rules\n\nRead the rule file matching your source format:\n\n- **Markdown → Portable Text**: `rules\u002Fmarkdown-to-pt.md` — `@portabletext\u002Fmarkdown` with `markdownToPortableText` (recommended)\n- **HTML → Portable Text**: `rules\u002Fhtml-to-pt.md` — `@portabletext\u002Fblock-tools` with `htmlToBlocks`\n- **Manual PT Construction**: `rules\u002Fmanual-construction.md` — build blocks programmatically from any source\n\n> **Note:** `@sanity\u002Fblock-tools` is the legacy package name. Always use `@portabletext\u002Fblock-tools` for new projects. The API is the same.\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"sanity","1.0.0","main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fsanity-io-agent-toolkit\u002Fportable-text-conversion",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill portable-text-conversion",{"tool":41,"command":42},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill portable-text-conversion",{"tool":44,"command":45},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill portable-text-conversion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsanity-io-agent-toolkit\u002Fportable-text-conversion\u002FSkill.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"metadata.json","REFERENCE","参考文档",496,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsanity-io-agent-toolkit\u002Fportable-text-conversion\u002Fmetadata.json",[56,63,68,75,80,87],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":64,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":76,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":88,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]