Every good act needs an impressive opening and a strong finish.

The Commack girls basketball team pretty much had that covered Saturday, thanks to starter Kim Shalhoub and closer Jillian Spagnuola.

Shalhoub, a junior who hit five three-pointers, had 13 of her 19 points in the first quarter. Spagnuola, a senior, scored the top-seeded Cougars’ last six points in the final 76 seconds of a 54-47 win over No. 5 Hauppauge in a Suffolk Class AA girls basketball semifinal at Stony Brook University.

Two-time defending Class AA champion Commack (21-2) will try to earn its third straight title on Thursday when it faces No. 3 Central Islip at Stony Brook.

“Kim was our only kid making shots early on,” Commack coach Denis Conroy said. “She saved our butts.”

advertisement | advertise on newsday

“Today was just my day,” Shalhoub said. “After my first shot went in, I could feel it.”

Commack, which led 40-38 after three quarters, got three-pointers from Shalhoub and Casey Hearns (eight points) to take a 46-38 lead.

Senior Katie Murphy hit a three-pointer with 3:22 remaining for Hauppauge’s first points of the fourth quarter, making the score 46-41. The Eagles got within five points three more times, but Spagnuola, a senior point guard, came through at the end for Commack.

Spagnuola, who guarded Murphy in an intense one-on-one matchup most of the game, hit a layup with 1:16 left and went 4-for-4 from the free-throw line in the final 27.5 seconds. She finished with 12 points, eight in the second half.

Murphy ended a great career with 16 hard-earned points and five assists. Senior Kayla Petre added 10 points for the Eagles.

Commack went 12-for-22 from the foul line but was 8-for-11 in the second half. Hauppauge (20-3) was 17-for-32 for the game but only 2-for-7 in the fourth quarter.

“The team that plays the hardest this time of year,” Spagnuola said, “is usually the team that’s going to win.”

Strong finish.