/hubspot-admin:standardize-geo-valuesfrom hubspot-admin
Standardizes inconsistent country and state/region formats (e.g., US vs United States, NY vs New York) across HubSpot contacts and companies to enable reliable geographic segmentation.
Ships in hubspot-admin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Convert inconsistent geographic formats (e.g., "US", "USA", "U.S." vs "United States"; "NY" vs "New York") to a single standard format across all contact and company records.
Inconsistent geo values break geographic segmentation. A list filtering for "United States" will miss contacts labeled "US" or "USA". For B2B companies running region-specific campaigns or reporting by geography, this means inaccurate audience sizes and missed contacts.
HUBSPOT_ACCESS_TOKEN in .env; an existing legacy private app token also works) with contact and company read/write scopesuvBefore executing, collect the following information from the user:
Q1: What format do you prefer for country values -- full names (United States) or ISO codes (US)?
Q2: Do you have a Salesforce or other CRM integration that requires a specific format?
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/standardize-geo-values/ 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 counts contacts and companies per variant value. execute.py applies the variant-to-standard mapping via batch update (review and extend its COUNTRY_MAPPING/STATE_MAPPING tables first). after.py verifies all variants return zero.
Run uv run scripts/before.py. The core query pattern:
variants = ["US", "USA", "U.S.", "U.S.A.", "America"]
for object_type in ["contacts", "companies"]:
for variant in variants:
resp = requests.post(f"{BASE}/crm/v3/objects/{object_type}/search",
headers=HEADERS, json={
"filterGroups": [{"filters": [
{"propertyName": "country", "operator": "EQ", "value": variant},
]}],
"limit": 1,
})
total = resp.json()["total"]
if total:
print(f"{object_type} with country = '{variant}': {total}")
Record all variant counts as your baseline.
This is scripted: uv run scripts/execute.py. The mapping tables it applies:
COUNTRY_MAPPING = {
"US": "United States",
"USA": "United States",
"U.S.": "United States",
"U.S.A.": "United States",
"America": "United States",
"UK": "United Kingdom",
"GB": "United Kingdom",
"Great Britain": "United Kingdom",
# Add other mappings as discovered in your audit
}
STATE_MAPPING = {
"NY": "New York",
"CA": "California",
"TX": "Texas",
"FL": "Florida",
"IL": "Illinois",
"PA": "Pennsylvania",
"OH": "Ohio",
"GA": "Georgia",
"NC": "North Carolina",
"NJ": "New Jersey",
"VA": "Virginia",
"WA": "Washington",
"MA": "Massachusetts",
"AZ": "Arizona",
"CO": "Colorado",
"MD": "Maryland",
"MN": "Minnesota",
"MO": "Missouri",
"WI": "Wisconsin",
"CT": "Connecticut",
"OR": "Oregon",
"SC": "South Carolina",
"LA": "Louisiana",
# Add all 50 US states + territories as needed
}
# For each mapping the script:
# 1. Searches for contacts with the variant value (POST /crm/v3/objects/contacts/search)
# 2. Collects all matching contact IDs (paginated via the `after` cursor)
# 3. Batch updates them (POST /crm/v3/objects/contacts/batch/update, 100 per call)
# 4. Repeats for companies (/crm/v3/objects/companies/...)
API notes:
For each variant:
For companies, do the same from the Companies view using filters and bulk edit.
After standardizing existing data:
Re-run the variant checks: uv run scripts/after.py. Every variant should return 0 for both contacts and companies.
Verification checklist:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
40 skills in this plugin
/assign-unowned-contactsAssign an owner to marketing contacts that have no owner. Ensures every marketable contact has accountability for follow-up, proper lead routing, and accurate owner-based reporting./audit-api-usageInventory the integrations, service keys, legacy private apps, and internal tooling that call HubSpot APIs, and flag anything on legacy v1-v4 endpoints or legacy app architecture ahead of HubSpot's 2027 cutoffs. Produces a migration checklist to date-based API versions and service keys./backfill-geo-dataEnrich missing geographic data (country, state, city) on contacts and companies using HubSpot workflows, external data providers, or IP-based geolocation.npx claudepluginhub tomgranot/hubspot-admin-skills --plugin hubspot-adminOther plugins' skills for the same job