01 - Fill a large pot with water and season generously with salt. Bring to a rolling boil, add spaghetti, and cook until al dente following package directions. Reserve 1 cup of cooking water, then drain using a colander.
02 - Heat unsalted butter in a large skillet over medium heat. Add chopped onion and cook for 3 minutes until tender. Stir in minced garlic and sauté for 1 minute until aromatic.
03 - Add quartered artichoke hearts to the skillet and cook for 2 minutes. Incorporate spinach and continue stirring until completely wilted, about 2 minutes.
04 - Lower the heat to low. Add softened cream cheese and heavy cream, stirring constantly until the cream cheese melts and the sauce achieves a smooth texture.
05 - Blend in grated Parmesan and shredded mozzarella, mixing until fully melted and the sauce is uniform. Season with salt, black pepper, and crushed red pepper flakes according to taste.
06 - Add cooked spaghetti directly to the skillet, tossing well to coat each strand. Gradually add reserved pasta water, as needed, to adjust the sauce consistency for a silky finish.
07 - Transfer spaghetti to serving bowls or plates. Garnish with freshly chopped parsley and extra Parmesan if desired. Serve immediately.