We develop a decomposition of firm-level revenue-based TFP growth into six margins: i) mean quantity-based TFP growth, ii) mean growth in demand shifters, iii) intensive margin specialization effects, iv) scope effects, v) product adding effects, and vi) product dropping effects. We then estimate and decompose firm-level revenue-based TFP gains generated by increased Chinese import competition and input access using Indian manufacturing data. We find evidence of quality upgrading in response to increased output market competition, and that firms tend to add new products that are lower productivity than their incumbent goods in response to increased input access.