sync-obsidian

by chatrichai

Turn every Claude Code session into a beautiful Obsidian note — automatically. Generates dual output: structured Markdown reports + interactive Canvas visual maps. Zero config, auto-detects projects.

3.7k效率与工作流未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/chatrichai/sync-obsidian

文档

Sync to Obsidian — Auto-Detect Project Sync

Automatically sync your Claude Code session plans and implementation reports to your Obsidian vault.

Every sync produces two files: a detailed Markdown note + an Obsidian Canvas visual map.

The project name is auto-detected — no per-project configuration needed.

Configuration

Only one path to set — your Obsidian vault root:

code
OBSIDIAN_VAULT = /Users/you/Documents/Obsidian Vault

Update this to your actual Obsidian vault path before first use.

Auto Project Detection

The skill automatically detects the current project name (in priority order):

  1. Git repo name: basename $(git rev-parse --show-toplevel)
  2. Current directory name: basename $PWD (fallback if not in a git repo)

Sync targets are derived from the project name:

  • Markdown: {OBSIDIAN_VAULT}/[Project] {project_name}/
  • Canvas: {OBSIDIAN_VAULT}/[Project] {project_name}/canvas/

Directories are auto-created if they don't exist (mkdir -p).

Usage

code
/sync-obsidian plan               # Sync the latest plan file
/sync-obsidian report             # Generate and sync an implementation report
/sync-obsidian plan Auth Redesign # Sync plan with custom title
/sync-obsidian report API Layer   # Sync report with custom title
  • $ARGUMENTS[0]: Type — plan or report (required)
  • $ARGUMENTS[1]: Custom title (optional — auto-inferred from content if omitted)

Execution Flow

Step 0: Detect Project

  1. Run basename $(git rev-parse --show-toplevel 2>/dev/null) 2>/dev/null || basename $PWD to get project name
  2. Set PROJECT_DIR = [Project] {project_name}
  3. Set CANVAS_DIR = [Project] {project_name}/canvas
  4. Run mkdir -p to ensure both directories exist

When type = plan

  1. Read the latest .md file from .claude/plans/
  2. If no plan file found, extract plan content from the current conversation context
  3. Convert to Obsidian note format (see templates below)
  4. Write Markdown to {OBSIDIAN_VAULT}/{PROJECT_DIR}/
  5. Write Canvas to {OBSIDIAN_VAULT}/{CANVAS_DIR}/
  6. Filename: [Plan] {title} ({YYYY-MM-DD}).md / .canvas

When type = report

  1. Summarize the implementation work completed in the current session
  2. Include: what was done, which files changed, key design decisions, follow-up TODOs
  3. Convert to Obsidian note format
  4. Write Markdown to {OBSIDIAN_VAULT}/{PROJECT_DIR}/
  5. Write Canvas to {OBSIDIAN_VAULT}/{CANVAS_DIR}/
  6. Filename: [Report] {title} ({YYYY-MM-DD}).md / .canvas

Markdown Templates

Plan Template

markdown
# [Plan] {title}

> Date: {YYYY-MM-DD}
> Source: Claude Code Session
> Project: {project_name}
> Status: Pending / Approved

---

{Original plan content, preserved in full markdown}

---

> Synced from `.claude/plans/{filename}`

Report Template

markdown
# [Report] {title}

> Completed: {YYYY-MM-DD}
> Source: Claude Code Session
> Project: {project_name}

---

## Summary

{1-3 sentence overview}

## Completed Work

{Detailed list of completed work:}
- Files created/modified
- Key design decisions
- Technical details

## File Changes

| File | Action | Description |
|------|--------|-------------|
| ... | Created/Modified | ... |

## Design Decisions

{Important architectural/technical decisions and rationale}

## Follow-up TODO

- [ ] {Next steps}

---

> Auto-generated by Claude Code

Canvas Sync (Dual Output)

Every Markdown sync also generates an Obsidian Canvas file (.canvas) for visual exploration.

Canvas Structure

Canvas is a JSON format with nodes (cards/groups) and edges (connections).

Report Canvas layout:

  • grp_summary (color:4 cyan) — Summary: title + date + 1-3 sentence overview
  • grp_work (color:6 pink) — Completed work: split into sub-cards (steps, rules, etc.)
  • grp_files (color:5 purple) — File changes: table of files and operations
  • grp_decisions (color:3 green) — Design decisions: architecture/tech choices and rationale
  • grp_todo (color:2 orange) — Follow-up TODO: checklist of next steps

Plan Canvas layout:

  • grp_overview (color:4) — Plan overview and goals
  • grp_steps (color:6) — Implementation steps, one text node per step
  • grp_architecture (color:3) — Architecture/tech decisions
  • grp_risks (color:2) — Risks and considerations

Layout principles:

  • Groups connected by edges showing flow direction
  • Top-left start: Summary → Work/Steps → Files/Architecture → TODO
  • Color key: 1=red, 2=orange, 3=green, 4=cyan, 5=purple, 6=pink

Sizing rules (prevent content clipping):

  • Text node min width 320px, recommended 500-660px
  • Estimate 35px per line of text (including line spacing)
  • Headers (##) at 45px, code blocks at 28px per line
  • Text node height = line_count × 35 + 60 (top/bottom padding)
  • Groups add 20px padding around contained text nodes
  • Minimum 80px gap between groups (vertical and horizontal)
  • Better too large than too small — clipping is worse than whitespace

Important Rules

  1. No YAML frontmatter — use > quote blocks for metadata instead
  2. Quote blocks for metadata — date, source, status, project in > blocks
  3. Preserve original plan content — never trim or rewrite technical details
  4. Reports must be specific — list actual file paths, code patterns, design rationale
  5. Always output both files — Markdown + Canvas on every sync
  6. Report full paths — tell the user where both files were written
  7. Auto-create directories — use mkdir -p if project or canvas dir doesn't exist

Auto-Sync Setup (Optional)

Add this to your project's CLAUDE.md to enable the full sync lifecycle:

markdown
## Auto Sync to Obsidian

### Plan Sync (Before Implementation)

When a plan/design discussion is complete and about to move into implementation,
call `/sync-obsidian plan` FIRST — so the user can review it in Obsidian before
giving the green light.

Trigger when:
- A plan or design discussion has been finalized
- User indicates approval intent ("looks good", "let's do it")
- Before starting any implementation work

Flow: Discuss → Sync plan → User reviews in Obsidian → Confirmed → Implement

### Report Sync (After Implementation)

After completing substantive work, call `/sync-obsidian report` before the session ends.

Trigger when:
- Code files were created, edited, or deleted
- A plan was implemented
- Important architecture discussions or decisions were made

### Do NOT trigger when:
- Pure Q&A / casual chat
- Only read files, no modifications
- User explicitly says no sync needed

相关 Skills

表格处理

by anthropics

Universal
热门

围绕 .xlsx、.xlsm、.csv、.tsv 做读写、修复、清洗、格式整理、公式计算与格式转换,适合修改现有表格、生成新报表或把杂乱数据整理成交付级电子表格。

做 Excel/CSV 相关任务很省心,能直接读写、修复、清洗和格式转换,尤其擅长把乱七八糟的表格整理成交付级文件。

效率与工作流
未扫描109.6k

PDF处理

by anthropics

Universal
热门

遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。

PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。

效率与工作流
未扫描109.6k

Word文档

by anthropics

Universal
热门

覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。

搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。

效率与工作流
未扫描109.6k

相关 MCP 服务

文件系统

编辑精选

by Anthropic

热门

Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。

这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。

效率与工作流
82.9k

by wonderwhy-er

热门

Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。

这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。

效率与工作流
5.8k

EdgarTools

编辑精选

by dgunning

热门

EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。

这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。

效率与工作流
1.9k

评论