The playoffs provide a last stand for Didi Gregorius, a final chance to make a case that the Yankees should invest in retaining him.

Six months ago — even while he was healing after Tommy John surgery — Gregorius felt like a no-brainer, long-term investment for the Yanks. He was arguably their best all-around player, had established himself as a leader and offered what has become rare lefty diversity in their lineup.

The Yanks did try to extend Gregorius last offseason. But unlike Aaron Hicks and Luis Severino, who accepted — and probably are grateful they did after injury-devastated seasons — extension offers, Gregorius, like Dellin Betances, did not find common long-term ground with the Yankees. Betances heads into free agency off of a bad shoulder, one game pitched and now a torn Achilles. Gregorius had his worst Yankees season since succeeding Derek Jeter.

At least he has the playoffs to make a statement. His 2019 highlight was a three-game set at Target Field in which he went 8-for-10 with five extra-base hits and 10 RBIs. He has a 1.042 OPS in 30 regular season games against the Twins and had the biggest hit in the 2017 wild-card game, a bottom-of-the-first, three-run homer off Ervin Santana that quickly tied the score after Severino was knocked out, giving up three runs in the top of the inning.

Brian Cashman has told me all free agent decisions are tabled until the offseason. Gregorius’ representatives did not return text messages seeking their insight.

The Yankees could make the qualifying offer (about $18 million) to Gregorius and he could accept. Neither is certain. The Yanks probably will be going over the $208 million luxury tax next season, but will want to limit just how far. For 10 signed players, a guesstimate at 40-man additions and the standard insurance/pension/etc. added to all payrolls for luxury tax purposes, the Yanks are at $171.5 million (per Cots Contracts).

That includes Aroldis Chapman, who probably will opt out, forcing the Yanks to consider whether to tack onto his existing contract. It does not include a hefty arbitration raise coming with James Paxton and first-timers Aaron Judge, Gary Sanchez and Chad Green. And it does not include if the Yanks are going to shop at the top of the free agent market for Gerrit Cole.

If offered, would Gregorius take the qualifier and try to re-establish himself for free agency the following year? If he instead tests the market, it would be off of a poor platform season and when few contenders and/or big-market teams clearly would be shortstop shopping.

The payday projected for Gregorius 12 months ago is unlikely to be achieved. Back then a good argument could be waged on whose left side of the infield to take for the next five years, the Red Sox with Xander Bogaerts and Rafael Devers or the Yanks with Gregorius and Miguel Andujar.

Not much went right for the defending champs, but Bogaerts and Devers are potential top-10 MVP finishers and cornerstones to the Red Sox’s future. Andujar injured his shoulder and hardly played and Gregorius made a turn for the worse on both sides of the ball.

Bogaerts received a six-year, $120 million pact before the season. He is three years younger than Gregorius, but the $20 million average on say a four- or five-year deal was not far-fetched. From 2016-18, Gregorius had a 10.2 in Wins Above Replacement, Bogaerts 9.8.

But Bogaerts had by far his best year in 2019. Gregorius did not return until June. That hurt Gregorius’ marketability. For Gleyber Torres handled the position well in his absence. The Yanks, therefore, could think about a 2020 in which Torres is a 100-game shortstop and — as an example — Cincinnati picks up Freddy Galvis’ $5.5 million 2020 option and trades him to the Yankees. Or did Tyler Wade show enough late to be a cheap shortstop caddy to Torres?

Gregorius’ defense, a key calling card, generated a minus-1 in Defensive Runs Saved in 688 1/3 innings at short. Torres was plus-1 in 659 2/3 innings. Offensively, Gregorius’ batting average and on-base numbers plummeted as he closed the season with 13 games hitting .160 with no homers.

Was this due to the disjointed season caused by his elbow injury and all will return in full next year? Brandon Crawford shares much with Gregorius — superb athletes/defenders who improved hitting against lefties as their careers progressed in part due to their work with Hensley Meulens. The Giants gave Crawford a six-year, $85 million extension entering his age 29 season in 2016 and his production has waned greatly in the first four years of the deal.

Conversely, losing Gregorius, 30 in February, would be painful and not just because of the lineup diversity. CC Sabathia is retiring. Betances, Brett Gardner and Austin Romine are free agents. With Gregorius and more frequently Aaron Judge, those have been the leaders of a clubhouse of unanimity, focus and professionalism. How many of those players can the Yanks bleed and stay the course?

Gregorius does have this postseason to make — on the field at least — a final statement about why he should stay.