<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Quinn Zhu</title>
    <description>The latest articles on DEV Community by Quinn Zhu (@gitgo_5662).</description>
    <link>https://dev.to/gitgo_5662</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4064033%2F3b8164f8-c06e-456b-a431-d2555ccc9ea9.png</url>
      <title>DEV Community: Quinn Zhu</title>
      <link>https://dev.to/gitgo_5662</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gitgo_5662"/>
    <language>en</language>
    <item>
      <title>Audit the Diff Before You Push Your First PR</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Mon, 09 Nov 2026 21:11:24 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/audit-the-diff-before-you-push-your-first-pr-4mp</link>
      <guid>https://dev.to/gitgo_5662/audit-the-diff-before-you-push-your-first-pr-4mp</guid>
      <description>&lt;p&gt;Your first PR should be small enough to read in one sitting.&lt;br&gt;
Audit the diff before you push it, not after review starts.&lt;br&gt;
Three commands tell you if the change is reviewable.&lt;/p&gt;

&lt;p&gt;That matters more now than it did two years ago.&lt;br&gt;
Many first PRs today contain lines you did not type yourself.&lt;br&gt;
A reviewer still pays the full cost of reading them.&lt;/p&gt;

&lt;p&gt;Below is the pre-push audit I would run on any first PR.&lt;br&gt;
It is a checklist, not a gate — you still decide.&lt;br&gt;
Treat the numbers in the decision table as heuristics, not evidence.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1 — Anchor the diff to the merge base
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git diff main&lt;/code&gt; shows you changes you did not make.&lt;br&gt;
Your branch point is older than &lt;code&gt;main&lt;/code&gt;, so you see other people's work.&lt;br&gt;
Anchor to the merge base instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin
git merge-base HEAD origin/main
git diff &lt;span class="nt"&gt;--stat&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD origin/main&lt;span class="si"&gt;)&lt;/span&gt;..HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--stat&lt;/code&gt; output is your first honest look at the PR.&lt;br&gt;
If it lists files you never opened, stop and find out why.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2 — Count lines per file, not in total
&lt;/h2&gt;

&lt;p&gt;A 300-line PR in one new test file is easy to review.&lt;br&gt;
The same 300 lines across nine files is not.&lt;br&gt;
Sort by file and read the top of the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--numstat&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD origin/main&lt;span class="si"&gt;)&lt;/span&gt;..HEAD | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-k1&lt;/span&gt;,1nr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Columns are added, deleted, path.&lt;br&gt;
Binary files show &lt;code&gt;-&lt;/code&gt; instead of a count, so read those separately.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3 — Separate whitespace churn from real edits
&lt;/h2&gt;

&lt;p&gt;Editors and formatters rewrite whitespace without asking.&lt;br&gt;
Whitespace-only hunks hide your real change from the reviewer.&lt;br&gt;
Compare the diff with and without &lt;code&gt;-w&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--shortstat&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD origin/main&lt;span class="si"&gt;)&lt;/span&gt;..HEAD
git diff &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="nt"&gt;--shortstat&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD origin/main&lt;span class="si"&gt;)&lt;/span&gt;..HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A large gap between those two lines means reformatting happened.&lt;br&gt;
Either revert it, or land it as a separate commit.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4 — List the paths that should not move
&lt;/h2&gt;

&lt;p&gt;Lockfiles, build output, snapshots, and vendored code are the usual suspects.&lt;br&gt;
One install command can rewrite a lockfile you never meant to touch.&lt;br&gt;
Grep the changed file list before you push.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD origin/main&lt;span class="si"&gt;)&lt;/span&gt;..HEAD &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'(lock|\.min\.|dist/|vendor/|\.snap$)'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;none&lt;/code&gt; is the answer you want.&lt;br&gt;
Anything else needs a one-line justification in the PR description.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5 — Test the tree you are about to commit
&lt;/h2&gt;

&lt;p&gt;Your working tree is not your commit.&lt;br&gt;
Unstaged leftovers can make a broken commit look green.&lt;br&gt;
Stash everything except the index, then run the tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nt"&gt;-p&lt;/span&gt;                      &lt;span class="c"&gt;# stage hunks, not whole files&lt;/span&gt;
git stash push &lt;span class="nt"&gt;--keep-index&lt;/span&gt; &lt;span class="nt"&gt;--include-untracked&lt;/span&gt;
your-test-command               &lt;span class="c"&gt;# whatever CI runs, same args&lt;/span&gt;
git stash pop                   &lt;span class="c"&gt;# restore the rest&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Failures here are real failures for that commit.&lt;br&gt;
Watch two edge cases: tests that need your unstaged edits, and fixtures that only exist untracked.&lt;/p&gt;
&lt;h2&gt;
  
  
  The audit script
&lt;/h2&gt;

&lt;p&gt;The script below combines steps 1–4 into one run.&lt;br&gt;
&lt;strong&gt;It is illustrative and was not executed for this article.&lt;/strong&gt;&lt;br&gt;
Check each command against your own Git version before trusting it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# diff-audit.sh — illustrative, unverified here.&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;/main&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
git fetch &lt;span class="nt"&gt;--quiet&lt;/span&gt; origin
&lt;span class="nv"&gt;MB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git merge-base HEAD &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BASE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"merge-base: &lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== per-file line counts =="&lt;/span&gt;
git diff &lt;span class="nt"&gt;--numstat&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;..HEAD | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-k1&lt;/span&gt;,1nr

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== totals =="&lt;/span&gt;
git diff &lt;span class="nt"&gt;--shortstat&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;..HEAD
git diff &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="nt"&gt;--shortstat&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;..HEAD

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== suspicious paths =="&lt;/span&gt;
git diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;..HEAD &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'(lock|\.min\.|dist/|vendor/|\.snap$)'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"none"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== commits =="&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;..HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the commit list last.&lt;br&gt;
Three commits with one idea each beat one commit with three ideas.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where a free model fits in the loop
&lt;/h2&gt;

&lt;p&gt;Scope triage is repetitive and low-risk.&lt;br&gt;
That is a reasonable place to spend a free model call.&lt;br&gt;
MonkeyCode is presented as an open-source project with free model access and a free server option.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;The announcement I was given cites a large free token allowance on the order of ten million tokens.&lt;br&gt;
That number is operator-supplied, so verify the current terms on the project's official page before you rely on it.&lt;/p&gt;

&lt;p&gt;Here is the prompt shape I would use on a diff.&lt;br&gt;
&lt;strong&gt;Illustrative only — I have not run it, and its output is not verified.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are checking scope, not style.
For each changed file, output one line:
path | one-sentence intent | in-scope? (yes / no / unclear)
Ticket text:
&amp;lt;paste ticket&amp;gt;
Diff:
&amp;lt;paste git diff --numstat and the first 50 lines of git diff&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the result to ask better questions, not to skip reading.&lt;br&gt;
A model that says &lt;code&gt;in-scope: yes&lt;/code&gt; is not a reviewer.&lt;br&gt;
Also check your repository's policy before sending code to any external service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a free server option helps
&lt;/h2&gt;

&lt;p&gt;Sometimes the blocker is not the diff, it is the toolchain.&lt;br&gt;
A cold local setup can eat your whole first hour.&lt;br&gt;
If the project offers a free server option, run the audit and the test command there instead.&lt;/p&gt;

&lt;p&gt;Keep the split honest: audit locally, execute remotely, read output locally.&lt;br&gt;
Confirm the remote environment matches the CI image before trusting a green run.&lt;br&gt;
If you cannot confirm that, treat the result as a hint and say so in the PR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decision table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lockfile changed, ticket is unrelated&lt;/td&gt;
&lt;td&gt;Revert that file; do not reinstall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One commit touches many unrelated files&lt;/td&gt;
&lt;td&gt;Split by hunks with &lt;code&gt;git add -p&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;-w&lt;/code&gt; diff is much smaller than raw diff&lt;/td&gt;
&lt;td&gt;Land formatting separately or revert&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generated or vendored files moved&lt;/td&gt;
&lt;td&gt;Confirm the build step, or drop them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tests pass only with unstaged edits&lt;/td&gt;
&lt;td&gt;Fix the commit, not the stash&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These thresholds are judgment calls, not measurements.&lt;br&gt;
Your repo's size and review culture should override them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to verify your own audit
&lt;/h2&gt;

&lt;p&gt;You need a way to know the audit worked.&lt;br&gt;
Pick checks you can actually run.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Re-run the script after splitting. The per-file counts should drop.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;git show --stat HEAD&lt;/code&gt; and read the file list out loud.&lt;/li&gt;
&lt;li&gt;Ask the reviewer one question: "is any file here unexpected?"&lt;/li&gt;
&lt;li&gt;If CI fails, compare its command with the one you ran in step 5.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A diff audit that never changes your PR is not doing anything.&lt;br&gt;
Expect it to remove at least one file the first few times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should skip this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Single-line documentation fixes. The audit costs more than the change.&lt;/li&gt;
&lt;li&gt;Repos where the lockfile change is the point, such as dependency bumps.&lt;/li&gt;
&lt;li&gt;Repos that commit generated artifacts on purpose; there, &lt;code&gt;dist/&lt;/code&gt; belongs in the diff.&lt;/li&gt;
&lt;li&gt;Teams whose pre-commit hooks already run these checks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Close
&lt;/h2&gt;

&lt;p&gt;Your first PR is a reading request, not a code delivery.&lt;br&gt;
Make the reading short and the request explicit.&lt;br&gt;
Everything else — trust, review speed, follow-up work — follows from that.&lt;/p&gt;

&lt;p&gt;If you run the audit script, tell me which check caught something your eyes missed.&lt;br&gt;
That is the part worth writing down for the next newcomer.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>codequality</category>
      <category>ai</category>
    </item>
    <item>
      <title>Read Twenty Merged PRs Before You Open Your First One</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Sun, 08 Nov 2026 19:53:46 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/read-twenty-merged-prs-before-you-open-your-first-one-3pol</link>
      <guid>https://dev.to/gitgo_5662/read-twenty-merged-prs-before-you-open-your-first-one-3pol</guid>
      <description>&lt;p&gt;Your first PR is a culture test, not a code test.&lt;/p&gt;

&lt;p&gt;Most onboarding advice teaches you the code. That is the easy half. The hard half is knowing what reviewers on this team reject on sight.&lt;/p&gt;

&lt;p&gt;You can learn that from data already in the repo. Merged PRs and their review comments are usually readable by every contributor.&lt;/p&gt;

&lt;p&gt;This post gives you a read-only script. Run it in your first hour. Turn twenty merged PRs into a checklist you can satisfy on the first attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why review history beats the style guide
&lt;/h2&gt;

&lt;p&gt;A style guide tells you what the team says it wants. Review comments show what the team actually enforces. The gap between those two is where new contributors lose a week.&lt;/p&gt;

&lt;p&gt;You are not looking for opinions. You are looking for repetition. A comment that appears once is taste. A comment that appears nine times is a rule.&lt;/p&gt;

&lt;p&gt;Counting is boring and reliable. Reading twenty PRs by hand is neither.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Pull the last twenty merged PRs
&lt;/h2&gt;

&lt;p&gt;You need the GitHub CLI. Check that you are authenticated first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh auth status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then collect the merged PR list. Keep the output local and keep it small.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# review-intake.sh — read-only, writes only to /tmp&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;gh repo view &lt;span class="nt"&gt;--json&lt;/span&gt; nameWithOwner &lt;span class="nt"&gt;-q&lt;/span&gt; .nameWithOwner&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;LIMIT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;20&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;OUT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/tmp/intake-&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

gh &lt;span class="nb"&gt;pr &lt;/span&gt;list &lt;span class="nt"&gt;--repo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--state&lt;/span&gt; merged &lt;span class="nt"&gt;--limit&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LIMIT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--json&lt;/span&gt; number,title,additions,deletions,changedFiles &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/merged.json"&lt;/span&gt;

jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.[] | [.number, .additions, .deletions, .title] | @tsv'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/merged.json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The size columns matter. If every merged PR touches two files and yours touches nineteen, that is a signal before review even starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Turn review comments into a frequency table
&lt;/h2&gt;

&lt;p&gt;Now fetch the comment bodies. Reviews and inline comments live in two endpoints, so call both.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/comments.txt"&lt;/span&gt;
: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/paths.txt"&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;n &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.[].number'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/merged.json"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;gh api &lt;span class="s2"&gt;"repos/&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;/pulls/&lt;/span&gt;&lt;span class="nv"&gt;$n&lt;/span&gt;&lt;span class="s2"&gt;/comments"&lt;/span&gt; &lt;span class="nt"&gt;--paginate&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="s1"&gt;'.[].body'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/comments.txt"&lt;/span&gt;
  gh api &lt;span class="s2"&gt;"repos/&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;/pulls/&lt;/span&gt;&lt;span class="nv"&gt;$n&lt;/span&gt;&lt;span class="s2"&gt;/reviews"&lt;/span&gt; &lt;span class="nt"&gt;--paginate&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="s1"&gt;'.[].body // empty'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/comments.txt"&lt;/span&gt;
  gh api &lt;span class="s2"&gt;"repos/&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;/pulls/&lt;/span&gt;&lt;span class="nv"&gt;$n&lt;/span&gt;&lt;span class="s2"&gt;/comments"&lt;/span&gt; &lt;span class="nt"&gt;--paginate&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="s1"&gt;'.[].path // empty'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/paths.txt"&lt;/span&gt;
&lt;span class="k"&gt;done

&lt;/span&gt;&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/comments.txt"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If that line count is under fifty, stop here. Twenty PRs without comments teach you nothing about review culture.&lt;/p&gt;

&lt;p&gt;Next, count the words reviewers repeat. Crude keywords are enough for a first pass.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oiE&lt;/span&gt; &lt;span class="s1"&gt;'\b(test|tests|coverage|nit|squash|rebase|changelog|naming|typo|revert|scope|breaking|docs)\b'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/comments.txt"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;'A-Z'&lt;/span&gt; &lt;span class="s1"&gt;'a-z'&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the top eight lines out loud. You now know what this team argues about.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Map the comments back to files
&lt;/h2&gt;

&lt;p&gt;File paths tell you where the arguments concentrate. That is where your first PR should be careful, or absent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;/paths.txt"&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three outcomes are common. Hot files are under active review pressure. Quiet files are safe first targets. Config and CI files often collect the angriest comments of all.&lt;/p&gt;

&lt;p&gt;Write the top five paths into a note. You will use them when you pick your ticket.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Write the checklist before you write code
&lt;/h2&gt;

&lt;p&gt;Convert frequencies into rules. Keep each line testable, so you can answer yes or no.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# My First-PR Checklist (from 20 merged PRs)&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; [ ] Diff touches 3 files or fewer
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Tests run locally; output pasted in the PR body
&lt;span class="p"&gt;-&lt;/span&gt; [ ] No changes under .github/ without asking
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Commit messages squashed to one, per merged-PR pattern
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Changelog entry added if docs/ appears in the diff
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Reviewer tagged who reviewed similar files last month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Six lines is plenty. A checklist you finish beats a policy you skim.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Optional: let a model cluster the comments
&lt;/h2&gt;

&lt;p&gt;Keyword counts miss synonyms. A model can group comments into themes like naming, test coverage, and scope creep.&lt;/p&gt;

&lt;p&gt;This is where a free model endpoint helps. The MonkeyCode project offers free model access and a free server option, which is enough for a one-off clustering run on a small text file. Both are operator-supplied here; check current limits, terms, and data handling in the project's own documentation before you depend on them.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Two rules keep this step honest. First, feed comment text only if your org allows it. Review comments frequently quote private code. Second, verify every cluster against the raw lines that produced it. A cluster without a quoted line is a guess.&lt;/p&gt;

&lt;p&gt;The script from step 3 stays the source of truth. The model only reorders it.&lt;/p&gt;

&lt;p&gt;If you would rather not set up local tokens for a throwaway repo, running the script on a free server workspace is a reasonable alternative. Same rules apply: read-only calls, output to a temp directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Put your rollback line in the PR body
&lt;/h2&gt;

&lt;p&gt;Write the revert command for your own PR before you open it. Paste it into the description under a heading called Rollback.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git revert &lt;span class="nt"&gt;-m&lt;/span&gt; 1 &amp;lt;merge-commit-sha&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Squash-merge repos are simpler. The command is &lt;code&gt;git revert &amp;lt;sha&amp;gt;&lt;/code&gt; against the squashed commit.&lt;/p&gt;

&lt;p&gt;Writing that line does two things. It proves you checked the merge strategy. It also gives the next person a copy-paste path when your patch breaks something at 2am.&lt;/p&gt;

&lt;p&gt;If your PR cannot be reverted cleanly, the PR is too large. Split it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;This method measures words, not severity. One blocking objection can outweigh twenty nits, and the script cannot tell them apart.&lt;/p&gt;

&lt;p&gt;It also fails on young repos. Fewer than twenty merged PRs means noise, not patterns, and squashed histories hide commit hygiene entirely.&lt;/p&gt;

&lt;p&gt;Comment counts skew toward chatty reviewers. Quiet reviewers still reject PRs, so treat the table as a starting hypothesis and confirm it with a human.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should skip this
&lt;/h2&gt;

&lt;p&gt;Skip it if your team reviews in chat and merges without comments. Skip it if the repo is private and your org forbids any external model call. Skip it if you already have a maintained contributor guide that reviewers actually cite.&lt;/p&gt;

&lt;p&gt;Everyone else: spend forty minutes in hour one. Open your first PR with fewer surprises, and with a revert line already written.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Your First Hour in a New Repo: Write the Map Before the Patch</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Sat, 07 Nov 2026 18:36:32 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/your-first-hour-in-a-new-repo-write-the-map-before-the-patch-2469</link>
      <guid>https://dev.to/gitgo_5662/your-first-hour-in-a-new-repo-write-the-map-before-the-patch-2469</guid>
      <description>&lt;h1&gt;
  
  
  Your First Hour in a New Repo: Write the Map Before the Patch
&lt;/h1&gt;

&lt;p&gt;Conclusion first: the map is the deliverable of your first hour. A one-page repo map makes your first PR small. It also makes your first rollback boring.&lt;/p&gt;

&lt;p&gt;Most onboarding advice says "read the code". That advice is too vague to act on. You cannot read a whole repo in an hour, but you can map it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Read the contract files, not the source (minutes 0–10)
&lt;/h2&gt;

&lt;p&gt;Four files decide how the repo really works. Find them before anything else.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;README&lt;span class="k"&gt;*&lt;/span&gt; CONTRIBUTING&lt;span class="k"&gt;*&lt;/span&gt; .github/workflows 2&amp;gt;/dev/null
&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-120&lt;/span&gt; .github/workflows/&lt;span class="k"&gt;*&lt;/span&gt;.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CI file is the truth. The README is a wish. When they disagree, trust the pipeline that gates merges.&lt;/p&gt;

&lt;p&gt;Write down three things: the install command, the test command, the deploy branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Generate the map with a script (minutes 10–25)
&lt;/h2&gt;

&lt;p&gt;Do not do this by hand. Run the same script every time you join a repo. This is the artifact you keep.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# repo-map.sh — run from the repo root, first hour, read-only&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"repo-map.md"&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"# Repo map (&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; +%FT%TZ&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt;
  &lt;span class="nb"&gt;echo
  echo&lt;/span&gt; &lt;span class="s2"&gt;"## Head"&lt;/span&gt;
  git log &lt;span class="nt"&gt;-1&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'%h %an %ad %s'&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;short
  &lt;span class="nb"&gt;echo
  echo&lt;/span&gt; &lt;span class="s2"&gt;"## Size and churn"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"- tracked files: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git ls-files | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"- commits, 90d: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-list &lt;span class="nt"&gt;--count&lt;/span&gt; &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;90.days HEAD&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;echo
  echo&lt;/span&gt; &lt;span class="s2"&gt;"## Hot files (90d, by commit count)"&lt;/span&gt;
  git log &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;90.days &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="nt"&gt;--pretty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;format: &lt;span class="se"&gt;\&lt;/span&gt;
    | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s1"&gt;'^$'&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
  &lt;span class="nb"&gt;echo
  echo&lt;/span&gt; &lt;span class="s2"&gt;"## Test entry points"&lt;/span&gt;
  &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-RIn&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*.yml'&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*.yaml'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'run: .*(test|pytest|jest|go test|mvn)'&lt;/span&gt; .github 2&amp;gt;/dev/null | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
  &lt;span class="nb"&gt;echo
  echo&lt;/span&gt; &lt;span class="s2"&gt;"## Risky paths present"&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;p &lt;span class="k"&gt;in &lt;/span&gt;migrations/ schema/ infra/ Dockerfile .env.example&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$p&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"- &lt;/span&gt;&lt;span class="nv"&gt;$p&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$out&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"wrote &lt;/span&gt;&lt;span class="nv"&gt;$out&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the output once, then trim it into your first PR description. Reviewers recognise their own repo faster than you can describe it.&lt;/p&gt;

&lt;p&gt;The hot-file list is the important part. Files that change every week break in ways you cannot predict. That is where your first bug will come from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Pin the baseline before you change anything (minutes 25–40)
&lt;/h2&gt;

&lt;p&gt;You need one known-good log on disk. Keep it out of your memory and out of git.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; .local
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'.local/'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .git/info/exclude
&lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="nb"&gt;time &lt;/span&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .local/baseline.log 2&amp;gt;&amp;amp;1 &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true
grep&lt;/span&gt; &lt;span class="nt"&gt;-cE&lt;/span&gt; &lt;span class="s1"&gt;'^(FAIL|FAILED)'&lt;/span&gt; .local/baseline.log &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true
grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'^(FAIL|FAILED)'&lt;/span&gt; .local/baseline.log | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap &lt;code&gt;npm test&lt;/code&gt; for the command you copied in Step 1. Record the wall time next to it, because slow suites change how you work.&lt;/p&gt;

&lt;p&gt;If the suite is already red, that is your starting line. Never "fix" a red baseline inside your first PR. Note the failing names and move on.&lt;/p&gt;

&lt;p&gt;A red baseline is information, not an emergency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Pick a first PR by blast radius, not by interest (minutes 40–55)
&lt;/h2&gt;

&lt;p&gt;Score two or three candidate files. The lowest score wins, even if it looks boring.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;Safe first PR&lt;/th&gt;
&lt;th&gt;Walk away&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Diff size&lt;/td&gt;
&lt;td&gt;under 50 lines&lt;/td&gt;
&lt;td&gt;over 300 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tests&lt;/td&gt;
&lt;td&gt;file has tests, or a close neighbour does&lt;/td&gt;
&lt;td&gt;no tests in the area&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema or migrations&lt;/td&gt;
&lt;td&gt;untouched&lt;/td&gt;
&lt;td&gt;touched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI config&lt;/td&gt;
&lt;td&gt;untouched&lt;/td&gt;
&lt;td&gt;changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;History&lt;/td&gt;
&lt;td&gt;several small reviewed commits&lt;/td&gt;
&lt;td&gt;one giant commit, no review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Revert cost&lt;/td&gt;
&lt;td&gt;one &lt;code&gt;git revert&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;needs a data fix&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two rules of thumb. Pick a file with tests, not a file with TODOs. If &lt;code&gt;git log&lt;/code&gt; shows one author and zero reviews, ask before you touch it.&lt;/p&gt;

&lt;p&gt;Log your scores in the issue. Future you will want the reasoning, not just the diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Write the rollback line before you open the PR (minutes 55–60)
&lt;/h2&gt;

&lt;p&gt;Put the exact revert command in the PR body. This takes ten seconds and saves an hour later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git symbolic-ref &lt;span class="nt"&gt;--short&lt;/span&gt; refs/remotes/origin/HEAD
git revert &lt;span class="nt"&gt;--no-edit&lt;/span&gt; &amp;lt;merge-or-squash-sha&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;merge-or-squash-sha&amp;gt;&lt;/code&gt; with the commit your PR actually produced. Check the default branch name first, because it is not always &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you cannot write the revert line, your PR is too big. Split it now, not after review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a model actually helps in hour one
&lt;/h2&gt;

&lt;p&gt;The map is mechanical reading. That is the right job for an AI assistant. Ask it to summarise, not to design.&lt;/p&gt;

&lt;p&gt;Three safe prompts for a new repo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;"List every command in this workflow file and what triggers it."&lt;/li&gt;
&lt;li&gt;"Which files under src/ have no test file with a matching name?"&lt;/li&gt;
&lt;li&gt;"Draft a five-line PR body from this diff and this baseline log."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every answer needs one check against the repo. Paste the command you ran beside the summary, or the summary is a rumour.&lt;/p&gt;

&lt;p&gt;This is where MonkeyCode's free tier fits my onboarding habit. The project offers free model access and a free server option. Free tokens let a newcomer ask boring questions all week without a budget conversation. A free server option matters when the suite needs a machine you do not own.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Free allowances change. Verify current limits and terms on the project's own page before you plan around them. Never treat a free tier as a permanent guarantee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is for a repo you did not write. If you are the main author, skip the map.&lt;/li&gt;
&lt;li&gt;Monorepos with a forty-minute suite need a different baseline. Start with the fastest subset only.&lt;/li&gt;
&lt;li&gt;Regulated codebases may forbid sending repo content to any hosted model. Check policy, then use local tooling.&lt;/li&gt;
&lt;li&gt;If your team already has an onboarding doc, extend it. Do not create a second source of truth.&lt;/li&gt;
&lt;li&gt;If the repo has no working test command, stop mapping. Fixing that comes first, and it is not your first PR.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The 60-minute checklist
&lt;/h2&gt;

&lt;p&gt;Copy this into your first issue or notes file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Install command copied from the workflow file, not the README&lt;/li&gt;
&lt;li&gt;[ ] Test command and measured runtime recorded&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;repo-map.md&lt;/code&gt; generated and pasted into your notes&lt;/li&gt;
&lt;li&gt;[ ] Baseline log saved at &lt;code&gt;.local/baseline.log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Candidate file scored with the blast-radius table&lt;/li&gt;
&lt;li&gt;[ ] Revert command written in the PR body&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do this once per repo. The second repo takes ten minutes. Ship small, revert clean.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>git</category>
      <category>ai</category>
      <category>testing</category>
    </item>
    <item>
      <title>Your First Review Loop: Turn Reviewer Comments Into Fixup Commits</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Fri, 06 Nov 2026 17:14:08 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/your-first-review-loop-turn-reviewer-comments-into-fixup-commits-1of1</link>
      <guid>https://dev.to/gitgo_5662/your-first-review-loop-turn-reviewer-comments-into-fixup-commits-1of1</guid>
      <description>&lt;p&gt;Review comments are not a task list yet. They are raw text from a busy reviewer. Your first job is to convert them into small, checkable commits.&lt;/p&gt;

&lt;p&gt;This loop does that in one sitting. You write a ledger, sort each comment, push fixups, then prove the diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Write the comment ledger before you edit
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;review-ledger.md&lt;/code&gt; on your branch. Do not change code until every comment has a row.&lt;/p&gt;

&lt;p&gt;Paste each comment verbatim. Keep the reviewer's typos and the file path.&lt;/p&gt;

&lt;p&gt;Then add five empty columns. They force a decision instead of a reflex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| # | Comment (verbatim) | Kind | Action | Commit | Status |
|---|--------------------|------|--------|--------|--------|
| 1 | "this breaks the retry path" | blocker | fix | | open |
| 2 | "why not reuse parse()?" | question | reply | | open |
| 3 | "typo in the comment above" | nit | batch | | open |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the ledger in the repo for the review. Delete it in the squash commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Sort every comment into one kind
&lt;/h2&gt;

&lt;p&gt;Sorting is the whole skill. Most first PRs stall because nits and blockers get equal weight.&lt;/p&gt;

&lt;p&gt;Use this table. If a row fits two kinds, pick the heavier one.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kind&lt;/th&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;What you do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Blocker&lt;/td&gt;
&lt;td&gt;"breaks", "wrong", "will fail"&lt;/td&gt;
&lt;td&gt;Fix it now, in code, in a fixup commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Question&lt;/td&gt;
&lt;td&gt;Ends with &lt;code&gt;?&lt;/code&gt;, asks for reasoning&lt;/td&gt;
&lt;td&gt;Answer in the thread first, code only if needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nit&lt;/td&gt;
&lt;td&gt;Formatting, naming, typos&lt;/td&gt;
&lt;td&gt;Batch all nits into one fixup commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Out of scope&lt;/td&gt;
&lt;td&gt;"we should also…"&lt;/td&gt;
&lt;td&gt;Open a follow-up issue, link it, do not code it here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Disagreement&lt;/td&gt;
&lt;td&gt;"I'd do it differently"&lt;/td&gt;
&lt;td&gt;Ask for one concrete failing case, then agree on a test&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Never argue about taste in a comment thread. Ask for a test instead. A test ends the debate in one round.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Check your branch state first
&lt;/h2&gt;

&lt;p&gt;Run this small script before you touch anything. It shows what the reviewer actually sees.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# review-loop.sh — run from the repo root, on your PR branch&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;/main&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

git fetch origin &lt;span class="nt"&gt;--quiet&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'branch: %s\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-parse &lt;span class="nt"&gt;--abbrev-ref&lt;/span&gt; HEAD&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'base:   %s\n\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BASE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== commits ahead of base =="&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BASE&lt;/span&gt;&lt;span class="s2"&gt;..HEAD"&lt;/span&gt;

&lt;span class="nb"&gt;echo
echo&lt;/span&gt; &lt;span class="s2"&gt;"== files touched =="&lt;/span&gt;
git diff &lt;span class="nt"&gt;--stat&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BASE&lt;/span&gt;&lt;span class="s2"&gt;...HEAD"&lt;/span&gt;

&lt;span class="nb"&gt;echo
echo&lt;/span&gt; &lt;span class="s2"&gt;"== untracked files (should be empty) =="&lt;/span&gt;
git status &lt;span class="nt"&gt;--porcelain&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'^??'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"none"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file list surprises you, stop. Fix the branch before answering review comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Land each blocker as a fixup commit
&lt;/h2&gt;

&lt;p&gt;Do not add a commit called "fix review". That buries the change history.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;--fixup&lt;/code&gt; pointed at the commit that owns the lines. The history stays readable after the squash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# stage only the blocker fix, hunk by hunk&lt;/span&gt;
git add &lt;span class="nt"&gt;-p&lt;/span&gt; src/retry.ts

&lt;span class="c"&gt;# attach it to the commit that introduced the bug&lt;/span&gt;
git commit &lt;span class="nt"&gt;--fixup&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3f2a9c1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat for each blocker. One blocker, one fixup, one ledger row.&lt;/p&gt;

&lt;p&gt;Then fold them in without opening an editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;GIT_SEQUENCE_EDITOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;: git rebase &lt;span class="nt"&gt;--autosquash&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; origin/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;GIT_SEQUENCE_EDITOR=:&lt;/code&gt; accepts the reordered todo list as-is. Check the log before you trust it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Prove the rebase changed only what you meant
&lt;/h2&gt;

&lt;p&gt;Rewriting history on a PR branch is safe only if you verify it. Use &lt;code&gt;git range-diff&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Capture the old head first, then compare after the rebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;OLD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-parse HEAD&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# ... rebase, fixups applied ...&lt;/span&gt;

git range-diff origin/main &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OLD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the markers carefully. &lt;code&gt;=&lt;/code&gt; means the commit is unchanged. &lt;code&gt;!&lt;/code&gt; means the content moved. &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; mean a commit disappeared or appeared.&lt;/p&gt;

&lt;p&gt;If an &lt;code&gt;!&lt;/code&gt; shows up in a commit you never touched, stop and read the patch. That is how accidental rewrites reach production.&lt;/p&gt;

&lt;p&gt;Then push with the safe flag. Never plain force-push a shared branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;--force-with-lease&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Reply with commit hashes, not promises
&lt;/h2&gt;

&lt;p&gt;Update each ledger row with the fixup hash. Then post one short reply per thread.&lt;/p&gt;

&lt;p&gt;Good reply shape: what changed, where, and how the reviewer can check.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fixed in &lt;code&gt;3f2a9c1&lt;/code&gt;. The retry path now reads &lt;code&gt;attempt &amp;lt; maxAttempts&lt;/code&gt;. Covered by &lt;code&gt;retry.spec.ts&lt;/code&gt; case 4.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That reply takes twenty seconds. It saves the reviewer a diff hunt.&lt;/p&gt;

&lt;p&gt;For questions, answer before you code. A wrong assumption in code costs more than a sentence in a thread.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Use a disposable machine for the repro
&lt;/h2&gt;

&lt;p&gt;Sometimes a reviewer reports a failure you cannot reproduce locally. Your laptop has stale caches and local env files.&lt;/p&gt;

&lt;p&gt;A throwaway environment settles it. MonkeyCode offers free model access and a free server option, as described by its maintainers.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Run the reviewer's exact steps on a clean box. Do not copy your &lt;code&gt;.env&lt;/code&gt; or any real tokens onto it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# on the disposable server, fresh clone only&lt;/span&gt;
git clone &amp;lt;your-fork-url&amp;gt; pr-repro &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;pr-repro
git switch review/fix-loop

&lt;span class="c"&gt;# run only the failing test first&lt;/span&gt;
./scripts/test.sh &lt;span class="nt"&gt;--filter&lt;/span&gt; RetryPath
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it fails there and passes on your laptop, the bug is environmental. Say that in the thread. Do not guess.&lt;/p&gt;

&lt;p&gt;Free model access helps in one narrow place here. Paste the long review thread and ask for a draft ledger.&lt;/p&gt;

&lt;p&gt;Then check every row against the real comment. Models invent plausible comments that were never written. Treat the output as a first draft, never as the record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;p&gt;This loop assumes a branch you own and a reviewer who will re-read it. Several cases break it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Heavy monorepos.&lt;/strong&gt; If a clean build takes thirty minutes, a disposable box per repro is a tax, not a shortcut.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict data policies.&lt;/strong&gt; If review threads or code cannot leave your network, keep the ledger local and skip any hosted assistance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared release branches.&lt;/strong&gt; Do not rebase and force-push a branch other people build on. Use merge commits there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reviewers who read email only.&lt;/strong&gt; Force-push notifies nobody useful. Post the commit hash in the thread too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also skip the fixup flow during an active release freeze. Rebasing behind a cut branch creates more confusion than it removes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you should have after one loop
&lt;/h2&gt;

&lt;p&gt;You end with three artifacts: a ledger with no open rows, a branch whose diff you can explain commit by commit, and a short evidence trail in the thread.&lt;/p&gt;

&lt;p&gt;That is a repeatable habit, not a one-off. Your second PR review will take half the time.&lt;/p&gt;

&lt;p&gt;If you want to try the free model access and the free server option, start from the project's own documentation and check current limits there.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>codequality</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Your First PR Needs Two Test Runs, Not One</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Thu, 05 Nov 2026 15:52:31 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/your-first-pr-needs-two-test-runs-not-one-1g96</link>
      <guid>https://dev.to/gitgo_5662/your-first-pr-needs-two-test-runs-not-one-1g96</guid>
      <description>&lt;p&gt;Your first PR will fail tests you did not break. Most newcomers cannot tell their breakage from pre-existing debt. The fix is boring: record a baseline before you edit, then diff against it.&lt;/p&gt;

&lt;p&gt;This drill takes about 40 minutes on a repo whose suite runs in under ten. You need git, a clean checkout, and one throwaway machine. You do not need permission to touch CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why pass/fail counts mislead a newcomer
&lt;/h2&gt;

&lt;p&gt;A red suite tells you nothing about ownership. The count blends your change with old debt, flaky tests, and services that never started. Two runs of the same commit can also disagree.&lt;/p&gt;

&lt;p&gt;So stop counting failures. Compare sets of normalized failure lines instead. That comparison answers one question: did my edit create this?&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Freeze a baseline commit
&lt;/h2&gt;

&lt;p&gt;Check out the commit your branch starts from. Never benchmark on your dirty working tree. A stale virtualenv or a half-installed dependency will manufacture failures that belong to nobody.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin
git switch &lt;span class="nt"&gt;-c&lt;/span&gt; probe/baseline &amp;lt;base-sha&amp;gt;
git status &lt;span class="nt"&gt;--short&lt;/span&gt;   &lt;span class="c"&gt;# must be empty&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;git status&lt;/code&gt; prints anything, stash it before you continue. A clean tree is the whole point of a baseline.&lt;/p&gt;

&lt;p&gt;This is also where a remote sandbox earns its keep. Your laptop has a history; a fresh box does not. MonkeyCode, an open-source coding agent project, currently offers a free server option that can hold this throwaway baseline box. Disclosure: This article was prepared as part of MonkeyCode's product outreach. Verify current terms and quota on the project page before you rely on them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# on the sandbox, not your laptop&lt;/span&gt;
git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 50 &amp;lt;repo-url&amp;gt; probe-baseline
&lt;span class="nb"&gt;cd &lt;/span&gt;probe-baseline
git checkout &amp;lt;base-sha&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the suite once before your change and once after. Same machine, same env, same commit history. That control is what makes the diff readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Turn noise into fingerprints
&lt;/h2&gt;

&lt;p&gt;Raw logs are unusable for comparison. Timings move, paths move, IDs move. Normalize them into a sorted set of stable lines.&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;fp.sh&lt;/code&gt; and make it executable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail
&lt;span class="nv"&gt;LOG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;:?usage:&lt;span class="p"&gt; fp.sh test-output.log&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'^(FAIL|ERROR|not ok|✗)'&lt;/span&gt; &lt;span class="nv"&gt;$LOG&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'s/[0-9]+([.][0-9]+)?(ms|s)//g'&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'s/[[:space:]]+/ /g'&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things happen here. It keeps only failure-shaped lines. It strips durations and collapses whitespace. It sorts and deduplicates, so ordering cannot create fake diffs.&lt;/p&gt;

&lt;p&gt;The pattern is runner-specific. Go's &lt;code&gt;--- FAIL&lt;/code&gt; and pytest's &lt;code&gt;FAILED&lt;/code&gt; need their own grep branches. Write the rule once for your repo's runner and commit the script next to the tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Record the baseline set
&lt;/h2&gt;

&lt;p&gt;Run the suite and capture output even when it fails. &lt;code&gt;|| true&lt;/code&gt; is not sloppiness here; a red baseline is expected input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; baseline.log 2&amp;gt;&amp;amp;1 &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
./fp.sh baseline.log &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; fp.before
&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; fp.before
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it twice if you can afford the minutes. A fingerprint that appears in one run and not the other is flaky, and flaky noise will wreck your later diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Make the smallest possible edit
&lt;/h2&gt;

&lt;p&gt;Now change one thing. One function, one guard, one test. Not a refactor plus a fix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; fix/one-thing
&lt;span class="c"&gt;# edit&lt;/span&gt;
make &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; after.log 2&amp;gt;&amp;amp;1 &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
./fp.sh after.log &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; fp.after
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small diffs keep the fingerprint delta small. If your edit touches ten files, you will not know which one moved the set.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Read the delta, not the totals
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;comm&lt;/span&gt; &lt;span class="nt"&gt;-13&lt;/span&gt; fp.before fp.after   &lt;span class="c"&gt;# new failures: likely yours&lt;/span&gt;
&lt;span class="nb"&gt;comm&lt;/span&gt; &lt;span class="nt"&gt;-23&lt;/span&gt; fp.before fp.after   &lt;span class="c"&gt;# vanished failures: you fixed something&lt;/span&gt;
&lt;span class="nb"&gt;comm&lt;/span&gt; &lt;span class="nt"&gt;-12&lt;/span&gt; fp.before fp.after   &lt;span class="c"&gt;# shared failures: pre-existing, leave them&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sort first if your &lt;code&gt;comm&lt;/code&gt; complains. &lt;code&gt;sort -u&lt;/code&gt; in the script already guarantees sorted input.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Observed delta&lt;/th&gt;
&lt;th&gt;Likely meaning&lt;/th&gt;
&lt;th&gt;Your move&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New fingerprints only&lt;/td&gt;
&lt;td&gt;Your edit broke behavior&lt;/td&gt;
&lt;td&gt;Fix your edit; do not fix the test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No delta, same failures&lt;/td&gt;
&lt;td&gt;Your edit is invisible so far&lt;/td&gt;
&lt;td&gt;Add the missing assertion or wiring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vanished fingerprints&lt;/td&gt;
&lt;td&gt;You changed unrelated behavior&lt;/td&gt;
&lt;td&gt;Revert the extra change before review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New fingerprints matching a flaky test&lt;/td&gt;
&lt;td&gt;Noise, not regression&lt;/td&gt;
&lt;td&gt;Rerun baseline; note the flake in the PR&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Write the three &lt;code&gt;comm&lt;/code&gt; lines into the PR description. Reviewers read a delta in seconds. They will not read a 400-line log.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Use a model for intent, not for a patch
&lt;/h2&gt;

&lt;p&gt;When a fingerprint is yours, the useful question is what the test was protecting. Ask that before you ask for code. A model reading the test file plus the failing assertion can name the behavior and the files involved.&lt;/p&gt;

&lt;p&gt;A prompt that works, kept narrow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here is one failing test and its assertion output.
Do not write a patch.
Answer: which behavior does this test assert,
and which source files does it exercise?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then read those files yourself. Patch generation is the easy part and the least trustworthy. A newcomer who can explain why a test exists reviews far better than one who accepts a diff.&lt;/p&gt;

&lt;p&gt;This is where free model access lowers the entry cost. MonkeyCode's outreach materials state a free token allowance, listed as 10M tokens as of November 2026, alongside the free server option. I have not independently verified limits, duration, or model selection. Treat those as current claims, not guarantees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits you should respect
&lt;/h2&gt;

&lt;p&gt;Fingerprint normalization is language-specific and needs maintenance. A suite that takes 25 minutes breaks the two-run loop. A permanently red baseline means the method cannot isolate your change, so escalate instead.&lt;/p&gt;

&lt;p&gt;Flaky tests will still lie to you. Rerun before you believe any new fingerprint.&lt;/p&gt;

&lt;p&gt;Do not paste proprietary code or secrets into a hosted model without written approval. If your team bans third-party tools, run the whole drill locally and skip Step 6.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should not use this
&lt;/h2&gt;

&lt;p&gt;Skip it during a live incident. You need a revert, not a baseline. Skip it on repos with no runnable local tests; fix the test command first.&lt;/p&gt;

&lt;p&gt;Also skip it if you are tempted to treat the delta as a substitute for reading code. The fingerprints tell you where to look. They do not tell you what the code should do.&lt;/p&gt;

&lt;h2&gt;
  
  
  The habit worth keeping
&lt;/h2&gt;

&lt;p&gt;Two runs, one diff, one question. That habit survives your first week, your first review, and your first agent-assisted PR.&lt;/p&gt;

&lt;p&gt;If you want to rehearse it without provisioning a machine, the sandbox route is the cheapest way to get a clean baseline box. Run the drill once on a repo you have not touched, and you will stop guessing which failures are yours.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>git</category>
      <category>testing</category>
      <category>ai</category>
    </item>
    <item>
      <title>Let the Existing Tests Choose Your First PR</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Tue, 27 Oct 2026 13:22:48 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/let-the-existing-tests-choose-your-first-pr-1in6</link>
      <guid>https://dev.to/gitgo_5662/let-the-existing-tests-choose-your-first-pr-1in6</guid>
      <description>&lt;p&gt;Your first pull request should be chosen by a test, not by curiosity.&lt;/p&gt;

&lt;p&gt;Curiosity sends you to the files that are fun to read. Tests send you to the files that are safe to change. On day one you cannot tell those apart by reading alone.&lt;/p&gt;

&lt;p&gt;This drill takes about an hour. It ends with one small PR and a baseline you can actually trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 0 — Fix your question in one sentence
&lt;/h2&gt;

&lt;p&gt;Write the question down before you open a single source file.&lt;/p&gt;

&lt;p&gt;A usable question looks like this: "Does &lt;code&gt;invoice_total()&lt;/code&gt; include tax on refunds?" A useless one looks like: "How does billing work?" The first can be answered by a test. The second can absorb your whole week.&lt;/p&gt;

&lt;p&gt;Keep the question where you will see it. A line at the top of your scratch branch is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — Map which tests already name your file
&lt;/h2&gt;

&lt;p&gt;Pick one candidate file. Then let git tell you who already checks its behavior.&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;name-the-test.sh&lt;/code&gt; in your scratch clone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# name-the-test.sh — find the tests that already mention a file you want to change.&lt;/span&gt;
&lt;span class="c"&gt;# usage: ./name-the-test.sh src/billing/invoice.py&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;:?usage:&lt;span class="p"&gt; name-the-test.sh &amp;lt;path/to/file&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;target&lt;/span&gt;&lt;span class="p"&gt;%.*&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"--- test files mentioning '&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;' ---"&lt;/span&gt;
git &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s1"&gt;'*test*'&lt;/span&gt; &lt;span class="s1"&gt;'*spec*'&lt;/span&gt; &lt;span class="s1"&gt;'*__tests__*'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"(none)"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"--- tracked files in the same family ---"&lt;/span&gt;
git ls-files | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; spec &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"(none)"&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"--- last three commits touching the file ---"&lt;/span&gt;
git log &lt;span class="nt"&gt;-3&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;short &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'%h %ad %s'&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;target&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it against three candidate files, not one. You want options, not a commitment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./name-the-test.sh src/billing/invoice.py
./name-the-test.sh src/billing/refund.py
./name-the-test.sh src/billing/tax_rules.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a file returns zero test references, drop it. A file nobody tests is a file where your mistake is invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Run only those tests, and save the output
&lt;/h2&gt;

&lt;p&gt;Do not guess the test command. Copy it from the repository's own CI config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="nt"&gt;-A3&lt;/span&gt; &lt;span class="s1"&gt;'run:'&lt;/span&gt; .github/workflows/ | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; pytest &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'npm test'&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'go test'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the single file you found, and write the output to disk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pytest tests/billing/test_invoice.py &lt;span class="nt"&gt;-q&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tee&lt;/span&gt; /tmp/baseline.txt
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5 /tmp/baseline.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That file is now your baseline. Green or red, you know the starting state. Most first-PR confusion comes from never having captured it.&lt;/p&gt;

&lt;p&gt;If the run fails on import errors rather than assertions, stop. You have an environment problem, not a code problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — Turn your question into one assertion
&lt;/h2&gt;

&lt;p&gt;Add a single test that answers your Step 0 sentence. Not three tests. One.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_refund_total_excludes_tax&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;invoice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Invoice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tax_rate&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;refunded&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;total&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it. It should fail, and the failure message should be readable enough for a stranger.&lt;/p&gt;

&lt;p&gt;If the assertion cannot be written without mocking five collaborators, your question is too big. Shrink it until the test fits on one screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — Make the smallest change that flips the test
&lt;/h2&gt;

&lt;p&gt;One rule keeps first PRs reviewable: at most three files change, and one of them is the test.&lt;/p&gt;

&lt;p&gt;If the fix needs a fourth file, split the ticket. State the split in the PR description rather than expanding scope quietly. Reviewers forgive small PRs and small questions; they rarely forgive a surprise refactor.&lt;/p&gt;

&lt;p&gt;Re-run the baseline file after the change. Compare with &lt;code&gt;/tmp/baseline.txt&lt;/code&gt; and confirm you moved only the test you meant to move.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5 — When your laptop cannot run the suite
&lt;/h2&gt;

&lt;p&gt;Some first days die on environment setup. Python 3.6 on a work laptop, an ARM machine, a Windows shell against a Linux-only suite. The drill above stalls at Step 2 through no fault of yours.&lt;/p&gt;

&lt;p&gt;This is where I keep a disposable workspace instead of a permanent one. MonkeyCode offers free model access and a free server option, which is enough for a single-file test run and a failure explanation. Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Two habits make that safe:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send the &lt;strong&gt;failure output&lt;/strong&gt;, not the whole file. Paste the traceback and the test name into the model. Ask "what does this assertion say about the code?" not "rewrite this module."&lt;/li&gt;
&lt;li&gt;Keep the free server &lt;strong&gt;ephemeral&lt;/strong&gt;. Clone, run, copy the log back, throw the workspace away. Anything you would not put in a public gist does not belong there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am deliberately not quoting quota numbers or machine specs. Free tiers move, and a number printed in a blog post is stale within weeks. Check the project's own page on the day you need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decision table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Local clone&lt;/th&gt;
&lt;th&gt;Free server workspace&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Suite runs in under 2 minutes&lt;/td&gt;
&lt;td&gt;Use local&lt;/td&gt;
&lt;td&gt;Unnecessary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Suite needs a Linux-only binary&lt;/td&gt;
&lt;td&gt;Skip&lt;/td&gt;
&lt;td&gt;Reasonable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repo has secrets in &lt;code&gt;.env&lt;/code&gt; fixtures&lt;/td&gt;
&lt;td&gt;Use local only&lt;/td&gt;
&lt;td&gt;Do not use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You only need one test file&lt;/td&gt;
&lt;td&gt;Use local&lt;/td&gt;
&lt;td&gt;Fine either way&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You need a long-lived CI replacement&lt;/td&gt;
&lt;td&gt;Build real CI&lt;/td&gt;
&lt;td&gt;Not this&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You want to read a stack trace with help&lt;/td&gt;
&lt;td&gt;Use local&lt;/td&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Treat the free server as a place to answer one question. The moment it becomes your only way to run tests, you have a dependency, not a tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this drill does not do
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;name-the-test.sh&lt;/code&gt; is a grep heuristic. Dynamic imports, string-built module names, and reflection-based frameworks will hide tests from it. If it returns &lt;code&gt;(none)&lt;/code&gt; for a file you know is covered, trust the code and check by hand.&lt;/p&gt;

&lt;p&gt;It also assumes a test suite exists. Repositories with no tests need a different first hour, and that is a fair reason to ask your mentor before starting.&lt;/p&gt;

&lt;p&gt;Finally, this drill will not teach you architecture. It teaches you where the safety net is. Reading the module top-to-bottom still has to happen, just not before you know which behavior someone already promised to protect.&lt;/p&gt;

&lt;p&gt;If you try one thing from this post, try the ordered steps: question, grep, baseline, one assertion, one small diff. If your machine fights you on step two, the free server option is the lowest-stakes place to start.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>testing</category>
      <category>git</category>
      <category>ai</category>
    </item>
    <item>
      <title>Score the File, Not the Prompt: A Week-One Triage Table for AI-Assisted PRs</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Mon, 26 Oct 2026 11:54:16 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/score-the-file-not-the-prompt-a-week-one-triage-table-for-ai-assisted-prs-1djl</link>
      <guid>https://dev.to/gitgo_5662/score-the-file-not-the-prompt-a-week-one-triage-table-for-ai-assisted-prs-1djl</guid>
      <description>&lt;p&gt;Give the model a ticket only after you score the file.&lt;/p&gt;

&lt;p&gt;Most juniors do it backwards. They paste the ticket, accept a patch, then try to understand it. On day one that order costs you your rollback.&lt;/p&gt;

&lt;p&gt;This post gives you a small triage script, a decision table, and a baseline test loop. You run all three inside your first hour. The artifact is the point, not the opinion.&lt;/p&gt;

&lt;h2&gt;
  
  
  The risky window is week one
&lt;/h2&gt;

&lt;p&gt;The tooling changed fast this year. Juniors now open real tickets with an agent in the loop from day two. That is fine, if you gate the loop with evidence.&lt;/p&gt;

&lt;p&gt;My rule is simple. Score the file before you score the prompt. A patch is only as safe as the code it touches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Measure the blast radius
&lt;/h2&gt;

&lt;p&gt;Run this on the file you plan to edit. It uses only &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, and &lt;code&gt;find&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# triage.sh - rate a file's blast radius before you take the ticket&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;:?usage:&lt;span class="p"&gt; triage.sh path/to/file [since]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;90&lt;/span&gt;&lt;span class="p"&gt;.days.ago&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;%.*&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nv"&gt;churn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git log &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$since&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;%H &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;owners&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git log &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$since&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;%ae &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;refs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-RIl&lt;/span&gt; &lt;span class="nt"&gt;--exclude-dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;.git &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*.ts'&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*.js'&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*.py'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$stem&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;tests&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-path&lt;/span&gt; ./.git &lt;span class="nt"&gt;-prune&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;stem&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;*test*"&lt;/span&gt; &lt;span class="nt"&gt;-print&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'file=%s\nchurn=%s\nowners=%s\nreferences=%s\ntest_files=%s\n'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$churn&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$owners&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$refs&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$tests&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make it executable and run it on your candidate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x triage.sh
./triage.sh src/billing/invoice.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample output from a small service I worked in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file=src/billing/invoice.ts
churn=14
owners=5
references=9
test_files=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it like this. High churn means the file moves under you. Many owners means no single reviewer knows the whole file. Many references means your typo becomes someone else's outage.&lt;/p&gt;

&lt;p&gt;Treat the script as a rough instrument. It measures motion, not correctness. Zero test files is the loudest signal in the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Turn the numbers into a decision
&lt;/h2&gt;

&lt;p&gt;Do not negotiate with yourself. Map the score to one of three lanes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signals&lt;/th&gt;
&lt;th&gt;Lane&lt;/th&gt;
&lt;th&gt;Who edits&lt;/th&gt;
&lt;th&gt;Evidence before PR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;tests &amp;gt;= 1, owners &amp;lt;= 2, references &amp;lt;= 3&lt;/td&gt;
&lt;td&gt;Green&lt;/td&gt;
&lt;td&gt;You, with a model draft&lt;/td&gt;
&lt;td&gt;Baseline test log, diff under 60 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tests &amp;gt;= 1, but owners &amp;gt;= 3 or references &amp;gt;= 6&lt;/td&gt;
&lt;td&gt;Amber&lt;/td&gt;
&lt;td&gt;Model drafts, you rewrite&lt;/td&gt;
&lt;td&gt;Named reviewer, per-hunk explanation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tests = 0, or references &amp;gt;= 10, or churn is spiking&lt;/td&gt;
&lt;td&gt;Red&lt;/td&gt;
&lt;td&gt;Senior pairs with you&lt;/td&gt;
&lt;td&gt;Written rollback plan first&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Red does not mean forbidden. It means you do not learn on the expensive file. Take a green ticket first, then ask for the red one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Write the ticket contract in one paragraph
&lt;/h2&gt;

&lt;p&gt;Before any prompt, write five lines in the ticket. File, function, expected behaviour, test command, and what must not change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;File: src/billing/invoice.ts
Function: applyDiscount()
Expected: rounding stays half-up, no new exports
Test: npm test -- invoice
Must not change: public signature, error messages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the model gets a boundary, not a wish. If it returns code that violates line five, you reject it in seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Prove the loop before the edit
&lt;/h2&gt;

&lt;p&gt;Run the test command and save the output. This is your baseline, and it is the only honest reference you have.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; invoice 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tee&lt;/span&gt; /tmp/base.log
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'passing|failing'&lt;/span&gt; /tmp/base.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the suite is already red, stop. A red baseline hides your regression inside someone else's failure.&lt;/p&gt;

&lt;p&gt;After the patch, run the same command against the same log target. Compare counts, not vibes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; invoice 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tee&lt;/span&gt; /tmp/after.log
diff &amp;lt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'passing|failing'&lt;/span&gt; /tmp/base.log&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &amp;lt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'passing|failing'&lt;/span&gt; /tmp/after.log&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Identical counts plus your new test passing is a shippable result. Anything else is a conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Set the hunk budget and the rollback line
&lt;/h2&gt;

&lt;p&gt;Cap the diff before you open the editor. Forty lines for a first ticket is plenty. Sixty is the ceiling on green files.&lt;/p&gt;

&lt;p&gt;Write the revert command in the PR description. It takes ten seconds and saves an hour.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git revert &lt;span class="nt"&gt;--no-commit&lt;/span&gt; &amp;lt;sha&amp;gt;
git diff &lt;span class="nt"&gt;--cached&lt;/span&gt; &lt;span class="nt"&gt;--stat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you cannot name the sha you would revert, you do not understand the patch yet. Read the diff again before you request review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where free model access and a free server actually help
&lt;/h2&gt;

&lt;p&gt;A junior needs volume, and volume is where budgets bite. Explaining unfamiliar files, drafting a failing test, and re-reading your own diff are high-frequency, low-risk uses. This is exactly the workload free model access fits.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Two operator-supplied details matter here. The project offers free model access, and it offers a free server option. The operator also describes a free allowance of 10 million tokens; confirm the current terms yourself, because allowances change and I am not quoting a benchmark. I have not measured speed, model quality, or uptime, and I am not claiming any.&lt;/p&gt;

&lt;p&gt;The free server option helps in one concrete way. Your laptop keeps its toolchain, and the build-and-test loop runs elsewhere. That is a real convenience when &lt;code&gt;npm install&lt;/code&gt; fights your local Node version.&lt;/p&gt;

&lt;p&gt;One rule, no exceptions. Do not paste secrets, customer data, or internal credentials into any hosted model. Read your employer's policy before your first prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;p&gt;This workflow is honest about what it cannot do.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Churn is not risk. A quiet file can still hold the payment path.&lt;/li&gt;
&lt;li&gt;The script misses dynamic references: reflection, string lookups, config-driven wiring.&lt;/li&gt;
&lt;li&gt;Test file counts lie in monorepos with shared fixtures.&lt;/li&gt;
&lt;li&gt;Free tiers change. Re-verify terms on the day you rely on them.&lt;/li&gt;
&lt;li&gt;A model draft is not a review. You still own every line you commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Skip this approach if your repo has no test command at all. Fix that first; a model will only make the chaos faster.&lt;/p&gt;

&lt;p&gt;Skip it too if you cannot read the language fluently yet. Learn the file by hand for a week, then add the agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first-hour checklist
&lt;/h2&gt;

&lt;p&gt;Run the script on two candidate files. Pick the green one. Write the five-line contract. Capture the baseline log. Draft with the model, then rewrite at least one hunk yourself.&lt;/p&gt;

&lt;p&gt;That last step is the whole method. You are not shipping model output. You are shipping a change you can explain, test, and revert.&lt;/p&gt;

&lt;p&gt;If you run the triage table on your own repo, keep your real thresholds in the PR description. The next junior will thank you for the numbers.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>ai</category>
      <category>git</category>
      <category>testing</category>
    </item>
    <item>
      <title>Rehearse the Rollback Before You Ship the Patch: A Day-One Git Drill</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Tue, 20 Oct 2026 10:04:29 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/rehearse-the-rollback-before-you-ship-the-patch-a-day-one-git-drill-59mj</link>
      <guid>https://dev.to/gitgo_5662/rehearse-the-rollback-before-you-ship-the-patch-a-day-one-git-drill-59mj</guid>
      <description>&lt;h1&gt;
  
  
  Rehearse the Rollback Before You Ship the Patch
&lt;/h1&gt;

&lt;p&gt;Your first pull request should be one you can undo in five minutes.&lt;/p&gt;

&lt;p&gt;Most onboarding advice stops at "get the build running." That is step zero. The step that protects you is a rollback rehearsal. You practice undoing a patch while nobody is on call.&lt;/p&gt;

&lt;p&gt;This drill uses git, a throwaway remote, and one small patch. You measure time-to-green on three undo paths. You leave with a table, not a feeling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why rehearse undoing work you have not shipped
&lt;/h2&gt;

&lt;p&gt;Patches arrive fast now. Reviewing an agent patch is one skill. Undoing it is a different skill, and a calmer one.&lt;/p&gt;

&lt;p&gt;If your team already merges agent-generated patches, you will be asked to revert one eventually. First-time reverts under pressure teach the wrong lesson. A sandbox branch teaches the right one.&lt;/p&gt;

&lt;p&gt;The drill also exposes something useful about your new repo. You learn which test command is real, how long green takes, and where the seams are.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 0: Define "green" before you touch anything
&lt;/h2&gt;

&lt;p&gt;Copy the exact command CI runs. Do not invent your own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# .drill/test-command&lt;/span&gt;
./scripts/test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If that command takes longer than ten minutes, subset it. A drill that costs an hour never gets repeated. Pick the fastest command that still fails when the patch breaks behavior.&lt;/p&gt;

&lt;p&gt;Write the command down before the drill. Changing it midway invalidates every number you collect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Move the drill onto a disposable remote
&lt;/h2&gt;

&lt;p&gt;Never rehearse in the repo your team deploys from. A scratch clone is the minimum. A scratch remote is better.&lt;/p&gt;

&lt;p&gt;This is where a free server option fits. Treat it as a sandbox for throwaway branches. Assume it can vanish, and assume it is not a place for secrets.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;MonkeyCode offers free model access and a free server option, and its team describes it as an open-source project. That is how you can generate the patch and host the scratch remote here. Delete every MonkeyCode mention and the git commands below still work unchanged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Generate one small, believable patch
&lt;/h2&gt;

&lt;p&gt;Ask for a bounded change. A 30-line diff reverts cleanly. A 400-line diff teaches you conflict resolution, not rollback.&lt;/p&gt;

&lt;p&gt;Prompt template you can reuse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Change exactly one function in &amp;lt;file&amp;gt;.
Constraints: no new dependencies, no more than 30 changed lines.
Output a unified diff only, no prose.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the output as &lt;code&gt;patch.diff&lt;/code&gt;. Reject it if it touches more than two files. Reject it again if it adds a dependency. Small patches keep the drill honest.&lt;/p&gt;

&lt;p&gt;The patch does not need to be good. It needs to apply, pass tests, and be reversible. That is the whole bar.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Script the rehearsal
&lt;/h2&gt;

&lt;p&gt;Save this as &lt;code&gt;rollback-drill.sh&lt;/code&gt;. Run it from anywhere except a worktree you care about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# rollback-drill.sh &amp;lt;repo-url&amp;gt; &amp;lt;patch-file&amp;gt;&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;REPO_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;:?repo&lt;span class="p"&gt; url required&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;PATCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;:?patch&lt;span class="p"&gt; file required&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;TEST_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TEST_CMD&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;./scripts/test.sh&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nv"&gt;WORK&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;mktemp&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;OUT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$WORK&lt;/span&gt;&lt;span class="s2"&gt;/timings.md"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'| path | result |\n|---|---|\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

timed&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c"&gt;# timed &amp;lt;label&amp;gt;&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; start end
  &lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TEST_CMD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$WORK&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;$label&lt;/span&gt;&lt;span class="s2"&gt;.log"&lt;/span&gt; 2&amp;gt;&amp;amp;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nv"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'| %s | %ss to green |\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$label&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;end &lt;span class="o"&gt;-&lt;/span&gt; start&lt;span class="k"&gt;))&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'| %s | RED (see %s.log) |\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$label&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$label&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 50 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$REPO_URL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$WORK&lt;/span&gt;&lt;span class="s2"&gt;/repo"&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$WORK&lt;/span&gt;&lt;span class="s2"&gt;/repo"&lt;/span&gt;
git config user.email drill@example.com
git config user.name drill

git switch &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; drill/base
timed baseline

git switch &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; drill/patch
git apply &lt;span class="nt"&gt;--3way&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PATCH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
git add &lt;span class="nt"&gt;-A&lt;/span&gt;
git commit &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"drill: apply patch"&lt;/span&gt;
timed patched

&lt;span class="c"&gt;# Path A: revert the commit, history stays readable&lt;/span&gt;
git switch &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; drill/revert drill/patch
git revert &lt;span class="nt"&gt;--no-edit&lt;/span&gt; HEAD &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null
timed revert

&lt;span class="c"&gt;# Path B: drop the commit entirely&lt;/span&gt;
git switch &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; drill/reset drill/patch
git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; &lt;span class="nt"&gt;--quiet&lt;/span&gt; drill/base
timed reset

&lt;span class="c"&gt;# Path C: kill switch, code stays where it is&lt;/span&gt;
git switch &lt;span class="nt"&gt;--quiet&lt;/span&gt; drill/patch
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;FEATURE_AGENT_PATCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;off
timed flag_off

&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"logs in &lt;/span&gt;&lt;span class="nv"&gt;$WORK&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two notes before you run it. Path C only means something if the patch sits behind a flag. If there is no flag, drop that block and record &lt;code&gt;n/a&lt;/code&gt; in your table. And &lt;code&gt;--depth 50&lt;/code&gt; keeps a monorepo clone tolerable; remove it if your repo needs full history to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Run each path three times
&lt;/h2&gt;

&lt;p&gt;One run measures your laptop, not your repo. Three runs show you the noise floor.&lt;/p&gt;

&lt;p&gt;If baseline swings by more than a minute, stop. Your suite is flaky, and every later number is decoration. Fix the flake or pick a narrower test command.&lt;/p&gt;

&lt;p&gt;Expected shape of the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| path      | result          |
|-----------|-----------------|
| baseline  | 42s to green    |
| patched   | 44s to green    |
| revert    | 45s to green    |
| reset     | 41s to green    |
| flag_off  | RED (see flag_off.log) |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A red &lt;code&gt;flag_off&lt;/code&gt; row is a real finding. The kill switch does not fully disable the change, or your test command ignores the flag. Both are worth knowing on day one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Read the table like a reviewer
&lt;/h2&gt;

&lt;p&gt;Compare paths on the same machine only. Wall-clock seconds are not portable across hardware.&lt;/p&gt;

&lt;p&gt;Look for two signals. First, does any undo path take longer than the patch took to write? Second, does &lt;code&gt;reset&lt;/code&gt; beat &lt;code&gt;revert&lt;/code&gt; by a wide margin? If yes, you now know why people reach for dangerous commands under pressure.&lt;/p&gt;

&lt;p&gt;That gap is the real lesson. &lt;code&gt;revert&lt;/code&gt; preserves history and costs conflict resolution. &lt;code&gt;reset&lt;/code&gt; is fast and throws work away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decision table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;th&gt;Watch out&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Patch is already pushed to a shared branch&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git revert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Others keep a readable history&lt;/td&gt;
&lt;td&gt;Later commits on the same lines conflict&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patch is local and unpushed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git reset --hard base&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fastest clean tree&lt;/td&gt;
&lt;td&gt;Silently discards uncommitted work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patch sits behind a flag&lt;/td&gt;
&lt;td&gt;flip the flag&lt;/td&gt;
&lt;td&gt;Seconds, no deploy&lt;/td&gt;
&lt;td&gt;Flag debt, and the off-path is untested&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patch includes a migration&lt;/td&gt;
&lt;td&gt;neither, escalate&lt;/td&gt;
&lt;td&gt;Code revert is not data revert&lt;/td&gt;
&lt;td&gt;You need a restore plan first&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Print this table into your onboarding notes. Rewrite it when your repo proves it wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes that make the numbers lie
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Migrations.&lt;/strong&gt; Reverting code leaves the schema changed. If &lt;code&gt;patch.diff&lt;/code&gt; touches a migration, the drill measures the wrong thing entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cached artifacts.&lt;/strong&gt; A stale build directory makes &lt;code&gt;reset&lt;/code&gt; look faster than it is. Clear the cache before each run, or run baseline twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uncommitted work.&lt;/strong&gt; &lt;code&gt;reset --hard&lt;/code&gt; does not ask. Run the script in the temp clone, never in your working tree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrong test command.&lt;/strong&gt; If the drill's command differs from CI, you are timing a rehearsal of a rehearsal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;p&gt;You need a test command that finishes in minutes and fails for the right reasons. Without one, build a smoke test first. This drill will not save you.&lt;/p&gt;

&lt;p&gt;Skip it if policy forbids pushing repo content to third-party hosts. Run everything locally instead; the script works the same. Skip it if your rollback procedure is a documented incident process with named owners. Training must not shadow the real runbook.&lt;/p&gt;

&lt;p&gt;Skip it in monorepos you cannot clone cheaply. A partial clone is fine. A forty-minute clone is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terms snapshot you should verify yourself
&lt;/h2&gt;

&lt;p&gt;Operator-supplied and not independently verified: free model access, a free server option, and a listed allowance of 10 million tokens. Quotas and terms change without notice. Read the project's current page before you plan any workflow around them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Close the loop
&lt;/h2&gt;

&lt;p&gt;Run the drill once. Keep the timing table in your onboarding notes.&lt;/p&gt;

&lt;p&gt;If you try it on a throwaway remote, the free server option saves you from polluting your laptop. Paste your slowest undo path in the comments. A five-minute revert is a team asset, and now you know yours.&lt;/p&gt;

</description>
      <category>git</category>
      <category>ai</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Day One: Prove the Build Before You Take the Ticket</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Mon, 19 Oct 2026 08:43:48 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/day-one-prove-the-build-before-you-take-the-ticket-45cf</link>
      <guid>https://dev.to/gitgo_5662/day-one-prove-the-build-before-you-take-the-ticket-45cf</guid>
      <description>&lt;p&gt;Your first hour should prove the build. It should not be reading source code.&lt;/p&gt;

&lt;p&gt;Most juniors start onboarding by opening files. That feels productive. It produces opinions, not evidence.&lt;/p&gt;

&lt;p&gt;A build that fails on your machine tells you nothing about the code. It tells you about your machine. The fix belongs in a written environment probe, not in a chat thread.&lt;/p&gt;

&lt;p&gt;This post gives you that probe. It takes about twenty minutes. It ends with your first PR and a rehearsed rollback.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the probe comes first
&lt;/h2&gt;

&lt;p&gt;A failing test on day one has three possible owners. The repo, the toolchain, or you.&lt;/p&gt;

&lt;p&gt;You cannot tell them apart from memory. You can tell them apart from a log with versions, commands, and exit codes.&lt;/p&gt;

&lt;p&gt;Write the log once. Reuse it for every future "works on my machine" argument.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Build a disposable workspace
&lt;/h2&gt;

&lt;p&gt;Do not probe inside your real clone. Use a throwaway directory or a temporary sandbox.&lt;/p&gt;

&lt;p&gt;This is where a free server option is genuinely useful. A disposable host gives you a clean OS with no leftover global installs.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;MonkeyCode offers free model access and a free server option, per the operator. I am not asserting specs, quotas, uptime, or permanence here. Treat both as conveniences, not guarantees.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/probe &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/probe
git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 1 &amp;lt;repo-url&amp;gt; app
&lt;span class="nb"&gt;cd &lt;/span&gt;app
git rev-parse &lt;span class="nt"&gt;--short&lt;/span&gt; HEAD   &lt;span class="c"&gt;# record this in your notes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Record the commit hash. A probe without a commit hash is a rumor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Write &lt;code&gt;probe.sh&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is a template. It is not tested against your repo. Adjust the install and test commands to match your &lt;code&gt;README&lt;/code&gt; and CI config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# probe.sh - day-one environment probe (template)&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;OUT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"env-probe.txt"&lt;/span&gt;
: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
log&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

log &lt;span class="s2"&gt;"== commit: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-parse &lt;span class="nt"&gt;--short&lt;/span&gt; HEAD&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; =="&lt;/span&gt;
log &lt;span class="s2"&gt;"== time:   &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; +%FT%TZ&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; =="&lt;/span&gt;
log &lt;span class="s2"&gt;"uname:  &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-srm&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
log &lt;span class="s2"&gt;"shell:  &lt;/span&gt;&lt;span class="nv"&gt;$BASH_VERSION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;bin &lt;span class="k"&gt;in &lt;/span&gt;git node npm python3 go java docker&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  if &lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;log &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--version&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n1&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;else
    &lt;/span&gt;log &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;: MISSING"&lt;/span&gt;
  &lt;span class="k"&gt;fi
done

&lt;/span&gt;log &lt;span class="s2"&gt;"== install =="&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; package-lock.json &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;npm ci &lt;span class="nt"&gt;--no-audit&lt;/span&gt; &lt;span class="nt"&gt;--no-fund&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 20 | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;fi

&lt;/span&gt;log &lt;span class="s2"&gt;"== test (300s cap) =="&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; +e
&lt;span class="nb"&gt;timeout &lt;/span&gt;300 npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--silent&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 40 | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PIPESTATUS&lt;/span&gt;&lt;span class="p"&gt;[0]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt;
log &lt;span class="s2"&gt;"test exit: &lt;/span&gt;&lt;span class="nv"&gt;$code&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

log &lt;span class="s2"&gt;"== end =="&lt;/span&gt;
&lt;span class="nb"&gt;exit &lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two design choices matter here. The &lt;code&gt;timeout&lt;/code&gt; cap stops a hung watcher from eating your morning. The &lt;code&gt;tail&lt;/code&gt; cap keeps the log small enough to read and share.&lt;/p&gt;

&lt;p&gt;The script always exits zero. It is a reporter, not a gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Read the verdict, not the vibes
&lt;/h2&gt;

&lt;p&gt;Run it and classify the result before you ask anyone for help.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x probe.sh &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./probe.sh
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'MISSING|test exit'&lt;/span&gt; env-probe.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;test exit&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Missing tools&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;th&gt;Your next action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;Green&lt;/td&gt;
&lt;td&gt;Take the ticket, link &lt;code&gt;env-probe.txt&lt;/code&gt; in it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;non-zero&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;Amber&lt;/td&gt;
&lt;td&gt;Reproduce once in the sandbox, then compare logs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;one or more&lt;/td&gt;
&lt;td&gt;Red&lt;/td&gt;
&lt;td&gt;Fix the toolchain first, do not touch code&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Green is common and boring. Good. Boring means the repo is not your problem today.&lt;/p&gt;

&lt;p&gt;Amber is the interesting case. It means the failure is real and reproducible, which makes it a legitimate ticket.&lt;/p&gt;

&lt;p&gt;Red is a setup bug wearing a code bug costume. Half of "the tests are broken" reports die here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Delegate only the log reading
&lt;/h2&gt;

&lt;p&gt;The slow part of onboarding is not typing commands. It is squinting at 40 lines of noise.&lt;/p&gt;

&lt;p&gt;This is a reasonable place to use free model access. The task is bounded, the input is small, and a wrong answer is cheap to detect.&lt;/p&gt;

&lt;p&gt;Do not ask for a patch. Ask for a classification.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are triaging a build log. Do not propose code changes.
Input: the last 40 lines below.
Output exactly three lines:
FAILURE_CLASS: &amp;lt;missing-tool | dependency | test-assert | network | unknown&amp;gt;
FIRST_BAD_LINE: &amp;lt;verbatim line&amp;gt;
NEXT_COMMAND: &amp;lt;one shell command to run&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the &lt;code&gt;NEXT_COMMAND&lt;/code&gt; yourself. If it does not move the log forward, the classification was wrong and you learned that in one step.&lt;/p&gt;

&lt;p&gt;Keep the model's output in your notes with the commit hash. Unlabeled model output is not evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Make the probe your first PR
&lt;/h2&gt;

&lt;p&gt;Your first PR should be small, reversible, and additive. &lt;code&gt;probe.sh&lt;/code&gt; plus &lt;code&gt;env-probe.txt&lt;/code&gt; is all three.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; chore/env-probe
git add probe.sh env-probe.txt
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: add day-one environment probe"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the PR body, state three things. The commit hash you probed. The verdict from the table. The one command a reviewer should run to confirm.&lt;/p&gt;

&lt;p&gt;Do not bundle a source change into this PR. Reviewers forgive a noisy artifact. They do not forgive a mixed diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Rehearse the rollback now
&lt;/h2&gt;

&lt;p&gt;You will need a rollback eventually. Practice it while the stakes are zero.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git revert &lt;span class="nt"&gt;--no-edit&lt;/span&gt; &amp;lt;merge-or-commit-sha&amp;gt;
git push origin chore/env-probe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If CI rejects the probe script, revert it and say so in the thread. That is a successful onboarding step, not a failure.&lt;/p&gt;

&lt;p&gt;You now know the revert command, the review path, and the CI turnaround time. That knowledge is worth more than the script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;p&gt;A sandbox probe proves a fresh environment. It does not prove production behavior, data shape, or service dependencies.&lt;/p&gt;

&lt;p&gt;The free server option suits exploration. It is not a substitute for a pinned CI runner or a reproducible container image your team controls.&lt;/p&gt;

&lt;p&gt;Skip this approach if any of the following is true.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your repo needs credentials or production data to build. Do not paste those into a shared sandbox.&lt;/li&gt;
&lt;li&gt;Your organization forbids sending logs to hosted models. Ask first, and use a local model if approved.&lt;/li&gt;
&lt;li&gt;Your build needs GPUs, large services, or hours of compilation. Use the team's real CI instead.&lt;/li&gt;
&lt;li&gt;You need guaranteed capacity. Free tiers change; plan around that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also skip the model step entirely if the log is short. Ten lines of output do not need triage help.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you actually learned
&lt;/h2&gt;

&lt;p&gt;You learned the build before the code. You learned the revert before the mistake.&lt;/p&gt;

&lt;p&gt;That order is deliberate. Juniors who learn rollback first take bigger, safer steps later.&lt;/p&gt;

&lt;p&gt;If you want a zero-cost place to run the probe, MonkeyCode's free model access and free server option are a reasonable starting point. Verify the current terms yourself before you depend on them.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Timebox Your First PR: A 90-Minute Onboarding Log for New Repos</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Fri, 16 Oct 2026 05:26:26 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/timebox-your-first-pr-a-90-minute-onboarding-log-for-new-repos-3p1e</link>
      <guid>https://dev.to/gitgo_5662/timebox-your-first-pr-a-90-minute-onboarding-log-for-new-repos-3p1e</guid>
      <description>&lt;p&gt;Most first PRs fail for process reasons, not coding reasons.&lt;/p&gt;

&lt;p&gt;The fix is cheap. Log your first 90 minutes in a new repo. Then attach that log to your first pull request.&lt;/p&gt;

&lt;p&gt;This post gives you a small bash script, a timebox table, and explicit stop rules. It also explains where a free cloud box fits when your laptop cannot reproduce CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why hour one decides your first PR
&lt;/h2&gt;

&lt;p&gt;You join a repo you have never run. You read code for two hours. You patch something small. Tests pass locally, then fail during review.&lt;/p&gt;

&lt;p&gt;The reviewer asks one question. "What was the baseline?" You do not know.&lt;/p&gt;

&lt;p&gt;That is the entire failure. The order was wrong, not your skill.&lt;/p&gt;

&lt;p&gt;So flip the order. Record first, patch second. Your log becomes evidence a reviewer can replay.&lt;/p&gt;

&lt;p&gt;Agent tooling keeps improving. Onboarding discipline has not kept up.&lt;/p&gt;

&lt;h2&gt;
  
  
  The artifact: a JSONL onboarding log
&lt;/h2&gt;

&lt;p&gt;Save this file as &lt;code&gt;onboard-log.sh&lt;/code&gt; on a scratch branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# onboard-log.sh - append JSONL breadcrumbs during your first repo day.&lt;/span&gt;
&lt;span class="c"&gt;# Usage:&lt;/span&gt;
&lt;span class="c"&gt;#   ./onboard-log.sh fingerprint&lt;/span&gt;
&lt;span class="c"&gt;#   TEST_CMD="npm test" ./onboard-log.sh baseline&lt;/span&gt;
&lt;span class="c"&gt;#   ./onboard-log.sh note "auth tests need redis on 6379"&lt;/span&gt;
&lt;span class="c"&gt;#   ./onboard-log.sh report&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-uo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;LOG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ONBOARD_LOG&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;onboard&lt;/span&gt;&lt;span class="p"&gt;.jsonl&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;PHASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;report&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;shift&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true
&lt;/span&gt;&lt;span class="nv"&gt;TEST_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TEST_CMD&lt;/span&gt;&lt;span class="k"&gt;:-}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;BASELINE_LOG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TMPDIR&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;/tmp&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/onboard.baseline.log"&lt;/span&gt;

iso&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; +&lt;span class="s2"&gt;"%Y-%m-%dT%H:%M:%SZ"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
sha&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; git rev-parse &lt;span class="nt"&gt;--short&lt;/span&gt; HEAD 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo &lt;/span&gt;no-git&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

emit&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;              &lt;span class="c"&gt;# $1 phase, then raw key=value pairs&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;phase&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;shift
  local &lt;/span&gt;&lt;span class="nv"&gt;extra&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;kv &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$kv&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;extra&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$extra&lt;/span&gt;&lt;span class="s2"&gt;,&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;%%=*&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;#*=&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;done
  &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'{"at":"%s","phase":"%s","head":"%s"%s}\n'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;iso&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$phase&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;sha&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$extra&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PHASE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="k"&gt;in
  &lt;/span&gt;fingerprint&lt;span class="p"&gt;)&lt;/span&gt;
    emit fingerprint &lt;span class="s2"&gt;"bash=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;BASH_VERSION&lt;/span&gt;&lt;span class="p"&gt;%%(*&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"node=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt; 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo &lt;/span&gt;none&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;;;&lt;/span&gt;
  baseline&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TEST_CMD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"set TEST_CMD first"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit &lt;/span&gt;2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="nv"&gt;t0&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;
    bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TEST_CMD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BASELINE_LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; 2&amp;gt;&amp;amp;1
    &lt;span class="nv"&gt;code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;
    emit baseline &lt;span class="s2"&gt;"exit=&lt;/span&gt;&lt;span class="nv"&gt;$code&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"secs=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; t0 &lt;span class="k"&gt;))&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"baseline exit=&lt;/span&gt;&lt;span class="nv"&gt;$code&lt;/span&gt;&lt;span class="s2"&gt;  log=&lt;/span&gt;&lt;span class="nv"&gt;$BASELINE_LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;;;&lt;/span&gt;
  note&lt;span class="p"&gt;)&lt;/span&gt;
    emit note &lt;span class="s2"&gt;"note=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;;;&lt;/span&gt;
  report&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"no log yet"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit &lt;/span&gt;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="nt"&gt;-F&lt;/span&gt;&lt;span class="s1"&gt;'"'&lt;/span&gt; &lt;span class="s1"&gt;'{for(i=1;i&amp;lt;=NF;i++) if($i=="phase") print $(i+2)}'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
      | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt;
    &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 1 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;;;&lt;/span&gt;
  &lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"phases: fingerprint baseline note report"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit &lt;/span&gt;2 &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four phases, four commands. Run them in this order.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fingerprint the machine before you read any code.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./onboard-log.sh fingerprint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Branch from main and record the baseline on a clean checkout.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; onboard/scratch main
&lt;span class="nv"&gt;TEST_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"npm test"&lt;/span&gt; ./onboard-log.sh baseline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Write notes while reading. Do not edit product code yet.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./onboard-log.sh note &lt;span class="s2"&gt;"auth suite needs redis on 6379"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Print the summary before you open the PR.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./onboard-log.sh report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The report prints one count per phase plus the last entry. A reviewer can replay your first hour in seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timebox the day in five windows
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Window&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Exit condition&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0-20 min&lt;/td&gt;
&lt;td&gt;fingerprint + find the test entry point&lt;/td&gt;
&lt;td&gt;you can name the test command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20-35 min&lt;/td&gt;
&lt;td&gt;baseline on a clean checkout&lt;/td&gt;
&lt;td&gt;exit code written to the log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;35-55 min&lt;/td&gt;
&lt;td&gt;write one failing test&lt;/td&gt;
&lt;td&gt;it fails for the right reason&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;55-80 min&lt;/td&gt;
&lt;td&gt;patch the smallest path&lt;/td&gt;
&lt;td&gt;new test passes, baseline still passes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80-90 min&lt;/td&gt;
&lt;td&gt;open the PR with the log&lt;/td&gt;
&lt;td&gt;reviewer sees one behavior change&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Stop at the window boundary. Say what you finished and what comes next. That message beats a rushed patch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways this goes wrong
&lt;/h2&gt;

&lt;p&gt;Baseline is red on a clean checkout. Stop immediately and report it. Do not fix it in your first PR.&lt;/p&gt;

&lt;p&gt;Baseline is green only on your machine. Your fingerprint line will show a different runtime. Fix the environment, not the test.&lt;/p&gt;

&lt;p&gt;Your log has no baseline entry. The PR cannot be judged. Skipped steps are invisible, so leave a note instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a hosted box fits
&lt;/h2&gt;

&lt;p&gt;Some repos will not build on a laptop. Old Node versions, native modules, a database you cannot install locally.&lt;/p&gt;

&lt;p&gt;That is the honest use case for a remote environment. Run the fingerprint and baseline steps on a free hosted box, then copy &lt;code&gt;onboard.jsonl&lt;/code&gt; back into your branch.&lt;/p&gt;

&lt;p&gt;MonkeyCode is an open-source coding-agent project that, per its maintainers, offers free model access and a free server option. Its site currently lists a free token allowance; treat that figure as current-at-writing and verify it on the project's own page before you plan around it.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;The value here is narrow and testable. The remote box removes environment noise from step 2. Free model access helps only with small questions, like "which fixture seeds this table?" Keep those answers in your notes.&lt;/p&gt;

&lt;p&gt;Do not route security review or architecture decisions through a chat box. That work stays with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits and who should skip this
&lt;/h2&gt;

&lt;p&gt;The script needs bash 4 or newer and a repo with one test command. Monorepos with per-package commands need one baseline entry per package.&lt;/p&gt;

&lt;p&gt;Notes containing quotes get mangled by the simple escape used here. Keep notes plain ASCII, or store them elsewhere.&lt;/p&gt;

&lt;p&gt;Skip this if your repo holds regulated or proprietary code and you have not read the hosting terms. Skip it if your team already has a trusted CI baseline. Skip it if you need a decision today, because a log costs 90 minutes.&lt;/p&gt;

&lt;p&gt;If you want a box for step 2 without provisioning one, MonkeyCode's free tier is one option to evaluate. The log file is the part that matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to take away
&lt;/h2&gt;

&lt;p&gt;Record before you patch. Timebox every window. Stop when the log tells you to stop.&lt;/p&gt;

&lt;p&gt;Your first PR should be small, explainable, and replayable. This log makes all three true.&lt;/p&gt;

</description>
      <category>git</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>career</category>
    </item>
    <item>
      <title>Your First Hour in a New Repo: Build a Reading Order from Git History</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Thu, 15 Oct 2026 11:29:37 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/your-first-hour-in-a-new-repo-build-a-reading-order-from-git-history-4l5j</link>
      <guid>https://dev.to/gitgo_5662/your-first-hour-in-a-new-repo-build-a-reading-order-from-git-history-4l5j</guid>
      <description>&lt;h2&gt;
  
  
  Conclusion first: do not read a new repo alphabetically
&lt;/h2&gt;

&lt;p&gt;You join a repo on Monday. Nobody has time to walk you through it. So you open the file tree and start at the top.&lt;/p&gt;

&lt;p&gt;That is the slowest path through a codebase. Files that change together belong together. Git already recorded which files move as one unit.&lt;/p&gt;

&lt;p&gt;Read the coupled files first and the architecture appears faster. This workflow has three steps: extract co-change pairs, expand them into a reading order, then use an agent to cover what you cannot read in time. Setup costs about fifteen minutes.&lt;/p&gt;

&lt;p&gt;The scripts below are templates. Run them in your own clone and treat the ranking as a hypothesis to verify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — Extract co-change pairs from commit history
&lt;/h2&gt;

&lt;p&gt;A commit that touches &lt;code&gt;checkout.ts&lt;/code&gt; and &lt;code&gt;cart.ts&lt;/code&gt; is evidence of a relationship. Repeat that across a year of history and the strong edges stand out from the noise.&lt;/p&gt;

&lt;p&gt;Limit the window to 12–18 months. Older commits describe code that no longer exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Dump one commit per NUL byte, followed by the file names it touched.&lt;/span&gt;
git log &lt;span class="nt"&gt;--no-merges&lt;/span&gt; &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"18 months ago"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--pretty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;format:&lt;span class="s1"&gt;'%x00'&lt;/span&gt; &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /tmp/cochange.log

&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; /tmp/cochange.log   &lt;span class="c"&gt;# sanity check: is this file absurdly large?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now count the pairs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# cochange.py — rank file pairs by how often they change together
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;

&lt;span class="n"&gt;IGNORE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vendor/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;node_modules/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dist/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;third_party/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.lock&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;git&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;log&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--no-merges&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--since=18 months ago&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--pretty=format:%x00&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--name-only&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;

&lt;span class="n"&gt;pairs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;touched&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\x00&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;
    &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IGNORE&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;touched&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;combinations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="nf"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;most_common&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  &amp;lt;-&amp;gt;  &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check two things before you trust the output. First, generated files and lockfiles dominate raw counts, so keep the ignore list honest. Second, squash-merged history turns every commit into a whole feature, which flattens the pair counts.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;--no-merges&lt;/code&gt; flag hides merge commits. That is usually what you want. If your team merges feature branches without squashing, drop the flag and compare the two outputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Expand one seed into a reading order
&lt;/h2&gt;

&lt;p&gt;The top pair is a starting point, not a plan. Expand outward from the most frequently touched file and stop after roughly a dozen files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Continue in the same script: walk the coupling graph.
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt;

&lt;span class="n"&gt;neighbors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defaultdict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;neighbors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="n"&gt;neighbors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;

&lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;touched&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;most_common&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:]:&lt;/span&gt;            &lt;span class="c1"&gt;# weight the last few picks
&lt;/span&gt;        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;cand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;neighbors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;recent&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cand&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;reading order:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Greedy expansion is a heuristic. It can wander into a test-only cluster and stall there. If the list looks wrong, change the seed to a file you already know matters.&lt;/p&gt;

&lt;p&gt;Then write the plan down with a stop condition for each block.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Stop when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0:00–0:20&lt;/td&gt;
&lt;td&gt;top 3 coupled files&lt;/td&gt;
&lt;td&gt;you can name the entry point and its caller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0:20–1:00&lt;/td&gt;
&lt;td&gt;full pair list&lt;/td&gt;
&lt;td&gt;you can draw five arrows between modules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1:00–2:00&lt;/td&gt;
&lt;td&gt;one end-to-end test&lt;/td&gt;
&lt;td&gt;the test passes locally and you know what it asserts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2:00–3:00&lt;/td&gt;
&lt;td&gt;agent summaries of the rest&lt;/td&gt;
&lt;td&gt;every claim is checked against code or a test&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The third row matters most. A reading order you cannot run is still a guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — Use an agent for the files you cannot reach
&lt;/h2&gt;

&lt;p&gt;You will not read 200 files on day one. Hand the ranked list to a coding agent and ask for narrow, checkable answers.&lt;/p&gt;

&lt;p&gt;MonkeyCode offers free model access and a free server option, which makes this step cheap to try from a work laptop. Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;Keep the prompt narrow. Broad questions produce broad guesses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For each file listed below, answer in at most four lines:
1. Which files in this repo reference it? Give file:line, or "not found".
2. What does it return or mutate?
3. Which test exercises it? Give the test name, or "no test found".
4. What would break if this file were deleted?

Files:
&amp;lt;paste the reading order here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Not found" and "no test found" are the most useful answers. They mark the edges of the repo's documented behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — Verify before you believe
&lt;/h2&gt;

&lt;p&gt;Agent output is a hypothesis, not a fact. Three commands settle most of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Does the caller really exist?&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="s2"&gt;"parseCheckout"&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.ts"&lt;/span&gt; src/ | &lt;span class="nb"&gt;head&lt;/span&gt;

&lt;span class="c"&gt;# Is this file actually alive?&lt;/span&gt;
git log &lt;span class="nt"&gt;-1&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'%h %ad %an'&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;short &lt;span class="nt"&gt;--&lt;/span&gt; src/cart.ts

&lt;span class="c"&gt;# Does the claimed test exist, and does it pass?&lt;/span&gt;
npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--testPathPattern&lt;/span&gt; cart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the grep finds nothing, the agent invented the caller. If the last commit is four years old, the file is probably dead code, not core logic.&lt;/p&gt;

&lt;p&gt;Record each verified fact in one note file. That note becomes the onboarding document for the next hire, which is a better gift than a Slack summary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first PR comes from the gaps
&lt;/h2&gt;

&lt;p&gt;The "no test found" list is your backlog. Pick one small function and add the missing test. It is a real contribution, it is low risk, and it forces you to run the code.&lt;/p&gt;

&lt;p&gt;Do not refactor anything in week one. You do not yet know which odd-looking code is load-bearing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and who should skip this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repos under about 40 files: just read them all in one sitting.&lt;/li&gt;
&lt;li&gt;Squash-merge-only history: co-change counts flatten, so pair ranking gets weak.&lt;/li&gt;
&lt;li&gt;Heavy vendoring or generated code: your ignore list does most of the work.&lt;/li&gt;
&lt;li&gt;Teams without a working local test command: verify by reading code instead.&lt;/li&gt;
&lt;li&gt;Anyone who cannot review agent output critically: skip Step 3 entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not hand security-critical paths to an agent on day one. Read those yourself, slowly.&lt;/p&gt;

&lt;p&gt;The pair list also says nothing about runtime behavior. Two files can co-change because a formatter touches them together, not because they are coupled. Skim the commit messages for the top pairs before you build a mental model on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;Run Step 1 on the repo you joined this week. Paste the top ten pairs into your notes. You now have a reading order, a verification habit, and a first PR candidate.&lt;/p&gt;

&lt;p&gt;If your laptop cannot spare the cycles for Step 3, MonkeyCode's free server option is one way to move that work off your machine.&lt;/p&gt;

</description>
      <category>git</category>
      <category>onboarding</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Scan the Diff Before You Request Agent Review</title>
      <dc:creator>Quinn Zhu</dc:creator>
      <pubDate>Tue, 13 Oct 2026 02:28:31 +0000</pubDate>
      <link>https://dev.to/gitgo_5662/scan-the-diff-before-you-request-agent-review-2j17</link>
      <guid>https://dev.to/gitgo_5662/scan-the-diff-before-you-request-agent-review-2j17</guid>
      <description>&lt;p&gt;Do not request review on an agent patch yet.&lt;br&gt;
A leaked secret outlives a bad function name.&lt;br&gt;
Scan the diff, then write a replay note.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start from the review gate
&lt;/h2&gt;

&lt;p&gt;You are the new engineer on this repo.&lt;br&gt;
Your first pull request should stay very small.&lt;br&gt;
An agent may draft the patch for you.&lt;/p&gt;

&lt;p&gt;You still decide what reviewers are allowed to see.&lt;br&gt;
Treat the agent summary as an unverified claim.&lt;br&gt;
Every claim needs a command you can rerun.&lt;/p&gt;

&lt;p&gt;A confident paragraph is not evidence at all.&lt;br&gt;
You need a command log beside that paragraph.&lt;br&gt;
Git output beats a polished explanation every time.&lt;/p&gt;
&lt;h2&gt;
  
  
  Keep this hour narrow
&lt;/h2&gt;

&lt;p&gt;Change only one behavior during this first hour.&lt;br&gt;
Touch only the files that this behavior needs.&lt;br&gt;
Leave lockfiles and migrations alone unless the ticket names them.&lt;/p&gt;

&lt;p&gt;Do not explore the whole tree on this branch.&lt;br&gt;
Do not ask the agent to clean unrelated files.&lt;br&gt;
Wide diffs hide secrets and unrelated edits together.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Freeze the base ref
&lt;/h2&gt;

&lt;p&gt;Pick the base branch that reviewers already trust.&lt;br&gt;
Write that ref down before you edit anything.&lt;br&gt;
Do not guess the base ref from memory later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin
git rev-parse &lt;span class="nt"&gt;--abbrev-ref&lt;/span&gt; HEAD
git merge-base HEAD origin/main
git status &lt;span class="nt"&gt;--short&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stop if your working tree is not clean.&lt;br&gt;
Stop if the base ref is missing locally.&lt;br&gt;
A dirty tree makes this scan meaningless now.&lt;/p&gt;

&lt;p&gt;Replace origin/main if your default branch name differs.&lt;br&gt;
Ask a teammate for the real base name.&lt;br&gt;
Do not invent a base just to pass.&lt;/p&gt;

&lt;p&gt;The three-dot diff starts at the merge base.&lt;br&gt;
It shows changes your branch introduced, not upstream noise.&lt;br&gt;
A two-dot diff can blame files you never edited.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Keep secrets out of the prompt
&lt;/h2&gt;

&lt;p&gt;Never paste env file contents into a chat.&lt;br&gt;
Never paste private keys, tokens, or customer rows.&lt;br&gt;
Name the file path when the agent must avoid it.&lt;/p&gt;

&lt;p&gt;Say which files the agent is allowed to touch.&lt;br&gt;
Say which commands the agent is allowed to run.&lt;br&gt;
Say that unknown files must stay completely untouched.&lt;/p&gt;

&lt;p&gt;A free model does not make a secret safer.&lt;br&gt;
The secret already left your machine in that paste.&lt;br&gt;
Treat every prompt as a copy you may not recall.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Run a diff scan before review
&lt;/h2&gt;

&lt;p&gt;This script is only a proposal for you.&lt;br&gt;
It is an unexecuted example for your branch.&lt;br&gt;
Adapt the base ref and path rules first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# Unexecuted example. Review it before you run it.&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;base&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;/main&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; git rev-parse &lt;span class="nt"&gt;--verify&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$base&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FAIL: base ref not found"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;2
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nv"&gt;files&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;base&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;...HEAD"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$files&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FAIL: empty diff against &lt;/span&gt;&lt;span class="nv"&gt;$base&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;2
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FILES:"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$files&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nv"&gt;blocked&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'(^|/)(\.env|\.env\..*|id_rsa|id_ed25519|.*\.pem|.*\.p12|.*\.key|credentials\.json|secrets\.ya?ml)$'&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$files&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$blocked&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FAIL: sensitive path in diff"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nv"&gt;pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'AKIA[0-9A-Z]{16}|-----BEGIN [A-Z ]*PRIVATE KEY-----|ghp_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}'&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;git diff &lt;span class="nt"&gt;--unified&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;base&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;...HEAD"&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$pattern&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FAIL: possible secret text in diff"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Do not print the match in a shared log."&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"PASS: no blocked path or obvious token pattern"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the script outside the repository if possible.&lt;br&gt;
Run it with the base ref as its argument.&lt;br&gt;
Read each failure before you silence the script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scan-first-diff.sh origin/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A pass is not a full security audit.&lt;br&gt;
It catches obvious paths and a few token shapes.&lt;br&gt;
Your team scanner still matters when you have one.&lt;/p&gt;

&lt;p&gt;The failure path can still reveal a secret nearby.&lt;br&gt;
Run the scan in a private terminal, not a shared log.&lt;br&gt;
If a real secret appears, rotate it with the owner.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Use a decision table
&lt;/h2&gt;

&lt;p&gt;Read this table before you push the branch.&lt;br&gt;
Act on the row that you actually hit.&lt;br&gt;
Do not blur two rows into a maybe.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scan result&lt;/th&gt;
&lt;th&gt;What you do&lt;/th&gt;
&lt;th&gt;What you do not do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Sensitive path listed&lt;/td&gt;
&lt;td&gt;Remove that file from the branch&lt;/td&gt;
&lt;td&gt;Ask the model to ignore it in prose&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token-like text in the diff&lt;/td&gt;
&lt;td&gt;Tell the credential owner and rotate&lt;/td&gt;
&lt;td&gt;Hide the line and hope review misses it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Empty diff&lt;/td&gt;
&lt;td&gt;Stop and restate the one behavior&lt;/td&gt;
&lt;td&gt;Open review only to show effort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pass, but a hunk is unexplained&lt;/td&gt;
&lt;td&gt;Drop that hunk or ask a human&lt;/td&gt;
&lt;td&gt;Ship the model explanation as your own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pass, and you can replay the test&lt;/td&gt;
&lt;td&gt;Write the replay note next&lt;/td&gt;
&lt;td&gt;Add extra files for completeness&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A shared branch needs a teammate before any rewrite.&lt;br&gt;
This table does not teach you to force-push.&lt;br&gt;
Ask the owner before you rewrite any public history.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Fix a failure without hiding it
&lt;/h2&gt;

&lt;p&gt;Do not delete the failing line from the log.&lt;br&gt;
Copy the flagged path, then remove it from the branch.&lt;br&gt;
Commit that removal before you rerun the scan.&lt;/p&gt;

&lt;p&gt;If the file is new, delete it from the branch.&lt;br&gt;
If the file is tracked, restore the base version with help.&lt;br&gt;
Do not hide a flagged path inside gitignore.&lt;/p&gt;

&lt;p&gt;Rerun the same script after that fix lands.&lt;br&gt;
A second pass still needs the replay note.&lt;br&gt;
Do not request review from a failing log.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 6: Write the replay note
&lt;/h2&gt;

&lt;p&gt;Put this note in the pull request body.&lt;br&gt;
A reviewer should rerun your checks without guessing.&lt;br&gt;
Keep each line short enough to verify quickly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Replay note&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Base ref: origin/main
&lt;span class="p"&gt;-&lt;/span&gt; Branch: your-branch-name
&lt;span class="p"&gt;-&lt;/span&gt; One behavior: one sentence you can defend
&lt;span class="p"&gt;-&lt;/span&gt; Allowed paths: list only those paths
&lt;span class="p"&gt;-&lt;/span&gt; Command run: the exact test command
&lt;span class="p"&gt;-&lt;/span&gt; Scan result: pass or fail, plus script name
&lt;span class="p"&gt;-&lt;/span&gt; Not run: anything you skipped on purpose
&lt;span class="p"&gt;-&lt;/span&gt; Model claim you rejected: one sentence, or none
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fill every line using your own words only.&lt;br&gt;
Do not paste an agent summary over those lines.&lt;br&gt;
If any line is unknown, the review is early.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Use a remote run only as a tool
&lt;/h2&gt;

&lt;p&gt;Disclosure: This article was prepared as part of MonkeyCode's product outreach.&lt;/p&gt;

&lt;p&gt;MonkeyCode offers free model access and a free server option.&lt;br&gt;
Both are availability claims supplied for this article, not measured results.&lt;br&gt;
Current quotas, hardware, and time limits are not stated.&lt;/p&gt;

&lt;p&gt;Check the current product docs before you rely on either.&lt;br&gt;
Those offers can change, and this article will not track them.&lt;br&gt;
Do not plan a deadline around an unverified limit.&lt;/p&gt;

&lt;p&gt;Use the free model to draft replay note wording.&lt;br&gt;
You still type the commands and read the output.&lt;br&gt;
Use a free server only when your team allows that workspace.&lt;/p&gt;

&lt;p&gt;Do not upload secrets so a remote scan looks better.&lt;br&gt;
The scan should see the diff, not your password store.&lt;br&gt;
If that workspace is unclear, run the script locally.&lt;/p&gt;

&lt;p&gt;Read the current MonkeyCode docs before any remote run.&lt;br&gt;
Try the scan on a branch you can delete.&lt;br&gt;
Stop if the docs disagree with this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Reject a yes from the model
&lt;/h2&gt;

&lt;p&gt;Ask the agent which checks it actually skipped.&lt;br&gt;
A short approval line is not a real scan.&lt;br&gt;
Compare its file list with git diff output.&lt;/p&gt;

&lt;p&gt;If those lists differ, believe git every time.&lt;br&gt;
If the agent reports no secrets, rerun the script.&lt;br&gt;
If you cannot explain a line, drop that line.&lt;/p&gt;

&lt;p&gt;This is the habit you want on later reviews.&lt;br&gt;
Your first review is where that habit starts.&lt;br&gt;
Reviewers teach faster when your note stays honest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should skip this workflow
&lt;/h2&gt;

&lt;p&gt;Skip this if CI already blocks secret paths.&lt;br&gt;
Follow that gate instead of a second unofficial script.&lt;br&gt;
Skip this if you cannot open pull requests yet.&lt;/p&gt;

&lt;p&gt;Skip this flow during an active production incident.&lt;br&gt;
Incident work needs the on-call owner, not a first-hour test.&lt;br&gt;
Skip this if the ticket requires production credentials.&lt;/p&gt;

&lt;p&gt;That ticket needs a human owner, not an agent run.&lt;br&gt;
You are still learning the review path on purpose.&lt;br&gt;
An incident is the wrong classroom for this script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits you should say out loud
&lt;/h2&gt;

&lt;p&gt;The pattern list misses many private token formats.&lt;br&gt;
It misses secrets that are split across lines.&lt;br&gt;
It misses tokens that do not match these shapes.&lt;/p&gt;

&lt;p&gt;The path list misses custom secret file names.&lt;br&gt;
Add the secret names your repository actually uses.&lt;br&gt;
Do not delete a team rule to match this example.&lt;/p&gt;

&lt;p&gt;The script does not rotate any credential for you.&lt;br&gt;
The script does not prove that your test passed.&lt;br&gt;
The script does not make the agent accountable.&lt;/p&gt;

&lt;p&gt;This example was not run against your repository.&lt;br&gt;
Treat the listing as a starting point only.&lt;br&gt;
Change it until a teammate accepts the blocked paths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you request review
&lt;/h2&gt;

&lt;p&gt;Run the scan and keep the last lines.&lt;br&gt;
Paste the replay note in your own words.&lt;br&gt;
Read the full diff with the agent closed.&lt;/p&gt;

&lt;p&gt;Request review only when all three answers hold.&lt;br&gt;
You can name the base ref from the command output.&lt;br&gt;
You can name the exact test command you ran.&lt;/p&gt;

&lt;p&gt;You can name every file you would defend.&lt;br&gt;
If one answer fails, keep the branch in draft.&lt;br&gt;
Fix that gap, or close the branch and start smaller.&lt;/p&gt;

&lt;p&gt;A delayed first review is cheaper than a leaked key.&lt;br&gt;
Leave the draft closed until those answers are easy.&lt;br&gt;
Your name is on the pull request, not the model's.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
