writing-to-logseq
Logseqのデータベースグラフに対し、HTTP APIを通じてページの作成、ブロック追加、コンテンツ更新、プロパティ設定などを行い、会話メモの同期まで実現することで、Logseqをより便利に活用するSkill。
📜 元の英語説明(参考)
Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.
🇯🇵 日本人クリエイター向け解説
Logseqのデータベースグラフに対し、HTTP APIを通じてページの作成、ブロック追加、コンテンツ更新、プロパティ設定などを行い、会話メモの同期まで実現することで、Logseqをより便利に活用するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o writing-to-logseq.zip https://jpskill.com/download/17712.zip && unzip -o writing-to-logseq.zip && rm writing-to-logseq.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17712.zip -OutFile "$d\writing-to-logseq.zip"; Expand-Archive "$d\writing-to-logseq.zip" -DestinationPath $d -Force; ri "$d\writing-to-logseq.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
writing-to-logseq.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
writing-to-logseqフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 4
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] writing-to-logseq
Logseq への書き込み
この Skill を使用する場面
この Skill は、以下の場合に自動的に起動します。
- ユーザーが Logseq で新しいページまたはブロックを作成したい場合
- グラフ内の既存のコンテンツを更新する場合
- エンティティのプロパティを設定または変更する場合
- ブロックにタグ/クラスを追加する場合
- 会話のメモを Logseq に同期する場合
- ユーザーが "add to logseq"、"create page"、"update block" などと発言した場合
書き込み操作: API については、{baseDir}/scripts/write-operations.py を参照してください。
利用可能な操作
| 操作 | 説明 |
|---|---|
create_page(title, content) |
新しいページを作成します |
create_block(parent, content) |
親の下にブロックを追加します |
update_block(uuid, content) |
ブロックの内容を修正します |
delete_block(uuid) |
ブロックを削除します |
set_property(uuid, key, value) |
プロパティの値を設定します |
add_tag(uuid, tag) |
ブロックにタグ/クラスを追加します |
append_to_page(title, content) |
既存のページにコンテンツを追加します |
簡単な例
ページの作成
from write_operations import LogseqWriter
writer = LogseqWriter()
# 簡単なページを作成
page = writer.create_page("Meeting Notes 2024-01-15")
# 初期コンテンツを含むページを作成
page = writer.create_page(
"Project Alpha",
content="Project overview and tasks",
properties={"status": "Active", "priority": "High"}
)
ブロックの追加
# ページにブロックを追加
block = writer.create_block(
parent="page-uuid-or-title",
content="New task item"
)
# ネストされたブロックを追加
child = writer.create_block(
parent=block["uuid"],
content="Sub-task details"
)
コンテンツの更新
# ブロックの内容を更新
writer.update_block(
uuid="block-uuid",
content="Updated content here"
)
# 既存のページに追加
writer.append_to_page(
title="Daily Notes",
content="- New item added via API"
)
プロパティの設定
# 単一のプロパティを設定
writer.set_property(
uuid="block-uuid",
key="status",
value="Complete"
)
# 型付きプロパティを設定
writer.set_property(
uuid="block-uuid",
key="rating",
value=5,
type="number"
)
# 複数のプロパティを設定
writer.set_properties(
uuid="block-uuid",
properties={
"author": "John Doe",
"rating": 5,
"published": "2024-01-15"
}
)
タグの追加
# ブロックにタグを追加
writer.add_tag(uuid="block-uuid", tag="Book")
# 複数のタグを追加
writer.add_tags(uuid="block-uuid", tags=["Important", "Review"])
HTTP API メソッド
ページの作成
{
"method": "logseq.Editor.createPage",
"args": ["PageTitle", {"property": "value"}, {"createFirstBlock": true}]
}
ブロックの挿入
{
"method": "logseq.Editor.insertBlock",
"args": ["parent-uuid", "Block content", {"sibling": false}]
}
ブロックの更新
{
"method": "logseq.Editor.updateBlock",
"args": ["block-uuid", "New content"]
}
プロパティの設定
{
"method": "logseq.Editor.upsertBlockProperty",
"args": ["block-uuid", "property-name", "value"]
}
ブロックの削除
{
"method": "logseq.Editor.removeBlock",
"args": ["block-uuid"]
}
安全性に関するガイドライン
ベストプラクティス
- 削除前に確認 - 削除する前に、ブロックが存在することを常に確認してください
- 一意のタイトルを使用 - 重複するページを作成しないようにしてください
- プロパティの検証 - プロパティの型がスキーマと一致することを確認してください
- エラー処理 - API の失敗を適切にキャッチして処理してください
よくある落とし穴
- ページの重複: 作成する前にページが存在するかどうかを確認してください
- 無効な UUID: 操作の前に UUID の形式を検証してください
- プロパティの型: 数値プロパティには数値が必要です
- レート制限: API に大量のリクエストを送信しないでください
コンテンツの書式設定
Markdown のサポート
# Logseq はブロック内で markdown をサポートしています
writer.create_block(
parent=page_uuid,
content="""
## Section Header
- Bullet point
- Another point
- Nested item
**Bold** and *italic* work too.
[[Link to Page]] and #tags
"""
)
プロパティの構文
# プロパティはコンテンツ内で設定できます
writer.create_block(
parent=page_uuid,
content="""
- Task item
status:: In Progress
priority:: High
due:: [[2024-01-20]]
"""
)
# または API 経由で (型付きの値には推奨)
writer.set_property(uuid, "rating", 5) # number
writer.set_property(uuid, "done", True) # checkbox
会話の Logseq への同期
メモを保存するためのパターン
def sync_conversation_to_logseq(title, notes):
"""会話のメモを Logseq ページに同期します。"""
writer = LogseqWriter()
# ページを作成または取得
page = writer.get_or_create_page(f"Claude Notes/{title}")
# タイムスタンプヘッダーを追加
from datetime import datetime
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
writer.append_to_page(
title=f"Claude Notes/{title}",
content=f"""
## {timestamp}
{notes}
---
"""
)
return page
エラー処理
try:
page = writer.create_page("My Page")
except writer.ConnectionError:
print("Cannot connect to Logseq")
except writer.DuplicateError:
print("Page already exists")
except writer.ValidationError as e:
print(f"Invalid data: {e}")
参考資料
- すべての操作については、
{baseDir}/references/write-operations.mdを参照してください - 安全性に関するプラクティスについては、
{baseDir}/references/safety-guidelines.mdを参照してください - ページテンプレートについては、
{baseDir}/templates/page-template.mdを参照してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Writing to Logseq
When to Use This Skill
This skill auto-invokes when:
- User wants to create new pages or blocks in Logseq
- Updating existing content in the graph
- Setting or modifying properties on entities
- Adding tags/classes to blocks
- Syncing conversation notes to Logseq
- User mentions "add to logseq", "create page", "update block"
Write Operations: See {baseDir}/scripts/write-operations.py for the API.
Available Operations
| Operation | Description |
|---|---|
create_page(title, content) |
Create new page |
create_block(parent, content) |
Add block under parent |
update_block(uuid, content) |
Modify block content |
delete_block(uuid) |
Remove block |
set_property(uuid, key, value) |
Set property value |
add_tag(uuid, tag) |
Add tag/class to block |
append_to_page(title, content) |
Add content to existing page |
Quick Examples
Create a Page
from write_operations import LogseqWriter
writer = LogseqWriter()
# Create simple page
page = writer.create_page("Meeting Notes 2024-01-15")
# Create page with initial content
page = writer.create_page(
"Project Alpha",
content="Project overview and tasks",
properties={"status": "Active", "priority": "High"}
)
Add Blocks
# Add block to a page
block = writer.create_block(
parent="page-uuid-or-title",
content="New task item"
)
# Add nested block
child = writer.create_block(
parent=block["uuid"],
content="Sub-task details"
)
Update Content
# Update block content
writer.update_block(
uuid="block-uuid",
content="Updated content here"
)
# Append to existing page
writer.append_to_page(
title="Daily Notes",
content="- New item added via API"
)
Set Properties
# Set single property
writer.set_property(
uuid="block-uuid",
key="status",
value="Complete"
)
# Set typed property
writer.set_property(
uuid="block-uuid",
key="rating",
value=5,
type="number"
)
# Set multiple properties
writer.set_properties(
uuid="block-uuid",
properties={
"author": "John Doe",
"rating": 5,
"published": "2024-01-15"
}
)
Add Tags
# Add tag to block
writer.add_tag(uuid="block-uuid", tag="Book")
# Add multiple tags
writer.add_tags(uuid="block-uuid", tags=["Important", "Review"])
HTTP API Methods
Create Page
{
"method": "logseq.Editor.createPage",
"args": ["PageTitle", {"property": "value"}, {"createFirstBlock": true}]
}
Insert Block
{
"method": "logseq.Editor.insertBlock",
"args": ["parent-uuid", "Block content", {"sibling": false}]
}
Update Block
{
"method": "logseq.Editor.updateBlock",
"args": ["block-uuid", "New content"]
}
Set Property
{
"method": "logseq.Editor.upsertBlockProperty",
"args": ["block-uuid", "property-name", "value"]
}
Delete Block
{
"method": "logseq.Editor.removeBlock",
"args": ["block-uuid"]
}
Safety Guidelines
Best Practices
- Verify before delete - Always confirm block exists before removal
- Use unique titles - Avoid creating duplicate pages
- Validate properties - Ensure property types match schema
- Handle errors - Catch and handle API failures gracefully
Common Pitfalls
- Duplicate pages: Check if page exists before creating
- Invalid UUIDs: Verify UUID format before operations
- Property types: Number properties need numeric values
- Rate limiting: Don't spam API with rapid requests
Content Formatting
Markdown Support
# Logseq supports markdown in blocks
writer.create_block(
parent=page_uuid,
content="""
## Section Header
- Bullet point
- Another point
- Nested item
**Bold** and *italic* work too.
[[Link to Page]] and #tags
"""
)
Property Syntax
# Properties can be set in content
writer.create_block(
parent=page_uuid,
content="""
- Task item
status:: In Progress
priority:: High
due:: [[2024-01-20]]
"""
)
# Or via API (preferred for typed values)
writer.set_property(uuid, "rating", 5) # number
writer.set_property(uuid, "done", True) # checkbox
Sync Conversation to Logseq
Pattern for Saving Notes
def sync_conversation_to_logseq(title, notes):
"""Sync conversation notes to Logseq page."""
writer = LogseqWriter()
# Create or get page
page = writer.get_or_create_page(f"Claude Notes/{title}")
# Add timestamp header
from datetime import datetime
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
writer.append_to_page(
title=f"Claude Notes/{title}",
content=f"""
## {timestamp}
{notes}
---
"""
)
return page
Error Handling
try:
page = writer.create_page("My Page")
except writer.ConnectionError:
print("Cannot connect to Logseq")
except writer.DuplicateError:
print("Page already exists")
except writer.ValidationError as e:
print(f"Invalid data: {e}")
Reference Materials
- See
{baseDir}/references/write-operations.mdfor all operations - See
{baseDir}/references/safety-guidelines.mdfor safety practices - See
{baseDir}/templates/page-template.mdfor page templates
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,691 bytes)
- 📎 references/safety-guidelines.md (7,197 bytes)
- 📎 references/write-operations.md (7,411 bytes)
- 📎 scripts/write-operations.py (14,596 bytes)