1. Short title This Act may be cited as the Prohibiting Detention of Youth Status Offenders Act of 2017 . 2. Deinstitutionalization of status offenders Section 223 of the Juvenile Justice and Delinquency Prevention Act of 1974 ( 42 U.S.C. 5633 ) is amended— (1) in subsection (a)(11)— (A) in the matter preceding subparagraph (A), by striking shall, ; (B) in subparagraph (A)— (i) in clause (i), by adding and at the end; (ii) in clause (ii), by striking and at the end; (iii) by striking clause (iii); and (iv) in the matter following clause (iii), by striking and at the end; and (C) by adding at the end the following: (C) if a court determines that a juvenile should be placed in a secure detention facility or secure correctional facility for violating an order described in subparagraph (A)(ii)— (i) the court shall issue a written order that— (I) identifies the valid court order that the juvenile has violated; (II) specifies the factual basis for determining that there is reasonable cause to believe that the juvenile has violated the order; (III) includes findings of fact to support a determination that there is no appropriate less restrictive alternative available to placing the juvenile in a secure detention facility or secure correctional facility, with due consideration to the best interest of the juvenile; (IV) specifies the length of time, not to exceed 3 days, that the juvenile may remain in a secure detention facility or secure correctional facility; (V) includes a plan for the release of the juvenile from the secure detention facility or secure correctional facility; and (VI) may not be renewed or extended; and (ii) the court may not issue a subsequent order described in clause (i) relating to a juvenile, unless the juvenile violates a valid court order after the date on which the court issues an order described in clause (i)