The present invention provides a heterocyclic compound of formula (I), a pharmaceutically acceptable salt thereof, a prodrug thereof or a hydrate thereof, wherein A, A' B, D, R1, R2 and R3 are as defined herein, a pharmaceutical composition comprising a compound of formula (I) as an active ingredient, methods of production, and methods of use thereof. Particularly, the present invention provides a compound of formula (I) useful for treating or preventing a disease, condition or disorder associated with protein kinases, preferably Janus Kinase family.本發明提供一種雜環式(I)化合物、其醫藥可接受鹽類、其前藥或其水合物,其中A、A'、B、D、R1、R2及R3如本文中之定義,包含式(I)化合物作為活性成分之醫藥組成物,製造方法及其之使用方法。尤其,本發明提供一種用於治療或預防與蛋白質激酶有關之疾病、症狀或失調之式(I)化合物,該激酶較佳為傑納斯激酶家族。