Claude Code for Product Designers
Lesson 39 of 49, 0 of 49 lessons completed
Sign in
Watch on YouTubePlay

Plays from YouTube. Google's privacy policy (opens in a new tab) applies.

Up next

4.2 A small change, their way

Next lesson in 8 s

4.1 How this team works

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

  1. Where a team's rules live: CLAUDE.md, README, lint config, git hooks and the git history.
  2. ESLint is an automatic "spell check" for code; npm run lint with no output means no errors or warnings.
  3. A pre-push hook stops a push (yours or Claude's) when lint or type checks fail; the commit still exists locally.
  4. Why a team blocks imports between feature folders, and where shared components belong (components).
  5. How to tell squash merges from merge commits in a git graph.
  6. What conventional-commit prefixes (feat, fix) look like.
  7. How to have Claude extract unwritten conventions from the history into CLAUDE.local.md, and to review them now and then.

Chapters

  1. 00:00Written and unwritten team rules
  2. 02:25ESLint, a spell check for code
  3. 05:15A pre-push hook blocks the push
  4. 09:15No imports between feature folders
  5. 10:37Reading the team's git history
  6. 13:34Saving unwritten rules for Claude
  1. 00:00Hello and welcome back.
  2. 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,
  3. 00:10how we can install dependencies, and how we can get onboarded a little bit faster with the help of AI.
  4. 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
  5. 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
  6. 00:39and how they are enforced.
  7. 00:41So first, let's take a look at things we might have already discussed.
  8. 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.
  9. 00:58We have our README file, which is a similar kind of thing, but it's written more with humans in mind.
  10. 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.
  11. 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.
  12. 01:24We're going to look into this in a second.
  13. 01:26So all of these things are actually written down, meaning we can like get to the bottom of this.
  14. 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.
  15. 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
  16. 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
  17. 02:03descriptions and other things along these lines.
  18. 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
  19. 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.
  20. 02:25Let's first focus on the written down rules.
  21. 02:28So we've already again went through CLAUDE.md and Readme file.
  22. 02:31Let's talk about that lint setup and what is ESLint in the first place.
  23. 02:37So an ESLint, we can think of it as a form of a spell check for code.
  24. 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
  25. 02:53going to be violating the rules written down over there.
  26. 02:56And you know, when we work in Figma, these rules is something that we can actually somehow relate to.
  27. 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
  28. 03:12their their layers or that they do actually care about naming their layers in the first place.
  29. 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.
  30. 03:27Then there are things such as we always design using variables or Figma styles.
  31. 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.
  32. 03:43So things that were often times, you know, like things that we were often times laughing on things like X or Twitter.
  33. 03:53So ESLint is basically a way to enforce similar set of rules automatically in our code.
  34. 03:59And depending on the code base, they might be set up in a different way.
  35. 04:03Uh, so let's see how this codebase, this imaginary codebase does it.
  36. 04:08So I'm going to go back to my Claude Code session.
  37. 04:11Uh, I'm going to open up First, I'm making sure again that I'm working within the right folder.
  38. 04:18Let me open up the file explorer.
  39. 04:20Um, so let's see.
  40. 04:21The first thing that I'm noticing over here is that there is a file that's called eslint.config.mjs.
  41. 04:28Um, and this is where all of these rules that are being enforced over here live.
  42. 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
  43. 04:43with these rules is by running a simple command, npm run lint.
  44. 04:49So it's going to do something like this.
  45. 04:51Depending on how large your codebase is, that might actually take a couple of minutes.
  46. 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
  47. 05:03everything is good. We have ESLint set up, but nothing is in violation.
  48. 05:08There are There aren't even warnings.
  49. 05:10So there are two kinds of outputs that we can see.
  50. 05:12We can have errors and we can have warnings uh depending on our configuration file, of course.
  51. 05:18Now, um there is also a husky folder and we can see there is a pre-push hook.
  52. 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
  53. 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.
  54. 05:47And over here we can see there are two things written down in this hook.
  55. 05:51So the lint needs to be green and the type check, which is another type of um you know spell check.
  56. 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
  57. 06:08examples, but in this case it's going to be errors.
  58. 06:11So let's see if we can actually if we can force an error in ESLint to show up.
  59. 06:19Okay, I'm going to head over to SRC and I'm going to get into features profile, profile form.
  60. 06:29And in this file we can see this is by the way this is that page over here.
  61. 06:41Yeah, this is a leftover from the previous module in which we were testing or stress testing the UI.
  62. 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.
  63. 06:54Let me find this text.
  64. 06:56It's right over here.
  65. 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.
  66. 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.
  67. 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.
  68. 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
  69. 07:43should cause an ESLint error.
  70. 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
  71. 07:57an error which means that I will be blocked from pushing this if I were ever to make a comment.
  72. 08:04And just for kicks I can ask Claude um to to try to commit and push this.
  73. 08:11Uh Claude, can you commit and then push the um the profile form uh profile form file for me uh without changing anything.
  74. 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
  75. 08:38push this commit over to the remote repository because um there was a problem.
  76. 08:45So let's give it a second.
  77. 08:48And there we have it.
  78. 08:49So the file is committed, but the push failed.
  79. 08:52So nothing is on GitHub yet.
  80. 08:55And the push the push failed because of the uh because of that lint uh errors.
  81. 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
  82. 09:14you know simple simple um you know typos like in here.
  83. 09:19Uh we can actually enforce uh a little bit more of high-level rules.
  84. 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
  85. 09:34own folder. And when you create a component over here, then you cannot import the same component from within a different feature.
  86. 09:42So if I create a component just for bookings, I cannot import it within spots.
  87. 09:46Uh if I were working on like anything that concerns spots, I cannot import it from a different folder.
  88. 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.
  89. 09:59but if this was a UI component, that should live in the components folder so that it can be shared with everything else.
  90. 10:06So this is another type of uh ESLint violation that would block us.
  91. 10:10and the best part is our Claude agents as well from actually pushing sloppy code.
  92. 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
  93. 10:27not really I don't know, slowing anyone down or making anyone's life miserable.
  94. 10:33But these rules are actually written down and enforced.
  95. 10:36And then there are there are these other types of rules, which is something we can basically figure out from the context.
  96. 10:45And it's for example the way like this team uses Git.
  97. 10:49So let me let me undo everything here.
  98. 10:53I'm going to class ask Claude to undo these changes, undo these changes.
  99. 10:58That was just a test.
  100. 11:00Drop the branch as well because I think it has created a branch as well.
  101. 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.
  102. 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.
  103. 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
  104. 11:42nice thing to keep an eye on.
  105. 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.
  106. 11:53And this is telling me, okay, this team, first of all, it seems to be doing squash merges.
  107. 11:58How do I know this?
  108. 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
  109. 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.
  110. 12:24And another thing that I can tell is that the way these commit messages look like.
  111. 12:30So some teams tend to use these conventional commits which we have only scratched the surface of in one of the previous videos.
  112. 12:38So scratch commits is something when you see like like a particular type of prefix before your commit.
  113. 12:47Something like feet for future when you are adding something new.
  114. 12:51So you would say instead of let's see my bookings page, right?
  115. 12:58So this would be my bookings page because we are adding a new feature.
  116. 13:02And then we have at CLAUDE.md with our conventions.
  117. 13:05That would be that would be this at CLAUDE.md with our conventions.
  118. 13:13We also let's see if we have any fixes here.
  119. 13:15Silence my or silence the Miranda Sans fallback from warning.
  120. 13:19So that would be fix silence the Miranda Miranda you get the gist of it.
  121. 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
  122. 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
  123. 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
  124. 13:57it actually tries to respect them every time you are contributing to this codebase.
  125. 14:01So let's see. I'm going to start a new session.
  126. 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
  127. 14:18working with Git Git in general.
  128. 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
  129. 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.
  130. 14:42Um, okay. I'm not even going to uh, I'm not even going to clean it up uh, Claude configure it out.
  131. 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
  132. 14:58lessons. Now I'm actually not sure.
  133. 15:00Let's see. Um, no, no.
  134. 15:03This isn't really documented anywhere.
  135. 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
  136. 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.
  137. 15:25Um, so that is something you would see in a like very well maintained codebase.
  138. 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
  139. 15:41and not cause any headaches.
  140. 15:43Um, so yeah, this is everything we need to know for now about uh, working with engineers and uh, knowing about their rules.
  141. 15:52Uh, it's good to know that some of them unenforced automatically.
  142. 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
  143. 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.
  144. 16:15And with that, I'm going to see you in the next video.

The cheat sheet is for signed-in viewers. Inside: the lesson's prompts ready to reuse, the commands and shortcuts, useful links and what to watch out for.

Sign in to get the cheat sheet

Loading the cheat sheet…