One major bottleneck in natural product drug development is derivatization, which is pivotal for fine tuning lead compounds. A promising solution is modifying the biosynthetic machineries of middle molecules such as macrolides. Although intense studies have established various methodologies for protein engineering of type I modular polyketide synthase(s) (PKSs), the accurate targeting of desired regions in the PKS gene is still challenging due to the high sequence similarity between its modules. Here, we report an innovative technique that adapts in vitro Cas9 reaction and Gibson assembly to edit a target region of the type I modular PKS gene. Proof-of-concept experiments using rapamycin PKS as a template show that heterologous expression of edited biosynthetic gene clusters produced almost all the desired derivatives. Our results are consistent with the promiscuity of modular PKS and thus, our technique will provide a platform to generate rationally designed natural product derivatives for future drug development.