Noncovalent interactions between small-molecule drugs and protein targets assume a pivotal role in drug design. Moreover, the design of covalent inhibitors, forming covalent bonds with amino acid residues, requires rational reactivity for their covalent warheads, presenting a key challenge as well. Understanding the intricacies of these interactions provides a more comprehensive understanding of molecular binding mechanisms, thereby guiding the rational design of potent inhibitors. In this study, we adopted the fragment-based drug design approach, introducing a novel methodology to extract noncovalent and covalent fragments according to distinct three-dimensional (3D) interaction modes from noncovalent and covalent compound libraries. Additionally, we systematically replaced existing ligands with rational fragment substitutions, based on the spatial orientation of fragments in 3D space. Furthermore, we adopted a molecular generation approach to create innovative covalent inhibitors. This process resulted in the recombination of a noncovalent compound library and several covalent compound libraries, constructed by two commonly encountered covalent amino acids: cysteine and serine. We utilized noncovalent ligands in KLIFS and covalent ligands in CovBinderInPDB as examples to recombine noncovalent and covalent libraries. These recombined compound libraries cover a substantial portion of the chemical space present in the original compound libraries and exhibit superior performance in terms of molecular scaffold diversity compared to the original compound libraries and other 11 commercial libraries. We also recombined BTK-focused libraries, and 23 compounds within our libraries have been validated by former researchers to possess potential biological activity. The establishment of these compound libraries provides valuable resources for virtual screening of covalent and noncovalent drugs targeting similar molecular targets.