Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/generated-rules.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"copier-template": "c297313eea2b16f7b713e0faf4a3672de05d6ea27a4ff374e659d3960d9784bc",
"copier-template": "d4711ceadf0cf1bb10d81a3a65b892b6bf0a0a20f40496fcb32407024152d15e",
"documentation-toc": "52734c4c63f46babf96aeae1260407add66dbec2d997f90a25ef01b7e1479127",
"github-actions": "5b7aa1678f3d3798125fb1203a68a39d2122ff2e4f655df17d4e8db621a5a684",
"github-actions": "c7bc81aede69023b0715ce8c0712f8e147cf5c2b6d90acf6a47a912ba99a182f",
"markdown-documentation": "027f47636d9d510e6cbd5505f9339c1aeee6f41dd823c0b478d409dde1ae4538",
"shell-scripts": "bdeed1f2724292989168f25949c8d83245f1436c24a3b82dab10429f60790d64"
}
6 changes: 3 additions & 3 deletions .agents/rules/copier-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These files are **rendered into consumer repositories** by `copier copy` and mer

## `copier.yml`

- `_skip_if_exists` lists **bootstrap-only** files (`pyproject.toml`, `.github/workflows/test.yml`); everything else under `template/` is updated on `copier update`. `_skip_if_exists` only protects files that exist: a file a consumer deletes is re-created on update, so optional files use a question-gated filename (`reusable_lint`, `test_workflow`).
- `_skip_if_exists` lists **bootstrap-only** files (`pyproject.toml`, agent guidance); everything else under `template/` is updated on `copier update`. `_skip_if_exists` only protects files that exist: a file a consumer deletes is re-created on update, so optional files use a question-gated filename (`agent_guidance`). A file removed from the template is deleted from consumers, local edits included.
- Renaming or removing a question is **breaking** for existing `.copier-answers.yml` files; document it in **`CHANGELOG.md`** and **`docs/migration-guide.md`**.

## `template/baselines/ruff.toml`
Expand All @@ -19,9 +19,9 @@ These files are **rendered into consumer repositories** by `copier copy` and mer

## `template/.pre-commit-config.yaml`

- Hook **`rev:`** values should match the versions pinned in **`template/pyproject.toml.jinja`** where applicable (ruff, mypy, pre-commit).
- Ruff and mypy are **local hooks** run with `uv run --frozen python -m`, so their versions come from the consumer's `uv.lock`; do not reintroduce mirrored `rev:` pins. Remote hooks keep a pinned **`rev:`**.
- **`fail_fast: true`** is intentional baseline behavior unless policy changes.

## `template/.github/workflows/`

See **`.agents/rules/github-actions.md`** for reusable vs template caller expectations and pinning.
See **`.agents/rules/github-actions.md`** for the managed caller workflow and its pins.
13 changes: 7 additions & 6 deletions .agents/rules/github-actions.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Review: GitHub Actions

## Callable workflows (this repository)
## Workflows of this repository

- Files under **`.github/workflows/`** that define **`on: workflow_call`** are **reusable entry points**. This repo uses the **`reusable-` filename prefix** as an org convention for discoverability (see `docs/reusable-workflows.md`). Renaming a published reusable file is a **breaking change** for every consumer `uses:` path.
- This repository publishes **no callable workflow**: Python CI callees live in github-workflows (see `docs/reusable-workflows.md`).
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. Its `release-please` job opens and maintains the release PR from conventional PR titles. See **`docs/versioning.md`**.
- **`reusable-pre-commit.yml`** should remain a thin, predictable pipeline: checkout → setup Python (with pip cache) → optional pre-install → install → `pre-commit run --all-files` (or overridden command). Avoid surprising side effects in defaults; document new **`inputs`** in `docs/reusable-workflows.md` and **`CHANGELOG.md`** when behavior or contract changes.

## Template caller workflows (`template/.github/workflows/`)
## Template caller workflow (`template/.github/workflows/ci.yml.jinja`)

- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. Its pin carries the `x-release-please-version` marker so release preparation bumps it with `STANDARDS_VERSION`, and it reaches consumers via `copier update`.
- **`test.yml`** is a **starter only** for consumer repos. This standards repo does **not** ship a reusable test matrix. Reviews should resist moving project-specific test logic here unless the README and docs explicitly expand that scope.
- Managed by Copier and **public API**: job ids decide the required check contexts of every adopter, so renaming one is a breaking change.
- Every `uses:` of github-workflows is pinned to the same ref, bumped here and delivered by `copier update`.
- The `Tests success` program must stay identical to the scoped gate accepted by github-config `scripts/check-required-gates.sh`.
- Test logic stays in `scripts/check.sh`; do not add project-specific steps to the template.

## Review checklist

Expand Down
6 changes: 3 additions & 3 deletions .claude/rules/copier-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ These files are **rendered into consumer repositories** by `copier copy` and mer

## `copier.yml`

- `_skip_if_exists` lists **bootstrap-only** files (`pyproject.toml`, `.github/workflows/test.yml`); everything else under `template/` is updated on `copier update`. `_skip_if_exists` only protects files that exist: a file a consumer deletes is re-created on update, so optional files use a question-gated filename (`reusable_lint`, `test_workflow`).
- `_skip_if_exists` lists **bootstrap-only** files (`pyproject.toml`, agent guidance); everything else under `template/` is updated on `copier update`. `_skip_if_exists` only protects files that exist: a file a consumer deletes is re-created on update, so optional files use a question-gated filename (`agent_guidance`). A file removed from the template is deleted from consumers, local edits included.
- Renaming or removing a question is **breaking** for existing `.copier-answers.yml` files; document it in **`CHANGELOG.md`** and **`docs/migration-guide.md`**.

## `template/baselines/ruff.toml`
Expand All @@ -25,9 +25,9 @@ These files are **rendered into consumer repositories** by `copier copy` and mer

## `template/.pre-commit-config.yaml`

- Hook **`rev:`** values should match the versions pinned in **`template/pyproject.toml.jinja`** where applicable (ruff, mypy, pre-commit).
- Ruff and mypy are **local hooks** run with `uv run --frozen python -m`, so their versions come from the consumer's `uv.lock`; do not reintroduce mirrored `rev:` pins. Remote hooks keep a pinned **`rev:`**.
- **`fail_fast: true`** is intentional baseline behavior unless policy changes.

## `template/.github/workflows/`

See **`.agents/rules/github-actions.md`** for reusable vs template caller expectations and pinning.
See **`.agents/rules/github-actions.md`** for the managed caller workflow and its pins.
13 changes: 7 additions & 6 deletions .claude/rules/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ paths:

# Review: GitHub Actions

## Callable workflows (this repository)
## Workflows of this repository

- Files under **`.github/workflows/`** that define **`on: workflow_call`** are **reusable entry points**. This repo uses the **`reusable-` filename prefix** as an org convention for discoverability (see `docs/reusable-workflows.md`). Renaming a published reusable file is a **breaking change** for every consumer `uses:` path.
- This repository publishes **no callable workflow**: Python CI callees live in github-workflows (see `docs/reusable-workflows.md`).
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. Its `release-please` job opens and maintains the release PR from conventional PR titles. See **`docs/versioning.md`**.
- **`reusable-pre-commit.yml`** should remain a thin, predictable pipeline: checkout → setup Python (with pip cache) → optional pre-install → install → `pre-commit run --all-files` (or overridden command). Avoid surprising side effects in defaults; document new **`inputs`** in `docs/reusable-workflows.md` and **`CHANGELOG.md`** when behavior or contract changes.

## Template caller workflows (`template/.github/workflows/`)
## Template caller workflow (`template/.github/workflows/ci.yml.jinja`)

- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. Its pin carries the `x-release-please-version` marker so release preparation bumps it with `STANDARDS_VERSION`, and it reaches consumers via `copier update`.
- **`test.yml`** is a **starter only** for consumer repos. This standards repo does **not** ship a reusable test matrix. Reviews should resist moving project-specific test logic here unless the README and docs explicitly expand that scope.
- Managed by Copier and **public API**: job ids decide the required check contexts of every adopter, so renaming one is a breaking change.
- Every `uses:` of github-workflows is pinned to the same ref, bumped here and delivered by `copier update`.
- The `Tests success` program must stay identical to the scoped gate accepted by github-config `scripts/check-required-gates.sh`.
- Test logic stays in `scripts/check.sh`; do not add project-specific steps to the template.

## Review checklist

Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/reusable-pre-commit.yml

This file was deleted.

10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python project standards

This repository owns the Copier template, reusable workflows and shared Python standards. Read `README.md` and `docs/development.md` for the current contract; there is no root Python package. Follow the actual Copier update and release procedures when changing templates or versions.
This repository owns the Copier template, the Python CI contract and shared Python standards. Read `README.md` and `docs/development.md` for the current contract; there is no root Python package. Follow the actual Copier update and release procedures when changing templates or versions.

For substantive changes read `.agents/rules/changelog-alignment.md`. For commits read `.agents/rules/commit-message-convention.md`; for dependencies read `.agents/rules/dependency-pinning.md`; for PRs read `.agents/rules/pr-description-workflow.md`. For Python string enums read `.agents/rules/strenum-string-enums.md` and `docs/string-enums.md`.

Expand All @@ -12,11 +12,11 @@ If graphify is installed and a graph exists, it may help explore the repository;

## Repository review focus

This repository is an organization-wide standards and template bundle, not an installable application: there is no root `pyproject.toml`. Consumers render the Copier template (`copier.yml`, `template/`) and call the reusable workflows in `.github/workflows/`.
This repository is an organization-wide standards and template bundle, not an installable application: there is no root `pyproject.toml`. Consumers render the Copier template (`copier.yml`, `template/`), whose `ci.yml` calls the reusable workflows of github-workflows.

- Pinning: workflow `uses:` lines and documented examples use release tags (`@vX.Y.Z`) or commit SHAs, never long-lived `@main`.
- Consumer guidance: changes to `template/` stay consistent with `docs/development.md`, `docs/reusable-workflows.md` and `README.md`.
- Reusable workflow contract: `.github/workflows/reusable-pre-commit.yml` is a public API; input renames, default changes or step removals are breaking unless documented in `CHANGELOG.md`.
- Validate: `copier copy --vcs-ref HEAD . "$TMPDIR/demo" --defaults --data package_name=demo && cd "$TMPDIR/demo" && git init -q && git add -A && pre-commit run --all-files`.
- Python policy follows `docs/string-enums.md` (`StrEnum`, not `(str, Enum)`), `template/baselines/ruff.toml` (`UP` selected) and strict mypy plus pytest-cov in `template/pyproject.toml.jinja`; tools and pre-commit `rev:` stay pinned.
- CI contract: `scripts/check.sh` targets and the job ids of the template `ci.yml` are public API; changing them is breaking and documented in `docs/migration-guide.md`.
- Validate: `copier copy --vcs-ref HEAD . "$TMPDIR/demo" --defaults --data package_name=demo && cd "$TMPDIR/demo" && git init -q && uv lock && git add -A && bash scripts/check.sh lint`.
- Python policy follows `docs/string-enums.md` (`StrEnum`, not `(str, Enum)`), `template/baselines/ruff.toml` (`UP` selected) and strict mypy plus pytest-cov in `template/pyproject.toml.jinja`; tools and remote pre-commit `rev:` stay pinned.
- `README.md` and `docs/development.md` are the source of truth.
Loading
Loading