gan-zhi-calculator

Conversion rules for calculating the year pillar, day pillar, month pillar, and hour pillar in Bazi (Eight Characters). Explicitly states that mental calculation is strictly prohibited and verification against a perpetual calendar is required.

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 "gan-zhi-calculator" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-1bcea70a04dbe14fc8e23495329af7a0d2ae9c8fed4ebcfd73cbfb4c6e87ac10. Verify the upstream source and version against https://skillhub.cn/skills/user_bb5d057c/gan-zhi-calculator 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

Conversion rules for calculating the year pillar, day pillar, month pillar, and hour pillar in Bazi (Eight Characters). Explicitly states that mental calculation is strictly prohibited and verification against a perpetual calendar is required.

0 Downloads

Introduction source: third_party · user_bb5d057c · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: gan-zhi-calculator
description: 八字推算时的年柱/日柱/月柱/时柱换算规则。严格禁止心算,必须查万年历验证。
category: 术数命理

干支换算规则

⚠️ 铁律

  1. 严禁心算任何干支——年柱查表、日柱查万年历/脚本、月柱看节气、时柱用五鼠遁公式
  2. 每次占卜前必须先获取实时时间:date "+%Y-%m-%d %H:%M:%S %A"
  3. 禁止使用任何假设时间、缓存时间、幻想时间

一、年柱:60年一轮回(必须查表)

基准年 干支 对应
1984 甲子 1944, 2004, 2064
1985 乙丑 1945, 2005, 2065
1986 丙寅 1946, 2006, 2066
1987 丁卯 1947, 2007, 2067
1988 戊辰 1948, 2008, 2068
1989 己巳 1949, 2009, 2069
1990 庚午 1950, 2010, 2070
1991 辛未 1951, 2011, 2071
1992 壬申 1952, 2012, 2072
1993 癸酉 1953, 2013, 2073
1994 甲戌 1954, 2014, 2074
1995 乙亥 1955, 2015, 2075
1996 丙子 1956, 2016, 2076
1997 丁丑 1957, 2017, 2077
1998 戊寅 1958, 2018, 2078
1999 己卯 1959, 2019, 2079
2000 庚辰 1960, 2020, 2080
2001 辛巳 1961, 2021, 2081
2002 壬午 1962, 2022, 2082
2003 癸未 1963, 2023, 2083
2004 甲申 1964, 2024, 2084
2005 乙酉 1965, 2025, 2085
2006 丙戌 1966, 2026, 2086
2007 丁亥 1967, 2027, 2087
2008 戊子 1968, 2028, 2088
2009 己丑 1969, 2029, 2089
2010 庚寅 1970, 2030, 2090
2011 辛卯 1971, 2031, 2091
2012 壬辰 1972, 2032, 2092
2013 癸巳 1973, 2033, 2093
2014 甲午 1954, 2014, 2074
2015 乙未 1955, 2015, 2075
2016 丙申 1956, 2016, 2076
2017 丁酉 1957, 2017, 2077
2018 戊戌 1958, 2018, 2078
2019 己亥 1959, 2019, 2079
2020 庚子 1960, 2020, 2080
2021 辛丑 1961, 2021, 2081
2022 壬寅 1962, 2022, 2082
2023 癸卯 1963, 2023, 2083
2024 甲辰 1964, 2024, 2084
2025 乙巳 1965, 2025, 2085
2026 丙午 1966, 2026, 2086
2027 丁未 1967, 2027, 2087
2028 戊申 1968, 2028, 2088
2029 己酉 1969, 2029, 2089
2030 庚戌 1970, 2030, 2090
2031 辛亥 1971, 2031, 2091
2032 壬子 1972, 2032, 2092
2033 癸丑 1973, 2033, 2093
2034 甲寅 1974, 2034, 2094
2035 乙卯 1975, 2035, 2095
2036 丙辰 1976, 2036, 2096
2037 丁巳 1977, 2037, 2097
2038 戊午 1978, 2038, 2098
2039 己未 1979, 2039, 2099
2040 庚申 1980, 2040, 2100
2041 辛酉 1981, 2041, 2101
2042 壬戌 1982, 2042, 2102
2043 癸亥 1983, 2043, 2103
2044 甲子 1984, 2044, 2104

快速记忆法:1984=甲子,每60年循环。


二、月柱:以节气分界(非农历月初!)

节气 月支 约公历日期
立春 寅月 2月4日左右
惊蛰 卯月 3月5日左右
清明 辰月 4月5日左右
立夏 巳月 5月5日左右
芒种 午月 6月6日左右
小暑 未月 7月7日左右
立秋 申月 8月8日左右
白露 酉月 9月7日左右
寒露 戌月 10月8日左右
立冬 亥月 11月7日左右
大雪 子月 12月7日左右
小寒 丑月 1月5日左右

月干用五虎遁(年干决定正月天干):

  • 甲己之年丙作首 → 正月丙寅
  • 乙庚之年戊为头 → 正月戊寅
  • 丙辛之年寻庚起 → 正月庚寅
  • 丁壬壬位顺流行 → 正月壬寅
  • 戊癸何方发,甲寅之上好追求 → 正月甲寅

示例:2026丙午年(丙年→丙辛之年寻庚起→正月庚寅→五月午月=甲午)

  • 月柱 = 甲午月(芒种6/6后进入)

三、日柱:基准日推算

基准:2024年1月1日 = 甲子日

days_diff = (target_date - date(2024, 1, 1)).days
gan_index = (1 + days_diff) % 10  # 甲=1
zhi_index = (1 + days_diff) % 12  # 子=1
if gan_index == 0: gan_index = 10
if zhi_index == 0: zhi_index = 12

验证脚本:python3 /root/.hermes/scripts/ganzhi_calculator.py


四、时柱:五鼠遁(天干地支一起递推!)

核心:不是"子时天干+当前地支",而是天干地支一起走!

日干 子时 丑时 寅时 卯时 辰时 巳时 午时 未时 申时 酉时 戌时 亥时
甲/己 甲子 甲寅 丙寅 丁卯 戊辰 己巳 庚午 辛未 壬申 癸酉 甲戌 乙亥
乙/庚 丙子 丁丑 戊寅 己卯 庚辰 辛巳 壬午 癸未 甲申 乙酉 丙戌 丁亥
丙/辛 戊子 己丑 庚寅 辛卯 壬辰 癸巳 甲午 乙未 丙申 丁酉 戊戌 己亥
丁/壬 庚子 辛丑 壬寅 癸卯 甲辰 乙巳 丙午 丁未 戊申 己酉 庚戌 辛亥
戊/癸 壬子 癸丑 甲寅 乙卯 丙辰 丁巳 戊午 己未 庚申 辛酉 壬戌 癸亥

公式:

wushudun = {'甲':1,'己':1, '乙':3,'庚':3, '丙':5,'辛':5, '丁':7,'壬':7, '戊':9,'癸':9}
# 时支索引:子=0, 丑=1, 寅=2, 卯=3, ...
hour_gan_idx = (wushudun[日干] + 时支索引 - 1) % 10 + 1
时柱 = 天干[hour_gan_idx] + 地支[时支索引+1]

验证示例:

  • 甲子日+丑时(索引1) → (1+1-1)%10+1=2→乙 → 乙丑 ✅
  • 甲子日+卯时(索引3) → (1+3-1)%10+1=4→丁 → 丁卯 ✅

⚠️ 常见错误:

  • ❌ 时柱计算错误:用"子时天干+当前地支"导致出现根本不存在的"甲丑"、"乙寅"等时柱。正确逻辑是:天干地支一起递推。甲子日+丑时=甲寅(不是甲丑)!甲子日+寅时=甲卯。
  • ❌ 年柱心算(必须查表)
  • ❌ 月柱用公历月(必须用节气)
  • ❌ 疏文署名用品牌名"道今康"而非真名"刘玉林"。疏文署名必须用弟子真名刘玉林!

五、推算工作流程

  1. 执行 date 获取实时时间
  2. 查年柱表得年柱
  3. 查节气得月支,用五虎遁得月干
  4. 用脚本或万年历验证日柱
  5. 用五鼠遁得时柱

⚠️ 即使脚本验证通过,仍需查万年历二次确认!

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value65/100

Highlights

  • 提供八字推算的完整干支换算规则,满足命理爱好者的专业需求
  • 强调查表验证和节气分界,提升推算准确性
Trigger Precision85/100

Highlights

  • 触发描述清晰明确,涵盖年/月/日/时柱四大核心模块
  • 边界清晰,不易与其他工具混淆
Structure and Standards90/100

Highlights

  • 结构层次分明,分步骤详解各柱推算方法
  • 包含铁律、示例、公式和常见错误,文档完整度高
Execution Reliability88/100

Areas to improve

  • 脚本路径为绝对路径 Reported severity: Minor

    验证脚本使用绝对路径 `/root/.hermes/scripts/ganzhi_calculator.py`,可能因部署环境不同而失效

    Recommendation: 建议改为相对路径或提供环境变量配置选项

Highlights

  • 强调必须查万年历二次验证,降低误算风险
  • 覆盖索引边界处理(如 %10 后为0时重置为10)
Evidence Verifiability (mean of the first four)82/100

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.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.