一键导入
calculate-bazi
Calculate Four Pillars (四柱) from birth date/time using lunar calendar conversion. Foundation skill for all BaZi analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Calculate Four Pillars (四柱) from birth date/time using lunar calendar conversion. Foundation skill for all BaZi analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | calculate-bazi |
| description | Calculate Four Pillars (四柱) from birth date/time using lunar calendar conversion. Foundation skill for all BaZi analysis. |
This skill calculates the Four Pillars (四柱 Sì Zhù) - the foundation of all BaZi fortune analysis. It converts birth date/time to the traditional Chinese lunar calendar and determines the Heavenly Stems (天干) and Earthly Branches (地支) for each pillar.
Calculate BaZi for:
- Born: 1990年1月15日 18:30
- Gender: Male
- Location: Beijing, China
Calculate Four Pillars for someone born:
- Date: January 15, 1990
- Time: 6:30 PM
- Gender: Female
- Location: San Francisco, USA
Calculate BaZi for compatibility analysis:
Person A:
- Born: 1988年3月22日 14:00
- Gender: Male
- Location: Shanghai
Person B:
- Born: 1990年7月8日 09:15
- Gender: Female
- Location: Beijing
八字命盘 (BaZi Chart)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
姓名:[Name]
性别:[Gender]
公历:1990年1月15日 18:30
农历:己巳年 腊月十九 酉时
┌─────┬─────┬─────┬─────┐
│ 年柱 │ 月柱 │ 日柱 │ 时柱 │
│Year │Month│ Day │Hour │
├─────┼─────┼─────┼─────┤
│ 己 │ 丁 │ 甲 │ 癸 │
│ 土 │ 火 │ 木 │ 水 │
├─────┼─────┼─────┼─────┤
│ 巳 │ 丑 │ 子 │ 酉 │
│ 火 │ 土 │ 水 │ 金 │
└─────┴─────┴─────┴─────┘
日主:甲木 (Day Master: Wood)
命格:[Pattern classification]
地支藏干 (Hidden Stems):
- 巳 (Fire): 庚金, 丙火, 戊土
- 丑 (Earth): 己土, 癸水, 辛金
- 子 (Water): 癸水
- 酉 (Metal): 辛金
五行统计 (Five Elements Count):
木 (Wood): 1
火 (Fire): 2
土 (Earth): 3
金 (Metal): 2
水 (Water): 3
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
"personalInfo": {
"name": "User Name",
"gender": "male",
"birthDate": {
"gregorian": "1990-01-15T18:30:00+08:00",
"lunar": "己巳年腊月十九酉时",
"year": 1990,
"month": 1,
"day": 15,
"hour": 18,
"minute": 30,
"timezone": "+08:00"
},
"location": "Beijing, China"
},
"fourPillars": {
"year": {
"stem": "己",
"branch": "巳",
"element": {
"stem": "土",
"branch": "火"
},
"hiddenStems": ["庚", "丙", "戊"]
},
"month": {
"stem": "丁",
"branch": "丑",
"element": {
"stem": "火",
"branch": "土"
},
"hiddenStems": ["己", "癸", "辛"]
},
"day": {
"stem": "甲",
"branch": "子",
"element": {
"stem": "木",
"branch": "水"
},
"hiddenStems": ["癸"]
},
"hour": {
"stem": "癸",
"branch": "酉",
"element": {
"stem": "水",
"branch": "金"
},
"hiddenStems": ["辛"]
}
},
"dayMaster": {
"stem": "甲",
"element": "木",
"yinYang": "阳"
},
"elementsBalance": {
"wood": 1,
"fire": 2,
"earth": 3,
"metal": 2,
"water": 3
},
"luckCycle": {
"direction": "forward",
"startAge": 3,
"cycles": [...]
}
}
Timezone Adjustment
Lunar Calendar Conversion
Pillar Derivation
Hidden Stems Extraction
Luck Cycle Calculation
Midnight Births (23:00-01:00)
Near Solar Term Births
Historical Timezone Changes
Leap Months (闰月)
./output/charts/[name]-[date].json.md formatIssue: Birth time unknown Solution: Calculate for 12:00 noon (default) and note uncertainty. Offer range analysis.
Issue: Born in different country, different timezone Solution: Use historical timezone database (e.g., IANA TZ). Explicitly state assumptions.
Issue: Conflicting lunar calendar sources Solution: Use authoritative source (中国科学院紫金山天文台). Document methodology.
Issue: Leap month confusion Solution: Always verify with solar term. Leap months don't affect month pillar.
This skill uses the shared BaZi Core Library located at .claude/lib/bazi_core.py.
Python API:
from lib.bazi_core import BaZiCalculator
calculator = BaZiCalculator()
result = calculator.calculate_bazi(
birth_date="1990-05-15", # Format: YYYY-MM-DD
birth_time="10:00", # Format: HH:MM
location="北京" # Optional, default: 北京
)
# Access results
print(result['four_pillars'])
print(result['day_master'])
print(result['elements_balance'])
Command Line:
# Basic usage
python /bunny-agent/.claude/lib/bazi_core.py 1990-05-15 10:00 北京
# With JSON output
python /bunny-agent/.claude/lib/bazi_core.py 1990-05-15 10:00 北京 --json
After calculation, generates:
./output/charts/[name]-bazi-[YYYYMMDD].json - Complete data./output/charts/[name]-bazi-[YYYYMMDD].md - Readable format./output/charts/[name]-bazi-[YYYYMMDD].txt - Plain text for printingAfter calculating BaZi:
Principle: 差之毫厘,谬以千里 - A tiny error in calculation leads to vastly different conclusions. Accuracy is paramount.
Create and manage artifact.json for task outputs. Use when creating code files, documentation, or any files that should be tracked as artifacts.
Create and manage artifact.json for task outputs. Use at the START of every task to define planned deliverables before beginning research.
Provide career guidance and recommendations based on BaZi elemental strengths, Day Master traits, and current luck cycles.
Calculate and interpret 10-year luck cycles (大运) and annual fortune (流年) for timing insights and life trend predictions.
Analyze BaZi compatibility for romantic relationships (合婚). Examines elemental harmony, Day Master interaction, and long-term compatibility potential.
Extracts and analyzes website content to understand brand messaging, visual style, value propositions, and content themes for video script planning.