Cook your pasta in salted water until al dente. Before draining, reserve 1 cup of the pasta water.
While the pasta cooks, heat a large pan over medium-high heat and add the diced bacon. Cook until crispy and the fat has rendered. Pour off excess bacon fat, leaving about 1 tablespoon in the pan.
In the same pan, add the garlic, rosemary, and onion. Take a second to enjoy that amazing aroma. After about 30 seconds, stir in the mushrooms and spinach.
Add the cooked pasta to the pan and toss to combine. Pour in ¾ cup of the reserved pasta water and stir well. Let it cook for about 3 minutes, then turn off the heat.
With the pan off the heat, pour in the scrambled egg. Use a wooden spoon or tongs to quickly toss the pasta, letting the residual heat gently cook the egg. Keep stirring for about a minute until the sauce is silky and coats the pasta.
Finish by adding black pepper, chili flakes, and parmesan. Give it a taste, then season with salt if needed. Plate it up and enjoy!