twofourlabs/agent-docs/astrology-backend-integration
- community
Checking that the SKILL.md file is still in the repository.
This skill provides a comprehensive approach for building astrology-specific backend systems with AI integration. Use when implementing vedic astrology features including kundli generation, dasha analysis, dosha detection, and astrological predictions. Builds on the ai-integrated-api-backend skill with astrology domain expertise.
Install
npx vskill@latest install twofourlabs/agent-docs/astrology-backend-integrationSKILL.md
This skill guides the implementation of vedic astrology backends that integrate astrology APIs with AI/LLM systems for predictions and consultations. It captures domain-specific patterns, data structures, and best practices for astrology applications.
When to Use This Skill
Apply this skill when you need to:
- Build vedic astrology consultation platforms
- Integrate astrology APIs (AstrologyAPI.com, Prokerala, etc.)
- Generate and store kundlis (birth charts)
- Implement dasha-based predictions
- Detect doshas (Manglik, Pitra, etc.)
- Provide gemstone/rudraksha recommendations
- Create AI-powered astrology consultants
- Support family/member chart management
- Build compatibility/matching systems
Prerequisites
Before using this skill, you should have:
- Completed the
ai-integrated-api-backendskill (or understand external API + AI integration) - Basic understanding of vedic astrology concepts
- Access to an astrology API provider
Astrology Domain Fundamentals
Core Concepts
Kundli (Birth Chart)
- Complete astrological profile of a person
- Requires: Date, Time, Location (lat/long) of birth
- Timezone: Critical for accuracy (default IST = 5.5 for India)
- Components: Charts, planets, dasha, doshas, remedies
Charts (Divisional Charts)
- D1 (Rashi Chart): Main birth chart, 12 houses
- D9 (Navamsa): Marriage and spiritual chart
- Other divisional charts (D10, D60, etc.) for specific life areas
Houses (Bhava)
- 12 houses representing life domains
- Critical mappings:
- House 1: Self, health, personality
- House 2: Wealth, family, speech
- House 4: Mother, property, happiness
- House 5: Children, education, creativity
- House 7: Marriage, partnerships
- House 10: Career, reputation, father
- House 11: Gains, friends, aspirations
- House 12: Losses, spirituality, foreign lands
Planets (Grahas)
- 9 planets in vedic astrology:
- Sun (Surya): Authority, self, ego
- Moon (Chandra): Mind, emotions, mother
- Mars (Mangal): Energy, courage, conflicts
- Mercury (Budha): Communication, intellect
- Jupiter (Guru): Wisdom, expansion, luck
- Venus (Shukra): Love, relationships, luxury
- Saturn (Shani): Discipline, karma, delays
- Rahu: Desires, obsessions, foreign
- Ketu: Detachment, spirituality, past life
Sign Lords (Zodiac Rulers)
- Each zodiac sign is ruled by a planet:
- Aries → Mars
- Taurus → Venus
- Gemini → Mercury
- Cancer → Moon
- Leo → Sun
- Virgo → Mercury
- Libra → Venus
- Scorpio → Mars
- Sagittarius → Jupiter
- Capricorn → Saturn
- Aquarius → Saturn
- Pisces → Jupiter
Dasha (Planetary Periods)
- Vimshottari Dasha: 120-year cycle
- Structure: Major (Mahadasha) → Minor (Antardasha) → Sub-minor (Pratyantar)
- Each planet rules for specific years
- Critical for timing predictions: "When will X happen?"
Doshas (Afflictions)
- Manglik Dosha: Mars in specific houses (1, 2, 4, 7, 8, 12)
- Affects marriage compatibility
- Measured as percentage (0-100%)
- Cancellations exist (e.g., both partners Manglik)
- Pitra Dosha: Ancestral debt
- Sun/Moon afflicted by Rahu/Ketu
- Remedies: Puja, charity
Remedies
- Gemstones: Strengthen weak planets
- Each planet has a gemstone (Ruby for Sun, Pearl for Moon, etc.)
- Worn on specific finger, day, metal
- Weight in carats specified
- Rudraksha: Beads for spiritual remedies
- Different mukhi (faces) for different planets
- Worn for protection and balance
- Puja/Mantras: Ritual remedies
Astrology API Integration Pattern
Step 1: Choose Astrology API Provider
Popular Options:
- AstrologyAPI.com (https://json.astrologyapi.com/)
- Prokerala API
- GeoVedic API
- AstroSage API
Common Features Needed:
- Birth chart generation (D1, D9)
- Planetary positions with nakshatra
- Vimshottari Dasha
- Dosha analysis (Manglik, Pitra, Kaal Sarp, etc.)
- Gemstone/Rudraksha suggestions
- Panchang (daily calendar)
- Compatibility/matching
Step 2: API Endpoint Mapping
Essential Endpoints (AstrologyAPI.com example):
Step 3: Base Payload Structure
Standard Birth Details Payload:
Critical Considerations:
- Timezone: MUST be accurate. Default IST = 5.5 for India
- Time Format: 24-hour format, NOT 12-hour AM/PM
- Coordinates: Use Google Maps Geocoding API or similar for accurate lat/long
- Date Validation: Ensure valid dates (no Feb 30, etc.)
Step 4: API Manager Implementation
Responsibilities:
- Authenticate with API (usually HTTP Basic Auth or API Key)
- Build payloads from user birth details
- Call multiple endpoints (charts, dasha, dosha, remedies)
- Handle API rate limits and errors
- Return structured responses
Key Pattern:
Parallel Fetching:
- Most endpoints are independent
- Fetch in parallel using async tasks (Celery, etc.)
- Reduces total time from 9×3s = 27s to ~3s
Data Storage Pattern
Database Schema Design
Collection 1: User Birth Details (user_metadata)
Collection 2: Raw Astrology Data (user_astro_metadata)
Why Two Collections?
- Birth details rarely change (immutable)
- Astrology data can be refreshed (dasha changes over time)
- Separation allows independent updates
Family/Member Support
Collection 3: Family Member Birth Details (user_member_metadata)
Collection 4: Family Member Astrology Data (user_member_astro_metadata)
Relation Types:
- "self" (primary user)
- "spouse", "mother", "father"
- "son", "daughter", "child"
- "brother", "sister"
- Custom relations as needed
Kundli Transformation Pattern
Problem Statement
Challenge: API responses are nested, verbose, and use inconsistent key naming. Need to transform into clean, AI-friendly structure.
Example API Response Issues:
- Mixed case keys: "Sign", "sign", "SIGN"
- Verbose: "The person is 28.5% Manglik due to Mars in 7th house..."
- Nested deeply: houses → sign → planets → details
- String format: "Mars(Retrograde)" instead of structured data
Solution: Multi-Step Transformation Pipeline
Step 1: Normalize Keys
- Convert all keys to lowercase
- Recursively process nested objects
- Standardize array structures
Step 2: Transform Charts
- Convert house list to dictionary (house number → details)
- Extract sign from each house
- Map sign to sign lord (Aries → Mars)
- Extract planets in each house
Step 3: Enrich Planets
- Parse planet strings: "Mars(Retrograde)" → {name: "Mars", isRetrograde: true}
- Add nakshatra, longitude, position
- Mark benefic/malefic status
Step 4: Build Dasha Timeline
- Parse date strings to ISO format
- Filter realistic window (e.g., 2010 to current_year + 25)
- Structure major → minor → sub-minor hierarchy
Step 5: Extract Dosha Values
- Reduce verbose reports to key values
- Manglik: Extract percentage only
- Pitra: Extract present/absent only
Step 6: Format Remedies
- Gemstone: Extract name, metal, finger, day, carat
- Rudraksha: Extract mukhi, planet, benefits
Output: Complete Kundli Structure
AI Prompt Integration Pattern
Context Assembly
Components to Inject:
- Complete kundli (YAML format above)
- Query-specific house mapping
- Gender-aware interpretation rules
- Current dasha for timing
- Language preference (Hindi/English)
System Prompt Structure:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/astrology-backend-integration/SKILL.md
Popularity
- Repository stars
- 6
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/twofourlabs/agent-docs/astrology-backend-integration)