Mon. Apr 13th, 2026

I Open-Sourced a Chinese Astrology Engine and Wired It Into Every AI Coding Tool

The topic of I Open-Sourced a Chinese Astrology Engine and Wired It Into Every AI Coding Tool is currently the subject of lively debate — readers and analysts are keeping a close eye on developments.

This is taking place in a dynamic environment: companies’ decisions and competitors’ reactions can quickly change the picture.

TL;DR: I built shunshi-bazi-core — a TypeScript library that calculates Chinese Four Pillars of Destiny (八字 / 四柱推命 / 사주팔자) charts with true solar time correction. Then I wrapped it as an MCP server for Claude Desktop / Cursor / Cline, and a Claude Code skill for the CLI. Everything is MIT-licensed.

Bazi (八字, literally “eight characters”) is a system from Chinese metaphysics that maps a person’s birth date and time into a chart of heavenly stems and earthly branches. Think of it as the Chinese equivalent of a natal chart in Western astrology — except it operates on a completely different calendar system (the sexagenary cycle) and has its own analytical framework involving Ten Gods (十神), Five Elements (五行), and Dayun (大运, ten-year fate periods).

It’s known as 四柱推命 (Shichū Suimei) in Japan and 사주팔자 (Saju Palja) in Korea. Hundreds of millions of people across East Asia consult Bazi readings — it’s one of the most widely practiced forms of divination in the world.

When I started building Shunshi.AI (an AI-powered Bazi reading platform), I surveyed every open-source Bazi library I could find in JavaScript, Python, and TypeScript. They all had at least one of these issues:

This is the big one. Bazi charts are based on solar time, not clock time. If you’re born in Urumqi (western China, UTC+8) at 14:00 clock time, your actual solar time is closer to 12:00 — a two-hour difference that shifts the entire hour pillar and changes the reading completely.

Most libraries just take the clock time as-is. This gives wrong charts for anyone born far from their timezone’s standard meridian: western China, Hokkaido, the U.S. West Coast, Western Europe…

What happens when someone is born at 23:30? Is that “today” or “tomorrow” in Bazi terms?

Different schools disagree (早子時 vs 晚子時). Most libraries don’t even let you choose — they silently pick one convention, and you discover the discrepancy only when your chart disagrees with a professional practitioner’s.

You compute a chart, compare it against a paid service, get different answers. Who’s right? Without golden test cases against authoritative reference tools, there’s no way to know.

I extracted the calculation engine from Shunshi.AI’s production backend and published it as a standalone TypeScript library:

The library is parity-tested against both Shunshi.AI’s Python backend and cantian-tymext’s relation calculations on 5 golden cases covering edge cases like 23:48 births and spring festival boundaries.

A calculation engine is useful, but the real magic happens when AI agents can call it. I built three integration layers:

“Calculate the Bazi chart for someone born on March 24, 1990 at 10:28 AM in Guangzhou, male.”

Claude calls the MCP tool, gets the full chart JSON, and gives you a professional-grade reading — complete with Ten Gods analysis, Five Element balance, and Dayun forecast.

It passed ClawHub’s security scan with Benign (HIGH CONFIDENCE) from both VirusTotal and OpenClaw — no runtime npm install, no undeclared dependencies, no credential requests.

If you’re building your own Bazi app, just use the core library directly. It’s pure TypeScript with zero framework dependencies — works in Node.js and browsers.

All four layers share the exact same calculation engine. A fix in shunshi-bazi-core propagates to every integration point.

The two projects are complementary, not competing. We chose different defaults based on what matches different schools of professional Bazi practice.

I wasted weeks debugging charts that were “almost right” before realizing the hour pillar was wrong because I was using clock time. The Equation of Time correction (accounting for Earth’s orbital eccentricity and axial tilt) can shift times by up to 30 minutes. For Bazi, where each “hour” is a 2-hour window, this regularly changes the chart.

ClawHub’s OpenClaw scanner flagged my first skill as “Suspicious” because it ran npm install at runtime. Fair enough — a skill that downloads arbitrary packages at execution time is a legitimate security concern. I restructured to declare dependencies in package.json with a proper install step, and it passed with HIGH CONFIDENCE.

When I started, there were maybe 2-3 Bazi-related MCPs. Now there are several, each with different strengths. The Model Context Protocol is becoming the standard way to give AI agents domain-specific capabilities, and the tooling (ClawHub for skills, MCP registries) is maturing quickly.

Bazi is searched for as 八字 (Chinese), 四柱推命 (Japanese), 사주팔자 (Korean), and “Four Pillars” (English). By including all four in my package description and README, I get discovered by developers across all four language communities.

I’m building Shunshi.AI — an AI-powered Bazi reading platform supporting English, Chinese, Japanese, and Korean. If you’re interested in Chinese metaphysics, AI tool integration, or multilingual TypeScript libraries, follow me here or on X.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment’s permalink.

For further actions, you may consider blocking this person and/or reporting abuse

DEV Community — A space to discuss and keep up software development and manage your software career

Built on Forem — the open source software that powers DEV and other inclusive communities.

Why it matters

News like this often changes audience expectations and competitors’ plans.

When one player makes a move, others usually react — it is worth reading the event in context.

What to look out for next

The full picture will become clear in time, but the headline already shows the dynamics of the industry.

Further statements and user reactions will add to the story.

Related Post