Claude Code for Product Designers
Lesson 41 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.4 Reviews and shared blind spots

Next lesson in 8 s

4.3 Automatic checks you'll meet

Adam fixes his CLAUDE.local.md so pushes and PRs go to his fork, pushes through the team's pre-push hook, then has Claude open his first PR. On GitHub he walks through the CI checks and what a good PR should show.

What you'll learn

  1. In this course, PRs go to your fork; check that CLAUDE.local.md says so.
  2. A pre-push hook runs lint and type checks before the push goes through.
  3. Forks have GitHub Actions off until you enable them; Actions minutes have a monthly limit (a generous one).
  4. CI (continuous integration) on a PR installs dependencies, lints, type-checks and builds the app; merge only when every check is green.
  5. npm run build builds the whole app (heavy); npm run dev compiles only the pages you open.
  6. If a check fails, ask Claude to look up the PR, investigate and fix it.
  7. A good PR shows what changes: screenshots or a short before/after video.

Chapters

  1. 00:00Pointing PRs at your fork
  2. 02:48Pushing through the pre-push hook
  3. 04:49Enabling Actions, opening the PR
  4. 06:21CI checks on the pull request
  5. 07:46Why the build runs in CI
  6. 09:53What a good PR shows
  1. 00:00Okay. Well, with the change being ready and hopefully tested thoroughly, locally, we are now ready to push the changes and raised our first PR so that we can see
  2. 00:12some of these automated tests and checks that we talked about in the previous in one of the previous videos.
  3. 00:19Before we before we make the push, however, let's take care of one thing that is related to this unique setup of this video course.
  4. 00:30So before because we have forked this GitHub repository and we made a clone of that forked GitHub repo, one thing that I want to take care of before I
  5. 00:42ask Claude to make the first push is I want to go back to my local CLAUDE.md file.
  6. 00:51And over here, I'm noticing I'm noticing that in one of the previous videos when I ask Claude to set up this file, it has wrongly assumed that whenever we
  7. 01:05push anything or whatever we raise a PR, this PR is not going to go to this forked version of our repository and instead it's going to go to this
  8. 01:15original version that's hosted on our organization.
  9. 01:18This is not something we want.
  10. 01:20This is you know, one of it might be a common way of working with work repos that you raise PRs to that original one.
  11. 01:30But over here, for the purposes of this course, we want to change that.
  12. 01:33We want to keep all of our PRs and pushes and branches locally on our forked version of the repo.
  13. 01:39So I'm going to I'm going to head over here to the view source button so that I can actually edit this local CLAUDE.md file.
  14. 01:49And I'm going to find a line in which it says region is my fork, upstream is the team repo.
  15. 01:56And I'm going to change that last sentence saying PRs go to um PRs go to my uh fork uh and never to the uh apps uh to the team
  16. 02:14repo tonic. Um PRs and pushes uh okay.
  17. 02:22So that is just to make sure Claude is never confused with that.
  18. 02:26If you skim through your local CLAUDE.md file and find a similar line, make sure to correct it.
  19. 02:32You can alternatively just spin up a really quick session with Sonnet and ask it whether it understands that whenever whenever whenever we are about to make a push um
  20. 02:42or raise a PR, this PR is going to be targeting our forked version of the repository.
  21. 02:47[snorts] Um okay, with that I'm going to close this and I 'm going to ask Claude to make the first um to make the first push um push the
  22. 02:57changes uh for now.
  23. 03:00And um as this is as Claude is going to be pushing the changes, uh we are going to witness that first check.
  24. 03:07So um we talked about these pre-push checks which are configured on this codebase and the configuration can be found over here in this Husky folder.
  25. 03:17We have that pre-push pre-push check.
  26. 03:20And so what is going to happen is we're going to see npm run lint and npm type check running uh in the background um and which is going to
  27. 03:30be essentially make it uh a little bit slower that like making that first push.
  28. 03:34But this is you know something that we want to make sure uh you know that our code is valid at this stage.
  29. 03:41So let's give it a second.
  30. 03:43Okay, this took a while because of my internet connection which basically which also um conveniently gave me an opportunity to clarify one thing in my uh ask for to
  31. 03:53Claude. And I just wanted to clarify that I would like for it to uh push the changes to my forked version of the repo just to be extra extra
  32. 04:01clear. Um the pre-push hook runs lint and type check before the push goes through.
  33. 04:06And um, basically um, yep.
  34. 04:12Okay, and we are good to go.
  35. 04:14So the change has been pushed.
  36. 04:16Um, I'm going to open up the Git graph.
  37. 04:19Uh, and I'm going to hit enter.
  38. 04:21And I can see it is indeed now like this commit lives both on my local version of this branch as well as the origin like or the remote version
  39. 04:30of this branch. So if I now go over here and refresh, I can see both the branches here as well as my first commit.
  40. 04:39Um, if this is here, it means that like there were no lint or type check errors, which is our first little success.
  41. 04:47Um, with this uh, what what follows usually is raising a PR.
  42. 04:53Now, another thing that we need to set up because of you know, this video course is in our fork version of the repository, we'll want to go into the
  43. 05:04actions tab and we'll want to enable workflows.
  44. 05:08So over here, we have just one simple workflow on GitHub that is going to perform, you know, very simple checks.
  45. 05:13Whenever GitHub is testing our PRs, it's also happening on virtual machines out there and we have a limit of of the on the number of minutes each month for
  46. 05:26which these checks or these virtual machines can run.
  47. 05:29It is very generous though and the the the the tests that we are about to see in a minute are going to be very very lightweight.
  48. 05:36So I'm going to just hit the I add or send my workflows, go ahead and enable them button.
  49. 05:42And with the GitHub actions enabled and also configured on this repository already, I'm going to go back to Claude and I'm going to ask it to open PR on
  50. 05:53fork. Um, and I'm going to hit enter.
  51. 05:57And because there are no other things to push, this should be fairly fairly quick.
  52. 06:04Now, I haven't said anything to Claude about like the the PR description because earlier on, we asked Claude to like review the history of commits and PRs in this
  53. 06:16repository and try to respect the conventions in this particular codebase and repository.
  54. 06:25So, let's see. The PR is open up.
  55. 06:29I'm going to go into the pull request tab here on GitHub.
  56. 06:33And this is the thing that I had in mind previously when we talked about enabling GitHub GitHub actions.
  57. 06:42So, the first type of automatic checks is you know that pre-push hook which is configured on this repository.
  58. 06:49But another type of checks that you are often times going to encounter are the checks or tests that are running on your PR directly on GitHub through things like
  59. 07:00GitHub actions. So, what is happening over here is GitHub is using a virtual machine to first of all install all of the dependencies.
  60. 07:10So, it's running that npm install command and it's going to also do the lint check, the ESLint check, the type check, and also it's going to build the application.
  61. 07:20And that last that last part is important because you really want to make sure when you merge the PR that it's going to have code for a working application
  62. 07:32that can be built.
  63. 07:33Otherwise, you are looking at a potential you know at a potential broken deployment or broken build and you really wouldn't want that.
  64. 07:42So, now that we have confirmed that this application is you know we can actually build this application, this PR is safe to be merged.
  65. 07:51Now, I could have checked that myself locally if I wanted to.
  66. 07:55I could open up I could open up a terminal and in that terminal what I can do is I could type in the npm run build command.
  67. 08:07Very similar to the npm run dev which opens up working version of the application locally, but the the difference between the npm run dev and npm run build is
  68. 08:19is with the npm run dev our computer basically compiles only the pages in the application that we happen to go into.
  69. 08:28Whereas when you go through the npm run build it's a much heavier process that's going to build all of the the entire application, all of the views.
  70. 08:36And when you work on you know like more heavy application this process can sometimes take a couple of minutes and depending on how strong your local computer is it
  71. 08:48can also drain a lot of the resources, which is why you typically don't really you know build applications locally and you instead offload some of this to these to
  72. 09:01this you know CI checks so called CI standing for continuous integration in here.
  73. 09:07So once over here we have just one simple check it's very common that you'll see a couple of rows with different types of checks depending on the the text
  74. 09:17setup or the text stack of your application.
  75. 09:20So it can sometimes take a couple of minutes for all of the texts to go green as they say, meaning you all you see are these grand green check
  76. 09:29marks and then and only then your PR is safe to be merged.
  77. 09:33Now if this check was ever to go red you would see at this red cross over here.
  78. 09:40You can go back to Claude and Claude you know can look up your PR and can offer a way to fix like can offer a way to investigate why
  79. 09:51the tests are failing and can offer a way to fix them.
  80. 09:55So that is how you would typically want to go about this.
  81. 09:59Let's also talk about the PR description.
  82. 10:02So over here it is pretty simple.
  83. 10:04Notice how how how much simpler it is from the PRs our Claude has been raising back when we were working on that first uh local only version of the
  84. 10:15um of the of the parking application.
  85. 10:18This is because again a couple of videos ago we asked Claude to see if there is any pattern for PR messages over here.
  86. 10:25It hasn't actually found anything.
  87. 10:27So it concluded that perhaps it's best to keep things simple.
  88. 10:31Usually you want your PR messages to be a bit more elaborate and when you onboard to an already existing repository chances are there's going to be plenty of better
  89. 10:40PR description examples that your Claude is going to um is going to use.
  90. 10:46One really important thing about raising a PR is making sure that everyone can preview what exactly or see what exactly is changing and how the application should look like
  91. 10:57with your changes merged.
  92. 10:59And sure you could ask them like the reviewer another engineer to just um fetch this like your branch um like like pull the changes from your branch locally and
  93. 11:11set up the application and run it.
  94. 11:14But a much more common example of or a much more common way to do it is just grabbing screenshots of like sometimes the before and after sometimes just the
  95. 11:24after changes. What I tend to do personally is recording really quick uh short uh Loom or Super Cut videos in which I'm showing the before and after and how
  96. 11:35the application should uh look after merging this PR.
  97. 11:39Uh so that is something you might be expected to do uh when you raise a PR uh in a team uh of other engineers.
  98. 11:47So yeah with that uh in the next video we're going to talk about how a process of code review can be different when working with other engineers.
  99. 11:56So I'll see you there.

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…