Template
Extract patterns from 18 projects across two machines (12 local infra + 6 remote personal/business via ssh survey). Ship a reusable Gitea template with AGENTS.md, 5 Crush PreToolUse hooks, git pre-commit/pre-push, a generalized rules engine, shared bash library, Makefile, lifecycle scripts, and gardening loop. Includes the canonical BASELINE-PROMPT.md (13 sections) and PATTERNS.md (standardization scorecard). The repo self-applies: it passes its own shellcheck (zero info-level), make fast, and all check-rules.sh checks. 💘 Generated with Crush Assisted-by: Crush via Crush <crush@charm.land>
26 lines
846 B
Bash
Executable File
26 lines
846 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# pre-push — full rule audit + clean-working-tree gate before pushing.
|
|
# Installed via: bash scripts/setup-hooks.sh
|
|
#
|
|
# Combines two proven policies observed across projects:
|
|
# - KNEL-AIMiddleware: block push if the working tree is dirty.
|
|
# - RCEO-PersonalAssistant: block push if the full test suite fails.
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT"
|
|
|
|
echo "pre-push: running full rule audit..."
|
|
|
|
# Full audit (non-fast): runs the slow test suite via `make test` if present.
|
|
if ! bash scripts/check-rules.sh --quiet; then
|
|
echo ""
|
|
echo "pre-push audit FAILED. Push blocked."
|
|
echo "Re-run with output: bash scripts/check-rules.sh"
|
|
echo "Bypass: git push --no-verify (emergencies only)"
|
|
exit 1
|
|
fi
|
|
|
|
echo "pre-push: all rules and tests passed."
|
|
exit 0
|