Preheat the oven to 180 °C (350 °F).
In a large ovenproof skillet, heat a drizzle of olive oil on medium heat. Brown the duck legs for 2 to 3 minutes, skin side down. Turn the duck legs over and brown for 2 to 3 minutes. Set aside on a plate.
Using the same pan, sauté the onion for 1 to 2 minutes.
Add the red wine and simmer until the liquid has reduced by half.
Add the marinara sauce and, if desired, the rosemary. Bring to a boil.
Return the duck legs to the pan. Season with salt and pepper. Cover and transfer the pan to the oven, and cook for 1 hr 45 min to 2 hrs.
Add the kale and beans to the pan. Stir gently. Continue cooking for 15 to 18 minutes.
If desired, garnish with Parmesan shavings just before serving.