Onmyōdō

'The Way of Yin and Yang') is a technique that uses knowledge of astronomy and calendars to divine good fortune in terms of date, time, direction and general personal affairs, originating from the philosophy of the yin-yang and the five elements.

[2][1] 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.

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.

On the other hand, since onmyōji did not have to perform misogi or fast, they were able to deal with kegare (uncleanliness) more easily, and they expanded their activities beyond the support of Shinto priests.

[1] 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.

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 in the Imperial Court.

[1] Onmyōji (陰陽師, also In'yōji) was one of the classifications of civil servants belonging to the Bureau of Onmyō [ja] in ancient Japan's ritsuryo system.

Abe no Seimei , a famous onmyōji