  We use the resource theory framework of generalized contextuality as a tool
for analyzing the structure of prepare-and-measure scenarios. We argue that
this framework is capable of simplifying proofs for witnessing quantum
contextuality and straightens known arguments regarding the robustness of
experimental implementations thereof. As a case study, we witness quantum
contextuality associated with any nontrivial noncontextuality inequality for a
class of scenarios by noticing a connection between the resource theory and
measurement simulability. We also expose a rule for composing behaviours that
allows one to build complex scenarios from simpler ones, which provides an
explanation of the non-contextual polytope structure for complex scenarios and
facilitates finding possible quantum violations. In particular, we show that
the state-dependent cloning scenario inherits contextuality from a simpler
scenario, and we engineer a complex prepare-and-measure scenario that has
quantum contextual violations for any noncontextuality inequality. Witnessing
contextuality from the abstract formalism of resource theories represents a
potential new framework for demonstrating quantum-over-classical advantages for
practical tasks.
