Bring a large pot of salted water to a boil. Add the spaghetti or linguine and cook according to package instructions until al dente. Reserve 1 cup of pasta water, then drain the rest and set aside.
In a large skillet, melt the butter over medium heat. Add the minced garlic and red pepper flakes. Cook for about 1-2 minutes, stirring frequently, until fragrant.
Add the shrimp to the skillet. Season with salt and black pepper. Cook for 2-3 minutes on one side, then flip and cook for another 2-3 minutes, until the shrimp are pink and opaque.
If using, pour in the white wine or chicken broth. Allow it to simmer for 2-3 minutes to reduce slightly.
Add the drained pasta to the skillet with the shrimp. Pour in the lemon juice and zest. Toss the pasta to combine well. If needed, add reserved pasta water gradually until desired consistency is reached.
Taste and adjust seasoning with additional salt, pepper, or red pepper flakes if desired. Remove from heat.
Serve immediately, garnished with fresh parsley.