Terminal
Terminal/Skill
Checks a contact list or CRM export against current data, refreshes changed fields, and replaces people who have left, with evidence for each row.
By Clay
Works with
npx skills add clay-run/clay-skill-creator --skill clean-and-refresh-contact-dataThe insight: staleness is a state question, not a time question — and a stale record is two different problems wearing one flag. "Rerun anything older than 90 days" re-buys data that hasn't changed and trusts data that has; the honest test is comparing what the record CLAIMS against what enrichment shows NOW. And when they disagree, the fork matters: same person, drifted data → REFRESH the fields; person gone → the record is beyond refresh — REPLACE the contact at the account (or retire it), per a policy the user chose. Collapsing those two into "update the row" is how CRMs fill with emails for people who left in 2024.
Nothing here ships with a value. Each one is the installer's, not the author's: ask for it, never substitute a plausible default, and where an answer does not exist say which step becomes unavailable rather than guessing. Where a default IS defensible it is named below, and using it means saying so in the output.
| Input | What the installer supplies | If it is missing |
|---|---|---|
| The list | a CSV or CRM export; per row, ideally name plus company or domain plus email plus profile URL | any subset works — more identifiers make verification cheaper, none makes it impossible |
| Which fields matter | employment and title, email deliverability, phone | ask. Every field verified is spend, so verify only what they act on |
| Replacement policy | for a departed contact: replace with a same-function equivalent, flag only, or retire | ask before finding the first mover — replacement costs a search plus verification per attempt |
| CRM overwrite policy | which fields may be overwritten, and which are never touched | this skill delivers a table and a change-log; writing back is their move, and the rules ship with the delivery |
| Cost ceiling and loop cap | credits, and how many replacement attempts | state per-row verification cost and the cap, then wait |
If an answer sheet is present beside this skill, load it and ask only for what it does not cover. A partial sheet is normal; a value it is missing gets asked for on its own rather than restarting the interview. Say which values came from the sheet before using them — a sheet applied silently is a wrong field nobody catches. If there is no sheet, say nothing about sheets — the check is a file lookup, not a question, so run the interview as though the feature did not exist rather than reporting an absence. At delivery, offer to save the answers back (identifiers only — never a token or a password), private and never published — and phrase the offer so it explains itself: "want me to save your answers to a file, so the next person on your team doesn't have to answer these again?"
Run clay whoami; echo "exit_code=$?". If it fails or Clay tools are missing, run
the Clay plugin's setup skill, restart if it says to, and re-run this skill. Tell
the user which workspace you're in. Confirm the person-enrichment arm live and read
declared costs (references/refresh-mechanics.md — surfaces drift per workspace).
Name what you will spend on, before you quote it:
clay routines list --limit 100 # the managed functions this workspace has
clay routines get <routineId> # its declared cost — the list call omits costs
clay search filters-mode fields --source-type people # free; the re-source arm's real fields
The search arm spends result quota, not credits, and the two are separate currencies. A quote naming only credits reports the re-sourcing half as free.
Per unique contact (dedupe on the strongest identifier first — LinkedIn URL beats email beats name+company):
multi-role is a flag, never "departed".current-confirmed (employer matches, title may have
drifted) · changed (same account, new title/details) · departed (employment
moved) · unverifiable (enrichment empty — an honest state; absence of evidence
never counts as departed).For current-confirmed and changed rows, per field:
unverified, never valid; a
role-address never ships as a person's email. Absent validation FLAGS, never
gates a row out.Per the Step-1 policy, for each departed row: source a same-account replacement
matching the lost contact's function × seniority (role-scoped search on the account
domain — quota, not credits), verify the candidate's employment the same way, and
cap the loop (max 2 replacement attempts per seat; a seat with no valid
replacement reports unfilled, never cycles). The mover themself is
track-champion-job-changes territory — emit them as a FOLLOW lead, don't chase them
here.
Refreshed table: per contact identity · verdict (current-confirmed / changed / departed→replaced / departed→unfilled / retired / unverifiable) · refreshed fields (old → new, per the gates) · email status · flags (multi-role, conflict, unverified) · evidence (what the enrichment showed, dated). Plus the change-log
(every overwrite, with before/after), the movers list (FOLLOW leads), and the
funnel: contacts in, verified, refreshed, replaced, unfilled, unverifiable, credits
measured vs declared. Every input row lands somewhere.
unverifiable — never as departed.Ask: "Refresh our 80-contact target list before the Q4 push — emails and titles."
Policy: replace departed with same-function/seniority; cap 2. Dedupe: 80 → 77
unique. Verification: 61 current-confirmed (9 with title drift → titles refreshed),
6 departed, 10 unverifiable (flagged). Refresh gates: 34 fields fetched (missing or
contradicted only), 31 overwrites (3 conflicts flagged: enrichment title vs a newer
CSV note) — zero empty-over-value events in the change-log. Email pass on the 70
kept: 58 valid, 7 catch-all → unverified flag, 5 invalid → re-find queued. The 6
departed: 5 replaced with verified same-account equivalents, 1 unfilled after 2
attempts; all 6 movers delivered as FOLLOW leads. Funnel + change-log + ~70 credits
measured vs declared.