All prompts
CMS & development

Cursor setup for HubSpot CMS development

An agent prompt that turns a Cursor workspace into a safe HubSpot CMS dev environment — CLI auth, the Developer MCP server, your theme fetched locally, a test module, and draft-only uploads.

Works withCursor

When to use it

You want to build and edit HubSpot Content Hub templates and modules with AI instead of clicking around Design Manager — without risking live assets. This prompt makes the agent do the setup work (CLI, auth, MCP, theme download, a working test module) with guardrails baked in: draft-mode uploads, no destructive commands, and credentials that never touch the chat.

The prompt

Set up this Cursor workspace so I can use AI to create and edit HubSpot Content Hub templates and modules connected to Design Manager.
My HubSpot account: [ACCOUNT ID OR NAME — HELP ME FIND IT IF NEEDED]
My existing theme: [DESIGN MANAGER PATH — HELP ME FIND IT IF NEEDED]
Carry out the setup using the terminal and local files. Explain any step I must complete myself in plain English.

1. Inspect the workspace, operating system, Node.js, npm, Git, and HubSpot CLI. Preserve existing files and configuration. Install missing dependencies where possible. Use the current official HubSpot documentation and installed CLI help to verify commands.
2. Check authenticated accounts with hs account list. If needed, guide me through hs account auth in my own terminal. I will generate and enter my Personal Access Key there. Never ask me to paste credentials into chat or read credential files into your context.
3. Identify the correct account and link it to this workspace with hs account link. Ask me to choose if multiple accounts could match. Include the explicit account ID in CMS commands.
4. Configure HubSpot's Developer MCP server using hs mcp setup and select Cursor. Preserve existing MCP settings. Help me verify that HubSpotDev appears under Cursor Settings → Tools & MCP. If a restart is needed, write a brief resume note first.
5. Locate and download my existing theme using hs cms ls and hs cms fetch. Inspect its templates, modules, fonts, colors, spacing, and dependencies. If it inherits from a parent theme, inspect the relevant parent assets too.
6. Prepare a separate development folder. For a marketplace or default theme, use an appropriate child theme. Check inherited files and absolute references before changing paths. Preserve the original files as a baseline. If I have no existing theme, prepare a minimal HTML/HubL theme.
7. Create a small test module with editable heading, body, and button fields. Match the existing theme's styling. Include the appropriate module.html, module.css, optional module.js, fields.json, and meta.json files. Make it responsive and ensure multiple instances can work on the same page.
8. Run applicable checks and upload the new development assets using --cms-publish-mode=draft. Verify that the upload succeeded and the assets exist remotely. Explain how to preview the module and test its editable fields in HubSpot.
9. Create a short README containing the actual account, local and remote paths, and working fetch, draft-upload, and draft-watch commands. Explain how to stop the watcher and retrieve later edits made in Design Manager. Configure Git and upload exclusions for credentials and unrelated files.

This workflow is for classic HTML/HubL assets in Design Manager. Follow the existing theme's architecture.
Use draft mode for development uploads. Publishing code requires an explicit request from me. Avoid deleting remote files, destructive cleanup flags, or replacing assets used by live pages.
Finish by explaining what you configured, which checks passed, any manual step remaining, and where I should start editing.

How to use it

  1. 1Open (or create) the workspace folder in Cursor and paste the prompt into the agent, filling in the two placeholders — or leave them and let the agent help you find your account ID and theme path.
  2. 2When the agent reaches authentication, run hs account auth in your own terminal and enter your Personal Access Key there — never in the chat.
  3. 3Approve the installs it proposes, then verify HubSpotDev shows up under Cursor Settings → Tools & MCP (restart Cursor if asked).
  4. 4When it finishes, preview the test module in HubSpot and check its editable fields — then start editing from the folder the README points to.

Tips

  • The guardrails are the point: draft-mode uploads, no deletions, explicit account IDs, credentials outside the chat. If you edit the prompt, keep those lines.
  • Works with other agentic editors too — swap step 4's Cursor selection for your editor when running it in Claude Code or similar.
  • Publishing stays manual by design: the agent uploads drafts, and only you promote them to live.

Related resources

Want this running in your portal?

We build smart properties, scoring models and data workflows for HubSpot teams every week. Book a free consultation and we'll map where AI actually earns its keep in your setup.

Talk to sales