From 833e9d30fc0d87ce7eda9797ffd0798931757c74 Mon Sep 17 00:00:00 2001 From: Masahiro Chaen Date: Wed, 8 Apr 2026 21:13:03 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20comprehensive=20Clips=20setup=20guide?= =?UTF-8?q?=20=E2=80=94=20/clip,=20Slack=20DM,=20X=20bookmarks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Detailed setup instructions for all 3 clipping methods - Slack DM clip: agent auto-action config, skill files, behavior spec - X bookmark cron: schedule, xurl --auth oauth2 requirement - Dataview queries for tag-based browsing - Both EN and JP versions updated Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 115 ++++++++++++++++++++++++++++++++++++++++++++++++--- README_JP.md | 108 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 211 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ccd76fb..f771a46 100644 --- a/README.md +++ b/README.md @@ -93,15 +93,57 @@ Updated automatically by Dreaming (morning + evening + weekly). Tracks patterns ## Clips — Knowledge Clipping -Clips automatically captures tweets and articles into your vault. Like Karpathy's compounding knowledge pattern, everything you read accumulates and becomes searchable. +Clips automatically captures tweets and articles into your vault. Like Karpathy's compounding knowledge pattern, everything you read accumulates and becomes searchable in Obsidian. ### Three Ways to Clip -| Method | Trigger | How it works | -|--------|---------|--------------| -| **`/clip` skill** | `/clip ` in Claude Code | Detects X tweet vs article, fetches content, generates summary + tags, saves to `clips/` | -| **X Bookmark Sync** | Daily cron (22:00) | Auto-fetches yesterday's X bookmarks via `xurl`, summarizes, saves to `clips/x/` | -| **Slack/Discord** | Post URL in channel | External agent picks up URL, scrapes, saves to `clips/articles/` | +| Method | Trigger | Best for | +|--------|---------|----------| +| **`/clip` skill** | `/clip ` in Claude Code | Working at your desk, high-quality summaries | +| **Slack DM** | Post URL in Slack DM to your agent | On the go (phone), instant capture | +| **X Bookmark Sync** | Automatic every 4 hours | Passive — just bookmark on X, it syncs | + +### 1. `/clip` — Manual Clip in Claude Code + +``` +/clip https://x.com/karpathy/status/1234567890 +/clip https://example.com/great-article +/clip https://url1.com https://url2.com # multiple URLs +``` + +Detects X tweet vs article automatically. Fetches content, generates summary + tags in Japanese, saves to `clips/`, updates daily note, and pushes to git. + +### 2. Slack DM — Clip from Your Phone + +Just send a URL to your agent's Slack DM: + +``` +https://example.com/interesting-article +``` + +The agent detects the URL, scrapes the content, generates a summary, saves to `clips/`, and replies in a thread: + +``` +📎 Clipped! +📄 How LLMs Will Change Everything +🏷️ #ai #llm #future +📁 vault/clips/articles/2026-04-08_llm-change-everything.md +``` + +**Setup**: Requires an always-on agent (like [OpenClaw](https://openclaw.com)) with Slack Socket Mode. Add the URL detection behavior to your agent's auto-actions. See [Slack Clip Setup](#slack-clip-setup) below. + +### 3. X Bookmark Auto-Sync + +Bookmark tweets on X as you normally would. A cron job syncs them to your vault automatically. + +**Default schedule**: Every 4 hours (8:00, 12:00, 16:00, 20:00) + +**Requirements**: [xurl](https://github.com/twitterdev/xurl) CLI with OAuth2 authentication. + +```bash +# Test manually +xurl bookmarks -n 5 --auth oauth2 +``` ### Clip File Format @@ -113,6 +155,7 @@ source: x | article url: https://... author: "@username" tags: [ai, claude-code, agent] +via: slack | cli | cron # how it was clipped --- ## Summary @@ -139,6 +182,66 @@ Each clip is automatically linked in the day's daily note: - [[clips/articles/2026-04-08_karpathy-llm-wiki]] — Karpathy LLM Wiki pattern ``` +### Dataview Queries + +Browse clips by tag in Obsidian: + +```dataview +TABLE rows.date, rows.source, rows.author +FROM "clips" +WHERE type = "clip" +FLATTEN tags as tag +GROUP BY tag +SORT rows.date DESC +``` + +### Slack Clip Setup + +To enable Slack DM → clip, add this auto-action to your agent: + +1. **Create skill files** in your agent's workspace: + +``` +workspace/skills/slack-clip/ +├── SKILL.md ← Skill overview +├── BEHAVIOR.md ← Detection rules + processing flow +└── processed-clips.json ← Deduplication tracking +``` + +2. **Add auto-action** to your agent's config (e.g., `AGENTS.md`): + +```markdown +### URL投稿 → Vaultクリップ +DM にURLを含むメッセージが来たら自動でvault/clips/に保存。 + +検知方法: +- メッセージテキストに https:// を含む(転送メッセージは除外) +- Slack内部URL、画像直リンクは除外 + +処理: +1. URL種別判定(X tweet vs 記事) +2. X tweet → xurl read / 記事 → firecrawl scrape +3. 要約・タグ生成 → vault/clips/ に保存 +4. git push + スレッド返信で確認 +``` + +3. **Ensure tools are available** to the agent: + - `xurl` (X API CLI) with OAuth2 auth + - `firecrawl` (web scraping CLI) + - Git access to your vault repo + +### X Bookmark Cron Setup + +Add a cron job to your agent scheduler: + +```json +{ + "name": "clip-x-bookmarks", + "schedule": "0 8-23/4 * * *", + "message": "Fetch X bookmarks with `xurl bookmarks -n 20 --auth oauth2`, check for duplicates in vault/clips/x/, summarize new ones, save to vault/clips/x/, update _index.md, git push." +} +``` + ## Architecture ``` diff --git a/README_JP.md b/README_JP.md index 6306968..70ee712 100644 --- a/README_JP.md +++ b/README_JP.md @@ -80,15 +80,57 @@ Dreaming(朝夕+週次)が自動更新。時間とともに浮かび上が ## Clips — ナレッジクリッピング -ツイートや記事を自動でvaultに蓄積。Karpathyの「知識が複利で増える」パターンで、読んだもの全てが検索可能に。 +ツイートや記事を自動でvaultに蓄積。Karpathyの「知識が複利で増える」パターンで、読んだもの全てがObsidianで検索可能に。 ### 3つの取り込み方法 -| 方法 | トリガー | 動作 | -|------|---------|------| -| **`/clip` スキル** | `/clip ` | Xツイート vs 記事を判定→内容取得→要約+タグ→`clips/`に保存 | -| **Xブックマーク自動同期** | 毎日22:00 cron | `xurl`で昨日のブックマークを取得→要約→`clips/x/`に保存 | -| **Slack/Discord経由** | チャンネルにURL投稿 | 外部エージェントが処理→`clips/articles/`に保存 | +| 方法 | トリガー | 最適な場面 | +|------|---------|-----------| +| **`/clip` スキル** | Claude Codeで `/clip ` | デスクワーク中、高品質な要約 | +| **Slack DM** | エージェントのDMにURL投稿 | 外出先(スマホ)、即座にキャプチャ | +| **Xブックマーク自動同期** | 4時間おきに自動 | パッシブ — Xでブックマークするだけ | + +### 1. `/clip` — Claude Codeで手動クリップ + +``` +/clip https://x.com/karpathy/status/1234567890 +/clip https://example.com/great-article +/clip https://url1.com https://url2.com # 複数URL対応 +``` + +X tweet vs 記事を自動判定。内容取得→要約・タグ生成→`clips/`保存→daily note追記→git push。 + +### 2. Slack DM — スマホからクリップ + +エージェントのSlack DMにURLを送るだけ: + +``` +https://example.com/interesting-article +``` + +エージェントがURLを検知→スクレイピング→要約→`clips/`保存→スレッド返信: + +``` +📎 クリップしました! +📄 LLMが全てを変える方法 +🏷️ #ai #llm #future +📁 vault/clips/articles/2026-04-08_llm-change-everything.md +``` + +**セットアップ**: 常時稼働エージェント([OpenClaw](https://openclaw.com)等)+ Slack Socket Modeが必要。詳細は[Slack Clipセットアップ](#slack-clipセットアップ)参照。 + +### 3. Xブックマーク自動同期 + +普段どおりXでツイートをブックマークするだけ。cronジョブが自動でvaultに同期。 + +**デフォルトスケジュール**: 4時間おき(8:00, 12:00, 16:00, 20:00) + +**必要なもの**: [xurl](https://github.com/twitterdev/xurl) CLI + OAuth2認証 + +```bash +# 手動テスト +xurl bookmarks -n 5 --auth oauth2 +``` ### クリップファイルのフォーマット @@ -100,6 +142,7 @@ source: x | article url: https://... author: "@username" tags: [ai, claude-code, agent] +via: slack | cli | cron --- ## 要約 @@ -126,6 +169,59 @@ tags: [ai, claude-code, agent] - [[clips/articles/2026-04-08_karpathy-llm-wiki]] — Karpathy LLM Wikiパターン ``` +### Dataviewクエリ + +Obsidianでタグ別にクリップを閲覧: + +```dataview +TABLE rows.date, rows.source, rows.author +FROM "clips" +WHERE type = "clip" +FLATTEN tags as tag +GROUP BY tag +SORT rows.date DESC +``` + +### Slack Clipセットアップ + +Slack DM → clip を有効にする手順: + +1. **スキルファイル作成** — エージェントのワークスペースに: + +``` +workspace/skills/slack-clip/ +├── SKILL.md ← スキル概要 +├── BEHAVIOR.md ← 検知ルール + 処理フロー +└── processed-clips.json ← 重複防止トラッキング +``` + +2. **自動アクション追加** — エージェントの設定(`AGENTS.md`等)に: + +```markdown +### URL投稿 → Vaultクリップ +DMにURLを含むメッセージが来たら自動でvault/clips/に保存。 + +検知: https:// を含む(転送メッセージ・Slack内部URL・画像直リンクは除外) +処理: URL判定 → 取得 → 要約・タグ → vault保存 → git push → スレッド返信 +``` + +3. **ツール確認** — エージェントが以下にアクセスできること: + - `xurl`(X API CLI)+ OAuth2認証 + - `firecrawl`(Webスクレイピング CLI) + - vault リポジトリへのgitアクセス + +### Xブックマークcronセットアップ + +エージェントスケジューラにcronジョブを追加: + +```json +{ + "name": "clip-x-bookmarks", + "schedule": "0 8-23/4 * * *", + "message": "xurl bookmarks -n 20 --auth oauth2 でブックマーク取得、vault/clips/x/ と重複チェック、新規を要約して保存、_index.md更新、git push" +} +``` + ## アーキテクチャ ```