We study algebraic dynamical systems (and, more generally, a-varieties) (Phi : A(c)(n) given by coordinatewise univariate polynomials by refining an old theorem of Ritt on compositional identities amongst polynomials. More precisely, we find a nearly canonical way to write a polynomial as a composition of "clusters" from which one may easily read off possible compositional identities. Our main result is an explicit description of the (weakly) skew-invariant varieties, that is, for a fixed field automorphism a : C C those algebraic varieties X C A for which (I)(X) C X. As a special case, we show that if f (x) E C[x] is a polynomial of degree at least two that is not conjugate to a monomial, Chebyshev polynomial or a negative Chebyshev polynomial, and X C a is an irreducible curve that is invariant under the action of (x, y) (f (x), f (y)) and projects dominantly in both directions, then X must be the graph of a polynomial that commutes with f under composition. As consequences, we deduce a variant of a conjecture of Zhang on the existence of rational points with Zariski dense forward orbits and a strong form of the dynamical Manin-Mumford conjecture for liftings of the Frobenius. We also show that in models of AGFA, a disintegrated set defined by sigma(x) - f (x) for a polynomial f has Morley rank one and is usually strongly minimal, that model theoretic algebraic closure is a locally finite closure operator on the nonalgebraic points of this set unless the skewconjugacy class of f is defined over a fixed field of a power of sigma, and that nonorthogonality between two such sets is definable in families if the skewconjugacy class of f is defined over a fixed field of a power of sigma.