generate cap scripts