California, United States of America
The following excerpt is from People v. Harvey, B275685 (Cal. App. 2017):
1. Penal Code section 1368, states, in relevant part, "(a) If, during the pendency of an action and prior to judgment, . . . a doubt arises in the mind of the judge as to the mental competence of the defendant, he or she shall state that doubt in the record and inquire of the attorney for the defendant whether, in the opinion of the attorney, the defendant is mentally competent. . . .  (b) If counsel informs the court that he or she believes the defendant is or may be mentally incompetent, the court shall order that the question of the defendant's mental competence is to be determined in a hearing which is held pursuant to Sections 1368.1 and 1369." (Italics added.)
2. People v. Superior Court (Romero) (1996) 13 Cal.4th 497 (Romero).