  The method of double extension, introduced by A.~Medina and Ph.~Revoy, is a
procedure which decomposes a Lie algebra with an invariant symmetric form into
elementary pieces. Such decompositions were developed for other algebras, for
instance for Lie superalgebras and associative algebras, Filippov $n$-algebras
and Jordan algebras.
  The aim of this note is to find a unified approach to such decompositions
using the derived bracket formalism. More precisely, we show that any
commutative $n$-ary superalgebra with a skew-symmetric invariant form can be
obtained inductively by taking orthogonal sums and generalized double
extensions.
