Pipeline hygiene
@revopslab/pipeline-hygiene
Check open deals in a CRM export (HubSpot, Salesforce, or any CSV) for past close dates, deals stuck in a stage, no recent activity, missing required fields (also by stage), zero amounts, and close dates too far out. Writes a hygiene score and a fix list per rep you can send out.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1---
- 2name: pipeline-hygiene
- 3description: Audit open deals in a CRM export (HubSpot, Salesforce, Pipedrive, or any CSV) for hygiene problems, such as close dates in the past, deals stuck in a stage, no recent activity, missing required fields (including fields required only at later stages), zero amounts, and close dates too far out. Produces a hygiene score, counts by rep, and a fix list to send to each rep. Use when the user says "clean up the pipeline", "which deals have past close dates", "pipeline hygiene check", "what do reps need to update before the forecast call", or "find stale deals".
- 4license: MIT
- 5---
- 7# Pipeline hygiene
- 9Finds the deals whose CRM data cannot be trusted yet and tells each rep exactly what to fix. Run it the day before a forecast call so the forecast is built on clean data.
- 11## When to use
- 13- Weekly, before forecast or deal reviews.
- 14- After a reorg or territory change, to catch ownerless deals.
- 15- Not for judging deal quality (use deal-review-prep for MEDDICC), and not for editing the CRM.
- 17## Inputs
- 191. **Open opportunities export** at `data/opportunities.csv`. Closed stages are skipped automatically. Columns are matched by common names:
- 20 - Needed: ID and stage.
- 21 - Used when present: name, owner, amount, close date, next step, stage entered date (or days in stage), last activity date, plus any column named in your required fields.
- 22 - Salesforce: an Opportunities report with Stage Duration and Last Activity. HubSpot: a deals view export with "Date entered current stage" and "Last activity date".
- 23 - Other names: `--map field=Column Name` (fields: `id`, `name`, `owner`, `amount`, `close_date`, `stage`, `next_step`, `stage_entered`, `stage_days`, `last_activity`).
- 242. **Rules** (optional) at `data/hygiene.json`, see the kit's `examples/hygiene.json`: `stale_days` (30), `activity_days` (14), `far_future_days` (365), `required` fields, `required_by_stage` (stage name to extra fields, using column names as they appear in the export), and `closed_stages`.
- 26Ask the user what "stale" means for their sales cycle the first time. A 30 day default is wrong for a 9 month enterprise cycle.
- 28## Steps
- 301. Confirm the export and the rules. If there is no rules file, run with defaults and say which ones.
- 312. Run:
- 33 ```bash
- 34 node scripts/hygiene.mjs data/opportunities.csv --config data/hygiene.json --out out --name hygiene
- 35 ```
- 373. Read `out/hygiene.json`. Mention `checks_skipped` (missing columns) so the user knows what was not checked.
- 384. Report the score, the top issue types, and the reps with the most deals to fix.
- 395. Offer per-rep messages: one short note per rep listing their deals and what to update, drafted from `out/hygiene-fix-list.csv`. Draft only; the user sends them.
- 41## Output to the user
- 43```markdown
- 44**Pipeline hygiene 2026-11-04: 20% clean** (1 of 5 open deals).
- 46| Issue | Deals |
- 47| --- | ---: |
- 48| Stuck in stage over 30 days | 2 |
- 49| Missing required fields | 2 |
- 50| Close date in the past | 1 |
- 52Biggest fix: Contoso Robotics ($120,000, Rep B): close date passed 4 days ago, 81 days in Proposal, no activity in 23 days, no next step.
- 531 deal has no owner (Adventure Works, $30,000).
- 54Fix list: out/hygiene-fix-list.csv
- 55```
- 57## Guardrails
- 59- Read-only. Never update the CRM, even if a fix is obvious. List it as a suggested edit.
- 60- Do not guess a close date or amount for a deal. The rep owns those.
- 61- Keep messages to reps factual and short. No public shaming lists unless the user asks for a team view.
