Spellcasting
If the NPC can cast spells then you can automate the population of the actual spells into the NPC sheet. Additionally with the correct wording FG will work out the attacks and spell save DCs where those are present in the spell/ The trait should be named 'Spellcasting' and the wording should be as follows:
The [NPC] is a nth-level spellcaster. Its spellcasting ability is [ability]. The [NPC] has the following spells prepared.
Cantrips (at will): <spell name>,<spell name>
1st level (4 slots): <spell name>, <spell name>
2nd level (2 slots): <spell name>, <spell name>
It is important that the wording is exactly as above including the punctuation. All spell names should be in lower case separated by a comma.
If the NPC has innate spellcasting abilities then replace the heading with 'Innate Spellcasting' and replace the 1st level, 2nd level etc with 3/day, 1/day or whatever the NPC rate of casting is.
If you want to override the automatic calculation of spell save and attack rolls replace the first line with this
The [NPC] is a nth-level spellcaster. Its spellcasting ability is [ability] (spell save DC #, +# to hit with spell attacks). The [NPC] has the following spells prepared.
(thanks jkadje)