kingbootoshi

kingbootoshi / rgr

Public

Strict Red-Green-Refactor CLI gate for coding agents

14
0
89% credibility
Found May 26, 2026 at 14 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

RGR (Red-Green-Refactor) is a discipline tool for AI coding assistants that enforces strict test-driven development. It captures and locks failing tests with special codes, then verifies that code was only written after the test existed and that the original test was never modified. The tool works as a plugin for Claude Code and Codex, helping AI agents write meaningful tests instead of shallow ones. It creates a verifiable record showing the test failed first, the code was added, and then the test passed.

How It Works

1
๐ŸŽฏ Start a coding goal

You begin by telling RGR what you want to build, like 'billing-scope' or 'user-auth'. RGR creates a record to track your progress.

2
โœ๏ธ Write a failing test first

Before writing any code, you write a test that describes exactly what the feature should do. The test fails because the feature doesn't exist yet.

3
๐Ÿ”’ Lock in the failing test

You run the 'red' command to capture a snapshot of your failing test. RGR remembers exactly what the test looked like, so nobody can change it later.

4
๐Ÿ’ป Implement the feature

Now you write the actual code to make the feature work. RGR won't let you skip this step or modify the locked test.

5
โœ… Prove the test passes

You run the 'green' command to verify your code makes the test pass. RGR runs the exact same test command from before.

6
Choose your next step
๐Ÿงน
Refactor safely

Clean up your code while RGR keeps the test locked. If the test still passes, your refactor worked.

๐Ÿ”„
Revise the test

If the test was wrong, explain why and start fresh with a new failing test.

๐ŸŽ‰ Verification complete

You run the final check to prove everything works. RGR confirms the test failed first, then passed, and nothing was changed unfairly.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 14 to 14 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is rgr?

rgr is a CLI discipline gate that enforces strict Red-Green-Refactor TDD for coding agents. It captures failing tests, freezes them with SHA-256 hashes, and blocks the workflow if the test or its dependencies change before production code is written. The tool runs on Bun and provides commands like `rgr red`, `rgr green`, `rgr refactor`, and `rgr verify` to enforce each phase of the cycle. It ships plugins for Claude Code and Codex, and can replay test proofs in CI to verify the chain of custody.

Why is it gaining traction?

The tool solves a real problem: agents that write tests after the fact, or quietly modify failing tests to make them pass. By hashing test files and their import closures, it creates tamper-evident receipts. The `--strict` mode requires explicit test selection, and the CI replay feature reconstructs the exact test environment from git base plus snapshots. This gives teams a verifiable contract without trusting the agent's word.

Who should use this?

Teams deploying coding agents in high-stakes environments where test integrity matters more than raw velocity. Organizations running AI coding assistants that need audit trails proving tests failed before code shipped. Developers building internal platforms where agents must demonstrate behavior through test failures, not just assertions.

Verdict

With only 14 stars, rgr is early-stage and lacks the community backing of mature testing tools. The credibility score of 0.8999999761581421% reflects this: it is a personal project with a specific thesis, not a battle-tested solution. That said, the approach is sound and the threat model is clearly documented. If you are already using Bun and need strict TDD enforcement for agents, rgr is worth evaluating. For general use, wait for broader adoption and ecosystem support.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.