New York Yankees second baseman Starlin Castro (14) reacts after...

New York Yankees second baseman Starlin Castro (14) reacts after hitting a walk-off homer to left in the bottom of the ninth inning of a game against the Colorado Rockies at Yankee Stadium on Wednesday, June 22, 2016. Credit: Joseph D. Sullivan

As transitions go, they’ve gone about as smoothly as they could for Starlin Castro, both to second base in his first full season at the position and to Yankees pinstripes.

After his first career walk-off homer beat the Rockies on Wednesday, Castro has a .257/.290/.419 slash line with 10 homers and 28 RBIs. Those are not Robinson Cano numbers, but Castro, acquired last December from the Cubs for Adam Warren and Brendan Ryan, has given the Yankees consistency and productivity at second base not seen since Cano left via free agency after the 2013 season.

Defensively, Castro has been a plus, and he’s shaken off a horrible May (.200/.241/.355) by going .288/.303/.438 this month.

Needless to say, life as a Yankee does not always go well initially. “He adapted [in] spring training,” said Castro’s double-play mate, shortstop Didi Gregorius, who had his own issues early last season as Derek Jeter’s replacement.

Jim Hendry is not surprised by the early success of Castro, 26, who hit .305 with a .345 on-base percentage, three homers and 12 RBIs in the season’s first month. Hendry, a special assignment scout for Yankees general manager Brian Cashman, was the Cubs’ GM in 2006 when they drafted Castro as a 16-year-old amateur free agent out of the Dominican Republic.

Tim Naehring, the Yankees’ vice president of baseball operations, was a professional scout in the organization from 2009-15, when his primary coverage included the National League. Hendry watched Castro down the stretch last season. He and Naehring thought he could be a solution at what had been a black-hole position for the Yankees since Cano’s departure for Seattle.

“We both thought and recommended [to Cashman] that he’s still just 25 and already has almost 1,000 hits [991 after 2015], he can still be a strong offensive force,” Hendry said by phone Thursday before adding that Naehring, in his NL coverage, had seen more of Castro throughout the regular season. “We both thought he could make the transition and be an above-average defender.”

The transition became necessary because Castro, a three-time All-Star at shortstop before age 25, had lost his job to phenom Addison Russell last Aug. 6. Castro’s performance had lagged significantly since his last All-Star appearance in 2014.

Cubs manager Joe Maddon, with a need at second, switched Castro there Aug. 11 and he excelled, producing a .353/.373/.588 slash line the rest of the way for Chicago, which earned a wild card and advanced to the NLCS against the Mets.

“To do that in a pennant race . . . they were not a lock to get in,” Hendry said. “He had a big hand in that and we were impressed with that.”

After the Cubs signed Ben Zobrist during December’s winter meetings to play second, the deal with the Yankees quickly came together.

It didn’t take long for the 6-2, 230-pound Castro to impress his new teammates with his athleticism and bat. His 10 homers are four shy of his season high, reached twice. “I know he’s capable of hitting for average, but also doing damage,” Carlos Beltran said. “He’s got pop.”

Pop that Hendry said could just be coming into its own.

“He has really good hands. He’s got some surprising power,” Hendry said. “It wasn’t reaching too far to think he might hit 20 [homers], I thought he was that kind of guy. When you’ve got over 1,000 hits [1,059] and are barely 26, you’ve got some ability. Guys grow into their power usually 25 to 28, 29. Hopefully, there’s more in there.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME