Bazi Skill for Claude Code

repository·main·Indexed 24 days ago

https://github.com/jinchenma94/bazi-skill

A Bazi (Four Pillars of Destiny) analysis tool for Claude Code that automates birth data collection, astrological chart calculation, and professional analysis. It incorporates principles from nine classical Chinese astrological texts, including Qiong Tong Bao Dian, San Ming Tong Hui, Di Tian Sui, Yuan Hai Zi Ping, Qian Li Ming Gao, Zi Ping Zhen Quan, and Guo Lao Xing Zong. Features include Day Master strength determination, Ten Gods relationship mapping, Great Cycles (Da Yun) and Annual Pillar calculations, and pattern determination.

Tokens
6.3K
Snippets
8
Records
29
Agent score
83%

What's inside bazi-skill

  1. Bazi Skill Features and Analysis Capabilities

    main

    The Bazi Skill provides a complete workflow for traditional Chinese astrology analysis:

    1. Information Collection: Step-by-step gathering of name, solar/lunar birthday, birth hour, gender, and birthplace.
    2. Chart Calculation (排盘计算): Automatically calculates the Four Pillars (Year, Month, Day, Hour pillars), Great Cycles (大运), and Annual Pillars (流年).
    3. Comprehensive Analysis (综合分析): Provides insights into:
      • Day Master strength (日主强弱)
      • Ten Gods relationships (十神关系)
      • Five Elements balance (五行平衡)
      • Pattern determination (格局判定)
      • Great Cycles and Annual Pillar interpretations
      • Advice on career, relationships, and health.
  2. Use the Bazi (Four Pillars of Destiny) Skill

    main

    The bazi skill is a professional Chinese traditional astrology tool used for birth chart analysis (Four Pillars of Destiny). It collects user information through an interactive process and performs professional calculations and analysis based on classical texts like Qiong Tong Bao Dian, San Ming Tong Hui, and Di Tian Sui.

    When to use this skill: Use this skill whenever a user asks for:

    • 八字 (Bazi)
    • 四柱 (Four Pillars)
    • 命理 (Fate/Destiny)
    • 算命 (Fortune telling)
    • Birth chart analysis
    • 运势 (Fortune/Luck), 大运 (Great Cycles), or 流年 (Annual Cycles).

    Triggers: Common triggers include: 算八字, 看八字, 批八字, 排八字, 四柱, 命盘, 算命, 帮我看看八字, 我想算八字, 分析八字, 排盘, bazi, bazi analysis, fortune telling, birth chart, 算一卦, 看运势, 命运分析.

  3. Identify Ten Gods and Six Relatives from Yuan Hai Zi Ping

    main

    The Yuan Hai Zi Ping system establishes the foundation for the 十神 (Ten Gods) and their relationship to 六亲 (Six Relatives).

    Ten Gods and Relatives Mapping

    • 正印 (Direct Resource): Mother
    • 偏财 (Indirect Wealth): Father (for male charts)
    • 正财 (Direct Wealth): Wife (for male charts)
    • 正官 (Direct Officer): Husband (for female charts)
    • 食神/伤官 (Eating God/Hurting Officer): Children (for female charts)
    • 比肩 (Friend/Parallel): Brothers (for male charts)
    • 劫财 (Rob Wealth): Sisters (for male charts)

    Use of Yong Shen (用神)

    To find the most helpful element for the Day Master, use these principles:

    1. 扶抑 (Support/Restrain): Support if weak; restrain if strong.
    2. 调候 (Tiao Hou): Adjust for temperature/moisture.
    3. 通关 (Bridge): Use a mediator to resolve clashes between two elements.
    4. 顺势 (Follow Trend): For special patterns like Cong Ge (从格), follow the dominant trend.
  4. Determine strength and flow using Di Tian Sui principles

    main

    The Di Tian Sui system provides principles for determining the strength of the Day Master and the flow of Qi.

    Strength Determination (旺衰判断)

    Strength is determined by three factors, in order of importance:

    1. 得令 (De Ling - Obtaining Command): The Day Master is in a state of Chang Sheng (长生) or Di Wang (帝旺) in the Month Branch. This is the most important factor.
    2. 得地 (De Di - Obtaining Ground): The Day Master has roots in other branches (e.g., Chang Sheng, Di Wang, or Mu Ku 墓库).
    3. 得势 (De Shi - Obtaining Momentum): The Heaven Stems have Bi Jie (比劫) to help or Yin (印) to produce the Day Master.

    Qi Flow (气势流通)

    • Flow: A chart prefers smooth production (e.g., Metal $\rightarrow$ Water $\rightarrow$ Wood $\rightarrow$ Fire).
    • Obstruction: If two elements clash (e.g., Metal vs. Wood), use a mediator (e.g., Water) to bridge them.
    • Extreme States:
      • If extremely strong (旺极), it is better to drain (泄) than to control (克).
      • If extremely weak (衰极), it is better to support (扶) than to assist (帮) (referring to Cong Ruo Ge 从弱格).
  5. Understand Da Yun cycles and early life fortune

    main

    Da Yun Cycles

    Each Da Yun step lasts for 10 years.

    Fortune before starting Da Yun (小运)

    Before a person reaches their calculated starting age for Da Yun, their fortune is analyzed using the Month Pillar (月柱) stem and branch as the representative cycle.

    Relationship with Liu Nian (Annual Fortune)

    • Liu Nian (流年): The stem and branch of the current year.
    • Interaction: Liu Nian interacts with the original Four Pillars (冲, 合, 刑, 害) and the Da Yun.
    • Mental Model: Da Yun represents the general environment, while Liu Nian acts as the trigger (引动).
      • Good Da Yun + Bad Liu Nian: Generally stable, but the specific year has turbulence.
      • Bad Da Yun + Good Liu Nian: Generally unfavorable, but the specific year presents opportunities.
  6. Understand the concept of 調候 (Tiao Hou) from Qiong Tong Bao Dian

    main

    In the Qiong Tong Bao Dian system, 調候用神 (Tiao Hou Yong Shen) is the most critical element. It refers to the specific Five Elements needed to balance the temperature and moisture of a chart based on the Day Master and the birth month (season).

    Core Rules:

    • Prioritize 調候 (Tiao Hou) before analyzing pattern (格局) or strength (旺衰).
    • A chart lacking the necessary Tiao Hou elements will struggle even if the pattern is excellent.
    • Summer births (Fire旺): Require Water (水) for cooling.
    • Winter births (Water旺): Require Fire (火) for warming.

    Examples:

    • Jia Wood in Yin Month (Early Spring): Needs Bing Fire (丙火) to warm and Gui Water (癸水) to nourish. If both are present, it indicates great wealth and status.
    • Geng Metal in Zi Month (Deep Winter): Needs Bing Fire (丙火) to thaw the cold and Jia Wood (甲木) to lead the Ding Fire (丁火).
  7. Analyze patterns and Shen Sha from San Ming Tong Hui

    main

    The San Ming Tong Hui system focuses on 格局 (Patterns) and 神煞 (Shen Sha/Spiritual Stars).

    Core Patterns (格局)

    • 正官格 (Direct Officer): Month branch contains Direct Officer protruding to Heaven. Represents upright character; avoid Shang Guan (伤官) breaking the pattern.
    • 七杀格 (Seven Killings): Month branch contains Seven Killings protruding. Represents decisiveness; requires Shi Shen (食神) to control or Yin (印) to transform.
    • 正财/偏财格 (Wealth Patterns): Month branch contains Wealth. Represents diligence; avoid Bi Jie (比劫) competing for wealth.
    • 正印/偏印格 (Resource Patterns): Month branch contains Resource. Represents intelligence; Pian Yin (偏印) should avoid Shi Shen (食神) (known as Xiao Shen Duo Shi 枭神夺食).
    • 食神格 (Eating God): Month branch contains Eating God. Represents abundance; avoid Xiao Yin (枭印) stealing the food.
    • 伤官格 (Hurting Officer): Month branch contains Hurting Officer. Represents talent; avoid Shang Guan Jian Guan (伤官见官) unless exceptions apply.

    Common Shen Sha (神煞)

    • 天乙贵人 (Tian Yi Nobleman): Brings good fortune and mitigates disasters. Formula: 甲戊庚牛羊,乙己鼠猴乡,丙丁猪鸡位,壬癸兔蛇藏,庚辛逢虎马.
    • 文昌贵人 (Wen Chang Nobleman): Intelligence and literary talent.
    • 驿马 (Yi Ma/驿马): Movement and travel. Found via: 申子辰马在寅,寅午戌马在申,巳酉丑马在亥,亥卯未马在巳.
    • 桃花 (Peach Blossom/Xian Chi): Romance and talent. Found via: 申子辰在酉,寅午戌在卯,巳酉丑在午,亥卯未在子.
    • 华盖 (Hua Gai): Solitude, religion, and academia. Found via: 申子辰在辰,寅午戌在戌,巳酉丑在丑,亥卯未在未.
  8. Derive Ten Gods (十神) based on Day Master

    main

    The Ten Gods are determined by the relationship between the Day Master (日干) and other Heavenly Stems, based on Five Element generation/restriction and Yin/Yang parity.

    RelationshipYin/Yang SameYin/Yang Different
    Producing Me (Mother)偏印 (枭神)正印
    Me Producing (Child)食神伤官
    Restricting Me (Officer)偏官 (七杀)正官
    I Restrict (Wealth)偏财正财
    Same as Me (Peer)比肩劫财
    | 十神 | 含义 | 代表人事 |
    |------|------|----------|
    | 比肩 | 同我者,阴阳相同 | 兄弟、朋友、同辈、竞争者 |
    | 劫财 | 同我者,阴阳不同 | 姐妹、竞争对手、损财者 |
    | 食神 | 我生者,阴阳相同 | 子女(女命)、才华、口福 |
    | 伤官 | 我生者,阴阳不同 | 子女(女命)、才艺、叛逆 |
    | 偏财 | 我克者,阴阳相同 | 偏财、父(男命)、情人 |
    | 正财 | 我克者,阴阳不同 | 正财、妻(男命)、稳定收入 |
    | 偏官(七杀) | 克我者,阴阳相同 | 偏权、压力、小人之类 |
    | 正官 | 克我者,阴阳不同 | 正权、上级、夫(女命) |
    | 偏印(枭神) | 生我者,阴阳相同 | 偏学术、继母、孤独 |
    | 正印 | 生我者,阴阳不同 | 母亲、学业、贵人 |
  9. Evaluate pattern purity and auxiliary gods in Zi Ping Zhen Quan

    main

    The Zi Ping Zhen Quan system focuses on the perfection of patterns and the relationship between different gods.

    Pattern Quality

    • 清 (Pure): A pattern is considered pure if it uses a single, clear Yong Shen.
    • 浊 (Turbid/Mixed): A pattern is turbid if it has multiple conflicting Yong Shen or if the Yong Shen is clashed/destroyed.

    Key Terminology

    • 用神 (Yong Shen): The most critical Ten God used to maintain pattern balance.
    • 相神 (Xiang Shen): The auxiliary god that supports the Yong Shen (e.g., in a Direct Officer pattern, the Resource star acts as the Xiang Shen to create Officer-Resource production).
    • 喜神 (Xi Shen): Elements that support the Yong Shen.
    • 忌神 (Ji Shen): Elements that clash with or destroy the Yong Shen.

    Success vs. Failure

    • 成格 (Success): Yong Shen is strong, Xiang Shen assists, and Ji Shen is controlled.
    • 败格 (Failure): Yong Shen is attacked, no Xiang Shen is present, or Ji Shen is dominant.
  10. Determine the direction of Da Yun (Great Fortune) based on Year and Gender

    main

    The direction of the Da Yun (whether it follows a forward or backward sequence) is determined by the combination of the Year Stem's polarity (Yang/Yin) and the person's gender.

    Year Stem Polarity:

    • Yang Year: Year Stem is 甲 (Jia), 丙 (Bing), 戊 (Wu), 庚 (Geng), or 壬 (Ren).
    • Yin Year: Year Stem is 乙 (Yi), 丁 (Ding), 己 (Ji), 辛 (Xin), or 癸 (Gui).

    Direction Rules:

    Year PolarityGenderDirection
    Yang YearMaleForward (顺排)
    Yang YearFemaleBackward (逆排)
    Yin YearMaleBackward (逆排)
    Yin YearFemaleForward (顺排)

    Mnemonic: Yang Male and Yin Female follow Forward direction; Yin Male and Yang Female follow Backward direction.

  11. Understand Heavenly Stem Combinations (天干五合)

    main

    Heavenly Stems can combine to transform into a new element.

    Combinations:

    • 甲 + 己 $\rightarrow$ 土 (Earth)
    • 乙 + 庚 $\rightarrow$ 金 (Metal)
    • 丙 + 辛 $\rightarrow$ 水 (Water)
    • 丁 + 壬 $\rightarrow$ 木 (Wood)
    • 戊 + 癸 $\rightarrow$ 火 (Fire)

    Conditions for Transformation: The stems must be adjacent, the timing/season must be appropriate, and the Earthly Branches must have a root supporting the transformed element. If these conditions are not met, it is considered a "Binding" (合绊), where the stems simply restrict each other's power.

    甲己合化土
    乙庚合化金
    丙辛合化水
    丁壬合化木
    戊癸合化火
  12. Bazi Calculation and Analysis Framework

    main

    Once information is confirmed, the skill executes a three-phase process: Calculation, Charting, and Analysis.

    Phase 1: Calculation Rules

    • Year Pillar (年柱): Determined by the solar term Li Chun (立春), not the Lunar New Year.
    • Month Pillar (月柱): Determined by the 12 solar terms (e.g., Qing Ming for Chen month). Uses the Nian Shang Qi Yue formula for stem-branch calculation.
    • Day Pillar (日柱): Determined via almanac lookup. Note: Ye Zi Shi (23:00-24:00) belongs to the next day.
    • Hour Pillar (时柱): Determined by birth time and the Wu Shu Dun Yuan method.
    • Great Cycles (大运): Direction depends on gender and year stem (e.g., Yang Year Male/Yin Year Female = Forward; Yin Year Male/Yang Year Female = Backward).

    Phase 2: Analysis Framework

    Analysis is conducted using the following structure:

    1. Day Master (日主): Strength (旺/弱), Five Elements characteristics, and personality.
    2. Ten Gods (十神): Analysis of relationships and impact on the Day Master.
    3. Five Elements Balance (五行平衡): Identifying useful gods (喜用神) and taboo gods (忌神).
    4. Pattern (格局): Determining the structure (e.g., Zheng Guan Ge) and its quality.
    5. Great Cycles & Annual Cycles (大运/流年): Predicting trends and current luck.
    6. Historical Calibration (历史事件校准): Proposing 3-5 past events for the user to verify, which helps refine the model.
    7. Comprehensive Advice: Career, wealth, marriage, and health suggestions.