A Method, Not a Mystery
Qimen Dunjia (奇門遁甲) is one of the Three Cosmic Boards (三式, sanshi) of Chinese temporal analysis, alongside Taiyi (太乙) and Liuren (六壬). Of the three, it is the most spatially oriented. Where Taiyi addresses cosmic-scale cycles and Liuren focuses on human affairs, Qimen Dunjia maps temporal conditions onto directional space — producing a board that tells you which directions are favorable and which are hostile at any given moment.
The name itself is a technical description. Qi (奇) refers to the Three Wonders — the Heavenly Stems Yi, Bing, and Ding — which are the system's favorable markers. Men (門) refers to the Eight Gates, each carrying a specific quality: Rest, Death, Wound, Block, Open, Fright, Life, View. Dun (遁) means to hide or conceal. Jia (甲) is the first and most important Heavenly Stem, representing the commander. The stem Jia never appears openly on the board; it hides beneath the Six Instruments (六儀). Hence: Strange Gates, Hidden Armor.
The system was historically associated with military strategy. Its language is full of formations, deployments, and tactical assessments. But the underlying mechanics are a general-purpose framework for evaluating the quality of time-direction combinations. The military vocabulary reflects the context in which the system was most valued, not a limitation on what it can analyze.
The Nine Palaces
The foundation of Qimen Dunjia is the Luoshu (洛書) — the 3x3 magic square where every row, column, and diagonal sums to fifteen. The arrangement is 2-9-4 across the top, 7-5-3 across the middle, 6-1-8 across the bottom. Each palace corresponds to a compass direction and a trigram: Palace 1 is Kan (north), Palace 9 is Li (south), and so on around the eight directions, with Palace 5 at the center.
The Siku Quanshu editors traced this arrangement to the Da Dai Liji's record of the ancient Mingtang (明堂) — the ritual hall where the sovereign faced each direction in its proper season. They also identified the Yiwei Qianzaodu's description of Taiyi traversing the Nine Palaces as the specific origin of Qimen Dunjia's method. The system, they concluded, 'actually arose from this; the fangji specialists did not know to seek its source and therefore falsely attributed it' to the Yellow Emperor.
In practice, the Nine Palaces serve as the board. All the moving parts of the system — stars, gates, stems, spirits — are distributed across these nine positions. Reading a Qimen Dunjia chart means reading which combinations have landed in which palaces, and therefore which directions carry which qualities at that moment.
The Moving Parts
Several layers of information rotate across the Nine Palaces. The Three Wonders (三奇) are the stems Yi, Bing, and Ding. Yi is called the Sun Wonder because the sun is 'born' at Yi; Bing and Ding are the Moon Wonder and Star Wonder respectively, associated with the brightness of the moon and the South Pole Star. These are the system's favorable elements — finding a Wonder in a palace elevates its quality.
The Six Instruments (六儀) are the stems Wu, Ji, Geng, Xin, Ren, and Gui. They serve as hosts for the hidden Jia stem: Jia hides beneath Wu in the first cycle (甲子), beneath Ji in the second (甲戌), and so on. Since Jia is the head of all yang stems and represents the commander, its concealment beneath the instruments is the literal meaning of 'Hidden Jia' — the general does not expose himself on the field.
The Eight Gates (八門) each carry a distinct character. The three auspicious gates are Open (開), Rest (休), and Life (生). View (景) is conditionally positive. The four inauspicious gates are Death (死), Wound (傷), Block (杜), and Fright (驚). The Nine Stars (九星) — Celestial Canopy, Celestial Fragrance, Celestial Charge, Celestial Assistant, Celestial Bird, Celestial Heart, Celestial Pillar, Celestial Benevolence, and Celestial Brilliance — add another evaluative layer, each with seasonal strengths and weaknesses.
Finally, the Eight Spirits provide a third overlay: Nine Heavens (suitable for open display of force), Nine Earths (suitable for concealment), Taiyin (favorable for hiding), Six Harmonies (favorable for escape), and others. The key principle stated in the Yanbo Diaosou Fu — the foundational mnemonic poem included in the Dunjia Yanyi — is that 'when an auspicious gate happens to combine with a Three Wonder, then indeed all affairs are suitable. But one must also check alongside: the remaining palaces must not have even a slight flaw.'
Yang and Yin Sequences
The system divides the year at the two solstices. From the Winter Solstice, when yang energy is born, the Yang Sequence (陽遁) governs: instruments are distributed forward and wonders are placed in reverse across the palaces. From the Summer Solstice, when yin energy is born, the Yin Sequence (陰遁) reverses this arrangement. Each sequence contains nine standard layouts, numbered 1 through 9, yielding eighteen layouts total.
Which layout applies at any given time depends on the solar term and the three-epoch subdivision within it. The text states a clear hierarchy: 'Yearly auspiciousness is not as good as monthly auspiciousness; monthly is not as good as daily; daily is not as good as hourly. When the hourly and daily auspiciousness coincide, this is even more auspicious.' The hourly layout — rotating every two hours through the day — is the most precise and most commonly used level of analysis.
The mechanism for linking the solar calendar to the layout sequence is called 'leaping spirit and linking qi' (超神接氣), which the text describes as 'the very key within Dunjia.' It handles the mismatch between the five-day pentad cycle and the irregular intervals between solar terms, inserting intercalary adjustments to keep the layouts synchronized with the actual astronomical calendar.
What the Dunjia Yanyi Actually Says
The Dunjia Yanyi (遁甲演義) is a four-juan manual by Cheng Daosheng (程道生) of Haining, compiled during the Ming dynasty and preserved in the Siku Quanshu. The title means roughly 'Interpretation of Dunjia.' It is not the oldest Qimen text, but it is one of the most systematic, and the Siku editors considered it the best available treatment of the subject.
Their assessment is worth quoting: 'Among all the fangji arts, it is the most rationally structured.' They praised it as 'concise in purpose yet comprehensive in expression,' noting that its discussion of natal destiny and current-year calculations contained theories 'not found in other texts.' They also acknowledged the system's scope: its palace divisions connect with calendar science, its directional methods connect with Taiyi, and its principles of mounting, bearing, generating, and overcoming connect with Liuren and astrology. 'From wind and cloud to weft-text prognostication, nothing is left uncovered.'
The text covers the complete system from origin legends through practical calculation methods. Juan 1 presents the historical transmission, the yearly/monthly/daily/hourly layout methods, and the Yanbo Diaosou Fu mnemonic poem. Juan 2 catalogs the named formations, both auspicious and inauspicious. Juan 3 details the Nine Stars and Eight Gates with their seasonal correspondences, plus the layout construction method. Juan 4 provides the eighteen layout diagrams and supplementary ritual practices.
Named Formations
The core of practical Qimen Dunjia is pattern recognition. When the moving parts align in certain configurations, the result is a named formation (格局) with a defined meaning. The auspicious formations read like a commander's wish list.
Heaven Concealment (天遁): Life Gate combines with the Bing stem over Ding — 'one obtains the concealment of the moon's brilliance.' Earth Concealment (地遁): Open Gate combines with Yi over Ji — 'one obtains the concealment of the sun's essence.' Man Concealment (人遁): Rest Gate combines with Ding at the Taiyin position — 'one obtains the concealment of the star's essence.' These three are the supreme configurations, each suited for hiding one's form and concealing one's traces.
Other favorable patterns include Dragon Turns Its Head (青龍回首) — Jia superimposed on Bing, favorable for 'projecting might across ten thousand li' — and Bird Falls into Its Nest (飛鳥跌穴) — Bing superimposed on Jia, where 'in a hundred battles, a hundred victories.' There are also the Three Deceptions and Five Feints (三詐五假), configurations for specific tactical situations from stealth operations to retreat.
The inauspicious formations are equally vivid. White Tiger Rampages (白虎猖狂): Xin superimposed on Yi — 'both host and guest are harmed.' Soaring Serpent Leaps the Precipice (騰蛇躍蹻): Gui superimposed on Ding — 'lost on the road, worried and fearful, unable to advance.' Great Blocking (大格): Geng superimposed on Gui — 'plans cannot succeed; the person sought is absent, and one invites their own blame instead. Carts break and horses die.' The Crouching Chant (伏吟) and Counter Chant (反吟) formations — where the stars remain stuck in their home palaces or land in their exact oppositions — are described as the most inauspicious of all.
Historical Context and Honest Attribution
The traditional origin story credits the Yellow Emperor, who supposedly created the system's original 4,320 layouts to defeat Chiyou at the Battle of Zhuolu. A divine spirit bestowed the formula in a dream; Feng Hou (the Wind Duke) developed it into a text. Later, the Duke of Zhou (Taigong) reduced the system to 72 active layouts, and Zhang Liang in the Han dynasty streamlined it further to the 18 layouts still used today.
The Siku editors handled this legend with characteristic directness: 'These attributions need no refutation.' They then traced the actual historical record. The Han dynasty bibliography mentions only tangentially related texts. The name 'Dunjia' first appears in poetry of Emperor Jianwen of Liang and in the Chen dynasty histories — suggesting the art flourished during the Northern and Southern Dynasties period (420-589 CE). The Sui bibliography records thirteen related works. By the Song dynasty the tradition was widespread, but its entanglement with military adventurism (the editors cite the Jingkang-era disaster of Guo Jing, who 'through occult delusion brought disaster to the state') and the addition of Daoist talismanic practices made it 'increasingly bizarre and inscrutable.' Liuren flourished while Dunjia nearly died out.
The Dunjia Yanyi represents a restoration effort — an attempt to recover the rational core of the system from beneath layers of accumulated mystification.
Relationship to the I Ching and Other Systems
Qimen Dunjia shares its foundations with the I Ching. Both systems are built on yin-yang theory, the Five Phases, and the Heavenly Stems and Earthly Branches. The Eight Trigrams structure both the I Ching's hexagrams and Qimen Dunjia's Nine Palaces. The concept of seasonal variation in quality — that the same element or star means different things at different times of year — runs through both traditions.
But Qimen Dunjia adds something the I Ching does not have: explicit spatial analysis. A hexagram reading evaluates a situation in time. A Qimen Dunjia chart evaluates a situation in time and space simultaneously, telling you not just whether conditions are favorable but in which direction the favorable conditions lie. This is why the system was valued for military strategy, construction siting, and travel planning — domains where direction matters as much as timing.
The relationship to other Chinese temporal systems is complementary. The Xieji Bianfang Shu provides per-activity date evaluation based on an imperial-standard ruleset. Liu Yao provides structural hexagram analysis for specific questions. Qimen Dunjia provides directional-temporal evaluation. The Siku editors recognized this explicitly, noting that Liuren excels at human affairs while Dunjia excels at celestial patterns, and 'in truth neither can be ranked above the other.' All three systems draw from the same well of stems, branches, and elemental interactions. They address different questions with different tools.