cleanup-deals
About
This skill standardizes HubSpot deal pipelines by removing test deals and fixing records with missing amounts or close dates. It includes safeguards for coordinating with Salesforce sync to prevent unintended data changes. Use it for ongoing maintenance to ensure accurate sales forecasting and pipeline reporting.
Quick Install
Claude Code
Recommendednpx skills add TomGranot/hubspot-admin-skills -a claude-code/plugin add https://github.com/TomGranot/hubspot-admin-skillsgit clone https://github.com/TomGranot/hubspot-admin-skills.git ~/.claude/skills/cleanup-dealsCopy and paste this command in Claude Code to install this skill
Documentation
Cleanup Deals
Standardize deal data to make pipeline reporting accurate. Test deals, missing amounts, and stale opportunities distort forecasts and pipeline metrics.
Prerequisites
- HubSpot API token in
.env - Python with
hubspot-api-clientinstalled viauv - Knowledge of which deal pipelines are active and which are synced from Salesforce
Important: Salesforce Sync Considerations
If deals are synced from Salesforce:
- Do NOT delete or modify synced deals without coordinating with the Salesforce admin.
- Changes in HubSpot may sync back to Salesforce and cause data loss.
- Identify synced deals by checking for the
hs_salesforceopportunityidproperty.
Step-by-Step Instructions
Stage 1: Before — Audit Deal Data
Pull deal metrics via the API:
from hubspot import HubSpot
from hubspot.crm.deals import PublicObjectSearchRequest
api_client = HubSpot(access_token=os.getenv("HUBSPOT_API_TOKEN"))
# Deals missing amount
no_amount = PublicObjectSearchRequest(
filter_groups=[{
"filters": [{
"propertyName": "amount",
"operator": "NOT_HAS_PROPERTY"
}]
}]
)
# Deals missing close date
no_close = PublicObjectSearchRequest(
filter_groups=[{
"filters": [{
"propertyName": "closedate",
"operator": "NOT_HAS_PROPERTY"
}]
}]
)
Record: total deals, deals per pipeline stage, deals missing amount, deals missing close date, stale deals (open with no activity in 60+ days).
Stage 2: Execute — Clean Up
- Delete test deals — search for deals with names containing "test", "demo", "sample", or with amount = $0 and no associated contacts.
- Address missing amounts — export deals without
amountand work with sales to fill in values or mark as lost. - Close stale deals — deals open with no activity in 90+ days should be reviewed with the deal owner. Set to "Closed Lost" if abandoned.
- Standardize pipeline stages — ensure all pipelines have consistent stage names and probability percentages.
- Remove unused pipelines — if a pipeline has zero active deals and is not in use, archive or delete it.
Stage 3: After — Verify
- Re-run the deal audit queries. Confirm:
- Test deals removed
- Missing amount count decreased
- Stale deal count decreased
- Check pipeline reports for accuracy.
Stage 4: Rollback
- Deleted deals can be restored from HubSpot's recycling bin within 90 days.
- Stage changes and property updates can be reverted manually but there is no bulk undo.
- For Salesforce-synced deals, check the Salesforce recycle bin as well.
Tips
- Establish a deal hygiene rule: deals without activity for 60 days get an automated reminder to the owner (build a simple workflow).
- Require
amountandclosedateas mandatory deal properties to prevent future gaps.
GitHub Repository
Related Skills
evaluating-llms-harness
TestingThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
cloudflare-cron-triggers
TestingThis skill provides comprehensive knowledge for implementing Cloudflare Cron Triggers to schedule Workers using cron expressions. It covers setting up periodic tasks, maintenance jobs, and automated workflows while handling common issues like invalid cron expressions and timezone problems. Developers can use it for configuring scheduled handlers, testing cron triggers, and integrating with Workflows and Green Compute.
webapp-testing
TestingThis Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.
finishing-a-development-branch
TestingThis skill helps developers complete finished work by verifying tests pass and then presenting structured integration options. It guides the workflow for merging, creating PRs, or cleaning up branches after implementation is done. Use it when your code is ready and tested to systematically finalize the development process.
