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.
Only one path to set — your Obsidian vault root:
OBSIDIAN_VAULT = /Users/you/Documents/Obsidian Vault
> Update this to your actual Obsidian vault path before first use.
The skill automatically detects the current project name (in priority order):
basename $(git rev-parse --show-toplevel)basename $PWD (fallback if not in a git repo)Sync targets are derived from the project name:
{OBSIDIAN_VAULT}/[Project] {project_name}/{OBSIDIAN_VAULT}/[Project] {project_name}/canvas/> Directories are auto-created if they don't exist (mkdir -p).
/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)basename $(git rev-parse --show-toplevel 2>/dev/null) 2>/dev/null || basename $PWD to get project namePROJECT_DIR = [Project] {project_name}CANVAS_DIR = [Project] {project_name}/canvasmkdir -p to ensure both directories existplan.md file from .claude/plans/{OBSIDIAN_VAULT}/{PROJECT_DIR}/{OBSIDIAN_VAULT}/{CANVAS_DIR}/[Plan] {title} ({YYYY-MM-DD}).md / .canvasreport{OBSIDIAN_VAULT}/{PROJECT_DIR}/{OBSIDIAN_VAULT}/{CANVAS_DIR}/[Report] {title} ({YYYY-MM-DD}).md / .canvas# [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] {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
Every Markdown sync also generates an Obsidian Canvas file (.canvas) for visual exploration.
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 overviewgrp_work (color:6 pink) — Completed work: split into sub-cards (steps, rules, etc.)grp_files (color:5 purple) — File changes: table of files and operationsgrp_decisions (color:3 green) — Design decisions: architecture/tech choices and rationalegrp_todo (color:2 orange) — Follow-up TODO: checklist of next stepsPlan Canvas layout:
grp_overview (color:4) — Plan overview and goalsgrp_steps (color:6) — Implementation steps, one text node per stepgrp_architecture (color:3) — Architecture/tech decisionsgrp_risks (color:2) — Risks and considerationsLayout principles:
Sizing rules (prevent content clipping):
> quote blocks for metadata instead> blocksmkdir -p if project or canvas dir doesn't existAdd this to your project's CLAUDE.md to enable the full sync lifecycle:
## 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
共 1 个版本