Idiom for: a not-challenging environment spoils a good worker gradually

Solution 1:

If you lie down with dogs, you will get up with fleas ( or in Latin, qui cum canibus concumbunt cum pulicibus surgent).

The quote has a large almost universally agreed meaning of "You should be cautious of the company you keep. Associating with those of low reputation may not only lower your own but also lead you astray by the faulty assumptions, premises and data of the unscrupulous."

[Wikipedia]

Also, the below sayings would fit depending on the context:

  • Tell me with whom thou goest and i'll tell thee what thou doest. (tell me who you go with and I'll tell you who you are)
  • Man is known by the company he keeps.
  • Evil companions bring more hurt than profit.

If you no longer have the advantages or skills you used to have, you can consider the phrase lose your edge. This might not depend on your environment though.

to lose the qualities or skills that made you successful in the past

[thefreedictionary]

Solution 2:

Forum.wordreference.com and www.usingenglish gloss the phrase he who touches pitch shall be defiled. It means, generally, one cannot associate with dirty things (eg, mediocre programmers) without getting dirty oneself. As I'd expect, google ngrams shows use of the phrase touch pitch as far more common in the 1800's than before or after, pitch being in common use aboard sailing ships.

From idioms.thefreedictionary.com, tarred with the same brush means “sharing the same characteristic(s); having the same good or bad points as someone else”, and from en.wiktionary, “To characterize using the same undesirable attribute, especially unjustly”. If a job shop is known for so-so products, people are likely to think of its employees as tarred with the brush of mediocrity. A worldwidewords.org entry for the phrase notes “There’s nothing directly racist in its history” but indicates why some may mistakenly think so.

Also, although not it's not well-known in English, the following proverb may apply in much the same way as “If you lie down with dogs, you will get up with fleas”:

How can you avoid wetting your shoes when you frequently walk on the riverside. ‒ WISDOMCHINA.htm