Teaching an AI about red-green-refactor (it's like teaching a junior dev)

Jan 27, 2026 1:31 pm

Hi ,


I spent 27 minutes this week refactoring imdone-cli commands to follow Git conventions.


The technical work? Easy.


The hard part? Teaching Claude Code about Test-Driven Development.


It went exactly like teaching a junior developer:


Me: "Write tests first."

Claude: *writes tests*

Claude: *also implements the feature*

Me: "No, tests should FAIL first."

Claude: "Oh! You want red-green-refactor."

Me: "Yes! That's TDD."


Here's what I learned: AI assistants are too helpful. They optimize for "done" not "done right."


The result:


Before (verbose):

imdone template --issue-key SCRUM-123 --template bug


After (Git-like):

imdone template SCRUM-123 bug

imdone t SCRUM-123 bug (with alias)


Why this matters:


Every CLI that invents its own syntax costs you cognitive energy. When tools follow de facto standards like Git, they cost zero mental friction.


Read the full experiment (with video):

👉 https://dev.to/imdone/context-driven-development-experiment-4-normalizing-cli-commands-with-claude-code-and-tdd-5247


I'm curious: Have you used AI assistants with TDD? Do they respect the red-green-refactor cycle, or do they skip ahead like Claude did?


Just hit reply and let me know.


Jesse


P.S. If you haven't updated imdone-cli lately, run npm update -g imdone-cli to get these Git-like commands. Your muscle memory will thank you.

Comments