0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

あなたのAGENTS.md、もう存在しないコマンドやパスを指してませんか? CIで検証するリンタを作った

0
Last updated at Posted at 2026-07-18

AGENTS.md は静かに腐る

Claude Code / Cursor / Codex などのエージェントに渡す AGENTS.md(や llms.txt / CLAUDE.md)。「セットアップは npm run build」「エントリは src/index.ts」と書いてあるのに、リネームや削除で その指示がいつのまにか嘘になっていく。エージェントはそれを信じて事故ります。

表記ゆれや文体ではなく、"嘘の指示" そのもの を CI で落とすリンタ、agents-lint を作りました。

何を検出するか

わざと不整合を入れたサンプルを通すと、こうなります。

✗ agents-lint: AGENTS.sample.md — 3 件の参照エラー
  :8   `npm run build` — package.json に script "build" がありません
  :14  参照 `src/parser.ts` が存在しません
  :15  参照 `test/run.mjs` が存在しません
exit code: 1
  • npm run <script>package.json に無ければエラー(近い名前を提案)
  • バッククォートで書かれた参照パスがディスクに無ければエラー
  • 何か問題があれば終了コード 1

CI で使う(定着の本体)

name: agents-lint
on: [push, pull_request]
jobs:
  agents-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hyuga611/agents-lint@main

指摘は PR にインライン注釈で出て、ジョブが落ちるので 古い設定はマージできません。人が意識しなくても毎PRで走る=これが定着の本体です。

リポジトリ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?