This paper presents a distributed framework to develop planning algorithms for optimal reconfiguration of multiagent systems in the presence of collision avoidance and final configuration constraints. First, reconfiguration problems are formulated as optimal control problems which are addressed using direct methods. Thus, reconfiguration problems become nonlinear programming problems subject to coupling variables, i.e., final configuration constraints, and coupling constraints, i.e., collision avoidance constraints. In our framework subgradient methods are adopted to include reconfiguration cases with non-differentiable objectives. Then, to develop distributed algorithms, final configuration constraints are tackled by primal decomposition, while collision avoidance constraints by dual decomposition. Since standard decomposition methods prevent the distributed implementation due to the existence of master problems, primal decomposition is combined with the distributed consensus algorithm and dual decomposition is integrated with the incremental subgradient method. In the end, this framework is employed to develop distributed planning algorithms for optimal reconfiguration of satellite clusters.