On the other hand, you have to be subtle enough with the foreshadowing so that when the character invents it, it looks clever. (Or maybe simple enough to see what everyone else missed through being too clever -- though not in this case).
Fortunately, this is not the climax of the story. Unfortunately, I think it's still going to need more work on how to show the spell can be developed.