BUILD OS · REUSABLE RULE

Verify the current behavior before asking an agent to refactor it

Rule

Capture the existing behavior and the regression check before broadening a code change.

Why it matters

An agent can satisfy a local request while changing an adjacent behavior that was never named in the prompt.

Failure mode

A change appears correct by inspection, then breaks an unrelated route or user flow.

Implementation

  1. Inspect the current route and its callers.
  2. Name invariants and edge cases.
  3. Choose a focused test or reproducible manual check.
  4. Review the diff and run the check after the change.

Verification

  • The check fails when the original defect is reintroduced.
  • Existing nearby flows still pass.
  • The final report names files changed and checks actually run.

Evidence and provenance

Documenté

The published agent workflow note documents the Inspect → Report → Plan → Modify → Verify sequence; no comparative benchmark is implied.

Source updated 2026-09-26: published field note.

Primary references

Related problems