The Virginia State Penitentiary in Richmond is "the most shameful prison in America," with a filthy and roach-infested cellblock, air vents that blow heat into the buildings and unfair restrictions that keep inmates in their cells more than 22 hours a day, according to a civil rights group.

The National Prison Project, a prison reform advocacy group, yesterday asked Virginia Department of Corrections Director Edward Murray, in a letter, to improve conditions immediately at the penitentiary and to end the "lock-down" begun in the fall of 1988. In a lock-down, prisoners are restricted to their cells almost all of the time and have limited opportunites for recreation or study.

David Fathi, a project lawyer who toured the prison July 10, said the project is considering legal action against the department if "Mr. Murray doesn't take corrective action and the place doesn't close down."

The department intended to close the prison in June and to transfer its 685 prisoners to two new state prisons under construction. But delays have forced postponement of those plans, and the Richmond prison is now expected to remain open at least until November.

Wayne Farrar, a Corrections Department spokesman, said Murray had not seen the letter. He called the prison "old and dilapidated," and said, "that's why we wanted to close it. It's on its last gasp."

In the letter, the project said that one of the boxes that simultaneously unlocks all the cells on a certain tier was welded shut. As a result, each cell must be locked and unlocked by a guard, a time-consuming process that could be disastrous in a fire or similar emergency.

Farrar said the lock-down was in place because the locks are so frail that they cannot be opened and shut as many times as a normal schedule would call for. "For the safety of the inmates, we feel they should be locked in," he said.

The project also said in a statement that in one of the prison's buildings, "the smell of garbage and unwashed bodies was nearly overpowering. There was garbage and dirt everywhere -- on the floor, on the walls, and on the windows, about half of which were broken or missing completely."

The project said prisoners complained of not being given cleaning supplies to wash down their cells and that they had to buy roach traps for their cells. Farrar said cleaning supplies and roach traps are given free to inmates every two weeks but said he could not comment further on the conditions of the prison.

The project said there were so many beds in some cells that prisoners on the top bunk bed could not sit upright, that "standing water is everywhere" and that when the toilets are stopped up, prisoners "are told by the staff to defecate in a bag and throw it off the tier."

The project requested that the department immediately clean all cells and employ an exterminator, that fans be installed in each cell and prisoners be provided cleaning supplies at least once a week. It also asked that bedding be cleaned once a week and that inoperable showers, toilets and sinks be repaired within 24 hours. It also requested that prisoners be allowed out of their cells at least six hours a day.

In 1988, the state legislature approved the sale of $161 million in bonds to finance construction of a 2,100-bed prison in Greensville County, the largest in Virginia's history. Greensville is one of the prisons to which state penitentiary inmates will be transferred.