I wanted a small snug end-cap for spare AAA batteries tossed in my bag, so I remixed my battery holder into a battery cap for AAA batteries. Then I scaled up to the other sizes.
The design is intentionally tight with low clearance, since to get a snug fit with rigid filament like PLA you need to post-process the surface and file down imperfections until it provides the desired fit. To do this with a AAA-sized hole, simply wrap some sand paper around a conveniently sized bolt, duct tape it on, and rotate it inside the cap. Much larger holes can be cleaned up with a sharp knife.
Flexible filament would probably work nicely also, but I have not tried it.
This works in Customizer. Batteries from different manufacturers differ slightly in size, and that might require adjustments to the dimensions.