Computing shape function derivatives for each cell

I would suggest having a look at Automated shape differentiation in the Unified Form Language | SpringerLink

Note that shape derivatives are not computer per cell, but for each mesh node (usually in fenics a vector function space of first order Lagrange elements).

See for instance: Shape Derivatives in UFL - #2 by dokken as well