armen Nieves can tie a bow on a baby's bib faster than it takes to tell it, and that is her job at a cluttered, noisy little factory here that makes do-it-yourself needlework kits for American hobbyists.

She lives in this industrial town 30 miles south of San Juan on $3.10 an hour earned three days a week, plus food stamps and hope, but her main worry these days is about the tax bill now before Congress. She's afraid it will close the Pioneer Co. plant down. "That would ruin my life," she said.

Joaquin B. Viso has similar worries about a very different factory, a glossy high-tech pharmaceutical plant at Cidra, 15 miles further south, that makes tranquilizers and medicines for the same American market. With 1,300 workers and a $141 million capital investment, the SmithKline Beckman Corp. subsidiary president is just as alarmed as Carmen's boss about what Congress seems about to do to Puerto Rico.

In fact, provisions of the giant tax bill now in a House-Senate conference have united all the island commonwealth's warring politicians in agreement that the bill could devastate Puerto Rico's already ailing economy. Primed, in part, by the corporations that are trying to hang on to their lucrative tax break, they say that the stake is 30,000 jobs and $4 billion in investment.

What's worse is that very few people in Washington appear to have noticed.

"If someone was planning to destroy the Puerto Rican economy, they could not have done it more systematically," said Bert Finn, former economic adviser to the governor and now a private investment counselor. "It's mostly been an accident so far, but we've been talking to them. If they pass this now we'll have to assume they're out to get us."

Sen. Robert Dole (R-Kan.) wrote the tax bill to close what he called a major loophole: current law allows U.S. corporations to assign millions of dollars in profits to Puerto Rican subsidiaries, so they avoid paying U.S. corporate income taxes on it. Dole said some companies make as much as $43,000 in profit per island job, and said his rewrite of the tax law's Section 936 would bring in another $1 billion for the U.S. treasury.

To Puerto Rico, Section 936 is not a loophole. It is the foundation of the island's entire economic structure.

Since 1921, corporations have come to Puerto Rico mainly for the tax breaks. With half the per capita income of Mississippi, the island is neither a state nor an independent nation, but has a love-hate commonwealth relationship to the United States.

Its 3.2 million islanders are U.S. citizens with a strong work ethic, but there are too many of them in a place with too few natural resources too far away from the U.S. mainland--1,000 miles from Miami--to attract investments alone, officials say. With no vote in Congress, Puerto Rico tends to vanish in policy debate.

Current law now says a corporation doesn't have to pay taxes on its profits in Puerto Rico. It also lets a corporation assign to Puerto Rico--and thus free from taxes--its profits from "intangibles" such as patents, copyrights or trademarks. In addition, half the corporation's tax-free income may be from "passive" investments, such as bank accounts, rather than from sales.

Corporations lured by these provisions now provide 40 percent of all Puerto Rico's manufacturing jobs, according to a study by the island treasury department, but it is the "intangibles" and the "passive" investments provisions that Dole's bill would junk.

SmithKline Beckman Corp. came here in 1969 to manufacture its patented tranquilizers and diuretics at Cidra and two other plants, and now is in the midst of a $40 million expansion to produce a new anti-ulcer drug.

"Our decision to come was because of the tax advantages, no question about that," said Viso in the firm's ultramodern offices. Like other employers, he praised the local labor force as hard-working and productive, but said the tax bill would cut profits by 40 percent. "We'd have to reconsider the basis of our operation here," he said. "This is a business, not a philanthropic organization."

A spokesman for American Cyanamid, which employs 1,200 workers at four plants, told the San Juan Star that while the company "won't walk away from a fixed investment of $78 million," it would "have to give serious consideration to withdrawing some operations" in Puerto Rico. The DuPont Co. said it would cancel expansion plans at the very least.

Smaller companies like the needleworking firm benefit, too. "The tax break more than offsets the cost of transportation back and forth," said Alan Greenstadt, assistant to the president of Pioneer Industries Inc. of New York. "The company was put together to take advantage of it."

The Rio Grande plant cuts, sews, prints and packages textiles sent down from South Carolina into crochet, embroidery, rug and afghan kits that sell as Vogart Crafts back on the mainland for 49 cents to $17. Business is down about 20 percent this year, said plant manager Luis Aponte, "the slowest year we've ever had."

Greenstadt said Vogart did $15.5 million in business last year, but if it loses the Puerto Rico tax benefits, "you're talking about quadrupling the tax burden. With margins as low as they are these days, well, I don't know if we'd still have a plant there."

Puerto Rico has built its own tax structure around the "Section 936" provisions, inducing companies to invest some of their profits here to bring the local taxes they pay to to a minuscule 4 to 7 percent of the company's profits. Fully $5.5 billion within the banking system comes from this source, but the treasury department estimated that $4 billion of it might go back to the mainland under the proposed changes.

"Puerto Rico has built its entire postwar economic development strategy around this Section 936 program," said the treasury report. "The legislation . . . would have the effect of derailing the island's entire economic development program."

Gov. Carlos Romero Barcelo and squads of economists have been buttonholing congressmen for two weeks in Washington, reminding them of Puerto Rico's existence. After failing in the Senate to win any concessions, they proposed a compromise proposal for the conference committee, and Romero said Thursday that he is "highly optimistic" it may squeak through.

The compromise, however, remains unacceptable to the big pharmaceutical firms. It would allow 50 percent of "intangible income" to be allocated to Puerto Rico and other U.S. possessions, instead of none, and would permit 35 percent of a company's tax-free income to be passive instead of the 10 percent the bill now calls for.

President Reagan endorsed the idea in a letter to key congressmen last week, saying the Senate bill "goes much further than is necessary" to correct abuses. But the measure still must hurdle House Speaker Thomas P. O'Neill's determination to avoid leaving any Democratic fingerprints on the overall $98.5 billion measure.

Secretary of State and acting Gov. Carlos S. Quiros said gamely that the compromise would perhaps be better for the island economy in the long run than leaving things as they are. "Industries would wonder what about next year, since Congress got so worked up this year. They don't want an unknown . . . . For the long term some action now would make them more secure."