Preheat oven to 350°F. Line 2 baking sheets with parchment paper.
Whisk flour, baking powder, baking soda, salt, cinnamon, ginger, and nutmeg in a medium bowl.
In a large bowl, beat softened butter, granulated sugar, and brown sugar until light and fluffy, about 2 minutes.
Beat in egg, pumpkin puree, and vanilla until smooth.
Add dry ingredients to wet and mix on low just until combined. Fold in pecans if using.
Scoop dough in 1.5 tablespoon portions onto sheets, spacing about 2 inches apart.
Bake 12 to 14 minutes until edges are set and tops look dry. Cool on sheets 5 minutes, then transfer to a rack to cool completely.
For the caramel frosting: Melt butter in a saucepan over medium heat. Stir in brown sugar and cook, stirring, until bubbling; simmer 2 minutes.
Whisk in milk and salt; bring back to a gentle simmer for 1 minute, then remove from heat and cool 5 minutes.
Whisk in vanilla, then gradually beat in powdered sugar until smooth and spreadable. If too thick, add a splash of milk; if too thin, add more powdered sugar.
Frost cooled cookies. Let set 20 minutes before serving. Optionally garnish with extra chopped pecans or flaky salt.
Notes
For the softest texture, do not overbake. The frosting sets as it cools—work quickly or keep it spreadable by whisking in a teaspoon of warm milk as needed.