Bazi + Zi Wei analysis skill for Claude Code and Codex
给 AI coding agents 使用的八字、紫微斗数、命理产品协作工具包
命语 Skill 是一个面向 Claude Code 和 Codex 的 AI 命理协作 Skill。它不是一个网页应用,也不是单纯的提示词文件,而是一套可安装、可引用、可运行脚本验证的 agent 工作流。
它帮助 AI agent 在处理八字、紫微斗数、命盘解读、财富分析、命理产品开发时,遵循同一套规则:
- 先锁定排盘事实,再进入解释。
- 区分八字大运、紫微大限和流年,不混用系统。
- 对财富、事业、感情等主题使用多层证据,不用单点断语。
- 保持温和、克制、可验证的表达方式,避免恐吓式算命。
- 在缺少依赖或出生信息时明确说明不确定性。
默认同时安装到 Claude Code 和 Codex:
curl -fsSL https://raw.githubusercontent.com/gaowei90098-creator/mingyu-skill/main/scripts/install.sh | bash只安装到 Codex:
curl -fsSL https://raw.githubusercontent.com/gaowei90098-creator/mingyu-skill/main/scripts/install.sh | bash -s -- --target codex只安装到 Claude Code:
curl -fsSL https://raw.githubusercontent.com/gaowei90098-creator/mingyu-skill/main/scripts/install.sh | bash -s -- --target claude同时安装可选排盘脚本依赖:
curl -fsSL https://raw.githubusercontent.com/gaowei90098-creator/mingyu-skill/main/scripts/install.sh | bash -s -- --with-deps如果你像维护其他开源 skill 一样,想手动复制标准目录:
cp -R codex/skills/mingyu ~/.codex/skills/mingyu
cp -R claude-code/skills/mingyu ~/.claude/skills/mingyu安装后可以直接对 agent 说:
Use $mingyu to read this birth chart.
或:
使用 mingyu skill 帮我分析这个八字和紫微命盘。
| Module | What It Does | Typical User Prompt |
|---|---|---|
| Bazi chart facts | 四柱、日主、纳音、命宫、身宫、胎元、起运、大运链 | 帮我排八字 |
| Bazi analysis | 日主旺衰、十神、五行、调候、格局、喜用神、大运流年 | 这个盘身强还是身弱?用神是什么? |
| Zi Wei chart facts | 十二宫、命宫、身宫、五行局、主星辅星、四化、大限 | 帮我看紫微命盘 |
| Zi Wei analysis | 三方四正、对宫借星、宫位证据、大限与流年分层 | 我的财帛宫和官禄宫怎么样? |
| Wealth framework | 财位四宫、成格判断、生年四化、八字担财、大运曲线 | 我这个盘财富等级如何? |
| Product collaboration | 命语/水滴语气、命盘展示、AI 命理产品体验、代码维护 | 帮我优化命理 AI 的系统提示词 |
User birth info or chart question
|
v
Mingyu Skill
|
+-- references/ domain rules loaded as needed
| +-- wuxing-tables.md stems, branches, hidden stems, ten gods
| +-- shichen-table.md Chinese hours and hour stem rules
| +-- dayun-rules.md luck cycle and annual flow rules
| +-- classical-texts.md classical interpretation references
| +-- project-guide.md Mingyu product/code collaboration guide
|
+-- scripts/ optional deterministic helpers
| +-- calculate_chart.py Bazi JSON helper using lunar-python
| +-- calculate_ziwei.cjs Zi Wei JSON helper using iztro
|
v
Fact lock: pillars, day master, palaces, mutagens, da-yun, decadal cycles
|
v
Layered interpretation: Bazi + Zi Wei + topic-specific evidence
|
v
Warm, bounded, non-fatalistic answer
This is the default mode for most Claude Code and Codex users.
Step 1: Install the skill.
Step 2: Ask the agent to use $mingyu.
Step 3: Provide birth data or an existing chart.
Step 4: The agent reads SKILL.md and references/ to guide analysis.
No Python or Node dependency is required in this mode.
Use this when you want the agent to run local chart helpers.
python3 scripts/setup_env.py
npm testThen run:
python3 scripts/calculate_chart.py --year 1995 --month 8 --day 15 --hour 14 --minute 30 --gender 男printf '{"birthday":"1995-08-15","time_idx":7,"gender":"男"}' | node scripts/calculate_ziwei.cjsWindows PowerShell:
'{"birthday":"1995-08-15","time_idx":7,"gender":"男"}' | node scripts/calculate_ziwei.cjs| Input | Required | Notes |
|---|---|---|
| Solar birth date | Yes | YYYY-MM-DD preferred |
| Birth time | Yes for full chart | If unknown, state uncertainty and avoid over-reading hour-sensitive parts |
| Gender | Yes for da-yun direction and Zi Wei conventions | Supports 男/女, male/female |
| Birthplace | Recommended | Useful when discussing true solar time |
| Existing chart JSON | Optional | Agent can analyze already generated chart data |
Mingyu Skill is designed to reduce common AI metaphysics mistakes:
| Risk | Guardrail |
|---|---|
| Mixing 八字大运 and 紫微大限 | Treat them as separate systems and label them clearly |
| Moving finished cycles into the future | Lock full da-yun and decadal cycle sequence before interpretation |
| One-palace wealth judgment | Require wealth analysis across 财帛、田宅、福德、官禄 plus 八字担财 |
| Overconfident prediction | Use tendency, evidence, and uncertainty instead of fatalistic claims |
| Missing dependency | Continue in pure Skill mode and disclose that deterministic scripts were not run |
| Health/legal/financial overreach | Keep outputs as cultural and reflective guidance, not professional advice |
| Layer | Choice |
|---|---|
| Skill format | SKILL.md plus references, scripts, and Codex metadata |
| Claude Code install path | ~/.claude/skills/mingyu or project .claude/skills/mingyu |
| Codex install path | ~/.codex/skills/mingyu |
| Bazi helper | Python 3.9+ with lunar-python |
| Zi Wei helper | Node.js 18+ with iztro |
| Environment setup | python3 scripts/setup_env.py |
| Deterministic validation | python3 scripts/validate.py or npm test |
| Codex metadata | agents/openai.yaml |
| License | MIT |
The Zi Wei helper uses Node iztro because it is easier to install across agent environments and avoids Python py_iztro/pythonmonkey thread stability issues seen in some runtimes.
Mingyu Skill treats chart calculation as a deterministic helper, not as an LLM guessing task.
Current validation fixture:
| Case | Expected |
|---|---|
| Solar birth | 1995-08-15 14:30, male |
| Bazi pillars | 乙亥 甲申 戊寅 己未 |
| Day master | 戊 |
| Zi Wei Chinese date | 乙亥 甲申 戊寅 己未 |
| Zi Wei palaces | 12 palaces |
| Key mutagens | 天机化禄、太阴化忌、紫微化科、天梁化权 |
Run validation:
python3 scripts/setup_env.py
python3 scripts/validate.pyThis verifies:
- Bazi helper returns the expected four pillars, day master, and da-yun chain.
- Zi Wei helper returns the expected Chinese date, 命宫/身宫, 12 palaces, and key mutagens.
- Script dependencies are installed and executable in the current environment.
For production-grade use, add your own fixtures in scripts/validate.py and compare outputs against trusted calendars or existing chart data.
mingyu-skill/
├── SKILL.md # Skill entry point
├── CHANGELOG.md # Version history
├── codex/skills/mingyu/ # Ready-to-copy Codex skill package
├── claude-code/skills/mingyu/ # Ready-to-copy Claude Code skill package
├── agents/openai.yaml # Codex UI metadata
├── references/
│ ├── project-guide.md # Mingyu product/code collaboration guide
│ ├── wuxing-tables.md # Five elements, stems, branches, ten gods
│ ├── shichen-table.md # Chinese hours and hour stem rules
│ ├── dayun-rules.md # Luck cycle and annual flow rules
│ └── classical-texts.md # Classical interpretation summaries
├── scripts/
│ ├── install.sh # One-line installer
│ ├── setup_env.py # Optional dependency setup/check
│ ├── validate.py # Deterministic chart validation
│ ├── calculate_chart.py # Bazi chart helper
│ └── calculate_ziwei.cjs # Zi Wei chart helper
├── requirements.txt
├── package.json
└── LICENSE
| Version | Date | Highlights |
|---|---|---|
| v1.1.0 | 2026-06-10 | Codex/Claude ready-to-copy skill directories, environment setup script, deterministic validation script, and accuracy documentation. |
| v1.0.0 | 2026-05-19 | First stable release. One-line installer, Claude Code/Codex support, Bazi helper, Zi Wei helper, domain references, Codex metadata. |
| v0.3.0 | 2026-05-19 | README polished for public GitHub usage, installation script added, repository topics configured. |
| v0.2.0 | 2026-05-19 | Compatibility pass: clear dependency model, npm test, friendly dependency errors. |
| v0.1.0 | 2026-05-19 | Initial extraction from Mingyu project into standalone skill package. |
See CHANGELOG.md for details.
Project-level Claude Code:
mkdir -p .claude/skills
git clone https://github.com/gaowei90098-creator/mingyu-skill .claude/skills/mingyuGlobal Claude Code:
mkdir -p ~/.claude/skills
git clone https://github.com/gaowei90098-creator/mingyu-skill ~/.claude/skills/mingyuCodex:
mkdir -p ~/.codex/skills
git clone https://github.com/gaowei90098-creator/mingyu-skill ~/.codex/skills/mingyupython3 scripts/setup_env.py
python3 scripts/validate.pyExpected:
- Bazi helper returns valid JSON with four pillars and da-yun.
- Zi Wei helper returns valid JSON with 12 palaces and mutagens.
- Skill validation passes with the Codex skill validator.
This project is for traditional culture study, entertainment, and AI product research. It does not provide medical, legal, investment, marriage, or other professional advice.
本项目用于传统文化学习、娱乐和 AI 产品研究。命理分析不构成医疗、法律、投资、婚姻等重大决策建议。
MIT