  Brooks' Theorem is a fundamental result on graph colouring, stating that the
chromatic number of a graph is almost always upper bounded by its maximal
degree. Lov\'asz showed that such a colouring may then be computed in linear
time when it exists. Many analogues are known for variants of (di)graph
colouring, notably for list-colouring and partitions into subgraphs with
prescribed degeneracy. One of the most general results of this kind is due to
Borodin, Kostochka, and Toft, when asking for classes of colours to satisfy
"variable degeneracy" constraints. An extension of this result to digraphs has
recently been proposed by Bang-Jensen, Schweser, and Stiebitz, by considering
colourings as partitions into "variable weakly degenerate" subdigraphs. Unlike
earlier variants, there exists no linear-time algorithm to produce colourings
for these generalisations.
  We introduce the notion of (variable) bidegeneracy for digraphs, capturing
multiple (di)graph degeneracy variants. We define the corresponding concept of
$F$-dicolouring, where $F = (f_1,...,f_s)$ is a vector of functions, and an
$F$-dicolouring requires vertices coloured $i$ to induce a
"strictly-$f_i$-bidegenerate" subdigraph. We prove an analogue of Brooks'
theorem for $F$-dicolouring, generalising the result of Bang-Jensen et al., and
earlier analogues in turn.
  Our new approach provides a linear-time algorithm that, given a digraph $D$,
either produces an $F$-dicolouring of $D$, or correctly certifies that none
exist. This yields the first linear-time algorithms to compute (di)colourings
corresponding to the aforementioned generalisations of Brooks' theorem. In
turn, it gives an unified framework to compute such colourings for various
intermediate generalisations of Brooks' theorem such as list-(di)colouring and
partitioning into (variable) degenerate sub(di)graphs.
