Place the mussels and/or clams in a saucepan and pour in the wine. Cover tightly and cook over a high heat for a few minutes, shaking the pan occasionally until all the shellfish have opened - discard any that do not.
Strain through a sieve reserving 2/3 cup of the cooking water - not the bottom part where the grit is. Remove the meat from the shells and reserve.
Meanwhile cook the spaghetti according to pack instructions until al dente.
While the spaghetti is cooking heat the oil in a heavy based frying pan, add the garlic and chili and saute for 20 secs. Tip in the shrimp and saute for a further minute.
Pour in the tomato sauce and the reserved cooking liquor. Bring to a gentle simmer, then stir in the cooked shellfish, basil and parsley. Season to taste and allow to just warm through.
When the pasta is cooked, drain and return to the pan. Pour in the seafood sauce and fold together until well combined. Serve at once.