Hook & Action Reference
Hook & Action Reference
Section titled “Hook & Action Reference”Static context for agents: read this before using any prompt block below.
Agent context
Section titled “Agent context”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:
uv run pytest tests/test_hooks.py -x -q # fast unit testsuvx pre-commit run --all-files # lint (ruff, line-length 100)Assumptions: pre-commit, lefthook, and uv are already installed. Do not recommend brew install, pip install pre-commit, or apt install for these tools.
pre-commit / lefthook
Section titled “pre-commit / lefthook”Activate pre-commit hooks
Section titled “Activate pre-commit hooks”Use the following prompt to activate pre-commit hooks for repo-release-tools.
<context>Repo: https://github.com/Anselmoo/repo-release-toolsEntry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-ChangelogAssume 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:
```bashpre-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`.Activate lefthook hooks
Section titled “Activate lefthook hooks”Use the following prompt to activate lefthook hooks for repo-release-tools.
<context>Repo: https://github.com/Anselmoo/repo-release-toolsEntry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-ChangelogAssume lefthook and uv are already installed.</context>
Activate lefthook hooks. A `lefthook.yml` must exist at the repo root (see prompt below). Then run:
```bashuv tool install repo-release-tools # installs rrt-hooks binarylefthook 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-toolsEntry point: rrt-hooks (installed binary — repo_release_tools.workflow.hooks:main)Python ≥ 3.12 | uv_build | Conventional Commits | Keep-a-ChangelogAssume pre-commit is already installed.</context>
Create `.pre-commit-config.yaml` at the repo root with this content:
```yamldefault_install_hook_types: [pre-commit, commit-msg]
repos: - repo: https://github.com/Anselmoo/repo-release-tools rev: v1.14.0 hooks: - id: rrt-branch-name - id: rrt-update-unreleased - id: rrt-commit-subject```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.