In the shale matrix, organic matter (kerogen) is dispersed and embedded within an inorganic matrix, and its internal gas diffusion is a long-term process. Under the influence of the transient process and complex structure, pressure and Langmuir's strain constant in the matrix are typically distributed nonuniformly. This implies that the sorption-induced swelling/shrinkage in the matrix would also present a nonuniform distribution, and the resulting matrix−fracture mechanical interactions have significant impacts on gas flow in shale fractures as well as gas production. In this study, through the concepts of the swelling path and swelling triangle, the nonuniform swelling/shrinkage is characterized, thereby establishing the relationship between shale response and swelling/shrinkage behaviors. In addition, given that gas transport in organic and inorganic matrixes is typically governed by different mechanisms, the influence of the compositional heterogeneity on gas flow in the matrix is also investigated. Subsequently, novel shale permeability and gas flow models are developed, incorporating the effects of gas diffusion and the dispersed distribution of kerogen. The proposed concepts and developed models are validated by comparing simulation results with one set of experimental observations, as well as two sets of field production data. Our results suggest that neglecting the mechanisms induced by the transient process and complex structure would lead to inaccurate estimations of shale permeability during gas production and result in underestimations of both gas production rates and cumulative production.