channel-truth-run
Automatic channel and contact synchronization
What this skill does
# Channel Truth Run > Runs the Channel Truth Agent to synchronize last_contact timestamps ## When to use - "run channel truth" - "update last contact dates" - "synchronize contact dates" - "run channel truth agent" ## What it does Channel Truth Agent: 1. Loads all activities from `activities.csv` 2. Finds the most recent communication for each contact 3. (Optionally) Scans channels (Email, Telegram, WhatsApp, LinkedIn) 4. Merges data and resolves conflicts 5. Updates `people.csv`, `leads.csv`, `clients.csv` with current dates 6. Generates a report (stale/hot contacts) 7. Sends summary to Telegram ## How to execute ### Run modes ```bash # Full run (default) cd $AGENTS_PATH/channel-truth python3 channel_truth_agent.py # Dry-run (read only, no writes) python3 channel_truth_agent.py --dry-run # Single contact (for debugging) python3 channel_truth_agent.py --person-id=p-acme-001 # Without channel scanning (activities.csv only) python3 channel_truth_agent.py --no-channels ``` ### Pre-run checks ```bash # Check if activities.csv exists ls -lh $CRM_PATH/activities.csv # Check people.csv ls -lh $CRM_PATH/contacts/people.csv # Dry-run test python3 channel_truth_agent.py --dry-run ``` ### After run ```bash # View report ls -lt $AGENTS_PATH/reports/channel_truth_*.md | head -1 # View latest report cat $(ls -t $AGENTS_PATH/reports/channel_truth_*.md | head -1) # View logs tail -20 $AGENTS_PATH/logs/channel_truth.json ``` ## Output 1. **Updated CSV files:** - `people.csv` - added `last_contact` and `last_updated` - `leads.csv` - added `last_contact_via_primary` - `clients.csv` - added `last_contact_via_primary` 2. **Report:** - `$AGENTS_PATH/reports/channel_truth_YYYY-MM-DD.md` 3. **Backup files:** - `people.csv.bak.TIMESTAMP` - `leads.csv.bak.TIMESTAMP` - `clients.csv.bak.TIMESTAMP` 4. **Telegram notification:** - Summary: how many updated, hot/stale contacts ## Rollback If something went wrong: ```bash # Rollback via backup cd $CRM_PATH/contacts/ ls -lt people.csv.bak.* | head -1 cp people.csv.bak.YYYYMMDD_HHMMSS people.csv cd ../relationships/ cp leads.csv.bak.YYYYMMDD_HHMMSS leads.csv cp clients.csv.bak.YYYYMMDD_HHMMSS clients.csv # Or via git cd $PROJECT_ROOT git log --oneline sales/crm/ git revert <commit-hash> ``` ## Schedule Agent runs automatically via launchd: - **Time**: 02:00 daily (after email agent) - **Plist**: `~/Library/LaunchAgents/com.yourcompany.channel-truth-agent.plist` ```bash # Check status launchctl list | grep channel-truth # Reload launchctl unload ~/Library/LaunchAgents/com.yourcompany.channel-truth-agent.plist launchctl load ~/Library/LaunchAgents/com.yourcompany.channel-truth-agent.plist ``` ## Troubleshooting ### "activities.csv not found" ```bash # Check path ls -l $CRM_PATH/activities.csv # If missing - create a basic one echo "activity_id,person_id,company_id,product_id,type,channel,direction,subject,notes,date,created_by" > activities.csv ``` ### "Telegram notification failed" ```bash # Check Telegram credentials ls -l $SALES_PATH/telegram/sessions/ # Test tg-tools cd $TG_TOOLS_PATH python3 -c "from tg_utils.auth import get_client; import asyncio; asyncio.run(get_client())" ``` ### "Channel API failure" ```bash # Skip channel scanning python3 channel_truth_agent.py --no-channels ``` ## Related skills - `log-activity` - logs activities in activities.csv - `git-workflow` - for committing changes (if needed) - `telegram-send` - for manually sending messages ## Usage example ```bash # User: "run channel truth in dry-run" cd $AGENTS_PATH/channel-truth python3 channel_truth_agent.py --dry-run # View what will be changed cat /tmp/channel-truth-output.txt # If everything is ok - run for real python3 channel_truth_agent.py # View report cat $(ls -t $AGENTS_PATH/reports/channel_truth_*.md | head -1) ``` ## Notes - Agent is idempotent (can be run multiple times) - Always backs up before modifying CSV - If a channel is unavailable - skips with warning - activities.csv - primary source of truth - Channel archives - supplementary (for verification)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.