SkillsGrove
SkillsGrove/Productivité/wulaosiji/skills/feishu-md-parser

feishu-md-parser

Installation

$npx skills add https://github.com/wulaosiji/skills --skill feishu-md-parser
$git clone --depth 1 https://github.com/wulaosiji/skills.git /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/feishu-doc-orchestrator/feishu-md-parser ~/.claude/skills/feishu-md-parser
Installe pour moi cette Agent Skill : https://github.com/wulaosiji/skills/tree/d733e1308915dcdcc52c9594853b10f497e7a4a0/feishu-doc-orchestrator/feishu-md-parser — lis d’abord son SKILL.md et ses scripts, et ne l’installe dans mon dossier de compétences qu’après avoir vérifié qu’elle est sûre.

Résumé

Description d’origine · MITMarkdown解析子技能 / Feishu markdown parser sub-skill. 将 Markdown 文件解析为飞书文档块格式,输出 JSON 文件,支持25种块类型映射。 Use when: "解析Markdown为飞书块", "parse markdown to feishu blocks", "Markdown转块格式", "markdown to block format", "飞书块类型映射", "feishu block type mapping", "文档块解析", "document block parsing". 内部组件,由 feishu-doc-orchestrator 编排调用,输出 blocks.json 供 feishu-block-adder 使用。Cross-references: feishu-doc-orchestrator, feishu-block-adder, feishu-doc-converter. Built by UniqueClub 🌐 https://uniqueclub.ai
Le SKILL.md ci-dessous est reproduit depuis wulaosiji/skills (commit d733e13) sous licence MIT. Le texte est inchangé ; seules les métadonnées d’en-tête du fichier sont omises, les images sont affichées sous forme de liens et les fichiers très longs sont tronqués. Copyright 2025 Feishu Document Creation Skill. Licence : feishu-doc-orchestrator/LICENSE. Seul le fichier d’instructions est affiché ; consultez le dépôt d’origine pour les éventuels scripts.

Feishu Markdown Parser (Sub-skill)

将 Markdown 文件解析为飞书文档块格式,输出 JSON 文件。支持25种块类型映射。内部组件。

When to Use

Use this skill when:

  • 需要将 Markdown 文件解析为飞书文档块格式时
  • 需要将标题、列表、表格、代码块等转换为飞书块时
  • 需要清理 Markdown 中的零宽字符和特殊格式时

Do NOT use this skill if:

  • 需要添加块到文档 → use feishu-block-adder instead
  • 需要创建文档 → use feishu-doc-orchestrator (parent) instead
  • 需要将飞书文档转为 Markdown → use feishu-doc-converter instead

Typical triggers:

  • 「解析 Markdown 为飞书块」「转换 Markdown 为块格式」
  • "parse markdown to blocks", "convert markdown to feishu format"

Workflow

  1. 探查 (Probe) 从指定路径读取 Markdown 文件内容。

  2. 约束 (Constrain) 支持的块类型:标题(# - ######)、无序/有序列表、表格、代码块、引用块、粗体/斜体、分割线。不支持的元素跳过并记录。清理零宽字符(\u200b, \u200c, \u200d, \ufeff)。

  3. 执行 (Execute)

  4. 解析 Markdown 内容为飞书块格式

  5. 清理内容(移除零宽字符、清理表格单元格、处理粗体标记)

  6. 输出 JSON 文件

python scripts/md_parser.py input.md output/blocks.json
  1. 验证 (Verify) 检查 blocks.json 中的块数量、表格数量、标题数量等元数据,确认解析完整。

  2. 交付 (Deliver) 输出 output/blocks.json(块数据)和 output/metadata.json(解析元数据)。

Output

{
  "blocks": [
    {
      "block_type": 2,
      "text": {
        "elements": [{"text_run": {"content": "文本内容"}}],
        "style": {}
      }
    },
    {
      "block_type": 31,
      "table": {
        "property": {"row_size": 3, "column_size": 2, "header_row": true},
        "data": [["标题1", "标题2"], ["数据1", "数据2"], ["数据3", "数据4"]]
      }
    }
  ],
  "metadata": {"total_blocks": 50, "table_count": 5, "heading_count": 10}
}

Guardrails

Anti-patterns

  • NEVER 将 Callout 块的颜色字段嵌套在 style 中(必须直接放在 callout 对象下)
  • Do NOT 保留零宽字符(会导致飞书显示异常)
  • Do NOT 独立使用本子技能——应由父技能编排

Constraints

  • 只传递文件路径,不传递内容
  • 输出给 feishu-doc-creator 和 feishu-block-adder
  • Callout 块(block_type: 19)使用 Python 展开操作符将样式字段直接展开到 callout 下

Related Skills

  • feishu-doc-orchestrator (parent) — 主编排技能,调用本子技能
  • feishu-block-adder — 下游:将解析后的块添加到文档
  • feishu-doc-converter — 反向转换:飞书文档转 Markdown

About UniqueClub

Part of the UniqueClub toolkit. 🌐 https://uniqueclub.ai

Voir le texte intégral de la licence (MIT)
MIT License

Copyright (c) 2025 Feishu Document Creation Skill

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.