cleanup-forms
Skill75 starsChanged 20 days agoMITView on GitHub
Audit and remove unused, test, or deprecated forms from HubSpot. Identifies forms with zero submissions, forms not embedded on any page, and test forms left over from development.
- Reads credentials
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 78
Document what was deleted in a cleanup log.
- Distinctive: line 79
If a form with submissions is deleted, the submission data is retained on the contact records — but the form definition is gone.
- Distinctive: line 84
Before deleting a form with any submissions, export the form definition (field names, settings) so it can be recreated.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cleanup Forms
Audit HubSpot forms to remove unused and test forms. Stale forms clutter the forms dashboard and can cause confusion when building workflows or reports.
Prerequisites
- A HubSpot service key (
HUBSPOT_ACCESS_TOKENin.env; an existing legacy private app token also works) withformsscope - Python 3.10+ with
uv - Note: The Forms API may return 403 on some plan tiers. If so, perform the audit manually in the HubSpot UI under Marketing > Forms.
Step-by-Step Instructions
Stage 1: Plan
Confirm with the user before starting:
- How aggressive to be: delete outright, or prefix with "[DEPRECATED]" first and delete next quarter?
- Any forms that must never be touched (compliance, legal, active campaigns)?
Stage 2: Before
Inventory all forms via the Marketing Forms API (v3):
import os, requests
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.environ["HUBSPOT_ACCESS_TOKEN"]
BASE = "https://api.hubapi.com"
HEADERS = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
forms, after = [], None
while True:
params = {"limit": 100}
if after:
params["after"] = after
resp = requests.get(f"{BASE}/marketing/v3/forms", headers=HEADERS, params=params)
resp.raise_for_status()
data = resp.json()
forms.extend(data.get("results", []))
after = data.get("paging", {}).get("next", {}).get("after")
if not after:
breakFor each form, record: form ID, name, type, submission count, created date, last submission date.
Stage 3: Execute
Flag forms matching any of these criteria:
- Zero submissions and created more than 30 days ago
- No recent submissions (last submission 6+ months ago) and not embedded on an active page
- Test forms (names containing "test", "temp", "draft", "copy of")
- Deprecated forms replaced by newer versions
Before deleting, check:
- Is the form referenced in any workflow enrollment trigger?
- Is the form embedded on any live landing page or website page?
- Is the form used in any pop-up or slide-in CTA?
Present the candidate list to the user and wait for explicit confirmation, then delete confirmed unused forms via the API (DELETE /marketing/v3/forms/{formId}) or UI.
Stage 4: After
- Re-run the inventory and confirm the deleted forms are gone.
- Document what was deleted in a cleanup log.
- If a form with submissions is deleted, the submission data is retained on the contact records — but the form definition is gone.
Rollback
- Deleted forms cannot be restored in HubSpot.
- Before deleting a form with any submissions, export the form definition (field names, settings) so it can be recreated.
- Contact records retain their form submission history regardless of form deletion.
Tips
- Establish a naming convention:
[TEAM] - Purpose - Version(e.g.,[Marketing] - Webinar Registration - v2). - Prefix deprecated forms with "[DEPRECATED]" instead of deleting immediately — delete after one quarter of no usage.
In this repository40 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- assign-unowned-contactsSkill
- audit-api-usageSkill
- backfill-geo-dataSkill
- bounce-monitoring-workflowSkill
- build-lead-scoringSkill
- build-smart-listsSkill
- cleanup-dashboardsSkill
- cleanup-dealsSkill
- cleanup-lead-ownersSkill
- cleanup-listsSkill
- cleanup-propertiesSkill
- cleanup-workflowsSkill
- connect-hubspot-agent-cliSkill
- connect-hubspot-mcpSkill
- create-icp-tiersSkill
- create-segment-listsSkill
- delete-no-email-contactsSkill
- engagement-suppression-workflowSkill
- enrich-company-nameSkill
- enrich-industrySkill
- fix-lifecycle-stagesSkill
- hubspot-auditSkill
- hubspot-implementation-planSkill
- hubspot-marketing-auditSkill
- hubspot-sales-auditSkill
- lifecycle-progression-workflowSkill
- merge-duplicate-companiesSkill
- new-contact-hygiene-workflowSkill
- quarterly-database-cleanupSkill
- reassign-deactivated-ownersSkill
- review-bounced-contactsSkill
- sandbox-self-testSkill
- standardize-geo-valuesSkill
- suppress-ghost-contactsSkill
- suppress-global-unsubscribesSkill
- suppress-hard-bouncedSkill
- waterfall-enrich-contactsSkill
- weekly-cleanup-routineSkill
- workflows-as-codeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

