Boil the pasta. Bring a large pot of well-salted water to a rolling boil.
Cook pasta until just al dente according to the package. Don’t overcook—soft pasta turns mushy once dressed.
Toast the nuts. While the pasta cooks, toast pine nuts or walnuts in a dry skillet over medium heat for 3–4 minutes, shaking often. Pull them when they’re golden and fragrant.
Let cool.
Prep the add-ins. Halve tomatoes, dice cucumber, cube mozzarella, and slice red onion. For a milder onion, soak slices in cold water for 10 minutes, then drain well.
Drain and cool the pasta. Reserve 2 tablespoons of the pasta water, then drain. Spread the pasta on a sheet pan or large bowl to cool for 5–10 minutes.
Toss with a drizzle of olive oil to prevent sticking.
Make the pesto. In a food processor, add basil, parsley, toasted nuts, garlic, 1/2 teaspoon salt, and several grinds of pepper. Pulse until finely chopped. With the motor running, stream in 1/2 cup olive oil.
Add lemon juice and cheese, then pulse to combine. Adjust with more oil for a loose, glossy texture.
Season and adjust. Taste the pesto. If it’s too thick, loosen with a splash of pasta water or more oil.
If it’s flat, add a pinch of salt or an extra squeeze of lemon.
Dress the pasta. In a large bowl, toss the cooled pasta with the pesto until every nook is coated. Add a little reserved pasta water if needed to help it spread evenly.
Fold in the vegetables. Gently mix in tomatoes, cucumber, mozzarella, and red onion. Add a crack of pepper and more salt to taste.
If you like heat, a pinch of red pepper flakes is great here.
Rest and garnish. Let the salad sit 10–15 minutes so flavors mingle. Finish with chopped fresh herbs, an extra shower of Parmesan, and a light drizzle of olive oil.
Serve chilled or at room temp. Both are excellent. If chilling for later, see the tips below to keep it vibrant.