Files
infra-plugins/plugins/shared-vault-sync/README.md
Adnan Zahir 1bd000e595 feat(shared-vault-sync): sync the nested devops-shared-vault subrepo
Detection order is now SHARED_VAULT_DIR, then $PWD, then $PWD/Areas/DevOps
(the nested shared subrepo inside the personal vault). Bump to 0.1.1.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-01 10:15:35 +07:00

21 lines
1.1 KiB
Markdown

# shared-vault-sync
Pulls a clean shared vault at `SessionStart` without blocking Claude Code or Codex when the network is unavailable.
Target detection, in order:
1. `SHARED_VAULT_DIR` — explicit override (e.g. the `devops-shared-vault` clone path).
2. `$PWD` — when the session starts inside the shared vault itself.
3. `$PWD/Areas/DevOps` — the nested shared subrepo inside the personal vault.
A directory is treated as the shared vault only if its `AGENTS.md` contains the marker `This is the shared persistent vault` and it is inside a git work tree.
The hook skips a dirty worktree and uses `git pull --ff-only`; it never rebases, merges, or pushes.
## Install
Install `shared-vault-sync` from the `infra-plugins` marketplace, then open a new session to activate its `SessionStart` hook.
## Recommended push automation
Keep pushes commit-driven. A scheduled local job may run `git fetch` and `git push` only when the vault is clean and the local branch is ahead; it must never rebase, force-push, or resolve conflicts. Let this hook handle the next safe pull after a rejected push.