📝 docs: add agent skills, AGENTS.md, and a doc-sync rule - #758
Merged
nstarman merged 3 commits intoAug 19, 2026
Merged
Conversation
Three agent-facing documents, layered so each fact has one home: - `skills/coordinax/SKILL.md` — using and extending coordinax from outside the repo: the chart/representation/vector/manifold layering, the tangent anchor and `coord_basis` vs `phys_basis` rules, `==` vs `equivalent`, deliberate `Distance`/`Angle` degradation, the static-chart performance rule, a troubleshooting table, and a version-notes rename table. - `AGENTS.md` — working inside the repo: spec authority, workspace layout, commands, the conventions that bite, the pitfalls drawn from the landed bug history, and the testing contract. - `.github/skills/code-review/SKILL.md` — reviewing a change, organised around the two properties that generate most defects here: a missing route composes rather than failing, and scalar-first code meets batched callers. Each cites the others rather than restating them; `docs/spec.md` stays authoritative and is cross-linked, not duplicated. Both `AGENTS.md` and the review skill carry a doc-sync rule: a change that alters public semantics, adds a hazard, or invalidates an example is not done until these files match it. GalacticDynamics#733 is the motivating precedent — 17 examples in `docs/spec.md` had gone stale because nothing forced the update. The skill's examples are tests. `skills/` joins `testpaths` and the `coordinax` nox package paths, so Sybil executes all 49 `pycon` blocks under `nox -s test` and in CI. Three outputs written from memory were wrong and this caught them. `.github/copilot-instructions.md` becomes a pointer to `AGENTS.md`; Copilot reads both, and two long files would diverge. Everything load-bearing moved across, including the workspace-package versioning template and the pre-submit checklist. `/AGENTS.md` is dropped from `.gitignore`, where it had reserved a slot for an untracked local file. The tracked file is now the canonical one, matching quax, quaxed, and quax-blocks.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a layered set of agent-facing documentation for the Coordinax workspace (usage skill, in-repo agent instructions, and a code-review skill), and wires the new skills/ docs into the test/lint surface so examples are continuously validated in CI.
Changes:
- Add
skills/coordinax/SKILL.md,AGENTS.md, and.github/skills/code-review/SKILL.md, with cross-references to avoid duplicated “source of truth” content. - Include
skills/in pytest collection and in thecoordinaxpackage path set used by nox sessions. - Replace the large
.github/copilot-instructions.mdwith a short pointer toAGENTS.md, and stop ignoring/AGENTS.md.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
skills/coordinax/SKILL.md |
New user-facing “how to use Coordinax” skill with tested pycon examples and troubleshooting/version notes. |
AGENTS.md |
New canonical in-repo agent instructions (spec authority, commands, conventions, pitfalls, doc-sync rule). |
.github/skills/code-review/SKILL.md |
New code-review checklist skill focused on coordinax-specific defect patterns and review scope. |
pyproject.toml |
Add skills/ to testpaths so skill examples are collected under pytest/Sybil. |
noxfile.py |
Include skills/ in PackageEnum.coordinax paths so package-scoped pytest runs cover the skill docs. |
.github/copilot-instructions.md |
Reduce to a pointer to AGENTS.md + the review skill to prevent divergence. |
.gitignore |
Stop ignoring /AGENTS.md so the tracked canonical file is used. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #758 +/- ##
==========================================
+ Coverage 96.62% 96.63% +0.01%
==========================================
Files 267 267
Lines 9034 9064 +30
==========================================
+ Hits 8729 8759 +30
Misses 305 305 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A self-review found the same facts stated in two files, PR citations and all — two copies that would diverge on the first update. - `AGENTS.md` "Pitfalls" duplicated five sections of the review skill, including the identical PR lists. Now a pointer naming that file as the single source of truth for the defect classes. - The 35-line workspace-package TOML template is one line: copy `packages/coordinaxs.hypothesis/pyproject.toml` and substitute the name. - "Before you submit" restated six items already on the same page. The one item that was not — roles obey affine vs tangent semantics — moves into Conventions, along with the one-sentence scratch-file rule that had its own section. - The review skill's "Repo conventions" and its doctest/Hypothesis bullets restated `AGENTS.md`; both now defer to it. Also corrects a claim in `AGENTS.md`: the fence convention describes files pytest collects, and `AGENTS.md` is not one of them. AGENTS.md 157 -> 108, the review skill 143 -> 138. No content lost, only second copies.
`.github/skills/<name>/SKILL.md` is GitHub's agent-skill location, and Copilot code review has consumed agent skills since they went GA. But a SKILL.md needs YAML frontmatter with `name` and `description`, and the description is what Copilot matches on to decide whether to load the skill at all. Without it the file is inert — it sits in the right directory and is never read. The sibling `gitmoji-commit` skill already has frontmatter; this one was modelled on the quax and quaxed code-review skills, which omit it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nstarman
added a commit
that referenced
this pull request
Aug 20, 2026
…iners (#775) `main` is red, and every open PR with it. #752 made `pt_map` return `Angle` for angular components rather than `Quantity` -- the point of that change -- but the `SKILL.md` doctest was written against the old behaviour and not updated: Expected {'r': Q(...), 'theta': Q(...), 'phi': Q(...)} Got {'r': Q(...), 'theta': Angle(...), 'phi': Angle(...)} `skills/` is in `testpaths`, so this fails the whole matrix on every branch that has #752 in its ancestry, which is now all of them. It is unrelated to whatever those branches touch. Mine to have caught. #752's doctest sweep ran over `src/`, `packages/`, `README.md` and `docs/`, and `skills/` was not in that list -- it arrived in #758, which merged after that branch's last full run and before #752 did, so no run on the branch ever saw the file. A sweep enumerated by hand missed a testpath the config already knew about; it should have read `testpaths`. Checked the rest of `skills/` for the same pattern rather than fixing only the reported line; that was the only occurrence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the three agent-facing documents, modelled on the
quax/quaxed/quax-blocksset, and wires the skill's examples into CI so they cannot rot.The layering
Each fact gets one home, and the files cite each other rather than restating:
skills/coordinax/SKILL.mdThe chart / representation / vector / manifold layering, framed around the
one idea that unlocks the library: a chart is not a representation, so
pt_map(dicts, chart-only) andcconvert(vectors, representation-aware)are not interchangeable. Then the things that cost real time:
coord_basisvsphys_basisdiffer by thechart's scale factors — with a worked example showing
1 rad/sbecome2 m/satr = 2 m==is strict on chart and frame;equivalentis the geometric relationDistance/Angledegradation to plainQuantityis deliberateregister_static; close over them, and keep pytrees off thejit boundary
geodesic_distancevschord_distance, and thelorentziangatereproduced
separation→geodesic_distance,prolong→act_jet,Parametric→TimeDep,materialize_transform→evaluate_at, thegroups/buildersnamespaces,
quantity_matrixremoved)AGENTS.mdDistilled from
.github/copilot-instructions.mdrather than copied. Keepsspec authority, the workspace table, commands, abstract-final, no
from __future__ import annotations, never parametrising a generic in adispatched signature, operators via
quax.register, scalar-first, and thenew-package versioning template. Adds a Pitfalls section the old file
lacked — batch safety, routes composing instead of failing,
eqx.error_ifunder jit, plum cache regressions — each citing the PRs it came from.
.github/skills/code-review/SKILL.mdOrganised around the two properties that generate most defects here:
number, not an exception (🐛 fix(charts): route Cart3D → ProlateSpheroidal3D via Cylindrical3D (stop recursion) #593, 🐛 fix(charts): convert between non-canonical two-sphere charts via canonical #594).
in the log (🐛 fix(charts): read CartND components on the last axis, not the batch axis #590, 🐛 fix(manifolds): make analytic curvilinear metric_matrix batch-safe #591, 🐛 fix(manifolds): make DiagonalMetric.to_dense and the product metric batch-safe #613, 🐛 fix(manifolds): make the hyperspherical round metric batch-safe #618, 🐛 fix(manifolds): batch-safe two-sphere pullback metric; pin the pole behaviour #621, 🐛 fix(vectors): batch indexing crashes on broadcastable-but-unequal shapes #653, 🐛 fix(manifolds): round-metric
scale_factorson S¹ and on a batch #751), and one every scalartest passes through.
Plus a scope section (leave ruff/
ty/prettier tonox -s lint; no genericsecurity checklist) and a what changed → what to check path table.
Keeping them current
Both
AGENTS.mdand the review skill carry a doc-sync rule: a change thatalters public semantics, adds a hazard, or invalidates an example is not done
until these files match it, with a table mapping change → file. The review
skill flags the omission from the other side.
#733 is the precedent that motivates it — 17 examples in
docs/spec.mdhadgone stale purely because nothing forced the update.
The examples are tests
skills/joins[tool.pytest.ini_options] testpathsand thecoordinaxPackageEnumpaths innoxfile.py, so Sybil executes all 49 ```pycon blocksunder
nox -s testand in CI. Confirmed collected: 10,981 tests total, 49 ofthem from the skill.
This earns its keep immediately — three outputs I wrote from memory were
wrong and the first run caught all three.
Two decisions worth a look
.github/copilot-instructions.mdbecomes an 8-line pointer (-674).Copilot reads
AGENTS.mdtoo, and two ~700-line files would diverge withina month. Everything load-bearing moved across; I checked specifically for
the workspace-package versioning template, the scratch-file rule, and the
agent checklist, which are all now in
AGENTS.md./AGENTS.mdis dropped from.gitignore, where it sat under# Local agentsreserving a slot for an untracked local file. The trackedfile is now canonical, matching quax / quaxed / quax-blocks. Anyone with a
local untracked
AGENTS.mdwill want to move it aside.Verification
pytest skills/— 49 passedpytest --collect-only— 10,981 collected, no collection errorsprek run --files ...— all hooks pass on every touched fileupstream/main(c29dad6), and the skill's version notesand examples were re-checked against it —
separation→geodesic_distance(💥 refactor(manifolds):
separationbecomesgeodesic_distance, and a real metric #715) and thelorentziannamespace (♻️ refactor(manifolds): move the causal verbs to alorentziansub-namespace #696) are reflected.🤖 Generated with Claude Code