Heat a large skillet over medium heat. Add the pecans and toast, stirring often to avoid burning, for 6 minutes. Remove them from the skillet.
Heat the same skillet over medium-low heat. Add the oil, onion, and garlic. Cook, stirring occasionally, for 5 minutes, or until the onion begins to soften.
Add the squash, cover, and cook, stirring occasionally, for 20 to 30 minutes, or until tender but still holding its shape.
Add the cayenne and season to taste with salt and black pepper. Stir in half of the pecans, cranberries, parsley, and cheese, if using. Transfer to a serving bowl. Garnish with remaining pecans, cranberries, parsley, and cheese, if using