Excellent high-temperature mechanical properties of Ni-based single-crystal superalloys (NSCSs) are attributed to the yield strength anomaly of ${\mathrm{Ni}}_{3}\mathrm{Al}$ that is intimately related to generalized stacking fault energies (GSFEs). Therefore, clarifying the effects of alloying elements on the GSFEs is of great significance for alloys design. Here, by means of ab initio density functional theory calculations, we systematically calculated the GSFEs of different slip systems of Ni and ${\mathrm{Ni}}_{3}\mathrm{Al}$ without and with alloying elements using the alias shear method. We obtained that for Ni, except for magnetic elements Mn, Fe, and Co, most of the alloying elements decrease the unstable stacking fault energy (${\ensuremath{\gamma}}_{\text{USF}}$) of the $[01\overline{1}](111)$ and $[11\overline{2}](111)$ slip systems and also decrease the stable stacking fault energy (${\ensuremath{\gamma}}_{\text{SF}}$) of the $[11\overline{2}](111)$ slip system. Interestingly, the reduction effects exhibit a strong correlation with the inverse of atom radii. For ${\mathrm{Ni}}_{3}\mathrm{Al}$, most of the alloying elements in groups IIIB--VIIB show a strong Al site preference. Except for Mn and Fe, the elements in groups VB--VIIB and the first column of group VIII increase the values of ${\ensuremath{\gamma}}_{\text{USF}}$ of different slip systems of ${\mathrm{Ni}}_{3}\mathrm{Al}$, which makes the slip deformation and dislocation emits difficult. On the other hand, the elements in groups IIIB--VIIB also increase the value of ${\ensuremath{\gamma}}_{\text{SF}}$, and thus reduce the stability of the antiphase boundary, complex stacking fault, and superlattice intrinsic stacking fault of ${\mathrm{Ni}}_{3}\mathrm{Al}$. We found that Re is an excellent strengthening alloying element that significantly increases the slip barrier of the tailing slip process for Ni, and also enhances the slip barrier of the leading slip process of three slip systems for ${\mathrm{Ni}}_{3}\mathrm{Al}$. W and Mo exhibit similar effects as Re. We predicted that Os, Ru, and Ir are good strengthening alloying elements as well, since they show the strengthening effects on both the leading and the tailing slip process for Ni and ${\mathrm{Ni}}_{3}\mathrm{Al}$. This work established an exhaustive dictionary of the effects of various alloying elements on the GSFEs of both Ni and ${\mathrm{Ni}}_{3}\mathrm{Al}$ phases, which would help to guide the design of next-generation high-performance NSCSs.