mail-messages-contact-touches
Skill1 starsChanged 17 days agoMITView on GitHub
Use this skill on a Mac when your CRM or contact sheet doesn't know who you last emailed or texted. Produces dated touch records (date, contact, channel, direction, email subject) from Apple Mail and Messages, without storing message bodies. "Log my emails and texts to the CRM", "when did I last talk to them", "backfill contact history".
In this repository67 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- morning-paper-outreachSkill
- client-activation-checkinSkill
- client-churn-autopsySkill
- client-win-backSkill
- late-payment-chaseSkill
- network-path-mappingSkill
- rate-increase-planSkill
- sales-call-debriefSkill
- weekly-funnel-reviewSkill
- buyer-readSkill
- punch-upSkill
- call-topic-miningSkill
- ceo-exec-assistantSkill
- og-image-from-templateSkill
- weekly-site-and-ad-reportSkill
- icp-reviewSkill
- weekly-content-ideas-from-callsSkill
- client-performance-reviewSkill
- cold-email-sequenceSkill
- email-content-reviewerSkill
- scoring-analysis-and-distributionSkill
- delivery-audit-discovery-callSkill
- directionSkill
- rundownSkill
- source-checkSkill
- work-reviewSkill
- demandbird-exact-time-linkedin-postSkill
- kondo-owed-reply-sweepSkill
- linkedin-export-contact-importSkill
- riverside-short-social-scheduleSkill
- youtube-transcript-panel-pullSkill
- email-voice-setupSkill
- upsell-opportunity-briefSkill
- ad-creative-content-strategySkill
- klaviyo-account-auditSkill
- facilitator-notesSkill
- local-prospectingSkill
- weekly-linkedin-postsSkill
- linkedin-watchlist-briefSkill
- pipeline-by-scriptSkill
- pre-session-flash-cardSkill
- write-in-the-owners-voiceSkill
- reddit-gtm-sprintSkill
- process-captureSkill
- sales-call-market-analyzerSkill
- linkedin-shoutout-postSkill
- plain-language-copy-checkSkill
- revenue-goal-funnel-mathSkill
- case-study-buildSkill
- cash-runway-forecastSkill
- client-profitability-readSkill
- client-proposalSkill
- content-briefSkill
- quarter-goal-filterSkill
- win-to-anglesSkill
- activity-incentive-sprintSkill
- candidate-interview-coachSkill
- client-list-stack-pitchSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Start with an 8-day window.
- Distinctive: line 40
MUST open both databases read-only, and never copy them out of the machine.
- Distinctive: line 41
MUST store subjects at most, never message bodies or attachments.
- Distinctive: line 42
MUST dry-run and get approval before writing to the CRM.
- Distinctive: line 43
NEVER guess between two contacts that share an email or number.
- Distinctive: line 44
NEVER report an empty result when Full Disk Access was refused.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Applies when relationship history lives in your inbox and phone, not your CRM. Produces one dated touch per real one-to-one email or text, matched to a contact, ready to append.
Runs locally on a Mac. Both databases are opened read-only; raw records stay on the machine, and only the derived fields reach the CRM.
The play
- Build an index from your contact list: lowercase emails, and phones reduced to digits.
- Open
~/Library/Messages/chat.dband the newest~/Library/Mail/V*/MailData/Envelope Indexas read-only SQLite (file:...?mode=ro). The terminal or interpreter needs Full Disk Access. If the open fails, stop and say so; don't report "no touches". - Texts: skip reactions, convert Apple's nanosecond dates, and match the handle. Group chats are context, never a direct touch.
- Email: read sender, To and Cc, date, subject and mailbox. Skip drafts, spam, trash, junk and bulk mail. It is outbound only when the From address is one of yours.
- Match: exact email, or exact phone; fall back to the last 10 digits only for North American numbers. Anything matching more than one contact is skipped and counted, not guessed.
- Emit date, contact, channel, direction, a summary (the email subject, or just "text message") and a source ID.
- Dry run first and show the counts by channel. Write only after the human approves. De-duplicate on the source ID so a re-run adds nothing.
- Start with an 8-day window. Backfill full history once, on purpose.
The field-level traps (Mail's automated flag, RCS sends, To versus Cc) are in references/apple-data-traps.md. Read it before writing the query, and check the flag meanings against a few messages you know before importing.
What good looks like
- First check: your own sent mail shows up as outbound. If it doesn't, the automated-mail filter is eating it.
- The mediocre version treats every group text and Cc as a conversation, and the CRM fills with "touches" from threads where you were one of twelve.
- The output is right when a contact you emailed yesterday shows yesterday, a backfill is spot-checked against the inbox for five contacts, and a second run adds zero rows.
Rules
- MUST open both databases read-only, and never copy them out of the machine.
- MUST store subjects at most, never message bodies or attachments.
- MUST dry-run and get approval before writing to the CRM.
- NEVER guess between two contacts that share an email or number.
- NEVER report an empty result when Full Disk Access was refused.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

