Bring a pot of salted water to a boil and cook the pasta according to package directions. It is totally up to you if you want your pasta "al dente" or on the softer side. Drain and set aside. Make sure to reserve 1 cup of pasta cooking water to thin down the sauce later in the recipe.
While the pasta is cooking, add the olive oil to a saucepan and heat over a medium heat until the oil starts to shimmer. Add the onions and ½ teaspoon of salt and sauté until softened. Once the onions are translucent, add the minced garlic and cook until fragrant. This should only take 30-60 seconds.
Next, add the cooked pasta, peas and reserved pasta water to the saucepan and toss to coat.Add the egg yolks, grated parmesan cheese, lemon juice and zest to the pan. Use tongs to toss the pasta so that the egg yolk combines with the liquid and turns into a smooth creamy sauce.
Place the spinach on top of the pasta in the saucepan and put a lid on to capture steam. This will wilt the spinach and should only take about 3 minutes.
Give the pasta a stir and season with salt, pepper and cracked red pepper flakes (optional).
Store leftovers in the fridge for up to 2 days. Leftovers can be enjoyed cold right out of the fridge or reheated in a saucepan. If reheating, add about a ¼ cup of water to help loosen the sauce.