- scripts/sync-claude-docs.sh with sync/check/list/help subcommands - scripts/install-claude-sync-hooks.sh for one-time hook setup - .githooks/post-commit auto-syncs on dev-doc changes - .githooks/pre-push warns (non-blocking) on stale sync - .claude-sync.conf lists 11 synced documents - SYNC_MANIFEST.md provides drift-detection anchor for Claude Chat - package.json: npm run sync:docs | sync:check - .gitignore excludes .claude-sync/ output directory Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
630 B
Bash
Executable File
30 lines
630 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Warn (non-blocking) if .claude-sync/ is stale relative to current source files.
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
|
|
if [ -z "${REPO_ROOT}" ]; then
|
|
exit 0
|
|
fi
|
|
cd "${REPO_ROOT}"
|
|
|
|
SYNC_SCRIPT="scripts/sync-claude-docs.sh"
|
|
if [ ! -f "${SYNC_SCRIPT}" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
set +e
|
|
bash "${SYNC_SCRIPT}" check >/dev/null 2>&1
|
|
rc=$?
|
|
set -e
|
|
|
|
if [ "${rc}" -ne 0 ]; then
|
|
{
|
|
printf '%s\n' "⚠️ .claude-sync/ is stale relative to current dev-docs."
|
|
printf '%s\n' " Fix: bash scripts/sync-claude-docs.sh sync"
|
|
printf '%s\n' " (push is NOT blocked)"
|
|
} >&2
|
|
fi
|
|
|
|
exit 0
|