numerology/optimal-days.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

487 lines
16 KiB
TypeScript
Executable file

#!/usr/bin/env bun
/**
* Optimal Days Finder
*
* Find the best days in a month (or year) for specific activities based on
* Personal Day cycles. Perfect for scheduling launches, meetings, creative work, etc.
*
* Usage:
* bun optimal-days.ts --birthdate "5/13/1982" --month 11 --year 2025 --day 1
* bun optimal-days.ts --birthdate "5/13/1982" --month 11 --year 2025 --day 8 --activity "business"
* bun optimal-days.ts --birthdate "5/13/1982" --year 2025 --day 3 (find all Day 3s in the year)
*/
import { calculateCycles } from './cycles';
import { loadProfile } from './profile-manager';
// Parse command line arguments
const args = process.argv.slice(2);
let birthdate = '';
let profileId = '';
let month: number | null = null;
let year: number = new Date().getFullYear();
let targetDay: number | null = null;
let activity = '';
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] === '--month' || args[i] === '-m') && args[i + 1]) {
month = parseInt(args[i + 1]);
i++;
} else if ((args[i] === '--year' || args[i] === '-y') && args[i + 1]) {
year = parseInt(args[i + 1]);
i++;
} else if ((args[i] === '--day' || args[i] === '-d') && args[i + 1]) {
targetDay = parseInt(args[i + 1]);
i++;
} else if ((args[i] === '--activity' || args[i] === '-a') && args[i + 1]) {
activity = args[i + 1].toLowerCase();
i++;
} else if (args[i] === '--help' || args[i] === '-h') {
console.log(`
Optimal Days Finder
Find the best days for specific activities based on Personal Day cycles.
USAGE:
bun optimal-days.ts --profile <id> [OPTIONS]
bun optimal-days.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]
-m, --month NUMBER Month to search (1-12) [optional - searches whole year if omitted]
-y, --year NUMBER Year to search [default: current year]
-d, --day NUMBER Target Personal Day number (1-9, 11, 22, 33)
-a, --activity NAME Activity type (new, creative, business, study, etc.) [optional]
-h, --help Show this help message
EXAMPLES:
# With profile
bun optimal-days.ts --profile rob -m 11 -y 2025 -d 1
bun optimal-days.ts --profile rob -y 2025 -d 8
# With birthdate
bun optimal-days.ts -b "5/13/1982" -m 11 -y 2025 -d 1
bun optimal-days.ts -b "5/13/1982" -y 2025 -d 8
bun optimal-days.ts -b "5/13/1982" -m 12 -y 2025 -a new
bun optimal-days.ts -b "5/13/1982" -d 3
PERSONAL DAY MEANINGS:
1 - New beginnings, initiatives, independence
2 - Cooperation, partnerships, details
3 - Creative expression, communication, social
4 - Hard work, organization, foundation building
5 - Change, freedom, marketing, variety
6 - Service, responsibility, teaching, family
7 - Introspection, study, spirituality, rest
8 - Achievement, business, power, success
9 - Completion, endings, release, letting go
11 - Inspiration, intuition, spiritual leadership
22 - Master building, manifestation
33 - Master teaching, healing, service
ACTIVITY KEYWORDS:
new, begin, start, launch → Day 1
creative, write, content → Day 3
business, money, scale → Day 8
study, learn, research → Day 7
complete, finish, publish → Day 9
teach, serve, help → Day 6
`);
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);
}
birthdate = profile.birthdate;
}
if (!birthdate) {
console.error('Error: --birthdate is required (or use --profile)');
console.error('Try: bun optimal-days.ts --help');
process.exit(1);
}
// Activity to Personal Day mapping
const activityMap: Record<string, number[]> = {
'new': [1],
'begin': [1],
'start': [1],
'launch': [1, 8],
'creative': [3],
'write': [3],
'content': [3],
'communicate': [3],
'business': [8],
'money': [8],
'financial': [8],
'scale': [8],
'study': [7],
'learn': [7],
'research': [7],
'certification': [7],
'complete': [9],
'finish': [9],
'publish': [9],
'release': [9],
'teach': [6, 33],
'serve': [6, 33],
'help': [6],
'organize': [4],
'build': [4, 22],
'system': [4],
'change': [5],
'market': [5],
'promote': [5],
'partner': [2],
'collaborate': [2],
'spiritual': [7, 11],
'inspire': [11],
};
// Determine target day from activity if not specified
if (!targetDay && activity) {
const matchedDays = activityMap[activity];
if (matchedDays && matchedDays.length > 0) {
targetDay = matchedDays[0]; // Use first match
console.log(`\n🎯 Searching for Personal Day ${targetDay} days (best for "${activity}" activities)\n`);
} else {
console.error(`Error: Unknown activity "${activity}"`);
console.error('Try: new, creative, business, study, complete, teach, etc.');
process.exit(1);
}
}
if (!targetDay) {
console.error('Error: Either --day or --activity is required');
console.error('Try: bun optimal-days.ts --help');
process.exit(1);
}
// Day meanings
const dayMeanings: Record<number, { name: string; energy: string; bestFor: string[] }> = {
1: {
name: 'New Beginnings',
energy: 'Initiative, Independence, Leadership',
bestFor: [
'Starting new projects or ventures',
'First client meetings',
'Launching products/services',
'Making bold decisions',
'Taking independent action',
'Breaking new ground'
]
},
2: {
name: 'Cooperation',
energy: 'Partnership, Patience, Details',
bestFor: [
'Building partnerships',
'Collaborative meetings',
'Detail-oriented work',
'Diplomatic negotiations',
'Relationship building',
'Refining and perfecting'
]
},
3: {
name: 'Creative Expression',
energy: 'Communication, Creativity, Social',
bestFor: [
'Writing and content creation',
'Public speaking',
'Social media and networking',
'Creative projects',
'Presentations',
'Joyful collaboration'
]
},
4: {
name: 'Foundation Building',
energy: 'Hard Work, Organization, Structure',
bestFor: [
'Building systems and processes',
'Organizing and planning',
'Infrastructure work',
'Physical projects',
'Financial planning',
'Detail implementation'
]
},
5: {
name: 'Change & Freedom',
energy: 'Variety, Adventure, Marketing',
bestFor: [
'Marketing and promotion',
'Trying new approaches',
'Embracing change',
'Travel and exploration',
'Experimenting',
'Pivoting strategies'
]
},
6: {
name: 'Service & Responsibility',
energy: 'Teaching, Helping, Family',
bestFor: [
'Client service work',
'Teaching and training',
'Taking on responsibility',
'Family matters',
'Home projects',
'Community service'
]
},
7: {
name: 'Introspection',
energy: 'Study, Spirituality, Analysis',
bestFor: [
'Deep study and learning',
'Research and analysis',
'Spiritual practice',
'Private development',
'Rest and rejuvenation',
'Strategic thinking'
]
},
8: {
name: 'Achievement',
energy: 'Power, Business, Success',
bestFor: [
'Business deals and negotiations',
'Financial decisions',
'Scaling operations',
'Authority building',
'Major launches',
'Leadership actions'
]
},
9: {
name: 'Completion',
energy: 'Release, Endings, Letting Go',
bestFor: [
'Completing projects',
'Publishing finished work',
'Releasing products',
'Ending what no longer serves',
'Wrapping up loose ends',
'Clearing space'
]
},
11: {
name: 'Inspiration',
energy: 'Intuition, Illumination, Spiritual Leadership',
bestFor: [
'Inspiring others',
'Channeling intuition',
'Spiritual teaching',
'Visionary work',
'Illuminating insights',
'Master-level guidance'
]
},
22: {
name: 'Master Building',
energy: 'Manifestation, Large-Scale Vision',
bestFor: [
'Building lasting legacies',
'Large-scale projects',
'Master-level manifestation',
'Visionary implementation',
'Foundation for decades',
'Ambitious launches'
]
},
33: {
name: 'Master Teaching',
energy: 'Healing, Compassionate Service',
bestFor: [
'Master teaching moments',
'Healing and service work',
'Compassionate leadership',
'Educational initiatives',
'Serving at highest level',
'Impact-focused action'
]
}
};
// Avoid activities
const avoidActivities: Record<number, string[]> = {
1: ['Waiting for others', 'Being passive', 'Following only'],
2: ['Solo ventures', 'Rushing', 'Being impatient'],
3: ['Heavy analytical work', 'Isolation', 'Serious only mode'],
4: ['Starting completely new things', 'Taking shortcuts', 'Scattered work'],
5: ['Rigid routines', 'Being stuck', 'Resisting change'],
6: ['Selfish pursuits', 'Avoiding responsibility', 'Neglecting others'],
7: ['Major public launches', 'Excessive socializing', 'Surface-level work'],
8: ['Spiritual retreats', 'Passive waiting', 'Small thinking'],
9: ['Starting new ventures', 'Beginning fresh', 'Initiating'],
11: ['Ignoring intuition', 'Playing small', 'Logical-only thinking'],
22: ['Small projects', 'Short-term thinking', 'Doubting vision'],
33: ['Selfish profit focus', 'Burnout', 'Saving everyone without boundaries']
};
interface OptimalDay {
date: Date;
dateString: string;
dayOfWeek: string;
personalDay: number;
personalMonth: number;
monthName: string;
}
// Find optimal days
function findOptimalDays(
birthdate: string,
targetDay: number,
month: number | null,
year: number
): OptimalDay[] {
const results: OptimalDay[] = [];
const startMonth = month || 1;
const endMonth = month || 12;
for (let m = startMonth; m <= endMonth; m++) {
const daysInMonth = new Date(year, m, 0).getDate();
for (let d = 1; d <= daysInMonth; d++) {
const dateStr = `${m}/${d}/${year}`;
const cycles = calculateCycles(birthdate, dateStr);
if (cycles.personal.day === targetDay) {
const date = new Date(year, m - 1, d);
results.push({
date,
dateString: dateStr,
dayOfWeek: date.toLocaleDateString('en-US', { weekday: 'long' }),
personalDay: cycles.personal.day,
personalMonth: cycles.personal.month,
monthName: date.toLocaleDateString('en-US', { month: 'long' })
});
}
}
}
return results;
}
// Main execution
console.log(`\n═══════════════════════════════════════════════════════════════`);
console.log(`🎯 OPTIMAL DAYS FINDER`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
const searchPeriod = month
? `${new Date(year, month - 1).toLocaleDateString('en-US', { month: 'long' })} ${year}`
: `All of ${year}`;
console.log(`Searching: ${searchPeriod}`);
console.log(`Personal Day: ${targetDay} (${dayMeanings[targetDay]?.name || 'Unknown'})\n`);
const optimalDays = findOptimalDays(birthdate, targetDay, month, year);
if (optimalDays.length === 0) {
console.log(`❌ No Personal Day ${targetDay} days found in ${searchPeriod}\n`);
process.exit(0);
}
console.log(`Found ${optimalDays.length} optimal day${optimalDays.length > 1 ? 's' : ''}:\n`);
// Display results grouped by month
const byMonth: Record<string, OptimalDay[]> = {};
optimalDays.forEach(day => {
if (!byMonth[day.monthName]) byMonth[day.monthName] = [];
byMonth[day.monthName].push(day);
});
for (const [monthName, days] of Object.entries(byMonth)) {
console.log(`📅 ${monthName.toUpperCase()} ${year}:`);
days.forEach(day => {
const date = day.date;
const dateFormatted = `${monthName} ${date.getDate()}, ${year}`;
console.log(`${day.dayOfWeek}, ${dateFormatted}`);
});
console.log('');
}
// Display day meaning and guidance
const meaning = dayMeanings[targetDay];
if (meaning) {
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`PERSONAL DAY ${targetDay}: ${meaning.name.toUpperCase()}`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
console.log(`🌟 ENERGY: ${meaning.energy}\n`);
console.log(`✅ BEST FOR:`);
meaning.bestFor.forEach(item => console.log(`${item}`));
console.log('');
if (avoidActivities[targetDay]) {
console.log(`⚠️ AVOID ON THESE DAYS:`);
avoidActivities[targetDay].forEach(item => console.log(`${item}`));
console.log('');
}
}
// Practical scheduling tips
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`💡 SCHEDULING TIPS`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
if (targetDay === 1) {
console.log(`→ Schedule important launches and "first steps" on these days`);
console.log(`→ Use for kickoff meetings and bold initiatives`);
console.log(`→ These are YOUR days to lead and take charge\n`);
} else if (targetDay === 3) {
console.log(`→ Perfect days for content creation and publishing`);
console.log(`→ Schedule presentations and networking events`);
console.log(`→ Social media campaigns work great on Day 3\n`);
} else if (targetDay === 7) {
console.log(`→ Block these days for deep work and study`);
console.log(`→ Avoid scheduling external meetings if possible`);
console.log(`→ Use for strategy, analysis, and preparation\n`);
} else if (targetDay === 8) {
console.log(`→ Schedule major business deals and negotiations`);
console.log(`→ Perfect for product launches and promotions`);
console.log(`→ Make big financial decisions on these days\n`);
} else if (targetDay === 9) {
console.log(`→ Ideal days to ship completed projects`);
console.log(`→ Schedule "wrapping up" and "final release" work`);
console.log(`→ Good for ending contracts or relationships\n`);
}
// Show first 3 as "upcoming opportunities" if searching future
const today = new Date();
const futureDays = optimalDays.filter(d => d.date >= today).slice(0, 3);
if (futureDays.length > 0) {
console.log(`═══════════════════════════════════════════════════════════════`);
console.log(`🚀 UPCOMING OPPORTUNITIES`);
console.log(`═══════════════════════════════════════════════════════════════\n`);
futureDays.forEach((day, i) => {
const daysUntil = Math.ceil((day.date.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
const urgent = daysUntil <= 7 ? '⚡' : '';
console.log(`${i + 1}. ${urgent} ${day.dayOfWeek}, ${day.monthName} ${day.date.getDate()}`);
console.log(` (${daysUntil} days from now - Personal Month ${day.personalMonth})\n`);
});
}
console.log(`✨ Use these optimal days to align your actions with natural energy cycles\n`);