start_my_day
Plan your day with smart task selection and daily note creation. Syncs completed tasks, selects 3-5 priority tasks from backlog, and creates organized daily notes for focused productivity.
Instructions
Start your day with smart task selection and daily note creation.
ENHANCED - Obsidian-first workflow:
Syncs yesterday's completed tasks from daily note
Intelligently selects 3-5 tasks from backlog using deterministic algorithm
Creates today's daily note with selected tasks organized by priority
Returns comprehensive briefing for the day
Selection algorithm picks:
1 critical task (deadlines or highest priority)
1-2 important tasks (high-impact work)
2-3 quick wins (low-effort, high-dopamine)
Perfect for: "Start my day" or "What should I focus on today?"
Args: date_str: Optional date in YYYY-MM-DD format (defaults to today)
Returns: Daily briefing with selected tasks, goals, and motivational message
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date_str | No |
Implementation Reference
- src/coach_ai/daily_notes.py:43-150 (handler)This is the core implementation of the start_my_day logic, which performs the Obsidian vault integration, task synchronization, and daily note creation.
async def start_my_day(date_str: str = None) -> str: """Start your day with smart task selection and daily note creation. ENHANCED VERSION - Obsidian-first workflow: - Syncs yesterday's completed tasks from daily note - Intelligently selects 3-5 tasks from backlog - Creates or updates today's daily note with selected tasks - Returns comprehensive briefing for the day Args: date_str: Optional date in YYYY-MM-DD format (defaults to today) Returns: Daily briefing with selected tasks and context """ vault = get_vault() if not vault: return "❌ Obsidian vault not configured. Set OBSIDIAN_VAULT_PATH environment variable." # Parse date if date_str: try: target_date = datetime.strptime(date_str, "%Y-%m-%d").date() except ValueError: return f"❌ Invalid date format. Use YYYY-MM-DD, got: {date_str}" else: target_date = date.today() db = await get_db() # Build briefing briefing = "=== 🌅 START MY DAY ===\n\n" briefing += f"📅 {target_date.strftime('%A, %B %d, %Y')}\n\n" # 1. Sync yesterday's note first (mark completed tasks) yesterday = target_date - timedelta(days=1) if vault.daily_note_exists(datetime.combine(yesterday, datetime.min.time())): sync_result = await _sync_completed_tasks(vault, yesterday, db) if sync_result["completed_count"] > 0: briefing += f"✅ Synced {sync_result['completed_count']} completed tasks from yesterday\n" for task in sync_result["completed_tasks"][:3]: briefing += f" - {task}\n" if sync_result["completed_count"] > 3: briefing += f" ... and {sync_result['completed_count'] - 3} more\n" briefing += "\n" # 2. Select tasks for today using smart algorithm selected = await select_tasks_for_today(db, target_date, max_tasks=5) total_selected = ( len(selected["critical"]) + len(selected["important"]) + len(selected["quick_wins"]) ) briefing += f"📋 Selected {total_selected} tasks from {selected['backlog_count']} in backlog\n\n" # 3. Create or update today's daily note note_existed = vault.daily_note_exists(datetime.combine(target_date, datetime.min.time())) if not note_existed: # Create new note with selected tasks await _create_daily_note_with_tasks(vault, target_date, selected) briefing += f"📝 Created today's daily note\n\n" else: # Note exists - could update it or leave as-is briefing += f"📝 Daily note already exists\n\n" # 4. Show selected tasks in briefing if selected["critical"]: briefing += "🎯 **CRITICAL (Do This First)**\n" for task in selected["critical"]: briefing += f" [{task['id']}] {task['title']}\n" if task.get("notes"): briefing += f" Note: {task['notes'][:100]}\n" briefing += "\n" if selected["important"]: briefing += "🔥 **IMPORTANT (Pick 1-2)**\n" for task in selected["important"]: briefing += f" [{task['id']}] {task['title']}\n" briefing += "\n" if selected["quick_wins"]: briefing += "⚡ **QUICK WINS (Energy Permitting)**\n" for task in selected["quick_wins"]: time_str = f" ({task['time_estimate']}min)" if task.get("time_estimate") else "" briefing += f" [{task['id']}] {task['title']}{time_str}\n" briefing += "\n" # 5. Get active goals for context goals_cursor = await db.execute( "SELECT goal, timeframe FROM goals WHERE status = 'active' LIMIT 3" ) goals = await goals_cursor.fetchall() if goals: briefing += "🎯 **Active Goals**\n" for goal in goals: briefing += f" - {goal['goal']} ({goal['timeframe']})\n" briefing += "\n" # 6. Add note path note_path = vault.get_daily_note_path(datetime.combine(target_date, datetime.min.time())) briefing += f"📄 Daily note: {note_path}\n\n" # 7. Motivational message current_hour = datetime.now().hour if current_hour < 12: briefing += "💪 Good morning! Start with the critical task or a quick win to build momentum.\n" - src/coach_ai/server.py:635-658 (registration)This is the MCP tool registration for start_my_day, which acts as a wrapper calling the implementation in daily_notes.py.
@mcp.tool() async def start_my_day(date_str: str = None) -> str: """Start your day with smart task selection and daily note creation. ENHANCED - Obsidian-first workflow: - Syncs yesterday's completed tasks from daily note - Intelligently selects 3-5 tasks from backlog using deterministic algorithm - Creates today's daily note with selected tasks organized by priority - Returns comprehensive briefing for the day Selection algorithm picks: - 1 critical task (deadlines or highest priority) - 1-2 important tasks (high-impact work) - 2-3 quick wins (low-effort, high-dopamine) Perfect for: "Start my day" or "What should I focus on today?" Args: date_str: Optional date in YYYY-MM-DD format (defaults to today) Returns: Daily briefing with selected tasks, goals, and motivational message """ return await daily_notes.start_my_day(date_str)