Fusion Ritual
Source
Starfinder Enhanced pg. 101
In your hands, all firearms have magical potential. Once per day, by performing a ritual that takes 10 minutes, you can imbue one heavy weapon, longarm, or small arm with a special spellthrower weapon fusion that doesn’t count toward the maximum level of fusions the weapon can have. This fusion lasts for 24 hours and only functions when wielded by you.
Loading a spell gem into a weapon with this fusion takes a full action, but it otherwise functions as per the reload action, and your fusion can accept gems with spell levels of up to one-third the weapon’s item level (minimum 1). Once per day, you can cast the spell contained within the spell gem without expending it.
Dragonscript
ID
38c0691d5aae59635bf0a2b9