tomgranot/hubspot-admin-skills/reassign-deactivated-owners
Claude Code and agent skill by tomgranot/hubspot-admin-skills
- community
Checking that the SKILL.md file is still in the repository.
Reassign contacts and companies from deactivated team members to active owners. Fully automated via the HubSpot Owners API and Batch Update API. Includes territory analysis for informed reassignment decisions.
Install
npx vskill@latest install tomgranot/hubspot-admin-skills/reassign-deactivated-ownersSKILL.md
Reassign Contacts From Deactivated Owners
Purpose
When team members leave an organization, their HubSpot-owned contacts and companies become orphaned. Leads are not being worked, accounts are not being managed, and any automation that relies on Contact owner or Company owner routes to dead ends. This skill identifies deactivated owners, analyzes their contact portfolios, and batch-reassigns ownership via the API.
Prerequisites
- A HubSpot service key (
HUBSPOT_ACCESS_TOKENin.env; an existing legacy private app token also works) withcrm.objects.contacts.read,crm.objects.contacts.write,crm.objects.companies.read,crm.objects.companies.write, andcrm.objects.owners.readscopes - Python 3.10+ with
uvfor package management - A
.envfile containingHUBSPOT_ACCESS_TOKEN - A decision from team leadership on the reassignment strategy (see Plan stage)
Scripts
Script paths are relative to this skill's directory. Run them from your project directory so .env, data/, and reports/ resolve there: prefix each path with wherever this skill is installed (skills/reassign-deactivated-owners/ in a clone of the repo).
| Stage | Script | Run with | |
|---|---|---|---|
| Before | `scripts/before.py` | uv run scripts/before.py | |
| Execute | `scripts/execute.py` | uv run scripts/execute.py | |
| After | `scripts/after.py` | uv run scripts/after.py |
before.py lists deactivated owners and counts their records, exporting the CSV baseline. execute.py batch-reassigns to the configured target owner. after.py verifies zero records remain with deactivated owners.
CRITICAL: Retrieving Deactivated Owners
The Owners API requires the archived=true parameter to retrieve deactivated users. The default endpoint only returns active owners. This is the most commonly missed detail.
Deactivated owners have "archived": true in their response object.
Interview: Gather Requirements
Before executing, collect the following information from the user:
Q1: Who should contacts from [deactivated user X] be reassigned to?
- Run the Before State script first to identify deactivated users and their contact counts, then ask this question for each deactivated user found
- Examples: "Assign Jane Doe's 500 contacts to John Smith", "Distribute evenly across the sales team", "Assign all to the Marketing Team user"
- Default: No default -- this requires an explicit business decision for each deactivated user
Q2: Should unowned contacts be assigned to a default user? If so, who?
- Examples: "Yes, assign to our Integration User", "Yes, round-robin across the sales team", "No, leave them unowned for now"
- Default: No -- unowned contacts are a separate strategic decision from deactivated-owner contacts
Execution Pattern
This skill follows a 4-stage execution pattern: Plan -> Before -> Execute -> After.
Stage 1: Plan
Before writing any code, confirm with the user:
- Reassignment strategy -- one of three options:
- Option A (Unassign): Set owner to blank. Best if no one is actively working these contacts and the team wants to start fresh with new assignment rules.
- Option B (Distribute to active team members): Round-robin across current reps. Best if there are active reps who should work these leads.
- Option C (Assign to shared owner): Assign to a single placeholder user (e.g., "Integration User" or "Marketing Team"). Good middle ground.
- Territory analysis: Before reassigning, the user may want to analyze the portfolio of each deactivated owner (customer %, lifecycle distribution, industry breakdown) to make informed decisions about who gets which contacts.
- Unassigned contacts: Ask whether the user also wants to address contacts that have no owner at all. This is a separate strategic decision.
- Preserve historical ownership: Ask whether to create a "Previous Owner" custom property to retain a record of the original assignment.
Stage 2: Before
Discover all deactivated owners and analyze their contact/company portfolios.
Optional: Territory analysis template
For informed reassignment decisions, generate a portfolio breakdown for each deactivated owner:
Present findings to the user. Ask for explicit reassignment instructions (which deactivated owner's contacts go to which active owner or shared user).
Stage 3: Execute
Batch-reassign contacts and companies from deactivated owners to the target owner(s).
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/reassign-deactivated-owners/SKILL.md
Popularity
- Repository stars
- 78
- Repository forks
- 18
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tomgranot/hubspot-admin-skills/reassign-deactivated-owners)