Setup
Getting started
Start with shared typed-source and verifier rules, then choose additional policy.
1. Install local checks
Install uv, then run from your Git repository. Sarj repositories use the shared Code Standards setup:
uvx --no-config --isolated --python 3.14 --from code-standards code-standards setupcode-standards doctorThis installs staged repository checks, commit-message validation, and the pull-request history workflow in one environment.
Standalone installation
For consumers using Repo Standards directly:
uv tool install repo-standardsrepo-standards pull-request size . --base origin/mainReplace origin/main with your target branch. Upgrade with uv tool upgrade repo-standards; pin the package version in automation.
2. Choose repository rules
Checks reject undeclared JavaScript and bespoke verifier scripts by default. Use .mts for ESM tooling and .cts for CommonJS. Start with this tracked .repo-standards/repository.toml:
repository_id = "example-repository"components = []repo-standards check .The manifest must be tracked in Git. Checks read committed HEAD; use --staged after staging both the manifest and files to check the index.
An omitted or empty rule list uses the defaults. A nonempty enabled_rules list or --enable-rule selection replaces them; include both default IDs when adding rules. Review rules and their examples. IDs stay versionless.
3. Measure pull-request size in CI
Save this workflow in .github/workflows/pr-size.yml. The size Action enables no repository rules; thresholds, labels, and approvals remain consumer policy.
GitHub Actions workflow
name: Pull-request sizeon: pull_request:permissions: contents: readjobs: size: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - uses: sarj-ai/repo-standards@9ec36427f34bab43589129d85d571dd476061c8e # v6.22.3Keep the full commit pins and complete Git history. Use pull_request; the size metric is not a security gate.
To exclude generated files, commit the attribute in the trusted base revision:
path/to/generated/** pr-size-excluded