Meanwhile, heat the oil in large sautee pan over a medium heat. Add the onion and cook, stirring often, until translucent but not browned, about 7 minutes. Stir in the garlic and cook for a further minute.
When the pasta is cooked, reserve 1 cup of the cooking water and drain.
Add ½ cup of the pasta cooking water to the pan of onions, and stir in the goat’s cheese. Heat, stirring often, for 2 minutes until the cheese melts. Add more of the pasta cooking water if necessary to create a sauce.
Stir in the pasta and the spinach and heat until it wilts. Season with salt and pepper.
Serve topped with the parmesan cheese, basil and chili flakes.