Terminal
Terminal/Skill
Ranks the people engaging with your team's LinkedIn posts, after removing your own staff and company pages, by how hard they leaned in.
By Clay
Works with
npx skills add clay-run/clay-skill-creator --skill inbound-triggers-monitorThe insight: this is a ranking problem wearing a detection problem's clothes. Every other monitor asks "did the event happen?" — the event either fired or it didn't. Here the platform hands you a truncated, self-contaminated top-N sample of the people who engaged, and three things follow that the naive build gets wrong:
So the output is never "here are the people who engaged." It is "here is who we can see, after suppression, ranked by how hard they leaned in — and here is where the sample was cut off."
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 |
|---|---|---|
| Whose posts | person profile URLs whose content draws their buyers | no default. The first stage takes a person profile; whether a company page is accepted is unverified, so if that is all they have, say so, try it, and report what came back |
| Window and depth | how far back, and how many posts per profile | ten posts is the default and twenty-five is the ceiling. There is no date filter, so the window is enforced when reading timestamps, not by the call |
| Which interaction types | reactions, comments, shares | all three is defensible and must be stated. Comments are the strongest signal and the most capped |
| The suppression set | their own domains and company pages, their employees, plus partners, agencies and investors | ask — this is non-negotiable. Without it the play degrades into people who engage structurally rather than out of interest |
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 they're in.
Confirm the arm exists before promising it — never assume the catalog:
clay workflows actions list | grep social-posts
Expect seven actions. The three this play runs, and their exact limits, are in
references/interaction-mechanics.md. Two traps worth naming here:
get-post-details is a Hacker News scraper despite the generic name. It is not part
of this play. Name-matching the catalog is how you end up calling it.activity-* family answers "what did this profile do"; the interaction-* family
answers "who engaged with this post". This play is interaction-* downstream of one
activity-* call. They are easy to swap and the swap silently inverts the question.socialUrl, e.g. linkedin.com/in/…). Whether a company page URL is accepted is
unverified here — if the user only has a company page, say that plainly, try it, and
report what came back rather than assuming either way.posted_at, not by the action).Every action in this family costs 0.5 credits per call (Clay Credits, declared in the catalog). The arithmetic, stated before spending:
stage 1: 0.5 × (number of monitored profiles)
stage 2: 0.5 × (number of posts in window) × (number of interaction types)
Worked: 3 profiles, 10 posts each in the window, all three interaction types →
0.5×3 + 0.5×30×3 = 46.5 credits. Identity resolution in step 7 is priced separately and
only for rows that survive the gate — which is the whole reason the gate runs first.
Give the number, get a yes, then spend. If the user wants a cheaper first pass: comments
only (0.5 × posts), which is also the highest-intent subset.
Per monitored profile, social-posts-get-post-activity-posts-and-shares with socialUrl
and maxActivitiesLimit set explicitly (max 25). Keep for each post: the canonical
post URL, its posted date, and whose profile it came from.
Then apply the window yourself, on posted_at. Drop anything older. Report how many posts
each profile contributed — a profile that posted twice this month contributes two posts,
and the digest should not look thin without saying why.
Per post, per chosen type:
| Action | Input | Cap | Default if unset |
|---|---|---|---|
social-posts-get-post-interaction-reactions | postUrl | 50 | 10 |
social-posts-get-post-interaction-comments | postUrl | 10 | 10 |
social-posts-get-post-interaction-shares | postUrl | 10 | 10 |
Always pass maxInteractionsLimit explicitly, at the cap. Leaving it unset silently
takes 10 reactions out of a possible 50 — a 5× recall loss that looks identical to a quiet
post in the output.
Record per post: how many interactions came back per type, and whether that number equals the cap. A post at the cap is definitely truncated, and step 9 has to say so.
But below the cap does not mean complete — verified on a live call: a request for 50 reactions on a well-engaged post returned 48. The provider returns what it can reach, not what exists, so a short return is unexplained, not reassuring. Cap-equality is sufficient evidence of truncation and never necessary. Report the requested limit and the returned count side by side and let the reader see the gap; do not convert either into a completeness claim.
Each returned interaction carries author.name, author.url, author.type, author.title
(the person's headline — present in the live payload but absent from the catalog's declared
outputs, so treat it as a bonus that may vanish, never as a required field),
interaction_type, reaction, and preview_text.
preview_text is not content. On a reaction it is a synthesized label of the form
"<Reaction> by <name>" — it restates two fields you already have and carries nothing new.
Only a comment's preview_text is the person's own words. Quoting a reaction's preview_text
as evidence of what someone said is fabrication with a real field name attached.
Canonicalize the interactor URL before it is used for anything: strip the query string, strip the trailing slash, lowercase. The same person arrives with tracking parameters on one post and bare on another, and un-canonicalized URLs make one human look like three.
Then build the interaction key:
interaction_key = clean_profile_url | interaction_type | canonical_post_url
That composite is what makes re-running the play idempotent: the same interaction on the
same post is the same key, so a weekly run adds new interactions instead of duplicating
old ones. Key on the person, not the interaction, when you aggregate in step 8 —
interaction_key is for deduplication, not for grain.
Four rules, evaluated in this order, stopping at the first match. A row can satisfy two rules at once — a partner's company page is both rule 1 and rule 3 — so first match wins and every dropped row is attributed to exactly one rule. Without that, the per-rule counts are not reproducible, and counts nobody can reproduce are counts nobody can act on. Every dropped row is counted and reported by rule: a silent gate is indistinguishable from a gate that isn't running.
author.type indicates a company/organization page. Where
author.type is missing or unrecognized, fall back to the URL shape: a /in/ path is a
person, a /company/ path is not. Two independent tests because author.type is a
provider field and provider fields go missing.existing_relationship, and never enter the new-lead route.A row that survives all four is a candidate. Nothing has been enriched yet.
For each surviving candidate, resolve the profile to a person and their current employer, then the employer to a canonical domain. Two consequences to handle honestly:
account: unresolved and the
profile URL intact. A named human who engaged twice is actionable even without a domain,
and dropping them hides the strongest signals behind an enrichment failure.Group interactions by clean_profile_url. Score each person by summing the weight of
their distinct (post, interaction_type) pairs — the same person reacting to the same
post twice counts once:
| Interaction | Weight |
|---|---|
| Comment | 3 |
| Share | 2 |
| Reaction | 1 |
intensity = Σ weights over distinct (post, interaction_type) pairs
| Intensity | Tier |
|---|---|
| ≥ 5 | hot |
| 3 – 4 | warm |
| 1 – 2 | watch |
The bands are exhaustive and non-overlapping over the integers the weights can produce, and
the minimum possible score for a surviving row is 1, so every candidate lands in exactly
one tier. A single comment (3) is warm; a comment plus any two other interactions (≥5) is
hot; one reaction is watch. Roll the same interactions up to the account grain by
summing person intensities within a resolved domain, and report both grains — a single hot
person and four watch people from the same account are different situations.
Per person: name · clean profile URL · resolved title and account (or unresolved) ·
intensity and tier · the distinct interactions with dates · the comment text where there
is one · existing_relationship where it applies. Per account: summed intensity, the
people, the tier mix.
Then the part that makes the digest honest, and it is not optional:
"4 of 11 posts returned the maximum 50 reactions; the engager list for those posts is incomplete."0 with the reason. Never pad a digest by widening the window without saying you
widened it, and never re-report last week's people as this week's triggers.Hand the surviving rows to score-inbound-leads for scoring and routing. This play detects
and ranks; it does not score against an ICP, write outreach, or push to a CRM.
maxInteractionsLimit and maxActivitiesLimit explicitly; NEVER rely on the
default 10, and never report a capped list without saying it was capped.author.type AND on URL shape; NEVER treat a missing
provider field as "person".Three monitored profiles: a founder and two AEs. The window is 14 days;
maxActivitiesLimit: 25 returns 6, 3 and 2 posts respectively, of which 8 fall inside the
window. All three interaction types → 0.5×3 + 0.5×8×3 = 13.5 credits, approved.
Reactions come back at 50 on two of the eight posts — both flagged capped. 214 raw
interactions collapse to 96 distinct (person, post, type) triples after canonicalization,
which is the first sign the URLs needed cleaning: 31 of those collapses were the same
people arriving with tracking parameters.
The gate drops 22 company pages (rule 1), 19 employees (rule 2, from the roster), and 4
agency accounts (rule 3) — 45 rows, reported by rule. Two customers are labelled, not
dropped. 49 candidates go to resolution; 41 resolve, 8 stay unresolved with their profile
URLs.
Ranking puts one person at intensity 8 — a comment on the founder's post (3), reactions to
three others (1+1+1), and a reshare (2) — and the digest shows that sum term by term rather
than asserting the total, because a tier nobody can recompute is a tier nobody trusts. One
account contributes
three watch people and no comments: interesting, but not the same as the single hot
commenter, and the account grain says so. The delivered digest leads with the two capped
posts, because the person who matters most may be in the 350 reactions nobody can see.