Skip to content

[WIP] Add AGENTS.md and CLAUDE.md agent-instruction files#3087

Draft
sloede wants to merge 7 commits into
mainfrom
msl/add-agent-instructions
Draft

[WIP] Add AGENTS.md and CLAUDE.md agent-instruction files#3087
sloede wants to merge 7 commits into
mainfrom
msl/add-agent-instructions

Conversation

@sloede

@sloede sloede commented Jun 16, 2026

Copy link
Copy Markdown
Member

Shared agent-instruction files for AI coding tools.

  • AGENTS.md — canonical, cross-tool source of truth (Codex, Cursor, Gemini CLI, Aider, …). Summarizes build/test/format, layout, architecture, conventions, and contribution norms from docs/src/.
  • CLAUDE.md — thin bridge for Claude Code via @AGENTS.md import (so /code-review inherits the same conventions).

🤖 Generated with Claude Code

Add a canonical AGENTS.md (read by Codex/Cursor/Gemini CLI/Aider) with
build/test/format commands, repository layout, a high-level architecture
overview, code conventions, type-stability rules, and contribution norms,
seeded from docs/src/ and the review checklist. CLAUDE.md bridges Claude
Code to it via the @AGENTS.md import plus Claude-specific notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@JoshuaLampert JoshuaLampert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Since I also just wrote a CLAUDE.md today for another project, I have a suggestion regarding how the agent should run julia code or tests.

Comment thread AGENTS.md Outdated
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.88%. Comparing base (b6b173e) to head (64dbaf6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3087   +/-   ##
=======================================
  Coverage   96.88%   96.88%           
=======================================
  Files         647      647           
  Lines       50026    50026           
=======================================
  Hits        48466    48466           
  Misses       1560     1560           
Flag Coverage Δ
unittests 96.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

@JoshuaLampert JoshuaLampert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few suggestions regarding how agents could effectively run julia code.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com>
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
@sloede sloede requested review from JoshuaLampert and ranocha June 17, 2026 07:23
@sloede

sloede commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

@JoshuaLampert @ranocha If the PR looks good from your side, how shall we proceed? I tested this locally once and it gave me some good first results on initial tests, but I feel like there's still some fine-tuning necessary. On the other hand, if it only lives in this PR, nobody is going to test drive it under real-world conditions. Maybe just merge and invite everyone who uses such tools to test the files and continue to refine them?

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
sloede and others added 2 commits June 17, 2026 10:21
Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com>
@sloede sloede requested a review from JoshuaLampert June 17, 2026 09:01

@JoshuaLampert JoshuaLampert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JoshuaLampert

JoshuaLampert commented Jun 18, 2026

Copy link
Copy Markdown
Member

We discussed that it could help to switch to TestItems.jl instead of the normal test framework of Test.jl. This would have the advantage that each @testitem (replacing @testset or @trixi_testset) can be run individually. Especially in VSCode it is nice because you can use the UI from VSCode to interact with the tests. This would also allow an agent to run only single @testitems, e.g., for computing and pasting l2 and linf errors. I use this in another repo using TestItems.jl and the workflow with the AI using a persistent julia session and explicit instructions in CLAUDE.md was pretty smooth so far. One disadvantage of the testitem workflow is that nested testsets/testitems are not supported. We would need to see if this restricts us.
Converting our current setup would also be a good job an AI agent could do. What do you think of this, @sloede?
If you want to see examples of packages using TestItems.jl, which have a similar (in the sense that most tests run some example using @test_trixi_include) test setup as Trixi.jl (although of course simpler) here are two examples: DispersiveShallowWater.jl and KernelInterpolation.jl.

@sloede

sloede commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

We discussed that it could help to switch to TestItems.jl [...]

Let's move this - at least somewhat - orthogonal discussion to #3092?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants