Separate Swiss chard leaves from stalks (or spinach from stems) and discard any damaged leaves. Wash the leaves in several changes of cold water until no grit remains.
Put the leaves in a pot with only the water that clings to them. Add generous pinches of salt, cover, and cook over medium heat until tender, about 12 minutes or so. Drain. When cool enough to handle, squeeze gently to remove as much moisture as possible, then chop very fine.
In a small saute pan, cook onion, prosciutto (or pancetta or ham), and butter over medium heat, stirring, until the onion turns translucent. Add the chopped greens and cook 2 to 3 minutes, until the butter is absorbed.
Turn the contents into a bowl. Add ricotta, egg yolk, grated Parmigiano-Reggiano, and a tiny grating of nutmeg (about 1/8 tsp). Mix until evenly combined. Taste and correct for salt.
Make yellow pasta dough by the machine method or hand-rolled method. Cut into 2-inch squares and stuff with the filling. When boiling, add 1 tbsp olive oil to the water.