With the threat of a collapse of Israel's fragile coalition government over, at least for the moment, Prime Minister Shimon Peres and the leader of the right-wing Likud faction, Foreign Minister Yitzhak Shamir, met today but failed to reach an agreement on how to avoid similar Cabinet crises in the future.

Peres -- who withdrew his dismissal of controversial Likud Trade Minister Ariel Sharon early today after Sharon retracted his bitter criticism of Peres' initiative for peace talks with Jordan -- said this afternoon that any minister who repeats Sharon's attacks will be fired immediately without an opportunity to apologize or retract his statements.

Peres said his authority is a 1981 amendment to Israel's Basic Law of Government, which assigns "collective responsibility" to Cabinet ministers to support decisions made by a majority of the Cabinet.

For his part, Shamir reiterated his position that, under the September 1984 coalition agreement that led to the national unity government, the prime minister can dismiss a minister from the opposite faction only with the approval of the alternate prime minister.

Despite the impasse on the question of the prime minister's firing authority, the crisis over the Peres-Sharon feud appeared to have passed, at least for the time being. Both sides vowed publicly to try to maintain the coalition national unity government until Peres and Shamir are scheduled to rotate positions next September.

Nevertheless, sources in both the Likud and Labor Alignment factions expressed fears that another attack by Sharon against Peres' foreign policy would bring down the 14-month-old bipartisan government.

They said that any moves by Peres in the peace process that hint of significant concessions will be likely to trigger a new outburst by Sharon, leading to his dismissal and a walkout by the Likud bloc.

Predicting that the days of the national unity government are numbered, Immigrant Absorption Minister Yaacov Tzur of the Labor Alignment said all that was achieved was a "timeout" in the conflict.

Economic Planning Minister Gad Yaacobi said he hoped "lessons had been studied" by Sharon and other ministers. But, he warned, "If such a phenomenon will happen again in the foreseeable future, the prime minister will fire any minister who acts the way Sharon acted, without any negotiations or any effort to appease anybody."

Sharon, who flew to New York for a fund-raising tour this morning after retreating from his confrontation with Peres, appeared to be the principal loser in the Cabinet crisis. Sharon retracted the six major points of criticism that he had leveled at the prime minister following the recent conciliatory gestures extended to Jordan's King Hussein by Peres, who is trying to bring about direct Jordanian-Israeli peace talks in an international forum.

Moreover, the flamboyant trade minister appeared to have edged himself into a corner: He stands vulnerable to summary dismissal if he attacks Peres' peace moves in the future, and he will appear weak to his right-wing constituency if he remains silent.

The Herut Party, the core of the Likud bloc, is scheduled to hold its national convention in January, when Sharon is expected to launch his open challenge to Shamir's party leadership. To succeed, he would need the support of the hard-line wing of the party, which is opposed to any peace negotiations that could lead to Israel's withdrawal from the occupied West Bank and Gaza Strip, captured in the 1967 war.

Peres, on the other hand, appeared to have gained favor with the parliament's religious parties by holding the coalition government together despite indications that he might have been able to put together a narrow-based coalition government without the Likud.

The religious parties, which hold 11 seats in the 120-member Knesset, or parliament, had feared early elections because their electoral base has been diminished considerably in the last two elections.

The religious parties, and particularly Interior Minister Yitzhak Peretz of the Shas (Sephardic Guardians) party, played a central role in resolving the Peres-Sharon feud through intensive mediation during the past two days.

Religious Affairs Minister Yosef Burg of the National Religious Party said today that the religious parties' refusal to enter a narrow coalition headed by Peres "gave Labor enough reason to think a second time if this is a proper moment and the proper reason for the dissolution of the Cabinet."