dsh-xuanji
dsh-xuanji: deterministic local fortune-telling engine for DSH — 16 tools incl. BaZi, Zi Wei, Mei Hua, Liu Yao; AI interprets, never infers.
Install
dsh plugin --profile web add github:huangziyuan-general/dsh-xuanji Writes to ~/.dsh/profiles/web; loaded by dsh web
Screenshots 5
What it solves
When a language model does divination charts itself, the fragile part is numeric derivation: sexagenary-cycle conversion, star placement, hexagram generation, bone-weight sums. Mental arithmetic drifts, and it drifts silently. dsh-xuanji moves every deterministic fact into a local engine and leaves the model with exactly one job: interpreting the result in plain language.
- 16
xuanji_*tools: BaZi (four pillars, hidden stems, ten gods, shensha, luck cycles), Zi Wei Dou Shu (14 major stars, birth-year four transformations, major/yearly/small limits), Mei Hua Yi Shu, Liu Yao Na Jia (Jing Fang style with palace, shi/yao, six relatives, six spirits, void, month/day break, returning generation), Qi Men Dun Jia (hourly rotating-plate simplified), almanac, date selection, feng shui (eight mansions + annual purple-white flying stars), naming, bone weight, zodiac profile, life-candle chart, tarot, Xiao Liu Ren, compatibility, numerology. - Four-layer output discipline: chart facts → traditional reading → real-world action advice → disclaimer, none optional; every statement is tagged with its source tier (classical text / common tradition / simplified rule / plain-language paraphrase / built-in character table), and gaps are reported as gaps.
- Ask, never guess: missing birth date, gender or hour triggers a question; the model is forbidden from filling in assumed values.
- Consistent time handling: automatic China DST correction for 1986–1991, true solar time via a built-in 57-city longitude table (longitude offset + equation of time), configurable late-Zi-hour convention; every adjustment is recorded in
meta.notesrather than silently changing the chart. - Solar and lunar input everywhere: date parameters accept
calendar=solar|lunarplusisLeapMonth; lunar years start at the first day of the first month, month lengths follow the lunar table (29/30), and a wrong leap-month flag is rejected with the actual leap month named. - Ten-pane right sidebar panel: BaZi, almanac, life-candle chart (SVG candlesticks with moving averages), bone weight, quick divination, tarot, Qi Men, feng shui, compatibility, Liu Yao — all read-only, zero tokens, theme-adaptive without probing.
- Honest boundaries: the REST surface is read-only with Host/Origin allowlisting and a fence header, and the author explicitly states this only covers the browser threat model — not same-machine processes — instead of claiming absolute isolation.
Who it’s for
- DSH users who want the model to interpret a chart without letting it compute one;
- enthusiasts of BaZi, Zi Wei, Liu Yao or Qi Men who want a structured chart as a starting point for discussion;
- DSH developers who want to reuse the “deterministic engine + model interpretation” split — the tool surface, source tagging and input validation are directly borrowable;
- anyone who just wants an almanac lookup, date selection, bone weight or a daily tarot card (zero tokens on the panel side).
Charting is engineering; interpretation is culture. The plugin makes no medical, investment or legal claims, threatening statements are explicitly banned, and serious real-world decisions should go to a professional. MIT licensed, Node.js ≥ 20.
Compiled from the project README · All rights belong to the original author
Report issue / Request removal