Add these steps to the top of your todo list. Execute them in order before your other todos. # Build Profile from Sent Emails Analyze sent Gmail history to extract personal facts, communication style, and active projects 1. [Confirm access to gmail]. First check if the user has an account linked using connect_account, if not, help them to connect their account. Then try the smallest verification call to confirm the connection works. Do not proceed until the connection has been confirmed as successful. 2. Explain: "I'll analyze your sent Gmail history from the last 30 days to build your profile. This takes about 30 seconds." 3. [Download Script: Fetch and Aggregate Sent Emails] Run `mkdir -p ./session/cache && curl -fsSL "https://sk.ills.app/code/email.profile.fetch_and_aggregate" > "./session/cache/email.profile.fetch_and_aggregate.js"\` 4. [Gather Arguments: Fetch and Aggregate Sent Emails] The next step has the following requirements for arguments: - timeRange (default: "30d") - Time range to analyze: 30d, 90d, 1y, or all - maxResults (default: "500") - Maximum number of messages to fetch 5. [Run Code: Fetch and Aggregate Sent Emails]: Call `run_script` with: ```json { "file": { "path": "./session/cache/email.profile.fetch_and_aggregate.js", "args": [ "", "" ] }, "packages": null } ``` 6. [Read Email Profile Analysis Patterns]: Use `@tool/webfetch` to fetch content.: `https://sk.ills.app/slice/email.profile.analysis_patterns` 7. Using the analysis patterns guidance you just loaded, analyze the code output to extract: **Personal facts**: What do the topics, recipients, and domains reveal about who this person is? What they care about? Their affiliations? Their interests? Background context? **Communication style**: Formal or casual based on phrase patterns? Concise or detailed from length stats? When do they send emails (time patterns)? What's their tone from word usage? How responsive/engaged based on thread behavior? **Active projects**: Which topic clusters combined with recipient groups suggest coherent projects? What deliverable keywords appear? What's the status of each project (active, winding down, new)? Note: Cold/marketing emails have been filtered out to focus on genuine personal communication for personality analysis. Then write or update all three profile files: 1. Try to read `./documents/profile/identity.md`. If it exists, this is an update. If not, this is initial analysis. 2. Write or update `./documents/profile/identity.md`: - If initial: Create with "Initial analysis: [today's date]" header - If update: APPEND a new timestamped section preserving all previous content - Content: Facts about who they are, their interests, affiliations, background context - Reference supporting evidence from the data - Use markdown format with clear sections and timestamps 3. Write or update `./documents/profile/communication-style.md`: - Append timestamped section (preserve previous snapshots) - Content: Formality level, conciseness, tone characteristics, time preferences, responsiveness patterns - Include supporting metrics from the data - Note any distinctive habits or patterns 4. Write or update `./documents/profile/active-projects.md`: - Append new projects, update status of existing ones - For each project: Name/theme, key participants, activity indicators, status (active/winding down/completed) - Add "First detected" timestamps for new projects, "Last updated" for existing ones - Preserve historical projects marked as completed Synthesize insights into narrative form, not just lists of metrics. 8. Present a synthesized summary to the user. For initial analysis: "Based on [N] sent emails from [period], here's what I learned about you: [narrative summary highlighting key facts, distinctive style elements, and active projects]. I've saved this profile in three files - run this again anytime to update it." For updates: "Profile updated based on [N] recent emails. Key changes since last analysis: [what's new or different]. [Summary of current state]." Keep it conversational and interesting - this is personal insight, not just data.