Step 1 — Pull every open deal (read-only)
Pull all open deals: current stage, amount, close date, next step field, and
how long the deal has sat in its current stage (time-in-stage). Read-only —
no field on the deal is changed in this step.
Step 2 — Pull activities per deal (read-only)
Pull logged calls, emails, meetings, and notes per deal, with timestamps.
This is the basis for the staleness check in Step 4.
Step 3 — Pull tasks per deal (read-only)
Pull open tasks tied to each deal, with due dates. A task past its due date
with no completion is overdue.
Step 4 — Apply the four hygiene rules
Evaluate every open deal against all four independently — a deal can trip
more than one:
| Rule |
Trip condition |
| Stale |
No logged activity (call, email, meeting, note) in the last {{stale_days}} days |
| Incomplete |
Missing next step, missing close date, or both |
| Stalled |
No stage change in the last {{stall_days}} days |
| Overdue task |
At least one open task past its due date |
Step 5 — Write the hygiene flag (the only write)
For every deal that trips at least one rule, write the internal hygiene-flag
field on the deal noting which rule(s) tripped and the date. This is the
only field the agent ever writes — never the stage, the owner, or the
amount. Deals that trip no rule get their flag cleared if previously set.
Step 6 — Nudge the owning rep in Slack
For each flagged deal, send the owning rep a Slack nudge naming the deal,
which rule(s) tripped, and the concrete action needed:
| Rule tripped |
Nudge action |
| Stale |
Log the last touchpoint or make contact today |
| Incomplete |
Set the missing next step and/or close date |
| Stalled |
Move the deal forward or note why it hasn't |
| Overdue task |
Complete or reschedule the task |
Group multiple flagged deals for the same rep into one message rather than
one message per deal.
Step 7 — Escalate the day's worst to {{escalation_channel}}
After all rep nudges are sent, rank flagged deals by:
- Number of rules tripped at once (most rules first).
- Deal amount at risk (largest first, as a tiebreaker).
- Days since last activity (longest first, as a second tiebreaker).
Post the top offenders to {{escalation_channel}} in one message: deal name,
owning rep, amount, which rules tripped, and days since last activity. Post
exactly once per run.
1---2name: pipeline-hygiene-rules3description: Daily HubSpot pipeline-hygiene rules — staleness, missing next step/close date, stage stalls, and overdue tasks — plus how to nudge the owning rep in Slack and escalate the day's worst offenders to the sales manager. The only write is an internal hygiene flag; stage, owner, and amount are never touched.4---56<skill name="pipeline-hygiene-rules">78<overview>9Turn four hygiene checks into a same-day nudge instead of a finding buried in10next week's pipeline review. A daily cron spawns a fresh session with11read-mostly access to HubSpot; this skill pulls every open deal, scores it12against the four rules, nudges the owning rep in Slack, and escalates the13day's worst offenders to the sales manager. Every run recomputes from14HubSpot's current state — there is no carryover between days.15</overview>1617<when-to-load>18- The daily cron fires the pipeline-hygiene scan.19- A human asks the agent to check pipeline hygiene or explain why a specific20 deal was flagged.21</when-to-load>2223<workflow>2425## Step 1 — Pull every open deal (read-only)2627Pull all open deals: current stage, amount, close date, next step field, and28how long the deal has sat in its current stage (time-in-stage). Read-only —29no field on the deal is changed in this step.3031## Step 2 — Pull activities per deal (read-only)3233Pull logged calls, emails, meetings, and notes per deal, with timestamps.34This is the basis for the staleness check in Step 4.3536## Step 3 — Pull tasks per deal (read-only)3738Pull open tasks tied to each deal, with due dates. A task past its due date39with no completion is overdue.4041## Step 4 — Apply the four hygiene rules4243Evaluate every open deal against all four independently — a deal can trip44more than one:4546| Rule | Trip condition |47|---|---|48| Stale | No logged activity (call, email, meeting, note) in the last {{stale_days}} days |49| Incomplete | Missing next step, missing close date, or both |50| Stalled | No stage change in the last {{stall_days}} days |51| Overdue task | At least one open task past its due date |5253## Step 5 — Write the hygiene flag (the only write)5455For every deal that trips at least one rule, write the internal hygiene-flag56field on the deal noting which rule(s) tripped and the date. This is the57**only** field the agent ever writes — never the stage, the owner, or the58amount. Deals that trip no rule get their flag cleared if previously set.5960## Step 6 — Nudge the owning rep in Slack6162For each flagged deal, send the owning rep a Slack nudge naming the deal,63which rule(s) tripped, and the concrete action needed:6465| Rule tripped | Nudge action |66|---|---|67| Stale | Log the last touchpoint or make contact today |68| Incomplete | Set the missing next step and/or close date |69| Stalled | Move the deal forward or note why it hasn't |70| Overdue task | Complete or reschedule the task |7172Group multiple flagged deals for the same rep into one message rather than73one message per deal.7475## Step 7 — Escalate the day's worst to {{escalation_channel}}7677After all rep nudges are sent, rank flagged deals by:78791. Number of rules tripped at once (most rules first).802. Deal amount at risk (largest first, as a tiebreaker).813. Days since last activity (longest first, as a second tiebreaker).8283Post the top offenders to {{escalation_channel}} in one message: deal name,84owning rep, amount, which rules tripped, and days since last activity. Post85exactly once per run.8687</workflow>8889<guardrails>90- **Read-mostly.** Deals, stage history, activities, and tasks are read-only.91 The only write to HubSpot is the internal hygiene flag on the deal — never92 the stage, never the owner, never the amount.93- **No memory between runs.** Each run is a fresh session; recompute every94 deal's hygiene status from HubSpot's current state rather than assuming95 yesterday's flags still hold.96- **Nudge and flag only.** The agent's output is a Slack nudge, a Slack97 escalation, and the hygiene flag write — it never logs an activity, sets a98 next step, or clears a task on the rep's behalf.99- **Scoped secrets.** HubSpot access is brokered server-side through the100 connector; no raw token is ever shown to the model or written to logs.101- **People decide, not the agent.** The rep and the sales manager decide102 whether to move a deal, reassign it, or adjust its amount — the agent only103 reports and reminds.104</guardrails>105106</skill>