This Seeking Tech guide will explain how you can beat Djinny in Astro Bot. Use the following video as a reference:
In order to dodge the electric skulls, you need to move to the left or right without stopping. You can use your rocket power-up if necessary. Afterwards, use the rocket to knock the golden skull back at the genie.
You then need to quickly defeat the four spike enemies before shifting your attention to dodging the electric skulls again. Make sure you give yourself some distance to make it easier for you to sidestep. Next, send the golden skull back to the genie to end the second phase.
For the final section, try to take care of the electric enemies quickly and then prepare to dodge more electric skulls. Afterwards, knock the golden skull back to the genie to end the fight.