  We present a general algorithm based on the concept of form-invariance which
can be used for generating phantom cosmologies. It involves linear
transformations between the kinetic energy and the potential of the scalar
field, and transforms solutions of the Einstein-Klein-Gordon equations which
preserve the weak energy condition into others which violate it, while keeping
the energy density of the field positive. All known solutions representing
phantom cosmologies are unified by this procedure. Using the general algorithm
we obtain those solutions and show the relations between them. In addition, the
scale factors of the product and seed solutions are related by a generalization
of the well-known $a\to a^{-1}$ duality.
