deal-management

Run the full deal lifecycle from CLI — discover pipelines/stages, qualify MQLs into deals with associations, advance/reassign in bulk, hunt stalled deals, and close.

By hubspot · 1,316 installs

npx skills add hubspot/agent-cli-skills --skill deal-management

Source repository · Upstream listing

Resources File When to use resources/lifecycle stage progression.md Lifecycle stage API values + the contact side updates that pair with deal moves. resources/stalled deal queries.md Filter cookbook for stalled / no activity / past close date deals with dynamic dates. Foundations Read bulk operations/SKILL.md first — JSONL piping, batch read, pagination, and the dry run/digest/confirm flow live there. Reshape recipes are in bulk operations/resources/json patterns.md . hubspot <command help is the source of truth. Object types are plural ( contacts , deals , companies ). For property reference: hubspot properties list type deals — don't hardcode property tables. 1. Discover pipelines and stages Pipeline and stage IDs are portal specific . Always discover at runtime — never hardcode across portals. Grab a specific stage ID by label: The IDs shown above ( appointmentscheduled , closedwon , etc.) are HubSpot's standard default deal pipeline stages — but discover yours every run since portals can rename or remove them. 2. Qualify an MQL into a deal Find connected MQLs without a deal, then for each: create the deal, associate to contact + company, promote lifecycle. Bulk pattern — many MQLs at once objects create returns one result line per stdin line, in input order. Capture both streams and join by line for associations: Company associations need a separate per contact pass via hubspot associations list from contacts:<id to companies — a contact may have zero or many companies. Pre qualification checks are just filters on the search: has email, has a company, no open deal, has an owner — all in the filter already. See resources/lifecycle stage progression.md for the full stage progression and contact side updates. 3. Advance or reassign in bulk For 100 rows, the dry run emits a digest line; re pipe with digest <hash confirm <count . Full flow in bulk operations/SKILL.md . 4. Find stalled deals Filter cookbook with dynamic dates lives in resources/stalled deal queries.md . The core query: Pipe the result into an update (extend close dates, move stage, set a flag) or into task creation. For follow up tasks/calls/notes against stalled deals, see the sales execution skill — don't duplicate activity object property handling here. 5. Close Closing is a stage update + closedate (YYYY MM DD). hs is closed and hs is closed won are read only — HubSpot derives them from the stage. Win/loss analysis (close reasons, win rate, ARR roll up) is in the sales reporting skill. Known constraints Bulk MQL → deal needs a two pass shell flow: associations must be built from objects create output, not in the same pipe. lifecyclestage is forward only in most portal settings — backward transitions may be rejected. closedate is a date string ( YYYY MM DD ). Datetime activity props ( hs last activity date ) also accept a date string for < / comparisons. No sequences/cadences API in the CLI — create a follow up task via sales execution instead.