/xuan-ji-yu-heng:xuan-ji-yu-hengfrom xuan-ji-yu-heng
Calculates Western natal charts, Four Pillars/BaZi, Zi Wei Dou Shu, and Vedic/Jyotish charts from birth data using a deterministic CLI. Narrates sourced readings with system-specific facts and warnings.
Ships in xuan-ji-yu-heng. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This Skill is the entry point and orchestrator. It does not compute charts with the
language model. All astronomy, calendar, ganzhi, star-placement, rule and interpretation math
is done by the bundled deterministic CLI at scripts/loom-chart.mjs. Your job is to gather and
confirm inputs, call the CLI, compute every requested system in full (how much you DISPLAY
follows the output channel — Channel A shows full technical data; Channel B shows only the
asked topic's facts), retain warnings honestly for audit, and narrate only from its output.
interpret command, not from
calculate / chart.json. Show the full set only in Channel A; ordinary questions use
answerPlan.selectedFacts and the topic bounds below. Never hand-compute a substitute or confuse
an omitted topic fact with an engine capability being absent.reason/evidence (no invented 命理 mechanisms). 十神象义不可错位(财=回报/客户/资源/责任,技能
与产品化看食伤;财格需真实权责与合理回报,非只靠成果;官杀藏≠排斥组织)。Keep each system's terms
inside that system (紫微星 ≠ 八字十神); relay brightness/dignity verbatim (Zi Wei “不/平” ≠ “陷”;
astrology 失势/detriment ≠ 落陷/fall; 水逆 ≠ 思考慢); avoid single-star verdicts; self-check for
contradictions. See references/reading-style.md.For a full technical chart, calculate --systems all explicitly requests Western, BaZi, Zi Wei
and Vedic / Jyotish. The Vedic result contains Lahiri sidereal Sun–Saturn, both
nodes.mean and nodes.true (Ketu is exactly opposite the corresponding Rahu), plus Lagna,
whole-sign bhava, nakshatra/pada, panchanga, D1/D9 and Vimshottari only when the engine returns
them. The owner-confirmed product default is vedic.nodes: "mean"; callers may still select
"true" explicitly, and both node modes remain visible in the result for comparison.
precision: "high" is limited to the recorded Swiss-only external numeric-reference fixture;
Swiss Ephemeris never runs in the bundle or at runtime. When birth time is unknown, relay
VEDIC_TIME_REQUIRED: Lagna, bhava, D9 Lagna, Vaara and Vimshottari are suppressed rather than
inferred from a noon anchor. The raw calculate input without --systems defaults to all four
shipped systems; callers may pass an explicit subset when needed.
Required: calendar (gregorian | lunar), local date YYYY-MM-DD, local time HH:mm[:ss]
(or mark time unknown), time accuracy (exact | approximate | unknown), IANA timezone
(e.g. Asia/Shanghai), latitude, longitude. Optional: elevation, lunarLeapMonth,
ruleGender (only where a rule needs it), dstDisambiguation (earlier | later),
per-system rule settings (Western zodiac: tropical|sidereal, ayanamsha, asteroids). Do
not ask for name or life events. See references/input-contract.md.
Use the calculation path in step 3: answer-plan for ordinary questions, or calculate plus
interpret for full technical charts. Do not replace calculation with model guesses or discard
warnings. Computing all four systems does not require displaying all four — see step 4.
birth-input.json (see references/input-contract.md).birth-input.json directly to answer-plan:
it validates and normalizes the input itself. Use doctor when installing/updating or diagnosing
a runtime problem, not before every question. Use standalone normalize only when normalized
time data is explicitly needed; do not run it as extra preparation for answer-plan.
For a full technical chart, run BOTH calculate --systems all
and interpret. For an ordinary question, run answer-plan --topic <bounded-topic> instead:
it always computes all four systems internally, then returns only a de-identified publicResult
and a topic-scoped answerPlan. Do not create or attach raw chart artifacts for an ordinary
question. calculate returns the private four-system chart; interpret runs the sourced BaZi
rules (旺衰强弱 / 格局 / 喜用神 / 神煞 / 刑冲合害 / 大运·流年吉凶) and cross-system facts.answerPlan.selectedFacts and its
allowedFactIds; do not read or attach chart.json / interpretation.json. The body shows
only the facts relevant to that topic. There is no requirement to display all four raw
charts or the full fact set in a topic report.requiredWarningCodes 中真正影响所选事实的 warning 才就地自然说明。
示例只示范信息边界和清楚的表达,不是逐字套用的开场白;不重复用户整段提问,也不把同一限制
换几个说法再讲一遍。详见 references/examples-career.md 中分开的正文与内部说明。references/reading-style.md; 事业 → + references/examples-career.md; 感情 → + references/examples-love.md; 财运 → + references/examples-wealth.md; 学业/流年不加载无关案例文件。id / reason /
evidence.ref / caveat,再按“事实 → 规则机制 → 现实含义 → 条件”写成连续自然段。
专业术语可以出现,但术语、机制与具体处境必须紧邻;不得将原始 id、ref、ruleId、
ruleset、provenance 或 warning 数据写入默认正文。reading-draft/v2 JSON:命盘段落用 sourceFactIds,相关 caveat/warning 用 constraintRefs;事业现实建议段落用独立 realitySource 引用同时提交的 careerReality.confirmedFacts,只记录用户明确自述,不借命盘 ID、不混合来源段落。没有现实自述就不生成现实建议;来源元数据不进正文。disclaimer 仅在确有必要时引用,legacy v1 仍拒绝。普通问题一律走绑定交付,顺序固定:
① answer-plan 取计划与绑定 → ② 写 reading-draft/v2 草稿 → ③ 密封该草稿到它的计划运行:node scripts/loom-chart.mjs validate-answer --seal-draft --input-file draft.json --binding-file answer-plan.json --output-file draft-origin.json → ④ 绑定送检:把 { draftSource, draftDigest, answerPlan(完整保存的计划), readingDraft } 放入送检文件,并加 --context-input-file birth-input.json --topic <topic>(及与 answer-plan 相同的 --lens/--at/--now)→ ⑤ 仅当 ok:true 才展示返回的 deliverableBody(它就是被检查过的文本,deliverableBodySha256 可核对)。
旧对象、旧出生资料、旧主题/目标时间、被改动的计划,或草稿不是为本次计划所写,都会被 BINDING_MISMATCH 受控拒绝;裸草稿(无来源)被 DRAFT_ORIGIN_MISSING 拒绝。改一个字、标题或顺序都必须重新密封并重新送检,展示新返回的正文,不得沿用上一次成功正文(失败结果不携带正文)。已声明绑定却漏传 --context-input-file 会被 INPUT_VALIDATION_FAILED 拒绝,绝不静默退回低层结构检查。
仅当确实只需要结构检查(例如人工排查历史草稿)时,才用 { answerPlan, readingDraft } 送检;该路径输出 validation-result/v2、不构成绑定交付,且仍须按上面的 lint-reading 流程检查措辞后再展示。摘要只证明一致性,不是认证;无状态检查器防意外错配、不防故意重新标注来源或回放整套旧上下文的宿主。详见 references/answer-contract.md。专业依据、敏感项校对、
引擎警告、声明、免责声明页脚、原始来源标识或自动追问菜单。用随 Skill 发布的确定性检查器验证草稿:
node scripts/loom-chart.mjs lint-reading --input-file draft.md --channel topic [--simple] [--technical-details]
它输出 { ok, violations:[{section,term,category,severity,line,replacementHint}] }。默认不带 --technical-details;只有用户明确要求来源或计算细节时才加该开关,它会放行来源标识但仍检查空话、重复与越界。工作流:①先把报告写入临时草稿 → ②跑 lint-reading → ③按 violations 重写(最多 2 次)→ ④通过(ok:true)才展示 → ⑤仍不过则改用更短更通俗的版本(可加 --simple),绝不把未通过草稿发给用户。检查器只指出问题,由你重写(不要机械删词,以免病句)。chart.json, verbatim (never omit, round away, or re-derive):
sign,
signDeg, house, retrograde and precision; the lunar node (mean or true) and — when
asteroids is on — Chiron/Ceres/Pallas/Juno/Vesta; the major aspects. If ayanamsha is
set, state the sidereal ayanamsha degrees and that positions are sidereal.tenGodDisplay
(the day column reads 日主(日元) and is never blank), hidden stems and 纳音; then the 大运
(with 起运).interpretation.json — 旺衰强弱, 格局, 喜用神 (+reason),
神煞, 刑冲合害, and the 大运·流年 吉凶倾向 (each fact's polarity+reason+source). These ARE
engine-produced (via interpret); never say this version “does not output” them or hand-compute a
substitute. Channel A shows the full set; Channel B uses only answerPlan.selectedFacts
(their terms may appear naturally when accompanied by their mechanism and implication). Only if
the answer plan has no eligible fact may you say it is absent.warnings entry for Channel A. For Channel B, retain every required warning for
audit, but mention only a practical limitation that materially affects the requested conclusion;
never copy raw warning codes, private messages or details. Never present an omitted or approximate
result as if it were exact.answerPlan following the natural-delivery rules in references/reading-style.md; retain each
selected fact id internally and honor guardrails. Do not append a fixed 校对、免责声明或追问。synastry)When the user uploads 1-5 people and asks about a relationship (合婚/配对/两人合不合/与谁更合):
label (甲/乙/男方/…, never a real name).couple|spouse|dating|ambiguous|ex|family|friend|partner.people.json ({ people:[{label, relation, input}...], analyzePair:[labelA,labelB] }) —
analyzePair is REQUIRED when more than two people are given (else the engine errors, asking for it).calculate --systems all per person and show each chart; then run synastry.synastry.findings per references/reading-style.md (合婚模板): lead with
契合度+关键张力, cite 八字/紫微/占星 findings, take the angle for the relationship type (夫妻/情侣/暧昧/前任),
give 相处建议. Keep disclaimers internal unless the user asks for technical detail or a
boundary is material to the current relationship question. Never conclude “注定在一起/必分手”.followupOffer only if the user asks to continue; never append it as an automatic menu.Arguments are passed as an array; input and output go through JSON files. These are independent commands, not a sequence to run before every answer.
node scripts/loom-chart.mjs doctor
node scripts/loom-chart.mjs normalize --input-file birth-input.json --output-file normalized.json
node scripts/loom-chart.mjs calculate --input-file birth-input.json --systems all --output-file chart.json
node scripts/loom-chart.mjs compare --input-file birth-input.json --profiles default,apparent-solar --output-file comparison.json
node scripts/loom-chart.mjs horoscope --input-file birth-input.json --at 2026-05-20T14:00 --output-file horoscope.json
node scripts/loom-chart.mjs interpret --input-file birth-input.json --at 2026-05-20T14:00 --output-file interpretation.json
node scripts/loom-chart.mjs answer-plan --input-file birth-input.json --topic career --lens advice --output-file answer-plan.json
node scripts/loom-chart.mjs bazi-career --input-file birth-input.json --system bazi --depth standard --output-file bazi-career.json
node scripts/loom-chart.mjs synastry --input-file people.json --output-file synastry.json
node scripts/loom-chart.mjs validate-answer --input-file validate-input.json --output-file validation-result.json
node scripts/loom-chart.mjs lint-reading --input-file draft.md --channel topic
node scripts/loom-chart.mjs verify
node scripts/loom-chart.mjs version
node scripts/loom-chart.mjs migrate --host qoder|workbuddy --source <extracted-new-package-dir>
--systems accepts all or a comma list of western,bazi,ziwei,vedic. all explicitly
requests all four systems. Without the flag, raw calculate also defaults to all four systems.bazi-career is the EXPLICIT single-system BaZi career entry (IQ-4F): --system is required
and must be bazi; --depth is required (brief|standard|detailed). It emits only the
versioned records (clarification-plan/v1 + response-view/v1) — never claim prose — and
fails closed (CLARIFICATION_REQUIRED, exit 12) instead of answering when a material setting
is unresolved or the affected claim class is unavailable. The generic answer-plan verb keeps
its unspecified-system behavior unchanged.calculate accepts --now <iso|ms> and --request-id <id> for reproducible output.version reads the sibling BUILD_MANIFEST.json and reports the REAL installed version
(engineVersion / releaseVersion / releaseTag / legacy / doubleNested) — never guessed, and not
the same thing as the latest online version.migrate atomically replaces an existing (incl. legacy double-nested) install under the host
skills dir with an already-downloaded+verified new package; it backs up first and rolls back on failure.compare profiles are versioned rule presets; run doctor and read
references/rulesets.md for the available ids.horoscope computes the Zi Wei dynamic chart (运限盘: 大限/小限/流年/流月/流日/流时) for a
target solar date; --at is YYYY-MM-DD or YYYY-MM-DDTHH:mm[:ss] (the hour sets the 流时).interpret produces interpretation.json: topic-organized, evidence-grounded facts (with
polarity 吉/凶/中性 and reason chains) plus disclaimers and followupOffers. --at
additionally folds in the current Zi Wei 流年.answer-plan is the ordinary-question entry point. It accepts only a bounded --topic
(character|career|wealth|marriage|studies|health|general) and --lens
(overview|strengths|risks|timing|advice|explain), never free-form question text. It computes
all four systems internally and returns publicResult plus answerPlan; see
references/answer-contract.md. Use general only for an explicitly requested complete
overview, never as the fallback for an unclear question.render is temporarily disabled. HTML/SVG reports could not be produced reliably across
host models, so the command now prints a stable JSON notice and exits with code 3. Present the
structured calculate / interpret JSON instead. (The renderer stays dormant for a future
re-introduction — see docs/adr/0005-fortune-sidereal-render-pause.md.){ "ok": true, ... }; on failure it prints
{ "ok": false, "error": { "code": ... } } and exits non-zero.answer-plan step)When the user wants an ordinary reading, run answer-plan and narrate ONLY from its
answerPlan.selectedFacts. The plan is the de-identified, evidence-grounded substrate — never
raw birth data and never your own invention. It contains no free-form question text; map the
question to a bounded topic/lens first, or ask a clarification question. For every substantive
paragraph, retain the internal chain fact/evidence → reason/ruleset → concrete implication → relevant condition. Write continuous, specific prose rather than a fixed report sequence.
Terms such as 干支、十神、宫位、星曜、相位或吠陀分类可以出现,但必须紧接着解释其规则机制和 现实含义;不要把它们变成脱离结论的术语附录。趋势与年份是传统命理解读,不是统计概率,绝不输出 X%。不要用后台标签、原始 ref/ruleId、固定免责声明或自动追问打断正文。用户问“为什么”或明确 要求技术细节时,才在正文之外给出相应的事实、规则和限制来源。
用具体的工作、关系、金钱或日常选择说明影响;不要用换了包装的行业黑话(专业壁垒/平台核心/
定价权/决定权/方法论/赋能/闭环…)。若一句话无法用“具体是谁、在什么场景、做了什么”解释,
就说明太抽象,必须重写。成文后用 lint-reading 自检(见上面工作流)。
Guardrails:
answerPlan.selectedFacts; if a topic has no fact, say so — do not backfill
positions, stems, stars, houses, or verdicts.followupOffer only when the user explicitly asks to continue; never append it as a menu.This engine version computes normalized time & location, Western natal charts (西方占星), BaZi (四柱八字), Zi Wei Dou Shu (紫微斗数), and a sourced cross-system interpretation. Notes:
precision: high) cover Sun–Pluto with houses
(placidus/whole-sign/equal/koch/porphyry), ascendant/MC, aspects and retrogrades, and hold the
≤1′ gate two ways: wrapper-consistency vs astronomy-engine's own output, plus an independent
JPL Horizons golden cross-check (source-cited fixture; worst deviation 0.20′).precision: approximate (角分级近似);
they are excluded from the ≤1′ gate. Relay their approximate nature.ruleGender. When the time is unknown, Western still places
planets by date but does NOT fabricate an ascendant or houses.LUNAR_CONVERTED
warning). Set lunarLeapMonth for a leap month.For a full technical chart, relay every warning plainly. For an ordinary answer, preserve every warning for audit but mention only the limitation that changes the requested conclusion; never present an omitted or approximate result as if it were calculated.
answer-plan.json is the only default artifact. It omits direct birth
input, deterministic request ids, normalized timestamps, timezone, raw warning details and raw
evidence notes. It is a de-identified answer context, not anonymous public data: obtain the
user's consent before any caller sends derived facts to a remote model or service.chart.json / interpretation.json only when the user explicitly asks for
a full technical chart or raw JSON. Keep those private artifacts and temporary input files out
of ordinary-topic workspaces; remove them after the task unless the user asks to retain them.warnings and provenance versions. For an ordinary
answer, fold only a material effect from answerPlan.requiredWarningCodes into the paragraph it
qualifies; never render raw codes or a warning panel.For traditional-culture, entertainment and self-reflection use. 吉凶/运势/趋势/年份 are 命理
condition assessments, 非科学预测. Do not use for medical, legal, financial or other major
decisions. This is a host instruction, not default answer text: include a short, natural boundary
only when the specific user request concerns one of those decisions. See
references/sources-and-limitations.md and references/privacy.md.
LICENSE (opens in a new tab)THIRD_PARTY_NOTICES.md (opens in a new tab)agents/openai.yaml (opens in a new tab)assets/report-template.html (opens in a new tab)references/answer-contract.md (opens in a new tab)references/examples-career.md (opens in a new tab)references/examples-love.md (opens in a new tab)references/examples-wealth.md (opens in a new tab)references/input-contract.md (opens in a new tab)references/output-contract.md (opens in a new tab)references/privacy.md (opens in a new tab)references/reading-lite-input.md (opens in a new tab)references/reading-style.md (opens in a new tab)references/rulesets.md (opens in a new tab)references/sources-and-limitations.md (opens in a new tab)sbom.cdx.json (opens in a new tab)sbom.spdx.json (opens in a new tab)scripts/fixtures/smoke.json (opens in a new tab)scripts/loom-chart.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
natal-chart, bazi, zi-wei-dou-shu, jyotish, astrology, chart-calculation
npx claudepluginhub jowitt13/loom-of-heaven --plugin xuan-ji-yu-heng2 skills in this plugin
Other plugins' skills for the same job