In the bowl of your stand mixer, cream together the sugar and softened butter. Cream in the egg as well.
Add in the salt, almond extract, minced rosemary, chili flakes, and almond meal. Mix in the flour until just combined---don't add it all at once, start with 2 cups then add 1/4 cup at a time until it's a good texture. You don't want it super dry and crumbly, you want it to hold together but not be greasy or super soft.
Wrap it in plastic wrap and let it rest for 1 hour in the refrigerator before continuing. This step is important so don’t skip it. You can also do everything up to this step a day or two ahead of time if needed, then just bake fresh.
Preheat your oven to 325 F. Line a couple cookie sheets with parchment paper. Grab small pieces of dough (about 2 tablespoons each) and gently roll into balls. Place on the cookie sheet and use your thumb to press an even depression/crater into each one.
Bake for 10 minutes. Then remove them from the oven and, using the end of a wooden spoon, gently redefine the depression (it's probably puffed a bit), then fill each with jam and sprinkle on a bit of flaky sea salt. Don't be tempted to massively overfill them, it will spill out.
Return to the oven and bake for another 10 to 12 minutes. Then transfer the cookies to a wire rack to cool completely.