In this paper we present a systematic method to solve the variational problem
of the derivation of a self-consistent Kohn-Sham field from an arbitrary local
energy functional. We illustrate this formalism with an application in nuclear
physics and give the general mean field associated to the widely used Skyrme
effective interaction