docs: standardize repository helpers under tools
This commit is contained in:
1 parent
714447aa06
commit
3a6ee49c5c
4 files changed
+22
-4
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Consistency checks for the rules library. Run from the repo root: sh tools/lint.sh
|
||||
set -u
|
||||
|
||||
fail=0
|
||||
|
||||
# 1. Every pattern directory must be reachable from the bootstrap router.
|
||||
for dir in rules/patterns/*/; do
|
||||
name=$(basename "$dir")
|
||||
if ! grep -q "$name" AGENT-BOOTSTRAP.md; then
|
||||
echo "FAIL: rules/patterns/$name is not mentioned in AGENT-BOOTSTRAP.md"
|
||||
fail=1
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Every bible/... path mentioned in the bootstrap must exist in the repo.
|
||||
for ref in $(grep -o 'bible/rules/patterns/[a-z-]*/contract\.md' AGENT-BOOTSTRAP.md | sort -u); do
|
||||
path=${ref#bible/}
|
||||
if [ ! -f "$path" ]; then
|
||||
echo "FAIL: AGENT-BOOTSTRAP.md references missing file $path"
|
||||
fail=1
|
||||
fi
|
||||
done
|
||||
|
||||
# 3. No machine-local absolute paths or stale path prefixes in committed markdown.
|
||||
if grep -rn '/Users/\|kit/patterns' --include='*.md' . --exclude-dir=.git; then
|
||||
echo "FAIL: machine-local absolute paths or stale kit/patterns references found (see above)"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if [ "$fail" -eq 0 ]; then
|
||||
echo "OK: all checks passed"
|
||||
fi
|
||||
exit "$fail"
|
||||
Reference in new issue
Block a user