In the recent submicron technologies, the pattern formation on photomasks is increasing in its difficulty owing to the complexity of optical proximity effect correction (OPC) and resolution enhancement techniques (RET). The detection and repair of critical patterns after OPC or RET have become essential procedures for photomask preparation, and design rule check (DRC) or lithography simulation tools have often been used to verify these patterns. However, the detection and repair of critical patterns have been becoming an excessive burden in the development of lithography processes and mask data processing. In this paper, we describe how to detect and repair these OPC critical patterns in lithography using the OPC-DFM rule, which can be derived from the OPC extraction test element group (TEG) effectively and easily. This technology enables the removal of OPC critical patterns before photomask preparation.