The 50-year-old Chinese civil war, having been fought across the broad China mainland, on the offshore islands of Quemoy and Matsu and in the United Nations, has moved this month to the back alleys and bars of this island.

At a critical moment in the long struggle between Chinese that still involves the United States, more than 20,000 overseas visitors, including several mainland Communist agents, have flooded this last small holding of the Chinese Nationalists to celebrate the 1911 overthrow of the Ching dynasty. Taiwan's security forces have issued an unprecedented island-wide spy alert on television, radio and in thousands of posters offering $11,000 rewards, and the island's security agents are known to be combing the streets.

Somewhere among the neon signs and trees strung with colored lights, mainland agents are passing instructions and collecting data from their networks here, making new friends and probing weaknesses during the late night carousing expected of "double-ten" (Oct. 10) celebrants. Although the Taiwan security rarely publicize their arrests, somewhere plainsclothesmen have pulled a reveler or two into a car and taken them off for questioning.

It is all part of China's 28-year effort to soften up this island for a final clash which, although probably many years away, both sides seem to consider inevitable. By most accounts, Taiwan's security forces and the natural anti-Communist bent of its 16 million people have successfully resisted the espionage threat. In the process, the government has also jailed advocates of civil-liberties and Taiwan independence and given itself something of a black eye broad.

However, the records of the Taiwan Garrison Command, responsible for the island's security, also show several apparent cases of genuine espionage. Some of the stories recounted by security officials interviewed here - and confirmed by other sources - reveal the problems of counterig infiltration on an island that shares countless political and family ties with its mainland enemy, that must encourage foreign trade to survive economically and tha must win all the friends it canamong overseas Chinese.

Chu Chuan-chou seemed in all respects a conscientious Taiwan businessman, sometimes treating old friends from the days on the mainland to a few drinks and going to HOng Kong at least once a year to make deals. He lived this life from the early 1950s until his arrest in 1965, when the government charged he had been trained as a spy on the mainland shortly after the Communist victory there and had been admitted to Taiwan by using the name of his brother-in-law's father.

Chu was executed in 1968, convicted of stealing military secrets through bribery or the inadvertent remarks of his drinking companions and passing his information through Hong Kong - where mainland agents can come and go as they please. His knowledge of who to approach in Taiwan was considerably enhanced by his old friendship with Chen Ming-jen, a top nationalist general who had gone over to the Communist side in 1949.

Hsu Ying, ostensibly a journalist, waged his own little war against the Nationalist Chinese in some of those Chinatowns that dot every continent and provide the background for regular underground skirmishes of the Chinese civil war.Hsu worked for Chinese-language newspapers in Thailand until Thai authorities in 1952 discovered he was a member of the Chinese Communist Party and repatriated him to China.

In 1956, Hsu went to Mauritius, where he became active in what Peking calls "united front" activities, the attempt to sow sympathy among uncommitted Chinese abroad. In 1967, apparently unaware that nationalist agents had been watching his activities, Hsu travelled to Taiwan for the Double Ten celebrations and attempted to strike up acquaintances with government officials. He was arrested, convicted and placed in one of the government's three detention centers, where he remains.

Agence Frace-Presse reporter Albert Yuan was jailed in 1963 for sending alleged coded messages to Peking and Hong Kong in the form of news telegrams.

One of the most recent arrests was that of an assistant medicine factory manager named Chen Ming-chung, who was convicted last year of making contact with a Chinese Communist agent in Japan and returning here to produce pro-mainland leaflets.

Maj. Gen. Tuan Ja-Fen of the Taiwan Garrison Command said the three prisons at Taipei, Tainan and Green Island now hold 236 "Communist agents," although that number includes sympathizers of the Taiwan independence movement whom Tuan refuses to distinguish from the Communists - who abhore the idea of Taiwan's separation from the mainland. "We think they are Communist agents or fellow travelers," Tuan said. "They both act to topple the government."

Asked for a count of how many prisoners had spent any time abroad since 1949, a command spokesman said about two-thirds. The estimate provides a very rough measure of the number who could have had foreign contacts.

Some Taiwan independence movement supporters, like editor Huang Hua of the ill-fated Taiwan Political Review, are still in prison, while others have been released or left relatively alone as the government tries to polish its image to fit the human rights consciousness of the Carter administration. The public outspokenness of Taiwan independence promoters like Huang illustrates how removed they are from the quiet, patient methods of the Communist Chinese espionage service.

Taiwan's new anti-spy alert began shortly after U.S. Secretary of State Cyrus Vance's August trip to Peking and seemed to reflect in part Taiwan's nervousness at Washington's renewed interest in ties with Peking. While that interest seems to have cooled in recent weeks, the influx of overseas Chinese visitors has kept security officials tense and the campaign continues.

"In order to preserve democracy and freedom, known Communist agents must be reported to the authorities," says a television announcer. "Communist agents on Taiwan do such things as collect information, develop spy organization, spread disruption and rumors." He asks for watchers to call or write, "Please use your true identity and address."

Security authorities say they have been getting about 30 calls or letters a week, but no good leads as yet. "One laundry man found a Communist mainland penny in a suit he was cleaning, but it turned out to belong to a foreigner who had travelled on the mainland recently," said a security official. When Chinese on either side of the Taiwan Straits say foreigner, they mean someone not of Chinese descent - an American or European businessman or journalist considered by both sides to be too conspicuous ever to pose a threat as a spy.

Actual acts of sabotage here have been no more serious than those found in countries not engaged in civil war. The governor of Taiwan Province, Hsieh Tung-min, lost a hand last year in the explosion of a letter bomb. A Taiwanese who had lived in the United States and whose political connections are unclear was convicted of the crime this year.

Several U.S. companies here received letters early this year from a group identifying itself as the People's Republic of China Liberation Front, threatening vague consequences if they did not leave the island by June 30. Nothing happened to the companies, although a Bank of America branch was bombed some years before.

Some native Taiwanese, still ruled by an administration composed almost entirely of nationalist Chinese born on mainland China, criticize the government's intense anti-communism as harmful to civil liberties and a waste of energy that could be devoted to building up the island.

Many other Taiwanese - including outspoken critics of the government - share the sense of foreboding at what might happen if Peking successfully weakened the island's resistance. There was some protest last year when the daughter of one independent-minded member of the legislature was sentenced to three years in reform school for participating in a tour of the mainland arranged by friends in Japan.

Another independent, Taiwan-born politician said in an interview: "The Communists knew how to use that girl. They gave her the V.I.P. treatment, and they must have given her some kind of mission or assignment to influence her father, so I think the government had good reason to treat her like that."