DEV Community

Md. Rafi for kirodotdev

Posted on

I Taught an AI to Use Git So I Wouldn't Have to Fear It Anymore

Cover Image
We've all felt that spark of fear before running a git reset --hard. For the Kiro AI hackathon, I decided to build a tool to extinguish that fear for good.

I call it Git Sensei, an AI-powered guardian for your command line. It's a tool designed to make Git safe, simple, and smart. It acts as a safety net for dangerous commands, translates plain English into Git, and most importantly, it understands the context of your repository to give you the right command at the right time.

But building it presented a classic developer dilemma.

The Challenge: Building for Safety and Innovation

How do you build a tool that is both rock-solid reliable and creatively intelligent?

  • The safety features needed to be perfect. They required upfront planning, a clear architecture, and a rigorous, spec-driven approach.
  • The AI features needed to be experimental. They required rapid iteration, conversational prompting, and the freedom to innovate.

Trying to do both at once usually ends in a messy compromise. This is where using Kiro, the AI IDE, changed my entire workflow.

The Solution: A Hybrid Development Model

I didn't have to compromise. I got to be both an architect and an innovator.

1. For the Foundation: Spec-to-Code
I started by writing a complete blueprint for the application's core: the requirements, the design, and a full task list. I handed this spec to Kiro, and it generated the entire robust, testable foundation of the app. The safety net was built on a rock.

2. For the AI: Vibe Coding
With the foundation secure, I switched to a conversational flow. I used Vibe to explore AI models and used prompt engineering to teach the AI how to be context-aware. Kiro handled all the complex integration, allowing me to focus purely on the AI's logic.

The "Wow" Moment

The payoff was undeniable. In my demo, I created a new, untracked file and gave Git Sensei a simple command: "save my work".

A normal translator would fail. But the context-aware AI knew better.

Demo GIF

It saw the untracked file and correctly suggested git add feature.txt. It didn't just translate my words; it understood my intent.

My Takeaway

My biggest lesson is that we no longer have to choose between rigid planning and chaotic innovation. With modern AI tools, we can apply the right methodology to the right part of the problem. It's a more strategic, flexible, and ultimately more powerful way to build.

If you want to see how it all works, check out the project below.

🔗 GitHub Repo
🎬 Video Demo

Thanks for reading

Top comments (0)