Heat oven to 400 degrees. Poke sweet potatoes with a knife a couple times then place directly onto oven rack. Cook for 40-45 minutes until soft. Remove and let cool.
In a large skillet, sauté onion and garlic in olive oil, stirring for about 1 minute. Add spinach and cook for about 5-7 minutes until onion is translucent and spinach is soft.
Once sweet potatoes are cool, cut lengthwise then scoop out the middle of the sweet potato. I used a knife to cut about 1/4 inch away from the skin all the way around then I cut the middle into three pieces. This makes it easier to remove the middle without breaking the skin.
Mash sweet potato into skillet. If it is a little undercooked, cover and cook for 10 more minutes.
Stir in salt and pepper. Place sweet potatoes on a parchment lined baking sheet.
Scoop mash into potato shells then create a large divot for the egg. You will want to make sure the divot is big enough to fit the egg.
Break one egg into each divot. Cook for 15 minutes or until yoke is set.