feat: slhx requirements, project structure, and core primitives
This commit is contained in:
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
msg_file="$1"
|
||||
# Require scope if REQs exist
|
||||
if [ -f REQUIREMENTS.md ]; then
|
||||
if ! grep -qE '^[a-z]+(\(.+\))?:' "$msg_file"; then
|
||||
echo "error: commit requires scope — e.g. feat(parser): ..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
changed=$(git diff --cached --name-only)
|
||||
# fail if REQs changed but AGENTS.md is older
|
||||
if echo "$changed" | grep -q '^REQUIREMENTS.md$' && echo "$changed" | grep -q '^AGENTS.md$'; then
|
||||
# Both changed — OK
|
||||
:
|
||||
else
|
||||
req_time=$(git log -1 --format=%ct -- REQUIREMENTS.md 2>/dev/null || echo 0)
|
||||
ag_time=$(git log -1 --format=%ct -- AGENTS.md 2>/dev/null || echo 0)
|
||||
if [ "$req_time" -gt "$ag_time" ]; then
|
||||
echo "error: REQUIREMENTS.md newer than AGENTS.md — run: redgate agents > AGENTS.md"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user