# Sankhya -- Claude Code Instructions
## Project Identity
**Sankhya** (Sanskrit: enumeration/analysis) -- Ancient mathematical systems for AGNOS
- **Type**: Flat library crate
- **License**: GPL-3.0
- **MSRV**: 1.89
- **Version**: SemVer 2.0.0
## Consumers
AGNOS ecosystem crates that need historical/ancient mathematical computations, calendar systems, or number system conversions. Primary consumer: hisab (as an optional companion).
## Modules
| `error` | SankhyaError enum (thiserror, serde, non_exhaustive) |
| `mayan` | Vigesimal numbers, Long Count, Tzolkin, Haab, Calendar Round, Venus tables |
| `babylonian` | Sexagesimal numbers, Saros cycle, reciprocals, Plimpton 322, Heron's sqrt |
| `egyptian` | Unit fractions, doubling multiplication, division, stellar decans, Sothic cycle |
| `vedic` | Nikhilam multiplication, Sulba Sutra, Katapayadi, Meru Prastara |
| `chinese` | Rod numerals, Chinese Remainder Theorem, magic squares, Sexagenary cycle |
| `greek` | Golden ratio, sieve, GCD/LCM, Archimedes' pi, Antikythera, isopsephy |
| `roman` | Roman numeral conversion, validation, arithmetic (I–MMMCMXCIX) |
| `islamic` | Al-Khwarizmi algebra, Khayyam cubics, completion of the square, Hijri calendar |
| `gregorian` | Proleptic Gregorian calendar, JDN conversion, leap years |
| `coptic` | 13-month Alexandrian calendar, Anno Martyrum |
| `persian` | Solar Hijri (Jalaali), 2820-year leap cycle, Nowruz |
| `hebrew` | Lunisolar, Metonic cycle, molad, dehiyyot, 6 year types |
| `aztec` | Tonalpohualli (260-day), Xiuhpohualli (365-day), Calendar Round |
| `epoch` | Precession, precessional ages, Seven Sages, cycle alignment, unified `convert()` API |
| `astro` | Coordinate systems, star catalog, precession, heliacal rising, monument alignment |
## Key Principles
- All math must be historically accurate -- real formulas, real correlations
- `#[non_exhaustive]` on ALL public enums
- `#[must_use]` on all pure functions
- Every type must be Serialize + Deserialize (serde)
- Zero unwrap/panic in library code
- All errors via Result<T, SankhyaError>
## Development Process
Follow the Work Loop from the AGNOS CLAUDE.md:
1. Work phase
2. Cleanliness check: `cargo fmt --check`, `cargo clippy --all-features --all-targets -- -D warnings`, `cargo audit`, `cargo deny check`, `RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps`
3. Test + benchmark additions
4. Run benchmarks (`./scripts/bench-history.sh`)
5. Internal review
6. Cleanliness check again
7. Documentation updates
## DO NOT
- **Do not commit or push** -- the user handles all git operations
- **NEVER use `gh` CLI**
- Do not add unnecessary dependencies
- Do not use unwrap/panic in library code
- Do not skip benchmarks before claiming performance improvements