  We consider the explicit construction of resource states for
measurement-based quantum information processing. We concentrate on
special-purpose resource states that are capable to perform a certain operation
or task, where we consider unitary Clifford circuits as well as non-trace
preserving completely positive maps, more specifically probabilistic operations
including Clifford operations and Pauli measurements. We concentrate on $1 \to
m$ and $m \to 1$ operations, i.e. operations that map one input qubit to $m$
output qubits or vice versa. Examples of such operations include encoding and
decoding in quantum error correction, entanglement purification or entanglement
swapping. We provide a general framework to construct optimal resource states
for complex tasks that are combinations of these elementary building blocks.
All resource states only contain input and output qubits, and are hence of
minimal size. We obtain a stabilizer description of the resulting resource
states, which we also translate into a circuit pattern to experimentally
generate these states. In particular, we derive recurrence relations at the
level of stabilizers as key analytical tool to generate explicit (graph-)
descriptions of families of resource states. This allows us to explicitly
construct resource states for encoding, decoding and syndrome readout for
concatenated quantum error correction codes, code switchers, multiple rounds of
entanglement purification, quantum repeaters and combinations thereof (such as
resource states for entanglement purification of encoded states).
