bazi

bazi is a skill for Claude Code from konglong87/xuanxue-skills. It costs 68 tokens per session (946 once invoked), scanned A, original, MIT.

A traditional Chinese astrology reading based on a person’s birth date, birth time, location, and gender. It calculates the chart with a provided program before explaining the results.

In plain words
What is it for?
Use it for a general BaZi reading, including the four-part birth chart, major life periods, and yearly analysis when the required birth information is available.
Why use it?
It gives a repeatable way to calculate the chart and avoids guessing when important birth details or time-zone information are missing.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions Claude Code.

Runs only inside a plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else, and the catalogue could not identify which plugin ships it.

Good fit Use it for a general BaZi reading, including the four-part birth chart, major life periods, and yearly analysis when the required birth information is available.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bazi

README.md
[![agentmods](https://agentmods.dev/badge/skills/konglong87/xuanxue-skills/bazi/github.svg)](https://agentmods.dev/skills/konglong87/xuanxue-skills/bazi)
Your own site
<a href="https://agentmods.dev/skills/konglong87/xuanxue-skills/bazi"><img src="https://agentmods.dev/badge/skills/konglong87/xuanxue-skills/bazi/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bazi

Your own site · 80×15
<a href="https://agentmods.dev/skills/konglong87/xuanxue-skills/bazi"><img src="https://agentmods.dev/badge/skills/konglong87/xuanxue-skills/bazi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 946 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.00946
Opus 5 $0.00034 $0.00473
Sonnet 5 $0.00014 $0.00189
Haiku 4.5 $0.00007 $0.00095

Measured 12d ago against content hash f60eb4e6a493, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

bazi scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (__tests__/analyze.test.js, lib/analyze.js, lib/report.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bazi/SKILL.md · 39 lines

What it actually says

八字综合命理

核心原则

确定性排盘必须来自仓库计算内核,模型只负责解释。必须调用 scripts/calculate.js,禁止心算四柱、十神、大运或流年,也禁止用常识补造缺失的出生资料。报告中的四柱、真太阳时、十神、大运和流年只能逐字段引用脚本 JSON 的 calculation / alternateCalculation,不得根据出生时间再次换算或改写;脚本失败、返回非 ready 或缺少所需字段时必须停止判读并报告错误。

执行流程

  1. 把用户资料整理为 JSON:birthDatebirthTimelongitudeutcOffsetMinutesstandardMeridiangendertargetYear(目标年份)可选,未提供时脚本按调用时当前公历年注入并在结果中披露。出生时间必须保留出生地当时的民用墙钟语义。
  2. 将 JSON 送入脚本。所有宿主都必须从已安装的 bazi 技能目录取得脚本的绝对路径;不得依赖当前工作目录或 shell 工作目录猜测仓库位置。Claude Code 可以使用 ${CLAUDE_PLUGIN_ROOT},其他宿主使用其提供的技能真实路径:
# 通用宿主:把占位符替换为当前 bazi 技能目录的绝对路径
printf '%s\n' '{"birthDate":"1955-02-24","birthTime":"19:15","longitude":-122.4194,"utcOffsetMinutes":-480,"gender":"male"}' | node "<absolute-bazi-skill-directory>/scripts/calculate.js"

# Claude Code 插件
printf '%s\n' '{"birthDate":"1955-02-24","birthTime":"19:15","longitude":-122.4194,"utcOffsetMinutes":-480,"gender":"male"}' | node "${CLAUDE_PLUGIN_ROOT}/skills/bazi/scripts/calculate.js"
  1. 若返回 needs_input,按 questions 一次性追问全部缺失信息并停止判读。信息不足时询问,不得猜测经度、历史时区或性别。
  2. 若返回 ready,读取 methodology.md,严格使用 calculationalternateCalculationanalysisContext;按 templates/report.md 输出。输出前逐项核对报告四柱与 calculation.四柱结果.{年,月,日,时} 完全一致。
  3. alternateCalculation 不为 null 时,说明日柱存在换日分歧;脚本已经用不同 dayBoundary 调用 core 复算另一派完整命盘。两派必须分别分析,禁止模型从主派心算或改写另一派十神、大运和流年。
  4. 每个判断都写出“算出 -> 依据 -> 可供判读”,并给现实核验点和行动。换日、起运、旺衰、格局、喜用神的流派分歧全部呈现。

路由边界

本技能用于综合命理,事业财运和婚恋只给概览。用户明确要求深入事业/财富时转 wealth-career,明确要求深入婚姻/恋爱时转 love-marriage。手掌照片转 palm。住宅风水与占卜能力均为 future / 未交付,当前不支持且不得调用不存在的技能。

禁止事项

  • 不把五行数量直接等同旺衰,不把任一格局或喜用神方法包装成唯一真相。
  • 不断言疾病、寿命、灾祸、必婚必离、确定收入或投资收益。
  • 不省略文化娱乐、非医疗和非投资职业建议的免责声明。
Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 39 lines · 68 tokens per session scan A f60eb4e6a493

Subscribe to this mod's changes

bazi is a skill published in the GitHub repository konglong87/xuanxue-skills (3 stars, last pushed 2d ago), licensed MIT. It adds 68 tokens to every session and 946 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

liki-bazi

A Chinese traditional fortune-reading tool using BaZi, a birth-chart system based on birth details, and Zi Wei Dou Shu, another Chinese astrology system. It can examine life areas and yearly trends, but its conclusions are for cultural reference, not professional advice.

ml8s/liki · 90 tokens

liki-divination

A traditional Chinese divination skill covering Liuyao readings, Qimen decisions, and selecting auspicious dates. It interprets an automatically generated chart using defined rules and presents the result as cultural guidance, not professional advice.

ml8s/liki · 85 tokens

liki-fengshui

A tool for analysing home layouts and directions through traditional Chinese feng shui methods, including Eight Mansions and Flying Stars. Feng shui is a traditional system for interpreting how spaces, directions, and time relate to one another.

ml8s/liki · 73 tokens

liki-naming

A Chinese naming tool that combines BaZi, a birth-chart system based on birth details, with traditional name analysis called Sancai-Wuge. It can also assess existing names and help create Chinese names from English names.

ml8s/liki · 83 tokens

liki-hepan

A traditional Chinese relationship reading that combines Bazi, a birth-chart system, with Zi Wei Dou Shu, another Chinese astrology system. It uses both people's birth information to produce a detailed compatibility report.

ml8s/liki · 33 tokens

liki-mingshu

An AI workflow for producing a Chinese traditional-culture fortune-telling report as JSON. It generates a report, reviews it, and revises it when the review fails; the results are for reference, not professional advice.

ml8s/liki · 38 tokens