Skip to content

Commit 9ce1b1c

Browse files
authored
Merge pull request #1 from dweb-channel/main
【奇门遁甲】新增奇门遁甲排盘
2 parents 29315a4 + 9816f00 commit 9ce1b1c

34 files changed

Lines changed: 7936 additions & 46 deletions

.claude/commands/openspec/apply.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: OpenSpec: Apply
3+
description: Implement an approved OpenSpec change and keep tasks in sync.
4+
category: OpenSpec
5+
tags: [openspec, apply]
6+
---
7+
<!-- OPENSPEC:START -->
8+
**Guardrails**
9+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
10+
- Keep changes tightly scoped to the requested outcome.
11+
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
12+
13+
**Steps**
14+
Track these steps as TODOs and complete them one by one.
15+
1. Read `changes/<id>/proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
16+
2. Work through tasks sequentially, keeping edits minimal and focused on the requested change.
17+
3. Confirm completion before updating statuses—make sure every item in `tasks.md` is finished.
18+
4. Update the checklist after all work is done so each task is marked `- [x]` and reflects reality.
19+
5. Reference `openspec list` or `openspec show <item>` when additional context is required.
20+
21+
**Reference**
22+
- Use `openspec show <id> --json --deltas-only` if you need additional context from the proposal while implementing.
23+
<!-- OPENSPEC:END -->
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: OpenSpec: Archive
3+
description: Archive a deployed OpenSpec change and update specs.
4+
category: OpenSpec
5+
tags: [openspec, archive]
6+
---
7+
<!-- OPENSPEC:START -->
8+
**Guardrails**
9+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
10+
- Keep changes tightly scoped to the requested outcome.
11+
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
12+
13+
**Steps**
14+
1. Determine the change ID to archive:
15+
- If this prompt already includes a specific change ID (for example inside a `<ChangeId>` block populated by slash-command arguments), use that value after trimming whitespace.
16+
- If the conversation references a change loosely (for example by title or summary), run `openspec list` to surface likely IDs, share the relevant candidates, and confirm which one the user intends.
17+
- Otherwise, review the conversation, run `openspec list`, and ask the user which change to archive; wait for a confirmed change ID before proceeding.
18+
- If you still cannot identify a single change ID, stop and tell the user you cannot archive anything yet.
19+
2. Validate the change ID by running `openspec list` (or `openspec show <id>`) and stop if the change is missing, already archived, or otherwise not ready to archive.
20+
3. Run `openspec archive <id> --yes` so the CLI moves the change and applies spec updates without prompts (use `--skip-specs` only for tooling-only work).
21+
4. Review the command output to confirm the target specs were updated and the change landed in `changes/archive/`.
22+
5. Validate with `openspec validate --strict` and inspect with `openspec show <id>` if anything looks off.
23+
24+
**Reference**
25+
- Use `openspec list` to confirm change IDs before archiving.
26+
- Inspect refreshed specs with `openspec list --specs` and address any validation issues before handing off.
27+
<!-- OPENSPEC:END -->
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: OpenSpec: Proposal
3+
description: Scaffold a new OpenSpec change and validate strictly.
4+
category: OpenSpec
5+
tags: [openspec, change]
6+
---
7+
<!-- OPENSPEC:START -->
8+
**Guardrails**
9+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
10+
- Keep changes tightly scoped to the requested outcome.
11+
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
12+
- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.
13+
- Do not write any code during the proposal stage. Only create design documents (proposal.md, tasks.md, design.md, and spec deltas). Implementation happens in the apply stage after approval.
14+
15+
**Steps**
16+
1. Review `openspec/project.md`, run `openspec list` and `openspec list --specs`, and inspect related code or docs (e.g., via `rg`/`ls`) to ground the proposal in current behaviour; note any gaps that require clarification.
17+
2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, and `design.md` (when needed) under `openspec/changes/<id>/`.
18+
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
19+
4. Capture architectural reasoning in `design.md` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
20+
5. Draft spec deltas in `changes/<id>/specs/<capability>/spec.md` (one folder per capability) using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement and cross-reference related capabilities when relevant.
21+
6. Draft `tasks.md` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
22+
7. Validate with `openspec validate <id> --strict` and resolve every issue before sharing the proposal.
23+
24+
**Reference**
25+
- Use `openspec show <id> --json --deltas-only` or `openspec show <spec> --type spec` to inspect details when validation fails.
26+
- Search existing requirements with `rg -n "Requirement:|Scenario:" openspec/specs` before writing new ones.
27+
- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities.
28+
<!-- OPENSPEC:END -->

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ test/results/
3535

3636
.venv/
3737
test/
38+
39+
# Openspec
40+
openspec
41+
AGENTS.md
42+
CLAUDE.md

README.md

Lines changed: 64 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ claude mcp add mingpan -- npx -y mingpan
4444

4545
> 请帮我排一个八字命盘,1992年4月12日7点30分,男性
4646
47+
> 请帮我起一个奇门遁甲时盘,2024年6月21日10点
48+
4749
## 工具列表
4850

4951
### 命理排盘
@@ -52,33 +54,33 @@ claude mcp add mingpan -- npx -y mingpan
5254

5355
#### 八字命理
5456

55-
| 工具 | 说明 |
56-
|------|------|
57-
| `bazi_basic` | 八字命盘排盘(四柱、藏干、十神、五行力量) |
58-
| `bazi_dayun` | 大运列表(十年一运) |
59-
| `bazi_liunian` | 流年列表(指定年份范围) |
60-
| `bazi_liuyue` | 流月列表(节气月,立春起算) |
61-
| `bazi_liuri` | 流日列表(指定月份内每日) |
57+
| 工具 | 说明 |
58+
| -------------- | ------------------------------------------ |
59+
| `bazi_basic` | 八字命盘排盘(四柱、藏干、十神、五行力量) |
60+
| `bazi_dayun` | 大运列表(十年一运) |
61+
| `bazi_liunian` | 流年列表(指定年份范围) |
62+
| `bazi_liuyue` | 流月列表(节气月,立春起算) |
63+
| `bazi_liuri` | 流日列表(指定月份内每日) |
6264

6365
#### 紫微斗数
6466

65-
| 工具 | 说明 |
66-
|------|------|
67-
| `ziwei_basic` | 紫微命盘排盘(十二宫、主星、辅星、四化) |
68-
| `ziwei_daxian` | 大限列表(十年一限) |
69-
| `ziwei_xiaoxian` | 小限列表(每年一宫) |
70-
| `ziwei_liunian` | 流年列表(指定年份范围) |
71-
| `ziwei_liuyue` | 流月列表(农历月) |
72-
| `ziwei_liuri` | 流日列表(农历日) |
67+
| 工具 | 说明 |
68+
| ---------------- | ---------------------------------------- |
69+
| `ziwei_basic` | 紫微命盘排盘(十二宫、主星、辅星、四化) |
70+
| `ziwei_daxian` | 大限列表(十年一限) |
71+
| `ziwei_xiaoxian` | 小限列表(每年一宫) |
72+
| `ziwei_liunian` | 流年列表(指定年份范围) |
73+
| `ziwei_liuyue` | 流月列表(农历月) |
74+
| `ziwei_liuri` | 流日列表(农历日) |
7375

7476
### 占卜起卦
7577

7678
占卜术基于起卦时间或随机数推演卦象,属于「卜」的范畴。
7779

7880
#### 六爻
7981

80-
| 工具 | 说明 |
81-
|------|------|
82+
| 工具 | 说明 |
83+
| -------------- | --------------------------------------------------- |
8284
| `liuyao_basic` | 六爻排盘(本卦/变卦、纳甲、六亲、六神、世应、旬空) |
8385

8486
六爻输入为六个爻值(自下而上):
@@ -89,8 +91,8 @@ claude mcp add mingpan -- npx -y mingpan
8991

9092
#### 梅花易数
9193

92-
| 工具 | 说明 |
93-
|------|------|
94+
| 工具 | 说明 |
95+
| -------------- | ---------------------------------------- |
9496
| `meihua_basic` | 梅花易数排盘(本卦/变卦/互卦、体用分析) |
9597

9698
支持两种起卦方式:
@@ -99,37 +101,57 @@ claude mcp add mingpan -- npx -y mingpan
99101

100102
#### 大六壬
101103

102-
| 工具 | 说明 |
103-
|------|------|
104+
| 工具 | 说明 |
105+
| ---------------- | ------------------------------------------------ |
104106
| `daliuren_basic` | 大六壬排盘(天地盘、四课、三传、十二天将、神煞) |
105107

106108
大六壬为三式之首,需输入节气、农历月、日干支、时干支。
107109

110+
#### 奇门遁甲
111+
112+
| 工具 | 说明 |
113+
| ------------- | ---------------------------------------------------------- |
114+
| `qimen_basic` | 奇门遁甲排盘(九宫布局、三奇六仪、八门九星八神、格局判断) |
115+
116+
奇门遁甲为三式之一,支持时盘和日盘两种盘式,支持拆补法和茅山法两种置闰算法。
117+
108118
## 输入参数
109119

110120
### 命理工具(八字/紫微)
111121

112-
| 参数 | 类型 | 必填 | 说明 |
113-
|------|------|------|------|
114-
| year | number || 出生年份(1900-2100) |
115-
| month | number || 出生月份(1-12) |
116-
| day | number || 出生日期(1-31) |
117-
| hour | number || 出生时辰(0-23) |
118-
| minute | number | | 出生分钟(0-59),默认 0 |
119-
| gender | string || `male` / `female` |
120-
| longitude | number | | 出生地经度,用于真太阳时校正 |
121-
| isLunar | boolean | | 是否为农历输入,默认 false |
122+
| 参数 | 类型 | 必填 | 说明 |
123+
| --------- | ------- | ---- | ---------------------------- |
124+
| year | number | | 出生年份(1900-2100) |
125+
| month | number | | 出生月份(1-12) |
126+
| day | number | | 出生日期(1-31) |
127+
| hour | number | | 出生时辰(0-23) |
128+
| minute | number | | 出生分钟(0-59),默认 0 |
129+
| gender | string | | `male` / `female` |
130+
| longitude | number | | 出生地经度,用于真太阳时校正 |
131+
| isLunar | boolean | | 是否为农历输入,默认 false |
122132

123133
### 占卜工具(六爻/梅花/大六壬)
124134

125135
占卜工具使用起卦时间而非出生时间,具体参数请参考各工具说明。
126136

137+
### 奇门遁甲工具
138+
139+
| 参数 | 类型 | 必填 | 说明 |
140+
| ------------ | ------- | ---- | ------------------------------------------------------ |
141+
| year | number || 起盘年份(1900-2100) |
142+
| month | number || 起盘月份(1-12) |
143+
| day | number || 起盘日期(1-31) |
144+
| hour | number || 起盘时辰(0-23) |
145+
| isLunar | boolean | | 是否为农历输入,默认 false |
146+
| panType | string | | `时盘` / `日盘`,默认 `时盘` |
147+
| zhiRunMethod | string | | `chaibu`(拆补法)/ `maoshan`(茅山法),默认 `chaibu` |
148+
127149
## 月份基准说明
128150

129-
| 系统 | 月份基准 | 日期基准 |
130-
|------|----------|----------|
131-
| 八字 | 节气月(立春起算) | 公历日 |
132-
| 紫微 | 农历月(初一起算) | 农历日 |
151+
| 系统 | 月份基准 | 日期基准 |
152+
| ---- | ------------------ | -------- |
153+
| 八字 | 节气月(立春起算) | 公历日 |
154+
| 紫微 | 农历月(初一起算) | 农历日 |
133155

134156
## 开发
135157

@@ -143,12 +165,12 @@ npm run dev # 监听变化
143165

144166
## 依赖
145167

146-
|| 用途 |
147-
|------|------|
148-
| `@modelcontextprotocol/sdk` | MCP 协议实现 |
149-
| `lunar-javascript` | 农历/公历转换 |
150-
| `iztro` | 紫微斗数计算引擎 |
151-
| `zod` | 输入参数校验 |
168+
| | 用途 |
169+
| --------------------------- | ---------------- |
170+
| `@modelcontextprotocol/sdk` | MCP 协议实现 |
171+
| `lunar-javascript` | 农历/公历转换 |
172+
| `iztro` | 紫微斗数计算引擎 |
173+
| `zod` | 输入参数校验 |
152174

153175
## 路线图
154176

@@ -157,7 +179,7 @@ npm run dev # 监听变化
157179
- [x] 六爻排盘
158180
- [x] 梅花易数排盘
159181
- [x] 大六壬排盘
160-
- [ ] 奇门遁甲
182+
- [x] 奇门遁甲排盘
161183

162184
## 许可证
163185

0 commit comments

Comments
 (0)