# Deal hygiene

Once a week, posts the open HubSpot deals that went quiet, have no next step or are past their close date.

Requires HubSpot, through Composio. Requires Slack, through Composio. Runs on a schedule.

## Install

No one has run this against real HubSpot and Slack accounts through Composio yet. Its eval cases use stand-ins.

```sh
npx @parcha/agentrun template install github:Parcha-ai/agentrun-templates/templates/deal-hygiene@242f29da8317fbe51d0cce4628bdb5ab61d7ccc9 --trust
```

Or open `<your AgentRun address>/#/templates/install?src=github%3AParcha-ai%2Fagentrun-templates%2Ftemplates%2Fdeal-hygiene%40242f29da8317fbe51d0cce4628bdb5ab61d7ccc9`. Pinned to commit 242f29da8317fbe51d0cce4628bdb5ab61d7ccc9.

## What it does

Once a week, a Slack post listing the open HubSpot deals that need a look, biggest first. A deal is listed when it has had no activity for longer than you allow, has no next step, or is past its close date. Each line says which of the three, the amount, the stage and the owner. A deal still listed from last week is marked as such. It only reads HubSpot and posts to one channel. It posts on its own only if you pick Never for approvals at install; it stays held to your pipeline and channel either way.

- Skill `deal-hygiene`: List the open HubSpot deals in one pipeline that have gone quiet, have no next step, or are past their close date, biggest first, and post the list to Slack once a week, marking deals listed before. Reads HubSpot only; the one write is the pinned Slack post. Use for the weekly hygiene run and for "which deals need a look".

## What starts it

- On a schedule: Mondays at 09:00 (UTC), unless you pick another time when you install it.
- By hand, any time: from the console, the API or the CLI.

## Inputs

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `stale_days` | integer, 1 to 180 | no | The schedule passes your saved setting. Blank: 14. Example: `14`. |

### Setup, filled in once at install

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `pipeline_id` | string | no | The HubSpot deal pipeline to check: default for HubSpot's first pipeline, or another pipeline's ID (Settings, Objects, Deals, Pipelines) Default: `default`. |
| `channel` | string | yes | The Slack channel ID the list goes to, like C0123ABCD (in Slack: the channel's details, at the bottom). Not a #name. |
| `stale_days` | integer | no | How many days with no logged activity before a deal is listed; 14 unless you set it. Default: `14`. |
| `top_n` | integer | no | How many deals the post lists at most, biggest first; the rest are counted; 10 unless you set it. Default: `10`. |
| `currency` | string | no | Your HubSpot account's currency, used only to write amounts ($, €); nothing is converted. Default: `usd`. |
| `cron` | string, cron | no | When the list runs, as a cron line (minute hour day-of-month month day-of-week): Monday 09:00 unless you set it. Default: `0 9 * * 1`. |
| `timezone` | string, timezone | no | The IANA time zone the cron line and the dates are read in (Europe/Madrid, America/New\_York): UTC unless you set it. Default: `UTC`. |

## What it needs

- Harness: pi, claude-agent, codex
- Model: balanced tier, low effort
- Tools: read
- Composio HubSpot tools: HUBSPOT_SEARCH_DEALS, HUBSPOT_RETRIEVE_PIPELINE_STAGES, HUBSPOT_RETRIEVE_OWNERS. Reads your deals, the stages of the pipeline you set and your deal owners' names, to find deals that need a look. It reads only: no deal, task or owner is changed.
- Composio Slack tools: SLACK_SEND_MESSAGE. Posts the weekly list to the one Slack channel you set, and nowhere else.
- Computer: Wherever your AgentRun puts a new agent
- Keys: A model key
- Learning: on

## Sample output

Input:

```json
{
  "content": "Scheduled run. List this week's open deals that need a look with your deal-hygiene skill and post it.",
  "stale_days": 14
}
```

Output:

Illustrative output, written by hand from the `flags-and-ranks` eval case's test account. A measured eval run replaces
it.

Five of six open deals need a look this week. Initech leads the list: $120,000, quiet for 27 days, no next step, and
its close date passed two weeks ago. Globex, the biggest deal, is fine and stays off the list. Soylent has no amount,
so it goes last whatever its flags say.

> :broom: *Deal hygiene, 2026-11-16*: 5 of 6 open deals need a look.
> 1. *Initech platform* ($120,000, Presentation scheduled, Omar Haddad): no activity in 27 days, no next step, close
>    date 2026-10-31 passed.
> 2. *Umbrella renewal* ($95,000, Decision maker bought-in, Dana Reyes): no activity in 22 days.
> 3. *Hooli pilot* ($60,500, Qualified to buy, Omar Haddad): close date 2026-11-10 passed.
> 4. *Vandelay imports* ($50,000, Appointment scheduled, Dana Reyes): no next step.
> 5. *Soylent intro* (no amount, Appointment scheduled, Omar Haddad): no activity logged, no next step.

## Tested

Passes 4 of 4 eval cases on pi, 4 of 4 on Claude Code and 4 of 4 on Codex.

4 eval cases: all-clean, flags-and-ranks, injection-in-next-step, no-repeats.

## Source

- Package: https://github.com/Parcha-ai/agentrun-templates/tree/242f29da8317fbe51d0cce4628bdb5ab61d7ccc9/templates/deal-hygiene
- Publisher: Parcha-ai
- Author: Parcha Labs
- Version: 0.1.0
- License: Apache-2.0
- Category: Sales
- Page: https://marketplace.agentrun.ai/templates/deal-hygiene/
