SAN FRANCISCO — For the first time in nearly two decades as a major league pitcher,

New president of baseball operations Buster Posey and the Giants believe Verlander can still bring it and are counting on him to help them contend again in the talented National League West.

The three-time American League Cy Young Award winner said he’s “miles ahead” of where he was last year at this time and he’s trying not to overdo it ahead of spring training, which begins next month.

Verlander went 5-6 with a 5.48 ERA in 17 starts for the AL West champion Houston Astros last year. He opened the season on the injured list due to shoulder inflammation. He also was on the IL from June 18 to Aug. 21 because of neck discomfort.

“Last year was difficult,” he said. “It was worst-case scenario for me. You could never get in a groove, pitched about as bad as I felt like I could. Positives were, I was able to learn a lot. You can’t play this game for very long if you don’t learn from injuries.”

Verlander will receive a full no-trade provision and a hotel suite on road trips.

He would earn $200,000 for winning his second MVP award, $150,000 for finishing second in the voting and $50,000 for third — and would get the same bonuses for Cy Young Award voting.

In addition, Verlander’s deal calls for him to make $100,000 for an All-Star selection, $150,000 for World Series MVP and $100,000 for League Championship Series MVP.

Verlander clearly remembers the electric atmosphere in San Francisco during the 2012 World Series, when the Giants swept his Detroit Tigers.

That included Posey on the other side — and now the retired star catcher did the recruiting of the veteran pitcher.

And the Giants aren’t adding him just to be a mentor or an example for their young pitchers but rather a top-tier starter to complement Logan Webb and Robbie Ray.

“Justin’s track record speaks for itself,” Posey said. “I was lucky enough to get to compete against him for a number of years and have always admired the way that he takes care of himself. When we started having the conversation a couple of weeks ago, it was very evident just how motivated he is, and you don’t get to the level of greatness that he’s accomplished in his career without having just the utmost fortitude and desire to be the best.”