TOKYO (AP) _ Ryoko Ishida is dead because she was a few seconds late in slipping through the school gate.

Television programs provide constant reminders of the tragedy by showing the closing of the quarter-ton gate of the Kobe Takatsuka High School, which crushed the 15-year-old's skull.

Her death caused an outcry by critics who feel Japan's acclaimed secondary education system is far too rigid. Parents and educators generally defend the rules.

Miss Ishida was killed July 6 by the school gate in Kobe, a port city 270 miles west of Tokyo. A teacher, Toshihiko Hosoi, 39, pushed the gate shut promptly at 8:30 a.m. to teach the children a ''lesson'' about promptness.

Hosoi has been fired and charged with professional negligence resulting in death. Other school and education officials have been disciplined.

Commentators and human rights groups blame the death on overzealous application of strict rules.

At a minimum, schools require students to wear uniforms. These often are sailor-type dresses for girls and black Prussian-style outfits for boys.

Some prescribe white socks and even white underwear, crewcuts for boys and pageboy haircuts for girls, with black hair bands.

Students at many schools are not allowed to patronize coffee shops or obtain drivers' licenses. Rules even describe exactly what a student may bring to school and list what is banned, such as playing cards and hair dryers.

''In some schools, if you go from your neighborhood to a neighborhood where there is another high school, you have to bring your high school identification card,'' said Seiji Fujii, a writer whose frequently criticizes the rules.

Enforcement usually is strict. Teachers patrol neighborhoods, inspect students at the school gate as they arrive, and search book bags and luggage.

Punishment often ranges from humiliating to violent. Students were buried in sand up to their necks in one recent case and corporal punishment is widely practiced, although it has been illegal since World War II ended.

''Teachers often slap, punch, kick,'' said Morikatsu Imahashi, an opponent of corporal punishment who teaches at Ibaraki University in Mito, 60 miles northeast of Tokyo.

Imahashi demonstrated with his hands how teachers sometimes clap their hands suddenly over students' ears. Fujii, the writer, said the practice broke the eardrum of a friend.

Five deaths from corporal punishment were reported in 1985-1987. After a student's death in 1988, the Education Ministry advised schools to ease their rules.

A few students have filed lawsuits, including a Tokyo senior expelled from a private high school for waving her hair, said Yasuhiro Yoshimine, a lawyer active in children's rights issues.

In Kobe, where about 30 percent of junior high and high school boys are required to wear crewcuts, more than 3,000 names of individuals and groups appeared in a March newspaper advertisment against the rule.

Rebellion can be costly. Adverse comments on obedience might show up in the secret record that follows a student from grade school and helps determine whether he or she will get into high school or win a job recommendation.

''In Japan, if the parents insist on their rights, they will be called strange, a problem,'' said Yoshimine, the lawyer. In Japan's homogeneous society, being seen as different or a problem is a major stigma.

''It can be tough,'' said Kurumi Tanabe, a 40-year-old mother from the Mito area. ''I got many letters criticizing me, saying the idea is bad, that I should have my son cut his hair.''

Kentaro Tanabe, 14, is one of four in a 1,000-student middle school who refuses to wear a crewcut.

Some students crack under the strain. Newspapers occasionally carry reports of students beating their teachers, and many who refuse to attend school blame strict rules.

Strong regulations are popular with teachers and school authorities. In a 1988 survey, 95 percent of middle-school teachers responding agreed with the statement that ''disorderly attire is a sign of mental disorder.''

Atsuo Nomura, principal of Kobe Takatsuka told students after Miss Ishida was killed: ''If all of you had woken up 10 minutes earlier, the teacher would never have had to raise his voice. I don't mean to put the responsibility on your side, but now I still want all of you to improve your life habits.''

Nomura later resigned.

''Parents generally believe stricter rules mean better education,'' said Tetsuo Tsujimura, who directs the Education Ministry's middle-school division and feels some rules are too strict.

Critics say tough school regulations and rigid curriculums suffocate individual differences and hurt Japanese education.

Strict rules were adopted by schools in the 19th century. Enforcement eased in the 1960s, but tightened again in the early 1980s in response to unruliness among teen-agers.

Yoshimine and others say the strict regulations reflect authoritarian attitudes left over from prewar militarism.

Since April, the Education Ministry has required schools to display the national flag and play the unofficial national anthem, both symbols of the prewar years, at entrance and graduation ceremonies.

News reports have linked rigid education with grisly crimes, such as the case of four boys who kidnapped, raped and beat a high school girl, then encased her body in a drum of concrete. At the sentencing last month, their lawyer blamed an ''ailing society'' for the boys' actions.