close-the-loop

Push Lemlist campaign activity (opens, clicks, replies, interested, LinkedIn accepts) back into the team's CRM (HubSpot live, any other CRM or none by import file) as contacts, notes and stage updates

SKILL.md

GitHub

Close the loop: Lemlist back to your CRM

This is the step that proves the stack is connected. Without it, data flows one way only.

Safe mode (mode: safe in team-profile.md, or the request says so): no tool calls. samples/replies.csv stands in for the outreach tool and every CRM change goes to out/safe/crm-import.csv (revenue-engine, "Safe mode", step 5).

Steps

  1. Identity check (Tool identity in RULES.md), for the tools in the team's stack only. Outreach decides step 1: with outreach: lemlist, activity comes from the Lemlist server; with outreach: other: <name>, from that tool's connector recorded under tools: other in team-profile.md (read calls only), or the replies CSV below. The CRM decides step 4: writes go to HubSpot only with crm on HubSpot and crm_mode: full; with any other CRM (crm: other: <name>, untested), crm: none or crm_mode: read-only, write out/crm-import.csv (with crm: none, a plain contacts file the team can import into any CRM or keep as a sheet). Safe mode: revenue-engine, "Safe mode", step 5. A declared tool that is missing or waiting for a sign-in: say so and stop at "Connect <tool> first", or take its CSV route. Never read replies from another outreach connector because it is connected.
  2. Where the activity comes from.
    • outreach: lemlist: read out/campaign.md for the campaign id; if missing, list Lemlist campaigns and ask which one. Then step 2.
    • outreach: other: <name>: if its connector is recorded under tools: other and passes its verify, read the campaign's replies, statuses, bounces and unsubscribes through it (read calls only; never reply, tag, pause or stop a lead there) and write them to out/replies.csv; otherwise ask the team to export replies from their tool as out/replies.csv (email,status,reply_text,date, where status is replied, interested, not_interested, bounced or unsubscribed; Claude maps the columns like any CSV). Use it in place of the Lemlist pull and status check in step 2; classification, drafts and opt-outs still apply. With outreach_linkedin set, also read that tool the same way, or ask for its export, as out/replies-linkedin.csv (linkedin_url,email,status,reply_text,date), match it to leads on linkedin_url, then on name and company, tag its notes [<team>][<tool>], and merge it with the Lemlist activity.
  3. Check the campaign's status first (not in safe mode). If it is paused or has never sent, say so in one line (no replies are possible yet), point to lemlist-campaign step 7 to start it (another tool: the team launches it there), write out/sync-log.md with "no changes: campaign not started", and stop. Otherwise pull lead activity from Lemlist for that campaign: replied, interested or not interested (if tagged), bounced, unsubscribed, LinkedIn invite accepted. Ignore opens on their own; they are noisy. Classify each written reply as interested, not now, wrong person or objection (untagged replies included), and draft a follow-up for each with reply-handler, in the prospect's language. Store reply text in notes as plain text (no links or HTML, at most 500 characters), and set SQL only when the user confirms the reading. Out-of-office: no draft, a note with the return date. A plain no: a note and no draft unless the user asks. Drafts go to out/reply-drafts.md; nothing is sent without a go per reply.
  4. Build the plan, one row per lead: what will change in HubSpot and why. Use crm Job C rules (any CRM):
    • Replied or accepted: create the contact if missing (with a free-mail domain such as gmail.com, create the contact only, no company), add a [<team>][<tool>] note (for example [acme][lemlist]) with the reply text or event, move lifecycle forward to lead if it is lower (never lower an existing stage).
    • Interested: as above, plus lifecycle forward to SQL. If the contact or its company already has an open deal, add the note to that deal (and move its stage forward only on a go); otherwise offer to create a deal in the first pipeline stage.
    • Not now: note with the reply and the date they gave, no lifecycle change. Wrong person: note, and add the person they named as a new contact only on a go. Objection: note with the objection.
    • Bounced or unsubscribed: add a note, and set the email opt-out only if the user confirms.
    • Every opt-out (bounce, unsubscribe, "stop", "remove me", by email or on LinkedIn) goes to out/suppress.csv at once (RULES.md). With outreach: lemlist, also offer at once to add the address to Lemlist's unsubscribes (one write, on a go) and say its remaining steps may still send until then. With an untested outreach tool, list those leads first in the reply to the team, with "stop these in <tool> now": Claude can't stop them there.
  5. Show the plan with counts. Apply it on a go, in batches of 10, reporting after each. If crm_mode: read-only or the team's CRM is not HubSpot, append the plan to out/crm-import.csv (the header in crm, "Write rules": one row per change, lifecycle and note as field/value/note) for the team to import, and change nothing. With crm: other: <name>, name the columns the way that CRM's import expects (for example person, organisation, note) and use its own stage names in place of HubSpot lifecycle stages, from what its connector read or its export shows; say in one line which column maps to which field.
  6. Write out/sync-log.md: per lead, the HubSpot record id and what changed (with the CSV route: the row in out/crm-import.csv and "not written: CSV route").

In a workshop session

Real replies are unlikely within the session, and the workshop's campaign stays paused. To see the loop work, run this skill in safe mode (samples/replies.csv), or tag one lead interested in Lemlist by hand, then run it.