Files
coorl-lost-cities/scripts/librarian.sh
T
coolguyandClaude Opus 4.7 5a1b944931 Add librarian Stage 1 oversize check
Third Stage 1 piece: scripts/librarian_check_oversize.py walks
non-archive markdown files and flags any over the 500-line soft cap
declared in AGENTS.md. Wired into scripts/librarian.sh.

Caught one real finding on first run: docs/performance.md at 914
lines. Splitting it into sub-topic notes is a separate cleanup task
— surfaced for the user, not auto-applied.

Updates docs/plans/librarian.md Progress + sets the next concrete
step to a stale-plan checker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 23:31:37 +09:00

37 lines
810 B
Bash
Executable File

#!/usr/bin/env bash
# Run all librarian Stage 1 checks. Exit code is non-zero if any check
# failed; each check still runs even if a previous one failed, so users
# see every finding in one pass.
set -uo pipefail
cd "$(dirname "$0")/.."
overall=0
echo "→ Markdown link integrity (lychee)"
if ! uv run python scripts/librarian_check_links.py; then
overall=1
fi
echo
echo "→ Code citations (file:line refs in inline code)"
if ! uv run python scripts/librarian_check_citations.py; then
overall=1
fi
echo
echo "→ File size (500-line soft cap from AGENTS.md)"
if ! uv run python scripts/librarian_check_oversize.py; then
overall=1
fi
echo
if [ "$overall" -eq 0 ]; then
echo "All Stage 1 checks passed."
else
echo "One or more Stage 1 checks failed (see above)."
fi
exit "$overall"