  Let $C$ be a symmetrizable generalized Cartan matrix. We introduce four
different versions of double Bott-Samelson cells for every pair of positive
braids in the generalized braid group associated to $C$. We prove that the
decorated double Bott-Samelson cells are smooth affine varieties, whose
coordinate rings are naturally isomorphic to upper cluster algebras.
  We explicitly describe the Donaldson-Thomas transformations on double
Bott-Samelson cells and prove that they are cluster transformations. As an
application, we complete the proof of the Fock-Goncharov duality conjecture in
these cases. We discover a periodicity phenomenon of the Donaldson-Thomas
transformations on a family of double Bott-Samelson cells. We give a (rather
simple) geometric proof of Zamolodchikov's periodicity conjecture in the cases
of $\Delta\square \mathrm{A}_r$.
  When $C$ is of type $\mathrm{A}$, the double Bott-Samelson cells are
isomorphic to Shende-Treumann-Zaslow's moduli spaces of microlocal rank-1
constructible sheaves associated to Legendrian links. By counting their
$\mathbb{F}_q$-points we obtain rational functions which are Legendrian link
invariants.
