Begin by straining the ricotta. Line a sieve with a piece of muslin cloth (or j-cloth) and set over a bowl. Add the ricotta and leave to drain for around 1 hour in the fridge.
Meanwhile, make the sauce. Place the peeled onion halves in a pan with the tomatoes, a pinch of salt and the butter. Bring to a very low simmer, cook for 25 minutes, then remove and discard the onion halves. Taste and season with salt and pepper; use a hand blender to blend into a smooth sauce or keep it chunky. Reserve in the fridge to reheat later.
Wilt the spinach and wild garlic down with a pinch of salt in a wide pan to make the malfatti. Transfer to a sieve and allow to cool, then squeeze out as much water as possible from the leaves. Finely chop, then place in a mixing bowl with the rest of the ingredients (including the strained ricotta). Season with a pinch of salt and pepper, then mix well until everything is evenly incorporated.
Roll the mixture into neat 2cm balls using your hands, then place on a tray dusted with semolina and leave in the fridge uncovered to firm up for at least 30 minutes (or overnight).
When ready to serve, boil a large pan of salted water and gently reheat the tomato sauce. Drop the malfatti into the water and cook for around 3 minutes or until they float to the surface. Once cooked, drain and leave to steam-dry a little.
They are ready to eat, but you can also pan-fry them in butter or oil for a few minutes until lightly crisp. Divide the sauce between serving plates. Place the malfatti on top and finish with a crack of black pepper.