Heat the oil in a frying pan. Briefly sauté the garlic and onion, add the squash and cook briefly. Pour in the water, season with salt, reduce the heat, cover and simmer the squash for approx. 20 mins. until soft. Add the cream cheese, puree the squash until smooth.
Cook the spaghetti in boiling salted water until just al dente. Set aside approx. 1 dl of the cooking water, drain the spaghetti. Transfer the squash puree to the same pan, add the reserved cooking water and stir until smooth. Add the spaghetti and chilli flakes, mix well.