# Bazi Compatibility

> Compare two people from reusable BaZi chart JSON files, two complete birth records, or one of each; write auditable interaction data and transparent general or relationship-specific scores before automatic interpretation. Use for 八字合婚, 合八字, two-person compatibility, 配不配, or whether two charts work together. Not for one-person natal work, reading an existing comparison, forecasting, or missing birth minutes.

- Skill: `misoto22/bazi-compatibility` (Agent Skill, multi-file: 33 files)
- Install (CLI): `npx skillmds@latest add misoto22/bazi-compatibility`
- Raw SKILL.md: https://api.skillmd.com/api/skills/misoto22/bazi-compatibility/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: Misoto22 (https://skillmd.com/u/misoto22)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/misoto22/bazi-compatibility

---


# BaZi Compatibility

Compare two validated sources, write `bazi_compatibility_<name-a>_<name-b>.json` plus data-only Markdown, then invoke `bazi-compatibility-reading` automatically.

## Route first

- One raw birth record belongs to `bazi-chart`.
- One existing chart needing meaning belongs to `bazi-reading`.
- An existing compatibility artifact needing meaning belongs to `bazi-compatibility-reading`.
- Luck cycles, dated predictions, and event timing are outside this release.

## Accepted source combinations

Accept chart + chart, raw birth + raw birth, or chart + raw birth. Prefer reusable chart JSON when available; never recalculate a valid existing chart.

A chart source must be schema `chinese-metaphysics.bazi-chart`, version 1, with a valid checksum and complete primary facts and score ledgers. If it declares a boundary alternate, that alternate must also be complete.

A raw source has the same exact requirements as `bazi-chart`: name, unambiguous place, exact date and minute, declared Gregorian or lunar calendar, IANA zone, latitude, longitude, and an explicit leap-month flag for lunar input. Resolve ambiguous places before running. Never infer a minute, place, leap month, gender, DST fold, or historical offset.

Birth data and chart artifacts are sensitive. Keep them in the user-selected output directory and do not transmit them elsewhere.

## Relationship context

Default to a relationship-neutral general comparison. Set a context only when the user states one clearly:

- `romance`: dating or romantic connection;
- `marriage`: spouses, marriage, or explicit 合婚;
- `friendship`: friends;
- `family`: relatives or household family dynamics;
- `work`: colleagues, founders, manager/report, or business collaboration.

Do not infer romance from two names, genders, or a vague “do we match?” request. An explicit context adds a separate contextual index; it never replaces or changes the general score.

## Numeric model contract

`bazi-compatibility-v1` always calculates five general dimensions with exact weights:

| Dimension | Weight |
|---|---:|
| Element complementarity | 25% |
| Directional day-master support | 20% |
| Cross-chart stem/branch interactions | 20% |
| Day-pillar core | 20% |
| Structural stability | 15% |

Every dimension carries positive and negative ledger entries. Preserve ownership for directional support: “A supplies B” is not interchangeable with “B supplies A.” Swapping left and right must preserve all numeric scores while reversing directional owners.

If either chart has a day-boundary alternate, compare all primary/alternate combinations and report the range. The displayed general score remains primary-primary. Do not average alternates or choose the most favorable pairing. Shen Sha is excluded from numeric scores and remains secondary evidence.

All percentages and 0-100 indexes are versioned heuristic outputs, not probabilities or guarantees of relationship success.

## Run the calculator

From this skill directory, create the request shape shown in `references/request.example.json` and run:

```bash
python3 scripts/compute_compatibility.py --request REQUEST.json --out OUTPUT_DIRECTORY
```

Inline JSON is accepted with `--json`. A stated context may be in `relationship_type` or supplied with `--relationship-type`. Raw inputs require `pyswisseph`, declared in `requirements.txt`; chart + chart does not recalculate astronomy. An optional Swiss data directory may be supplied with `--ephemeris-path`.

The command prints canonical JSON and data-only Markdown absolute paths, in that order. Exit code 2 means no valid artifact pair was created. Do not manually complete a partial comparison.

## Validate and hand off

Read the output JSON back through the gate the reading skill runs:

```bash
python3 scripts/validate_artifact.py COMPARISON.json
```

It checks the schema and version, the canonical checksum, both source identities and their distinct chart checksums, all five dimensions with their ledgers and weights, the general arithmetic those weights produce, a contextual score against its own profile, confidence, and the sensitivity range the displayed score has to sit inside. Exit 2 means the run produced something unreadable: report every defect it names, and do not complete a partial comparison by hand.

Then confirm the Markdown names the same checksum and contains data only.

After validation, automatically invoke `bazi-compatibility-reading` with the exact JSON path. Do not wait for another user message and do not invoke it after any failure. After the reading completes, report both compatibility artifact paths, the reader-report path, and the separate evidence-artifact path.

This skill calculates evidence only. It must not issue a “soulmate,” “destined,” safe/unsafe, marry/divorce, hire/fire, medical, financial, legal, or deterministic verdict.

