<?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: Humam Moin</title>
    <description>The latest articles on DEV Community by Humam Moin (@humam_moin).</description>
    <link>https://dev.to/humam_moin</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%2F3962927%2Ff98c7fee-5828-490c-9975-7a432196300e.png</url>
      <title>DEV Community: Humam Moin</title>
      <link>https://dev.to/humam_moin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/humam_moin"/>
    <language>en</language>
    <item>
      <title>Building an AI-Powered Git Diff Reviewer: Catch Bugs Before You Push</title>
      <dc:creator>Humam Moin</dc:creator>
      <pubDate>Mon, 12 Oct 2026 14:08:18 +0000</pubDate>
      <link>https://dev.to/humam_moin/building-an-ai-powered-git-diff-reviewer-catch-bugs-before-you-push-3mab</link>
      <guid>https://dev.to/humam_moin/building-an-ai-powered-git-diff-reviewer-catch-bugs-before-you-push-3mab</guid>
      <description>&lt;p&gt;Hey dev.to! 👋&lt;/p&gt;

&lt;p&gt;Have you ever pushed a commit in a hurry, only to realize later that you introduced a critical security flaw or a silly bug? We've all been there. The "oops, I'll fix it in the next commit" cycle is a rite of passage for developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if you had a senior developer looking over your shoulder before you even push?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's exactly why I built &lt;strong&gt;Git Diff Reviewer&lt;/strong&gt;, a CLI tool that integrates directly into your Git workflow. When you commit, it automatically extracts your diff, sends it to an LLM (Gemini, OpenRouter, Groq, or local Ollama), and gives you a structured review right in your terminal.&lt;/p&gt;

&lt;p&gt;Let's dive into how it works and how you can set it up!&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ What is Git Diff Reviewer?
&lt;/h2&gt;

&lt;p&gt;Git Diff Reviewer is a pre-commit hook that acts as your personal AI code reviewer. Instead of waiting for CI/CD to fail or a teammate to catch a bug, you get instant feedback.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Provider Support:&lt;/strong&gt; Gemini for deep capability, Groq for ultra-low latency, OpenRouter for flexibility, or Ollama for 100% local privacy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict Review Taxonomy:&lt;/strong&gt; It doesn't just say "this looks bad." It categorizes issues (see the table below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-commit Hook:&lt;/strong&gt; Runs automatically on &lt;code&gt;git commit&lt;/code&gt;. Zero friction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.reviewerignore&lt;/code&gt;:&lt;/strong&gt; Filters out lockfiles, build outputs, and &lt;code&gt;.env&lt;/code&gt; files so you don't waste tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully Tested:&lt;/strong&gt; Comes with 22 unit tests to ensure reliability.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;What it catches&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Critical Bugs&lt;/td&gt;
&lt;td&gt;Logic errors, infinite loops&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔒 Security Vulnerabilities&lt;/td&gt;
&lt;td&gt;SQL injection, XSS, hardcoded secrets (aligned with OWASP/CWE)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚠️ Anti-patterns&lt;/td&gt;
&lt;td&gt;Code smells and bad practices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚡ Performance Bottlenecks&lt;/td&gt;
&lt;td&gt;N+1 queries, inefficient loops&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  How It Works (Architecture)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────┐
│   git commit -m "feat: update auth"      │
└────────────────────┬─────────────────────┘
                     ▼
┌──────────────────────────────────────────┐
│   Pre-commit hook                        │
│   python main.py --staged                │
└────────────────────┬─────────────────────┘
                     ▼
┌──────────────────────────────────────────┐
│   Extract staged diff                    │
│   + filter files via .reviewerignore     │
└────────────────────┬─────────────────────┘
                     ▼
┌──────────────────────────────────────────┐
│   LLM Provider                           │
│   Gemini │ Groq │ OpenRouter │ Ollama    │
└────────────────────┬─────────────────────┘
                     ▼
┌──────────────────────────────────────────┐
│   Structured review printed in terminal  │
└──────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 Setup &amp;amp; Installation
&lt;/h2&gt;

&lt;p&gt;Let's get this running on your machine.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Clone the repository
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/humammoin09-blip/git-diff-reviewer.git
&lt;span class="nb"&gt;cd &lt;/span&gt;git-diff-reviewer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Create and activate a virtual environment
&lt;/h3&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; venv .venv

&lt;span class="c"&gt;# Windows:&lt;/span&gt;
.&lt;span class="se"&gt;\.&lt;/span&gt;venv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\A&lt;/span&gt;ctivate.ps1

&lt;span class="c"&gt;# Mac/Linux:&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  3. Install dependencies
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4. Set up environment variables
&lt;/h3&gt;

&lt;p&gt;Copy the example file and add your API key:&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;cp&lt;/span&gt; .env.example .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Open &lt;code&gt;.env&lt;/code&gt; and configure your provider (e.g., Gemini):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LLM_PROVIDER=gemini
GEMINI_API_KEY=your_api_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Pro tip:&lt;/strong&gt; If you want 100% privacy, set &lt;code&gt;LLM_PROVIDER=ollama&lt;/code&gt; and run a local model!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  5. Install the Git hook
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python main.py &lt;span class="nt"&gt;--install-hook&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That's it! Now, every time you commit, the AI will review your code.&lt;/p&gt;


&lt;h2&gt;
  
  
  💻 Real-World Example
&lt;/h2&gt;

&lt;p&gt;Imagine you write this code:&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;# auth.py
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT * FROM users WHERE id = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When you commit, the AI immediately flags it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=== AI CODE REVIEW ===

[CRITICAL] SQL Injection vulnerability detected
File: auth.py, Line 42
Issue: User input directly interpolated into SQL query.
Fix: Use parameterized queries.
CWE-89: Improper Neutralization of Special Elements used in an SQL Command

[WARNING] Hardcoded secret detected
File: config.py, Line 15
Issue: API_KEY = "sk-abc123..."
Fix: Move to environment variable.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This catches the bug before it ever reaches production. 🛑&lt;/p&gt;


&lt;h2&gt;
  
  
  ⚠️ Honest Limitations
&lt;/h2&gt;

&lt;p&gt;Real security engineers respect honesty over hype, so here's what the tool cannot do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM hallucinations:&lt;/strong&gt; AI can occasionally give false positives. Treat it as a "second pair of eyes," not an absolute truth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context window limits:&lt;/strong&gt; Extremely large diffs might exceed the model's context window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline limitation:&lt;/strong&gt; Unless you are using a local Ollama model, you need an internet connection.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🔮 What's Next? (Roadmap)
&lt;/h2&gt;

&lt;p&gt;I'm just getting started with this. For v2, I'm planning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] GitHub Action integration (automatic PR reviews)&lt;/li&gt;
&lt;li&gt;[ ] Multi-file context understanding&lt;/li&gt;
&lt;li&gt;[ ] Custom rule engine (define your own linting rules)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🤝 Your Turn, dev.to!
&lt;/h2&gt;

&lt;p&gt;If you find this project useful, please give it a Star on GitHub! ⭐&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/humammoin09-blip" rel="noopener noreferrer"&gt;
        humammoin09-blip
      &lt;/a&gt; / &lt;a href="https://github.com/humammoin09-blip/git-diff-reviewer" rel="noopener noreferrer"&gt;
        git-diff-reviewer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An automated terminal tool that runs a Git diff before pushing code, uses an LLM to review or roast your code changes, and catches bad practices.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Git Diff Reviewer&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;A modular, terminal-based CLI tool that inspects local git diffs and sends them to your choice of LLM provider for an automated, high-rigor security and code quality review.&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🌟 Key Features&lt;/h2&gt;
&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;strong&gt;Multi-Provider Support&lt;/strong&gt;: Seamlessly switch between &lt;strong&gt;OpenRouter&lt;/strong&gt;, &lt;strong&gt;Google Gemini&lt;/strong&gt;, &lt;strong&gt;Groq&lt;/strong&gt;, and local &lt;strong&gt;Ollama&lt;/strong&gt; models.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Flexible Diff Targets&lt;/strong&gt;: Review staged changes (&lt;code&gt;--staged&lt;/code&gt;), unstaged changes (&lt;code&gt;--unstaged&lt;/code&gt;), or diff against specific branches/commits (&lt;code&gt;--branch main&lt;/code&gt;).&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Interactive Mode&lt;/strong&gt;: Guided terminal prompts for picking diff targets and providers on the fly.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Strict Review Taxonomy&lt;/strong&gt;: Highlights Critical Bugs, Security Vulnerabilities (OWASP/CWE/Secret leaks), Anti-patterns, and Performance Bottlenecks with actionable Before/After code snippets.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Rich Terminal Rendering&lt;/strong&gt;: Formatted markdown and colorized panels right in your terminal.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Safe Truncation&lt;/strong&gt;: Automatically manages large diffs to avoid LLM token context overflow.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Export to Markdown&lt;/strong&gt;: Save reviews directly to &lt;code&gt;.md&lt;/code&gt; files for pull request comments…&lt;/li&gt;

&lt;/ul&gt;&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/humammoin09-blip/git-diff-reviewer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Break it, fuzz it, and if you find a bug, open an issue. I read every single one.&lt;/p&gt;

&lt;p&gt;Let me know in the comments what features you'd like to see in v2!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>git</category>
      <category>opensource</category>
      <category>python</category>
    </item>
    <item>
      <title>Building an AI Devil's Advocate: A Multi-Agent Debate App with LangGraph &amp; Streamlit #ai #python #opensource #showdev</title>
      <dc:creator>Humam Moin</dc:creator>
      <pubDate>Sun, 11 Oct 2026 06:33:17 +0000</pubDate>
      <link>https://dev.to/humam_moin/building-an-ai-devils-advocate-a-multi-agent-debate-app-with-langgraph-streamlit-ai-53mo</link>
      <guid>https://dev.to/humam_moin/building-an-ai-devils-advocate-a-multi-agent-debate-app-with-langgraph-streamlit-ai-53mo</guid>
      <description>&lt;p&gt;Hey devs! &lt;br&gt;
This is my first post on here, and I am sharing what I built&lt;/p&gt;

&lt;p&gt;Have you ever wanted an AI that argues with itself? I recently built a project called "&lt;em&gt;AI Devil's Advocate&lt;/em&gt;" — a multi-agent debate application that lets two AI agents argue a topic while a Judge AI delivers the final verdict.&lt;/p&gt;

&lt;p&gt;But building it came with a major challenges like: API Rate Limits etc. &lt;/p&gt;

&lt;p&gt;Here is how I built it, how it works, and how I solved the rate-limit issue using Automatic Fallback.&lt;/p&gt;

&lt;p&gt;What is AI Devil's Advocate?&lt;/p&gt;

&lt;p&gt;It's an autonomous multi-agent system where:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent A (For): Argues in favor of the topic.&lt;/li&gt;
&lt;li&gt;Agent B (Against): Argues against the topic.&lt;/li&gt;
&lt;li&gt;Judge AI: Listens to both sides and provides a structured verdict.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's fully built with Python, LangGraph, and Streamlit, supporting multiple free-tier providers like Groq, Google Gemini, and OpenRouter.&lt;/p&gt;

&lt;p&gt;Key Features&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Multi-Provider Architecture: Switch between Groq, Gemini, and     OpenRouter on the fly.&lt;/li&gt;
&lt;li&gt;Automatic 429 Fallback (The Magic): If your active provider hits a rate limit or quota exhaustion, the app automatically switches to your next configured provider with zero interruption to the debate.&lt;/li&gt;
&lt;li&gt;Polished UI &amp;amp; Animations: Custom CSS, Google Fonts (Inter/Poppins), fade-in animations, and stylized debater cards.&lt;/li&gt;
&lt;li&gt;Transcript Exports: Download the entire debate as a styled PDF or Markdown file with 1 click.&lt;/li&gt;
&lt;li&gt;Session API Call Counter:** Real-time sidebar counter to monitor your free-tier usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tech Stack &amp;amp; Architecture&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Frontend: Streamlit (with custom CSS for animations)&lt;/li&gt;
&lt;li&gt;Orchestration: LangGraph (State machine for multi-agent flow)&lt;/li&gt;
&lt;li&gt;LLM Factory: Custom &lt;code&gt;FallbackLLMWrapper&lt;/code&gt; class that handles provider switching.&lt;/li&gt;
&lt;li&gt;Providers: Groq (ultra-low latency), Google Gemini, OpenRouter.&lt;/li&gt;
&lt;li&gt;Exports: ReportLab (for PDF generation).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How the Fallback Works&lt;br&gt;
Instead of relying on one API, I built an &lt;code&gt;llm_factory.py&lt;/code&gt; that wraps all providers. If the primary LLM throws a &lt;code&gt;429 Too Many Requests&lt;/code&gt; error, the wrapper catches it and immediately routes the prompt to the next available provider in the list. The debate never stops!&lt;/p&gt;

&lt;p&gt;Try it Live!&lt;/p&gt;

&lt;p&gt;I have deployed it on Streamlit Community Cloud. You can try it right now:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://legal-debate-agent.streamlit.app/" rel="noopener noreferrer"&gt;Live Demo Link&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open Source&lt;/p&gt;

&lt;p&gt;The project is completely open-source. Feel free to fork it, add new providers, or improve the UI!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/humammoin09-blip/Legal-Debate-Agent" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What I Learned&lt;/p&gt;

&lt;p&gt;Building this taught me a lot about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;State Management in LangGraph for multi-agent conversations.&lt;/li&gt;
&lt;li&gt;Error Handling in Production LLMs (the 429 fallback is a lifesaver).&lt;/li&gt;
&lt;li&gt;UI/UX in Streamlit — you can make it look like a real SaaS product with a bit of custom CSS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have any questions or feedback, drop a comment below! I'm currently exploring more Agentic AI workflows. &lt;/p&gt;

&lt;p&gt;And this is my first post, so please let me know if I made any mistakes in writing or anywhere else. Also, if you like the repo, please consider giving it a star..&lt;/p&gt;

&lt;p&gt;Happy coding! &lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
