Roast the potatoes for 45 minutes at 425°F or boil them in their jackets/skins until very tender, 25-30 minutes. Cool the potatoes completely. Remove the potatoes from their skins and pass through a ricer.
Arrange the riced potatoes on a large work surface with a well at the center. Place the yolks in the well along with the cheese. Season with salt, pepper and a little nutmeg. Work the eggs and cheese into the potatoes first, then sprinkle 2 cups of flour over the potatoes and work it into the potatoes. Work the spinach into the potatoes, if using. If the dough is sticky, sprinkle in a little more flour until firm enough to roll into ropes on a floured surface.
Cut into 1-inch pieces or pillows for basic dumplings or, use a gnocchi tool to roll and mark the dumplings. Transfer the gnocchi to a parchment-lined baking sheet.
Boil the gnocchi in salted water in two batches (don’t crowd the pot!) until they float and are cooked through. Remove with a spider to a warm bowl. Carefully drain the excess water from the bowl and serve with pomodoro sauce or pesto.