Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam shows where a team's rules live and breaks a lint rule on purpose so the pre-push hook blocks Claude's push. Then he reads the team's git history and has Claude save its unwritten conventions to CLAUDE.local.md.
What you'll learn
- Where a team's rules live:
CLAUDE.md, README, lint config, git hooks and the git history. - ESLint is an automatic "spell check" for code;
npm run lintwith no output means no errors or warnings. - A pre-push hook stops a push (yours or Claude's) when lint or type checks fail; the commit still exists locally.
- Why a team blocks imports between feature folders, and where shared components belong (
components). - How to tell squash merges from merge commits in a git graph.
- What conventional-commit prefixes (
feat,fix) look like. - How to have Claude extract unwritten conventions from the history into
CLAUDE.local.md, and to review them now and then.
Chapters
- 00:00Written and unwritten team rules
- 02:25ESLint, a spell check for code
- 05:15A pre-push hook blocks the push
- 09:15No imports between feature folders
- 10:37Reading the team's git history
- 13:34Saving unwritten rules for Claude
- 00:00Hello and welcome back.
- 00:01So, in the previous module, we looked at how we can clone an existing GitHub repository, how we can set up a new application to run locally on our Mac,
- 00:10how we can install dependencies, and how we can get onboarded a little bit faster with the help of AI.
- 00:17In this module, we are going to shift gears and we are going to look into how we can start actually contributing to this application without making other engineers' lives
- 00:27more miserable. And we're going to begin with getting to know how this team works and what are the different like where are the different conventions or rules written down
- 00:39and how they are enforced.
- 00:41So first, let's take a look at things we might have already discussed.
- 00:45So we just did discuss Claude.md file, a document that has a list of rules for our AI agents to you know keep like be aware of and respect.
- 00:58We have our README file, which is a similar kind of thing, but it's written more with humans in mind.
- 01:04And again, it's up to us as humans whether we are going to be respecting these rules, if there are any rules written down over here or not.
- 01:12And then there are some there are like automated checks that are going to basically hard enforce for like specific rules to be to be respected.
- 01:24We're going to look into this in a second.
- 01:26So all of these things are actually written down, meaning we can like get to the bottom of this.
- 01:31And then sometimes there are things that are not necessarily strictly documented, but it is still like an unwritten rule that we are expected to be honoring these things.
- 01:43And one common example is getting to know how a particular team works with Git, the way they are going to be making comments, the way they are going to
- 01:52be describing these comments, or how they set up new PRs, how frequently, how how small or how big these are, and also what goes into the PR of these
- 02:03descriptions and other things along these lines.
- 02:06So with Claude, we can luckily get to know all of these things a little bit faster and we can actually ask it to, you know, when it works on
- 02:14when it's working on our behalf so that it respects these rules so that we are basically not any sort of pain in the ass for engineers on this team.
- 02:25Let's first focus on the written down rules.
- 02:28So we've already again went through CLAUDE.md and Readme file.
- 02:31Let's talk about that lint setup and what is ESLint in the first place.
- 02:37So an ESLint, we can think of it as a form of a spell check for code.
- 02:42It's a way to enforce specific rules and a specific way of writing code in an automatic manner that can sometimes even block us from pushing the code that is
- 02:53going to be violating the rules written down over there.
- 02:56And you know, when we work in Figma, these rules is something that we can actually somehow relate to.
- 03:03You might know this from your experience, you know, when onboarding to a new team, you might discover that this team has a very specific way of, you know, naming
- 03:12their their layers or that they do actually care about naming their layers in the first place.
- 03:17Then they can have, you know, things like we always name layers using sentence case or capital case or camel case or kebab case or whatever case.
- 03:27Then there are things such as we always design using variables or Figma styles.
- 03:32We don't really accept things like hard coded hex values or text layers with detached text styles or, you know, components that are detached.
- 03:43So things that were often times, you know, like things that we were often times laughing on things like X or Twitter.
- 03:53So ESLint is basically a way to enforce similar set of rules automatically in our code.
- 03:59And depending on the code base, they might be set up in a different way.
- 04:03Uh, so let's see how this codebase, this imaginary codebase does it.
- 04:08So I'm going to go back to my Claude Code session.
- 04:11Uh, I'm going to open up First, I'm making sure again that I'm working within the right folder.
- 04:18Let me open up the file explorer.
- 04:20Um, so let's see.
- 04:21The first thing that I'm noticing over here is that there is a file that's called eslint.config.mjs.
- 04:28Um, and this is where all of these rules that are being enforced over here live.
- 04:33And the way for us to quickly confirm whether all of the code in uh in the existing or the current snapshot of the codebase are basically um in compliance
- 04:43with these rules is by running a simple command, npm run lint.
- 04:49So it's going to do something like this.
- 04:51Depending on how large your codebase is, that might actually take a couple of minutes.
- 04:56Uh, and then when you see a response like this, which is slightly confusing, but when you see a response like this, meaning no response at all, it means that
- 05:03everything is good. We have ESLint set up, but nothing is in violation.
- 05:08There are There aren't even warnings.
- 05:10So there are two kinds of outputs that we can see.
- 05:12We can have errors and we can have warnings uh depending on our configuration file, of course.
- 05:18Now, um there is also a husky folder and we can see there is a pre-push hook.
- 05:25So a hook is a way to force us and our AI agents to truly respect the code, like the the rules written down in our codebase, such as the
- 05:35ESLint. Um, a pre-push hook is something that is actually going to stop us and our AI agents from pushing a commit to a remote repository if anything is wrong.
- 05:47And over here we can see there are two things written down in this hook.
- 05:51So the lint needs to be green and the type check, which is another type of um you know spell check.
- 05:58Uh, you know both of these tests need to be green, meaning they need to like there there can be any sort of errors, sometimes even warnings in very extreme
- 06:08examples, but in this case it's going to be errors.
- 06:11So let's see if we can actually if we can force an error in ESLint to show up.
- 06:19Okay, I'm going to head over to SRC and I'm going to get into features profile, profile form.
- 06:29And in this file we can see this is by the way this is that page over here.
- 06:41Yeah, this is a leftover from the previous module in which we were testing or stress testing the UI.
- 06:47We can see a couple of things such as this caption over here about the license plate filled in for you when you book a space.
- 06:54Let me find this text.
- 06:56It's right over here.
- 06:57Let's say I want to change this manually to be something like like a little bit more in your Oh, actually I cannot change this unless we begin a session.
- 07:07So maybe I'm going to go back to one of the previous sessions and I'm going to open up the same file.
- 07:13So SRC profile form and I'm going to type in we are in, we are going to we will fill this in for you when you book a space.
- 07:29So what I'm doing here seems innocent, but I have just I've just used an apostrophe over here in a way that really isn't isn't valid over here and that
- 07:43should cause an ESLint error.
- 07:46So if I now open up the terminal just as a proof and run npm run lint after a second we should see a problem and over here this is
- 07:57an error which means that I will be blocked from pushing this if I were ever to make a comment.
- 08:04And just for kicks I can ask Claude um to to try to commit and push this.
- 08:11Uh Claude, can you commit and then push the um the profile form uh profile form file for me uh without changing anything.
- 08:30And um what I'm expecting is going to happen is Claude is going to make a commit, but then it's going to tell us that it was unable to actually
- 08:38push this commit over to the remote repository because um there was a problem.
- 08:45So let's give it a second.
- 08:48And there we have it.
- 08:49So the file is committed, but the push failed.
- 08:52So nothing is on GitHub yet.
- 08:55And the push the push failed because of the uh because of that lint uh errors.
- 09:01Um so that is a really neat way to like maintain um maintain your codebase quality over time because like ESLint can be used for much more than just uh
- 09:14you know simple simple um you know typos like in here.
- 09:19Uh we can actually enforce uh a little bit more of high-level rules.
- 09:24One common type of rule that we can see in these uh in the ESLint configuration is that when you work on features over here, so each feature has its
- 09:34own folder. And when you create a component over here, then you cannot import the same component from within a different feature.
- 09:42So if I create a component just for bookings, I cannot import it within spots.
- 09:46Uh if I were working on like anything that concerns spots, I cannot import it from a different folder.
- 09:52Uh that is because if there is something to be shared in between these features, that should live depending on what kind of things this is.
- 09:59but if this was a UI component, that should live in the components folder so that it can be shared with everything else.
- 10:06So this is another type of uh ESLint violation that would block us.
- 10:10and the best part is our Claude agents as well from actually pushing sloppy code.
- 10:17So it's really great to have these forms of this form of restrictions set up in our codebase because that these are going to let us make sure we are
- 10:27not really I don't know, slowing anyone down or making anyone's life miserable.
- 10:33But these rules are actually written down and enforced.
- 10:36And then there are there are these other types of rules, which is something we can basically figure out from the context.
- 10:45And it's for example the way like this team uses Git.
- 10:49So let me let me undo everything here.
- 10:53I'm going to class ask Claude to undo these changes, undo these changes.
- 10:58That was just a test.
- 11:00Drop the branch as well because I think it has created a branch as well.
- 11:08Okay, and as Claude is doing this what I'm going to do Okay, I'm just going to let it undo this really quickly.
- 11:23And as it's doing this, what I'm going to bring up is that Git graph Claude code desktop app mode, which we discussed in one of the previous modules.
- 11:33This is something you can like download and install into your in your Claude application if you want to have access to this Git graph, which I think is really
- 11:42nice thing to keep an eye on.
- 11:44And the reason it's so nice in this particular example is because it allows me to just have a casual read through some of the past commits.
- 11:53And this is telling me, okay, this team, first of all, it seems to be doing squash merges.
- 11:58How do I know this?
- 11:59Going back to one of the previous lessons, if you know, we if this was a codebase doing merge commits, we would see these like these lines going into here
- 12:11and here like and like we would have it would basically retain information about some of these commits living on like different branches at some point in time.
- 12:24And another thing that I can tell is that the way these commit messages look like.
- 12:30So some teams tend to use these conventional commits which we have only scratched the surface of in one of the previous videos.
- 12:38So scratch commits is something when you see like like a particular type of prefix before your commit.
- 12:47Something like feet for future when you are adding something new.
- 12:51So you would say instead of let's see my bookings page, right?
- 12:58So this would be my bookings page because we are adding a new feature.
- 13:02And then we have at CLAUDE.md with our conventions.
- 13:05That would be that would be this at CLAUDE.md with our conventions.
- 13:13We also let's see if we have any fixes here.
- 13:15Silence my or silence the Miranda Sans fallback from warning.
- 13:19So that would be fix silence the Miranda Miranda you get the gist of it.
- 13:26So based like depending on what kind of team you are working with, there might be just different strategies for making commits and they might not necessarily be written down
- 13:37anywhere. So if you want to be nice to order engineers and you want to respect these unwritten rules, one nice thing you can do now that we have this
- 13:45local CLAUDE.md file is you can ask Claude to actually analyze your commit history and so that it saves so that it can save some of these observations and
- 13:57it actually tries to respect them every time you are contributing to this codebase.
- 14:01So let's see. I'm going to start a new session.
- 14:04I'm going to close everything over here and I going to say Claude, it seems like this codebase doesn't have any documented rules for making messages, uh, creating PRs and
- 14:18working with Git Git in general.
- 14:20Um, I would like you to therefore analyze the most recent Git history, uh, see what kind of context we can extract for this and add it to our local
- 14:31CLAUDE.md file so that next time I'm working with you, you try to respect uh, the rules uh, these engineer the unwritten rules these engineers have.
- 14:42Um, okay. I'm not even going to uh, I'm not even going to clean it up uh, Claude configure it out.
- 14:49So it's going to read that recent Git history and the PRs uh, summarize them and document in CLAUDE.md unless we have done that already one of the previous
- 14:58lessons. Now I'm actually not sure.
- 15:00Let's see. Um, no, no.
- 15:03This isn't really documented anywhere.
- 15:05So that's that's that is a nice example of something you would want to have documented in your Claude dot local dot MD, although ideally ideally there is one global
- 15:15CLAUDE.md file uh, with these rules documented or even better yet you can create entire PR uh, templates or PR description templates uh, in your codebase.
- 15:25Um, so that is something you would see in a like very well maintained codebase.
- 15:30Um, so yeah, but you know, until then this is how you can help use Claude to help yourself um, be uh, you know, just friendly pal uh, for them
- 15:41and not cause any headaches.
- 15:43Um, so yeah, this is everything we need to know for now about uh, working with engineers and uh, knowing about their rules.
- 15:52Uh, it's good to know that some of them unenforced automatically.
- 15:55That is a great thing and for everything else ask Claude to basically see go and see if it can find any patterns and try to have them documented in
- 16:04your local CLAUDE.md file file and also get in the habit of reviewing these patterns every now and then because they also tend to change over time.
- 16:15And with that, I'm going to see you in the next video.