Cook the pasta in a large pot of boiling, salted water according to package directions. Add broccoli in the last 5 minutes of cook time. Drain the pasta and broccoli.
In the bottom of the pot over medium heat add the olive oil and shallots and cook for about 3 to 4 minutes until softened and translucent. Add the minced garlic and sauté for about 30 seconds to a minute. Turn off the heat. Add back in the pasta and the broccoli mix and toss in the oil to coat. Add salt and pepper and toss. Toss in the red pepper flakes, if using. Add parmesan cheese to serve.