Step 1
Heat the oven to 400 degrees. Bring a large covered pot of well-salted water to a boil. Add the farro and adjust the heat to maintain a medium boil. Cook uncovered, stirring occasionally to make sure nothing is sticking to the bottom, until tender and not too chewy, about 30 minutes.
Step 2
Meanwhile, on a sheet pan, combine the tomatoes and onion wedges with the oil, making sure everything is well coated and glistening, then season with salt, pepper and the red-pepper flakes. Roast until the tomatoes blister and slightly deflate, 25 to 30 minutes.
Step 3
When the farro is done, drain, then pour into a serving bowl or back into the pot. Toss with some olive oil, then mix in the pesto. Add the lemon zest and juice, then stir in the spinach. Set aside to cool slightly.
Step 4
Scrape the onions, tomatoes and their juices into the farro; season with salt and pepper as needed. Add the cheese, if using, then garnish with herbs and serve.