返回 Skill 列表
extension
分类: 开发与工程无需 API Key

notion-page-content-updater

当用户需要从文档或数据源中提取结构化内容来更新或填充Notion页面时。此技能处理完整的工作流程,包括:1)按名称搜索并定位特定的Notion页面;2)从源文档(Word/PDF/文本文件)中提取内容;3)分析文档结构以识别相关部分;4)将提取的内容映射到Notion页面的部分;5)修改页面块(添加、删除、更新段落、列表和标题);以及6)以适当的Notion格式(项目符号列表、段落、结构化部分)组织信息。当用户请求‘用文档中的信息更新Notion页面’或需要在文档与Notion工作空间之间同步内容时,请使用此技能。

person作者: jakexiaohubgithub

Skill: Notion Page Content Updater

Purpose

Update a specified Notion page with structured content extracted from a source document (e.g., Word, PDF, text). This skill automates the end-to-end process of finding the page, reading the document, parsing its content, and updating the Notion page's blocks accordingly.

Core Workflow

Follow these steps precisely:

  1. Clarify Request & Identify Target: Confirm the exact name of the Notion page to update and the path/filename of the source document.
  2. Locate the Notion Page:
    • Use notion-API-post-search with the exact page name. If no results, search more broadly (e.g., partial name) or use an empty query {} to list all pages/databases.
    • From the search results, identify the correct page by its title property. Note its id.
  3. Extract Source Content:
    • Use the appropriate tool (word-get_document_text, pdf-get_document_text, filesystem-read_file) to read the source document's full text.
  4. Analyze Page Structure & Plan Updates:
    • Retrieve the current page structure using notion-API-get-block-children with the page ID.
    • Analyze the returned blocks to identify the target sections (e.g., headings for "About Me", "Paintings"). Note the block IDs that come immediately before where new content should be inserted.
    • Parse the extracted document text to identify the relevant content for each target section.
  5. Execute Page Updates (Section by Section):
    • For placeholder content: If a section contains placeholder text (e.g., [Birth, Your education...]), delete the old block using notion-API-delete-a-block.
    • To add new content after a heading/block: Use notion-API-patch-block-children. Specify the page ID as block_id, use the after parameter with the ID of the heading block, and provide the new content in the children array.
    • Structure the content appropriately: Use paragraph blocks for descriptive text and bulleted_list_item blocks for lists.
    • Process one major section at a time (e.g., About Me, then Paintings, then Workshop, etc.).
  6. Verify & Conclude: After all updates, retrieve the page children again to confirm the changes. Provide a clear summary of what was updated.

Critical Implementation Notes

  • Block Update Limitation: The notion-API-update-a-block endpoint has very limited functionality and often cannot be used to change a block's type or rich text content. The primary method for adding content is patch-block-children.
  • Content Chunking: Notion API calls have size limits. Break long document text into logical paragraphs when creating children arrays.
  • Special Characters: Escape quotation marks and newlines (\n) properly in JSON payloads for block content.
  • Error Handling: If a search finds multiple pages with similar names, ask the user for clarification. If a section heading doesn't exist on the target page, you may need to create it first.

Required Tools

  • notion-API-post-search
  • notion-API-get-block-children
  • notion-API-patch-block-children
  • notion-API-delete-a-block
  • word-get_document_text / pdf-get_document_text / filesystem-read_file
  • local-claim_done

Example Trajectory Pattern

The provided trajectory is a canonical example. Follow its pattern: search, extract, analyze structure, then sequentially update sections using patch-block-children after relevant headings.