Claude-skill-registry archive-obsidian-vault
Archives monthly work items from Obsidian vault Area/ and Projects/ to Archive/ with proper organization and attachment handling. Use when archiving completed monthly work.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/archive-obsidian-vault" ~/.claude/skills/majiayu000-claude-skill-registry-archive-obsidian-vault && rm -rf "$T"
skills/data/archive-obsidian-vault/SKILL.mdArchive Obsidian Vault
Overview
This skill automates the archival process for monthly work items in an Obsidian vault. It moves completed work from
Area/ and Projects/ directories to Archive/ following a consistent naming pattern, handles attachments properly, and optionally processes journal files.
Vault Structure
The Obsidian vault follows this structure:
- Active work areas (Discussions, Drawings, Journal, People)Area/
- Active projectsProjects/
- Archived work organized by YYYY-MM [Category] patternArchive/
Quick Start
To archive work for a specific month:
- Request month to archive - Ask user for the month in YYYY-MM format (e.g., 2025-10)
- Identify items to archive - Search for all files and folders matching the date pattern
- Process journal cleanup - Run delete_empty_journals.py if requested
- Create archive directories - Set up destination folders
- Move files with attachments - Transfer files and their associated attachments
- Verify completion - Confirm all items were archived successfully
Archival Process
Step 1: Request Month to Archive
Ask the user for the month:
- Request the month in YYYY-MM format (e.g., "2025-10")
- Validate the format matches YYYY-MM pattern
- Store this as the
variable for the rest of the process$MONTH
Ask about journal processing preferences:
- Should empty journals be deleted before archiving?
- Should journals be combined into monthly files?
- Should bookmarks be extracted from journals?
- Or should journals be moved as-is?
Step 2: Identify Items to Archive
Search for items in Area/ directories:
Navigate to the vault location:
/Users/paul/Library/CloudStorage/GoogleDrive-paul@meandu.com/My Drive/Obsidian/meandu/
Find items matching the month pattern:
filesArea/Discussions/$MONTH *.md
filesArea/Drawings/$MONTH-*.md
filesArea/Journal/$MONTH-*.md
foldersProjects/$MONTH */
Identify attachment references:
For each Drawings file found:
- Extract attachment references using pattern:
![[*-tldrawFile.*]] - Build list of attachment files that need to be moved
- Attachments are typically in previous months' Archive/*/attachments/ folders or Projects/attachments/
Step 3: Process Journal Cleanup (Optional)
If user requested empty journal deletion:
cd 'Area/Journal' python ~/bin/obsidian/delete_empty_journals.py --dry-run . $MONTH # Review output, then run without --dry-run python ~/bin/obsidian/delete_empty_journals.py . $MONTH
Available journal processing scripts in
~/bin/obsidian/:
- Removes journal files containing only whitespacedelete_empty_journals.py
- Merges daily YYYY-MM-DD.md files into monthly YYYY-MM Journal.mdcombine_journals.py
- Extracts links into separate YYYY-MM Links.md filesextract_bookmarks.py
Step 4: Create Archive Directories
Create destination directories following the established pattern:
cd Archive mkdir -p "$MONTH Discussions" mkdir -p "$MONTH Drawings/attachments" mkdir -p "$MONTH Journals" # Create project-specific folders as needed mkdir -p "$MONTH [Project Name]"
Step 5: Move Files with Attachments
Move Discussion files:
mv Area/Discussions/$MONTH*.md Archive/$MONTH\ Discussions/
Move Drawing files and attachments:
- Move markdown files:
mv Area/Drawings/$MONTH-*.md Archive/$MONTH\ Drawings/
- Extract list of referenced attachments from moved files
- Find and copy/move attachments from their current locations to Archive/$MONTH Drawings/attachments/
- Verify all referenced attachments are present
Move Journal files:
mv Area/Journal/$MONTH-*.md Archive/$MONTH\ Journals/
Move Project folders:
mv Projects/$MONTH\ [Project\ Name] Archive/
Step 6: Verify Completion
Count and verify:
- Count files in each archive directory
- Verify attachment references match available files
- Report final counts to user
Summary format:
Archived for $MONTH: - X discussion files → Archive/$MONTH Discussions/ - X drawing files → Archive/$MONTH Drawings/ - X attachment files → Archive/$MONTH Drawings/attachments/ - X journal files → Archive/$MONTH Journals/ - X project folders Total: X items archived
File Paths Reference
Vault base path:
/Users/paul/Library/CloudStorage/GoogleDrive-paul@meandu.com/My Drive/Obsidian/meandu/
Key directories:
- Discussion filesArea/Discussions/
- Drawing files with tldraw attachmentsArea/Drawings/
- Daily journal entriesArea/Journal/
- Project foldersProjects/
- Archived workArchive/
Journal processing scripts:
~/bin/obsidian/delete_empty_journals.py ~/bin/obsidian/combine_journals.py ~/bin/obsidian/extract_bookmarks.py
Archive Naming Pattern
All archive folders follow this pattern:
YYYY-MM [Category]
Examples:
- For discussion files2025-10 Discussions
- For drawing files (includes attachments/ subdirectory)2025-10 Drawings
- For journal entries2025-10 Journals
- For specific projects2025-10 On-call training
Attachment Handling
Attachment reference format:
![[uuid-tldrawFile.webp]] ![[uuid-tldrawFile.png]]
Finding attachments:
- Check Archive/YYYY-MM Drawings/attachments/ directories from previous months
- Check Projects/attachments/ directory
- Use find command to locate specific files by UUID
Organizing attachments:
- All attachments for a month go in Archive/YYYY-MM Drawings/attachments/
- Maintain flat structure (no nested directories)
- Preserve original filenames
Error Handling
Common issues:
-
Nested attachments directory - If attachments end up in attachments/attachments/, flatten:
cd Archive/$MONTH\ Drawings/attachments mv attachments/* . rmdir attachments -
Shared attachments - If files reference attachments from previous months, copy (don't move) them:
cp Archive/YYYY-MM\ Drawings/attachments/uuid.png Archive/YYYY-MM\ Drawings/attachments/ -
Google Drive sync - If files aren't visible in Obsidian after archiving:
- Wait for Google Drive to complete sync
- Tell user to reload vault in Obsidian (Cmd+R)
Best Practices
- Always run journal cleanup scripts with --dry-run first to preview changes
- Verify attachment counts before and after moving to ensure nothing is lost
- Use comm or similar tools to verify all referenced attachments are present
- Report detailed summaries to user showing what was archived
- Check for empty directories after moving files to keep vault clean