从月将加时到四课三传:一套能起课、能复核、能解释的中英双语六壬 Skill。
From Moon General placement to the Four Lessons and Three Transmissions: a bilingual Liu Ren skill that calculates, explains, and exposes its reasoning.
中文 · English
liu-ren-divination 是一个面向 Codex 的六壬占卜 Skill,也可以作为独立 Python 排盘工具使用。它将《六壬占卜原理》中的核心起课逻辑整理为可执行、可检查的流程:输入日干、日支、占时支和月将,程序会排出天地盘、四课、三传、九宗、旬空、六亲与十二天官;Codex 再结合问题语境,生成结构化、条件式的解释。
这个项目不满足于“听起来像六壬”。它强调三件事:
- 计算要确定:能交给程序的部分由程序完成,减少临场心算错误。
- 过程要透明:展示每一课的上下神、生克关系、取传原则和需要人工复核的边界。
- 解释要克制:把课盘转化为现实条件、风险信号和可逆行动,不把传统象数包装成确定事实。
| 能力 | 说明 |
|---|---|
| 天地盘 | 按“月将加时”建立地盘十二支与天盘十二天神的一一对应 |
| 四课 | 根据日干寄宫推导干阳、干阴、支阳、支阴四课 |
| 三传 | 按九宗主规则选取初传、中传、末传 |
| 九宗 | 支持贼克、比用、涉害、遥克、昴星、别责、八专、伏吟、返吟 |
| 旬空 | 根据有效日柱自动计算空亡二支 |
| 六亲 | 自动标注三传相对于日干的父母、兄弟、子孙、妻财、官鬼关系 |
| 天官 | 根据昼夜贵人和顺逆布列生成十二天官,并标注三传所乘天官 |
| 结构化解读 | 依次解释问题映射、当前状态、发动机制、发展链、制化关系和行动建议 |
| 分类占断 | 提供求财、婚姻、出行、农事、失物与健康问题的专门解释框架 |
| 中英术语 | 附带六壬核心术语中英对照,便于跨语言研究与交流 |
- 内置确定性 Python 脚本,不依赖模型凭记忆拼凑课盘。
- 日干与日支阴阳不配时会拒绝计算,避免无效日柱静默进入结果。
- 涉害等复杂边界不能唯一确定时返回
needs_review,不会伪造确定答案。 - 明确区分“课盘事实”“传统解释”和“现实建议”。
- 不把单个吉神、凶神或生克关系凌驾于全盘结构之上。
- 对医疗、法律、投资、安全等高风险问题设有强制边界。
git clone https://github.com/shizi2077/liu-ren-divination-skill.git
mkdir -p ~/.codex/skills
cp -R liu-ren-divination-skill/liu-ren-divination ~/.codex/skills/liu-ren-divination重新载入 Codex 后,通过 $liu-ren-divination 调用。
从 Releases 下载最新版本,将其中的 liu-ren-divination 文件夹放入:
~/.codex/skills/liu-ren-divination
确认以下文件存在:
~/.codex/skills/liu-ren-divination/SKILL.md
~/.codex/skills/liu-ren-divination/scripts/build_chart.py
使用 $liu-ren-divination:
我想问这次合作能不能顺利推进。
日干甲、日支寅、占时酉、月将申,夜占。
请排四课三传并解释。
建议提供:
- 一个具体问题,而不是“看看我一生如何”之类的宽泛提问;
- 日干与日支;
- 占时支;
- 月将;
- 昼占或夜占,用于排天官;
- 可选的起课时间、地点、本命和行年信息。
如果只提供公历时间,需要先通过可靠历法确定当地时支、日柱和月将。项目不会在缺乏可靠换算时猜测这些输入。
python3 liu-ren-divination/scripts/build_chart.py \
--day-stem 甲 \
--day-branch 寅 \
--hour-branch 酉 \
--moon-general 申 \
--period nightJSON 输出:
python3 liu-ren-divination/scripts/build_chart.py \
--day-stem 甲 \
--day-branch 寅 \
--hour-branch 酉 \
--moon-general 申 \
--period night \
--json参数说明:
| 参数 | 必需 | 说明 |
|---|---|---|
--day-stem |
是 | 日干:甲乙丙丁戊己庚辛壬癸 |
--day-branch |
是 | 日支:子丑寅卯辰巳午未申酉戌亥 |
--hour-branch |
是 | 起课所用占时支 |
--moon-general |
是 | 起课所用月将支,不应直接拿农历月支代替 |
--period |
否 | day 或 night,用于确定昼贵或夜贵并排十二天官 |
--json |
否 | 输出便于程序处理的 JSON |
输入:甲寅日、酉时、申将、夜占。
起课:甲寅日,占时酉,月将申
1课 干阳:甲(木) → 丑(土);贼(下克上)
2课 干阴:丑(土) → 子(水);贼(下克上)
3课 支阳:寅(木) → 丑(土);贼(下克上)
4课 支阴:丑(土) → 子(水);贼(下克上)
三传:子 → 亥 → 戌
九宗:比用
三传六亲:父母、父母、妻财
旬空:子、丑
三传天官:白虎、太常、玄武
脚本只负责可确定的结构计算。真正解释时,还要结合所问事项、季节旺衰、空亡、合冲刑害破、天官、类神及现实证据。
Skill 默认采用以下顺序,避免“见一个符号就下结论”:
- 明确日干与日支在此次问题中分别代表谁或什么。
- 用四课观察己方与对方的外在处境和内在倾向。
- 用初传、中传、末传观察发动、发展和落点。
- 综合五行生克、旺相休囚死、合冲刑害破、空亡与六亲。
- 用天官描述事情以何种人物、方式或场景表现出来。
- 检查不利因素是否受制、入空或被后传化解;有利因素是否被耗泄或冲破。
- 输出顺势路径、风险路径、现实观察信号和可逆行动。
- 月将加时与天地盘映射
- 天干寄宫与四课链
- 九宗主规则与三传
- 日柱阴阳合法性检查
- 旬空与三传六亲
- 昼夜贵人、天官顺逆排布
- 公历、时区、真太阳时、日柱与月将的可靠换算
- 涉害复杂古法细分和不同流派差异
- 遁干、全部神煞、所有课体组合及应期
- 类神选择与具体问题的角色映射
- 旺衰、制化和现实背景的综合解释
脚本出现 needs_review: true 时,应展示候选和原因并人工复核,不应强行生成确定断语。
liu-ren-divination-skill/
├── README.md
└── liu-ren-divination/
├── SKILL.md
├── agents/
│ └── openai.yaml
├── scripts/
│ └── build_chart.py
└── references/
├── foundations.md
├── chart-construction.md
├── interpretation.md
├── category-readings.md
└── glossary.md
本 Skill 依据《六壬占卜原理》全书中英对照本整理。
根据项目整理者提供的传承说明:该书作者是其朋友的汉学老师,相关六壬法脉被介绍为承自真正的司天监传承。本说明用于如实记录知识来源与师承背景,不构成 GitHub、OpenAI、Codex 或其他第三方对个人身份及传承谱系的独立认证。
项目没有收录或公开原书全文,只保留运行 Skill 所需的规则化知识、术语映射和原创排盘实现。原书及相关内容的权利归各自权利人所有。
- 使用原书中的贼克、比用、别责、八专、伏吟与返吟案例进行回归检查。
- 对四课链、三传、旬空、六亲和天官输出进行了脚本测试。
- 进行了常规问题与高风险健康问题的独立前向测试。
- Skill 目录通过结构与 YAML 元数据验证。
这意味着实现经过了针对性检查,但不代表它已经覆盖所有传统流派、全部特殊格局或任何超自然准确率。
六壬属于传统文化、术数史与象数研究。本项目适合用于文化研究、思路整理和条件式决策反思,不构成医学诊断、法律意见、投资建议或确定性预言。
- 不用课盘预测死亡、重病、犯罪定罪或投资收益。
- 不建议停药、拒医或用仪式替代治疗。
- 出现急症、自伤、他伤或现实危险时,停止占断并优先寻求现实帮助。
- 重大决定应结合证据、专业意见和可逆方案。
欢迎通过 Issues 或 Pull Requests 提交:
- 可复核的传统规则勘误;
- 有明确出处的流派差异;
- 能覆盖特殊课体的测试案例;
- 中英术语翻译改进;
- 不改变传统含义的可读性优化。
提交规则修订时,请同时给出来源、适用条件和至少一个可复核案例。
六壬 · 大六壬 · 四课三传 · 月将加时 · 九宗门 · 天官 · 旬空 · Codex Skill · Liu Ren · Chinese Divination
liu-ren-divination is a Liu Ren divination skill for Codex and a standalone Python chart-construction tool. It turns the core procedures documented in Principles of Liu Ren Divination into an executable and inspectable workflow.
Given a day stem, day branch, divination-hour branch, and Moon General, it constructs the Heaven and Earth Plates, Four Lessons, Three Transmissions, Nine Principles classification, Xun Void, Six Relatives, and Twelve Celestial Officials. Codex then uses the supplied question and context to produce a structured, conditional interpretation.
The project is built around three goals:
- Deterministic calculation — let code handle the parts that can be calculated reliably.
- Transparent derivation — show the upper and lower spirit of every lesson, their elemental relationship, the selected principle, and review boundaries.
- Responsible interpretation — translate chart symbolism into conditions, observable risks, and reversible actions instead of presenting divination as established fact.
| Feature | Description |
|---|---|
| Heaven and Earth Plates | Places the Moon General over the divination hour and maps all twelve positions |
| Four Lessons | Derives Stem Yang, Stem Yin, Branch Yang, and Branch Yin lessons from the stem lodging palace |
| Three Transmissions | Selects the Initial, Middle, and Final Transmissions through the Nine Principles |
| Nine Principles | Implements Rebellion/Suppression, Identical Polarity, Torrent, Distant Domination, Seven Sisters, Alternatives, Sharing, Prostrate Moan, and Covered Moan |
| Xun Void | Calculates the two void branches from a valid sexagenary day pillar |
| Six Relatives | Labels the Three Transmissions relative to the day stem |
| Celestial Officials | Places the Nobleman and all Twelve Celestial Officials according to day/night and orientation |
| Structured reading | Separates chart facts, traditional interpretation, and practical recommendations |
| Category reading | Includes frameworks for wealth, relationships, travel, agriculture, lost property, and health-related questions |
| Bilingual terminology | Includes a Chinese-English glossary of core Liu Ren terms |
- It includes a deterministic Python chart builder rather than asking the model to reconstruct the chart from memory.
- It rejects a day stem and day branch with incompatible polarity.
- It emits
needs_reviewwhen a complex boundary cannot be selected safely. - It distinguishes chart structure from symbolic interpretation and real-world advice.
- It does not let a single favorable or unfavorable symbol override the entire chart.
- It includes mandatory boundaries for medical, legal, financial, and safety-critical questions.
git clone https://github.com/shizi2077/liu-ren-divination-skill.git
mkdir -p ~/.codex/skills
cp -R liu-ren-divination-skill/liu-ren-divination ~/.codex/skills/liu-ren-divinationReload Codex, then invoke the skill with $liu-ren-divination.
Download the latest package from Releases, then place the liu-ren-divination folder at:
~/.codex/skills/liu-ren-divination
Use $liu-ren-divination.
Question: Will this partnership move forward smoothly?
Day stem: Jia 甲
Day branch: Yin 寅
Divination hour: You 酉
Moon General: Shen 申
Night reading.
Please construct the Four Lessons and Three Transmissions and explain the result.
python3 liu-ren-divination/scripts/build_chart.py \
--day-stem 甲 \
--day-branch 寅 \
--hour-branch 酉 \
--moon-general 申 \
--period night \
--jsonThe required inputs are established calendrical values. The tool intentionally does not guess a day pillar or Moon General from an underspecified Gregorian timestamp, because timezone, true solar time, and solar-term boundaries can materially change the chart.
The skill follows a layered workflow:
- Define what the day stem and day branch represent in the question.
- Read the Four Lessons as the external and internal conditions of both sides.
- Read the Initial, Middle, and Final Transmissions as initiation, development, and outcome.
- Combine generation and control, seasonal qi, unions, clashes, punishments, harms, destructions, voids, and Six Relatives.
- Use Celestial Officials to describe how a situation may manifest.
- Check whether adverse factors are controlled, voided, or resolved later, and whether favorable factors are drained or disrupted.
- Produce a favorable path, a risk path, observable signals, and reversible actions.
Automated:
- Moon General placement and plate mapping
- Stem lodging palaces and the Four Lessons
- Main Nine Principles workflow and Three Transmissions
- Day-pillar polarity validation
- Xun Void and Six Relatives
- Day/night Nobleman and Celestial Official placement
Requires contextual or expert review:
- Reliable conversion from Gregorian time, timezone, and true solar time
- Complex Torrent variants and lineage-specific differences
- Hidden stems, the complete spirit/star system, all compound chart forms, and timing rules
- Selection of category spirits for a specific question
- Integrated interpretation of seasonal strength, transformations, and real-world context
When the script returns needs_review: true, preserve the candidates and explain the ambiguity instead of forcing a definitive reading.
This skill was distilled from the complete Chinese-English edition of Principles of Liu Ren Divination.
According to the provenance statement supplied by the project curator, the author is the Chinese-studies teacher of the curator's friend, and the Liu Ren lineage is described as descending from an authentic Imperial Astronomical Bureau (司天监) tradition. This records the stated source and lineage background; it is not an independent verification or endorsement by GitHub, OpenAI, Codex, or any other third party.
The repository does not reproduce the complete book. It contains only the structured knowledge, terminology mappings, and original chart-building implementation required by the skill. Rights in the source book and related materials remain with their respective holders.
- Regression checks were performed against worked examples covering major and special principles.
- The Four Lessons, Three Transmissions, Xun Void, Six Relatives, and Celestial Official outputs were tested.
- Independent forward tests covered both an ordinary decision question and a high-risk health question.
- The skill folder passed structural and YAML metadata validation.
These checks validate the implementation targets; they do not claim coverage of every lineage, every exceptional chart, or any supernatural accuracy.
Liu Ren belongs to the study of traditional culture, divination history, and symbolic systems. This project is intended for cultural research and conditional decision reflection. It is not a medical diagnosis, legal opinion, investment recommendation, or deterministic prediction.
- Do not use the chart to predict death, severe disease, criminal guilt, or investment returns.
- Do not stop medication, refuse medical care, or replace treatment with ritual.
- When there is an emergency, self-harm risk, violence, or immediate danger, stop the reading and seek real-world assistance first.
- Major decisions should combine evidence, qualified professional advice, and reversible plans.
Issues and pull requests are welcome, especially for:
- source-anchored corrections to traditional rules;
- clearly documented lineage differences;
- reproducible test cases for exceptional charts;
- improvements to Chinese-English terminology;
- readability improvements that preserve technical meaning.
When proposing a rule change, include the source, applicable conditions, and at least one reproducible example.