AI 八字 + 紫微斗数排盘与综合印证 Skill:算法精准排盘(不靠 LLM 猜),三种分析模式,一键生成水墨风 HTML 命盘海报。兼容 Claude / Codex / Cursor / Workbuddy 等 SKILL.md Agent。
# Add to your Claude Code skills
git clone https://github.com/dzcmemory-web/bazi-ziwei-skillGuides for using ai agents skills like bazi-ziwei-skill.
Last scanned: 6/18/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-06-18T08:48:28.339Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}bazi-ziwei-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by dzcmemory-web. AI 八字 + 紫微斗数排盘与综合印证 Skill:算法精准排盘(不靠 LLM 猜),三种分析模式,一键生成水墨风 HTML 命盘海报。兼容 Claude / Codex / Cursor / Workbuddy 等 SKILL.md Agent。. It has 266 GitHub stars.
Yes. bazi-ziwei-skill passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/dzcmemory-web/bazi-ziwei-skill" and add it to your Claude Code skills directory (see the Installation section above). bazi-ziwei-skill ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
bazi-ziwei-skill is primarily written in TypeScript. It is open-source under dzcmemory-web on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh bazi-ziwei-skill against similar tools.
No comments yet. Be the first to share your thoughts!
用户场景:
不触发:单纯的星座 / 塔罗 / 周公解梦 / 风水 / 姓名学。
公历或农历日期 (YYYY-MM-DD)
出生时刻 (HH:MM, 24 小时制)
性别 (男/女)
若用户没给时辰,必须主动询问,不要默认子时。时辰对四柱日柱和紫微命宫影响极大。
不需要出生地。排盘直接使用钟表时间,不做真太阳时经度校正。
问题 1:要看哪种命理?
"我可以做三种分析:
- 八字独立分析(事业 / 财运 / 婚恋 / 子女 / 六亲 / 健康,按八字格局推演 — 长文输出)
- 紫微独立分析(十二宫 + 大限 + 生年四化 + 流年 — 长文输出)
- 八字 + 紫微综合印证(两盘交叉对账 — 提供长文 / 可视化海报 / 两种都要)"
如果用户选 3,再追问问题 2:呈现形态
"综合印证可以这样输出: A. 📜 长文深度版(Markdown 散文,沉浸阅读) B. 🎴 结构化海报版(单文件 HTML,可截图分享) C. 两种都要"
根据选择加载相应提示词和模板:
| 用户选 | 加载提示词 | 模板 | 输出 |
|---|---|---|---|
| 1 | prompts/bazi-prompt.md |
— | Markdown 对话回复 |
| 2 | prompts/ziwei-prompt.md |
— | Markdown 对话回复 |
| 3 + A | prompts/zonghe-yinzheng-prompt.md |
— | Markdown 对话回复 |
| 3 + B | prompts/zonghe-poster.md |
templates/report-zonghe-poster.html |
<name>-zonghe.html |
| 3 + C | 上述两份都跑 | 同上 | Markdown + HTML 两份 |
海报模板仅综合印证一种。八字独立 / 紫微独立只有长文输出(用户深度阅读用)。这是经过设计的——海报是综合印证独占的杀手锏,承担社交分享 + 用户惊艳的角色。
绝对不要让 AI 自己排八字或紫微。必须调用算法层脚本:
cd calculator
node dist/run-chart.js --year=YYYY --month=MM --day=DD --hour=HH --minute=MM --gender=male > chart.json
注意:run-chart.ts 的 stdout 是纯 JSON,stderr 是 debug 信息。重定向时只取 stdout(> chart.json),不要 2>&1。
脚本输出 JSON:
bazi:四柱 / 十神 / 星运 / 自坐 / 纳音 / 藏干 / 大运(含 startAge/endAge/startYear/endYear)bazi.enrichment:格局 / 旺衰 / 调候 / 五行旺相 / 五行统计 / 天干关系 / 地支关系 / 整柱判定ziwei:十二宫 / 生年四化 / 大限 / 阴阳 / 五行局 / 命主身主关键约束:纯 LLM 排盘会错排日柱 → 日主 → 格局 → 用神,全链失真。Case B 测试证明 DeepSeek/Gemini 自行排盘均出错。算法层不可绕过。
LLM 读 JSON 不如读结构化文本。把 Step 1 的 JSON 转成文墨天机风格的树状文本:
node dist/dump-text.js --input=chart.json --output=chart.txt
文本盘包含:
将 chart.txt 内容连同对应提示词一起送给 LLM 做分析。
读取对应长文提示词(bazi-prompt.md / ziwei-prompt.md / zonghe-yinzheng-prompt.md),喂入 chart.txt,输出 Markdown 长文。
综合印证(3+A)的前置条件:先跑八字 + 紫微独立分析拿到中间报告,再喂给
zonghe-yinzheng-prompt.md。 如输出被截断,分段输出。
prompts/zonghe-poster.md,喂入 chart.txt{ 开头",照办即可analysis.jsoncd calculator
node dist/render.js \
--chart=chart.json \
--analysis=analysis.json \
--template=../templates/report-zonghe-poster.html \
--output=<user-name>-<date>.html \
--currentYear=<YYYY>
重要:海报版的视觉由 HTML 模板决定,LLM 只产数据不产 HTML。如果 LLM 输出含 markdown 包装(如 ```json … ```),渲染前需剥掉。
装好 Skill 后不要主动跑任何验证 / 自检命令。 不要试 Smoke Test、不要排示例盘、不要分析示例命主。装好就是装好,等用户来给生辰再开始工作。
自检命令在
TEST-GUIDE.md中由人工按需运行,不在 Agent 的职责范围内。Agent 主动跑会浪费 token + 触发上下文压缩。
依赖检查(仅在用户首次提供生辰、Agent 准备跑 run-chart.ts 报错时):
cd <skill-root>/calculator
ls node_modules >/dev/null 2>&1 || npm install
也就是说,依赖问题报错时再修,不要装好就主动检查。
├── SKILL.md ← 本文件
├── calculator/
│ ├── run-chart.ts ← 入口:生辰 → JSON(stdout 纯 JSON / stderr debug)
│ ├── dump-text.ts ← JSON → 文墨天机风文本
│ ├── render.ts ← 渲染脚本:chart.json + analysis.json + 模板 → HTML
│ ├── package.json ← 算法层依赖声明
│ ├── yiqi-core/ ← Yiqi 算法(已 vendored 入库,无外部依赖)
│ └── bazi-enrich/ ← enrichBazi 补层(格局/旺衰/调候/关系/整柱)
├── prompts/
│ ├── bazi-prompt.md ← 八字独立分析(长文)
│ ├── ziwei-prompt.md ← 紫微独立分析(长文)
│ ├── zonghe-yinzheng-prompt.md ← ⭐ 综合印证(长文)
│ └── zonghe-poster.md ← ⭐ 综合印证(海报版 JSON 输出)
├── templates/
│ └── report-zonghe-poster.html ← 综合印证海报模板(占位符)
└── fixtures/ ← 7 个验证案例(Case A-G)
注:HTML 渲染目前仅支持综合印证模式。如用户选了八字独立 / 紫微独立又问"能不能出 HTML 报告",告知"目前 HTML 海报仅对综合印证开放,建议选综合印证(含八字+紫微)以拿到海报"。
用户:我是 2000 年 1 月 1 日 12:00 出生的男生,帮我看下命盘。
Skill 应该走:
run-chart.ts 产出 chart.jsondump-text.ts 产出 chart.txtprompts/bazi-prompt.md + 喂入 chart.txt → 输出八字分析| 现象 | 原因 | 处理 |
|---|---|---|
| 排盘脚本报错 | 日期超 1900-2100 / 时辰格式错 | 询问用户校正 |
| AI 想"凭记忆排盘" | 偷懒走捷径 | 拒绝。算法层是不可绕过的硬约束 |
| 输出被截断 | 三段一锅出超 token 上限 | 回到决策门,拆分输出 |
| 算法层和用户其他软件结果不一致 | 命名流派差异(建禄格 vs 比肩格) | 按算法层 notes 解释,不偷换说法 |
| Windows + 中文路径 + PowerShell 编码错乱 | 平台特性 | 在 cmd / git bash / WSL 下运行,避免 PowerShell |
本分析基于传统八字与紫微斗数理论框架,仅供文化研究与娱乐参考,不构成医疗、投资、婚姻、法律等任何决策依据。命运由个人选择与客观环境共同塑造。
AI 八字 + 紫微斗数排盘与综合印证 Skill
精准排盘(不靠 LLM 猜)· 三种分析模式 · 一键生成水墨风 HTML 命盘海报
简体中文 | English
综合印证海报示例(合成命主,仅供展示)
一个遵循 SKILL.md 开放标准 的命理分析 Skill,可装入 Claude Code / Claude Desktop / Codex / Cursor / Hermes / OpenClaw 等支持该标准的 AI Agent。
它做三件大模型单独做不好的事:
git clone https://github.com/dzcmemory-web/bazi-ziwei-skill.git
cd bazi-ziwei-skill/calculator
npm install
需要 Node.js >= 18。算法层依赖仅一个:
lunar-typescript(MIT)。
把整个 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 会:
详细流程见 SKILL.md,测试方法见 TEST-GUIDE.md。
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 产出的结构化内容填进模板槽位——三者各司其职,互不污染。
NOTICE问题反馈、合作或交流,欢迎邮件:dzcmemory@gmail.com
如果这个项目对你有帮助,欢迎点一个 ⭐ Star 支持。
本项目基于传统八字与紫微斗数理论框架,仅供文化研究与娱乐参考,不构成医疗、投资、婚姻、法律等任何决策依据。命运由个人选择与客观环境共同塑造。
MIT © 2026 dzcmemory-web