We develop a general framework to describe the cubically nonlinear interaction of a degenerate quartet of deep-water gravity waves in one or two spatial dimensions. Starting from the discretised Zakharov equation, and thus without restriction on spectral bandwidth, we derive a planar Hamiltonian system in terms of the dynamic phase and a modal amplitude. This is characterised by two free parameters: the wave action and the mode separation between the carrier and the sidebands. For unidirectional waves, the mode separation serves as a bifurcation parameter, which allows us to fully classify the dynamics. Centres of our system correspond to non-trivial, steady-state nearly resonant degenerate quartets. The existence of saddle-points is connected to the instability of uniform and bichromatic wave trains, generalising the classical picture of the Benjamin–Feir instability. Moreover, heteroclinic orbits are found to correspond to discrete, three-mode breather solutions, including an analogue of the famed Akhmediev breather solution of the nonlinear Schrödinger equation.