agentsclimarketplace

Vault

Skill samrock06/secondbrain/skills/vault

Use this skill to connect secondbrain to the team's knowledge base or to refresh it. Connect mode points secondbrain at a local folder or clones a git repo, and is the one-time per-machine bootstrap: trigger it whenever someone installs the plugin, sets secondbrain up on a new machine, connects it to the team's content or shared notes, or sees a 'secondbrain is not configured' message. Refresh mode pulls the latest team content and rebuilds the search index: trigger it for "sync", "refresh the vault", "pull the latest team content", "reindex", or after the team adds content. Audit mode reports tag and date-metadata problems that make the vault harder to search and plan against: trigger it for "audit the vault", "check our tags", "tag hygiene", "why is search missing things", or "/vault audit". It recommends and never changes a note. Also trigger for /vault in any form, including /vault <directory-path>, /vault <repo-url>, /vault refresh, and /vault audit.From its SKILL.md

Install
npx -y skills add samrock06/secondbrain --skill vault

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

27.5 KB, as published. Nobody here has run it

secondbrain /vault

Connect secondbrain to the team vault, or refresh it. Route by intent before doing anything else:

The user wantsModeGo to
To connect, set up, or point secondbrain at a directory or repo, or nothing is configured yetConnectSteps 1 to 9 below
To sync, refresh, pull the latest content, or reindex, and a vault is already configuredRefresh"Refresh mode" at the end of this file
To audit, check tags, find metadata problems, or ask why search is missing thingsAuditskills/vault/references/vault-audit.md

When a vault is already configured and the user's wording is ambiguous, prefer Refresh and say which you ran.

Contents

  • Required Runtime Instructions
  • Execution Checklist
  • Audit mode (see references/vault-audit.md)
  • Steps
  • No-Clobber and Backup Safety
  • Pointer Write and Resolvability Guarantee
  • Activation Handoff

Conventions (apply these)

  • Apply skills/secondbrain-core/references/writing.md. Hard rules: obey domain voice rules, avoid clinical or template phrasing, remove em dashes, and apply the inline Output-Quality Checklist before any final response.

Output-quality checklist exemption (Connect and Refresh only): in those two modes /vault is a machine-configuration command. Its output is the activation handoff in skills/vault/references/activation-handoff.md or a refresh status line, not synthesized prose. Apply voice hard rules (no em dashes, no clinical phrasing) throughout, but the standard prose output-quality checklist does not govern them.

Audit mode is not exempt. Its report is synthesized prose a person reads and acts on, so run the full inline Output-Quality Checklist from skills/secondbrain-core/SKILL.md before delivering it.

Execution Checklist

/vault progress:
- [ ] Ask mode (point at existing directory or clone a git repo)
- [ ] Resolve directory or clone repo
- [ ] Detect git in the resolved directory
- [ ] Ensure secondbrain.config.json (no-jq stop / no-pandoc stop / present+valid+vaultRoot exists / invalid stop / absent check-parent-then-confirm-then-create)
- [ ] Write ~/.secondbrain pointer (no-clobber check first; pointer-already-equals-DIR leaves it untouched)
- [ ] Offer qmd install on consent (verify with scripts/qmd-ok.sh: ok means qmd actually runs, broken means it is installed but cannot start)
- [ ] Apply skills/vault/references/activation-handoff.md

Steps

Step 1: Ask the mode

Ask using AskUserQuestion:

How do you want to connect secondbrain to your team's knowledge base?

A) Point secondbrain at an existing folder on this machine B) Clone a git repo for me

If $ARGUMENTS is present, use it to pre-fill the path (mode A) or URL (mode B) field when confirming or asking for that value. If $ARGUMENTS does not fit the chosen mode, ask for the correct value.

Stash the choice as MODE (value: A or B).

Step 2 (Mode A): Point at an existing directory

Obtain the folder path from $ARGUMENTS (if provided and fits mode A) or AskUserQuestion:

What is the full path to your team's knowledge base directory?

Resolve it to an absolute path. Verify it exists and is a directory:

[ -d "$DIR" ] && echo "exists" || echo "missing"

If $DIR does not exist or is not a directory, surface the problem and stop.

Canonicalize DIR to its physical path, with no trailing slash, so it matches what secondbrain-sync.sh computes later:

DIR="$(cd "$DIR" && pwd -P)"

Detect whether the directory is inside a git work tree:

[ "$(git -C "$DIR" rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && echo "git" || echo "directory"

(Test the command's output, not just its exit code: a bare rev-parse ... && echo git prints true then git, and misclassifies a location where rev-parse exits 0 while printing false.)

Classify git ONLY when $DIR is itself the root of that work tree, not merely somewhere inside it. Canonicalize both sides with pwd -P before comparing, the same way secondbrain-sync.sh does, so a symlinked path component or a stray trailing slash never causes a false "git-nested" classification:

TOPLEVEL="$(git -C "$DIR" rev-parse --show-toplevel 2>/dev/null || true)"
[ -n "$TOPLEVEL" ] && [ "$(cd "$TOPLEVEL" && pwd -P)" = "$(cd "$DIR" && pwd -P)" ] && echo "git-root" || echo "git-nested"

If git-root: set SOURCE_TYPE=git. Capture remote and branch:

REMOTE_URL="$(git -C "$DIR" remote get-url origin 2>/dev/null || true)"
BRANCH="$(git -C "$DIR" branch --show-current 2>/dev/null || true)"

If git-nested: $DIR sits inside an enclosing repo rooted at <TOPLEVEL> (for example, a notes folder inside a dotfiles repo). Refresh mode only pulls when the vault root IS the git work-tree toplevel, so it can never pull for a nested vault, no matter what is recorded here. Do not silently adopt the enclosing repo as a git source secondbrain will track. Tell the user <DIR> is inside a git repo rooted at <TOPLEVEL>, that secondbrain cannot track a nested subdirectory as a git source, and confirm using AskUserQuestion:

<DIR> is inside a git repo rooted at <TOPLEVEL>. secondbrain can only track the whole repo as a git source, not a subdirectory of it, so choosing the subdirectory here means refresh will never pull for it.

A) Re-run /vault and point it at <TOPLEVEL> instead, so the whole repo is tracked as the git source B) Treat <DIR> as a plain directory (no git tracking, refresh will not pull)

On A: stop this run of /vault. Tell the user to re-run /vault with <TOPLEVEL> as the path. Do NOT write the pointer or config for <DIR> in this run. On B: set SOURCE_TYPE=directory, leave REMOTE_URL and BRANCH empty, and continue with $DIR as the plain-directory source. The activation handoff must never print the git-source pull promise for this vault, since B is the only path that proceeds.

If not git at all: set SOURCE_TYPE=directory. Leave REMOTE_URL and BRANCH empty.

If SOURCE_TYPE=directory (the source is not a git repo), confirm the directory using AskUserQuestion:

Is <DIR> itself a folder that is synced or shared with others (Dropbox, a network drive, a shared server volume), or is it private to this machine?

A) It is shared or synced with others B) It is private to this machine C) Stop and reconsider

Stash the answer as SYNCED_PARENT (yes for A, no for B). On C: stop. Do NOT write the pointer.

secondbrain only reads this directory, so a shared or synced parent changes nothing about what it stores.

Proceed to Step 4.

Step 3 (Mode B): Clone a git repo

Obtain the git remote URL from $ARGUMENTS (if provided and fits mode B) or AskUserQuestion, and stash it as REMOTE_URL:

What is the URL of the git repo to clone?

Choose a checkout path. Default:

DEFAULT_PATH="$HOME/$(basename "$REMOTE_URL" .git)"
echo "$DEFAULT_PATH"

Confirm with the user (AskUserQuestion):

Where should secondbrain check out the repo? Press enter to accept the default, or type a path. Default: <DEFAULT_PATH>

Use the user-supplied path or DEFAULT_PATH as DIR.

If $DIR exists but $DIR/.git does not, it is not a git repo at all (for example, the default path already exists as a plain synced folder). A clone into it will fail with a confusing "destination path already exists" error, so check for this state up front and stop and ask before attempting anything:

if [ -e "$DIR" ] && [ ! -d "$DIR/.git" ]; then
  echo "EXISTS_NOT_GIT"
fi

If EXISTS_NOT_GIT, ask using AskUserQuestion:

<DIR> already exists but is not a git repo, so secondbrain cannot clone into it.

A) Point secondbrain at <DIR> as a plain directory instead (switch to Mode A on this folder, no git tracking) B) Pick a different, empty path to clone <REMOTE_URL> into

On A: set MODE=A and jump to Step 2's git-detection logic (the "Detect whether the directory is inside a git work tree" step) using this DIR, skipping the path-existence check since it already passed here. On B: ask for a new path and re-check it against the same rule before proceeding.

If $DIR/.git already exists, this may be a pre-existing checkout of a different repo. Before pulling, compare its origin to the URL the user gave:

if [ -d "$DIR/.git" ]; then
  EXISTING_ORIGIN="$(git -C "$DIR" remote get-url origin 2>/dev/null || true)"
fi

If EXISTING_ORIGIN is non-empty and differs from REMOTE_URL, STOP before pulling and ask using AskUserQuestion:

The checkout at <DIR> already exists and points at <EXISTING_ORIGIN>, not the <REMOTE_URL> you asked for.

A) Use the existing repo at <DIR> as-is (keep its own origin) B) Pick a different path to clone <REMOTE_URL> into

On A: keep DIR as-is, set REMOTE_URL to EXISTING_ORIGIN (never silently overwrite it with the mismatched URL), and continue. On B: ask for a new path and re-check it against the same rule before proceeding. Never pull into a checkout whose origin does not match REMOTE_URL.

If $DIR/.git exists and EXISTING_ORIGIN is empty (a git repo with no origin remote configured), do not fall through to the pull; there is nothing to compare and nothing to pull from. Treat this like a mismatch and ask using AskUserQuestion:

The checkout at <DIR> already exists as a git repo, but has no origin remote configured, so secondbrain cannot verify it matches <REMOTE_URL>.

A) Use the existing repo at <DIR> as-is, with no remote (skip the pull; there is nothing to pull from) B) Pick a different path to clone <REMOTE_URL> into

On A: keep DIR as-is, leave REMOTE_URL empty, set CLONE_ACTION=none, and skip straight to the "On success" capture step below without pulling. On B: ask for a new path and re-check both this rule and the mismatch rule before proceeding.

Clone if absent, or pull if it already exists (origin already confirmed to match, or the user chose to keep the existing repo):

if [ -d "$DIR/.git" ]; then
  git -C "$DIR" pull --ff-only
else
  git clone "$REMOTE_URL" "$DIR"
fi

Set CLONE_ACTION=cloned if $DIR/.git did not exist beforehand, or CLONE_ACTION=pulled if it did (unless already set to none above).

Auth is delegated entirely to the user's git credential manager. If the clone or pull fails (exit non-zero), surface the git output verbatim and stop. Diagnose by the specific error rather than a blanket "check credentials or network": a "destination path already exists" error means the path check above was bypassed (re-verify DIR); "no tracking information for the current branch" or "no upstream" means the repo has no proper remote tracking (offer the no-origin branch above); a genuine auth or network failure (permission denied, could not resolve host, timed out) is the case where checking credentials or network applies; a divergence error (non-fast-forward) means local commits exist that need to be reconciled (see No-Clobber: commit or stash), not credentials or network. Tell the user to address the specific cause, then re-run /vault.

On success: set SOURCE_TYPE=git. Capture:

REMOTE_URL="$(git -C "$DIR" remote get-url origin 2>/dev/null || true)"
BRANCH="$(git -C "$DIR" branch --show-current 2>/dev/null || true)"

Proceed to Step 4.

Step 4: Ensure secondbrain.config.json

Before anything else, probe for jq and pandoc unconditionally, regardless of whether a config exists yet. Both are hard dependencies of /sync (secondbrain-sync.sh exits non-zero before doing any work if either is missing), so gate on them first rather than only when validating an existing config:

if ! command -v jq >/dev/null 2>&1; then
  echo "NO_JQ"
elif ! command -v pandoc >/dev/null 2>&1; then
  echo "NO_PANDOC"
elif [ ! -f "$DIR/secondbrain.config.json" ]; then
  echo "MISSING"
elif jq empty "$DIR/secondbrain.config.json" 2>/dev/null; then
  echo "OK"
else
  echo "INVALID"
fi

(Validate with jq, which secondbrain already requires. Pass the path as an argument, never interpolated into a script string, so paths containing quotes or spaces are handled correctly.)

  • NO_JQ: tell the user jq is required (the same dependency secondbrain's sync already requires) and is not installed. Give the install command for their platform: brew install jq on macOS, apt-get install jq on Debian/Ubuntu. Ask them to install it, then re-run /vault. Stop. Do NOT write the pointer, and do NOT treat this as an invalid config; the config itself may be perfectly valid, jq is just missing.

  • NO_PANDOC: tell the user pandoc is required (/sync exits before doing any work without it, even for a pure-Markdown vault). Give the install command for their platform: brew install pandoc on macOS, apt-get install pandoc on Debian/Ubuntu. Ask them to install it, then re-run /vault. Stop. Do NOT write the pointer.

  • OK: read vaultRoot and collection from it, with an explicit default so an absent vaultRoot key resolves to "." rather than the literal string null; stash as CONFIG_VAULT_ROOT and CONFIG_COLLECTION:

    CONFIG_VAULT_ROOT="$(jq -r '.vaultRoot // "."' "$DIR/secondbrain.config.json")"
    CONFIG_COLLECTION="$(jq -r '.collection // ""' "$DIR/secondbrain.config.json")"
    

    Verify the vault root actually exists before going further:

    [ -d "$DIR/$CONFIG_VAULT_ROOT" ] && echo "exists" || echo "missing"
    

    If $DIR/$CONFIG_VAULT_ROOT is missing, stop without writing the pointer. Tell the user secondbrain.config.json at <DIR> points vaultRoot at <CONFIG_VAULT_ROOT>, which does not exist, and ask whether to create that directory or fix the vaultRoot value in the config, then re-run /vault.

    Otherwise set CONFIG_CREATED=false and continue to Step 5.

  • INVALID: tell the user $DIR/secondbrain.config.json exists but could not be parsed as JSON. Stop. Do NOT write the pointer.

  • MISSING: before offering to create a new config, check whether a parent directory already has one, since a subdirectory pointer would create a stray duplicate config:

    P="$(dirname "$DIR")"
    while [ "$P" != "/" ] && [ "$P" != "." ]; do
      if [ -f "$P/secondbrain.config.json" ]; then
        echo "PARENT_CONFIG: $P"
        break
      fi
      P="$(dirname "$P")"
    done
    

    If a parent config is found, tell the user <P> already has a secondbrain.config.json and ask whether they meant to point /vault at <P> instead of the subdirectory <DIR>. If they confirm the parent, restart from Step 2 with DIR="<P>" (Step 2's path prompt is skipped since DIR is already set; this re-runs git detection, source classification, and the synced-folder question against <P> so they are never left stale from the subdirectory's classification, and there is no loop risk since <P>'s config already exists so the parent walk is never re-entered). If they confirm they really do want the subdirectory as its own separate knowledge base, continue below.

    Ask using AskUserQuestion:

    No secondbrain.config.json at <DIR>. Create a minimal one and use this directory as the knowledge base? (yes / no)

    On no: stop. Do NOT write the pointer.

    On yes: derive the collection name as the kebab-cased basename of DIR. Kebab-case rule: lowercase the basename, replace each run of non-alphanumeric characters with a single -, and trim any leading or trailing - (example: My Notes (2024) becomes my-notes-2024). Write $DIR/secondbrain.config.json using the Write tool with this content (add "repo" and "branch" only when SOURCE_TYPE=git AND REMOTE_URL is non-empty):

    For a non-git or git-with-no-remote source:

    {"vaultRoot": ".", "collection": "<kebab-cased-basename>"}
    

    For a git source with a remote URL:

    {"vaultRoot": ".", "collection": "<kebab-cased-basename>", "repo": "<REMOTE_URL>", "branch": "<BRANCH>"}
    

    Set CONFIG_VAULT_ROOT=".", CONFIG_COLLECTION="<kebab-cased-basename>", CONFIG_CREATED=true.

Step 5: Write the pointer

Check whether $HOME/.secondbrain already exists and points somewhere else:

if [ -f "$HOME/.secondbrain" ]; then
  head -n 1 "$HOME/.secondbrain"
fi

If the file exists and its first line already equals $DIR, leave the file untouched, set POINTER_OUTCOME=pointer-written, and continue to Step 6.

If the file exists and its first line differs from $DIR, stop and ask using AskUserQuestion:

The ~/.secondbrain pointer currently points at <old>. Overwrite it to point at <DIR> instead?

This switches the vault for every secondbrain project on this machine, not just this one. To keep both vaults side by side instead: leave the pointer as-is (option B) and set SECONDBRAIN_VAULT=<DIR> for THIS project only (for example in this project's .claude/settings.local.json under "env", or exported in the shell that launches Claude Code here). It resolves before ~/.secondbrain, so this project uses the new vault at <DIR> while every other project keeps using <old>.

A) Overwrite the pointer to <DIR> B) Leave the existing pointer alone and stop

On B: stop. Do NOT write the pointer. Tell the user to set SECONDBRAIN_VAULT=<DIR> in this project's environment (for example, this project's .claude/settings.local.json "env" block) so this project uses the new vault at <DIR>; the machine-wide pointer stays on <old>.

On A, or if $HOME/.secondbrain does not exist yet: write the absolute path to ~/.secondbrain (single line, newline-terminated):

printf '%s\n' "$DIR" > "$HOME/.secondbrain"
echo "wrote $HOME/.secondbrain -> $DIR"

If the write fails, surface the error and tell the user to run:

printf '%s\n' "<DIR>" > ~/.secondbrain

...manually, then run /sync to proceed; future sessions pick it up at start. Set POINTER_OUTCOME=manual-fallback on failure, else POINTER_OUTCOME=pointer-written.

Step 8: Offer qmd install

Check whether npm is available:

command -v npm >/dev/null 2>&1 && echo "npm_available" || echo "npm_absent"

If npm is absent, skip silently -- do not mention it unless the user asks.

If npm is present, probe whether qmd is actually usable (on PATH AND able to run), not merely present:

"${CLAUDE_PLUGIN_ROOT}/scripts/qmd-ok.sh"

It prints exactly one token: ok, absent, or broken.

If the token is ok, set QMD_STATUS=installed and skip silently.

If the token is broken, qmd is on PATH but cannot run. Set QMD_STATUS=broken, then read node --version and tell the user (this does not stop setup; grep search works meanwhile):

  • node major below 20: "qmd is installed but not running: it needs node 20 or newer and you are on node <X>. Update node, then re-run /search setup-qmd. Search works on keyword or grep meanwhile."
  • node major 20 or newer, or node absent or its version unparseable: "qmd is installed but not running (not a node-version issue). Try reinstalling with npm install -g @tobilu/qmd. Search works on keyword or grep meanwhile."

If the token is absent and npm is present, ask using AskUserQuestion:

secondbrain uses qmd for fast local Markdown search (BM25 + semantic). Install it now via npm i -g @tobilu/qmd? (yes / no; you can install it later and re-run /sync)

On yes: run npm i -g @tobilu/qmd. Re-probe with "${CLAUDE_PLUGIN_ROOT}/scripts/qmd-ok.sh". If it prints ok, set QMD_STATUS=just-installed. If it prints broken (the install landed but qmd cannot run, typically an older node), set QMD_STATUS=broken, then read node --version and give the same message as the initial-probe broken branch above:

  • node major below 20: "qmd is installed but not running: it needs node 20 or newer and you are on node <X>. Update node, then re-run /search setup-qmd. Search works on keyword or grep meanwhile."
  • node major 20 or newer, or node absent or its version unparseable: "qmd is installed but not running (not a node-version issue). Try reinstalling with npm install -g @tobilu/qmd. Search works on keyword or grep meanwhile."

If it prints absent (the install did not resolve, for example npm -g EACCES without sudo), set QMD_STATUS=install-failed, surface the npm error, and tell the user the grep fallback is active and they can retry with npm i -g @tobilu/qmd then /sync. Either way, do not stop the overall setup flow -- the search fallback (grep) works without qmd.

On no or any non-affirmative answer: set QMD_STATUS=declined and skip silently.

If npm was absent: set QMD_STATUS=skipped-absent.

Step 9: Activation handoff

Read skills/vault/references/activation-handoff.md and apply its body exactly. Pass these resolved values into the handoff:

  • MODE -- A or B, from Step 1
  • CLONE_ACTION -- cloned | pulled | none (Mode B only; empty for Mode A)
  • DIR -- the absolute local path to the knowledge base directory
  • SOURCE_TYPE -- git or directory
  • REMOTE_URL -- the git remote URL (may be empty)
  • BRANCH -- the current branch (git only; may be empty)
  • CONFIG_VAULT_ROOT -- the vaultRoot value from secondbrain.config.json
  • CONFIG_COLLECTION -- the collection value from secondbrain.config.json
  • CONFIG_CREATED -- true if a minimal secondbrain.config.json was written in Step 4, else false
  • QMD_STATUS -- one of installed, just-installed, install-failed, broken, declined, skipped-absent
  • POINTER_OUTCOME -- one of pointer-written or manual-fallback

No-Clobber and Backup Safety

Hard rule: Mode B's pull must never clobber local changes. secondbrain only runs git pull --ff-only, which is fast-forward-only and safe by design -- it refuses to merge if the local branch has diverged. If the user has local modifications, git pull --ff-only may fail; surface the error and tell them to commit or stash local changes before re-running /vault.

secondbrain writes nothing into the content source directory except secondbrain.config.json, and only when the user explicitly consents in Step 4. The only other file setup writes is ~/.secondbrain, the machine-local pointer.

Pointer Write and Resolvability Guarantee

Hard rule: never finish /vault having written a ~/.secondbrain pointer that resolve_config_root cannot use. The pointer must be an absolute path; never a relative path, never a URL. After writing, echo the written value back so the user can confirm it looks correct.

The pointer is the only persistence mechanism for the content source path. Future sessions read it via resolve_config_root Tier 2 (the hooks read ~/.secondbrain at session start). It is not stored in settings.local.json or any project file -- it is machine-global and personal.

Carry the pointer outcome into skills/vault/references/activation-handoff.md so the user knows exactly how future sessions find their content.

$ARGUMENTS


Refresh mode

Refresh the configured vault from its content source by running the sync script, then report the result. This is a thin front end over scripts/secondbrain-sync.sh; do not reimplement sync logic.

Apply skills/secondbrain-core/references/config-context.md for how the vault is resolved. Do not guess a vault root. This mode produces a status summary, not vault prose, so it is exempt from the Output-Quality Checklist.

Run

Invoke the script and capture its JSON (it self-resolves the vault via the config model; do not pass --vault-root unless the user explicitly names a directory):

bash "${CLAUDE_PLUGIN_ROOT}/scripts/secondbrain-sync.sh" $ARGUMENTS

Pass through only the recognized flags found in $ARGUMENTS: --rescan (scan every source file, not just those changed by the last pull), --force (re-extract even when up-to-date cached text exists), --no-extract (skip text extraction), --no-qmd (skip reindexing). Ignore unrecognized text, including the word refresh itself.

The vault is never written to. Source files keep their original format; any extracted text lands in the local index cache reported as extraction.cache_dir.

For a git source with uncommitted local changes, the script stashes them before the pull and restores them after, so an in-progress edit does not block the refresh. If the stash restore conflicts with what was just pulled, the script reports it in conflicts[] rather than losing anything.

Report

The script prints one JSON document on stdout and progress on stderr. Read the JSON and summarize:

  • status: ok or error.
  • source_type: git or directory (state which, so the user knows whether a pull happened).
  • pulled: for a git source, the before/after commits and files-changed count; null for a plain directory.
  • extracted: how many source files had text extracted for the index; skipped: how many were already current; failed: list any failures with the reason.
  • extraction.extractor: which extractor ran, or none. When it is none, say plainly that non-markdown files are findable by filename only until an extractor is installed. Never imply full coverage.
  • qmd: whether the search collection was updated, and its name.
  • conflicts: surface any listed.

Lead with a one-line outcome, for example: "Refreshed: pulled 3 files, extracted 1 document, reindexed collection meridian-kb."

Exit codes and degraded cases

  • Exit 0: ok or partial (some extractions may have failed; report them).
  • Exit 1 (unexpected, including invalid config JSON): if the reason names invalid JSON in secondbrain.config.json, this is a config problem, not a git problem. Tell the user the config file's JSON is broken and needs fixing by hand (or re-run /vault to regenerate it); do not suggest git remediation, credentials, or network checks here.
  • Exit 3 (path missing / no config): the vault is not configured or its root is gone. Tell the user to run /vault connect mode first; do not retry blindly.
  • Exit 5 (git pull failed): report the failure; the local vault is unchanged. The reason field tells you which of two states this is:
    • If reason mentions unresolved merge conflicts: this is left over from a prior refresh's stash-pop conflict, not divergence. Tell the user to open the conflicted files, resolve the markers, git add them, and (if the stash is now redundant) git stash drop, then re-run.
    • Otherwise, check for divergent history, the far more common cause: run git -C <vault dir> status. If it reports diverged branches, tell the user in plain language what happened and have them run git pull --rebase --autostash in the team directory, then re-run. Only if git status shows no divergence and no unmerged paths should you suspect a genuine fetch failure; then suggest checking credentials or network.
  • Exit 2 (usage): an unrecognized flag was passed; re-run with the recognized flags only.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.