Heat oven to 220C/200C fan/gas 7. Heat the oil in a medium frying pan (ovenproof if you have one) over a medium heat. Add the onion and cook for 3 mins until starting to soften.
Add the garlic, chilli flakes and chorizo, and fry for another 2 mins before adding the butter beans and a generous pinch of salt. Stir to combine, then cook for 2 mins more. Add the spinach and a splash of water and stir until wilted. Remove from the heat.
If your pan isn’t ovenproof, tip the mixture into a medium casserole dish. Make four dips in the mixture with the back of a tablespoon and crack the eggs into each hole. Sprinkle with salt and freshly ground pepper (and extra chilli, if you like), then bake for 5-6 mins until the egg whites are set and the yolk is still runny. Serve with a scattering of chopped coriander, if you like.