Brief an agent's second try at Rails proration

Vibe codingHard30 minAnthropic and OpenAI style

Your task

You joined a team that owns a 400,000-line Ruby on Rails monolith, and you need proration: when a customer upgrades mid-period, they pay the difference for the days left. You asked an agent for it. It invented a PricingService that does not exist, rebuilt logic that already lives in app/services/billing/, and did its math in floats. The team routes all money math through a Money value object.

Write the brief for the agent's second attempt.

What you know:

  • billing code lives in app/services/billing/, and nobody on the team has a full map of it
  • Money lives in app/models/money.rb and handles rounding and currencies
  • plans have a monthly price, and each billing period starts on the customer's signup day, so periods run 28 to 31 days
  • the team reviews by reading diffs, and big diffs get skimmed

Then, in a few sentences: why did the agent invent a service instead of finding the real ones?