Pi TDD Cycle.
Spike for a Deterministic Red - Green - Refactor state machine that keeps people and coding agents in the loop
Quick solo spike in preparation for a workshop at Socrates UK 2026 to develop a simple tdd extension for Pi.dev .
Inspired by a session by Emily Bache yesterday on reviewing various people's approaches to the RPG rules kata, and a conversation with Jon Jagger on states in the red green refactor cycle, and how we could use LLMs to give people feedback.
Both people and coding agents want to get the job done. So often I find the refactor step is skipped or rushed. The spike version appears to sometimes not pause for developer feedback after Red (when it is time to review the output, and make sure the test feedback is comprehensible), but it (limited testing YMMV) appears to stop on refactor, and cycle back to Refactor, until the developer approves going ahead.
You can choose to write tests and code by yourself, and use the cycle to slow you down, and optionally use an LLM to identify some code smells. You can then choose to act or ignore the code smells. Up to you when the cycle continues.
You can read how this spike came together in the [spike session transcript](transcripts/code-smells.html spike.html).
