Repository navigation
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… AGENTS.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… agents Split usage from coding guidelines: src/struphy/agent_guides/ (USAGE.md and the setup-simulation and postprocess-simulation skills) is package data, so pip installs get the guide of their version. struphy agents prints it, --install copies the skills into a project and points its AGENTS.md/CLAUDE.md to it. The repo's .claude/skills link to the shipped copies. README and quickstart explain the workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ixes --install keeps skills that already link to the installed version, replaces other symlinks, and does nothing in the Struphy repository itself (whose .claude/skills link to the guides). examples_url falls back to devel when struphy is not installed. --path and --install are mutually exclusive. Tests for symlinks and the argparse wiring. Guide wording fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spossann
added a commit
that referenced
this pull request
Oct 19, 2026
…nd propagator Options template (#798) Closes #793, closes #794, closes #795. - **#793**: `struphy.api.models` now also exports `CurlCurl`, `ToyDrift` and `IncompressibleNavierStokesSPH` (the last one was missing too). A new test in `api/tests/test_public_api.py` parses `api/models/__init__.py` (without importing every model). It checks that `__all__` matches `struphy.models.__all__` and `_LAZY_IMPORTS`, and that each name is imported from its defining module. So a model that is missing from the hand-maintained api file now fails CI. - **#794**: the `StruphyModel` docstring no longer points to `fluid.py`/`kinetic.py`/... It now says one module per model, regenerate `struphy/models/__init__.py` with `struphy build-init-files`, and add the model by hand to `struphy/api/models/__init__.py`. - **#795**: the template `Propagator.Options` now declares `opt1: OptsTemplate = "implicit"`, the same pattern as the real propagators (e.g. `implicit_diffusion.py`). It used to be `opt1: str = ("implicit",)`. `check_option` accepts tuples on purpose (list-valued options), which is why the old default never failed. - **CI**: `src/struphy/api/tests/` was in no test shard, so its tests never ran in CI. It is now in shard-2 of `reusable-unit-testing.yml` and `reusable-scheduled.yml` and in `struphy test unit`. Its tests are marked `mpi_skip`, and the folder gets an `__init__.py` like the other test folders. Follow-up for #797: once this is merged, the line "Don't copy the template in `base.py` literally: its `opt1` default is a tuple." in `src/struphy/propagators/AGENTS.md` can be removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
spossann
added a commit
that referenced
this pull request
Oct 21, 2026
…e shipped with the package (struphy agents) (#797) Guidance for AI coding agents (Claude Code, Codex, Copilot, Cursor, ...), split into **coding guidelines** (for changing Struphy, repo only) and **usage guidelines** (for using Struphy, shipped with the pip package). ## Coding guidelines (repository only) - `AGENTS.md` at the root: repository layout, branches/PRs, code style, MPI rules (`maybempi`, collectives on all ranks), Pyccel kernel pitfalls, tests (CI shards, `mpi_skip`, rank counts), performance pitfalls, feectools submodule workflow. `CLAUDE.md` imports it (`@AGENTS.md`). - `src/struphy/models/AGENTS.md`: how to add a model (structure of `StruphyModel`, the 8 `doc_*` methods, `models-all.rst`, `build-init-files`, `api/models/__init__.py`, default-options tests, verification tests, examples). - `src/struphy/propagators/AGENTS.md`: how to add a propagator (`Variables`/`Options`/`allocate`/`__call__`, docstring, `propagators-avail.rst`, particle kernel folders, tests). - Each nested guide has a one-line `CLAUDE.md`, and the root `AGENTS.md` tells agents to read them before creating a model or propagator. ## Usage guidelines (shipped in the package) - `src/struphy/agent_guides/USAGE.md`: entry point (installation check, CLI, running with MPI, ground rules, docs links). - `src/struphy/agent_guides/skills/setup-simulation/` (moved from `.claude/skills/`, now independent of a source checkout) and the new `skills/postprocess-simulation/` (`Output` API). - Package data in `pyproject.toml`: only these files; the coding `AGENTS.md`/`CLAUDE.md` are not shipped (checked with a wheel build). - `.claude/skills/*` in the repo are relative symlinks to the shipped skills, so there is one copy. ## New command `struphy agents` - `struphy agents` prints the guide, the paths of the skills and the examples URL for the installed version. - `struphy agents --path` prints the folder of the guide. - `struphy agents --install [DIR]` copies the skills to `DIR/.claude/skills/` and adds a pointer to `DIR/AGENTS.md` and `DIR/CLAUDE.md`. It is idempotent: a second run refreshes the skills and leaves the pointers unchanged. It does nothing in the Struphy repository itself. - Tests in `console/tests/test_agents.py` (`mpi_skip`). README (`README.qmd` and `README.md`, edited by hand since they have diverged) and the quickstart (`doc/sections/quickstart.rst`) get a section on how to use the agent files. ## Notes for reviewers - `src/struphy/api/models/__init__.py` currently misses `CurlCurl` and `ToyDrift`, and the template `Options` in `propagators/base.py` has a tuple default (`opt1: str = ("implicit",)`). Both are left for a separate PR; the propagator guide tells agents not to copy the template. - The examples URL uses the release tag (`v3.4.0`), which lacks newer examples until the next release. - Symlinks in `.claude/skills/` need `core.symlinks` on Windows checkouts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
spossann
added a commit
that referenced
this pull request
Oct 21, 2026
…nd propagator Options template (#798) Closes #793, closes #794, closes #795. - **#793**: `struphy.api.models` now also exports `CurlCurl`, `ToyDrift` and `IncompressibleNavierStokesSPH` (the last one was missing too). A new test in `api/tests/test_public_api.py` parses `api/models/__init__.py` (without importing every model). It checks that `__all__` matches `struphy.models.__all__` and `_LAZY_IMPORTS`, and that each name is imported from its defining module. So a model that is missing from the hand-maintained api file now fails CI. - **#794**: the `StruphyModel` docstring no longer points to `fluid.py`/`kinetic.py`/... It now says one module per model, regenerate `struphy/models/__init__.py` with `struphy build-init-files`, and add the model by hand to `struphy/api/models/__init__.py`. - **#795**: the template `Propagator.Options` now declares `opt1: OptsTemplate = "implicit"`, the same pattern as the real propagators (e.g. `implicit_diffusion.py`). It used to be `opt1: str = ("implicit",)`. `check_option` accepts tuples on purpose (list-valued options), which is why the old default never failed. - **CI**: `src/struphy/api/tests/` was in no test shard, so its tests never ran in CI. It is now in shard-2 of `reusable-unit-testing.yml` and `reusable-scheduled.yml` and in `struphy test unit`. Its tests are marked `mpi_skip`, and the folder gets an `__init__.py` like the other test folders. Follow-up for #797: once this is merged, the line "Don't copy the template in `base.py` literally: its `opt1` default is a tuple." in `src/struphy/propagators/AGENTS.md` can be removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Guidance for AI coding agents (Claude Code, Codex, Copilot, Cursor, ...), split into coding guidelines (for changing Struphy, repo only) and usage guidelines (for using Struphy, shipped with the pip package).
Coding guidelines (repository only)
AGENTS.mdat the root: repository layout, branches/PRs, code style, MPI rules (maybempi, collectives on all ranks), Pyccel kernel pitfalls, tests (CI shards,mpi_skip, rank counts), performance pitfalls, feectools submodule workflow.CLAUDE.mdimports it (@AGENTS.md).src/struphy/models/AGENTS.md: how to add a model (structure ofStruphyModel, the 8doc_*methods,models-all.rst,build-init-files,api/models/__init__.py, default-options tests, verification tests, examples).src/struphy/propagators/AGENTS.md: how to add a propagator (Variables/Options/allocate/__call__, docstring,propagators-avail.rst, particle kernel folders, tests).CLAUDE.md, and the rootAGENTS.mdtells agents to read them before creating a model or propagator.Usage guidelines (shipped in the package)
src/struphy/agent_guides/USAGE.md: entry point (installation check, CLI, running with MPI, ground rules, docs links).src/struphy/agent_guides/skills/setup-simulation/(moved from.claude/skills/, now independent of a source checkout) and the newskills/postprocess-simulation/(OutputAPI).pyproject.toml: only these files; the codingAGENTS.md/CLAUDE.mdare not shipped (checked with a wheel build)..claude/skills/*in the repo are relative symlinks to the shipped skills, so there is one copy.New command
struphy agentsstruphy agentsprints the guide, the paths of the skills and the examples URL for the installed version.struphy agents --pathprints the folder of the guide.struphy agents --install [DIR]copies the skills toDIR/.claude/skills/and adds a pointer toDIR/AGENTS.mdandDIR/CLAUDE.md. It is idempotent: a second run refreshes the skills and leaves the pointers unchanged. It does nothing in the Struphy repository itself.console/tests/test_agents.py(mpi_skip).README (
README.qmdandREADME.md, edited by hand since they have diverged) and the quickstart (doc/sections/quickstart.rst) get a section on how to use the agent files.Notes for reviewers
src/struphy/api/models/__init__.pycurrently missesCurlCurlandToyDrift, and the templateOptionsinpropagators/base.pyhas a tuple default (opt1: str = ("implicit",)). Both are left for a separate PR; the propagator guide tells agents not to copy the template.v3.4.0), which lacks newer examples until the next release..claude/skills/needcore.symlinkson Windows checkouts.🤖 Generated with Claude Code