  The electronic structure and interactions of kagome materials such as 1:1
(FeGe class) and 1:6:6 (MgFe$_6$Ge$_6$ class) are complicated and involve many
orbitals and bands at the Fermi level. Current theoretical models treat the
systems in an $s$-orbital kagome representation, unsuited and incorrect both
quantitatively and qualitatively to the material realities. In this work, we
lay the basis of a faithful framework of the electronic model for this large
class of materials. We show that the complicated ``spaghetti" of electronic
bands near the Fermi level can be decomposed into three groups of $d$-Fe
orbitals coupled to specific Ge orbitals. Such decomposition allows for a clear
analytical understanding (leading to different results than the simple
$s$-orbital kagome models) of the flat bands in the system based on the
$S$-matrix formalism of generalized bipartite lattices. Our three minimal
Hamiltonians can reproduce the quasi-flat bands, van Hove singularities,
topology, and Dirac points close to the Fermi level, which we prove by
extensive ab initio studies. We also obtain the interacting Hamiltonian of $d$
orbitals in FeGe using the constraint random phase approximation (cRPA) method.
We then use this as a fundamental ``LEGO"-like building block for a large
family of 1:6:6 kagome materials, which can be obtained by doubling and
perturbing the FeGe Hamiltonian. We applied the model to its kagome siblings
FeSn and CoSn, and also MgFe$_6$Ge$_6$. Our work serves as the first complete
framework for the study of the interacting phase diagram of kagome compounds.
