| name | wikibrain-sync |
| description | Sync the WikiBrain memory vault — commit and push to its private GitHub repo. Use when the user says "sync memory", after a session saves memories worth keeping, or when another wikibrain skill lands changes. |
wikibrain-sync
VAULT = the repo this skill lives in (resolve the ~/.claude/skills/wikibrain-sync symlink; default ~/personal/WikiBrain). Done when the working tree is clean and origin matches local — or you've reported exactly why not.
-
Guard. git -C "$VAULT" rev-parse --show-toplevel must print the vault path itself; anything else means a parent repo is reaching in (e.g. a git repo at $HOME) — stop and tell the user.
-
Reconcile. With an origin: git -C "$VAULT" pull --rebase. On conflict keep the newer fact and show the user what won.
-
Stage. git -C "$VAULT" add . then status --short. Nothing staged → report "vault in sync"; done.
-
Screen. Read the staged diff for secrets — a token, credential, or key in a memory stops the sync; flag the file to the user instead of pushing.
-
Commit as sole author, no trailers: memory: sync YYYY-MM-DD (<n> new, <m> updated).
-
Push. Missing origin → create it first: gh repo create "$(basename "$VAULT")" --private --source "$VAULT" --remote origin. Report the pushed hash and one line per changed file.