Moisture-enabled electric generations (MEGs) are highly promising in nextgeneration energy conversion, while those derived from sustainable biomass are still in their infancy. Protein nanostructures possess intriguing abilities to harness ion transportation for bioelectricity generation. Herein, quality-enhancing MEGs with silk cocoon-like structure were developed. In this context, silk fibroin nanofiber film was first electrospun, and a sericin concentration gradient along the thickness direction was created through a simple spraying technique. Owing to the good moisture absorption capacity, abundant dissociated ions, and numerous micro-nanoscale channels, the maximum open-circuit voltage and short-circuit current of the prepared MEGs were 276 mV and 70 nA, respectively, at 95% relative humidity. In addition, MEG can deliver voltage for nearly 2.5 h without degradation. Because of cell membrane blebbing induced by sericin, the bacteriostatic rate of the MEGs against both S. aureus and E. coli was more than 80%. Particularly, the MEGs demonstrated successful applications in self-powered sensors, including a human respiratory rate and different states of human movement. Our study offers insight into the future development of flexible, efficient, and easily fabricated protein-based MEGs.