Preheat the oven to 350°F (175°C).
Line a baking tray with parchment paper.
In a large bowl, combine oats, flour, cinnamon, nutmeg, baking powder, and salt.
In another bowl, whisk together mashed sweet potato, egg, maple syrup, melted coconut oil, and vanilla.
Pour the wet ingredients into the dry ingredients.
Mix until a soft cookie dough forms.
Fold in the nuts and raisins if using.
Scoop about 2 tablespoons of dough onto the prepared baking tray.
Flatten each cookie slightly with the back of a spoon.
Bake for 16–18 minutes or until the edges are lightly golden.
Cool on the baking tray for 5 minutes.
Transfer to a wire rack and cool completely before serving.