Cook the pasta. Bring a large pot of salted water to a rolling boil.
Add the pasta and cook until al dente according to package directions. You want some bite so the salad doesn’t go mushy.
Rinse and cool. Drain the pasta and rinse briefly under cool water to stop the cooking. Shake off excess water well.
Transfer to a large mixing bowl and drizzle with 1 tablespoon olive oil to prevent sticking.
Prep the mix-ins. While the pasta cools, halve the tomatoes, dice the cucumber, slice the red onion, and crumble the feta. If using olives, halve them now.
Dress the pasta base. Add the pesto to the pasta and toss until every piece is lightly coated. If it seems tight, add 1–2 tablespoons olive oil to loosen.
You want a glossy, even coating.
Add the vegetables and feta. Fold in tomatoes, cucumber, onion, and olives. Sprinkle in the feta last to keep some larger crumbles intact. Toss gently.
Brighten it up. Squeeze in the lemon juice and season with black pepper.
Taste before adding salt—feta and pesto are salty. Adjust with more lemon, olive oil, or pesto to preference.
Chill or serve. You can serve it right away for a fresher, greener pesto flavor. For deeper flavor, cover and chill for 30–60 minutes so everything melds.
Finish and garnish. Just before serving, toss again and top with fresh basil and a pinch of red pepper flakes if you like a little heat.