  We develop a theory of non-linear cosmological perturbations at superhorizon
scales for a scalar field with a Lagrangian of the form $P(X,\phi)$, where
$X=-\partial^{\mu}\phi\partial_{\mu}\phi$ and $\phi$ is the scalar field. We
employ the ADM formalism and the spatial gradient expansion approach to obtain
general solutions valid up to the second order in the gradient expansion. This
formulation can be applied to, for example, DBI inflation models to investigate
superhorizon evolution of non-Gaussianities. With slight modification, we also
obtain general solutions valid up to the same order for a perfect fluid with a
general equation of state $P=P(\rho)$.
