Your coding agent is following rules that are no longer true. Here is the fix.
Описание и применение
Инструкция AGENTS.md может устаревать, заставляя агента выполнять неверные команды. Добавление метки covers:, проверка drift в CI и чеклист подтверждения превращают файл в живой документ, который автоматически обнаруживает устаревание и предотвращает ложные успехи.
Задача
An instruction file (AGENTS.md) can become stale, causing an agent to run outdated commands and report success without actually executing the intended tests.
Результат
Implementing a drift check and verification checklist turns a stale, silent instruction file into a living, verifiable document, preventing agents from executing outdated commands and ensuring accurate reporting.
Рабочий процесс
- Add a
covers:line to each agent-visible file listing the paths it describes. - Create a CI job (
scripts/check_doc_drift.sh) that compares the last commit time of each doc against the last commit time of the paths it covers, failing if the doc is older than a threshold. - Ensure CI uses
fetch-depth: 0to get full commit history. - When adding or modifying a rule, discard the current artifact or stash it, start a fresh session with the updated rules, re-run the task, and confirm the issue does not recur.
- Include a verification checklist in the instruction file to force manual confirmation of command, path, and test references.
Доказательства
Your AGENTS.md says the tests run with npm test. Last month a teammate moved them behind a build step.
Give each agent-visible file a covers: line that lists the paths it describes. Then add a CI job that compares the last commit time of each doc against the last commit time of the paths it covers.
If you keep the existing artifact and continue, you are still operating in context polluted by the old system. The model may try to reconcile the new rule with the old work instead of applying it cleanly.
Add a verification checklist to the file
- Дата записи: 2026-10-09T01:56:01.629Z