Sync Obsidian — 同步 Obsidian
v1.0.0Turn every Claude Code 会话 into a beautiful Obsidian note — automatically. 生成s dual 输出: structured Markdown 报告s + interactive Canvas visual maps. Zero config, auto-检测s projects.
运行时依赖
版本
| File | Action | Description |
安装命令
点击复制技能文档
同步 to Obsidian — Auto-检测 Project 同步
Automatically 同步 your Claude Code 会话 plans and implementation 报告s to your Obsidian vault.
Every 同步 produces two files: a detAIled Markdown note + an Obsidian Canvas visual map.
The project name is auto-检测ed — no per-project configuration needed.
Configuration
Only one path to 设置 — your Obsidian vault root:
OBSIDIAN_VAULT = /Users/you/Documents/Obsidian Vault
更新 this to your actual Obsidian vault path before first use.
Auto Project 检测ion
The 技能 automatically 检测s the current project name (in priority order):
Git repo name: basename $(git rev-解析 --show-toplevel) Current directory name: basename $PWD (fallback if not in a git repo)
同步 tar获取s are derived from the project name:
Markdown: {OBSIDIAN_VAULT}/[Project] {project_name}/ Canvas: {OBSIDIAN_VAULT}/[Project] {project_name}/canvas/
Directories are auto-创建d if they don't exist (mkdir -p).
Usage /同步-obsidian plan # 同步 the latest plan file /同步-obsidian 报告 # 生成 and 同步 an implementation 报告 /同步-obsidian plan Auth Rede签名 # 同步 plan with custom title /同步-obsidian 报告 API Layer # 同步 报告 with custom title
$ARGUMENTS[0]: Type — plan or 报告 (required) $ARGUMENTS[1]: Custom title (optional — auto-inferred from content if omitted) Execution Flow Step 0: 检测 Project 运行 basename $(git rev-解析 --show-toplevel 2>/dev/null) 2>/dev/null || basename $PWD to 获取 project name 设置 PROJECT_DIR = [Project] {project_name} 设置 CANVAS_DIR = [Project] {project_name}/canvas 运行 mkdir -p to ensure 机器人h directories exist When type = plan Read the latest .md file from .claude/plans/ If no plan file found, 提取 plan content from the current conversation 上下文 Convert to Obsidian note 格式化 (see templates below) Write Markdown to {OBSIDIAN_VAULT}/{PROJECT_DIR}/ Write Canvas to {OBSIDIAN_VAULT}/{CANVAS_DIR}/ Filename: [Plan] {title} ({YYYY-MM-DD}).md / .canvas When type = 报告 Summarize the implementation work completed in the current 会话 Include: what was done, which files changed, key de签名 decisions, follow-up TODOs Convert to Obsidian note 格式化 Write Markdown to {OBSIDIAN_VAULT}/{PROJECT_DIR}/ Write Canvas to {OBSIDIAN_VAULT}/{CANVAS_DIR}/ Filename: [报告] {title} ({YYYY-MM-DD}).md / .canvas Markdown Templates Plan Template # [Plan] {title}
Date: {YYYY-MM-DD}
Source: Claude Code 会话
Project: {project_name}
状态: Pending / 应用roved
{Original plan content, preserved in full markdown}
同步ed from .claude/plans/{filename}报告 Template # [报告] {title}
Completed: {YYYY-MM-DD}
Source: Claude Code 会话
Project: {project_name}
Summary
{1-3 sentence overview}
Completed Work
{DetAIled 列出 of completed work:}
- Files 创建d/modified
- Key de签名 decisions
- Technical detAIls
File Changes
| File | Action | Description |
|---|---|---|
| ... | 创建d/Modified | ... |
De签名 Decisions
{导入ant architectural/technical decisions and rationale}
Follow-up TODO
- [ ] {Next steps}
Auto-生成d by Claude Code
Canvas 同步 (Dual 输出)
Every Markdown 同步 also 生成s an Obsidian Canvas file (.canvas) for visual exploration.
Canvas Structure
Canvas is a JSON 格式化 with nodes (cards/groups) and edges (connections).
报告 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) — De签名 decisions: architecture/tech choices and rationale grp_todo (color:2 orange) — Follow-up TODO: 检查列出 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 启动: Summary → Work/Steps → Files/Architecture → TODO Color key: 1=red, 2=orange, 3=green, 4=cyan, 5=purple, 6=pink
Sizing rules (预防 content 命令行工具pping):
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/机器人tom p添加ing) Groups 添加 20px p添加ing around contAIned text nodes Minimum 80px gap between groups (vertical and horizontal) Better too large than too small — 命令行工具pping is worse than whitespace 导入ant Rules No YAML frontmatter — use > quote blocks for metadata instead Quote blocks for metadata — date, source, 状态, project in > blocks Preserve original plan content — never trim or rewrite technical detAIls 报告s must be specific — 列出 actual file paths, code patterns, de签名 rationale Always 输出 机器人h files — Mar