While anterior knee pain can be caused by more than one issue, most cyclists ignore some common muscular imbalances brought on by a repetitive single plane motion sport. Many of these issues can be corrected by strengthening and stretching especially in the off season. A common weakness in a cyclist’s knee or runner for that matter is the VMO (Vastus Medialis oblique) which is located on the inside of the patella (kneecap). In cycling we seldom complete the last 35 degrees of knee extension which is controlled by the VMO. Over a long period of time the muscles along the lateral side of the leg or knee become stronger and sometimes tighter than the under engaged (VMO) medial muscles. This causes the patella to track improperly and cause irritation to the tissue under it. Sitting at a desk all day can just aggravate the issue as the knee is rarely extended engaging the VMO. Bike specific issues to be aware of that can contribute to this is a saddle that's too low or too far forward, pushing big gears or cranks that are too long.
Treating this issue involves stretching and rolling the lateral side structures (outside of the leg) and strengthen the VMO muscles. A few VMO exercises would be short arc single leg press and wall squats while compressing a ball between your knees. The process of correcting this issue is sometimes slow so patience is a must. Taping the knee properly by a PT can help relieve some pain and shorten the rehab period.