Skip to content

feat: TDD mode — configurable agent instruction for test-driven review flow #76

Description

@ichoosetoaccept

Summary

Add a configurable TDD mode that adjusts codereviewbuddy's agent instructions to guide the AI into a test-driven development flow when reviewing and resolving PR comments.

Motivation

When an agent fixes review comments, it typically jumps straight to implementation. A TDD mode would instruct the agent to:

  1. Write a failing test first that reproduces the issue flagged by the reviewer
  2. Implement the fix to make the test pass
  3. Verify the fix doesn't break existing tests

This produces higher-quality fixes with built-in regression coverage.

Design

Config

[agent]
tdd_mode = false  # Set to true to enable TDD-guided review flow

Behavior when enabled

  • Agent instructions (system prompt / tool descriptions) are augmented with TDD guidance
  • When resolving a review comment, the agent is guided to:
    1. Read the comment and understand the issue
    2. Write a test that would catch the bug/issue
    3. Run the test to confirm it fails
    4. Implement the minimal fix
    5. Run the test to confirm it passes
    6. Run the full test suite

Open questions

  • Should TDD mode be per-reviewer or global?
  • Should it apply to all comment severities or only bug/flagged?
  • How prescriptive should the instructions be? (strict TDD vs gentle nudge)
  • Should it integrate with the existing resolve_levels config?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions