openclaw/workspace/skills/obsidian-clipper/SKILL.md
Clip web articles to Obsidian vault with full content and images. Use when user sends a URL and wants to save it to Obsidian, or says "clip this", "save to Obsidian", "保存到 Obsidian", "clip 到 vault" etc. Also auto-triggers in Discord channel
npx skillsauth add dragonkid/dotfiles obsidian-clipperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Clip web articles to Obsidian vault with full text and images.
~/Documents/second-brain
Default save folder: Clippings/
Image folder: Attachments/<article-title>/
所有 vault 文件的创建和编辑必须通过 staging 目录中转(~/.openclaw/workspace/.vault-staging/):
cp 到 staging,编辑完再 cp 回 vaultcp 到 vaultcp -r 到 Attachments/根据页面类型选择获取方式:
web_fetch,失败或内容不完整再用 browserbrowser 流程:
browser open → wait for load → scroll to bottom (trigger lazy load) → wait 3s → snapshot
For long articles, snapshot may truncate. Use JS evaluate to get remaining text:
// Get text in chunks
document.querySelector('main').innerText.substring(0, 15000)
document.querySelector('main').innerText.substring(15000, 30000)
// Continue until all content captured
Use JS evaluate to get title, author, date:
// Generic
JSON.stringify({
title: document.querySelector('h1')?.textContent?.trim(),
author: document.querySelector('[rel=author]')?.textContent?.trim()
})
See platform-specific sections below for better selectors.
After scrolling, evaluate JS to get all content images:
Array.from(document.querySelectorAll('article img, #js_content img')).map((img, i) => ({
index: i,
src: img.src,
dataSrc: img.getAttribute('data-src')
}))
Use dataSrc when src is a placeholder (data:image/svg or 1x1 pixel).
Skip non-content images: tracking pixels, avatars, follow buttons, QR codes, GIFs at end of WeChat articles.
ATTACH_DIR="~/Documents/second-brain/Attachments/<title>"
mkdir -p "$ATTACH_DIR"
curl -s -L "<url>" -o "$ATTACH_DIR/img-1.png"
Frontmatter template:
---
title: "<title>"
source: "<url>"
author:
- "<author>"
date: YYYY-MM-DD
tags:
- clippings
---
![[<title>/img-1.png]]~/Documents/second-brain/Clippings/<title>.md文件保存后,触发增量索引(只索引新文件,不影响其他笔记):
python3 ~/.openclaw/workspace/scripts/vault_index.py --file "Clippings/<title>.md"
只在索引完成后发一条消息,过程中保持静默。格式(多行):
✅ Clippings/<title>.md
N 张图 · 索引完成(N chunks)
<一句话主题摘要>
索引失败时第二行改为 N 张图 · 索引失败:<错误原因>。
#js_content selector#activity-name#js_name#publish_time or .rich_media_meta_list emphasis elementsweb_fetch will fail (requires login). Must use browser.x.com/<user>/article/<id>main elementinnerText.substring()web_fetch,内容不完整或 JS 渲染失败再用 browserarticle, main, .post-content, .entry-content selectors任务完成后关闭 tab:
browser(action=close, profile=openclaw, targetId=<targetId>)
Clippings/)当用户在 Discord #obsidian-vault channel 发送 PDF 附件时(消息中包含本地文件路径),触发此流程。
OpenClaw 会将附件保存到本地临时路径,从消息 metadata 中获取该路径。
cp "<tmp_path>/<filename>.pdf" ~/Documents/second-brain/Clippings/<filename>.pdf
保持原始文件名,不做重命名。
python3 ~/.openclaw/workspace/scripts/vault_index.py --file "Clippings/<filename>.pdf"
只在索引完成后发一条消息,格式:
✅ Clippings/<filename>.pdf
索引完成(N chunks)
索引失败时第二行改为 索引失败:<错误原因>。
tools
Use when user wants to manage TODO items - adding tasks, listing pending items, marking done, removing, or searching. Triggers on /todo command or TODO-related requests.
tools
Use when creating a new skill, updating an existing skill, or troubleshooting skill frontmatter, gating, or slash command registration issues in OpenClaw.
tools
手动触发自我改进与记忆维护。分析近期 memory 文件,维护工作区文件,提出改进提案。触发方式:/self_improve 或用户说"自我改进"、"self improve"。
testing
测试 OpenClaw 配置中 LLM provider 的可用性。触发方式:/provider_check 或用户问"测试 provider 可用性"、"检查 provider 状态"、"provider 健康检查"。