HubSpot Repository Setup: Governance, Git, and AI Guardrails

Set up a HubSpot repository with a three-tier Git branch model, governance files like roadmap.md and CHANGELOG.md, and AI guardrails via Claude.md and an AI-rules folder. Install the HubSpot MCP in VS Code to let AI reference platform-specific docs before it starts coding.
Chapters
If your repo has no rules, your project does. Usually bad ones. In this video, we're setting up the boring stuff that quietly determines whether the rest of this build feels clean or painful. By the end, you'll have a repo structured correctly with the proper branch model, a verified.gitignore, the core governance files, AI guardrails, and the HubSpot MCP setup wired in so your future self is not doing archaeology. Now, last video we made an episode 1 branch. This is something I'm going to do for this video series, but it's not necessary for you. It just allows you to go back to each one of these branches and see exactly what we did in that video. It will not include code from, you know, video 22, so it should be nice and easy to follow from there on. But we do need to have a branching system. The real project model is main for stable code, develop for active integrations, and later we'll make feature branches for focus work. That's not just a Git preference, it mirrors the dev and prod environments we're building for. Okay, let's jump over to the terminal again and get our Git branching set up, uh, real quickly. Let's do a git status, see where we are, and you can see here that we are on branch episode 1. So let's create the branches. git branch develop git branch main, and that created two branches. Now what we're going to do is create and check out to a branch. So I'm going to git checkout -b feature/governance. And if I do git status here, We will see now that we are on the governance branch. Now let's jump back over here. In the last video, we did create this.gitignore file. I want to make sure that you have created this and that you have put all the things in there. Um, down here at the bottom, you'll see I have docs.system_dependencies in here to get rid— make sure that this one with all my very, very secret data is not added to the actual GitHub account or anywhere else where people could see it. Also, you'll see that a lot of things that are in here are just things you just don't need to upload, you know, like these node_modules. It's just a lot of cruft that we don't need to have up in GitHub. When someone was— if someone was to be working with you on this, they would download this and then they would just build it, which would pull down all those things independent of this. And so you don't worry about, you know, wasting all that space up there. Cool. Now what we're going to do is going to make some files in our docs folder to continue working on this governance business. I'm going to create each one of them and then I'll walk through them after to explain them in more depth. Okay, we're going to do a roadmap.md file. We're going to do changelog. Yeah, I like to keep it all capital for consistency. .md. In the file, we're gonna do requests.md, and we're gonna do gotchas.md. I believe that is all of them. And let's just go ahead and walk through each of these files. Actually, before we do that, we are going to actually create a Claude.md file. This file is obviously specific to Claude, but you would put whatever the equivalent instruction file your coding system uses here. The point is pretty simple: give the AI your architecture, your rules, your deployment constraints, and your documentation obligations before it even starts coding. Okay, and we've got that file now. I am going to copy and paste my info in here. This of course will be available in the repo. So what this is, is the Claude MD file of finding guidance, blah, blah, blah, blah, blah. We're going to create a folder, AI rules, with these 3 files in it that helps further break down the rules that Claude will be looking. The reason I do this is because this file can get pretty large and cumbersome over time. So the more you can just isolate, you know, different sections of it into different files. It's just easier for you to look through and add to as needed. So let's go ahead and look through this a little more. The overview architecture, the structure of everything here is all that. Now going back into the docs, let's go ahead and add that folder. New folder, AI-rules. All right. Now hubspot-platform.md, and then we need firebase-admin.md. All right, I'm going to copy over a whole bunch of things. You can go ahead and look through this at your leisure. Alright, Firebase and admin. Now some of the stuff you can extrapolate and use for other projects. Some of this stuff is very specific to the project we're doing now. For example, you won't always be using Firebase, but you can take this, clone it, make your own copy, make your own revisions, you know, make it better, make it more for you. And use this in other projects as you go forward. Let's do a real quick walkthrough of the admin just to give you a, just a, you know, a bird's eye view of it. This is our, you know, committing convention. So if you're going to be using an AI tool to commit things, you want to make sure it follows this naming convention for commits it makes. You want the commit message to say why and not just what. Never without explicit user instruction. Never, never, never. These are the things that you want to make sure the AI just doesn't go off and do on its own without talking or consulting with you first. And then we have our system dependencies. So this is something where it can check to see if, you know, something it needs to find, like, you know, a portal ID or Google Cloud project ID, something like that. And at the end of each coding session, you want to make sure that it is updating the changelog here. We're going to have it referencing the roadmap to see if there— what's next on the list. These are— remember, these are the files that we created earlier. The request is an interesting one. The request is basically the things where as you're building things out, you think, oh, this would be an interesting idea to add, or there's a bug that I want to fix at some point in time, but not right now. So what I've done is I always put things into a request folder. It's kind of like, you could call it like a scope creep folder almost. I add these things here and whatever agent I'm working with will go through this file after it's done with the process it's doing, or I can have a separate agent working on this concurrently. It just allows me to stay focused on the project itself without just, you know, veering off into some, you know, vibe coding tangent. And then we have a gotchas folder here. These are things that just little idiosyncrasies, you know, throughout whatever environment we're working with, things like, you know, oh, didn't realize that'd be like that. Let's put that in the gotchas file just for reference in the future if we ever need to go through it again. And that's basically it for these files. As I said, this will be in a template for you. You can copy them down and read more into each one of these if you have questions about it. Of course, you know, add anything to the comments below. I know I went through a lot here and it is kind of overwhelming as well as AI is changing at a blistering pace. So, you know, what is good here now might not necessarily be good in the future. And I'd love to update this and see other people's practices. Okay. And let's finish off the whole AI business. Let's install the HubSpot MCP server inside your editor. I'll add a link to the HubSpot MCP docs as well in the description below. But the gist is it's going to allow our AI to look at the docs, know exactly how to build things referencing HubSpot-specific architecture, and hopefully make the whole coding experience a little bit easier for you and the AI assistant itself. So to install it, we're going to do hs-mcp-setup. I am using Cloud. I'm also using VS Code, but we're going to do it for Cloud Code. You do it for all. And I'm gonna hit submit. Alright, cool. It's installed. As it says here, you might need to restart the tools to get it going. I think we're good for now. Let's make sure we have committed everything. We have a lot of things going on here. We're gonna go the easy route this time. First of all, let's just look at the stat where we are. We're on our governance file, right? Branch. This— a lot of things to do here. Let's create a message here. This is going to be docs. Commit. I'm going to check out to our develop branch. I'm going to merge. With governance. I want to publish that. And just to verify, I'm going to go over here. We should be able to go to develop now, and we should see our docs, all that good stuff here. And I haven't done it yet, I'm just going to do it real quickly. I'm going to check out to our main branch so we can start using that instead of master. Publish. This is actually all good right now. So what we could do is go ahead and merge this with develop, sync changes, and then if we go back here, refresh again, we should see main. Cool. Okay, that's it for this video. Next, we're going to create the HubSpot project. We're going to define the app object schema and we're going to start shaping the data model. The rest of the app depends upon. Until then, bye-bye.










