BackgroundThe quality of school-based sex and relationships education (SRE) is variable in the UK. Digitally-based interventions can usefully supplement teacher-delivered lessons and positively impact sexual health knowledge. Designed to address gaps in core SRE knowledge, STASH (Sexually Transmitted infections And Sexual Health) is a peer-led social network intervention adapted from the successful ASSIST (A Stop Smoking in Schools Trial) model, and based on Diffusion of Innovation theory. This paper describes how the STASH intervention was developed and refined.MethodsDrawing on the Six Steps in Quality Intervention Development (6SQuID) framework, we tested a provisional programme theory through three iterative stages -: 1) evidence synthesis; 2) intervention co-production; and 3) adaptation - which incorporated evidence review, stakeholder consultation, and website co-development and piloting with young people, sexual health specialists, and educators. Multi-method results were analysed in a matrix of commonalities and differences.ResultsOver 21 months, intervention development comprised 20 activities within the three stages. 1) We identified gaps in SRE provision and online resources (e.g. around sexual consent, pleasure, digital literacy), and confirmed critical components including the core ASSIST peer nomination process, the support of schools, and alignment to the national curriculum. We reviewed candidate social media platforms, ruling out all except Facebook on basis of functionality restrictions which precluded their use for our purposes. 2) Drawing on these findings, as well as relevant behaviour change theories and core elements of the ASSIST model, we co-developed new content with young people and other stakeholders, tailored to sexual health and to delivery via closed Facebook groups, as well as face-to-face conversations. 3) A pilot in one school highlighted practical considerations, including around peer nomination, recruitment, awareness raising, and boundaries to message sharing. From this, a revised STASH intervention and programme theory were co-developed with stakeholders.ConclusionsSTASH intervention development required extensive adaptation from the ASSIST model. Although labour intensive, our robust co-development approach ensured that an optimised intervention was taken forward for feasibility testing. Evidencing a rigorous approach to operationalising existing intervention development guidance, this paper also highlights the significance of balancing competing stakeholder concerns, resource availability, and an ever-changing landscape for implementation.Trial registrationISRCTN97369178.