アンチパターン:避けるべきこと
Simon Willisonは、エージェント生成コードのレビューにおいて、開発者自身が動作確認と責任を持つべきであり、未検証な大量コードを提出する行為は「アンチパターン」であると指摘している。
キーポイント
未検証コードの提出禁止
エージェントが生成した数百〜数千行のコードを、開発者自身が動作確認を行わずにPRとして提出することは、レビュー担当者に作業を押し付ける行為であり厳しく戒めるべきである。
良いPRの定義と要件
適切なエージェント活用によるPRは、動作保証、小さなスコープでの分割、明確な文脈提供、そして開発者自身による説明の検証を含むべきである。
手動テストの証拠提示
レビュー担当者の時間を無駄にしないよう、手動テストの結果や実装意図に関するコメント、動作動画などの具体的な証拠をPRに含めることが推奨される。
影響分析・編集コメントを表示
影響分析
本記事は、Agentic Engineering(エージェント型エンジニアリング)の現場で顕在化している「責任の所在」の問題を指摘しており、単なるツールの利用法を超えて、開発プロセスにおける人間とAIの役割分担に関する規範を提示している。これは、大規模なコードベースを持つ組織やチーム開発において、AI活用による生産性向上と品質維持のバランスを取る上で重要な指針となる。
編集コメント
AIコード生成が一般化する中で、その「使い方」よりも「レビューと責任の取り方」が問われる時代に入ったことを示す重要なエッセイです。チーム開発におけるAI活用のマナーとベストプラクティスを定義するものとして注目すべき内容です。
*Agentic Engineering Patterns >*
私たちの奇妙な新しいアジェンティック・エンジニアリングの世界には、避けるべき振る舞い(アンチパターン)がいくつかあります。
未検証のコードを共同作業者に押し付ける
このアンチパターンは一般的であり、非常に腹立たしいものです。
自分でレビューしていないコードでプルリクエストを作成しないでください。
エージェントがあなたのために作成した数百行(あるいは数千行)のコードを含む PR を開き、そのコードが機能することを自ら確認する作業を行っていない場合、あなたは実際の作業を他の人に委譲していることになります。
彼ら自身もエージェントに指示を出すことができたはずです。果たしてあなたはどのような価値を提供しているのでしょうか?
レビューのためにコードを投稿する場合、それが他の人が時間を割いて取り組む準備ができていると確信できる必要があります。最初のレビューパスはあなたの責任であり、他人に丸投げすべきことではありません。
良いアジェンティック・エンジニアリングのプルリクエストには、以下の特徴があります:
- コードが動作しており、その動作を確信していること。あなたの仕事は、動作するコードを提供することです。
- 変更内容が小さく、レビュー担当者に過度な認知負荷をかけずに効率的にレビューできる範囲であること。大きな PR 一つよりも、複数の小さな PR の方が優れており、コーディングエージェントを使って Git の細かな調整を任せることで、コードを別々のコミットに分割するのは容易です。
- PR には、変更内容を説明するための追加のコンテキストを含めるべきです。その変更が果たす上位レベルの目標は何でしょうか?関連するイシューや仕様へのリンクもここで有用です。
- エージェントは説得力のあるプルリクエストの説明を作成します。あなたもそれらを確認する必要があります!自分が読んで検証していないテキストを他人に読ませようとするのは失礼な行為です。
他の人にレビューされていないコードを簡単に押し付けることがいかに容易かを知っている以上、自分自身で追加の作業を行ったことを示す何らかのエビデンスを含めることをお勧めします。手動テストの方法に関するメモ、特定の実装選択に対するコメント、あるいは機能を実働している様子のスクリーンショットや動画は、レビュアーが詳細を掘り下げるために時間を無駄にしないことを示すのに *非常に* 大きな効果があります。
Tags: ai, llms, ai-ethics, coding-agents, ai-assisted-programming, generative-ai, agentic-engineering, code-review
原文を表示
*Agentic Engineering Patterns >*
There are some behaviors that are anti-patterns in our weird new world of agentic engineering.
Inflicting unreviewed code on collaborators
This anti-pattern is common and deeply frustrating.
Don't file pull requests with code you haven't reviewed yourself.
If you open a PR with hundreds (or thousands) of lines of code that an agent produced for you, and you haven't done the work to ensure that code is functional yourself, you are delegating the actual work to other people.
They could have prompted an agent themselves. What value are you even providing?
If you put code up for review you need to be confident that it's ready for other people to spend their time on it. The initial review pass is your responsibility, not something you should farm out to others.
A good agentic engineering pull request has the following characteristics:
- The code works, and you are confident that it works. Your job is to deliver code that works.
- The change is small enough to be reviewed efficiently without inflicting too much additional cognitive load on the reviewer. Several small PRs beats one big one, and splitting code into separate commits is easy with a coding agent to do the Git finagling for you.
- The PR includes additional context to help explain the change. What's the higher level goal that the change serves? Linking to relevant issues or specifications is useful here.
- Agents write convincing looking pull request descriptions. You need to review these too! It's rude to expect someone else to read text that you haven't read and validated yourself.
Given how easy it is to dump unreviewed code on other people, I recommend including some form of evidence that you've put that extra work in yourself. Notes on how you manually tested it, comments on specific implementation choices or even screenshots and video of the feature working go a *long* way to demonstrating that a reviewer's time will not be wasted digging into the details.
Tags: ai, llms, ai-ethics, coding-agents, ai-assisted-programming, generative-ai, agentic-engineering, code-review
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み