A D.C. Superior Court judge today will order the Department of Human Resources to develop plans over the next 90 days for a wide range of reforms at the city's long-troubled institutions for juvenile offenders.

The 18-page order, signed by Judge Gladys Kessler, provides for improved medical and psychiatric care for children held at the institutions, requires tighter controls over distribution of medication, such as tranquilizers, and outlines job training programs for counselors and other staff members assigned to the detention facilities.

In addition, Kessler will order the city to submit a detailed plan within 45 days to remedy what she described as "the critical staffing-level inadequacies" at Cedar Knoll and Oak Hill, the city's two juvenile detention facilities, located in Laurel, Md.

Kessler's order, to be released in final form today, followed a lengthy inquiry that begin in her courtroom last September when three juveniles held at Cedar Knoll complained, through their attorneys, of sexual attacks, physical beatings and narcotics distribution at the institution.

The youths' allegations in two of the three cases were confirmed by supervisors from the Department of Human Resources, Kessler said.

As a result, Kessler appointed lawyers from the city's Public Defender Service to represent the interests of all juveniles at Cedar Knoll and then ordered city officials to participate in what grew into a broad investigation of the two detention facilities - known jointly as the Children's Center.

"I applaud most of the order," Remsky Atkinson, the administrator of Cedar Knoll, said yesterday. "Many of those things are things we have been trying to do for years."

Both Cedar Knoll and Oak Hill are administered by the Department of Human Resources. Oak Hill is a maximum security facility for juveniles convicted of serious crimes. Cedar Knoll is a medium-security facility that also is used as a detention center for juveniles awaiting trial.

A major portion of Kessler's order sets out a confidential procedure in which children who feel they have been abused or mistreated by staff members at the institution can file complaints with the institution administrators.

Within 30 days, Kessler said, forms must be made available throughout the institutions on which a child can notify authorities of a complaint and request an interview. The forms will be deposited in locked boxes accessible only to designated administrative personnel and social workers.

When a complaint is filed, the child's attorney or social worker is to be notified immediately and the child must be interviewed by an official of the institution within 24 hours of the complaint, Kessler said.

The official will then decide whether the complaint warrants additional investigation, Kessler said. She ordered that all allegations of physical or sexual abuse be investigated at length.

If the investigating official finds sufficient cause to believe that a staff member was responsible for physical abuse, the staff member "shall be removed from contact with children" until the complaint is resolved, Kessler said. Such a finding must be made within 72 hours of a complaint, the judge said.

Kessler ordered the institutions to provide the court with a report every six months on the number of complaints lodged and any disciplinary action taken in each case.

In an effort to cut down on physical assaults on children at Cedar Knoll, Kessler ordered the city to come up with an acceptable plan - within 30 days - to provide the children with individual, locked sleeping quarters, or to station a counselor during the night in the dormitories where the majority of the children now sleep.

Individual sleeping quarters are provided at Oak Hill.

Kessler also asked the department to give her a detailed explanation with 30 days of emergency medical and suicide prevention courses available to employes at the two institutions. In 1976, five youths either committed or attempted suicide while they were incarcerated at the Children's Center. All of those youths had been placed in locked isolation rooms.

Kessler's order provides that no child be detained in an isolation room for emotional or mental problems unless a doctor orders such treatment in writing.

Morevoer, Kessler said, the city must submit a detailed plan for identification and treatment of children who have emotional problems or who show symptoms of mental illness.

In connection with staff shortages at both facilities, Kessler gave the city 45 days to come up with a plan to hire one caseworker for every 30 juveniles, two psychologists for every 100 juveniles and a psychiatrist for every 100 juveniles to provide at least 20 hours of service a week.

Kessler also indicated she favored a proposal that requires all applicants to obtain clearence from the District police department before being accepted for employment at the institutions.