This article has multiple issues. Please help talk page. (Learn how and when to remove these template messages)( or discuss these issues on the Learn how and when to remove this template message)
Onmy?d? (, also In'y?d?, lit. 'The Way of Yin and Yang') is a traditional Japanese esoteric cosmology, a mixture of natural science and occultism. It is based on the Chinese philosophies of Wu Xing (five elements) and yin and yang, introduced into Japan at the beginning of the 6th century. It was accepted as a practical system of divination. These practices were influenced further by Taoism, Buddhism and Shintoism, and evolved into the system of onmy?d? around the late 7th century. Onmy?d? was under the control of the imperial government, and later its courtiers, the Tsuchimikado family, until the middle of the 19th century, at which point it became prohibited as superstition.
In the 5th and 6th centuries, the principles of yin-yang and the Five Elements were transmitted to Japan from China and Baekje along with Buddhism and Confucianism, particularly by the obscure Korean monk Gwalleuk. Yin-yang and the Five Elements, as well as the divisions of learning to which they were linked - astronomy, calendar-making, the reckoning of time, divination, and studies based on observation of nature - were amalgamated into fortune telling. This process of judging auspicious or harmful signs present in the natural world, was accepted into Japanese society as a technique for predicting good or bad fortune in the human world. Such techniques were known mostly by Buddhist monks from mainland Asia, who were knowledgeable in reading and writing Chinese. Over time, demand from members of the imperial court who believed that onmy?d? divination would be helpful in decision-making, made it necessary for the laity to perform the art, and onmy?ji began to appear around the middle of the 7th century.
During the Heian period the nobility organized their lives around practices recommended by onmy?ji. The practice of "lucky and unlucky directions" provides an example. Depending on the season, time of day, and other circumstances, a particular direction might be bad luck for an individual. If one's house was located in that direction, such an individual was advised not to go back directly to his house but had to "change direction" (katatagae), by going in a different direction and lodging there. Such a person would not dare to go in the forbidden direction, but stayed where they were, even if that resulted in absence from the court, or passing up invitations from influential people.
In the 10th century Kamo no Tadayuki ( ) and his son Kamo no Yasunori, made great advancements in onmy?d?, astronomy and calendar science. From among their students emerged Abe no Seimei, who displayed superior skills in the divining arts of onmy?d?, by which he gained an uncommon amount of trust from the court society. Tadayuki and Yasunori passed on their skills in astronomy to Seimei while their advances in calendar-making went to Yasunori's son. From the end of the Heian period into the Middle Ages, astronomy and calendar science were completely subsumed into onmy?d?, and the Abe and Kamo families came to dominate the art.
Onmy?ji (, also In'y?ji) was one of the classifications of civil servants belonging to the Bureau of Onmy? in ancient Japan's ritsuryo system. People with this title were professional practitioners of onmy?d?.
Onmy?ji were specialists in magic and divination. Their court responsibilities ranged from tasks such as keeping track of the calendar, to mystical duties such as divination and protection of the capital from evil spirits. They could divine auspicious or harmful influences in the earth, and were instrumental in the moving of capitals. It is said that an onmy?ji could also summon and control shikigami.
Onmy?ji had political clout during the Heian period, but in later times when the imperial court fell into decline, their state patronage was lost completely. In modern-day Japan onmy?ji are defined as a type of priest, and although there are many who claim to be mediums and spiritualists, the onmy?ji continues to be a hallmark occult figure.