numerology/pinnacles.ts
rpriven fd6e171586
Add comprehensive numerology calculator with 10 specialized tools
- Core calculations (Life Path, Expression, Soul Urge, Birthday)
- Advanced numbers (Maturity, Personality, Hidden Passion, Karmic Lessons)
- Timing cycles and optimal days finder
- Compatibility analysis and name optimizer
- Telos integration for personal development
- Professional PDF report generation
- Profile management system
- Security fix: Add .claude/ to .gitignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:00:15 -06:00

766 lines
23 KiB
TypeScript
Executable file

#!/usr/bin/env bun
/**
* Life Stages & Pinnacles Calculator
*
* Calculate your 4 major Life Pinnacles - the overarching themes and
* opportunities for growth during different life stages. Each pinnacle
* lasts approximately 9 years and represents major life chapters.
*
* Also calculates Challenge Numbers - obstacles and lessons to overcome.
*
* Usage:
* bun pinnacles.ts --birthdate "5/13/1982"
* bun pinnacles.ts --birthdate "5/13/1982" --name "Your Name"
*/
import { reduce } from './core-calculator';
import { loadProfile } from './profile-manager';
// Parse command line arguments
const args = process.argv.slice(2);
let birthdate = '';
let name = '';
let profileId = '';
for (let i = 0; i < args.length; i++) {
if ((args[i] === '--profile' || args[i] === '-p') && args[i + 1]) {
profileId = args[i + 1];
i++;
} else if ((args[i] === '--birthdate' || args[i] === '-b') && args[i + 1]) {
birthdate = args[i + 1];
i++;
} else if ((args[i] === '--name' || args[i] === '-n') && args[i + 1]) {
name = args[i + 1];
i++;
} else if (args[i] === '--help' || args[i] === '-h') {
console.log(`
Life Stages & Pinnacles Calculator
Calculate your 4 major Life Pinnacles and Challenge Numbers.
Pinnacles are 9-year cycles representing major life themes and opportunities.
USAGE:
bun pinnacles.ts --profile <id>
bun pinnacles.ts --birthdate "mm/dd/yyyy" [OPTIONS]
OPTIONS:
-p, --profile ID Use saved profile
-b, --birthdate DATE Your birthdate (mm/dd/yyyy) [required if no profile]
-n, --name NAME Your name [optional - for context]
-h, --help Show this help message
EXAMPLES:
# With profile
bun pinnacles.ts --profile rob
# With birthdate
bun pinnacles.ts -b "5/13/1982"
bun pinnacles.ts -b "5/13/1982" -n "John Doe"
WHAT ARE PINNACLES?
Pinnacles are major 9-year life cycles, each with a specific theme and energy.
There are 4 pinnacles in a lifetime:
1st Pinnacle: Foundation & Growth (Birth to ~age 27-35)
2nd Pinnacle: Productivity & Building (Age ~27-44)
3rd Pinnacle: Harvest & Mastery (Age ~44-53)
4th Pinnacle: Wisdom & Legacy (Age ~53 onwards)
The age ranges depend on your Life Path number.
WHAT ARE CHALLENGES?
Challenges represent obstacles and lessons you must overcome during each
pinnacle period. They show where growth is needed.
`);
process.exit(0);
}
}
// Load profile if specified
if (profileId) {
const profile = loadProfile(profileId);
if (!profile) {
console.error(`Error: Profile '${profileId}' not found`);
console.error('List profiles with: bun profile.ts list');
process.exit(1);
}
name = profile.name;
birthdate = profile.birthdate;
}
if (!birthdate) {
console.error('Error: --birthdate is required (or use --profile)');
console.error('Try: bun pinnacles.ts --help');
process.exit(1);
}
// Parse birthdate
const parts = birthdate.split('/');
if (parts.length !== 3) {
console.error('Error: Birthdate must be in mm/dd/yyyy format');
process.exit(1);
}
const month = parseInt(parts[0]);
const day = parseInt(parts[1]);
const year = parseInt(parts[2]);
// Calculate Life Path
function calculateLifePath(m: number, d: number, y: number): number {
const monthReduced = reduce(m);
const dayReduced = reduce(d);
const yearReduced = reduce(y);
const sum = monthReduced + dayReduced + yearReduced;
return reduce(sum);
}
const lifePath = calculateLifePath(month, day, year);
// Calculate Pinnacles
// Pinnacle 1 = Month + Day
// Pinnacle 2 = Day + Year
// Pinnacle 3 = Pinnacle 1 + Pinnacle 2
// Pinnacle 4 = Month + Year
const pinnacle1 = reduce(month + day);
const pinnacle2 = reduce(day + year);
const pinnacle3 = reduce(pinnacle1 + pinnacle2);
const pinnacle4 = reduce(month + year);
// Calculate Challenge Numbers
// Challenge 1 = |Month - Day|
// Challenge 2 = |Day - Year|
// Challenge 3 = |Challenge 1 - Challenge 2|
// Challenge 4 = |Month - Year|
const monthReduced = reduce(month);
const dayReduced = reduce(day);
const yearReduced = reduce(year);
const challenge1 = Math.abs(monthReduced - dayReduced);
const challenge2 = Math.abs(dayReduced - yearReduced);
const challenge3 = Math.abs(challenge1 - challenge2);
const challenge4 = Math.abs(monthReduced - yearReduced);
// Calculate Pinnacle Ages
// Age at end of 1st Pinnacle = 36 - Life Path
const firstPinnacleEnd = 36 - lifePath;
const secondPinnacleEnd = firstPinnacleEnd + 9;
const thirdPinnacleEnd = secondPinnacleEnd + 9;
// 4th Pinnacle continues for rest of life
// Calculate current age
const today = new Date();
const birthYear = year;
const currentAge = today.getFullYear() - birthYear;
// Determine current pinnacle
let currentPinnacle = 1;
let currentPinnacleNumber = pinnacle1;
let currentChallenge = challenge1;
let pinnacleStartAge = 0;
let pinnacleEndAge = firstPinnacleEnd;
if (currentAge > thirdPinnacleEnd) {
currentPinnacle = 4;
currentPinnacleNumber = pinnacle4;
currentChallenge = challenge4;
pinnacleStartAge = thirdPinnacleEnd + 1;
pinnacleEndAge = 999; // Lifetime
} else if (currentAge > secondPinnacleEnd) {
currentPinnacle = 3;
currentPinnacleNumber = pinnacle3;
currentChallenge = challenge3;
pinnacleStartAge = secondPinnacleEnd + 1;
pinnacleEndAge = thirdPinnacleEnd;
} else if (currentAge > firstPinnacleEnd) {
currentPinnacle = 2;
currentPinnacleNumber = pinnacle2;
currentChallenge = challenge2;
pinnacleStartAge = firstPinnacleEnd + 1;
pinnacleEndAge = secondPinnacleEnd;
} else {
currentPinnacle = 1;
currentPinnacleNumber = pinnacle1;
currentChallenge = challenge1;
pinnacleStartAge = 0;
pinnacleEndAge = firstPinnacleEnd;
}
// Pinnacle meanings
const pinnacleMeanings: Record<number, { theme: string; focus: string[]; opportunities: string[]; challenges: string[] }> = {
1: {
theme: 'Independence & Leadership',
focus: [
'Develop self-confidence and courage',
'Learn to stand on your own',
'Take initiative and lead',
'Forge your own path'
],
opportunities: [
'Starting new ventures',
'Developing leadership skills',
'Building self-reliance',
'Taking bold action',
'Pioneering new territory'
],
challenges: [
'Overcoming self-doubt',
'Avoiding excessive ego',
'Not being too aggressive',
'Learning independence without isolation'
]
},
2: {
theme: 'Cooperation & Relationships',
focus: [
'Build meaningful partnerships',
'Develop diplomacy and tact',
'Learn patience and cooperation',
'Master the art of collaboration'
],
opportunities: [
'Deep relationships and partnerships',
'Collaborative projects',
'Diplomatic roles',
'Building harmony',
'Supporting others'
],
challenges: [
'Avoiding codependence',
'Not losing yourself in others',
'Overcoming hypersensitivity',
'Speaking up when needed'
]
},
3: {
theme: 'Creative Expression & Communication',
focus: [
'Express yourself creatively',
'Develop communication skills',
'Find joy and optimism',
'Share your gifts with the world'
],
opportunities: [
'Creative projects and arts',
'Public speaking and writing',
'Social connections',
'Self-expression',
'Inspiring others through joy'
],
challenges: [
'Avoiding scattered energy',
'Not being superficial',
'Managing criticism',
'Finishing what you start'
]
},
4: {
theme: 'Foundation & Hard Work',
focus: [
'Build solid foundations',
'Develop discipline and organization',
'Work hard toward goals',
'Create lasting structures'
],
opportunities: [
'Building wealth through effort',
'Creating systems and order',
'Physical accomplishments',
'Real estate and property',
'Establishing security'
],
challenges: [
'Avoiding rigidity',
'Not overworking',
'Preventing burnout',
'Being flexible when needed'
]
},
5: {
theme: 'Freedom & Change',
focus: [
'Embrace change and variety',
'Explore and experience life',
'Develop adaptability',
'Learn from diverse experiences'
],
opportunities: [
'Travel and adventure',
'Career changes and pivots',
'Marketing and promotion',
'Trying new things',
'Personal freedom'
],
challenges: [
'Avoiding restlessness',
'Not being irresponsible',
'Managing impulses',
'Commitment when needed'
]
},
6: {
theme: 'Responsibility & Service',
focus: [
'Take responsibility for others',
'Serve family and community',
'Teach and nurture',
'Create harmony and beauty'
],
opportunities: [
'Family and home',
'Teaching and counseling',
'Helping professions',
'Creating beauty',
'Service to others'
],
challenges: [
'Avoiding martyrdom',
'Not being controlling',
'Setting boundaries',
'Self-care alongside service'
]
},
7: {
theme: 'Wisdom & Spirituality',
focus: [
'Seek inner truth and wisdom',
'Develop spiritual understanding',
'Master a specialty',
'Trust your intuition'
],
opportunities: [
'Deep study and research',
'Spiritual development',
'Teaching wisdom',
'Mastering expertise',
'Inner peace'
],
challenges: [
'Avoiding isolation',
'Not being too aloof',
'Connecting with others',
'Practical application of wisdom'
]
},
8: {
theme: 'Power & Achievement',
focus: [
'Build material success',
'Develop business acumen',
'Gain authority and respect',
'Master the material world'
],
opportunities: [
'Business success',
'Financial abundance',
'Leadership positions',
'Recognition and authority',
'Large-scale projects'
],
challenges: [
'Avoiding greed',
'Not abusing power',
'Staying ethical',
'Balancing material and spiritual'
]
},
9: {
theme: 'Completion & Humanitarianism',
focus: [
'Serve humanity broadly',
'Complete life lessons',
'Develop compassion',
'Let go of the past'
],
opportunities: [
'Humanitarian work',
'Teaching and healing',
'Artistic expression',
'Global thinking',
'Completion of major cycles'
],
challenges: [
'Avoiding emotional overwhelm',
'Not being impractical',
'Letting go when needed',
'Setting boundaries in service'
]
},
11: {
theme: 'Spiritual Illumination',
focus: [
'Inspire and illuminate others',
'Develop spiritual gifts',
'Lead through inspiration',
'Channel higher wisdom'
],
opportunities: [
'Spiritual teaching',
'Inspirational leadership',
'Intuitive development',
'Healing work',
'Visionary projects'
],
challenges: [
'Managing nervous system',
'Avoiding overwhelm',
'Grounding spiritual energy',
'Practical application of vision'
]
},
22: {
theme: 'Master Building',
focus: [
'Build lasting legacies',
'Manifest grand visions',
'Serve on large scale',
'Combine practical and visionary'
],
opportunities: [
'Large-scale manifestation',
'Building institutions',
'Global impact',
'Visionary leadership',
'Lasting contributions'
],
challenges: [
'Managing immense pressure',
'Not doubting grand vision',
'Staying grounded',
'Balancing ambition with reality'
]
},
33: {
theme: 'Master Teaching',
focus: [
'Teach and heal at master level',
'Serve humanity compassionately',
'Embody unconditional love',
'Lead through nurturing'
],
opportunities: [
'Master teaching',
'Healing on large scale',
'Compassionate leadership',
'Raising consciousness',
'Selfless service'
],
challenges: [
'Avoiding martyrdom',
'Preventing burnout',
'Setting healthy boundaries',
'Not trying to save everyone'
]
}
};
// Challenge meanings
const challengeMeanings: Record<number, { lesson: string; mustLearn: string[]; traps: string[] }> = {
0: {
lesson: 'Choice & Responsibility',
mustLearn: [
'Make clear decisions',
'Take full responsibility',
'Avoid indecisiveness',
'Choose your path'
],
traps: [
'Analysis paralysis',
'Avoiding decisions',
'Waiting for perfection'
]
},
1: {
lesson: 'Independence vs. Dependence',
mustLearn: [
'Stand on your own',
'Develop self-confidence',
'Take initiative',
'Balance independence with cooperation'
],
traps: [
'Too dependent on others',
'Too aggressive/domineering',
'Afraid to lead'
]
},
2: {
lesson: 'Sensitivity & Balance',
mustLearn: [
'Manage sensitivity',
'Find balance in relationships',
'Speak your truth',
'Cooperate without losing self'
],
traps: [
'Oversensitivity',
'Codependence',
'People-pleasing',
'Avoiding conflict'
]
},
3: {
lesson: 'Self-Expression',
mustLearn: [
'Express yourself authentically',
'Share your creativity',
'Communicate openly',
'Find your voice'
],
traps: [
'Self-criticism',
'Scattered energy',
'Superficiality',
'Fear of judgment'
]
},
4: {
lesson: 'Discipline & Order',
mustLearn: [
'Create structure',
'Develop discipline',
'Commit to hard work',
'Build foundations'
],
traps: [
'Rigidity',
'Workaholism',
'Avoiding necessary work',
'Too much restriction'
]
},
5: {
lesson: 'Freedom & Responsibility',
mustLearn: [
'Balance freedom with responsibility',
'Embrace change wisely',
'Develop self-discipline',
'Focus energy'
],
traps: [
'Restlessness',
'Irresponsibility',
'Overindulgence',
'Fear of commitment'
]
},
6: {
lesson: 'Responsibility & Boundaries',
mustLearn: [
'Set healthy boundaries',
'Serve without martyrdom',
'Accept responsibility appropriately',
'Love with wisdom'
],
traps: [
'Martyrdom',
'Controlling others',
'Codependence',
'Perfectionism'
]
},
7: {
lesson: 'Faith & Trust',
mustLearn: [
'Trust your intuition',
'Connect spiritually',
'Balance alone time with connection',
'Share your wisdom'
],
traps: [
'Isolation',
'Cynicism',
'Overthinking',
'Spiritual bypassing'
]
},
8: {
lesson: 'Power & Integrity',
mustLearn: [
'Use power ethically',
'Balance material and spiritual',
'Lead with integrity',
'Manage money wisely'
],
traps: [
'Greed',
'Abuse of power',
'Materialism',
'Workaholism'
]
}
};
// Output
console.log(`\n═══════════════════════════════════════════════════════════════`);
console.log(`📊 LIFE STAGES & PINNACLES`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
if (name) {
console.log(`Name: ${name}`);
}
console.log(`Birthdate: ${birthdate}`);
console.log(`Current Age: ${currentAge}`);
console.log(`Life Path: ${lifePath}\n`);
// Display all 4 pinnacles
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`YOUR 4 MAJOR LIFE PINNACLES`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
const pinnacles = [
{ num: 1, value: pinnacle1, ages: `Birth - Age ${firstPinnacleEnd}`, challenge: challenge1 },
{ num: 2, value: pinnacle2, ages: `Age ${firstPinnacleEnd + 1} - ${secondPinnacleEnd}`, challenge: challenge2 },
{ num: 3, value: pinnacle3, ages: `Age ${secondPinnacleEnd + 1} - ${thirdPinnacleEnd}`, challenge: challenge3 },
{ num: 4, value: pinnacle4, ages: `Age ${thirdPinnacleEnd + 1}+`, challenge: challenge4 }
];
pinnacles.forEach(p => {
const isCurrent = p.num === currentPinnacle;
const marker = isCurrent ? ' 👉 YOU ARE HERE' : '';
const meaning = pinnacleMeanings[p.value];
console.log(`${isCurrent ? '✨ ' : ''}PINNACLE ${p.num}: ${p.ages}${marker}`);
console.log(`Number: ${p.value} - ${meaning?.theme || 'Unknown'}`);
console.log(`Challenge: ${p.challenge}\n`);
if (meaning && isCurrent) {
console.log(`CURRENT FOCUS:`);
meaning.focus.forEach(f => console.log(`${f}`));
console.log('');
}
});
// Detailed current pinnacle
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`YOUR CURRENT PINNACLE (Pinnacle ${currentPinnacle})`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
const currentMeaning = pinnacleMeanings[currentPinnacleNumber];
if (currentMeaning) {
console.log(`PINNACLE ${currentPinnacle}: NUMBER ${currentPinnacleNumber}`);
console.log(`${currentMeaning.theme.toUpperCase()}\n`);
console.log(`AGE RANGE: ${pinnacleStartAge === 0 ? 'Birth' : `Age ${pinnacleStartAge}`} - ${pinnacleEndAge === 999 ? 'Rest of Life' : `Age ${pinnacleEndAge}`}`);
if (pinnacleEndAge !== 999) {
const yearsRemaining = pinnacleEndAge - currentAge;
console.log(`Years Remaining in This Pinnacle: ${yearsRemaining}\n`);
} else {
console.log(`This is your final pinnacle for the rest of your life.\n`);
}
console.log(`🎯 PRIMARY FOCUS:`);
currentMeaning.focus.forEach(f => console.log(`${f}`));
console.log('');
console.log(`✅ OPPORTUNITIES:`);
currentMeaning.opportunities.forEach(o => console.log(`${o}`));
console.log('');
console.log(`⚠️ CHALLENGES TO WATCH:`);
currentMeaning.challenges.forEach(c => console.log(`${c}`));
console.log('');
}
// Current Challenge
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`YOUR CURRENT CHALLENGE (Pinnacle ${currentPinnacle})`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
const challengeMeaning = challengeMeanings[currentChallenge];
if (challengeMeaning) {
console.log(`CHALLENGE ${currentPinnacle}: NUMBER ${currentChallenge}`);
console.log(`${challengeMeaning.lesson.toUpperCase()}\n`);
console.log(`📚 MUST LEARN:`);
challengeMeaning.mustLearn.forEach(l => console.log(`${l}`));
console.log('');
console.log(`❌ TRAPS TO AVOID:`);
challengeMeaning.traps.forEach(t => console.log(`${t}`));
console.log('');
}
// Strategic Life Planning
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`STRATEGIC LIFE PLANNING`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
if (currentPinnacle === 1) {
console.log(`💡 You're in your Foundation & Growth period.\n`);
console.log(`This pinnacle is about:\n`);
console.log(`→ Building your foundation for life`);
console.log(`→ Discovering who you are`);
console.log(`→ Developing core skills and abilities`);
console.log(`→ Learning life's basic lessons\n`);
console.log(`Use this time to experiment, learn, and grow. The patterns you`);
console.log(`establish now will influence your entire life.\n`);
} else if (currentPinnacle === 2) {
console.log(`💡 You're in your Productivity & Building period.\n`);
console.log(`This pinnacle is about:\n`);
console.log(`→ Applying what you learned in Pinnacle 1`);
console.log(`→ Building your career and relationships`);
console.log(`→ Creating stability and structure`);
console.log(`→ Maximizing productivity\n`);
console.log(`This is your power building phase. Focus on creating the life`);
console.log(`you want to live in Pinnacles 3 and 4.\n`);
} else if (currentPinnacle === 3) {
console.log(`💡 You're in your Harvest & Mastery period.\n`);
console.log(`This pinnacle is about:\n`);
console.log(`→ Reaping what you've sown`);
console.log(`→ Mastering your craft`);
console.log(`→ Reassessing and adjusting`);
console.log(`→ Preparing for wisdom phase\n`);
console.log(`This is the harvest time. What you built in Pinnacles 1-2 now`);
console.log(`bears fruit. Use this time to master and perfect.\n`);
} else if (currentPinnacle === 4) {
console.log(`💡 You're in your Wisdom & Legacy period.\n`);
console.log(`This pinnacle is about:\n`);
console.log(`→ Sharing wisdom gained from life`);
console.log(`→ Creating lasting legacy`);
console.log(`→ Mentoring others`);
console.log(`→ Living your highest purpose\n`);
console.log(`This is your wisdom phase. You have a lifetime of experience.`);
console.log(`How will you share it? What legacy will you leave?\n`);
}
// Next Pinnacle Preview (if not in Pinnacle 4)
if (currentPinnacle < 4) {
const nextPinnacle = currentPinnacle + 1;
let nextNumber, nextStart, nextEnd;
if (nextPinnacle === 2) {
nextNumber = pinnacle2;
nextStart = firstPinnacleEnd + 1;
nextEnd = secondPinnacleEnd;
} else if (nextPinnacle === 3) {
nextNumber = pinnacle3;
nextStart = secondPinnacleEnd + 1;
nextEnd = thirdPinnacleEnd;
} else {
nextNumber = pinnacle4;
nextStart = thirdPinnacleEnd + 1;
nextEnd = 999;
}
const yearsUntilNext = nextStart - currentAge;
const nextMeaning = pinnacleMeanings[nextNumber];
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`NEXT PINNACLE PREVIEW`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
console.log(`PINNACLE ${nextPinnacle}: NUMBER ${nextNumber} - ${nextMeaning?.theme}`);
console.log(`Begins: Age ${nextStart} (in ${yearsUntilNext} years)\n`);
if (nextMeaning) {
console.log(`PREPARE NOW FOR:`);
nextMeaning.focus.slice(0, 3).forEach(f => console.log(`${f}`));
console.log('');
}
}
console.log(`✨ Generated with Life Stages & Pinnacles Calculator\n`);