Files
mrcharles f5292183f4 refactor: remove Makefile, restructure as knowledge-first framework
The primary value is the knowledge layer (markdown files that any agent
reads — Crush, OpenWebUI, Hermes, Conduit on iPhone). CLI tooling
(scripts, git hooks) is optional, for projects that use git/docker.

Changes:
- Remove Makefile entirely. All commands are now direct script invocations
  (bash scripts/check-rules.sh, bash scripts/setup-hooks.sh, etc.)
- Add scripts/test.sh stub (replaces make test)
- check-rules.sh: test-suite check now calls scripts/test.sh, not make test
- Rewrite README as three-layer architecture: knowledge → git hooks → docker
- Update all docs (AGENTS.md, BASELINE-PROMPT.md, ADOPTING.md, PATTERNS.md,
  STATUS.md) to remove every make reference

The framework now works for:
- CLI/harness users (git hooks + scripts + AGENTS.md)
- Non-CLI users (BASELINE-PROMPT.md loaded into any agent's system prompt)

💘 Generated with Crush

Assisted-by: Crush via Crush <crush@charm.land>
2026-08-07 12:14:30 -05:00

45 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# setup-hooks.sh — install this repo's git hooks.
#
# Mechanism: copy scripts/pre-commit and scripts/pre-push into .git/hooks/ and
# make them executable. This is the most portable pattern (works on any clone,
# no `git config core.hooksPath` mutation, survives config resets, idempotent).
#
# Run once after cloning: bash scripts/setup-hooks.sh
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
# shellcheck disable=SC1091
source "$HERE/lib/common.sh"
REPO_ROOT="$(repo_root)"
cd "$REPO_ROOT"
[ -d .git ] || die "no .git directory here — run this from a git checkout"
HOOKS_DIR=".git/hooks"
HOOK_NAMES="pre-commit pre-push"
log_step "Installing git hooks"
for name in $HOOK_NAMES; do
src="scripts/$name"
dst="$HOOKS_DIR/$name"
[ -f "$src" ] || die "source hook not found: $src"
cp "$src" "$dst"
chmod +x "$dst"
log_ok "installed $dst"
done
cat <<EOF
Git hooks installed. The following now run automatically:
pre-commit fast rule audit (shellcheck, image pinning, container naming,
required files, doc freshness, Discourse pointers, WORKING.md
completion, hygiene).
Hot-path bypass for STATUS.md / WORKING.md.
pre-push full rule audit (includes scripts/test.sh) + clean-working-tree gate.
Bypass either with \`git commit --no-verify\` / \`git push --no-verify\`
(emergencies only).
EOF