Compounds represented by general formula (I) (all of the symbols in the formula conform to the definitions in the Description) are compounds that, in addition to having a Btk-selective inhibitory activity, exhibit an excellent metabolic stability and can avoid hepatotoxicity or the like, and as a consequence can provide safe therapeutic agents for diseases in which B cells or mast cells participate.一種通式(I)所示之化合物,(式中,全部符號如說明書所記載)為除具有Btk之選擇性抑制活性外,代謝穩定性亦優異,可避免肝毒性等之化合物,因此可製成安全之B細胞或肥胖細胞參與之疾病之治療劑。