Files
小钰 4ff76822ad feat: 梅花易数 + 梅花心易 算法层 v1.0
- 八卦基础数据(先天数/五行/方位/生克关系)
- 六十四卦完整数据(卦名/卦辞/象辞/吉凶/关键词)
- 体用分析引擎(动爻→体用→五行生克→旺衰判定)
- 变卦/互卦计算
- 三种起卦方式:数字法、时间法、外应法(梅花心易)
- CLI入口:JSON/文本双格式输出
- 断卦分析 prompt + 梅花心易 prompt + 海报版 prompt
- HTML海报模板(古风暗色系)
2026-08-03 07:12:25 +08:00

140 lines
4.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: meihua-yishu
description: 梅花易数 + 梅花心易排盘与断卦。数字起卦、时间起卦、外应起卦,体用五行分析,输出JSON+文本+HTML海报。
---
# 梅花易数 + 梅花心易 Skill
## 何时触发
用户场景:
- "帮我用梅花易数算一下" / "起个卦" / "梅花易数看下"
- 提供 2-3 个数字要求起卦
- 描述外应现象要求断卦("我看到一只鸟飞过" / "听到雷声")
- "用心易看看" / "梅花心易"
**不触发**:单纯的八字/紫微(见 bazi-ziwei)、六爻(见 liuyao-skill)、星座/塔罗。
---
## 必需输入
```
起卦方式: number(数字) / time(时间) / observation(外应/心易)
问事类型: 事业/财运/感情/健康/出行/考试 等(可选)
```
数字法需 2-3 个数字(上卦数、下卦数、动爻数可选)。
时间法无需额外输入(自动取当前时间)。
外应法需描述观察到的现象。
---
## 执行流程
### Step 0 — 确认起卦方式
> "梅花易数可以这样起卦:
> 1. **数字法** — 你报 2-3 个数字(最常用)
> 2. **时间法** — 按当前时间自动起卦(最快)
> 3. **梅花心易** — 描述你看到/听到的外应现象(最高境界)"
如果用户选梅花心易,追问外应:
> "请描述你在起念问事那一刻看到或听到的:
> - 什么声音?(雷声、笑声、流水…)
> - 什么东西?(大树、飞鸟、火焰…)
> - 什么方位/颜色/数字?
> 可以描述一个或多个外应。"
### Step 1 — 排盘(算法层,产出 JSON)
**绝对不要让 AI 自己排梅花卦**。必须调用算法层:
```bash
cd calculator
# 数字起卦
node dist/run-hua.js --method=number --numbers="3,5" --question="事业" > hua.json
# 时间起卦
node dist/run-hua.js --method=time --question="财运" > hua.json
# 外应起卦(心易)
node dist/run-hua.js --method=observation --observation="东方传来雷声" --trigrams="4,6" --question="出行" > hua.json
```
### Step 2 — 文本盘输出
```bash
node dist/run-hua.js --method=number --numbers="3,5" --question="事业" --output=text > hua.txt
```
文本输出包含:主卦、体用、五行关系、旺衰、变卦、互卦。
### Step 3 — 断卦分析
读取对应提示词:
- 标准梅花易数 → `prompts/duangua-prompt.md`
- 梅花心易 → `prompts/xinyi-prompt.md`
喂入 `hua.txt` + `hua.json`,输出断卦长文。
### Step 4 — 海报输出(可选)
1. 读取 `prompts/duangua-poster.md`,喂入 `hua.txt`
2. LLM 输出 JSON → 保存为 `analysis.json`
3. 调用渲染脚本生成 HTML:
```bash
cd calculator
node dist/render.js --chart=hua.json --analysis=analysis.json --template=../templates/meihua-poster.html --output=<name>-<date>.html
```
---
## 关键约束
1. **排盘必须走算法层**:不要徒手算八卦数、体用关系
2. **一事一占**:每次只问一件事
3. **梅花心易重直觉**:外应分析要结合卦象,不要纯逻辑推导
4. **不替用户做决策**:给信号不给指令
5. **禁忌**:不诚不占、不疑不占、不动不占
6. **免责声明**:分析末尾必带
---
## 文件清单
```
meihua-yishu/
├── SKILL.md ← 本文件
├── calculator/
│ ├── src/
│ │ ├── trigrams.ts ← 八卦基础数据(先天数/五行/方位/生克)
│ │ ├── hexagrams.ts ← 六十四卦数据(卦名/卦辞/象辞/吉凶)
│ │ ├── analysis.ts ← 体用分析 + 五行生克 + 旺衰 + 变互卦
│ │ └── run-hua.ts ← CLI 入口
│ ├── package.json
│ ├── tsconfig.json
│ └── dist/
├── prompts/
│ ├── duangua-prompt.md ← 标准梅花易数断卦提示词
│ ├── xinyi-prompt.md ← 梅花心易断卦提示词
│ └── duangua-poster.md ← 海报版 JSON 输出提示词
├── templates/
│ └── meihua-poster.html ← 海报 HTML 模板
└── fixtures/ ← 验证案例
```
---
## 报告部署
生成海报 HTML 后,部署到报告站点:
```bash
cp <报告名>.html /root/.openclaw/workspace/reports/meihua/<报告名>.html
```
访问地址:`https://report.zhaidk.xyz/meihua/<报告名>.html`
---
*本分析基于传统梅花易数理论框架,仅供文化研究与娱乐参考,不构成任何决策依据。*