aboutsummaryrefslogtreecommitdiff
path: root/.githooks
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-08-16 01:11:09 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-08-16 01:11:09 +0300
commit51b7064ef0a02642393bab1d2eea0f4dbd8414d2 (patch)
tree035e5bb44255677ed938b2c8bf1b42cca1ee410c /.githooks
parent2b4b3849ca7760d6fcff10cd560553bb8081a8e2 (diff)
fix: keep agent skill aligned with stable releases
refs #2847
Diffstat (limited to '.githooks')
-rwxr-xr-x.githooks/pre-commit13
1 files changed, 13 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index d8b05146..166820c0 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -4,5 +4,18 @@ set -euo pipefail
repo_root="$(git rev-parse --show-toplevel)"
cd "$repo_root"
+if ! git diff --cached --quiet -- skills/herdr/SKILL.md; then
+ head_version="$(git show HEAD:Cargo.toml | sed -n 's/^version = "\(.*\)"/\1/p' | head -1)"
+ staged_version="$(git show :Cargo.toml | sed -n 's/^version = "\(.*\)"/\1/p' | head -1)"
+ staged_skill="$(git rev-parse :skills/herdr/SKILL.md 2>/dev/null || true)"
+ released_skill="$(git rev-parse "v${staged_version}:skills/herdr/SKILL.md" 2>/dev/null || true)"
+
+ if [[ "$head_version" == "$staged_version" && "$staged_skill" != "$released_skill" ]]; then
+ echo "error: skills/herdr/SKILL.md may only change in a release commit" >&2
+ echo "update it while preparing the release and stage it with the Cargo.toml version bump" >&2
+ exit 1
+ fi
+fi
+
echo "pre-commit: running just lint"
just lint