jmvs

AGENTS.md

Guidance for AI coding agents and contributors working on JMVS, a RasMol-like 3D molecular viewer in Java. It was modernised from a legacy Java3D app to a libGDX app (docs/modernisation.md); see docs/roadmap.md for planned features, and docs/README.md for the architecture docs.

Repository map

Path Contents
jmvs-core/ Structure model, element table, covalent bonding, mmCIF readers (ciftools-java)
jmvs-scene/ Renderer-neutral scene data, display modes, colour schemes, registry, jmvs.properties
jmvs-render-gdx/ libGDX renderer, shaders, orbit camera, screen picking
jmvs-app/ Launcher, controller, Scene2D/VisUI UI, packaging (jpackage task)
legacy-app/ Legacy Java3D application, archived as a standalone build (not part of the root build or CI)
build-logic/ jmvs.java-conventions plugin (Java 25 toolchain, JUnit, -Werror)
gradle/libs.versions.toml, gradle/verification-metadata.xml Dependency versions and checksums
LEGACY.md Project history since 1999 and screenshots comparing the app with the 2022 Java3D version
data/ Sample structures used by tests and for trying the viewer; see data/README.md for why each is there
docs/arc42/, docs/adr/ To-be architecture and decisions
docs/arc42/legacy/, docs/adr/legacy/ As-is documentation of the legacy app

Build, run, test

Any JDK 17–27 can run Gradle; toolchains download JDK 25 (and JDK 11 for the standalone legacy-app build).

./gradlew build                                    # compile and test everything
./gradlew :jmvs-core:test                          # one module's tests
./gradlew :jmvs-app:run --args="data/1crn.cif"     # run the new app (optionally with a file)
./gradlew -p legacy-app run                        # run the archived legacy app (macOS only)
./gradlew :jmvs-app:jpackage                       # native installer in jmvs-app/build/jpackage/
./gradlew --write-verification-metadata sha256 help   # after changing dependencies (use an empty GRADLE_USER_HOME
                                                      # and --no-configuration-cache so CI-only artifacts are included)

Visual and performance checks (render once to a PNG, or rotate and log the frame rate):

./gradlew :jmvs-app:installDist
jmvs-app/build/install/jmvs/bin/jmvs data/1usc.cif --mode ribbons --scheme structure --screenshot /tmp/1usc.png
jmvs-app/build/install/jmvs/bin/jmvs data/1zpd.cif --mode balls --benchmark 5
jmvs-app/build/install/jmvs/bin/jmvs data/4hhb.cif --mode ribbons --scheme chain --surface ses --surface-opacity 0.5 --screenshot /tmp/4hhb.png
jmvs-app/build/install/jmvs/bin/jmvs data/5me2.cif data/emd_3488.map.gz --mode sticks --scheme chain --contour 0.09 --map-style mesh --screenshot /tmp/5me2.png

Mode ids: balls, sticks, ballsandsticks, ribbons, cartoon. Scheme ids: cpk, chain, group, structure, bfactor, confidence. Surface ids: ses, sas. Secondary structure sources (--ss): auto, file, computed. Density map styles (--map-style): surface, mesh; --contour takes a level or <n>sigma.

Architecture rules

Code conventions

Testing

Dependencies

Documentation