# Installs the optional prose-lint tooling for this skill: Vale (via
# Homebrew) and Proselint (via uv, isolated from system Python — macOS's
# system Python refuses a bare `pip3 install` under PEP 668).
# Safe to re-run: brew and uv both skip already-installed packages.
if command -v brew >/dev/null 2>&1; then
echo "==> brew bundle (Vale, uv)"
brew bundle --file=Brewfile
echo "Homebrew not found. Install it from https://brew.sh, then re-run this script." >&2
echo "Or install manually: a Vale release from https://vale.sh, and uv from https://astral.sh/uv." >&2
if command -v uv >/dev/null 2>&1; then
echo "==> uv tool install (from requirements.txt)"
while IFS= read -r pkg; do
pkg="${pkg%%#*}" # strip inline comments
pkg="$(echo "$pkg" | xargs)" # trim whitespace
[ -z "$pkg" ] && continue
uv tool update-shell || true
echo "uv not found — re-run this script after Homebrew installs it." >&2
echo "Done. Verify with:"
echo " ~/.local/bin/proselint check --demo # or 'proselint check --demo' once ~/.local/bin is on PATH"
echo "scripts/prose_lint.py finds proselint at ~/.local/bin even before your"
echo "shell picks up the PATH change from 'uv tool update-shell'."