The Wartime Oracle: What Qimen Dunjia Actually Is
The most storied divination system in Chinese tradition reads neither hexagrams nor horoscopes. It reads a field.
Part 1 of The Wartime Oracle — Qimen Dunjia and its military reputation.
The Reputation
Qimen Dunjia (奇門遁甲) has the best reputation of any divination system in Chinese civilization. Zhuge Liang allegedly used it to conjure the east wind at the Battle of Red Cliffs. Liu Bowen supposedly deployed it to help Zhu Yuanzhang overthrow the Mongols and found the Ming dynasty. The Yellow Emperor himself is said to have received its secrets from the Nine Heavens Mysterious Lady (九天玄女) during his war against Chi You at the plains of Zhuolu.
None of these attributions are historically verifiable. They are—and this is worth saying plainly—legends. But legends tell you something important: they tell you what a culture considers prestigious. And Chinese culture has always considered Qimen Dunjia the most prestigious of the Three Cosmic Boards (三式): Taiyi (太乙), Liuren (六壬), and Qimen (奇門). Taiyi reads fate on the scale of empires. Liuren handles everyday questions. Qimen handles war.
Or at least, that is what its reputation says. The actual system, once you strip away the legends, is something both more specific and more interesting than “military divination.” It is a space-time field analysis using a 3×3 grid.
What Qimen Dunjia Is Not
Here is what people miss: Qimen Dunjia is not hexagram-based at all. If you know the I-Ching—if you know Liu Yao, the six-line structural method—you might assume that Qimen is another way of reading hexagrams. It is not. Liu Yao casts a hexagram and reads the interactions between six lines: which lines are strong, which are weak, which are moving. The analysis is linear. One hexagram, six positions, one focal line.
Qimen does something fundamentally different. It constructs a spatial-temporal field—a snapshot of a particular moment in time mapped onto a particular arrangement of space—and reads the interactions among multiple layers superimposed on that field. The same cosmological ingredients appear (Heavenly Stems, Earthly Branches, trigrams, Five Elements), but the architecture is completely different. Where Liu Yao is a column, Qimen is a grid.
The Nine Palaces
The foundation of the entire system is the Nine Palaces (九宮), a 3×3 grid derived from the Luoshu (洛書), the legendary “River Writing” that appeared on the back of a tortoise emerging from the Luo River. The Luoshu arranges the numbers 1 through 9 in a magic square where every row, column, and diagonal sums to 15:
| 4 巽 SE | 9 離 S | 2 坤 SW |
| 3 震 E | 5 中 Center | 7 兌 W |
| 8 艮 NE | 1 坎 N | 6 乾 NW |
Each palace corresponds to a trigram and a compass direction. The center palace (5) is special—it has no gate of its own and is sometimes said to “borrow” from its neighbors. The Dunjia Yanyi, the Ming dynasty text that is our primary source here, states it directly: the method takes the Nine Palaces as its foundation (其法以九宮爲本).
The Siku Quanshu catalog review of the Dunjia Yanyi, written by Ji Yun's team in the 1780s, traces the historical lineage with unusual care. They note that the Nine Palaces derive not from the Luoshu-as-diagram (the 45-dot pattern popularized in the Song dynasty) but from the numerical text described in the Daidai Liji: “two-nine-four, seven-five-three, six-one-eight” (二九四七五三六一八). This is the Nine Palaces method's actual origin. The Yiwei Qianzaodu (易緯乾鑿度) elaborated it further with the concept of Taiyi traveling through the Nine Palaces. Qimen Dunjia, the catalogers conclude, “actually arose from this” (遁甲之法實從此起).
The Four Layers
Onto this 3×3 grid, the system superimposes four rotating layers. Each layer represents a different dimension of reality, and their interactions at a given moment produce the reading:
The Eight Gates (八門) represent human affairs—the conditions and situations a person encounters. They are: Open (開), Rest (休), Life (生), Injury (傷), Block (杜), View (景), Death (死), and Shock (驚). Of these, Open, Rest, and Life are considered auspicious. Death and Injury are inauspicious. The rest depend on context. The gates rotate through the palaces according to the time of the reading, so the same gate occupies different spatial positions at different hours.
The Nine Stars (九星) represent heaven's influence. They are named: Tianpeng (天蓬), Tianrui (天芮), Tianchong (天沖), Tianfu (天輔), Tianqin (天禽), Tianxin (天心), Tianzhu (天柱), Tianren (天任), and Tianying (天英). Each star carries a Five Element association and a general character (auspicious, inauspicious, or neutral). The Yanbodiaosouge (煙波釣叟賦)—a classical rhyming treatise preserved in the Dunjia Yanyi—classifies them: “Tianfu, Tianchong, Tianren, Tianqin, and Tianxin are auspicious yang stars; Tianying, Tianrui, and Tianzhu are inauspicious yin stars” (逢任衝輔禽陽星,英芮柱心陰宿名).
The Eight Spirits (八神) represent cosmic forces—the invisible influences that shape events beyond human control. They include Zhifu (值符, the Duty Talisman), Tengshe (螣蛇, the Soaring Serpent), Taiyin (太陰, the Great Yin), Liuhe (六合, the Six Harmonies), Baihui/Gouchen (白虎/勾陳), and others. Each carries specific associations and modifies the reading of whatever palace it occupies.
The Heavenly Stems (天干)—specifically the Three Marvels and Six Rites (三奇六儀)—form the fourth layer. The Three Marvels are Yi (乙), Bing (丙), and Ding (丁). The Six Rites are the six Jia (甲) stems hidden beneath the remaining stems: Jia hides under Wu (戊), Ji (己), Geng (庚), Xin (辛), Ren (壬), and Gui (癸). This is where the name comes from: “Qimen” (奇門) means “Marvel Gates” and “Dunjia” (遁甲) means “Hidden Jia.” The Yang Day-Stem (乙, the sun) is the Day Marvel; the Yin Moon-Stems (丙 and 丁) are the Moon Marvels. Jia, the head of all yang stems, conceals itself among the six rites—hence “hidden.”
How the Field Works
At any given moment, each of these four layers occupies a specific arrangement across the Nine Palaces. The reading consists of examining which gate, which star, which spirit, and which stem land in which palace, and then analyzing their interactions. A Life Gate (生門) with an auspicious star in a palace whose element supports them both is very different from a Death Gate (死門) with an inauspicious star in a palace that drains them.
The system distinguishes between Yang Shields (陽遁) and Yin Shields (陰遁). From the winter solstice through the summer solstice, the arrangement follows the yang sequence (forward through the palaces). From summer solstice through winter solstice, it reverses into the yin sequence. The Dunjia Yanyi explains: yang shields run forward with the rites and backward with the marvels (陽遁順儀奇逆布); yin shields run backward with the rites and forward with the marvels (陰遁逆儀奇順行).
The original system attributed to the Yellow Emperor contained 4,320 configurations (one per double-hour in a year). The Duke of Zhou reduced this to 72 active configurations. Zhang Liang (Zhang Zifang) of the Han dynasty compressed it further to 18. The Dunjia Yanyi notes that whether you use 18, 72, or the original 4,320, the underlying structure is the same: 1,080 fixed configurations that repeat. The rest is a matter of which temporal cycle you apply to select the active one.
The Connection to the I-Ching
Qimen Dunjia is not a hexagram system, but it shares the same cosmological vocabulary. The eight trigrams define the eight palaces. The Heavenly Stems and Earthly Branches supply the temporal framework. The Five Elements govern all interactions. Someone trained in Liu Yao would recognize every ingredient; the recipe is different.
The Siku catalogers make this point explicitly. They note that Qimen shares with Liuren (六壬) the use of stems, branches, and element interactions, and with Taiyi (太乙) the cosmic scale. But Qimen adds a spatial dimension that neither of the others possess. It maps time onto space, then reads the resulting field. “Among the technical arts, it is the most principled” (方技之中最有理致), the catalogers write—a striking endorsement from scholars who spent a decade dismissing most divination texts as nonsense.
The Dunjia Yanyi as a Text
The Dunjia Yanyi (遁甲演義) was written by Cheng Daosheng (程道生, courtesy name Kesheng 可生) of Haining during the Ming dynasty. It runs to four juan (volumes). The Siku catalogers describe it as “concise in theme and comprehensive in wording” (旨約詞該), and praise its treatment of the “placing marvels and establishing command-gate” methodology (用奇置閫之要) as particularly detailed.
What makes the Dunjia Yanyi valuable is not that it invented anything new. It is that it systematized existing material into a coherent presentation. Volume 1 opens with “Origins of Dunjia” (遁甲原流), tracing the system from the Yellow Emperor through the Duke of Zhou to Zhang Liang, then lays out the year, month, day, and hour configurations in sequence. It preserves the full text of the Yanbodiaosouge (煙波釣叟賦)—the “Rhapsody of the Fisherman in Mist and Waves”—which is perhaps the most famous mnemonic text in the entire Qimen tradition. It also includes the Huangdi Yinfujing (黃帝陰符經), another classical treatise on the system's principles.
The catalogers note one feature that distinguishes the Dunjia Yanyi from other Qimen texts: its discussion of natal-year and traveling-year calculations (本命行年). The idea is that the practitioner should seek the auspicious stars in their own natal configuration—a personalization that other texts do not address. “This approach is not found in other books” (其說亦他書所未及), the catalogers observe.
The Military Question
So is Qimen Dunjia actually a military system? The answer is: it was used for military purposes, among many others. The Yanbodiaosouge is explicit about battlefield applications— where to position troops (九天之上好揚兵), where to hide them (九地潛藏可立營), where to set ambushes (伏兵但向太陰位), and how to determine the commander's optimal position relative to the opponent. But the same text also discusses travel, concealment, evasion, and general decision-making.
The military reputation stuck because of the legends, and because spatial field analysis is genuinely useful for strategic thinking—you are literally asking “which direction is favorable right now?” But the system itself is a general framework for reading the quality of time-space configurations. The Siku catalogers, characteristically, cut through the mythology: they note that enthusiasts of the marvelous (好奇者) hijacked the system for military rhetoric, which eventually led to disasters like Guo Jing's occult defense of Kaifeng in 1126 (以妖妄誤國). The catalogers' verdict: the system is sound; the charlatans ruined its reputation.
What Comes Next
This article is an introduction—the vocabulary and the architecture. In subsequent articles in this series, we will work through the actual mechanics: how to construct a Qimen chart for a given moment, how to read the interactions between layers, and what the classical texts say about specific configurations. The system is complex, but it is not mystical. Every element has a derivation. Every rule has a rationale. The Dunjia Yanyi, for all its legendary framing, is ultimately an engineering manual.
