Simply batter holders for spring/plates like this https://www.aliexpress.com/item/1005002547394834.html . It is customisable for batteries AA and AAA. Or you can download openscad and play with other parameters.
BatteryHolders.scad | 2.1KB | |
BatteryHolders_3xAA.stl | 26.6KB | |
BatteryHolders_3xAAA.stl | 27.8KB | |
BatteryHolders_4xAAA.stl | 36.6KB |