🩺 Agentic Git-Doctor

Inspiration

As a 3rd-year AI & Data Science student and freelancer, I often jump between multiple codebases. The biggest "productivity killer" isn't writing code—it's reviewing it. Understanding the intent, security implications, and performance impact of a raw git diff can take hours of mental energy. I wanted to build an "AI Resident" that sits in your workflow, diagnosing technical debt before it even reaches a pull request.

What it does

Agentic Git-Doctor is a multi-agent review system powered by Gemini 1.5 Flash. It takes raw Git diffs and provides a specialized "Medical Report" of your code:

  • The Architect (Security): Scans for hardcoded keys, leaked secrets, and injection risks.
  • The Performance Lead: Identifies algorithmic bottlenecks and inefficient data structures.
  • The Technical Writer: Generates a professional PR description and summarizes the "why" behind the logic.
  • The Surgeon: Provides a "One-Click Fix" code snippet for the most critical issue identified.

How we built it

The project uses a specialized Agentic Prompting architecture to ensure high-signal feedback:

  • Frontend: A high-speed React dashboard styled with Tailwind CSS for a professional "cyber-medical" aesthetic.
  • Orchestration: A Node.js backend that handles the Git stream processing and coordinates API calls.
  • AI Engine: We utilized Gemini 1.5 Flash because of its incredible speed and its ability to handle complex technical reasoning via system-level instructions.
  • JSON-Mode Mapping: We forced the AI to output strictly structured data, allowing the frontend to dynamically generate health gauges and priority-coded alerts.

Challenges we ran into

The biggest challenge was Context Precision. Raw diffs are often fragmented. Initially, the AI would sometimes lose track of the broader project intent. I solved this by refining the "Technical Historian" prompt to force the AI to reason about the structural changes rather than just line-by-line additions.

Additionally, working against a 5-hour deadline meant I had to prioritize a "Zero-Config" experience—making the tool work instantly upon pasting a diff without requiring a full repository clone.

Accomplishments that we're proud of

  • Performance Analysis: Successfully getting the AI to identify Big O complexity shifts. For example, catching when a change moves a function from to :

  • Zero-Latency Feel: Using Gemini 1.5 Flash allowed us to get a full "Consultation" in under 3 seconds.

  • Persona Isolation: Creating a system where three distinct "agents" provide specialized feedback within a single prompt, preventing "advice overlap."

What we learned

  • Prompt Engineering is Software Engineering: I learned that structured outputs are essential for building reliable AI-driven tools.
  • The Power of Gemini: I realized that Gemini’s ability to understand technical context is on par with a senior reviewer when properly grounded in "System Personas."
  • The Value of Time: I proved that a functional, AI-powered developer tool can be built from scratch in a single afternoon if you focus on the "Core Wow Factor."

What's next for Agentic Git-Doctor

  • VS Code Extension: Moving the "Doctor" directly into the editor for real-time diagnosis as you type.
  • Multimodal Audits: Using Gemini's vision capabilities to analyze UI changes by comparing screenshots of the app before and after the diff.
  • GitHub Action Integration: Automating the "Doctor's Report" as an automated comment on every new Pull Request.

Built With

Share this project:

Updates