Cook green and wax beans in a pot of lightly salted water until fork-tender, 3 minutes; drain. In the same pot, boil chicken broth. Add chicken breasts and simmer 15 to 20 minutes. Reserve 1/2 cup broth. Shred the chicken. Meanwhile, cook whole-wheat spaghetti according to the package directions. Heat olive oil in a large skillet over medium heat. Add sliced garlic cloves and cook 1 minute. Add chicken broth, the beans, pasta, chicken, and 1/2 teaspoon salt and cook 2 minutes. Stir in 1/2 cup basil leaves and 1/4 teaspoon red pepper flakes.