bazi-ziwei
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "bazi-ziwei" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-787f2f6566ead09d2f0bd18e913198872b8eba54cc71acf1663832a7f413b51d. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/bazi-ziwei before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A specialized skill for Bazi and Ziwei Doushu, intended to help an AI agent more effectively complete related tasks and handle related requests.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- User scene: Provide time of birth. 2000 - What? 01 - What? 01 Noon 12 : 00 Man) wants analysis Ask "Look at eight words for me / watch purple / fortune tell / watch the life course / watch the flow of the year"
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- If the user does not provide the time of birth, **you must proactively ask**, do not default to the Zi hour. The birth hour has a huge impact on the day pillar of the Four Pillars and the Ziwei life palace. Place of birth is not required. Charting uses clock time directly; do not apply true-solar-time longitude correction.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: 八字紫微斗数技能
slug: bazi-ziwei
version: 1.0.0
displayName: 八字紫微斗数技能
description: >
八字紫微斗数技能专用技能,帮助AI Agent高效完成相关任务。
summary: "八字紫微斗数技能专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 中国传统文化
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"八字 + 紫微斗数综合分析 Skill
何时触发
用户场景:
- 提供出生时间("我是 2000-01-01 中午 12:00 男")并希望分析
- 询问"帮我看八字 / 看紫微 / 算命 / 看命盘 / 看流年大运"
- 提供命盘文本(文墨天机、紫微斗数排盘软件导出格式)希望深度解读
- 询问特定大运/流年的吉凶
不触发:单纯的星座 / 塔罗 / 周公解梦 / 风水 / 姓名学。
必需输入
公历或农历日期 (YYYY-MM-DD)
出生时刻 (HH:MM, 24 小时制)
性别 (男/女)
若用户没给时辰,必须主动询问,不要默认子时。时辰对四柱日柱和紫微命宫影响极大。
不需要出生地。排盘直接使用钟表时间,不做真太阳时经度校正。
执行流程
Step 0 — 决策门(开场必做) ⭐
问题 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 两份 |
海报模板仅综合印证一种。八字独立 / 紫微独立只有长文输出(用户深度阅读用)。这是经过设计的——海报是综合印证独占的杀手锏,承担社交分享 + 用户惊艳的角色。
Step 1 — 排盘(算法层,产出 JSON)
绝对不要让 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 自行排盘均出错。算法层不可绕过。
Step 2 — 文本盘转换(算法层,产出可读文本)
LLM 读 JSON 不如读结构化文本。把 Step 1 的 JSON 转成文墨天机风格的树状文本:
node dist/dump-text.js --input=chart.json --output=chart.txt
文本盘包含:
- 紫微部分:基本信息 + 生年四化 + 十二宫(含主星 / 辅星 / 大限 / 流年)
- 八字部分:四柱(含藏干十神 / 星运 / 自坐 / 纳音)+ 大运 + 算法补层(格局 / 旺衰 / 调候 / 关系 / 整柱)
将 chart.txt 内容连同对应提示词一起送给 LLM 做分析。
Step 3 — 分析(按 Step 0 用户选择执行对应分支)
Step 3 — 长文版(用户选 1 / 2 / 3+A / 3+C)
读取对应长文提示词(bazi-prompt.md / ziwei-prompt.md / zonghe-yinzheng-prompt.md),喂入 chart.txt,输出 Markdown 长文。
综合印证(3+A)的前置条件:先跑八字 + 紫微独立分析拿到中间报告,再喂给
zonghe-yinzheng-prompt.md。 如输出被截断,分段输出。
Step 3 — 海报版(仅用户选 3+B 或 3+C)
- 读取
prompts/zonghe-poster.md,喂入chart.txt - LLM 必须输出严格 JSON(不是 Markdown)——提示词末尾会要求"直接以
{开头",照办即可 - 把 LLM 输出的 JSON 保存为
analysis.json - 调用渲染脚本:
cd 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 文件路径告诉用户,让其用浏览器打开
重要:海报版的视觉由 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
也就是说,依赖问题报错时再修,不要装好就主动检查。
关键约束
- 装好不自检:见上节"安装后行为"。不要主动跑示例排盘 / 自检 / smoke test
- 决策门必做:永远先问用户要哪种分析,避免无意义的 token 消耗 + 输出截断
- 排盘必须走算法层:不要徒手算四柱、紫微宫位、大限。错一步全盘垮
- 不引入命盘外变量:风水、姓名、阳宅、紫白飞星不在本 Skill 范围
- 冲突要说出来:八字与紫微出现矛盾信号时按综合印证提示词的 4 条规则判定,不和稀泥
- 置信度自评:边界情况(旺衰临界、格局模糊、两盘对立)必须标"置信度:低"
- 不替用户做决策:投资、择偶、医疗、堕胎等决策类问题,给信号不给指令
- 敏感问题拒答:下蛊、断人财路、害人命运等违禁内容直接拒绝
- 免责声明:分析末尾必带"仅供文化研究与娱乐参考"
文件清单
├── 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 应该走:
- 信息确认(日期/时辰/性别 ✅)
- 决策门:"想要八字分析 / 紫微分析 / 综合印证?"
- 用户回 "八字":
- Step 1:跑
run-chart.ts产出chart.json - Step 2:跑
dump-text.ts产出chart.txt - Step 3a:加载
prompts/bazi-prompt.md+ 喂入chart.txt→ 输出八字分析
- Step 1:跑
- 提醒"若要紫微 / 综合印证可随时追问"
失败模式与处理
| 现象 | 原因 | 处理 |
|---|---|---|
| 排盘脚本报错 | 日期超 1900-2100 / 时辰格式错 | 询问用户校正 |
| AI 想"凭记忆排盘" | 偷懒走捷径 | 拒绝。算法层是不可绕过的硬约束 |
| 输出被截断 | 三段一锅出超 token 上限 | 回到决策门,拆分输出 |
| 算法层和用户其他软件结果不一致 | 命名流派差异(建禄格 vs 比肩格) | 按算法层 notes 解释,不偷换说法 |
| Windows + 中文路径 + PowerShell 编码错乱 | 平台特性 | 在 cmd / git bash / WSL 下运行,避免 PowerShell |
免责声明(每次输出末必带)
本分析基于传统八字与紫微斗数理论框架,仅供文化研究与娱乐参考,不构成医疗、投资、婚姻、法律等任何决策依据。命运由个人选择与客观环境共同塑造。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供专业八字+紫微斗数综合分析,满足中国传统文化爱好者高频刚需
- 具备完整算法排盘层,避免纯LLM排盘错误,保障分析准确性
- 支持多形态输出(长文深度分析+HTML可视化海报),提升用户体验
Highlights
- 触发词覆盖全面,包含'看八字/看紫微/算命/看命盘'等常见变体
- 明确排除边界(星座/塔罗/风水等),避免误触发
- 必需输入项清晰(日期+时辰+性别),引导用户完整提供信息
Areas to improve
-
缺少显式When to Use章节标题 Reported severity: Minor
文档中'何时触发'内容存在但未使用标准章节标题
Recommendation: 建议将'何时触发'改为标准'## When to Use'章节标题以符合规范
-
文档长度接近上限 Reported severity: Minor
SKILL.md约480行,接近500行建议上限
Recommendation: 建议将部分详细说明(如失败模式)移至独立文档并通过引用链接
Highlights
- 执行流程分Step清晰(决策门→排盘→文本转换→分析)
- frontmatter元数据完整,包含name/slug/version/license等必要字段
- 提供端到端工作示例,便于理解完整使用流程
Areas to improve
-
未说明需预构建calculator/dist目录 Reported severity: Minor
脚本调用依赖dist/run-chart.js等构建产物,但未说明需先执行npm run build
Recommendation: 建议在安装说明中增加'首次使用前需cd calculator && npm install && npm run build'
Highlights
- 算法层与LLM解耦,通过TypeScript脚本确保排盘准确性
- 覆盖主要异常场景(日期范围、依赖安装、输出截断、平台兼容性)
- 关键约束明确(如'装好不自检''排盘必须走算法层'),避免常见执行错误
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 152
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.