<?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: The AI Leverage Weekly</title>
    <description>The latest articles on DEV Community by The AI Leverage Weekly (@leveragenotes).</description>
    <link>https://dev.to/leveragenotes</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%2F3914896%2Fb2a4ead1-5e63-481e-9e32-f64d1ef69d79.png</url>
      <title>DEV Community: The AI Leverage Weekly</title>
      <link>https://dev.to/leveragenotes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leveragenotes"/>
    <language>en</language>
    <item>
      <title>The Best AI Prompts for Refactoring Legacy Code</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Mon, 29 Jun 2026 09:00:47 +0000</pubDate>
      <link>https://dev.to/leveragenotes/the-best-ai-prompts-for-refactoring-legacy-code-5g7h</link>
      <guid>https://dev.to/leveragenotes/the-best-ai-prompts-for-refactoring-legacy-code-5g7h</guid>
      <description>&lt;h1&gt;
  
  
  The Best AI Prompts for Refactoring Legacy Code
&lt;/h1&gt;

&lt;p&gt;Legacy code doesn't come with a manual. You inherit a function that's 300 lines long, has no tests, and the original author is long gone. You know it needs to change, but touching it feels like defusing a bomb blindfolded. AI tools won't rewrite your entire codebase for you — but with the right prompts, they dramatically shrink the time between "I don't understand this" and "I can safely change this." Here are the prompts I reach for, in the order I actually use them.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Start with a plain-English explanation of what the code does
&lt;/h2&gt;

&lt;p&gt;Before you touch anything, you need to understand it. Paste the function or module and ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain what this code does in plain English. Describe:
1. Its purpose (what business problem it solves)
2. Its inputs and outputs
3. Any side effects or external dependencies
4. Edge cases it appears to handle
5. Anything that looks unusual or potentially buggy

Here is the code:
[paste code]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you a mental model fast. Don't skip it — even if you think you understand the code, the AI often surfaces a side effect or edge case you glossed over.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Identify the smell before you prescribe the fix
&lt;/h2&gt;

&lt;p&gt;Jumping straight to "refactor this" produces mediocre results. Instead, ask for a diagnosis first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review the following legacy code and list every code smell you can identify.
For each smell: name it, quote the specific lines involved, and explain why it's a problem.
Do not suggest fixes yet — just audit.

[paste code]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Getting a structured smell list forces the AI to slow down and reason about the code rather than produce a cosmetically cleaner version of the same mess.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Ask for a refactoring plan, not just refactored code
&lt;/h2&gt;

&lt;p&gt;Once you have the smell list, ask for a sequenced plan before asking for any new code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Given the code smells you identified, produce a step-by-step refactoring plan.
Order the steps from lowest risk to highest risk.
For each step, explain: what changes, why it's safe to do in isolation, and what could break.
Do not write code yet.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the prompt that saves the most time. A plan exposes assumptions you can challenge before you've committed a line of code. It also gives you natural stopping points if you're time-boxed.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Generate a characterization test suite before refactoring
&lt;/h2&gt;

&lt;p&gt;Legacy code without tests is a minefield. Use the AI to generate "characterization tests" — tests that document current behavior, not ideal behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a suite of unit tests for the following function that captures its current behavior exactly — including any behavior that looks wrong.
The goal is not to test correctness; the goal is to detect if refactoring changes the output.
Use [your test framework, e.g. Jest / pytest / RSpec].

[paste code]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run these tests, commit them, and now you have a safety net. Any refactoring that breaks a test is a regression you need to understand before merging.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Refactor one smell at a time, not all at once
&lt;/h2&gt;

&lt;p&gt;Now you're ready to change code. Do it incrementally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Refactor ONLY the following problem from the code below: [name one smell from your list, e.g. "extract the nested conditional into a separate function"].
Do not change any other logic.
Show me the before and after side by side and explain every change you made.

[paste code]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern is one of the ones I've packaged into The AI Leverage Playbook: 50 Prompts &amp;amp; Workflows for Engineers — but the version above is enough to get value on its own.&lt;/p&gt;

&lt;p&gt;Scoping the prompt tightly is the key move. When you ask AI to "refactor everything," it over-reaches and introduces changes you didn't ask for, review, or understand. One smell per prompt keeps the diff reviewable.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Ask for a risk assessment on your final diff
&lt;/h2&gt;

&lt;p&gt;Before you open the PR, paste your final diff and ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;Review this diff. Identify any changes that:
&lt;/span&gt;&lt;span class="gd"&gt;- Could introduce a regression
- Change behavior in a way that isn't obvious from the variable/function names
- Should be covered by a test that doesn't exist yet
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;Be specific. Quote the lines you're concerned about.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Treat this like a second pair of eyes on your PR — one that reads every line without getting bored.&lt;/p&gt;




&lt;h2&gt;
  
  
  The sequence matters as much as the prompts
&lt;/h2&gt;

&lt;p&gt;These six prompts are most effective in order: understand → audit → plan → safety-net → change → validate. Skipping steps (especially the characterization tests) is how you end up with a "refactored" codebase that breaks in production on an edge case nobody thought to test.&lt;/p&gt;

&lt;p&gt;None of these prompts require a specific AI tool — they work with whatever assistant you're already using. The discipline is in the sequence, not the syntax.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w8" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w8&lt;/a&gt;&lt;/p&gt;

</description>
      <category>refactoring</category>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>We Saved 6 Hours of QA Time This Week Using AI — Here's the Breakdown (Week 7 Roundup)</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Fri, 26 Jun 2026 09:01:03 +0000</pubDate>
      <link>https://dev.to/leveragenotes/we-saved-6-hours-of-qa-time-this-week-using-ai-heres-the-breakdown-week-7-roundup-4nm4</link>
      <guid>https://dev.to/leveragenotes/we-saved-6-hours-of-qa-time-this-week-using-ai-heres-the-breakdown-week-7-roundup-4nm4</guid>
      <description>&lt;h1&gt;
  
  
  We Saved 6 Hours of QA Time This Week Using AI — Here's the Breakdown (Week 7 Roundup)
&lt;/h1&gt;

&lt;p&gt;This week had a clear throughline: AI doing the tedious, time-consuming work that engineers hate but can't skip — and the numbers were actually surprising.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Case That Made It concrete
&lt;/h2&gt;

&lt;p&gt;Midway through the week, a service I was responsible for had a module with 23 functions, zero unit tests, and a refactor deadline approaching fast. Historically, writing that test suite from scratch would eat up most of a day — probably 5–6 hours of mechanical, low-satisfaction work.&lt;/p&gt;

&lt;p&gt;Using an AI-assisted workflow to generate the test scaffolding function by function, I had a working first draft of the full suite in under 90 minutes. That's not a rounding error. That's the difference between shipping the refactor this sprint and punting it to the next one.&lt;/p&gt;

&lt;p&gt;The output wasn't perfect — about 20% of the generated tests needed meaningful corrections, mostly around edge cases and mock setup. But starting from a structured draft instead of a blank file changed the whole shape of the work. I was reviewing and refining, not grinding.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Other Half of the Week
&lt;/h2&gt;

&lt;p&gt;The second major theme was debugging. A gnarly stack trace came in from a service in a part of the codebase I hadn't touched in months. The kind of error where you'd normally spend 45 minutes just reorienting yourself before you even start diagnosing.&lt;/p&gt;

&lt;p&gt;Feeding the trace to an AI model with the right context got me to the probable root cause in one structured pass. Not magic — it still took judgment to confirm the fix — but the triage phase that usually burns the most time was compressed dramatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Week Actually Proved
&lt;/h2&gt;

&lt;p&gt;These weren't toy examples or tutorials. Both were real work, under real time pressure. The pattern that held across both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI front-loads the structural work&lt;/strong&gt; (scaffolding, triage, orientation)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineers handle the judgment layer&lt;/strong&gt; (correctness, context, edge cases)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The split saves hours, not minutes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The engineers who are winning with AI right now aren't the ones with the cleverest prompts. They're the ones who've figured out exactly which part of their workflow to hand off.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w7" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>career</category>
      <category>engineering</category>
    </item>
    <item>
      <title>How to Use AI to Debug a Stack Trace (Step-by-Step)</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Wed, 24 Jun 2026 09:00:33 +0000</pubDate>
      <link>https://dev.to/leveragenotes/how-to-use-ai-to-debug-a-stack-trace-step-by-step-110n</link>
      <guid>https://dev.to/leveragenotes/how-to-use-ai-to-debug-a-stack-trace-step-by-step-110n</guid>
      <description>&lt;h1&gt;
  
  
  How to Use AI to Debug a Stack Trace (Step-by-Step)
&lt;/h1&gt;

&lt;p&gt;You've got a wall of red text, a stack trace you don't fully recognize, and no obvious starting point. AI can turn that trace into a clear diagnosis and a fix — in under two minutes. Here's exactly how to do it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Raw Stack Traces Are Hard to Parse Alone
&lt;/h2&gt;

&lt;p&gt;Stack traces are dense. They mix your code with framework internals, third-party library frames, and sometimes async noise that obscures the actual origin of the error. The mental overhead of filtering signal from noise is where most debugging time gets wasted. AI is surprisingly good at this — not because it "knows" your system, but because it can pattern-match against thousands of similar traces and explain each layer in plain language.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Copy the Full Stack Trace — Don't Trim It
&lt;/h2&gt;

&lt;p&gt;Resist the urge to paste only the top three lines. The root cause is often buried lower in the trace. Copy everything, including the error type, message, and every frame.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Use This Prompt Template
&lt;/h2&gt;

&lt;p&gt;Open your AI assistant (ChatGPT, Claude, Gemini — any capable model works) and paste this:&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 a senior engineer helping me debug a runtime error.

Here is the full stack trace:
---
[PASTE YOUR FULL STACK TRACE HERE]
---

Please do the following:
1. Identify the root cause of the error in plain English.
2. Pinpoint the exact line or frame where the error originates (not just where it surfaces).
3. Explain why this error occurs — what condition triggered it.
4. Suggest a concrete fix with a code example.
5. List any other places in a typical codebase where this same pattern might cause the same error.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That fifth point is the one most developers skip — and it's where you stop patching and start preventing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Add Context to Get a Sharper Answer
&lt;/h2&gt;

&lt;p&gt;After the initial response, follow up with:&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 the function where the error originates. Does this change your diagnosis?

[PASTE THE RELEVANT FUNCTION OR METHOD]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This two-pass approach — trace first, code second — gives the model enough context to go from "here's what's probably wrong" to "here's exactly what's wrong."&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Ask for a Reproduction Case
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a minimal code snippet that would reproduce this error so I can verify the fix before applying it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This forces the model to commit to a specific understanding of the bug. If the reproduction case doesn't match what you're seeing, you've caught a hallucination before it costs you time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Validate the Fix, Then Ask for a Test
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here is the fix I applied: [PASTE FIX]. Now write a unit test that would have caught this error before it reached production.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You've just turned a debugging session into a regression test — automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Workflow Actually Gets You
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A plain-English explanation you can share with a teammate or put in a PR description&lt;/li&gt;
&lt;li&gt;A fix you can verify before applying&lt;/li&gt;
&lt;li&gt;A unit test that closes the loop&lt;/li&gt;
&lt;li&gt;A checklist of similar patterns to audit in the rest of the codebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This entire flow takes five minutes once you have the prompt structure memorized.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical AI techniques for engineers, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w7" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>ai</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Generate Unit Tests from a Function Using AI</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Mon, 22 Jun 2026 09:01:20 +0000</pubDate>
      <link>https://dev.to/leveragenotes/how-to-generate-unit-tests-from-a-function-using-ai-173m</link>
      <guid>https://dev.to/leveragenotes/how-to-generate-unit-tests-from-a-function-using-ai-173m</guid>
      <description>&lt;p&gt;You have a function, you need tests, and you're staring at a blank file. AI can generate a solid first draft of your unit test suite in under a minute — but only if you prompt it correctly. This walkthrough shows you exactly how to do it, step by step, with copy-paste prompts and real output patterns you can adapt immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the Naive Prompt Fails
&lt;/h2&gt;

&lt;p&gt;Most engineers start with something like &lt;code&gt;"write tests for this function"&lt;/code&gt; and paste their code. The output is usually technically correct but shallow: happy-path only, no edge cases, no error conditions, no boundary values. It looks like coverage but isn't.&lt;/p&gt;

&lt;p&gt;The fix isn't a fancier AI model — it's a better prompt structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Frame the Function with Context
&lt;/h2&gt;

&lt;p&gt;Before pasting code, tell the AI what the function is supposed to do, what it promises to callers, and what test framework you're using. One short paragraph of context doubles the quality of the output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;I&lt;/span&gt; &lt;span class="nx"&gt;have&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;TypeScript&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;validates&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;submitted&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="nx"&gt;address&lt;/span&gt;
&lt;span class="nx"&gt;before&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;s stored to the database. It should return true for valid emails
and false for invalid ones. I&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="nx"&gt;using&lt;/span&gt; &lt;span class="nx"&gt;Vitest&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="s2"&gt;`describe/it/expect`&lt;/span&gt;
&lt;span class="nx"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;No&lt;/span&gt; &lt;span class="nx"&gt;mocking&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;needed&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;pure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="nx"&gt;Here&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;PASTE&lt;/span&gt; &lt;span class="nx"&gt;FUNCTION&lt;/span&gt; &lt;span class="nx"&gt;HERE&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nx"&gt;Generate&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;comprehensive&lt;/span&gt; &lt;span class="nx"&gt;unit&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;suite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Cover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;happy&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boundary&lt;/span&gt;
&lt;span class="nf"&gt;cases &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;empty&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;very&lt;/span&gt; &lt;span class="nx"&gt;long&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;malformed&lt;/span&gt; &lt;span class="nx"&gt;inputs&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;missing&lt;/span&gt; &lt;span class="p"&gt;@,&lt;/span&gt; &lt;span class="nx"&gt;multiple&lt;/span&gt; &lt;span class="p"&gt;@,&lt;/span&gt; &lt;span class="nx"&gt;special&lt;/span&gt; &lt;span class="nx"&gt;characters&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="nx"&gt;edge&lt;/span&gt; &lt;span class="nx"&gt;cases&lt;/span&gt; &lt;span class="nx"&gt;implied&lt;/span&gt;
&lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;implementation&lt;/span&gt; &lt;span class="nx"&gt;itself&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last line — &lt;em&gt;"edge cases implied by the implementation itself"&lt;/em&gt; — is the key instruction. It forces the model to read the actual logic rather than generating generic tests.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Ask for a Test Plan Before the Code
&lt;/h2&gt;

&lt;p&gt;For non-trivial functions, add one extra step: ask for the test plan first, review it, then ask for the implementation. This costs 30 seconds and catches gaps before they get baked into code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before writing any test code, list every test case you plan to cover for
the function above. Group them by: (1) valid inputs, (2) invalid inputs,
(3) boundary/edge cases, (4) error conditions. Use plain English, one
line per case. I'll confirm the list before you write any code.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scan the list. You'll almost always spot a case the model missed — and more importantly, a case &lt;em&gt;you&lt;/em&gt; would have missed too. Add it back in plain English before you proceed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Generate the Tests
&lt;/h2&gt;

&lt;p&gt;Once the plan is approved, run the generation prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Now&lt;/span&gt; &lt;span class="nx"&gt;write&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;full&lt;/span&gt; &lt;span class="nx"&gt;Vitest&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;suite&lt;/span&gt; &lt;span class="nx"&gt;based&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;plan&lt;/span&gt; &lt;span class="nx"&gt;above&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="nx"&gt;Requirements&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;One&lt;/span&gt; &lt;span class="s2"&gt;`describe`&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt; &lt;span class="nx"&gt;named&lt;/span&gt; &lt;span class="nx"&gt;after&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;One&lt;/span&gt; &lt;span class="s2"&gt;`it`&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt; &lt;span class="nx"&gt;per&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;descriptive&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;reads&lt;/span&gt; &lt;span class="nx"&gt;like&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;
  &lt;span class="nf"&gt;sentence &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;returns false when the input is an empty string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;No&lt;/span&gt; &lt;span class="nx"&gt;external&lt;/span&gt; &lt;span class="nx"&gt;dependencies&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;mocks&lt;/span&gt; &lt;span class="nx"&gt;unless&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;requires&lt;/span&gt; &lt;span class="nx"&gt;them&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;If&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;requires&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;fixture&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;define&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;at&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;top&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt;
  &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;describe&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;Add&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;one&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;line&lt;/span&gt; &lt;span class="nx"&gt;comment&lt;/span&gt; &lt;span class="nx"&gt;above&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;obvious&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The descriptive &lt;code&gt;it&lt;/code&gt; strings matter. They're your documentation. When a test fails in CI at 2am, a string like &lt;code&gt;"returns false when the input is an empty string"&lt;/code&gt; tells you exactly what broke without opening the file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Audit the Output for Coverage Gaps
&lt;/h2&gt;

&lt;p&gt;Don't ship the AI output directly. Run this audit prompt against the generated suite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review the test suite you just wrote. Identify any of the following that
are missing or weakly covered:
1. Return value correctness (not just truthiness)
2. Side effects the function might have
3. Thrown exceptions or error types
4. Performance-sensitive paths (very large inputs)
5. Any assumption in the code that isn't tested

For each gap, either add a test case or explain why it's intentionally
excluded.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where the real value compounds. The model will often find its own blind spots when asked directly — things like checking the &lt;em&gt;type&lt;/em&gt; of a return value, not just its truthiness, or confirming an exception has the right message, not just that it was thrown.&lt;/p&gt;

&lt;p&gt;This pattern is one of the ones I've packaged into &lt;em&gt;The AI Leverage Playbook: 50 Prompts &amp;amp; Workflows for Engineers&lt;/em&gt; — but the version above is enough to get value on its own.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Parametrize Repetitive Cases
&lt;/h2&gt;

&lt;p&gt;If the audit reveals many similar inputs that differ only in data, ask the model to refactor to a parametrized format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Refactor&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;cases&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;share&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;same&lt;/span&gt; &lt;span class="nx"&gt;assertion&lt;/span&gt; &lt;span class="nx"&gt;logic&lt;/span&gt; &lt;span class="nx"&gt;but&lt;/span&gt; &lt;span class="nx"&gt;differ&lt;/span&gt;
&lt;span class="nx"&gt;only&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="nx"&gt;into&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="s2"&gt;`it.each`&lt;/span&gt; &lt;span class="nx"&gt;table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Keep&lt;/span&gt; &lt;span class="nx"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;repetitive&lt;/span&gt; &lt;span class="nx"&gt;tests&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt;
&lt;span class="nx"&gt;individual&lt;/span&gt; &lt;span class="s2"&gt;`it`&lt;/span&gt; &lt;span class="nx"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This cuts file length dramatically and makes it obvious when you need to add another row versus a whole new test.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Full Prompt Order at a Glance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Context prompt&lt;/strong&gt; — framework, function purpose, constraints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test plan prompt&lt;/strong&gt; — review before any code is written&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation prompt&lt;/strong&gt; — structured output requirements&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit prompt&lt;/strong&gt; — coverage gap check&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refactor prompt&lt;/strong&gt; — parametrize repetitive cases&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Working through all five steps for a typical utility function takes about 10 minutes. The result is a test suite that would have taken 45–60 minutes to write by hand — and usually has better edge case coverage than the manual version.&lt;/p&gt;




&lt;h2&gt;
  
  
  One More Tip: Anchor to Your Existing Test Style
&lt;/h2&gt;

&lt;p&gt;If your codebase already has tests, paste one existing test file alongside your prompt and add: &lt;code&gt;"Match the style, naming conventions, and structure of the example test file below exactly."&lt;/code&gt; The AI will mirror your patterns, which means the output requires almost no style cleanup before review.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. It's the fastest way to build a repeatable AI-assisted engineering practice. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w7" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Switching AI Tools Mid-Sprint Cost Us a Day (And What We Learned) — Week 6 Roundup</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Fri, 19 Jun 2026 09:01:06 +0000</pubDate>
      <link>https://dev.to/leveragenotes/how-switching-ai-tools-mid-sprint-cost-us-a-day-and-what-we-learned-week-6-roundup-4fd9</link>
      <guid>https://dev.to/leveragenotes/how-switching-ai-tools-mid-sprint-cost-us-a-day-and-what-we-learned-week-6-roundup-4fd9</guid>
      <description>&lt;p&gt;This week's two pieces — one on writing better Git commit messages with AI, and one comparing Claude and ChatGPT for code review — were both born from the same messy sprint where I made a mistake that cost real time.&lt;/p&gt;

&lt;p&gt;Here's what happened.&lt;/p&gt;

&lt;p&gt;Midway through a feature branch, I switched from the AI tool I'd been using for code review to a different one, mostly out of curiosity. I wanted to test a head-to-head comparison in a live context rather than a synthetic one. The model switch was seamless. The workflow wasn't.&lt;/p&gt;

&lt;p&gt;The new tool had a different "grain" — it flagged different things, used different idioms in its suggestions, and didn't carry any of the soft context I'd built up through earlier prompts in the session. I had to re-explain patterns we'd already established. I re-reviewed two files I'd already cleared. Net result: roughly a day's worth of focused review time became a day and a half, and I caught one &lt;strong&gt;genuine&lt;/strong&gt; regression — a missing null check on an edge case — that I'm not confident the original tool would have caught.&lt;/p&gt;

&lt;p&gt;So the lesson wasn't "tool X is better than tool Y." It was that &lt;strong&gt;consistency in tooling during a sprint has its own compounding value&lt;/strong&gt;, and switching mid-flow carries a real context-switching cost that doesn't show up in any benchmark.&lt;/p&gt;

&lt;p&gt;That framing fed directly into the commit message piece too. One thing I tracked this week: AI-assisted commit messages across 34 commits on two branches. Compared to my previous sprint's messages (which I still have in the log), the assisted ones averaged 2.1x longer, contained explicit "why" context in 79% of cases vs. ~20% before, and two of them directly prevented a "what did this change actually do?" question during a sync. Measurable. Mundane. Worth doing.&lt;/p&gt;

&lt;p&gt;The throughline this week: AI tooling rewards deliberate, consistent workflows more than it rewards novelty. Picking the best tool matters less than building repeatable habits around whatever you pick.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w6" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w6&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ai</category>
      <category>engineering</category>
      <category>tools</category>
    </item>
    <item>
      <title>Claude vs ChatGPT for Code Review: Which Is Better?</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Wed, 17 Jun 2026 09:01:18 +0000</pubDate>
      <link>https://dev.to/leveragenotes/claude-vs-chatgpt-for-code-review-which-is-better-2go</link>
      <guid>https://dev.to/leveragenotes/claude-vs-chatgpt-for-code-review-which-is-better-2go</guid>
      <description>&lt;p&gt;If you've Googled this, you've probably already used both and still aren't sure which one to trust with your actual codebase. Here's my concrete answer after running both through real code review workflows: &lt;strong&gt;they're good at different things, and picking the wrong one for the job costs you time.&lt;/strong&gt; Here's exactly how to choose.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Difference That Matters for Code Review
&lt;/h2&gt;

&lt;p&gt;ChatGPT (GPT-4o) is faster and more conversational. It's excellent at quick back-and-forth — paste a function, ask a question, iterate. Claude (Sonnet or Opus) handles larger context windows more gracefully and tends to produce more structured, thorough analysis when you give it a full file or a diff.&lt;/p&gt;

&lt;p&gt;That's not a vibe — it's a practical difference. On a recent project, I fed both models the same 400-line service file and asked for a review. ChatGPT flagged the most obvious issues quickly. Claude caught a subtle state mutation buried in a helper that was three function calls deep. Both missed things. But they missed &lt;em&gt;different&lt;/em&gt; things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where ChatGPT Wins
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Iterative, conversational review.&lt;/strong&gt; You want to ask follow-ups like "why is that a problem?" or "show me a fix" — GPT-4o handles the dialogue better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Short functions and isolated snippets.&lt;/strong&gt; Fast, accurate, minimal friction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explaining unfamiliar patterns.&lt;/strong&gt; "What is this doing and is it idiomatic?" — GPT-4o is strong here.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where Claude Wins
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full-file or multi-file context.&lt;/strong&gt; Claude doesn't degrade as badly at the edges of a long context. Feed it an entire module and it still reasons about the top of the file when reviewing the bottom.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured output.&lt;/strong&gt; Ask Claude for a review in a specific format and it follows it reliably. Useful when you want output you can paste directly into a PR comment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security and logic review on complex code.&lt;/strong&gt; In my experience, Claude surfaces more non-obvious issues on business-logic-heavy code — race conditions, incorrect assumptions about mutability, edge cases in conditional branches.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Prompt I Actually Use (Copy This)
&lt;/h2&gt;

&lt;p&gt;For any non-trivial code review, I use this with Claude:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review the following code as a senior engineer doing a pull request review.
Structure your response as:
1. Critical issues (bugs, security, data integrity)
2. Design concerns (architecture, coupling, testability)
3. Minor improvements (naming, style, readability)
4. Questions I should answer before merging

Be specific. Reference line numbers or function names. Skip praise.

[paste code here]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "skip praise" instruction is load-bearing — without it, both models pad their output with positive framing that buries the real findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Honest Take
&lt;/h2&gt;

&lt;p&gt;Stop treating this as a permanent either/or. Use ChatGPT for fast conversational review of small pieces. Use Claude when you're doing a serious pre-merge review of a whole module. The engineers who get the most out of AI code review aren't loyal to one model — they know which tool fits which context.&lt;/p&gt;

&lt;p&gt;The instinct to pick a winner and stick with it is the same instinct that leads people to use a screwdriver as a hammer. Both tools exist. Use them correctly.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w6" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w6&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>How to Write Better Git Commit Messages with AI</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Mon, 15 Jun 2026 09:00:58 +0000</pubDate>
      <link>https://dev.to/leveragenotes/how-to-write-better-git-commit-messages-with-ai-1j00</link>
      <guid>https://dev.to/leveragenotes/how-to-write-better-git-commit-messages-with-ai-1j00</guid>
      <description>&lt;p&gt;Bad commit messages are a tax you pay forever. You hit &lt;code&gt;git log&lt;/code&gt; six months later and find a wall of "fix stuff", "WIP", "asdf", and "final final v2" — and now you're archaeologist instead of engineer. The good news: AI can eliminate this problem almost entirely, and in this walkthrough I'll show you exactly how to wire it into your workflow with copy-paste prompts you can use today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Commit Messages Fail (And Why AI Actually Helps Here)
&lt;/h2&gt;

&lt;p&gt;The root cause isn't laziness — it's timing. You write the commit message right after a long coding session, when your brain is fried and you just want to push. Context is all in your head, not on the screen.&lt;/p&gt;

&lt;p&gt;AI flips this. You feed it the diff and your rough notes; it drafts a structured message. You edit for accuracy. Total time: 30 seconds. The output is consistently better than what most engineers write under pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Stage Your Changes and Generate a Diff
&lt;/h2&gt;

&lt;p&gt;Before prompting, get a clean diff of what you're about to commit:&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;--staged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the output. If the diff is large (500+ lines), narrow it to the most meaningful files:&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;--staged&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; path/to/relevant/file.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to paste every line into the prompt — a representative slice plus a plain-English summary of your intent is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Use This Base Prompt
&lt;/h2&gt;

&lt;p&gt;Paste this into your AI assistant of choice (ChatGPT, Claude, Copilot Chat, etc.):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;You are a senior engineer helping me write a Git commit message.

Here is the staged diff:
&lt;span class="nt"&gt;&amp;lt;paste&lt;/span&gt; &lt;span class="na"&gt;diff&lt;/span&gt; &lt;span class="na"&gt;here&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

My intent: &lt;span class="nt"&gt;&amp;lt;one&lt;/span&gt; &lt;span class="na"&gt;sentence&lt;/span&gt; &lt;span class="na"&gt;about&lt;/span&gt; &lt;span class="na"&gt;what&lt;/span&gt; &lt;span class="na"&gt;this&lt;/span&gt; &lt;span class="na"&gt;change&lt;/span&gt; &lt;span class="na"&gt;accomplishes&lt;/span&gt; &lt;span class="na"&gt;and&lt;/span&gt; &lt;span class="na"&gt;why&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

Write a commit message using the Conventional Commits format:
&lt;span class="p"&gt;-&lt;/span&gt; First line: type(scope): short imperative summary (max 72 chars)
&lt;span class="p"&gt;-&lt;/span&gt; Blank line
&lt;span class="p"&gt;-&lt;/span&gt; Body: 2–4 bullet points explaining WHAT changed and WHY, not HOW
&lt;span class="p"&gt;-&lt;/span&gt; If there's a breaking change, add a BREAKING CHANGE footer

Output only the commit message, no commentary.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A real example output for a token-refresh bug fix might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix(auth): prevent silent token refresh on expired session

- Remove automatic refresh call when session TTL has already elapsed
- Add explicit expiry check before calling refreshToken()
- Prevents a race condition that caused duplicate refresh requests
  under slow network conditions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's immediately useful to the next engineer reading &lt;code&gt;git log&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Refine With a One-Line Follow-Up
&lt;/h2&gt;

&lt;p&gt;If the first draft is close but not quite right, don't re-explain from scratch. Just correct the specific problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The scope should be "session" not "auth", and the first line
is too long — tighten it to under 60 characters.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI handles surgical edits like this well. You're the reviewer; it's the first-draft writer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Build a Shell Alias for Speed
&lt;/h2&gt;

&lt;p&gt;The friction of copy-pasting manually will kill this habit. Automate it. Add this to your &lt;code&gt;.zshrc&lt;/code&gt; or &lt;code&gt;.bashrc&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="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gcm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git diff --staged | pbcopy &amp;amp;&amp;amp; echo "Diff copied. Paste into your AI prompt."'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Linux, swap &lt;code&gt;pbcopy&lt;/code&gt; for &lt;code&gt;xclip -selection clipboard&lt;/code&gt;. Now your staged diff is on your clipboard in one command, ready to paste into any AI chat.&lt;/p&gt;

&lt;p&gt;For teams using the GitHub CLI, you can go further and pipe directly into a script that calls an API — but the manual copy-paste habit alone will get you 80% of the value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Add a Linter to Enforce the Format
&lt;/h2&gt;

&lt;p&gt;Writing good messages is only half the battle — the other half is making sure they don't regress. Add &lt;code&gt;commitlint&lt;/code&gt; to your repo:&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;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; @commitlint/cli @commitlint/config-conventional
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"module.exports = { extends: ['@commitlint/config-conventional'] };"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; commitlint.config.js
npx husky add .husky/commit-msg &lt;span class="s1"&gt;'npx --no -- commitlint --edit "$1"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now any commit that doesn't follow Conventional Commits format gets rejected before it ever touches your branch. Pair this with the AI prompt above and the format issues go away almost entirely.&lt;/p&gt;




&lt;p&gt;This prompt pattern is one of the ones I've packaged into The AI Leverage Playbook: 50 Prompts &amp;amp; Workflows for Engineers — but the version above is enough to get real value on its own.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Good Looks Like at Scale
&lt;/h2&gt;

&lt;p&gt;Once this habit is set, your &lt;code&gt;git log&lt;/code&gt; becomes actual documentation. You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;git log --oneline&lt;/code&gt; to get a readable changelog for a release&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;git log --grep="fix(auth)"&lt;/code&gt; to find every auth-related fix without grepping source&lt;/li&gt;
&lt;li&gt;Onboard new engineers by pointing them at commit history, not Confluence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The commit message becomes a first-class artifact, not an afterthought.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference: The Prompt, One More Time
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;You are a senior engineer helping me write a Git commit message.

Diff:
&lt;span class="nt"&gt;&amp;lt;paste&amp;gt;&lt;/span&gt;

Intent: &lt;span class="nt"&gt;&amp;lt;one&lt;/span&gt; &lt;span class="na"&gt;sentence&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

Format: Conventional Commits. First line ≤72 chars, imperative mood.
Body: 2–4 bullets on what changed and why. BREAKING CHANGE footer if needed.
Output the commit message only.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save that. Reach for it every time you're about to type "fix stuff."&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w6" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w6&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>We Cut Onboarding Time by 40% Using AI — Here's Exactly What We Did (Week 5 Roundup)</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Fri, 12 Jun 2026 09:00:55 +0000</pubDate>
      <link>https://dev.to/leveragenotes/we-cut-onboarding-time-by-40-using-ai-heres-exactly-what-we-did-week-5-roundup-3no0</link>
      <guid>https://dev.to/leveragenotes/we-cut-onboarding-time-by-40-using-ai-heres-exactly-what-we-did-week-5-roundup-3no0</guid>
      <description>&lt;h1&gt;
  
  
  We Cut Onboarding Time by 40% Using AI — Here's Exactly What We Did (Week 5 Roundup)
&lt;/h1&gt;

&lt;p&gt;This week's theme snuck up on me: &lt;strong&gt;AI as a knowledge transfer tool&lt;/strong&gt;, not just a coding assistant.&lt;/p&gt;

&lt;p&gt;It started with a practical problem. We had a new engineer joining a team that owned a gnarly 4-year-old backend service. No real docs. Tribal knowledge scattered across Slack threads and the heads of two people who'd since moved to other teams. Historically, getting someone productive on this service took 6–8 weeks. The first two weeks were basically lost — reading code, asking questions, getting lost again.&lt;/p&gt;

&lt;p&gt;This time, we tried something different.&lt;/p&gt;

&lt;p&gt;We spent about 3 hours upfront running the codebase through a structured AI-assisted audit. We asked it to map data flows, identify the non-obvious entry points, and flag the areas where the code didn't match what the surrounding comments implied it did. That last part alone surfaced 11 spots where the "how" and "why" had quietly diverged over years of patches.&lt;/p&gt;

&lt;p&gt;From that, we generated a living onboarding doc — not a static README, but something structured around &lt;em&gt;questions a new engineer will actually ask&lt;/em&gt;. Things like: "Why is this service the source of truth instead of the other one?" and "What breaks first when this queue backs up?"&lt;/p&gt;

&lt;p&gt;The new engineer was opening meaningful PRs by the end of week two. That's a 40% reduction in ramp time compared to our baseline on the same service.&lt;/p&gt;

&lt;p&gt;This connects directly to what I wrote about earlier this week. The piece on prompts I use to stay unblocked? Half of those exist because I got tired of losing hours to orientation problems — not knowing where to start, not knowing what I didn't know. AI doesn't fix confusion automatically, but it compresses the time between &lt;em&gt;lost&lt;/em&gt; and &lt;em&gt;oriented&lt;/em&gt; dramatically when you ask it the right questions.&lt;/p&gt;

&lt;p&gt;The junior devs piece is the other side of this coin. Onboarding faster isn't cheating the learning process — it's front-loading the context so the actual learning can happen sooner. Juniors who use AI well aren't skipping the hard parts. They're getting to the hard parts faster.&lt;/p&gt;

&lt;p&gt;That's the pattern I keep seeing: AI as a forcing function for knowledge that was always there but never made explicit.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w5" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w5&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>career</category>
      <category>engineering</category>
    </item>
    <item>
      <title>Junior Devs Who Use AI Are Not Cheating — They're Training Smarter</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Wed, 10 Jun 2026 09:01:14 +0000</pubDate>
      <link>https://dev.to/leveragenotes/junior-devs-who-use-ai-are-not-cheating-theyre-training-smarter-oaj</link>
      <guid>https://dev.to/leveragenotes/junior-devs-who-use-ai-are-not-cheating-theyre-training-smarter-oaj</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Take:&lt;/strong&gt; The engineering community's instinct to gatekeep AI tools from junior developers isn't protecting them — it's handicapping them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I keep hearing some version of this: &lt;em&gt;"Juniors should learn without AI first. Otherwise they won't actually understand anything."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I get the intuition. It rhymes with real advice — learn fundamentals before frameworks, understand SQL before ORMs. But this specific application is wrong, and it's worth pushing back on directly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The "struggle builds understanding" argument doesn't hold here
&lt;/h2&gt;

&lt;p&gt;Yes, productive struggle matters. Banging your head against a bug for an hour can teach you something that a quick answer never would. But that principle has limits.&lt;/p&gt;

&lt;p&gt;The version of struggle that builds understanding is &lt;em&gt;targeted&lt;/em&gt; — you're stuck on a concept, you work through it, something clicks. The version that doesn't build understanding is &lt;em&gt;thrashing&lt;/em&gt; — you're stuck on a syntax issue, a poorly worded error message, or a gap in documentation that has nothing to do with the core concept you're trying to learn.&lt;/p&gt;

&lt;p&gt;AI is exceptionally good at eliminating the second kind of friction. That's not a bug. That's the point.&lt;/p&gt;

&lt;p&gt;A junior dev who uses AI to quickly unblock on a confusing TypeScript error message — and then spends the saved time understanding &lt;em&gt;why&lt;/em&gt; the type system works the way it does — is learning better, not worse.&lt;/p&gt;




&lt;h2&gt;
  
  
  AI is a feedback loop, not a crutch
&lt;/h2&gt;

&lt;p&gt;Here's the practical reality. When a junior developer writes a function and asks an AI to review it, they get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specific feedback on their actual code&lt;/li&gt;
&lt;li&gt;Explanations tied to what they just wrote&lt;/li&gt;
&lt;li&gt;Faster iteration on their mistakes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's a better learning loop than most code reviews in most companies, which happen days later, are often surface-level, and rarely include pedagogical explanation.&lt;/p&gt;

&lt;p&gt;The devs who will struggle aren't the ones using AI. They're the ones using AI &lt;em&gt;without asking why&lt;/em&gt; — copy-pasting without reading, accepting output without testing. That's a habits problem, not a tools problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  The concrete thing to teach instead
&lt;/h2&gt;

&lt;p&gt;If you're mentoring a junior dev, don't tell them to avoid AI. Teach them this prompt habit:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of:&lt;/strong&gt; &lt;em&gt;"Write me a function that paginate results from a database."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use:&lt;/strong&gt; &lt;em&gt;"Write me a function that paginates results from a database, then explain each part of the implementation so I can understand the tradeoffs."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That single shift — demanding explanation alongside output — turns AI into a tutor instead of a vending machine. The understanding is still happening. It's just happening faster.&lt;/p&gt;




&lt;p&gt;The gatekeeping instinct comes from a good place, but it's aimed at the wrong target. The question was never &lt;em&gt;should&lt;/em&gt; juniors use AI. It's &lt;em&gt;how do we help them use it well&lt;/em&gt;.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w5" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w5&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>10 Prompts I Reach for Every Week to Stay Unblocked as an Engineer</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Mon, 08 Jun 2026 09:00:48 +0000</pubDate>
      <link>https://dev.to/leveragenotes/10-prompts-i-reach-for-every-week-to-stay-unblocked-as-an-engineer-1fa5</link>
      <guid>https://dev.to/leveragenotes/10-prompts-i-reach-for-every-week-to-stay-unblocked-as-an-engineer-1fa5</guid>
      <description>&lt;h1&gt;
  
  
  10 Prompts I Reach for Every Week to Stay Unblocked as an Engineer
&lt;/h1&gt;

&lt;p&gt;After five weeks of deliberately logging how I use AI during a normal engineering workweek, a clear set of patterns has emerged. Not the flashy demos — the quiet, repeatable ones that actually move work forward. Here are ten that have become muscle memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Translate a vague ticket into a scoped task list
&lt;/h2&gt;

&lt;p&gt;Product tickets often arrive half-baked. Before I touch code, I paste the ticket text and ask:&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 a senior engineer helping me scope this ticket for implementation.
Given this ticket description: "[PASTE TICKET]"
Output: a numbered list of discrete technical tasks, any ambiguities I should clarify with product, and a one-sentence definition of "done".
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This takes 90 seconds and saves hours of mid-sprint confusion.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Write the test before the implementation
&lt;/h2&gt;

&lt;p&gt;I stopped writing implementation code first. Instead I describe the behavior and ask AI to write the test contract:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Write&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;unit&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="nx"&gt;suite&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;called&lt;/span&gt; &lt;span class="s2"&gt;`applyDiscount(cart, couponCode)`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="nx"&gt;It&lt;/span&gt; &lt;span class="nx"&gt;should&lt;/span&gt; &lt;span class="nx"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;valid&lt;/span&gt; &lt;span class="nx"&gt;coupon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expired&lt;/span&gt; &lt;span class="nx"&gt;coupon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;coupon&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;minimum&lt;/span&gt; &lt;span class="nx"&gt;cart&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;met&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;cart&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;zero&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Use&lt;/span&gt; &lt;span class="nx"&gt;Jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Do&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;implement&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="nx"&gt;only&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having the test in front of me before I write a line of logic keeps the scope tight.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Generate the first draft of a PR description
&lt;/h2&gt;

&lt;p&gt;Blank PR descriptions are a tax on your reviewers. I paste my diff summary and ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Given this list of changed files and a brief summary of what changed: [PASTE SUMMARY]
Write a pull request description with: a one-sentence summary, a bullet list of changes,
any areas reviewers should look at closely, and how to test it locally.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Rubber-duck a design decision with structured pushback
&lt;/h2&gt;

&lt;p&gt;Instead of a normal rubber-duck session, I want pushback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I'm deciding between [Option A] and [Option B] for [specific problem].
Here's my current thinking: [reasoning].
Push back on my preferred option. What am I missing or underweighting?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The forced devil's advocate framing produces better objections than a neutral "compare these two" prompt.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Explain an unfamiliar codebase section
&lt;/h2&gt;

&lt;p&gt;When I land in a module I've never touched:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain what this code does, its likely inputs and outputs, any side effects,
and what could go wrong if someone modifies it without understanding it fully.
[PASTE CODE BLOCK]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Draft an incident postmortem outline
&lt;/h2&gt;

&lt;p&gt;When an incident closes, the postmortem doc gets written under pressure. I paste the timeline and ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Given this incident timeline: [PASTE]
Draft a postmortem outline with: summary, timeline, root cause, contributing factors,
impact, what went well, what didn't, and action items with owners TBD.
Keep the tone factual and blameless.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. Tighten a gnarly regex or SQL query
&lt;/h2&gt;

&lt;p&gt;Rather than asking AI to write it from scratch, I show it what I have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;Here&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;SQL&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt;&lt;span class="s1"&gt;'s slow on large datasets: [PASTE QUERY]
Identify the likely performance bottlenecks and suggest a rewrite with explanation.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern is one of the ones I've packaged into The AI Leverage Playbook: 50 Prompts &amp;amp; Workflows for Engineers — but the version above is enough to get value on its own.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Spot missing error handling
&lt;/h2&gt;

&lt;p&gt;I've started running a dedicated pass for error handling before submitting any PR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review this function for missing or inadequate error handling.
List each case where an unhandled error could cause a silent failure, crash, or bad user state.
[PASTE FUNCTION]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model catches edge cases I've mentally glossed over because I wrote the happy path first.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Write the runbook entry while the fix is fresh
&lt;/h2&gt;

&lt;p&gt;Runbooks go stale because nobody writes them at the right moment. I do it immediately post-fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I just fixed this issue: [DESCRIBE ISSUE AND FIX IN 2-3 SENTENCES]
Write a runbook entry for on-call engineers. Include: symptoms, likely cause,
step-by-step remediation, and how to confirm it's resolved.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  10. Turn a Slack thread into a decision log
&lt;/h2&gt;

&lt;p&gt;Long Slack threads where decisions got made are black holes. I paste the thread and ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Summarize this Slack thread as a decision log entry.
Include: the question being decided, options that were considered,
the decision made, who made it, and the rationale.
[PASTE THREAD]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three months from now, your future self will thank you.&lt;/p&gt;




&lt;h2&gt;
  
  
  The common thread
&lt;/h2&gt;

&lt;p&gt;None of these are "write my code for me" prompts. Every one is about getting to clarity faster — tighter scope, better context, cleaner handoffs. The value isn't outsourcing thinking; it's compressing the parts of the job that drain time without demanding creativity.&lt;/p&gt;

&lt;p&gt;Pick two of these to try this week. Keep the ones that stick.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. It goes out every Monday and each issue is one concrete workflow you can use the same day. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w5" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=long_w5&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ai</category>
      <category>engineering</category>
      <category>tools</category>
    </item>
    <item>
      <title>How We Shipped a Feature in 2 Days That Was Scoped for a Week (Week 4 Friday Roundup)</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Fri, 05 Jun 2026 09:00:44 +0000</pubDate>
      <link>https://dev.to/leveragenotes/how-we-shipped-a-feature-in-2-days-that-was-scoped-for-a-week-week-4-friday-roundup-58h5</link>
      <guid>https://dev.to/leveragenotes/how-we-shipped-a-feature-in-2-days-that-was-scoped-for-a-week-week-4-friday-roundup-58h5</guid>
      <description>&lt;p&gt;Week 4 is done, and I want to talk about one specific thing that happened on Tuesday — because the numbers are concrete enough to be worth documenting.&lt;/p&gt;

&lt;p&gt;We had a feature on the board: a configurable notification dispatch system. PM estimated 5–7 days given the surface area — schema changes, a new service layer, three integration points, and test coverage. The kind of ticket that sits in sprint planning while everyone quietly dreads it.&lt;/p&gt;

&lt;p&gt;We shipped a working version in &lt;strong&gt;2 days and 3 hours&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here's what actually changed: I stopped treating AI as a code autocomplete tool and started using it as a design-pressure machine. Before writing a single line, I fed the requirements doc and our existing service patterns into the model and asked it to surface design contradictions and edge cases I should resolve &lt;em&gt;before&lt;/em&gt; coding. It returned 11 questions. Seven of them were things I'd have hit mid-implementation and had to unwind. Two of them would have caused rework after QA.&lt;/p&gt;

&lt;p&gt;Resolving those upfront — on paper, not in code — saved an estimated 6–8 hours of the kind of debugging that feels productive but isn't.&lt;/p&gt;

&lt;p&gt;The rest of the time savings came from what I wrote about earlier this week: using AI to stress-test the engineering assumptions baked into our pipeline. Once you start treating your toolchain as a thing that can be interrogated rather than trusted, you move faster because you're not finding out at 4pm that your CI config has a silent assumption baked in from 2021.&lt;/p&gt;

&lt;p&gt;Two articles this week explored different sides of this: one looked at the day-to-day mechanics of where AI actually earns its place in a normal workday, and the other was about what happens when you point it at your infrastructure and it exposes fragility you didn't know was there.&lt;/p&gt;

&lt;p&gt;The through-line: &lt;strong&gt;AI is most useful when you use it before the problem is fully formed&lt;/strong&gt;, not after you're already in the weeds.&lt;/p&gt;

&lt;p&gt;That's the pattern worth repeating.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w4" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=roundup_w4&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>tutorial</category>
      <category>career</category>
    </item>
    <item>
      <title>AI Won't Replace Your DevOps Pipeline — But It Will Expose How Fragile It Is</title>
      <dc:creator>The AI Leverage Weekly</dc:creator>
      <pubDate>Wed, 03 Jun 2026 09:01:08 +0000</pubDate>
      <link>https://dev.to/leveragenotes/ai-wont-replace-your-devops-pipeline-but-it-will-expose-how-fragile-it-is-4hde</link>
      <guid>https://dev.to/leveragenotes/ai-wont-replace-your-devops-pipeline-but-it-will-expose-how-fragile-it-is-4hde</guid>
      <description>&lt;h1&gt;
  
  
  AI Won't Replace Your DevOps Pipeline — But It Will Expose How Fragile It Is
&lt;/h1&gt;

&lt;p&gt;Here's a take I'll defend: the most valuable thing AI tooling has done for DevOps isn't automation. It's &lt;strong&gt;diagnosis&lt;/strong&gt;. And most teams aren't ready for what it reveals.&lt;/p&gt;

&lt;p&gt;When you start feeding your CI/CD configs, runbooks, and incident postmortems into an LLM and asking it to reason about them, you don't get magic pipelines. You get a mirror. And the reflection is usually uncomfortable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Problem AI Surfaces
&lt;/h2&gt;

&lt;p&gt;Fragile pipelines survive on tribal knowledge. Someone on your team knows that the deploy job silently retries three times before it emails anybody. Someone else knows that the staging environment health check lies. That knowledge lives in Slack threads and people's heads — not in your tooling.&lt;/p&gt;

&lt;p&gt;AI doesn't "just work" when that context is missing. You paste in your GitHub Actions YAML and ask it to diagnose a flaky test stage and it asks you questions you should already have answers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does this retry block actually retry &lt;em&gt;on&lt;/em&gt;?&lt;/li&gt;
&lt;li&gt;Is this a transient network issue or a test environment issue?&lt;/li&gt;
&lt;li&gt;Where does this failure get surfaced and to whom?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those aren't AI limitations. Those are gaps in your documentation and your observability.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Concrete Example
&lt;/h2&gt;

&lt;p&gt;Here's a prompt pattern that's been useful for surfacing exactly this:&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 a senior SRE reviewing a CI/CD pipeline for operational risk.
Here is our [GitHub Actions / GitLab CI / Jenkins] config: [PASTE CONFIG]
Here is our last 5 incident summaries: [PASTE SUMMARIES]

Identify:
1. Single points of failure that aren't documented
2. Implicit assumptions baked into the pipeline
3. Alert or notification gaps
4. Any step where a silent failure is possible

For each finding, explain WHY it's a risk, not just that it is one.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this and you will get a list. Some of it will be obvious. Some of it will stop you cold because you'll realize you &lt;em&gt;knew&lt;/em&gt; it was a problem and never wrote it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Opinion Part
&lt;/h2&gt;

&lt;p&gt;Teams that treat AI as a pipeline automation layer are going to be disappointed. Teams that treat it as a &lt;strong&gt;forcing function for operational clarity&lt;/strong&gt; are going to come out ahead.&lt;/p&gt;

&lt;p&gt;The pipeline doesn't get smarter because you added AI. Your &lt;em&gt;understanding&lt;/em&gt; of the pipeline gets sharper — and that's what actually reduces incidents.&lt;/p&gt;

&lt;p&gt;If your DevOps practice can't be described clearly enough for an LLM to reason about it, that's not an AI problem. That's a documentation and observability debt problem that was always there. AI just stopped letting you ignore it.&lt;/p&gt;




&lt;p&gt;I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: &lt;a href="https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w4" rel="noopener noreferrer"&gt;https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=medium_w4&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ai</category>
      <category>engineering</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
