mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 20:47:15 +01:00
New agent_ready/ package (dist and live-url modes, 100% branch coverage) checks robots, sitemap, llms.txt, ai-catalog, 404, no-JS text, markdown mirrors and JSON-LD. repo_contract gains web-repo detection and installs the agent-ready pre-commit hook, CI workflow and check_agent_ready.sh shim; scripts/check_agent_ready.sh is the shared entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBScELfMUiieK9ManFbS3Y
32 lines
1.2 KiB
Bash
Executable File
32 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# Install the repo-contract gate into a repo and bootstrap its CLAUDE.md
|
|
# `## Commands` section plus scripts/test_changed.sh.
|
|
#
|
|
# Run this on EVERY new repo, right after `git init`. Idempotent. Pieces:
|
|
# scripts/check_repo_contract.sh shim, pre-commit hook, CI workflow (skipped
|
|
# when the repo has .dep-freshness-no-workflow), Commands section. A website
|
|
# (Vite/Astro/index.html build, or [agent_ready] in repo-contract.toml) also
|
|
# gets the AgentReady gate: config table, shim, hook, agent-ready workflow.
|
|
#
|
|
# Usage: scripts/install_repo_contract_gate.sh <repo> [--check] [--no-bootstrap]
|
|
# Exit: 0 contract satisfied | 1 violations left (e.g. <FILL IN>) | 2 not a git repo
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
UTILS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
readonly UTILS_ROOT
|
|
|
|
main() {
|
|
if [[ $# -lt 1 ]]; then
|
|
echo "Usage: $(basename "$0") <repo> [--check] [--no-bootstrap]" >&2
|
|
exit 1
|
|
fi
|
|
PYTHONPATH="$UTILS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
|
|
python3 -m repo_contract.install "$@"
|
|
}
|
|
|
|
main "$@"
|