Skills 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.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/70asunflower/notion-im-helper" ~/.claude/skills/clawdbot-skills-notion-im-helper && rm -rf "$T"
manifest:
skills/70asunflower/notion-im-helper/SKILL.mdsource content
Notion IM Helper
通过消息自动同步内容到 Notion。支持日记、笔记、待办、想法、问题、链接、摘抄 7 种类型。
Environment Variables
- Notion Integration TokenNOTION_API_KEY
- Target Notion Page ID (32 chars)NOTION_PARENT_PAGE_ID
(optional) - Separate page for quotesNOTION_QUOTES_PAGE_ID
Setup
pip install notion-client- Set env vars:
andNOTION_API_KEYNOTION_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:
→ diaryd
/笔记:
/学习:
/note:
→ noten
/待办:
/todo:
→ todot
/done:
/完成:
→ done√
/想法:
/灵感:
/idea:
/flash:
/闪念:
→ ideai
/问题:
/疑问:
→ questionq:
/摘抄:
/quote:
/qu:
→ quotez
/链接:
/link:
/url:
→ linkl
/图片:
/photo:
/img:
→ imagep
Formats:
→ H1 heading* text
→ H2 heading** text
→ H3 heading*** text
→ quote block> text
→ divider---
→ bulleted list- text
/1. text
etc → numbered list2. text
+ subsequenttoggle: title
/-
/--
lines → toggle block---
Commands:
/月报
→ extract current month records for summarymonthly
/摘抄
→ random historical entry随机摘抄
/搜: xxx
→ search records by keywordsearch: xxx
/撤回
→ delete last batch of blocks (within 5 min window)undo
/配置检查
→ verify configcheck 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#关键词
→ project/p:项目名- 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:
→ success, relay success message to userOK|message
→ guide user to set up Notion integrationERROR|CONFIG
→ invalid API key or page not authorizedERROR|AUTH
→ tell user to waitERROR|RATE_LIMIT
→ tell user to retry laterERROR|NETWORK
Always run
check_config.py first on first use. Never modify or delete existing Notion blocks.
Image Upload
- Supports local file paths (e.g.,
) and HTTP URLs (e.g.,C:\Users\photos\img.jpg
)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
flag to add caption text to the image--caption - Max file size: 5MB (Notion API limit)
- Supported formats: jpg, jpeg, png, gif, webp, bmp, svg