Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

When agents invent APIs — make grep-first a merge gate

Описание и применение

Агенты часто создают новые публичные API, не проверяя существующие. Внедрение «grep-first» как порога слияния заставляет их искать существующие символы, цитировать найденные пути и запрещать создание новых общих экспортов без одобрения, тем самым уменьшая количество ошибок и ускоряя ревью.

Задача

Agents often create new shared APIs or duplicate existing ones without checking the repository, leading to unnecessary code churn and review overhead.

Результат

Implementing a grep-first merge gate reduced the number of PRs with invented APIs, improved code quality, and streamlined the review process.

Рабочий процесс

  • 1. Agent searches the repo for the intended symbol using rg or IDE search.
  • 2. Agent cites at least one real file path and a one-line snippet proving existence.
  • 3. If no match, agent stops and lists alternatives (reuse nearby pattern, extend existing module, or request human approval).
  • 4. PR is rejected if it introduces new exports under shared/lib/hooks/api directories without a REVIEW_OK comment.
  • 5. Reviewers enforce checklist: grepped imports, no new shared files, no parallel hooks, private helpers unexported, CI/bot checks for new exports.

Доказательства

I keep catching agent PRs that call helpers that do not exist.

Источник

The fix that stuck for me is boring: grep-first as a merge gate.

Источник

In the prompt (and later in CI), I require: Search before invent – rg / IDE search for the intended symbol, path, or behavior.

Источник

Prompts alone drift. I also fail the PR when the diff introduces new exports under shared folders without a checklist comment.

Источник

  • Дата записи: 2026-11-02T12:14:14.988Z