While the pasta is cooking, heat the oil in a large saucepan.
Add the onions and garlic along with a good pinch of salt and some ground black pepper. Saute until the onions turn soft and translucent, about 8 minutes over medium heat.
Add the red pepper flakes, stir in, and then add the broccoli florets.
Cook, stirring frequently, no more than five minutes or as long as it takes for the broccoli to turn just slightly tender. It should still have a good bite.
Add the pasta and beans to the saucepan along with some salt and more ground black pepper. Mix everything together. Add 1/2 cup of the pasta water to make a little sauce.
Add the parsley and lemon juice and stir to mix.