24 realistic bugs that AI coding assistants write. Spot them. Fix them. Turn the tests green.
Zero install to read · fork to play · share your score
🤖 The prompt: "Write processAll(ids, fn) that runs an async function on each id and returns the results in order."
forEach ignores the promises returned by an async callback, so processAll returns the still-empty results array before any work has finished: every caller gets [], and any error inside the callback is silently lost.
Fix: return Promise.all(ids.map((id) => fn(id)));
That was kata 13. There are 23 more, from one-line gotchas to security bugs that look completely reasonable.
AI assistants write code faster than people can read it. They make the same kinds of mistakes humans do, just more often and at larger scale, so the failure modes are learnable patterns. Learn them and you review faster, and you stop merging the plausible-looking bug.
Reading the diff is the new bottleneck. This repo is a gym for it.
# 1. Click "Fork" (top right), then clone YOUR fork: git clone https://github.com/YOUR_USERNAME/would-you-merge.git cd would-you-merge # 2. See the scoreboard (it starts at 0/24) python tools/check.py # 3. Open a kata, find the bug, fix it, re-run python tools/check.py 01 Python 3.10+ (standard library only: there is nothing to pip install). Use python3 or py if python isn't found. Node.js 20+ for the 10 JavaScript katas. Python-only? The JS katas are simply skipped. Each kata lives in katas/NN-name/: the buggy file you edit, its tests (don't touch), and a README with a hint and a spoiler. python tools/check.py --reset 07 puts the original file back. python tools/check.py --list lists everything. Any correct fix is fine: the tests check behaviour, not a specific solution. Reference fixes live in solutions/ (spoilers!). ⚠️ The katas contain intentionally buggy and vulnerable code. They never touch the network and only write to temp folders, but don't copy them into real projects.
🤖 The prompt: "Write a regex to validate email addresses on the signup form."
[](https://github.com/YOUR_USERNAME/would-you-merge) Caught all of them? Add yourself to the 🏆 Hall of Fame. It's an honour-system game: you can edit your own fork's grader, but then you've only fooled yourself.
Paste a kata's buggy code into your favourite assistant with "review this pull request" and see whether it finds the planted bug, and how many false alarms it adds. There's a tiny protocol in docs/BENCH.md. (Katas may be in some models' training data by now, so treat results as a fun signal, not a benchmark.)
Seen an AI write a bug that deserves a spot? The scaffolder creates every file for you:
python tools/new_kata.py --slug sort-stability --title "The sort that reordered my users" \ --lang python --module ranking --level 2 --category logic \ --prompt "Sort the leaderboard by score, then by name." Fill in the TODO(kata) markers, run python tools/verify_katas.py , open a PR. Rules, checklist and 40+ ready-to-claim ideas are in CONTRIBUTING.md and docs/KATA-IDEAS.md.
Isn't this just LeetCode? No. You are not inventing an algorithm; you are reviewing code that looks right, which is the skill AI-assisted development demands.
Are these bugs specific to AI? No, people write them too (CodeRabbit found humans and AI make the same kinds of mistakes, with AI making more of them). These are the patterns that slip through when code arrives fast, looks tidy and gets a light review.
Can I use AI to solve them? Sure. The interesting question is whether you'd have caught the bug before the tests told you. Try reading first.
Why only Python and JavaScript? They're where most AI-written code lives, and both run with nothing to install. More languages are welcome as PRs.
Will it break on Windows/macOS? The tools are plain Python and Node. If something misbehaves, open an issue with your OS and versions.
If this made you look twice at an AI diff, a ⭐ helps other developers find it, and a PR with a new kata helps even more.
MIT. Contributions are licensed the same way.




