bazi-ziwei
八字 + 紫微斗数 AI 排盘与综合分析。当用户提供生辰(阳历/农历日期、时辰、性别)询问八字、紫微、命理、命盘、流年大运相关问题时使用。基于 Yiqi 算法库 + enrichBazi 补全层精准排盘(杜绝 LLM 自行排盘出错),支持按需独立分析八字 / 独立分析紫微 / 两盘交叉印证。
pinned to #8fd7dfaupdated last month
Ask your AI client: “install skills/bazi-ziwei”.
Requires the metahub MCP server installed in your client. Set up MCP.
mh install skills/bazi-ziweimetahub onboarded this repo on the author's behalf.
If you own github.com/dzcmemory-web/bazi-ziwei-skill on GitHub, claim the listing to take over publishing. Your claim preserves the existing eval history and badges; only the curator label is replaced with verified-publisher on your next publish.
Stars
450
Last commit
last month
Latest release
published
- #ai-agent
- #bazi
- #bazi-suanming
- #chinese-astrology
- #claude-skill
- #fortune-telling
- #metaphysics
- #skill-md
- #ziwei
- #ziwei-doushu
Evaluation report
WarningsAutomated checks the publisher passed at publish time — structure, docs, safety, and whether the artifact behaves as claimed.8fd7dfa· last month
Kind-specific
31Skill: SKILL.md present
found at SKILL.md · frontmatter source: SKILL.md
Skill: body content present
2,494 words · 5,398 chars · 15 sections · 5 code blocks
Skill: triggers declaredwarn
No `trigger` phrases in SKILL.md frontmatter
Add `trigger:` lines so Claude knows when to activate this skill — e.g. `when building MCP servers` or `for diagram creation`.
Skill: allowed-tools scope
no allowed-tools restriction (Claude may use anything)
Release history
1- releasecurrent8fd7dfawarnlast month
Contents
这是什么
一个遵循 SKILL.md 开放标准 的命理分析 Skill,可装入 Claude Code / Claude Desktop / Codex / Cursor / Hermes / OpenClaw 等支持该标准的 AI Agent。
它做三件大模型单独做不好的事:
- 精准排盘:八字四柱、紫微十二宫、大运流年由内置算法库计算,不让 LLM 自己排——纯 LLM 排盘常把日柱、日主、格局算错,一步错则全盘失真。
- 格局补层:在排盘之上补一层"格局 / 旺衰 / 调候 / 刑冲合害 / 盖头截脚"算法,喂给 LLM 做有依据的分析。
- 综合印证:把八字与紫微两套独立体系的结论做交叉对账——主轴是否一致、人生窗口是否对齐、冲突时听谁。这是本 Skill 区别于"任意 LLM + 任意排盘工具"的核心增量。
✨ 特性
- 🎯 算法精准:排盘核心源自开源项目 Yiqi(MIT),经实测对齐;补层算法经 7 组案例多维度回归验证
- 🧭 三种分析模式:八字独立 / 紫微独立 / 八字+紫微综合印证
- 📜 两种呈现形态:Markdown 长文深度版 + 🎴 单文件 HTML 海报版(综合印证专属)
- 🎴 水墨风命盘海报:现代极简 × 中式水墨,含紫微 12 宫盘 + 八字四柱盘 + 六维交叉对账,可截图分享
- 🔌 跨 Agent:一份 SKILL.md,多个主流 Agent 通用
- 🔒 隐私优先:所有排盘在本地完成,无需联网;运行产物默认 gitignore
🚀 安装
1. 克隆仓库
git clone https://github.com/dzcmemory-web/bazi-ziwei-skill.git
2. 安装算法层依赖
cd bazi-ziwei-skill/calculator
npm install
需要 Node.js >= 18。算法层依赖仅一个:
lunar-typescript(MIT)。
3. 注册到你的 Agent
把整个 bazi-ziwei-skill/ 文件夹放进 Agent 的 skills 目录:
| Agent | skills 目录 |
|---|---|
| Claude Code / Claude Desktop | ~/.claude/skills/bazi-ziwei/ |
| Codex | ~/.codex/skills/bazi-ziwei/ 或项目内 AGENTS.md 引用 |
| Cursor | 项目 .cursor/ 规则引用 |
| Hermes Agent | ~/.hermes/skills/bazi-ziwei/ |
| OpenClaw | 其 skills 目录 / ClawHub 本地安装 |
Agent 会自动读取 SKILL.md 并按需调用。
📖 使用
装好后,直接对 Agent 说出生时间即可:
我是 2000 年 1 月 1 日中午 12 点出生的男生,帮我看下命盘。
Agent 会:
- 问你要哪种分析(八字 / 紫微 / 综合印证)
- 综合印证时再问要长文还是 HTML 海报
- 调用算法层排盘 → 加载对应提示词 → 输出分析或渲染海报
详细流程见 SKILL.md,测试方法见 TEST-GUIDE.md。
命令行直接排盘(不经 Agent)
cd calculator
# 排盘 → JSON
node dist/run-chart.js --year=2000 --month=1 --day=1 --hour=12 --minute=0 --gender=male > chart.json
# JSON → 可读文本盘
node dist/dump-text.js --input=chart.json --output=chart.txt
# JSON + 分析 JSON + 模板 → HTML 海报
node dist/render.js --chart=chart.json --analysis=analysis.json \
--template=../templates/report-zonghe-poster.html --output=report.html --currentYear=2026
仓库自带一份合成示例(2000-01-01 男,非真人):
examples/sample-chart.json— 算法层排盘输出examples/sample-chart.txt— 文墨天机风文本盘examples/sample-analysis.json— 综合印证分析(示例)examples/sample-report.html— 综合印证海报成品,下载后用浏览器打开即可预览效果
📁 目录结构
bazi-ziwei-skill/
├── SKILL.md Skill 主入口(Agent 读这个)
├── TEST-GUIDE.md 测试指南(5 条用户路径)
├── calculator/
│ ├── run-chart.ts 排盘入口:生辰 → JSON
│ ├── dump-text.ts JSON → 文墨天机风文本盘
│ ├── render.ts JSON + 分析 + 模板 → 单文件 HTML
│ ├── yiqi-core/ 排盘核心算法(vendored from Yiqi, MIT)
│ └── bazi-enrich/ 格局/旺衰/调候/刑冲合害 补层算法
├── prompts/
│ ├── bazi-prompt.md 八字独立分析(长文)
│ ├── ziwei-prompt.md 紫微独立分析(长文)
│ ├── zonghe-yinzheng-prompt.md 综合印证(长文)
│ └── zonghe-poster.md 综合印证(海报 JSON 输出)
├── templates/
│ └── report-zonghe-poster.html 综合印证海报模板(占位符)
└── examples/
├── sample-chart.json 合成示例排盘
└── sample-chart.txt 合成示例文本盘
🏗️ 工作原理
生辰 ──> run-chart.ts ──> chart.json ──> dump-text.ts ──> chart.txt
(算法层精准排盘) (LLM 友好文本)
│
┌───────────────────────────┤
▼ ▼
长文提示词 海报提示词
(Markdown 散文) (严格 JSON 输出)
│
render.ts + 模板
▼
单文件 HTML 海报
关键设计:LLM 只负责"分析",不负责"排盘"和"画 HTML"。排盘交给确定性算法,HTML 视觉交给固定模板,LLM 产出的结构化内容填进模板槽位——三者各司其职,互不污染。
🙏 致谢
- 排盘核心算法源自 Yiqi 八字紫微排盘系统(MIT 协议),详见
NOTICE - 农历换算依赖 lunar-typescript(MIT)
📬 联系 / Contact
问题反馈、合作或交流,欢迎邮件:[email protected]
如果这个项目对你有帮助,欢迎点一个 ⭐ Star 支持。
⚠️ 免责声明
本项目基于传统八字与紫微斗数理论框架,仅供文化研究与娱乐参考,不构成医疗、投资、婚姻、法律等任何决策依据。命运由个人选择与客观环境共同塑造。
📄 License
MIT © 2026 dzcmemory-web
Reviews
No reviews yet. Be the first.
Related
Frontend Slides
Create beautiful slides on the web using Claude's frontend skills
Guizang Ppt Skill
AI-agent Skill for generating polished HTML slide decks: editorial magazine and Swiss layouts, image prompts, social covers, and a WebGL/low-power presentation runtime.
Verification Before Completion
Evidence before assertions, always
mh install skills/bazi-ziwei