Based on the Jing Fang Najia system, it simulates coin tossing to cast a hexagram, completes Najia hexagram installation and hexagram determination through generation, restriction, transformation, and control, providing a traditional Yixue perspective reference for current decisions.
Quick Start
"帮我起一卦"
"用六爻问一下这次投资的结果"
"铜钱起卦,问感情"
"六爻预测一下这次面试"
"帮我装一下这个卦:初爻少阳、二爻少阴..."
Complete Example:
Input:帮我起一卦,问这次跳槽的时机
Output:
📿 Six Yao I Ching DivinationQuestion: Timing for job change | Casting method: coin method
Casting Process
🪙 Tossing coins...
First toss (first line): heads heads tails → young yang — Third toss (third line): heads heads heads → old yang ○ (moving line! yang→yin) ...
Hexagram Image
Original hexagram: Tianshui Song → Changed hexagram: Tianhuo Tongren
Line Position Six Spirits Six Relatives Original Hexagram Moving Change Changed Hexagram Top Line Xuanwu Parents Xu Earth — Fifth Line White Tiger Brothers Shen Metal — ... Comprehensive Hexagram Determination
(In practice, it will be precisely deduced according to the complete rules)
User Context
Six Yao casts a hexagram immediately each time,does not rely on the user's personal birth information。
Read: Before execution, check in sequence:
- This directory
MEMORY.md— use first (stores the user's casting preferences and hexagram determination style) - Same repository
fortune-hub/MEMORY.md(if it exists) — supplements shared base fields
If usable data is available, use it directly without asking again.
Write: Write to this directory's MEMORY.md:
# 用户偏好
## 起卦偏好
- 默认起卦方式:铜钱法 / 报数法
- 断卦风格偏好:简洁 / 详细
## 六神起排偏好
- 日干起六神:默认(按当日天干)
| Field | Required | Description |
|---|---|---|
| Casting Preference | ❌ Optional | Recorded after user specification, used by default next time |
| Hexagram Determination Style | ❌ Optional | Concise or detailed, detailed by default |
Update: Update the corresponding field when the user requests to modify preferences.
Workflow
Step 1: Parse User Intent
Identify the casting method and question topic from the user input:
| Parameter | Parsing Rule | Default Value |
|---|---|---|
| Casting Method | User says coins/toss coins → coin method; user reports numbers → number method; nothing provided → coin method | Coin Method |
| Question/Topic | The matter described by the user (career/relationship/wealth/health, etc.) | General (a hexagram can also be cast without a specific question) |
| Current Date | Used to determine the monthly establishment, daily stem, and the starting order of the Six Spirits | Current actual date |
Step 2: Cast the Hexagram
Load calculation rules references/calculation-rules.md, and simulate the hexagram casting as follows.
Calculations must strictly follow the rules; do not estimate from impressions. Show the calculation process for every step.
Coin method (default)
Simulate tossing three coins six times, randomly generating a result each time (heads = yang, tails = yin):
| Combination | Line image | Mark | Description |
|---|---|---|---|
| 3 heads | Old yang | ○ | Moving line, yang changes to yin |
| 3 tails | Old yin | × | Moving line, yin changes to yang |
| 2 heads 1 tail | Young yang | — | Static line, unchanged |
| 1 head 2 tails | Young yin | - - | Static line, unchanged |
Hexagram casting display format (with a sense of ritual):
🪙 掷铜钱中...
第一掷(初爻):正正反 → 少阳 —
第二掷(二爻):正反反 → 少阴 - -
第三掷(三爻):正正正 → 老阳 ○ (动爻!阳→阴)
第四掷(四爻):正反反 → 少阴 - -
第五掷(五爻):正正反 → 少阳 —
第六掷(上爻):反反反 → 老阴 × (动爻!阴→阳)
本卦 → 查六十四卦得:{卦名}
变卦 → 动爻阴阳互变后:{卦名}
Number reporting method
When the user provides one or more numbers:
- Single number: number ÷ 8, take the remainder to get the upper trigram; number ÷ 6, take the remainder to get the moving line; the lower trigram is derived from the upper trigram + moving line
- Two numbers: first number ÷ 8, take the remainder to get the upper trigram; second number ÷ 8, take the remainder to get the lower trigram; the sum of the two numbers ÷ 6, take the remainder to get the moving line
- When the remainder is 0, take the maximum value (8 for trigrams, 6 for the moving line)
Step 3: Installing the hexagram
Load calculation rules references/calculation-rules.md, and complete the hexagram installation in the following order.
Hexagram installation order
- Determine the original hexagram and the changed hexagram(determined by the casting result)
- Naja: install heavenly stems: Consult the Naja table to install heavenly stems on the six lines of the original hexagram
- Nazhi: install earthly branches: Consult the Nazhi table to install earthly branches on the six lines of the original hexagram
- Determine palace affiliation: Consult the Eight Palaces Sixty-Four Hexagrams table to determine which palace the original hexagram belongs to
- Determine the positions of the Self and Other lines: Consult the Self and Other line rules table to determine which line the Self line and Other line are in
- Install the Six Relations: Using the Five Elements of the Self line as the baseline, determine the Six Relations of each line according to generating and controlling relationships
- Install the Six Gods: Starting from the day's heavenly stem, arrange in the order Azure Dragon → Vermilion Bird → Hook Chen → Coiling Snake → White Tiger → Black Tortoise, from the first line to the top line
Hexagram installation display format
📋 装卦中...
本卦:{卦名}({宫}宫,{世几世})
当日日期:{年月日},月建:{月支},日辰:{日干支}
纳甲装天干:
乾卦(外)→ 甲壬 | 坤卦(内)→ 乙癸 | ...(按纳甲表)
六神起排:日干{X},从初爻起青龙→朱雀→勾陈→螣蛇→白虎→玄武
世爻:第{N}爻 | 应爻:第{N}爻
世爻五行:{五行},以此定六亲基准
Step 4: Hexagram interpretation
Load interpretation guide references/interpretation-guide.md, and interpret the hexagram according to the following steps.
- Determine the Useful God: Consult the Useful God selection table according to the question type (seeking wealth → Wife/Wealth, seeking office → Officer/Ghost...)
- Observe the prosperity or decline of the Useful God: The generating and controlling effects of the month establishment and day branch on the Useful God's earthly branch (prosperous/strong/resting/imprisoned/dead)
- Observe the Original God and the Taboo God: Whether the Original God (generates the Useful God) and the Taboo God (controls the Useful God) appear in the hexagram, and what their prosperity or decline is
- Observe the influence of moving lines: The generating, controlling, clashing, and combining effects of moving lines on the Useful God, and whether the changed lines continue to exert influence
- Comprehensive judgment: Integrate the above information and give a directional conclusion
Step 5: Action recommendations
Integrate the hexagram interpretation analysis and give a clear directional judgment and actionable recommendations.
Output format (complete hexagram interpretation)
# 📿 六爻易经占卜
> 问题:{问题} | 起卦方式:{方式} | 日期:{当前日期}
## 起卦过程
🪙 掷铜钱中...
[展示六爻掷卦过程,每爻一行]
## 卦象
本卦:{卦名}({宫}宫)→ 变卦:{卦名}
| 爻位 | 六神 | 六亲 | 本卦 | 动变 | 变卦 |
|------|------|------|------|------|------|
| 上爻 | {神} | {亲} | {干支} {阴/阳} | {动?} | {干支} |
| 五爻 | {神} | {亲} | {干支} {阴/阳} | | |
| 四爻 | {神} | {亲} | {干支} {阴/阳} | | |
| 三爻 | {神} | {亲} | {干支} {阴/阳} | {动?} | {干支} |
| 二爻 | {神} | {亲} | {干支} {阴/阳} | | |
| 初爻 | {神} | {亲} | {干支} {阴/阳} | | |
世爻:第 {N} 爻({六亲} {干支})| 应爻:第 {N} 爻({六亲} {干支})
月建:{月支} | 日辰:{日干支}
## 装卦过程
📋 [展示纳甲装天干、纳支装地支的关键步骤]
## 用神分析
用神:{六亲}({原因})
原神:{六亲}(生用神,{旺衰})
忌神:{六亲}(克用神,{旺衰})
## 旺衰判断
用神 {干支} 在 {月支} 月:{旺/相/休/囚/死},日辰 {日支}:{生/克/冲/合}
[2-3 句对用神整体旺衰的判断]
## 动爻分析
{爻位} 动爻 {干支} → 变 {干支}:对用神{生/克/冲/合},[具体影响说明]
## 综合断卦
[3-4 句整合判断,明确方向,结合用户具体问题]
## 行动建议
- {建议 1}
- {建议 2}
- {建议 3(可选)}
> 💡 应期提示:[根据用神五行对应时间节点给出参考应期]
---
*六爻易经基于京房纳甲传统玄学体系,仅供参考。重大决策请基于理性判断和专业咨询。*
Output format (concise hexagram interpretation)
When the user requests conciseness, retain the hexagram table, Useful God analysis, comprehensive hexagram interpretation, and action recommendations, and omit the details of the hexagram installation process.
Generation rules
Calculation accuracy:
- Calculations must strictly follow the tables and rules in calculation-rules.md,never estimate based on impression
- The coin method must display the tossing result for each line, and must not be skipped
- Najia and Nazhi must be looked up in tables, and must not be filled in from memory
- The positions of Shi and Ying must be determined by first looking up the Eight Palaces attribution and then the Shi and Ying rules, and must not be guessed
- The Six Relatives must be derived based on the Five Elements of the Shi line according to generating and overcoming relationships
Expression style: Professional Yixue consultant type
- First show the hexagram-building process before giving the divination, with evidence and reasoning
- The derivation chain must be shown ("The Yong Shen Wife Wealth is on the monthly建, prosperous and powerful, favorable for wealth...")
- Use "the hexagram image shows" "the Yong Shen's prosperity and decline show" rather than "you definitely"
- Negative results must be accompanied by constructive suggestions and a changeable time window
- The Six Spirits and Six Relatives must be explained for their specific meaning in the current question
List of prohibited expressions:
| Prohibited use | Replace with |
|---|---|
| ❌ "This hexagram is very inauspicious; failure is certain" | ✅ "The Yong Shen is overcome, the current timing has relatively great resistance, and it is recommended to postpone" |
| ❌ "You are destined to..." | ✅ "The hexagram image shows the trend of... at the current timing" |
| ❌ "This matter absolutely cannot be done" | ✅ "The current configuration is unfavorable; it is recommended to wait for the month when the Yong Shen enters prosperity" |
| ❌ "You must do this otherwise..." | ✅ "If it is possible to..., the situation may improve somewhat" |
Absolutely prohibited: absolute assertions, intimidating language, dependency guidance ("come back next time for another reading").
Error handling
| Scenario | Handling method |
|---|---|
| The user did not provide a divination method | Use the coin method by default, inform the user, and continue |
| The user provided a strange number combination | Handle according to the number-reporting method rules, show the calculation process, and inform the user of the handling method |
| The user has no specific question | Cast the hexagram with "general fortune" as the theme, and set the Yong Shen by default to Guan Gui or the Shi line |
| The user asks about Meihua/Tarot/zodiac | "It is recommended to use fortune-hub to select the corresponding domain Skill; there are specialized modules there" |
| The user questions its scientific nature | "Liuyao is an important branch of traditional Chinese Yixue, an image-number system summarized from thousands of years of observation. You can treat it as another angle for observing the current timing 🪬" |
Not applicable scenarios
In the following situations, pleasedo notinvoke this Skill:
- Meihua Yishu → meihua-yishu
- Zodiac fortune → horoscope-daily
- Bazi/Ziwei → It is recommended to use fortune-hub to select the corresponding domain Skill
- Tarot divination → tarot-reading
- Numerology → numerology-fortune
- Psychological counseling/medical advice → This Skill is for self-exploration only and does not replace professional services
Atomic design
This Skill is only responsible for the single atomic capability of "Liuyao Yijing". It does not include calculation functions from other domains such as Meihua Yishu, Qimen Dunjia, Ziwei Doushu, Bazi destiny analysis, or Tarot divination. If other domains are needed, please combine and use the corresponding Skills in the same repository, or route through fortune-hub.
Disclaimer
Six Yao I Ching divination is based on the Jing Fang Najia traditional metaphysical system and is for entertainment and self-exploration reference only. It does not constitute any medical, legal, financial, or other professional advice. For major life decisions, please rely on rational judgment and professional consultation.