urmzd/dotfiles / dot_agents/skills/publish-vault
publish-vault
VerifiedPublish notes from an Obsidian vault folder into another folder (usually a repo's content directory) by one-way mirroring top-level Markdown files (add, update, remove). Discovers vaults and likely targets, asks the user where to publish from and to, previews, then mirrors with a bundled script. Use when the user says "publish the blog", "sync the vault to the repo", "push my Obsidian posts", or "publish-vault". Do NOT commit or push (use ship); do NOT edit note content.
Publish Vault
Mirror one vault folder into one target folder. The source wins every conflict; the target is output only. Paths are never assumed: vaults and repos move, so discover them each run and confirm with the user.
Steps
-
Find vaults. Read Obsidian's registry and list every vault path that still exists:
python3 -I -c 'import json,os;r=json.load(open(os.path.expanduser("~/Library/Application Support/obsidian/obsidian.json")));[print(v["path"]) for v in r["vaults"].values() if os.path.isdir(v["path"])]'On Linux the registry is
~/.config/obsidian/obsidian.json. Note any registered path that no longer exists: the vault moved, so ask the user where it went. -
Ask for the source. If
srcwas not given, show the vaults and their top-level folders that contain.mdfiles, and ask which folder to publish. Accept any path the user types. -
Find targets. Look for content folders in nearby git repos that already hold the same filenames as the source (strong match), or directories named
blog,posts,content,notes:for f in "<src>"/*.md; do echo "$(basename "$f")"; done > /tmp/names find ~/github ~/code ~/src -maxdepth 4 -type d \( -name blog -o -name posts -o -name content -o -name notes \) -not -path '*/node_modules/*' 2>/dev/nullRank folders with overlapping filenames first.
-
Ask for the target. If
dstwas not given, show the ranked candidates and ask. Accept any path. If the target does not exist, ask before creating it. -
Check for repo-side edits. If the target is in a git repo, run
git -C <dst> status --porcelain .. Any modified file that also differs from the source will be overwritten: show the diff and ask before continuing. -
Dry run and show the add/update/remove list:
~/.agents/skills/publish-vault/scripts/mirror.sh --src <src> --dst <dst> --dry-run -
Mirror. Rerun without
--dry-run. If the dry run listed removals, get explicit approval first. -
Report the summary line and
git -C <dst> status --short .. Offershipto commit.
Rules
- One-way only: never copy target files back into the vault.
- Only top-level files with the chosen extension (
--ext, defaultmd) are touched. Subfolders and.obsidianare ignored. - The script refuses to run if the source is empty or has undownloaded iCloud placeholders.
- Never hard-code paths in this skill. Confirm source and target with the user every run.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |