简介
Notion IM Helper
原始描述
Sync IM messages to Notion via Notion API. Supports 7 content types, 4 formats, 2 metadata types. Append-only to a single Notion page.
通过你的 Agent 添加
安装目录:notion-im-helper/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: notion-im-helper
description: Sync IM messages to Notion via Notion API. Supports 7 content types, 4 formats, 2 metadata types. Append-only to a single Notion page.
Notion IM Helper
通过消息自动同步内容到 Notion。支持日记、笔记、待办、想法、问题、链接、摘抄 7 种类型。
Environment Variables
NOTION_API_KEY - Notion Integration Token
NOTION_PARENT_PAGE_ID - Target Notion Page ID (32 chars)
NOTION_QUOTES_PAGE_ID (optional) - Separate page for quotes
Setup
pip install notion-client
- Set env vars:
NOTION_API_KEY and NOTION_PARENT_PAGE_ID
- Authorize integration on Notion page (··· > Connect to)
Usage
NOTION_API_KEY - Notion Integration TokenNOTION_PARENT_PAGE_ID - Target Notion Page ID (32 chars)NOTION_QUOTES_PAGE_ID (optional) - Separate page for quotespip install notion-client- Set env vars:
NOTION_API_KEYandNOTION_PARENT_PAGE_ID - Authorize integration on Notion page (··· > Connect to)
Usage
When the user sends a message matching a trigger pattern, execute the corresponding script:
python scripts/record.py record --type {type} "{content}"
python scripts/record.py heading --level {1|2|3} "{text}"
python scripts/record.py divider
python scripts/record.py list --kind {bullet|number} "{items}"
python scripts/record.py toggle "{json}"
python scripts/record.py image [--caption "text"] "{file_path_or_url}"
python scripts/record.py undo
python scripts/check_config.py
python scripts/summary.py {monthly|quote}
Trigger Rules
Content types (prefix → type):
日记:/今天:/riji:/d→ diary笔记:/学习:/note:/n→ note待办:/todo:/t→ tododone:/完成:/√→ done想法:/灵感:/idea:/flash:/闪念:/i→ idea问题:/疑问:/q:→ question摘抄:/quote:/qu:/z→ quote链接:/link:/url:/l→ link图片:/photo:/img:/p→ image
Formats:
* text→ H1 heading** text→ H2 heading*** text→ H3 heading> text→ quote block---→ divider- text→ bulleted list1. text/2. textetc → numbered listtoggle: title+ subsequent-/--/---lines → toggle block
Commands:
月报/monthly→ extract current month records for summary摘抄/随机摘抄→ random historical entry搜: xxx/search: xxx→ search records by keyword撤回/undo→ delete last batch of blocks (within 5 min window)配置检查/check config→ verify config
Smart detection (no prefix, AI infers):
- Pure URL → link
- Starts with YYYY-MM-DD → diary
- Contains
[ ]or【 】→ todo - Default → idea
Metadata
Scan the LAST line for metadata:
#关键词→ tag/p:项目名→ project- Remove metadata from content before passing to script
Batch & Undo
- Multi-line messages: each format line (heading/quote/divider/list) becomes a separate block, sent in a single API call
- Undo within 5 minutes: deletes all blocks from the last batch
- Undo after 5 minutes: deletes only the last single block
- Day separator: a divider is auto-inserted when the last record is from a different day
Output Protocol
Scripts emit standardized output prefixes:
OK|message→ success, relay success message to userERROR|CONFIG→ guide user to set up Notion integrationERROR|AUTH→ invalid API key or page not authorizedERROR|RATE_LIMIT→ tell user to waitERROR|NETWORK→ tell user to retry later
Always run check_config.py first on first use. Never modify or delete existing Notion blocks.
Image Upload
- Supports local file paths (e.g.,
C:\Users\photos\img.jpg) and HTTP URLs (e.g., https://example.com/photo.png)
- Local files are uploaded to Notion servers via the File Upload API, then attached as image blocks
- URL images are referenced directly as external image blocks
- Optional
--caption flag to add caption text to the image
- Max file size: 5MB (Notion API limit)
- Supported formats: jpg, jpeg, png, gif, webp, bmp, svg
C:\Users\photos\img.jpg) and HTTP URLs (e.g., https://example.com/photo.png)--caption flag to add caption text to the image正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。