GitGhoul: The Haunted Codebase & Zombie Code Exorcist with Google Gemma 2
This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 🕷️
What I Built: GitGhoul
Every long-lived codebase harbors restless spirits:
- 🧟 Zombie Code: Dead functions, obsolete endpoints, and unreachable returns lingering after rushed merges.
- ⚰️ Comment-Cloth Corpses: Old implementations commented out instead of deleted because developers fear losing history.
- 🕯️ Spectral TODOs: Ancient comments from 2021 like
// TODO: Temporary patch until next sprintthat haunt PRs for years. - 🌀 Cursed Complexity: Deep callback abysses and spaghetti logic where execution paths lose their way.
Standard static analysis tools output sterile, robotic warning tables that developers ignore. GitGhoul turns technical debt into an engaging Halloween ritual:
- Interactive Graveyard UI: Visualizes your codebase as an atmospheric cemetery where files are plotted as weathered tombstones and possession severity scores.
- Heuristic Ghoul Detection: Scans code for dead branches, post-return statements, embalmed commented functions, and ancient TODO markers.
- Local AI Exorcisms powered by Google Gemma 2: Conducts an on-device exorcism using Google's open-weight Gemma 2 (via Ollama). Gemma purifies the code, writes a witty, spooky Repose Blessing in the spirit of Día de los Muertos, and produces a clean, production-ready unified git diff ready for pull requests.
🔒 Why Open Innovation Matters
The Hacktoberfest prompt asks: Why does open innovation matter for what you built? For source code analysis and automated refactoring, open-weight, on-device AI is essential:
- Total Code Sovereignty & Privacy: Source code contains company secrets, proprietary business logic, unreleased algorithms, and API patterns. Uploading company codebases to third-party commercial cloud AI APIs creates unacceptable IP and compliance risks. With Gemma 2 running 100% locally via Ollama, no proprietary code ever leaves your machine.
- Runs in the Dark (Completely Offline): GitGhoul operates with the lights (and the Wi-Fi) off. Whether working on an air-gapped internal server or hacking on a train, the exorcist never drops connection.
- Zero Token Taxes on Large Refactors: Running static analysis and refactoring across thousands of lines of code would rack up costly token bills on closed cloud APIs. Open-weight models cost $0 in ongoing API fees.
📸 Screenshots & Live UI
GitGhoul visualizing haunted files as tombstones, displaying spectral laments, and banishing code spirits with Google Gemma 2.
🛠️ How I Built It
- Frontend & App Architecture: Built on Next.js 16 (App Router + Turbopack) with TypeScript and Tailwind CSS.
- Open-Source AI Engine: Google Gemma 2 (
gemma2:9.2B) served locally through Ollama (http://localhost:11434), constrained with structured JSON outputs. - Scanner Pipeline: Custom TypeScript AST and heuristic regex analyzer identifying dead branches, orphaned comments, and ancient TODOs.
- Gothic Retro Theme: Pixel-accented dark palette, atmospheric grave markers, and celebratory confetti upon completing exorcisms.
💻 Code Repository
- GitHub Repository: https://github.com/Imbiber/git-ghoul
🏆 Prize Categories
- Ghost in the Machine (Hacktoberfest Week 4 Overall Theme): Directly embodies the theme by turning developer technical debt and dead code into an interactive graveyard ritual and digital Día de los Muertos remembrance.
- Best Use of Gemma ($200): Employs Google's open-weight Gemma 2 locally via Ollama for zero-cost, privacy-first code refactoring and diff generation.
Top comments (0)
Comments
No comments yet. Start the discussion.