Shirley was originally drafted out of Putnam City High School in 1972 by the Los Angeles Dodgers, but chose to attend the University of Oklahoma. While there, he was a member of the gold medal-winning Team USA at the 1974 Amateur World Series, the predecessor to today's Baseball World Cup. He was drafted again in 1975 by the San Francisco Giants, but did not sign, instead waiting until the following January, when he was drafted in the secondary phase by the Padres.
Shirley skipped several levels of minor league baseball, being assigned directly to the Double-A Amarillo Gold Sox to start the 1976 season. After posting a win–loss record of 9–5 with a 3.32 ERA in 16 starts, he was promoted to the Triple-A Hawaii Islanders, finishing the season there. It would be the last time Shirley played in the minors until 1987.
Shirley was named to the Padres' starting rotation to open the 1977 season. He posted what turned out to be one of his best seasons in his rookie year, setting what would be career highs in wins (12), games started (35), innings pitched (214) and strikeouts (146). It was also his only year as a full-time starter, as he never started more than 25 games in a season after 1977.
Shirley started the 1978 season in the Padres' rotation as their number two starter after future Hall of Famer Gaylord Perry. Although he pitched occasionally in relief, he remained in the rotation until July, when he was moved to the bullpen after a start in which he gave up six runs on seven hits and five walks in six innings. He made only one start the rest of the year.
After spending two more seasons as a swingman for the Padres, Shirley was part of an eleven-player trade which sent him to the Cardinals along with ace reliever Rollie Fingers, veteran catcher Gene Tenace and minor league catcher Bob Geren for a package of prospects and role players.
Over the course of the next two seasons, Shirley's role remained the same. After spending one season in St. Louis, he was traded during spring training 1982 to the Reds for a pair of prospects, one of whom was reliever Jeff Lahti. He became a free agent after the season, and was signed by the Yankees.
During Shirley's first season with the Yanks, he was used mostly as a starter for the first time since 1979. He started the second game of the season on April 6 after Ron Guidry's Opening Day start, but after giving up 4 runs in 2.2 innings, he did not pitch again for nearly two weeks. In his next start, which came on April 27, he pitched his first shutout in nearly four years. Despite this, he finished the year with an ERA above 5 (5.08) for the first time in his career, and also pitched the fewest innings of his career (108) outside the strike-shortened 1981 season.
Through the remainder of Shirley's career with the Yankees, he was primarily used as a long reliever, starting just 22 out of the 140 games in which he appeared from 1984 to 1987. His Yankee career came to an abrupt end in June 1987, when Shirley was involved in an incident of clubhouse roughhousing with Don Mattingly that resulted in Mattingly ending up on the disabled list. He was released shortly thereafter.
After his release on June, Shirley signed with the Royals eight days later. His tenure with Kansas City was disastrous, as he appeared in just three games, pitching 7.1 innings and giving up 12 runs, including five home runs, for an ERA of 12.73. The Yankees re-signed him to a minor league contract, and he finished the season with their Triple-A farm club, the Columbus Clippers. After playing in the Toronto Blue Jays farm system in 1988, Shirley retired.