Through a sometimes stormy year, Nigeria's President Shehu Shagari and the National Assembly -- the country's first civilian government in 13 years -- have been warily circling each other like evenly matched but inexperienced boxers. Each has been testing the other's skill and knowledge of the limits of power under their new, U.S.-style constitution.

Shagari has won the first round by bluff, made some tactical retreats and forced two stalemates. But the legislators have learned along the way, and Shagari faces toe-to-toe slugging in 1981.

Americans would find the relationship between Shagari and the assembly, the federal courts and state governors similar to governmental tugs of war in the United States. There is a difference, however, in that Nigeria is still breaking in civilian government. A dispute run wild could disrupt the democratic system in West Africa's most populous and powerful country, which is closely watched by its less developed neighbors.

At independence 20 years ago, Nigeria inherited a British colonial administrative legacy -- a three-way, ethnically based regional political grouping imposed on a weak parliamentary government that collapsed into a series of bloody coups and a harsh civil war only six years into independence.

To avoid a recurrence, the now-retired military rulers, with the help of an elected civilian assembly, put together a federal structure two years ago by borrowing extensively from the U.S. constitution. The three old contentious regional blocs have been splintered into 19 states, and federal power is shared among president, National Assembly and federal courts.

The courts have already indicated their independence by imposing a $658,000 fine on the executive branch for violating the constitution. Neither the act nor the sum, quite large here, would have been conceivable under the allegedly corrupt first civilian government and it is unlikely that any court in most of Nigeria's neighboring countries could act that independently. c

The court's ruling, under appeal by the administration, grew out of a suit against the federal government by a Borno State legislator, Shugaba Abdulrahman, after he was forced out of bed one night earlier this year and expelled to Chad. Interior Ministry agents expelled him on the ground that he was not a Nigerian, but the court ruled he was and that he had been denied a due-process hearing guaranteed by the constitution.

"The past year has been an exercise of each branch of government trying to establish its constitutional rights over the other," said Idris Ibrahim, deputy speaker of the House of Representatives and a member of Shagari's National Party of Nigeria. "Everyone now knows where they stand."

The National Party's Senate leader, Olusola Saraki, said in a recent interview that the assemblymen were not just interested in confronting Shagari but were asserting their rights.

"We shall never be a rubber stamp and I think our stand is being clearly understood by the president," Saraki said.

Shagari, who talks publicly about "team" efforts among the three government branches, showed tenacity in the first confrontation with the Senate a year ago about Cabinet appointments. So far, his style has dominated that struggle.

The Senate threw down the gauntlet by rejecting half of Shagari's list of 24 Cabinet appointments in the first month of civilian government in 1979. They specified that two of the rebuffed 12 were too controversial and would not be reconsidered.

In December, Shagari resubmitted all 12 names with the unspoken assurance that the government would not begin to function until he had the Cabinet of his choosing. The Senate approved the entire list.

Earlier this year, the assembly examined Shagari's budget at length, finally approving it almost intact. Then the legislators dug in their heels over two issues and, out of pique at Shagari, some Nigerians said, initiated a constitutional amendment to reorganize the president's office.

An uproar was caused when Shagari appointed 18 defeated National Party candidates and party functionaries as "presidential liaison officers" in all the states except Lagos, the federal capital.

One Nigerian legislator called it "pork barrel patronage." There are five political parties in Nigeria, and only the legislators and state governors from the seven states dominated by the National Party did not criticize the president.

Shagari's office argued that the $3 million appropriation for the liaison officers was necessary so they could function as overseers of federal projects in the states. The legislators deleted it from the budget but Shagari is using his executive office funds to finance the officers.

Bola Ige, governor of Oyo and outspoken Unity Party of Nigeria member, called the liaison officers "presidential lazy officers," after their initials, PLO.

"Nobody knows the PLO in Oyo State," answered Ige when asked his name, "and anyone in this state government who mentions his name will get sacked." Ige said these officials were seen as an attempt to usurp some of the governors' power.

"I have heard that some governors complain that the PLOs consider themselves alternate governors," acknowledged Emmanuel Edozien, Shagari's economics adviser. But, he added, "The official could add to the effectiveness of each governor by providing liaison with the federal government."

While this issue remains stalemated, another controversy has erupted about the salary the lawmakers tried to set for themselves.

They approved an average annual salary of $30,000 plus constituency allowances of $84,000. Shagari's advisory body -- the constitutionally created National Economic Council, chaired by Vice President Alex Ekwueme and including all 19 governors plus the chairman of the Nigerian Central Bank -- cut the salaries to $22,500 a year and slashed the constituency allowance to $5,000.

Since all salary legislation must be passed by the assembly and signed by Shagari, the deadlock seems unbreakable. No one, including Shagari, has a salary yet and they are living on emergency funds.

The angry legislators have moved to amend constitutionally the composition of the National Economic Council, replacing all the elected officials with technocrats, but the amendment process was purposely made cumbersome by the framers of Nigeria's constitution and the issue seems to have gone back to Shagari.

"This is propaganda the executive is using to make mass appeal to the people in the streets," said an incensed Deputy House Speaker Ibrahim. "They have accused us of looting the national treasury and our political careers are being destroyed by these 20 people on the National Economic Council."

By siding with Shagari, the governors may have lost some of their allies for the coming battle over Shagari's federal revenue-sharing plan.

Out of a $30 billion budget for next year, Shagari plans for the federal government to retain 55 percent and pass 30 percent to the states. Most of the remaining 15 percent will be for local governments, development of the new capital and ecology.

The governors have rejected the formula, demanding at least 50 percent for the states. They have gone to the National Assembly, where the final formula must be passed, to seek help.

"We're well aware of what the governors think they should get," said Shagari's adviser on constitutional matters, Godwin A. Odenigwe. "If we had allowed the govenors to determine the allocation, there wouldn't have been any for Nigeria."

The maneuvering, horse-trading and friction will continue, Odenigwe said, because the constitution has set it up that way.

"It is understood that there is always going to be some turbulence over who is encroaching on the powers of the other," he said. Generations of American politicians also have understood that.