Pure Bash helpers for keeping repositories maintained: dependency update PRs, repository practice audits, agent review automation, systemd user services, and stacked PR workflow support (gh-stack; Graphite is retired).
Headline tools: dep-updater (stacked dependency PRs), github-repo-lint (org repo practices audit), secret scanning (gitleaks via scripts/dev/secret-scan / CI), and secret audit (TruffleHog deep history via scripts/secret-audit — see docs/secret-audit-trufflehog.md).
Run scripts from a clone of this repo (paths below are relative to the repo root). Most entry points accept --help.
| Tool | What it does |
|---|---|
dep-updater |
Stacked dependency update PRs for one repo (or batch across clones) |
dep-updater-batch-run |
Daily dep-updater --batch --all + email report (systemd entry point) |
github-repo-lint |
Audit / onboard org repos against practices (merge queue, workflows, …) |
secret-scan |
Local + CI gitleaks scan for leaked credentials (canonical org helper) |
secret-audit |
TruffleHog deep scan (full git history); intake marker + periodic org sweep |
setup-service / systemd |
Install and inspect optional daily user services |
ship-and-review |
Submit stack → wait for CI → agent review loop |
start-development / ship helpers |
Worktrees, local CI gates, stack submit, CI wait |
wait-for-agent-review |
PR agent review loop (triage, quota fallback, operator email) |
Creates stacked dependency update PRs for a single repository (or, with --batch --all, org repos from the GitHub API that have a local clone under configured scan roots). Supported ecosystems: npm/pnpm, Python (pip, uv, poetry, pipenv), Rust/Cargo, and GitHub Actions. Stacking follows the target repo’s .github/stacking-tool marker (gh-stack when absent; a leftover graphite marker is refused). npm, PyPI, and GitHub Actions releases newer than 9 days are skipped unless the bump fixes a CVE. Work runs in a throwaway worktree under --tmpdir — the primary clone is not used for stack submit.
# Preview the plan (no git / worktree changes)
scripts/dep-updater --dry-run --dir /path/to/repo
# Apply updates for one repo (wait for CI + merge by default)
scripts/dep-updater --dir /path/to/repo
# One combined PR instead of one PR per package
scripts/dep-updater --batch --dir /path/to/repo
# CVE-fix bumps only
scripts/dep-updater --security-only --dir /path/to/repo
# Org membership via GitHub API; run clones under scan roots (skips archived;
# skips private unless --include-private; logs org repos with no local clone)
scripts/dep-updater --batch --all --no-wait-ci --no-wait-mergeUseful flags: --ecosystem npm|python|rust|gha|auto, --jobs N (with --batch --all), --report-json (implies --dry-run --quiet), --merge-via gh|merge-queue, --cleanup, --rebase. See Dependency Updates for ecosystem policy details.
With --batch --all, --jobs N runs up to N per-repository dep-updater --batch --dir <repo> children at once; most of a repo's time is spent waiting on CI, merge polling and registry calls, so the daily batch no longer takes the sum of every repo's wait. The default follows the host: the core count capped at 4 (beyond that the children only queue behind the shared GitHub pacing gate). At a terminal the default is serial, because parallel children have no stdin and their interactive prompts (rebase, resume-CI gate) would silently take the non-interactive answer; an explicit --jobs N or DEP_UPDATER_JOBS is honoured with a NOTE. Set DEP_UPDATER_JOBS=N (a positive integer; anything else is an error, like --jobs) to change the default for a host, or pass --jobs 1 for the serial, live-streamed run. Each repo's output is buffered and replayed in the original repo order, and the failure summary, the updates report, worst_exit and the Skipped (missing tooling) handling are folded in that same order, so the log markers dep-updater-batch-run parses and the exit status match a serial run. Differences to know about: output is not streamed (a repo's log appears once it and every repo before it finished), stdout and stderr of a repo are replayed as one stream on stdout, and TTY-only colour hints are not applied to replayed output. Ephemeral clones are made inside the workers, so they run in parallel too. Ctrl-C or TERM stops every worker and its in-flight commands and removes the buffers; clones that may still back a worktree are kept. Every gh call the children make passes the shared pacing gate (see "Shared GitHub API pacing" below), so they share one quota budget and one rate-limit backoff. Timing baseline: every run logs [batch-all] TIMING repo=<name> status=<ok|failed|skipped> seconds=<n> per repo and [batch-all] TIMING total wall_seconds=<n> sum_repo_seconds=<n> jobs=<n> repos=<n> (the ratio of the last two is the achieved speed-up), and appends one JSON line with the same numbers and per-repo results to ~/scratch/repository-helpers/dep-updater-batch-timings.jsonl (DEP_UPDATER_TIMINGS_FILE overrides the path; set it empty to disable). Compare --jobs 1 and --jobs N runs from that file.
--batch --all checks free space under its temp directory (--tmpdir when given, else $TMPDIR, else /tmp, and $TMPDIR as well when --tmpdir points elsewhere) before it creates the clone root. Below DEP_UPDATER_MIN_FREE_MB (a positive integer of at most nine digits, default 3072) it logs one ERROR: LOW_DISK_SPACE path=... free_mb=... required_mb=... line and stops before any clone, worktree or PR exists; dep-updater-batch-run puts that line at the top of its email. A repo whose log shows No space left on device is reported with the root cause LOW_DISK_SPACE instead of a downstream symptom such as an empty CI status.
In service mode, this entry point runs git fetch, then dep-updater --batch --all, and sends an SMTP report. --print writes the report to stdout instead; it skips SMTP and the batch run. Configure ~/.config/dep-updater.env from etc/dep-updater.env.example.
# Report-only (no batch, no SMTP)
DEP_UPDATER_BATCH_SCAN_ROOT=/path/to/repos scripts/dep-updater-batch-run --print
# Full daily worker
systemctl --user start dep-updater.service
tail --follow=name --retry ~/scratch/repository-helpers/dep-updater-batch.logAudits GitHub repositories against org conventions: protect-main + classic main protection, GitHub merge queue wiring, branch cleanup workflows, release-age policy (Dependabot cooldown / pnpm minimumReleaseAge), license / CODEOWNERS / cursor rules, stacking-tool marker, uv CVE workflow, and more. --suggest prints remediation hints; --apply-fix repairs supported GitHub settings and can queue candidate workflow PRs from the target clone.
# Current clone (when run inside a git repo with a GitHub origin)
scripts/github-repo-lint --suggest
# One repo by slug
scripts/github-repo-lint --repo OWNER/NAME --suggest
# New-repo onboarding checklist (strict expectations + SUGGEST hints)
scripts/github-repo-lint --new-repo --repo OWNER/NAME
# Every repo in the org
scripts/github-repo-lint --all --org the-hcma --suggest
# Repos are audited concurrently by default (min(cores, 4); identical report and exit status; see "Parallel audits" below)
scripts/github-repo-lint --all --org the-hcma --compact
# Force a serial audit
scripts/github-repo-lint --all --org the-hcma --compact --jobs 1
# Repair supported settings (+ candidate workflow stack when run from the clone)
scripts/github-repo-lint --repo OWNER/NAME --apply-fix
# Daily compliance email over org repos from the GitHub API (systemd / cron entry)
scripts/github-repo-lint --enforcerRequires an authenticated gh CLI and jq. Merge-queue-only subset: scripts/check-merge-settings (same flags, --merge-only behavior). Full check table: github-repo-lint checks.
--jobs N audits up to N repositories at once. The default is parallel: the host core count capped at 4, because beyond that the workers only queue behind the shared pacing gate (the 100 ms call spacing, not the worker count, bounds throughput). Set GITHUB_REPO_LINT_JOBS=N (a positive integer; anything else is an error, like --jobs) to change the default for a host (for example in the systemd unit or workflow env), or pass --jobs 1 for a serial audit. Each repository's output is buffered and replayed in the original repo order and the --compact report is built from the same per-repository results, so the report, the failure summary and the exit status match a serial run (verified byte-identical on the real org). Differences to know about: output is not streamed (nothing prints until all workers finish), each repo's stdout is printed before its stderr, TTY-only colour hints are not applied to replayed output, and per-process caches (for example SHA lookups) are repeated per worker so API volume is somewhat higher. --apply-fix always runs serially, and an unwritable TMPDIR falls back to a serial audit. Ctrl-C or TERM stops the workers and removes the buffers. Every gh call the workers make passes the shared pacing gate (see "Shared GitHub API pacing" below), so the workers share one quota budget, one minimum call spacing and one rate-limit backoff instead of each pacing alone.
Every GitHub call made through github_api_exec_with_rate_limit_retry (all of scripts/lib/repo-practices, the agent-review loop, scripts/gh-api) first passes github_api_pace_gate, which coordinates every process on the host through one state directory (~/scratch/repository-helpers/github-api-state by default): a shared blocked_until that any caller's rate-limit wait raises, the last observed core quota (read from real response headers, because GET /rate_limit reports a wrong core figure on some accounts), a minimum spacing between call starts, and a call counter. The gate stops at a quota reserve and waits for the real reset instead of failing, and it fails open with one NOTE if the state directory or lock is unusable. The lock is flock where available (Linux) with an atomic mkdir fallback. Environment: GITHUB_API_PACING=0 disables the gate, GITHUB_API_STATE_DIR relocates the state, GITHUB_API_MIN_INTERVAL_MS (default 100), GITHUB_API_QUOTA_RESERVE (default 200) and GITHUB_API_QUOTA_TTL_S (default 30) tune it, and GITHUB_API_PACE_LOCK=mkdir forces the portable lock even where flock exists. Calls that are not gh api/gh pr (gh auth status, gh stack) are not paced.
Org secret detection is gitleaks, wrapped by the canonical library scripts/lib/ci-secret-scan (copied into consumer repos as .github/ci/secret-scan and synced via github-repo-lint). CI runs it on every PR as a post-push triage job; it is not currently a required merge-queue status check.
Run the same logic locally before you push (installs gitleaks under ~/.cache/repository-helpers/bin when needed):
# This repo (or pass another clone path as the first argument)
scripts/dev/secret-scan
scripts/dev/secret-scan /path/to/other-repo
# Consumer repos that adopted the CI wrapper
bash .github/ci/secret-scanThe gitleaks tarball download is verified against a hardcoded SHA-256 (ci_secret_scan_sha256, one per platform, from the release's gitleaks_<ver>_checksums.txt) before extraction — a swapped or tampered asset fails loudly. On a version bump, refresh the version and all ci_secret_scan_sha256 platform entries (linux/darwin/windows × x64/arm64); github-repo-lint flags a stale pin.
Optional env: GITLEAKS_BASE / GITLEAKS_HEAD for a PR-diff scan, GITLEAKS_VERSION to override the pinned version (checksum check is then skipped), CI_SECRET_SCAN_BIN_DIR for a custom install path (defaults to /usr/local/bin on Unix, ~/.cache/repository-helpers/bin on Windows). On a leak, the helper prints ERROR: SECRET_SCAN_LEAK with rotate / branch-quarantine guidance — do not push and hope CI catches it.
pre-pr-checks / submit-stack / ship-and-review run this scan as a planned job when .github/ci/secret-scan or scripts/dev/secret-scan exists (escape hatch: PRE_PR_CHECKS_SKIP=secret-scan). CI secret-scan still runs after push for triage. Full-history / intake / periodic deep scans (TruffleHog) are #509 — now implemented as scripts/secret-audit (see below).
Full git history and org-wide sweeps use TruffleHog via scripts/secret-audit (see docs/secret-audit-trufflehog.md). After a clean scan, --write-marker records intake in a host-local ledger (~/scratch/repository-helpers/secret-audit-intake.json — not a git file; disposable, regenerated by the nightly sweep). github-repo-lint reads that ledger locally: a missing, stale, or corrupt entry FAILs --new-repo / --strict-onboarding (#575); CI runs (no ledger on the runner) skip the check. The daily timer does maintain the ledger.
scripts/secret-audit --repo OWNER/NAME
scripts/secret-audit --repo OWNER/NAME --write-marker
scripts/secret-audit --all --org the-hcma --include-privateAutomation always passes --no-update to TruffleHog. Installs must match the pinned release (3.97.0); a mismatched on-PATH binary is replaced from GitHub releases after checksum verification. On leaks: ERROR: SECRET_AUDIT_LEAK — rotate credentials; never record a clean intake.
Daily timer (optional): scripts/setup-secret-audit installs secret-audit.service (05:00) running scripts/secret-audit-batch-run (org sweep + summary email; finding details stay on the host under secret-audit-runs/). The sweep never writes markers, so it leaves local clones clean. Org sweeps skip archived repos; set SECRET_AUDIT_REPORT_TO in ~/.config/secret-audit.env (see etc/secret-audit.env.example) or reuse DEP_UPDATER_REPORT_TO.
| Script | Purpose | Typical invocation |
|---|---|---|
scripts/dev/approve-pending-deployments |
Approve WAITING GitHub environments (github-repo-lint, dep-updater) |
scripts/dev/approve-pending-deployments --pr <n> |
scripts/dev/post-pr-submission-checks |
Poll required checks; print agent-friendly failure logs | scripts/dev/post-pr-submission-checks --pr <n> |
scripts/dev/pre-pr-checks |
Detect-first local CI (shellcheck, tests, Python/TS/Rust when present; secret-scan when adopted; CodeRabbit CLI review when cr is installed) |
from .worktrees/<stack>-wt: scripts/dev/pre-pr-checks |
scripts/dev/coderabbit-cli-review |
Optional pre-push review with the CodeRabbit CLI (cr): own allowance, findings fail (or are answered with a logged --decline), each head once (max 2 per branch), a connection error is retried once and then skipped, never --use-credits; also the coderabbit-cli job of pre-pr-checks when cr is installed |
scripts/dev/coderabbit-cli-review (after committing) |
scripts/dev/model-review |
Pre-push review by a model other than the author: findings gate (logged --decline), each head once, incremental, at most 8 heads per branch; also the model-review job of pre-pr-checks when a reviewer command is available |
scripts/dev/model-review (after committing) |
scripts/dev/start-development |
Prune/sync; create or resume a stack worktree | scripts/dev/start-development --worktree my-change --no-interactive |
scripts/dev/submit-stack |
Register the branch as a gh stack, refuse a branch whose PR is already queued, pre-pr-checks → stack submit → CI wait |
scripts/dev/submit-stack |
scripts/dev/merge-stack |
Land a PR through the merge queue: gh stack merge for a stacked PR, gh pr merge --auto when the base branch has a merge queue, --auto --squash with auto-merge only, a refusal with neither (or a graphite marker) |
scripts/dev/merge-stack --pr <n> [--wait] |
scripts/dev/with-tmp-layout |
Run a command with its temp files under $TMPDIR/<project>/<branch>/<tool> (detached HEAD: detached-head/<sha>): test tools are removed after a passing run and kept after a failing one, uv and pnpm caches are kept, and marked directories older than 3 days (TMP_LAYOUT_RETENTION_DAYS) are swept at the next run; run-tests uses the same layout; consumer CI reaches it through the composite action actions/setup-tmp-layout (#832) |
scripts/dev/with-tmp-layout pytest -- uv run pytest |
Never implement on the primary clone — always cd into the stack worktree first. See Development.
| Script | Purpose |
|---|---|
scripts/check-lockfile-drift |
Compare lockfiles to registry constraints (safe throwaway worktree) |
scripts/check-merge-settings |
Thin wrapper: merge + GitHub MQ checks only |
scripts/check-token-expiry |
Preflight a CI environment PAT's expiry; warn before CI starts failing |
scripts/gh-api |
Throttled gh passthrough for agent flows (primary/secondary rate-limit backoff) |
scripts/grandfather-pnpm-release-age |
One-time pnpm minimumReleaseAge / exclude cutover for existing lockfiles |
scripts/on-deploy |
Example deploy hook; consumer repos implement their own |
scripts/trigger-agent-review |
Request a review from the configured agent profile (--confirm-clean asks CodeRabbit for a full review of an already-reviewed head; check / status report last_reviewed_sha, an object-based hint rather than a verdict that must be read together with head_reviewed, and head_reviewed_by, the agent whose review is on the head) |
Shared libraries live under scripts/lib/ (agent-review, ci-secret-scan, on-deploy-deps, release-age-defaults, repo-practices, runner, …).
scripts/gh-api wraps a one-off gh call in the shared GitHub rate-limit backoff (scripts/lib/github-api-rate-limit): it reads Retry-After / X-RateLimit-Reset, sleeps until reset, and emits NOTE: GITHUB_RATE_LIMIT_* breadcrumbs — the same logic wait-for-agent-review / github-repo-lint use internally, so ad-hoc agent calls (gh api, gh pr view, posting a reply) survive a tripped secondary limiter instead of 403'ing. Args, stdin, stdout, and the exit code (including 125 for quota-intact fail-fast) pass straight through. Interactive gh (auth, prompts, --web) is rejected; scripts/gh-api -- … opts a non-listed subcommand in. Tune with GITHUB_API_RATE_LIMIT_MAX_RETRIES, GITHUB_API_RATE_LIMIT_MAX_WAIT_S, GITHUB_API_RATE_LIMIT_QUOTA_INTACT_FAIL_FAST, GITHUB_API_SECONDARY_RATE_LIMIT_BACKOFF_S, GITHUB_API_ATTEMPT_TIMEOUT_S (per-attempt cap, default 300s; a hung read is cut off and retried, a mutation is never repeated) (scripts/gh-api --help).
| Script | Purpose |
|---|---|
scripts/setup-github-repo-lint |
Install github-repo-lint enforcer unit + timer |
scripts/setup-service |
Install worktree-aware dep-updater systemd user unit + timer |
scripts/show-services |
Read-only status of all service templates in this repo |
scripts/setup-service --status
scripts/setup-github-repo-lint --status
scripts/show-servicesTracked work that extends the tools above (not shipped yet):
| Issue | What it will add |
|---|---|
Shipped: TruffleHog deep secret audit (scripts/secret-audit), host-local intake ledger (#573), lint check, systemd timer — see docs/secret-audit-trufflehog.md. |
After CI is green, wait-for-agent-review drives the PR review loop (CodeRabbit, Copilot, Bugbot, humans): reply-before-resolve triage, quota fallback, early complete when nothing is outstanding, and operator email. It does not self-approve. Configure ~/.config/agent-review.env from etc/agent-review.env.example.
scripts/wait-for-agent-review loop --pr <n>
scripts/wait-for-agent-review check --pr <n>
scripts/wait-for-agent-review complete --pr <n> # emails operator when complete_ready
scripts/wait-for-agent-review hold --pr <n> # pause CodeRabbit while a series of fix pushes is made
scripts/wait-for-agent-review release --pr <n> # resume it: one review of the whole series (loop exit 14 = held)scripts/dev/ship-and-review runs the full ship path: pre-pr-checks → stack submit → CI wait (approves WAITING environments on the operator’s behalf) → wait-for-agent-review loop.
scripts/dev/ship-and-review
scripts/dev/ship-and-review --no-submit --pr <n> # PR already openThis repo ships two optional systemd user services. They are separate on purpose: dependency updates can create PRs, while repository-practices monitoring only reports compliance drift and points to the explicit --apply-fix remediation command.
| Service | Script | Schedule | Purpose |
|---|---|---|---|
dep-updater.service |
scripts/dep-updater-batch-run |
03:00 daily | Create/update dependency PRs for org repos with local clones and email the run report. |
github-repo-lint.service |
scripts/github-repo-lint |
04:00 daily | Monitor org repos (GitHub API; default the-hcma) and email the repository-practices report. |
dep-updater.service is the automation worker. It fetches every local clone under the scan root, runs dep-updater --batch --all (org API membership + local checkouts), streams the run to ~/scratch/repository-helpers/dep-updater-batch.log, and sends a success, failure, or timeout report by email. When updates are created, the report lists them from structured JSON; when none are created, it says so explicitly. Org repos with no local clone appear under Skipped (no local clone).
github-repo-lint.service is the compliance monitor. It discovers repositories from the GitHub org API (orgs/<ORG>/repos, default the-hcma; same source as github-repo-lint --org the-hcma --all), runs strict repository-practices checks for each one, emails the daily report, and exits non-zero when any repository fails. It does not apply repairs automatically. Local scan-root clones are not required for the audit (only for some --apply-fix workflow stacks).
Install or inspect them from this repository:
cp etc/dep-updater.env.example ~/.config/dep-updater.env
chmod 600 ~/.config/dep-updater.env
scripts/setup-service
scripts/setup-service --status
scripts/setup-github-repo-lint
scripts/setup-github-repo-lint --status
scripts/show-servicesgithub-repo-lint (no args) reuses ~/.config/dep-updater.env for SMTP by default. Use ~/.config/github-repo-lint.env when you need a different org (GITHUB_REPO_LINT_ORG), include-private, or report settings.
scripts/show-services prints a read-only summary of every systemd service template in this repo, including installed status, active/enabled state, timer next run, configuration files, log tail commands, and setup command.
See docs/SYSTEMD.md for service configuration, logs, timers, and manual trial runs.
Invocation and flags: dep-updater / dep-updater-batch-run. Supported ecosystems and policy defaults:
-
npm / pnpm: reads
package.json, lockfiles, and workspace config. Exact pins are updated in place; workspace, local, file, link, and git refs are skipped. -
Python / pip: supports
requirements.txtandpyproject.toml, writes>=floor constraints, and respects intentional==pins. -
Python / uv: supports
uv.lock;==pins are updated and promoted to>=, with dry-run install checks guarding transitive constraints. -
Python / Poetry: supports
poetry.lock, respecting intentional==pins. -
Python / Pipenv: supports
Pipfile.lock, respecting intentional==pins. -
Rust / Cargo: supports
Cargo.toml/Cargo.lockusingcargo outdatedJSON andcargo add, preserving dev/build kind and workspace package targeting. Requires a Rust toolchain on the host (plus theclippycomponent for post-bump recovery):rustup component add clippy cargo install cargo-outdated --locked
apt's Rust is too old for current
cargo-outdated— install via rustup, and on Debian/Ubuntu addbuild-essential pkg-config libssl-devforopenssl-sys/libgit2-sys. Note that~/.cargo/binis not on a systemd/cronPATHby default, so a timer-run batch can still report the tool missing after a successful interactive install. A host without it no longer fails the whole run:--batch --allskips those repos and lists them under Skipped (missing tooling) in the batch email, while a single-repo run still fails loudly. -
GitHub Actions: supports
.github/workflows/*.yml, preserving existingvprefix style, updating major-only pins only on newer majors, and skipping SHA or local action pins.
For npm, PyPI, and GitHub Actions, registry releases newer than 9 days are skipped unless the bump fixes a CVE.
See dep-updater.plan.md for implementation details and dep-updater-hybrid-architecture.plan.md for the Bash + Python extraction proposal.
Invocation and flags: github-repo-lint. The audit covers GitHub native merge queue wiring (org default), protect-main, classic branch protection, branch cleanup workflows, release-age policy, license/CODEOWNERS metadata, cursor rules, and uv Python CVE checks.
--apply-fix can repair supported GitHub settings such as Release Please squash settings, the protect-main ruleset (squash-only + merge_queue SQUASH + required_signatures + require_code_owner_review with an OrganizationAdmin bypass), and classic main branch protection (GitHub MQ profile). When run from the target repository clone, it also prepares candidate workflow fixes in a dedicated .worktrees/repo-practices-candidate-fixes-wt worktree and submits them as a stack for review (gh stack init / gh stack submit; the target's own .github/stacking-tool marker is not consulted for this, and a leftover graphite marker there is flagged by the audit). Candidate workflow templates live under scripts/lib/repo-practices-workflows/ so they can be reviewed and linted directly. Disable org repos in Graphite’s merge-queue UI so Graphite does not also try to land PRs (Graphite stacking is retired; stacking is gh-stack via .github/stacking-tool).
scripts/lib/repo-practices implements the audit. Use --merge-only (via scripts/check-merge-settings) to run only the merge-queue subset.
| Check | Full audit | Merge-only | What it validates |
|---|---|---|---|
| Release Please squash settings | yes | yes | Repos with release-please.yml use squash-only merges on main |
protect-main ruleset |
yes | yes | Squash-only + GitHub merge_queue (SQUASH) + required_signatures + pull_request require_code_owner_review on refs/heads/main when GitHub MQ, Release Please, or strict onboarding |
protect-main required_signatures |
yes | yes | Ruleset rejects any push/merge with an unverified commit; a missing rule FAILS in every mode (repository-helpers#782); --apply-fix adds the rule — repository-helpers#609 |
protect-main require_code_owner_review |
yes* | yes | Ruleset enforces CODEOWNER review (matching classic protection), with an OrganizationAdmin bypass (bypass_mode: pull_request) so the org owner can still land PRs (*missing rule FAILS --new-repo / --strict-onboarding, SUGGESTs routine --all / --suggest; rule present without the bypass FAILS always; --apply-fix adds both — repository-helpers#626) |
| Main HEAD commit verification | yes | — | Default-branch HEAD reports commit.verification.verified (bot authors skipped); an unverified HEAD FAILS in every mode, and unverified human commits among the last 20 are a SUGGEST; no --apply-fix — repository-helpers#609, #782 |
Classic main protection |
yes | — | CODEOWNERS reviews, CI contexts; no Graphite-only push restrictions (GitHub MQ profile) |
| GitHub merge queue wiring | yes | yes | protect-main merge_queue, ci.yml merge_group, dependabot auto-merge via gh pr merge --auto when dependabot.yml exists |
| Workflow file extensions | yes | — | .github/workflows/* use .yml (not .yaml) |
| Branch cleanup workflows | yes | — | cleanup-branch-on-merge.yml, cleanup-merged-branches.yml, canonical merged-pr-closer.yml |
| License / copyright / CODEOWNERS | yes | — | Top-level LICENSE with copyright notice; .github/CODEOWNERS with org owner |
| Agent review agents rule | yes* | — | .agents/rules/pr-ship-and-review.md + thin .cursor/rules/*.mdc shim + .agents/skills/ship-and-review/SKILL.md reference wait-for-agent-review and reply-before-resolve (*missing agents layout FAILS only --new-repo during #637 rollout / SUGGEST under --strict-onboarding; invalid agents body or invalid shim FAILS --new-repo / --strict-onboarding; legacy full-body .mdc with no .agents/rules/<name>.md SUGGEST migrate under --strict-onboarding / FAILS --new-repo; when the canonical agents rule exists but the .mdc is still a full body, the invalid-shim FAIL applies) |
| Pre-PR checks agents rule | yes* | — | .agents/rules/pre-pr-checks.md (+ Cursor shim): format before check + no truncated output; consumer repos resolve scripts/dev/ via the repository-helpers clone (#579) (*same #637 dual-path severity as agent-review; bare-path FAILS --new-repo / --strict-onboarding (#575/#579); routine --all / --suggest emits SUGGEST and succeeds) |
| Git commit identity agents rule | yes* | — | .agents/rules/git-commit-identity.md (+ Cursor shim) forbids agent/machine co-authors; agents must verify commit signing and ~/.cursor/cli-config.json attribution (*#637 dual-path severity) |
| No secret exposure agents rule | yes* | — | .agents/rules/no-secret-exposure.md (+ Cursor shim): never leak secrets into logs/transcripts/PRs/commits; allowlist or path-existence when inspecting config; rotate if leaked (*#637 dual-path + #575) |
| Remote timeouts and retries agents rule | yes* | — | .agents/rules/remote-timeouts-retries.md (+ Cursor shim): explicit timeouts on every remote call; bounded retries for transient failures only (*#637 dual-path severity) |
| GitHub API throttle rule | yes* | — | .agents/rules/github-api-throttle.md (+ Cursor shim): every gh call site (agent or first-party code) runs via "${REPOSITORY_HELPERS_DIR:-$HOME/work/ai/repository-helpers}/scripts/gh-api" or, inside first-party bash libraries, github_api_exec_with_rate_limit_retry; consumers carry a breadcrumb + canonical URL, not a copied body (*#637 dual-path; repository-helpers#608) |
| GitHub content formatting rule | yes* | — | .agents/rules/github-content-formatting.md (+ Cursor shim): agent-authored issue/PR bodies and comments require --body-file + scripts/lint-github-markdown for multi-paragraph content, and committed .md files use one line per paragraph / list item (scripts/lint-github-markdown --repo-files, repository-helpers#671); consumers carry a breadcrumb + canonical URL, not a copied body (*#637 dual-path; repository-helpers#657) |
| CodeRabbit skills rule | yes* | — | .agents/rules/coderabbit-skills.md (+ Cursor shim): the CodeRabbit CLI skills (code-review, autofix, coderabbit-config) are installed at user level with coderabbit skills (preview with --agent, apply the exact --confirm <plan-hash> only after the user approves), the review run caps of scripts/dev/coderabbit-cli-review stay in force and --use-credits is never passed; consumers carry a breadcrumb + canonical URL, not a copied skill body (*#637 dual-path, SUGGEST-during-rollout: a missing agents rule FAILS --new-repo only; a missing or invalid Cursor shim and an invalid agents rule FAIL --new-repo / --strict-onboarding; repository-helpers#860) |
.coderabbit.yaml |
yes | — | SUGGEST-only, never FAILs (a GitHub API error is a WARN, or a SUGGEST under --suggest): a repo without a root .coderabbit.yaml is nudged to add one; the coderabbit-config skill creates and validates it (repository-helpers#860) |
| Repo practices after config change | yes* | — | .agents/rules/repo-practices-after-config-change.md (+ Cursor shim) requires github-repo-lint after workflow/config edits; pre-pr-checks runs detect-first repo-practices-lint when the diff touches those paths (*#637 dual-path) |
| Session-start read guidance | yes* | — | .agents/rules/read-agents-and-rules.md (+ Cursor shim) requires reading AGENTS.md and .agents/rules/ at the start of every new agent session (*#637 dual-path) |
| Agent bootstrap (agent-agnostic) | yes* | — | AGENTS.md at root + a session-startup line telling the agent to load .agents/rules/*.md; CLAUDE.md (an @AGENTS.md import, or a symlink to AGENTS.md) and .github/copilot-instructions.md shims so Claude Code / Copilot reach the same guidance, plus .github/instructions/agents-rules.instructions.md (applyTo: '**') telling Copilot to read .agents/rules/*.md, because Copilot auto-loads .github/instructions/ but not .agents/rules/ (#681) (templates in scripts/lib/repo-practices-agents/) (*missing AGENTS.md / startup line / CLAUDE.md / copilot shim FAILS --new-repo / --strict-onboarding (#575/#579); the .github/instructions pointer uses the rollout ratchet: missing FAILS only --new-repo, invalid FAILS --new-repo / --strict-onboarding; routine --all / --suggest emits SUGGEST and succeeds); a present CLAUDE.md or .github/copilot-instructions.md that names .cursor/rules but never .agents/rules is stale: FAILS --new-repo / --strict-onboarding, SUGGESTs routine, --apply-fix re-syncs CLAUDE.md only when it is the bare @AGENTS.md import (a customized CLAUDE.md or the repo-specific Copilot file is only SUGGESTed); the missing-shim --apply-fix only creates absent or empty files and never overwrites a non-empty one |
| Agent-bootstrap shims trackable | yes | — | .gitignore must not ignore CLAUDE.md, .github/copilot-instructions.md or .github/instructions/agents-rules.instructions.md (mirrors the .cursor/rules/ guard) (#575) |
| Secret-audit intake ledger | yes | — | Host-local ~/scratch/repository-helpers/secret-audit-intake.json entry (status=clean, fresh) after a TruffleHog deep scan; missing / stale / corrupt FAILs --new-repo / --strict-onboarding (#575), unless GITHUB_REPO_LINT_INTAKE_ADVISORY=1 (set by scripts/dev/pre-pr-checks, repository-helpers#874) makes it a SUGGEST; not checked in CI (docs/secret-audit-trufflehog.md) |
| Stacking-tool marker + rule | yes* | — | .github/stacking-tool (graphite|gh-stack) and .agents/rules/stacking-tool.md + thin Cursor shim (*#637 dual-path) A graphite marker on a repo whose protect-main has required_signatures always FAILS, as part of retiring Graphite org-wide, since its merge queue builds unsigned commits (repository-helpers#772) |
| Stacking docs consistency | yes | — | gh-stack marker vs leftover Graphite docs (AGENTS.md / pr-ship / GRAPHITE.md) |
| UV Python CVE check | yes | — | uv.lock + pyproject.toml repos require canonical .github/workflows/cve-check.yml |
| UV + Release Please lock sync | yes | — | uv + release-please.yml repos require release-please-config extra-files bumping uv.lock via @.name.value jsonpath (release-please#2561) |
| Python static CI job | yes | — | Python (pyproject.toml + ruff) repos run ruff check/format + typecheck in one Python lint & format checks job via .github/ci/python-static; no split Ruff/Pyright/Mypy/Backend Lint publishers in any workflow; cutover must share the combined job/step conclusion |
.cursor/rules / .agents/rules / .agents/skills gitignore |
yes | — | .gitignore must not block .cursor/rules/, .agents/rules/, or .agents/skills/ |
| Dependabot release age | yes | — | cooldown on every dependabot.yml updates entry (release-age-defaults) |
| pnpm release age | yes | — | minimumReleaseAge in pnpm-workspace.yaml when present |
| pnpm Corepack CI | yes | — | Exact packageManager: pnpm@X.Y.Z when lockfile exists; no pnpm/action-setup / setup-node cache: pnpm; use org composite actions/setup-pnpm-corepack (pin SHA on main) |
| Temp layout CI | yes | — | Workflows and .github/ci wrappers that run uv, pnpm or pytest go through scripts/dev/with-tmp-layout (temp files under $TMPDIR/<project>/<branch>/<tool>) and the workflow uses actions/setup-tmp-layout@<full SHA on main> (repository-helpers#832); FAILS every repo, existing ones included, now that every consumer has the layout (rp_tmp_layout_enforce_existing, set to 0 only to fall back to the rollout SUGGEST) |
ci-secret-scan gitleaks pin |
yes* | — | Warn when scripts/lib/ci-secret-scan pins gitleaks (ci_secret_scan_version / ci_secret_scan_sha256) behind the release-age-eligible version (*this repo only) |
ci-shellcheck pin |
yes* | — | Warn when scripts/lib/ci-shellcheck pins shellcheck (ci_shellcheck_version / ci_shellcheck_sha256) behind the release-age-eligible version (*this repo only) |
| GitHub-native security settings | yes* | — | Dependabot alerts, Dependabot security updates, secret scanning + push protection (free on public repos, GHAS-gated on private — advisory only there), private vulnerability reporting; --apply-fix toggles each via the GitHub API (*enforceable (public-repo-available) settings FAIL under --new-repo and --strict-onboarding; private-repo advisory-only settings (secret scanning, private vulnerability reporting when GHAS-gated) always SUGGEST, never FAIL; routine --all / --suggest SUGGESTs throughout — org-wide rollout complete, repository-helpers#588) |
| Actions hardening | yes* | — | default_workflow_permissions: read and can_approve_pull_request_reviews: false (--apply-fix sets both); sha_pinning_required: true when every third-party workflow uses: is already SHA-pinned and any setup-pnpm-corepack pins have nested third-party uses: SHA-pinned too (--apply-fix enables it under that gate — repository-helpers#640 / #646); allowed_actions is SUGGEST-only always (*workflow perms FAIL under --new-repo / --strict-onboarding; sha_pinning_required FAILs under those modes only when uses: (and nested composite pins) are already SHA-pinned, else SUGGEST; routine --all / --suggest SUGGESTs — repository-helpers#588) |
Actions workflow uses: pinning |
yes* | — | Third-party uses: refs pinned to a full commit SHA; a release/publish workflow (holds OIDC / write tokens) with a non-SHA pin is promoted past a generic suggestion (*generic non-SHA pins are SUGGEST always; release/publish workflow pins FAIL under --new-repo and --strict-onboarding — org-wide rollout complete, repository-helpers#588) |
| systemd unit hardening | yes | — | SUGGEST-only, never FAILs (suggestions print with --suggest; a GitHub API error is a WARN, never a silent skip): repos shipping etc/systemd/*.service templates are nudged to set NoNewPrivileges=true and to consider ProtectSystem= / ProtectHome= / PrivateTmp= / RestrictAddressFamilies= / CapabilityBoundingSet= (values are service-specific and are never auto-applied; repository-helpers#634). A unit that mails through setgid sendmail(1) is exempt (repository-helpers#765): NoNewPrivileges= and the seccomp-style directives (RestrictAddressFamilies=, SystemCallFilter=, SystemCallArchitectures=, ...) force no_new_privs in a user manager, the kernel then ignores the setgid bit and sendmail hangs. Mark such a unit with a mails-via-sendmail comment (any case, on its own comment line in the unit): that comment is the only thing that exempts a unit — nothing is inferred from Exec*= or Environment=, since the SMTP host usually comes from an EnvironmentFile= the audit cannot see |
| Deployment environment protection | yes* | — | Any environment a workflow deploys to must have a protection rule (required reviewer) or a deployment_branch_policy (*missing FAILS --new-repo and --strict-onboarding; SUGGESTs in routine --all / --suggest — org-wide rollout complete, repository-helpers#588) |
| Agent review properties | yes | — | Org custom properties agent-reviewers (multi-select: coderabbit, copilot, bugbot; unset means coderabbit only) and agent-review-enabled (true/false; false turns agent review off) pick which agent reviewers are active per repo (scripts/lib/agent-review-reviewers, repository-helpers#716), and agent-review-max-rounds (single-select 0 to 5; unset means 3, 0 means no cap) caps the review rounds before wait-for-agent-review loop accepts a PR with CI green and nothing unanswered (scripts/lib/agent-review-max-rounds, repository-helpers#861). Every property, default, override and failure mode is in docs/custom-properties.md. Undefined properties SUGGEST (--apply-fix defines all three org schemas); a malformed value (unknown reviewer, a non-boolean agent-review-enabled, or a round cap outside 0 to 5) FAILS |
| Protection-mechanism consistency | yes | — | Advisory only: flags a genuine disagreement between classic main protection and the protect-main ruleset — this org runs both by design, so their coexistence is never itself flagged. require_code_owner_reviews is now enforced on both sides (repository-helpers#626), so this check is normally quiet (repository-helpers#588) |
--suggest prints remediation lines; --apply-fix queues candidate workflow/cursor-rule PRs via the stacking backend selected by .github/stacking-tool (gh stack init / gh stack submit; a leftover graphite marker is flagged by the audit and refused by the tooling).
Further detail (protect-main rules, branch hygiene, CVE workflow template): AGENTS.md.
scripts/setup-service reads unit templates from etc/systemd/<unit>.service in the invoking repository, substitutes @@REPO_DIR@@, injects DEPLOYED_COMMIT and ConditionHost=|<machine-id> guards, installs under ~/.config/systemd/user/, and keeps a readable copy under ~/.config/share/systemd-units/ for scripts/show-services. Enables companion timers when etc/systemd/<unit>.timer exists.
Opt-out: a repo that manages its own systemd convention (system-scope units, a different placeholder set, a host-guard library, etc.) ships its own executable scripts/setup-service whose content differs from this repo's generic helper (cmp -s). A byte-identical copy (e.g. another worktree of repository-helpers) is not an opt-out. Differing content is self-documenting signal to skip generic user-scope adoption — start-development --refresh and this repo's scripts/setup-service become no-ops for that checkout (repository-helpers#630). GITHUB_REPO_LINT_SERVICE_UNIT (e.g. scripts/setup-github-repo-lint) only selects a unit basename on the generic path; the content-diff opt-out is checked first and still wins. Details: docs/SYSTEMD.md.
For service repositories, provide an executable scripts/on-deploy hook:
| Exit code | Meaning |
|---|---|
0 |
Build or sync steps ran; the service must restart. |
1 |
Nothing changed; restart may be skipped. |
2+ |
Failure; setup aborts. |
Use scripts/lib/on-deploy-deps from this repo for Python and pnpm dependency staleness checks. See AGENTS.md and docs/on-deploy-deps-load.snippet.
Stacking backend is selected by .github/stacking-tool (gh-stack; Graphite is retired and a leftover graphite marker is refused). Never edit the primary clone directly — work in a stack worktree.
scripts/dev/start-development --worktree my-change --no-interactive
cd .worktrees/my-change-wt
# gh-stack (this repo):
gh stack init my-change/topic
# … commit …
# gh stack add my-change/next-layer # optional extra layerLocal quality gates and submit (prefer these over bare gh stack submit):
scripts/dev/pre-pr-checks # detect-first local CI mirror (includes secret-scan when adopted)
scripts/dev/secret-scan # optional: same gitleaks path without full pre-pr
scripts/dev/submit-stack # pre-pr-checks + stack submit + CI waitpre-pr-checks plans a secret-scan job when .github/ci/secret-scan or scripts/dev/secret-scan exists. That is the submit-path gate; CI secret-scan still runs after push for triage. Skip only with PRE_PR_CHECKS_SKIP=secret-scan. Org-wide / historical deep scans are tracked separately (repository-helpers#509).
End-to-end ship (submit + CI + agent review loop):
scripts/dev/ship-and-review
# or, when the PR already exists:
scripts/dev/ship-and-review --no-submit --pr <n>After every push, wait for CI on the PR head (included in submit-stack by default):
scripts/dev/post-pr-submission-checks --pr <n>When CI is green, run the agent review loop. Reply on-thread before resolving (exit code 3 means feedback still needs a human reply):
scripts/wait-for-agent-review loop --pr <n>When check reports complete_ready: true (agent sign-off on the current head):
scripts/wait-for-agent-review complete --pr <n> # emails the operator; does not self-approveMerging (org default): use GitHub’s merge queue (gh pr merge --auto --squash / Enable auto-merge; a PR in a gh stack cannot use auto-merge — land it with gh stack merge --yes --squash (from the stack's worktree) or scripts/dev/merge-stack --pr <n>). Do not use the merge-it label to land PRs — leftover labels are ignored. Graphite is retired (its merge queue builds unsigned commits); disable Graphite’s merge-queue UI for org repos.
Configure ~/.config/agent-review.env from etc/agent-review.env.example (SMTP, AGENT_REVIEW_REPORT_TO, early-complete when nothing outstanding, 12h PR non-convergence cap).
See AGENTS.md for coding conventions, utility index, and agent-review details; .cursor/rules/stacking-tool.mdc for backend selection; .agents/skills/ship-and-review/SKILL.md for the full review playbook; skills under .agents/skills/{graphite,gh-stack}/.
Run the full local CI mirror:
scripts/dev/pre-pr-checksFocused tests live in tests/ and can be run directly:
bash tests/dep-updater.test
bash tests/dep-updater-batch-run.test
bash tests/github-repo-lint-part-1.test # parts 1-6; see tests/lib/github-repo-lint-part-init
scripts/dev/run-tests --jobs 8 # the whole suite, files in parallel
bash tests/a-github-repo-lint-enforcer.test
bash tests/setup-service.testshellcheck is pinned (currently 0.11.0) so a local run and CI never disagree on lint findings (e.g. SC2329). Both .github/workflows/ci.yml and scripts/dev/pre-pr-checks resolve shellcheck through scripts/lib/ci-shellcheck, which downloads the pinned release binary (Linux/macOS, x86_64/aarch64) when the pinned version is not already resolvable — locally into ~/.cache/repository-helpers/bin, in CI into /usr/local/bin. The download is verified against a hardcoded SHA-256 and the installed binary is re-checked so a stale shellcheck earlier on PATH can't silently win. Override the version for local experiments with SHELLCHECK_VERSION (checksum check is then skipped).
scripts/github-repo-lint warns when ci_shellcheck_version / ci_shellcheck_sha256 in scripts/lib/ci-shellcheck fall behind the newest shellcheck release that clears the dep-updater release-age gate (same mechanism as the ci-secret-scan gitleaks pin). On a bump, update the version and all four checksums, then re-sync any consumer .github/ci/shellcheck.
MIT. Copyright (c) 2026 Henrique Andrade / thehcma. See LICENSE.