What is the correct definition of a regular point of a map in algebraic geometry?
More specifically, let $f:X\to Y$ be a map of varieties with $f(p) = q$, and let $Z=f^{-1}(q)$. Let $\hat{X}$ be the formal completion of $X$ at $p$, $\hat{Y}$ the formal completion of $Y$ at $q$, and $\hat{Z}$ the formal completion of $Z$ at $p$. I would like a nice condition on $f$ that implies that $$\hat{X}\cong \hat{Y}\times\hat{Z}.$$ Intuitively, this should be an algebraic version of the statement that $p$ is a regular point of $f$.
I do not want to make any smoothness assumptions about $X$ or $Z$. In particular, if $X = Y \times Z$ and $f$ is the projection onto $Y$, then every point of $Y\times Z$ should be a regular point of $f$, even if $Z$ is singular. (The conclusion about formal neighborhoods is obviously true in this trivial case!)