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.claude/skills/close-the-loop/SKILL.md
GitHubClose 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
- Identity check (Tool identity in
RULES.md), for the tools in the team's stack only. Outreach decides step 1: withoutreach: lemlist, activity comes from the Lemlist server; withoutreach: other: <name>, from that tool's connector recorded undertools: otherinteam-profile.md(read calls only), or the replies CSV below. The CRM decides step 4: writes go to HubSpot only withcrmon HubSpot andcrm_mode: full; with any other CRM (crm: other: <name>, untested),crm: noneorcrm_mode: read-only, writeout/crm-import.csv(withcrm: 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. - Where the activity comes from.
outreach: lemlist: readout/campaign.mdfor the campaign id; if missing, list Lemlist campaigns and ask which one. Then step 2.outreach: other: <name>: if its connector is recorded undertools: otherand 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 toout/replies.csv; otherwise ask the team to export replies from their tool asout/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. Withoutreach_linkedinset, also read that tool the same way, or ask for its export, asout/replies-linkedin.csv(linkedin_url,email,status,reply_text,date), match it to leads onlinkedin_url, then on name and company, tag its notes[<team>][<tool>], and merge it with the Lemlist activity.
- 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-campaignstep 7 to start it (another tool: the team launches it there), writeout/sync-log.mdwith "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 withreply-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 toout/reply-drafts.md; nothing is sent without a go per reply. - Build the plan, one row per lead: what will change in HubSpot and why. Use
crmJob 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.csvat once (RULES.md). Withoutreach: 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.
- 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
- Show the plan with counts. Apply it on a go, in batches of 10, reporting after each. If
crm_mode: read-onlyor the team's CRM is not HubSpot, append the plan toout/crm-import.csv(the header incrm, "Write rules": one row per change, lifecycle and note asfield/value/note) for the team to import, and change nothing. Withcrm: 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. - Write
out/sync-log.md: per lead, the HubSpot record id and what changed (with the CSV route: the row inout/crm-import.csvand "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.