Notion APIでページ検索・閲覧・作成、ファイルアップロード、画像付き日記作成、個別ブロックの更新・削除を行うスキル。「Notionで検索して」「Notionに日記書いて」「Notionにファイルアップロードして」「Notionの個別ブロックを修正して」で使用。
npx skills add https://github.com/karaage0703/ai-assistant-workspace --skill xs-notion-manager
Notion APIを使ってページの検索・閲覧・作成、ファイルアップロードを行う。
ntn_xxx)をコピー mkdir -p ~/.config/notion
echo "ntn_xxxxx" > ~/.config/notion/api_key
cd [WORKSPACE]/skills/notion-manager
uv run python notion_tool.py search "検索ワード"
uv run python notion_tool.py search "検索ワード" -t page # ページのみ
uv run python notion_tool.py search "検索ワード" --json # JSON出力
uv run python notion_tool.py read <page_id>
uv run python notion_tool.py read <page_id> --json
uv run python notion_tool.py read <page_id> --with-ids # 各ブロックIDを表示(編集対象を特定するため)
uv run python notion_tool.py create <parent_id> "タイトル"
uv run python notion_tool.py create <parent_id> "タイトル" -c "本文"
uv run python notion_tool.py create <db_id> "タイトル" --database # DB内に作成
# 画像をアップロード(imageブロックとして追加)
uv run python notion_tool.py upload photo.jpg <page_id>
# 動画をアップロード(videoブロックとして追加)
uv run python notion_tool.py upload video.mp4 <page_id>
# ファイルをアップロード(fileブロックとして追加)
uv run python notion_tool.py upload document.pptx <page_id> --as-file
# キャプション付き
uv run python notion_tool.py upload photo.jpg <page_id> -c "東京の風景"
対応形式:
サイズ: 20MB以下は single-part、20MB超は自動で multi-part upload(10MBチャンクで分割→/complete で結合)。
# 1. ブロックIDを調べる(read --with-ids でページ内の全ブロックIDを表示)
uv run python notion_tool.py read <page_id> --with-ids
# 2. 単一ブロックの取得
uv run python notion_tool.py get-block <block_id>
uv run python notion_tool.py get-block <block_id> --json
# 3. ブロックのテキスト更新(既存タイプを維持)
uv run python notion_tool.py update <block_id> -t "新しいテキスト"
# 4. リンク付きテキストに変更
uv run python notion_tool.py update <block_id> -t "クリックでサイトへ" --link "https://example.com"
# 5. To-doブロックのチェック切替
uv run python notion_tool.py update <block_id> --checked
uv run python notion_tool.py update <block_id> --unchecked
# 6. ブロックタイプを切り替え(段落 ↔ 見出し ↔ 箇条書き等)
uv run python notion_tool.py update <block_id> --type bulleted_list_item # 段落→箇条書き
uv run python notion_tool.py update <block_id> -l 3 # 見出し2 → 見出し3
uv run python notion_tool.py update <block_id> --type heading_2 -t "新タイトル" # テキストも同時変更
# 7. ブロック削除(-y で確認スキップ)
uv run python notion_tool.py delete <block_id> -y
対応ブロックタイプ: paragraph, heading_1〜3, bulleted_list_item, numbered_list_item, to_do, quote, code
注意:
--type 指定時は 新タイプを直後に挿入 → 旧ブロック削除 で位置を保ちつつ置き換える(新ブロックIDが返る)--type の対応タイプ: paragraph / heading_1〜3 / bulleted_list_item / numbered_list_item / to_do / quoteupdate 非対応 → delete して upload で再投稿delete は archive 扱い(Notion上はゴミ箱に入る、復元可)# 見出し追加
uv run python notion_tool.py append <page_id> -H "セクション名" -l 2
# テキスト追加
uv run python notion_tool.py append <page_id> -t "本文テキスト"
# 箇条書き追加
uv run python notion_tool.py append <page_id> -b "箇条書きアイテム"
# クリッカブルなリンク付き箇条書き
uv run python notion_tool.py append <page_id> -b "リンクテキスト" --link "https://example.com"
# 複数の箇条書き
uv run python notion_tool.py append <page_id> --bullets "項目1" "項目2" "項目3"
# 長文・コマンド名・URL・特殊文字を含む内容(バックティック / $() / "" / \ など)
# → 必ず --body-file 経由。bash の解釈事故(バックティックがコマンド置換になる等)を防ぐ
uv run python notion_tool.py append <page_id> -F bullet.txt # default: bullet
uv run python notion_tool.py append <page_id> -F text.txt --as text # paragraph
uv run python notion_tool.py append <page_id> -F head.txt --as heading # heading 2
echo "本文 with \`gh pr edit\` and \$(date)" | uv run python notion_tool.py append <page_id> -F - # stdin
⚠️ -b "..." / -t "..." インラインでは、内容にバックティックや $() を含めない。bash がダブルクォート内のそれらをコマンド置換として解釈し、bullet/text の該当部分が空文字に化ける。コマンド名・URL・特殊文字を含む長文は -F/--body-file 一択。
read --json で取得した JSON の file ブロックには署名付きURLが入る。curl -sL -o <out> <url> でダウンロード。URLは1時間で期限切れなので取得後すぐに。
# シンプルな日記
uv run python notion_tool.py diary <parent_page_id>
# タイトル・内容・画像付き
uv run python notion_tool.py diary <parent_page_id> \
-t "2026-01-30 日記" \
-c "今日の出来事" \
-i photo1.jpg photo2.jpg
NotionのページURL末尾の32文字(ハイフンなし)がPage ID。
https://notion.so/Page-Title-abc123def456... の abc123def456... 部分。
制限事項・トラブルシューティングは README.md を参照。
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill.
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
Take karaage0703/xs-notion-manager from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.