From a45deea697cbabddf9681fb3fbdaa2c155c74477 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Mon, 18 May 2026 19:18:28 -0700 Subject: [PATCH] Add AGENTS.md to template and project --- AGENTS.md | 8 ++++++++ template/AGENTS.md.jinja | 9 +++++++++ tests/__snapshots__/test_agents.ambr | 14 ++++++++++++++ tests/test_agents.py | 13 +++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 AGENTS.md create mode 100644 template/AGENTS.md.jinja create mode 100644 tests/__snapshots__/test_agents.ambr create mode 100644 tests/test_agents.py diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..825990a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,8 @@ +# Environment/Tools + +* Python project with `uv`, use `uv add`/`uv run python` instead of bare `pip`/`python` +* `poe setup`: One-time after-clone setup (dependencies, install pre-commit hooks). +* `poe lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty) +* `poe test`: Run tests (accepts pytest arguments) +* `poe lt`: Lint+test (no arguments) +* `poe snapup`: Update test snapshots (syrupy, accepts pytest arguments) diff --git a/template/AGENTS.md.jinja b/template/AGENTS.md.jinja new file mode 100644 index 0000000..f5c4e14 --- /dev/null +++ b/template/AGENTS.md.jinja @@ -0,0 +1,9 @@ +# Environment/Tools + +* Python project with `uv`, use `uv add`/`uv run python` instead of bare `pip`/`python` +* `poe setup`: One-time after-clone setup (dependencies, install pre-commit hooks). +* `poe lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty) +* `poe test`: Run tests (accepts pytest arguments) +* `poe lt`: Lint+test (no arguments) +* `poe snapup`: Update test snapshots (syrupy, accepts pytest arguments) +{#- vim: set ft=markdown: #} diff --git a/tests/__snapshots__/test_agents.ambr b/tests/__snapshots__/test_agents.ambr new file mode 100644 index 0000000..89bbd03 --- /dev/null +++ b/tests/__snapshots__/test_agents.ambr @@ -0,0 +1,14 @@ +# serializer version: 1 +# name: test_agents + ''' + # Environment/Tools + + * Python project with `uv`, use `uv add`/`uv run python` instead of bare `pip`/`python` + * `poe setup`: One-time after-clone setup (dependencies, install pre-commit hooks). + * `poe lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty) + * `poe test`: Run tests (accepts pytest arguments) + * `poe lt`: Lint+test (no arguments) + * `poe snapup`: Update test snapshots (syrupy, accepts pytest arguments) + + ''' +# --- diff --git a/tests/test_agents.py b/tests/test_agents.py new file mode 100644 index 0000000..a868c75 --- /dev/null +++ b/tests/test_agents.py @@ -0,0 +1,13 @@ +"""Snapshot tests for AGENTS.md template.""" + +from collections.abc import Callable +from pathlib import Path + +from syrupy.assertion import SnapshotAssertion + + +def test_agents( + render_template: Callable[..., Path], snapshot: SnapshotAssertion +) -> None: + rendered = render_template() + assert (rendered / "AGENTS.md").read_text() == snapshot