From 41eb5b97cb8ca90688d90f668a2bae45a76f6e31 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brule Date: Sun, 8 Mar 2026 11:32:15 -0400 Subject: [PATCH] chore: add bootstrap-siblings post-commit hook Co-Authored-By: Svrnty Inc. --- lefthook.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lefthook.yml b/lefthook.yml index 7472393..cc87a6c 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -66,6 +66,21 @@ post-commit: NEW_TOTAL_LINE=$((TOTAL_LINE + 1)) sed -i "${NEW_TOTAL_LINE}s/Total: ${OLD_COUNT}/Total: ${NEW_COUNT}/" "$ROOT_CLAUDE" echo "REGISTRY: added '$REPO_NAME' to root CLAUDE.md (${DATE}, ${COMMIT})" + bootstrap-siblings: + run: | + REPO_ROOT=$(git rev-parse --show-toplevel) + HOOKS_DIR="$REPO_ROOT/../.svrnty-hooks" + [ -f "$HOOKS_DIR/lefthook.yml" ] || exit 0 + [ -f "$HOOKS_DIR/CLAUDE.md.template" ] || exit 0 + for sibling in "$REPO_ROOT"/../*/; do + [ -d "$sibling/.git" ] || continue + [ -f "$sibling/lefthook.yml" ] && continue + SNAME=$(basename "$sibling") + cp "$HOOKS_DIR/lefthook.yml" "$sibling/lefthook.yml" + cp "$HOOKS_DIR/CLAUDE.md.template" "$sibling/CLAUDE.md" + (cd "$sibling" && lefthook install 2>/dev/null) + echo "BOOTSTRAP: installed lefthook + CLAUDE.md in '$SNAME'" + done pre-push: commands: