We propose the Cosmic Web Detachment (CWD) model, a framework to interpret the star-formation history of galaxies in a cosmological context. The CWD model unifies several starvation mechanisms known to disrupt or stop star formation into one single physical framework. Galaxies begin accreting star-forming gas at early times via a network of primordial filaments, simply related to the pattern of density fluctuations in the initial conditions. But when streams cross on intergalactic scales, this pattern is disrupted, and the galaxy detaches from its primordial filaments, ending the accretion of cold gas. We argue that CWD encompasses known external processes halting star formation, such as harassment, strangulation and starvation. On top of these external processes, internal feedback processes such as AGN contribute to stop in star formation as well. We introduce a simple formalism to identify CWD events and quenched galaxies in dark-matter N-body simulations. With it we reproduce and explain, in the context of CWD, several observations including downsizing, the cosmic star formation rate history, the galaxy mass-color diagram and the dependence of the fraction of red galaxies with mass and local density.