HubSpot is a great tool for building websites. It lets developers create custom parts, called modules. Marketing teams can easily use these modules to build web pages by simply dragging and dropping them.
But building lots of these modules takes a lot of time. It can get really boring because developers have to write the exact same type of code over and over again. They have to write long setup files, create the HTML, and make sure everything looks good on all devices.
Now, many developers are using AI tools like ChatGPT or GitHub Copilot to work faster. AI is not perfect. It cannot do everything for you. But if you use it smartly, it can save you hours of boring work.
This guide explains how HubSpot developers can use AI to build modules faster, while keeping their code clean and easy to use.
HubSpot gives you a lot of power, but it also makes developers do a lot of manual setup work for every single module.
Every single module needs a file called fields.json. This file tells HubSpot what buttons and text boxes to show to the marketing team. Even a simple module needs you to type out the code for:
Typing out this code for dozens of modules takes forever and it is really easy to make typing mistakes.
HubSpot uses a coding language called HubL. Developers mix HubL with normal HTML to make the web pages work. They have to write the same basic loops and "if" statements every day. Doing this repetitive work takes time away from solving bigger problems.
After the basic code is done, developers still need to write CSS to make the module look nice. They have to test it on mobile phones and make sure it is easy for blind people to use with screen readers. All these steps add up.
AI cannot build a perfect HubSpot module all by itself from just one simple prompt. However, it is amazing at doing the boring, repetitive typing for you.
One of the best ways to use AI is to let it write your fields.json file. You can just tell the AI what you need in plain English. For example, you can say, "Make a fields.json file for a pricing card with a title, a picture, and a button."
The AI will quickly type out all the starting code. You still have to check it to make sure it is right, but it saves you from doing all the heavy typing.
AI is pretty smart when it comes to basic HubL code. It can quickly write the code patterns that you use every day, like:
A lot of websites use the same types of layouts, like a grid of features or a list of customer reviews. Instead of starting from a blank page, you can ask AI to write the basic HTML for you. Then, you can step in and add the special HubSpot code to make it work.
HubSpot has a lot of rules. Instead of searching through long pages of instruction manuals, developers can just ask the AI a question. The AI can give you a quick summary and show you an example of the code you need.
You cannot trust AI blindly. If you do, your website might break. You need to know where AI gets confused.
Sometimes, AI just invents things. It might try to use a field type that HubSpot does not even support. It might misspell a property or forget a required ID. A developer always needs to double-check the AI's work against HubSpot's real rules.
If your module needs to pull complex data from a database (like HubDB), AI often gets very confused. It struggles to write complex queries and filters. For the hard stuff, human developers are still much better.
AI does not know what your whole website looks like. It might write code that is hard for the marketing team to understand in the editor. A human always needs to review the module and make sure it is easy to use before putting it on a live website.
Smart developers use AI as a helpful assistant. Here is a simple step-by-step workflow that works really well:
fields.json file and the starting HTML code.AI is not going to steal a HubSpot developer's job. But it is a super helpful tool. By letting AI do the boring typing and basic setup, developers can save hours of time every week.
The secret is knowing what AI is good at and knowing exactly when you need to step in and do the real work.
Building HubSpot modules from scratch takes time. Rapid lets you upload any UI screenshot and generates a complete, production-ready HubSpot module (with fields.json, HubL bindings, and proper structure) in under 60 seconds. Try it free →