Skip to content
repo-release-tools
GitHub

Hook & Action Reference

Static context for agents: read this before using any prompt block below.

This page is static context for agents working on repo-release-tools. It lists the entry points, key files, and verification commands. It then gives ready-to-paste prompt blocks for pre-commit and lefthook setup. Read the context first, then use a prompt block unchanged.

Repo: github.com/Anselmoo/repo-release-tools · Python ≥ 3.12 · uv_build

Entry points (from pyproject.toml):

  • rrt-hooks → repo_release_tools.workflow.hooks:main — git hook runner (installed binary, NOT a uvx shortcut)
  • rrt → repo_release_tools.cli:app — developer CLI

Key files:

File Role
src/repo_release_tools/hooks.py All rrt-hooks subcommand logic
src/repo_release_tools/changelog.py Changelog parsing, [Unreleased] management
.pre-commit-hooks.yaml Hook definitions consumed by pre-commit
lefthook.yml Lefthook configuration (repo root)
action.yml Composite GitHub Action

Verification commands:

Terminal window
uv run pytest tests/test_hooks.py -x -q # fast unit tests
uvx pre-commit run --all-files # lint (ruff, line-length 100)

Each block below is a ready-to-paste prompt for pre-commit or lefthook setup. Use one verbatim.

Use the following prompt to activate pre-commit hooks for repo-release-tools.

<context>
Repo: https://github.com/Anselmoo/repo-release-tools
Entry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)
Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-Changelog
Assume pre-commit is already installed.
</context>
Activate the pre-commit hooks for this repository. A `.pre-commit-config.yaml` must exist (see prompt below). Then run:
```bash
pre-commit install --install-hooks
```
This installs hooks for every stage declared in `default_install_hook_types`. Commit-msg-stage hooks require `commit-msg` in that list — omitting it silently skips `rrt-update-unreleased` and `rrt-commit-subject`.

Use the following prompt to activate lefthook hooks for repo-release-tools.

<context>
Repo: https://github.com/Anselmoo/repo-release-tools
Entry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)
Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-Changelog
Assume lefthook and uv are already installed.
</context>
Activate lefthook hooks. A `lefthook.yml` must exist at the repo root (see prompt below). Then run:
```bash
uv tool install repo-release-tools # installs rrt-hooks binary
lefthook install # registers git hooks
```
DO NOT use `uvx --from repo-release-tools rrt-hooks …` in `lefthook.yml` — `rrt-hooks` is an installed binary, not a uvx shortcut.

.pre-commit-config.yaml — incremental workflow (auto-write changelog)

Section titled “.pre-commit-config.yaml — incremental workflow (auto-write changelog)”

Use the following prompt to configure pre-commit with auto-write changelog.

<context>
Repo: https://github.com/Anselmoo/repo-release-tools
Entry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)
Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-Changelog
Assume pre-commit is already installed.
</context>
Create `.pre-commit-config.yaml` at the repo root with this content:
```yaml
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/Anselmoo/repo-release-tools
rev: v1.18.0
hooks:
- id: rrt-branch-name
- id: rrt-update-unreleased
- id: rrt-commit-subject
```
  • rrt-hooks is an installed binary, not a uvx shortcut. Do not write uvx --from repo-release-tools rrt-hooks … in lefthook.yml.
  • Commit-msg hooks need commit-msg in default_install_hook_types. Omitting it silently skips rrt-update-unreleased and rrt-commit-subject.
  • pre-commit, lefthook, and uv are assumed installed. Do not recommend brew install, pip install pre-commit, or apt install for these tools.

Badge families are intentionally complete for the current icon registry across platform, registry, and language labels; see src/repo_release_tools/tools/platform.py if you think one is missing.

Chat is powered by Context7, a third-party service with its own terms and privacy policy.