Preheat the oven: Preheat your oven to 350°F (175°C). Line an 8×8-inch baking pan with parchment paper, leaving some paper over the sides for easy removal.
Prepare the dry ingredients: In a large bowl, combine the rolled oats, flour, cinnamon, baking powder, and salt. Stir until evenly combined.
Mix the wet ingredients: In another bowl, whisk together the melted butter, brown sugar, egg, and vanilla extract until smooth.
Combine the mixtures: Pour the wet ingredients into the dry ingredients. Stir gently until the mixture is just combined.
Add the apples: Fold in the chopped apples. If using walnuts or pecans, fold them in at the same time.
Fill the pan: Transfer the mixture to the prepared baking pan. Spread it evenly and gently press it down with a spatula.
Bake: Bake for 30–35 minutes, or until the edges are lightly golden and the center is set.
Cool: Remove the pan from the oven and allow the bars to cool completely before cutting. This helps them firm up and makes slicing easier.
Slice and serve: Lift the bars from the pan using the parchment paper. Cut into 12 squares or rectangles and serve.