Skip to content

Commit 57b41d8

Browse files
authored
Merge pull request #91 from diffpy/docs/add-agents-md
docs: add AGENTS.md with contribution guidelines for AI agents
2 parents 69e6239 + f6a57c3 commit 57b41d8

2 files changed

Lines changed: 110 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# AGENTS.md — Guidelines for AI agents working on pyobjcryst
2+
3+
## Repository overview
4+
5+
`pyobjcryst` is a Python binding (via Boost.Python) of the ObjCryst++ C++
6+
library. It is built and maintained with
7+
[scikit-package](https://scikit-package.github.io/scikit-package/), which
8+
provides the release scripts, CI workflows, and changelog tooling used here.
9+
10+
The C++ bindings live under `src/extensions/`; pure-Python wrappers and
11+
utilities are in `src/pyobjcryst/`. Tests live in `tests/`.
12+
13+
## Dependency chain
14+
15+
```
16+
vincefn/objcryst ← real upstream (C++ library, GUI, Fox)
17+
↓
18+
diffpy/libobjcryst ← repackages ObjCryst++ as a shared library for conda/pip
19+
↓
20+
diffpy/pyobjcryst ← Python bindings (this repo)
21+
```
22+
23+
**Any C++ feature or fix must flow through the full chain before it can land
24+
here:**
25+
26+
1. Implement or fix it in [vincefn/objcryst](https://github.com/vincefn/objcryst).
27+
2. Pick it up in [diffpy/libobjcryst](https://github.com/diffpy/libobjcryst)
28+
(libobjcryst is a convenience repackaging — updating the vendored sources
29+
and cutting a release is usually all that is needed).
30+
3. Only then expose or rely on it in pyobjcryst.
31+
32+
If a PR here is blocked on an upstream change, note the upstream issue/PR in
33+
the description and news item.
34+
35+
## Branching and commits
36+
37+
- Always branch from `main`.
38+
- Use [Conventional Commits](https://www.conventionalcommits.org/) prefixes:
39+
`fix:`, `feat:`, `docs:`, `refactor:`, `test:`, `chore:`, etc.
40+
- Keep commits focused and atomic.
41+
- Make sure `git config user.email` is a verified address on the author's
42+
GitHub account so commits are attributed correctly.
43+
44+
## Coding standards
45+
46+
1. Where possible, make the code conform to Billinge group coding
47+
standards. These can be found in the documentation of
48+
[scikit-package](https://scikit-package.github.io/scikit-package/)
49+
50+
## Before opening a PR
51+
52+
1. **News item** — every PR that changes user-visible behaviour must add a
53+
file `news/<PR-number>.rst` following `news/TEMPLATE.rst` (sections:
54+
`Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`; leave
55+
unused sections as `* <news item>`).
56+
The `check-news-item` CI job (provided by scikit-package release scripts)
57+
enforces this.
58+
2. **Do not edit `CHANGELOG.rst` directly** — it is auto-generated from the
59+
`news/` items at release time by the scikit-package tooling.
60+
3. Run the test suite locally before pushing if possible: `pytest tests/`
61+
62+
## CI checks on PRs
63+
64+
| Workflow | Trigger | What it does |
65+
| ----------------- | -------- | --------------------------------------------------- |
66+
| `tests-on-pr` | every PR | Builds the C extension and runs the full test suite |
67+
| `check-news-item` | every PR | Verifies a `news/<PR-number>.rst` file exists |
68+
69+
Both workflows are provided by `scikit-package/release-scripts`.
70+
71+
## Merge policy — human review required
72+
73+
**PRs must never be auto-merged.** Every PR requires at least one human
74+
review and approval before merging, regardless of CI status.
75+
Do not use `gh pr merge --auto` or any equivalent automated merge on this
76+
repository.
77+
78+
## What agents should NOT do
79+
80+
- Do not force-push to `main`.
81+
- Do not bypass CI or skip the news-item requirement.
82+
- Do not merge PRs autonomously — always leave them open for human review.
83+
- Do not commit secrets, credentials, or large binary files.
84+
- Do not expose a new C++ feature in pyobjcryst before it is available in a
85+
released version of diffpy/libobjcryst.

‎news/91.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**Added:**
2+
3+
* Add ``AGENTS.md`` documenting contribution guidelines for AI coding agents
4+
(dependency chain, commit conventions, news-item policy, human-review
5+
requirement).
6+
7+
**Changed:**
8+
9+
* <news item>
10+
11+
**Deprecated:**
12+
13+
* <news item>
14+
15+
**Removed:**
16+
17+
* <news item>
18+
19+
**Fixed:**
20+
21+
* <news item>
22+
23+
**Security:**
24+
25+
* <news item>

0 commit comments

Comments
 (0)