From chinese-metaphysics
Cast and interpret Chinese metaphysics charts with verified deterministic calculation - BaZi (八字 Four Pillars), Zi Wei Dou Shu (紫微斗数 Purple Star), and Qi Men Dun Jia (奇门遁甲). Use this skill whenever the user asks for a BaZi reading, four pillars, day master, 用神, Zi Wei chart, purple star astrology, Qi Men divination, Chinese astrology, fortune reading from birth date/time, auspicious timing, luck pillars, annual forecast (流年), or asks to verify a chart from another app or practitioner. Also use it when the user gives a birth date + time + place and asks about personality, career timing, or compatibility in a Chinese metaphysics context. NEVER cast these charts from memory - the calendar math fails silently; always run the scripts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/chinese-metaphysics:chinese-metaphysicsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Casting is deterministic and runs in code. Interpretation is classical and runs through the reference files. Never compute pillars, star placements, or shensha mentally — solar-term boundaries and hour conversions are exactly where mental arithmetic fails silently.
Casting is deterministic and runs in code. Interpretation is classical and runs through the reference files. Never compute pillars, star placements, or shensha mentally — solar-term boundaries and hour conversions are exactly where mental arithmetic fails silently.
| Task | Script | Key flag |
|---|---|---|
| BaZi chart + luck pillars | scripts/cast_bazi.py | --year YYYY for annual overlay |
| Zi Wei Dou Shu chart | scripts/cast_ziwei.py | --time-index 0..12 if birth time unknown |
| Qi Men Dun Jia divination | scripts/cast_qimen.py | use question time, not birth time |
| Compatibility check | scripts/check_compat.py | always use this; never reason from one branch |
| Verify all engines (post-change) | scripts/run_tests.py | 16 assertions against gold chart |
pip install lunar-python py-iztro --break-system-packages # BaZi + Zi Wei
pip install kinqimen --break-system-packages # Qi Men
pip install --upgrade --force-reinstall ephem --break-system-packages # fixes kinqimen
The ephem reinstall is required: kinqimen pins a stale ephem whose binary is broken on Python 3.12 (PyUnicode_GET_SIZE error). The pip warning about the version conflict is harmless.
cast_qimen.pyalso contains asys.pathworkaround for kinqimen's broken internal import — do not remove it.
Before casting, confirm you have all of the following:
YYYY-MM-DD)HH:MM) — if unknown, BaZi runs on three pillars with reduced confidence; Zi Wei cannot run at all; say soLocation to coordinates: UTC+8 → meridian 120; UTC+9 → meridian 135, etc. Pass both longitude and meridian to the scripts — they apply true solar time correction internally.
Run the appropriate script(s) for the requested system:
python scripts/cast_bazi.py --date YYYY-MM-DD --time HH:MM \
--longitude L --tz-meridian M --gender female|male [--year YYYY]
python scripts/cast_ziwei.py --date YYYY-MM-DD --time HH:MM \
--longitude L --tz-meridian M --gender female|male
python scripts/cast_qimen.py --datetime "YYYY-MM-DD HH:MM" --longitude L
When both BaZi and Zi Wei are cast for the same person, cross-corroborate findings in the interpretation.
Before interpreting, check whether either of these applies:
references/methodology_forks.md item 1).references/methodology_forks.md before interpreting.Use only stars, gods, and interactions present in script output. Never invent shensha or interactions not printed.
| System | Reference file |
|---|---|
| BaZi | references/bazi_reading.md |
| Zi Wei Dou Shu | references/ziwei_and_qimen_reading.md |
| Qi Men Dun Jia | references/ziwei_and_qimen_reading.md |
| Compatibility | references/bazi_reading.md (compatibility section) |
| Boundary / school forks | references/methodology_forks.md |
The Day Master strength verdict can legitimately differ between scoring schools, and it flips the advice. When the chart is near that boundary:
references/methodology_forks.md item 3 for the full protocolWhen the user brings a chart from another app or practitioner, reproduce it with the scripts and diff. Reference references/methodology_forks.md before declaring a mismatch.
| Expect exact match | Expect legitimate school differences |
|---|---|
| Pillars, hidden stems, nayin | Hour pillar (solar time vs clock time) |
| Void branches | Life lord 命主 |
| 12 palace placements | Strength verdict and 用神 |
| Four transformations | Qi Men ju near solar-term boundaries |
| Decade ranges |
Known external engines (audited June 2026):
--no-solar-correction mode; solar-term boundaries are ephemeris-grade and trustworthyRun after any script change or environment change (library upgrades):
python scripts/run_tests.py
Verifies all three engines against a gold chart validated against a professional engine. Expects 16 assertions to pass.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub chloechewx/chinese-metaphysics-skill --plugin chinese-metaphysics