DEV Community

Cover image for I made an AI that roasts your code (and it's brutally honest)
Antonio Tirado Montes
Antonio Tirado Montes

Posted on • Originally published at codemasterip.com

I made an AI that roasts your code (and it's brutally honest)

We've all been there: you push code thinking it's clean, then a senior dev comments "why?" on line 47 and your soul leaves your body.

I built Code Roast to give you that experience before the PR — for free, with AI, in 15 languages.

The brief
Build an AI code reviewer that's funny, honest, and educational.
Bonus: it should hurt a little (so you remember the lesson).

The result
You paste code → the AI returns:

A roast ("This 47-line function violates SRP harder than my New Year's resolutions")
A severity badge (mild → catastrophic) you can share
Actionable fixes (because being mean isn't useful without solutions)
The prompt that makes it work
After 30+ iterations, this is the structure that consistently produces funny + useful:

const prompt = `You are a senior dev reviewing code for a junior. Be:

  • BRUTAL but FAIR (no personal attacks, only the code)
  • SPECIFIC (cite line numbers, name the antipattern)
  • CONSTRUCTIVE (every roast = one concrete fix)
  • FUNNY (one joke max, never at the dev's expense)

Return JSON:
{
"severity": "mild" | "medium" | "spicy" | "catastrophic",
"roast": "<2-3 sentences, the funny part>",
"issues": [{ "line": number, "problem": string, "fix": string }],
"verdict": ""
}

Code to review:
`\
${userCode}
\``;
The key insights:

Constraint produces creativity. "One joke max" forces the model to pick the best one.
Structured output > prose. JSON makes the UI predictable and shareable.
Severity as enum lets us show different badge designs (and a different Kody face per level).
The tech stack (boring on purpose)
Frontend: React + Vite + Tailwind
AI: Gemini 2.5 Flash via Supabase Edge Function
Rate limiting: Postgres rate_limits table, 5 roasts/hour for free, unlimited Pro
Result sharing: dynamic 1200×630 SVG generated in another Edge Function
The whole thing is ~400 lines of code for the feature itself.

What surprised me

  1. Severity badges drive 80% of the shares.
    People love showing off a "Catastrophic 🔥" badge to their friends way more than the actual review. Make the outcome shareable, not the process.

  2. Multilingual roasts hit different.
    A Spanish dev got a roast that included a "madre mía" and tweeted it. Localized humor > translated humor.

  3. Free tier converts.
    About 4% of users hit the free limit and upgrade. The tool itself is the funnel.

Try it (free, no signup needed)
👉 codemasterip.com/code-roast

Paste your worst code. I dare you.

Have you built AI tools that lean into humor? What worked for you? Comments are open.

Top comments (0)