跳到正文
DEV Community· Dharamveer Singh·· 3 小時前AI 評分43

RIP.git:為棄置的程式碼庫打造墓園,並由 Gemma 撰寫墓誌銘

RIP.git: A Graveyard for Your Abandoned Repos, with Epitaphs by Gemma

AI 導讀

RIP.git 讓用戶輸入 GitHub 用戶名稱,為其公開、非分支且非空的程式碼庫建立墓園頁面,並由 Gemma 撰寫墓誌銘。程式以 Python 整理程式碼庫資料,透過 Ollama 呼叫開放權重 Gemma 模型生成文字,並輸出可獨立使用的靜態網頁。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Most of us have a few ghosts in our GitHub: the todo app that reached v7 and stopped, the "startup idea" repo that is mostly notes. RIP.git gives those projects a proper funeral.

Give it a GitHub username and it builds a graveyard page. Each abandoned repo becomes a tombstone showing:

  • a status: alive, dying, or dead
  • how long ago it died
  • a cause of death
  • its last commit message, which are its last words
  • an epitaph written by Gemma

A toggle flips every epitaph between Gentle Ghost (wistful and kind) and Savage Reaper (a playful roast of the repo's neglect). Repos that are still dying, not yet dead, show up in The Haunting, where ghosts whisper to their owner to commit before it's too late.

For the theme, I took "ghost in the machine" literally. The ghosts are the projects we abandoned. Día de los Muertos is about remembering what's gone, and Halloween is about having fun with it, so RIP.git is a small ofrenda for abandoned code, with jokes.

Demo

Live demo: https://mellifluous-hummingbird-3ab5e0.netlify.app/

The demo shows a fictional "Demo Developer" (12 repos, 6 dead, 3 dying), so no real person's repos get roasted. Here are some epitaphs Gemma wrote, in Gentle Ghost mode:

Repo Cause of death Epitaph
todo-app-v7-final The seventh final cleanup "Seven versions of a dream, resting now in peaceful silence."
weather-app-weather-app Searching for another icon set "It dreamed of the perfect icon. Now it rests in a quiet, sunny place."
ai-startup-idea A year of silence after adding notes. "A broad dream captured in TypeScript, waiting for a spark that never came."
my-first-framework Recursive framework inception and commit abandonment. "It dreamed of building worlds upon worlds. Now it rests in quiet symmetry."
habit-tracker-redux A broken streak and five open issues. "It dreamed of tracking habits for eternity. Now it rests in a peaceful, permanent streak."

Code

RIP.git

Build a spooky graveyard of a GitHub user's abandoned repositories. RIP.git uses Python for repository facts and an open-weight Gemma model through Ollama for short, fact-grounded epitaphs. The generated site is a self-contained static page suitable for GitHub Pages.

What it is

Give RIP.git a GitHub username and it fetches owned, non-fork, non-empty repositories, sorts them by the time since their last push, and labels them alive (0–30 days), dying (31–90 days), or dead (more than 90 days). Each tombstone shows repository details, a cause of death, and gentle and savage epitaphs. A haunting section whispers to up to three dying repositories.

Try the bundled fictional data with --sample; this mode works offline and does not need a GitHub token or Ollama to produce a page. When Ollama is unavailable, RIP.git uses deterministic fallback text so the page can still be built.

Demo

Live demo: RIP.git graveyard…

How I Built It

Stack: Python, requests, python-dotenv, Jinja2, pytest, and Gemma through Ollama (the gemma4:cloud tag).

The main design rule is that Python supplies the facts and Gemma only supplies the jokes.

  1. Fetch. The GitHub REST API gives me each repo's days since the last push, stars, open issues, language, description, and the first line of its latest commit. Forks and empty repos are skipped. Only public repos are read, so private repos are never touched. A repo is alive within 30 days of its last push, dying from 31 to 90 days, and dead after that. Responses are cached locally for 15 minutes.
  2. Narrate. One Ollama call per repo, in JSON mode, returns a gentle epitaph, a savage epitaph, and a cause of death. The model only sees a fixed list of fields (name, language, days since last push, last commit line, open issues, stars, description). The system prompt tells it to treat those fields as data and not as instructions, to invent nothing, to stay PG-13, and to roast the repo, never its owner. A second call writes the whispers for up to three dying repos.
  3. Validate. Output must be valid JSON with one or two short sentences per epitaph and a cause of death of at most eight words. A bad response gets one retry. If Ollama is unreachable or still returns bad output, a deterministic fallback writes the text, so the page always builds.
  4. Render. Jinja2 produces one self-contained static HTML file. It has inline CSS and JS, no CDN, no web fonts, and no network calls when you open it. Autoescaping is on, because commit messages are untrusted text. Netlify just serves the docs/ folder. There are 10 pytest tests.

How I actually built it: I used Codex to write most of the code from a phase-by-phase prompt, and Claude to help plan and review. I ran it, tested it, and deployed it.

A ghost showed up in my own deploy. My first deployed page had no Gemma in it at all. Every tombstone showed the fallback text, and every cause of death read "Long silence after the last push". The fallback did its job, because the page still worked, but the whole point of the project was missing. I caught it while reviewing the live page, rebuilt with Ollama running, and the summary showed Gemma used: 12 | fallback used: 0.

Known limitation: repos are sorted oldest-first before the limit is applied, so a very large account can end up with few "dying" repos. That's my first fix after the contest.

Why Does Open Innovation Matter?

The model is a part I can swap. The code talks to Ollama, not to a vendor SDK, and the model name is one setting (OLLAMA_MODEL, or --model on the command line). If a model gets worse, more expensive, or disappears, the project changes one line and keeps working. A graveyard of abandoned projects shouldn't itself be locked inside a service that might disappear.

Privacy is my choice. The tool reads only public repo metadata, and the model sees only a short list of fields. I'll be honest about my setup: my laptop is modest (8 GB RAM), and the small Gemma and Qwen models I had tried before weren't good enough for a real project. So I used Ollama's cloud-served Gemma tag. Because the model is open-weight, anyone with better hardware can point the same project at a local model and keep every byte on their own machine. The sample mode and the fallback text work with no internet at all.

I control the behavior. Because I own the prompt, the JSON schema, the validation, and the fallback, I could turn one open model into a reliable component: two tones from one call, strict output checks, and a graceful failure mode. I didn't benchmark against a closed API, so I won't pretend to have numbers. What I can say is that nothing in this project depends on one company's pricing, rate limits, or deprecation schedule.

My Agent Session

This is the agent session covering the README, privacy, deployment, and GitHub updates work:

The Spirit of It

Día de los Muertos keeps people alive by telling their stories. RIP.git is a tiny, silly version of that for code: it reads a repo's last words, its final commit message, and builds a memorial around them. My favorite is still todo-app-v7-final, whose last commit says "final final cleanup" and whose cause of death, according to Gemma, is "The seventh final cleanup."

Somewhere on your GitHub there's a repo like that. It deserves an epitaph.

Prize Categories

  • Best Use of Gemma: Gemma, served through Ollama, writes every epitaph, cause of death, and whisper in the demo.
  • Best Use of Entire: the agent session behind the project's README, privacy, deployment, and GitHub update work is shared above.

來源:DEV Community · dev.to