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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.2 KB |
| scripts/executable_mirror.sh | script | 1.6 KB |
scripts/executable_mirror.sh
View on GitHub#!/usr/bin/env bash
# One-way mirror of top-level files with one extension from SRC into DST.
# Copies new/changed files, removes DST files missing from SRC.
# Usage: mirror.sh --src DIR --dst DIR [--ext md] [--dry-run]
set -euo pipefail
src="" dst="" ext="md" dry=0
while [ $# -gt 0 ]; do
case "$1" in
--src) src="$2"; shift 2 ;;
--dst) dst="$2"; shift 2 ;;
--ext) ext="${2#.}"; shift 2 ;;
--dry-run) dry=1; shift ;;
-h|--help) sed -n 2,4p "$0"; exit 0 ;;
*) echo "unknown arg: $1" >&2; exit 2 ;;
esac
done
[ -d "$src" ] || { echo "src not a directory: $src" >&2; exit 2; }
[ -d "$dst" ] || { echo "dst not a directory: $dst" >&2; exit 2; }
shopt -s nullglob
src_files=("$src"/*."$ext")
[ ${#src_files[@]} -gt 0 ] || { echo "no .$ext files in $src; refusing to empty $dst" >&2; exit 1; }
placeholders=("$src"/.*."$ext".icloud)
[ ${#placeholders[@]} -eq 0 ] || { echo "cloud placeholders not downloaded: ${placeholders[*]}" >&2; exit 1; }
run() { if [ "$dry" -eq 1 ]; then echo "would: $*"; else "$@"; fi; }
added=0 updated=0 removed=0
for f in ${src_files[@]+"${src_files[@]}"}; do
name="$(basename "$f")" target="$dst/$name"
if [ ! -e "$target" ]; then echo "add $name"; run cp "$f" "$target"; added=$((added+1))
elif ! cmp -s "$f" "$target"; then echo "update $name"; run cp "$f" "$target"; updated=$((updated+1)); fi
done
for t in "$dst"/*."$ext"; do
name="$(basename "$t")"
[ -e "$src/$name" ] || { echo "remove $name"; run rm "$t"; removed=$((removed+1)); }
done
echo "$added added, $updated updated, $removed removed$([ "$dry" -eq 1 ] && echo ' (dry 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | 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: 322k | 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: 322k | Updated | Claude CodeCodex | Verified | Install |