Skip to content

Import AGENTS.md from CLAUDE.md and use pixi in the agent instructions - #11774

Merged
headtr1ck merged 6 commits into
pydata:mainfrom
headtr1ck:agents-md-claude-import
Oct 21, 2026
Merged

headtr1ck merged 6 commits into
pydata:mainfrom
headtr1ck:agents-md-claude-import

Conversation

@headtr1ck

@headtr1ck headtr1ck commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #11753: agents still ignore AGENTS.md, e.g. asking for reruns of the flaky job in #11766.

  • Add a root CLAUDE.md that imports AGENTS.md: Claude Code before v2.1.277 doesn't read AGENTS.md, and newer versions skip it if there is a CLAUDE.md in a parent directory or a CLAUDE.local.md.
  • Move the test guidelines to xarray/tests/AGENTS.md so that other agents read them too, with xarray/tests/CLAUDE.md importing it, and reference them from AGENTS.md.
  • Test guidelines: prefer parametrizing with the use_dask fixture or pytest.param(..., marks=requires_*) over separate tests, which avoids duplicate code and checks that numpy and dask give the same result. Mention that shared fixtures are in xarray/tests/conftest.py, drop the "Common patterns" section (it contradicted this and used a function that doesn't exist) and update the CI environment names.
  • Replace the pytest.importorskip examples in the test guidelines: tests should be skipped at collection time with the requires_* decorators.
  • Ask agents to always add type hints, and add them to the examples in the test guidelines.
  • Use the pixi environments of the CI instead of uv for running tests and mypy, and pixi exec pre-commit (the pre-commit pixi task always succeeds).

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude Code with Opus 5.5

🤖 Generated with Claude Code

headtr1ck and others added 6 commits October 21, 2026 08:33
Claude Code before v2.1.277 doesn't read AGENTS.md, and newer versions skip it
when a CLAUDE.md exists in a parent directory. A CLAUDE.md that imports
AGENTS.md works in both cases. The test guidelines move to xarray/tests/AGENTS.md,
so that other agents read them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@headtr1ck

Copy link
Copy Markdown
Collaborator Author

@dcherian I noticed that you seem to be against parametrizing tests e.g. for with and without dask (as per your previous instructions in the agents file).
Is there a reason for it?
I find that this would just duplicate code for basically no benefit.

Is the approach with using the use_dask fixture ok for you?

@dcherian

Copy link
Copy Markdown
Contributor

Uhh... i withdraw that objection. I prefer not doing the has_dask stuff, can be hard to see at a first glance (I think that's what prompted that edit to CLAUDE.md). I think the parametrize is OK.

@headtr1ck headtr1ck added the plan to merge Final call for comments label Oct 21, 2026
@headtr1ck
headtr1ck merged commit 040b040 into pydata:main Oct 21, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to merge Final call for comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants