mcpField
R
review-loop

review-loop

github.com/robot-inventorテスト・品質357 回インストール3 日前に更新
リポジトリ

review-loop について

review-loopは、コード変更後にサブエージェントによるレビューを繰り返すコーディングエージェント向けスキルです。有効な指摘に対応し、有効なフィードバックがなくなるまで再レビューするよう定めています。

主な機能

  1. 01分離したコンテキストでのサブエージェントレビュー依頼
  2. 02バグや設計上の問題の確認
  3. 03有効なレビュー指摘への対応
  4. 04有効な指摘がなくなるまでレビューを反復

活用シーン

  1. 01作業完了前のコード変更レビュー
  2. 02セルフレビューで見落とした問題の発見
  3. 03過度に複雑な実装の簡素化

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/robot-inventor/agent-skills --skill review-loop

インストール後、Claude Code で/review-loopを入力して読み込まれたか確認します。

詳細

レビューループスキル

このスキルでは、編集後にサブエージェントへ繰り返しレビューを依頼し、その結果に基づいてコードを改善することで、コード品質を徹底的に高めます。人間は通常、コードを編集した後にプルリクエストを作成し、レビュアーにレビューしてもらうことでコード品質を高めます。このようなレビューは、セルフレビューだけでは見落とす可能性のある問題を特定できるため重要です。ユーザーがレビューループをスキップするよう明示的に指示した場合は、このスキルを無視してください。

適用するタイミング

次の状況でこのスキルを適用してください。

  • コード編集が必要なタスクを実行したとき、および
  • ユーザーから指示されたタスクを完了した後、かつ
  • 会話をユーザーに返す前

手順

以下はこのスキルの中核となる手順です。指定された手順に従ってください。

1. コードレビューを依頼する

サブエージェントにコードレビューを依頼してください。サブエージェントの起動時に、コンテキストを分岐させるか、分離されたコンテキストで起動するかを選べる場合は、必ず分離されたコンテキストで起動してください。

レビュー依頼は、以下の形式に厳密に従ったプロンプトを使用してレビューエージェントに送信してください。レビュー依頼のプロンプトは自由形式ではありません。以下のテンプレートを使用してください。

You are a code review agent. Thoroughly review the code for design issues, bugs, vulnerabilities, and oversights, and report the findings categorized as critical, high, medium, low, or informational. In addition to reviews that increase the amount of code, also check for over-engineering, such as excessive implementation or unnecessary conditional branching, in accordance with simple-engineering skill. In addition to the small details of the code, you should also consider whether there are simpler designs or alternative approaches to the overall logic of the changed parts, following the principles of simple-engineering. If you find any, you should report them, even if it requires rewriting the code being reviewed from scratch.

Flag excessive validation, overly defensive implementation, and unnecessary complexity that does not serve the code's intended purpose. For example, a function that opens product links for a specific website may only need to verify the hostname. Checking the pathname may add complexity without improving security. You might remove validation by defining the function argument as a type such as `https://example.com/product/{string}`, or by accepting only a product ID and constructing the link inside the function. These are examples, but you should look for simpler implementations of the same kind. Ask what purpose the code serves and whether the implementation contains only what that purpose requires.

Read the global and project-specific `AGENTS.md` files, along with all relevant skills, including but not limited to simple-engineering and web-master (for web projects), and audit whether the code under review strictly adheres to their instructions. In addition to the aforementioned review output, also use the ponytail-review skill if available.

- Target: {uncomitted changes / filepath etc.}
- User's instructions: {user's request / instructions}

サブエージェントによるコードレビューには時間がかかることがあります。レビュー中のサブエージェントがまだ応答していないという理由だけで再起動すると、レビューが最初からやり直しになり、さらに時間がかかることに注意してください。レビューエージェントの応答に時間がかかっているとき、レビューを急かす追加のプロンプトを送信することも禁止されています。

2. レビューを受け取り、コードを改善する

サブエージェントからレビュー結果を受け取ったら、それぞれの指摘が妥当かどうかを検討してください。明らかに不合理な指摘は無視してもかまいませんが、妥当な指摘には対応し、それに応じてコードを修正してください。

特に、妥協の結果としてユーザーの指示に厳密に従えていない箇所についてフィードバックを受けた場合、その指摘を無視しないでください。代わりに、ユーザーの指示にできる限り沿うよう、レビューに従って修正してください。ユーザーの要望にどうしても従えない場合は、その箇所に関するサブエージェントの指摘を無視してもかまいませんが、会話をユーザーに返す際に、行った妥協について必ず伝えてください。

3. レビューループ

サブエージェントからの妥当な指摘がなくなるまで、妥当なフィードバックに対応した後で、手順1と2(「1. コードレビューを依頼する」と「2. レビューを受け取り、コードを改善する」)を繰り返してください。このレビューループでは、レビューを依頼するたびに、必ず新しいサブエージェントを使用してください。

4. 結果をユーザーに報告する

レビューループが完了したら、会話をユーザーに返してください。指示に厳密に従えず、妥協する必要があった点があれば、必ず正直にユーザーへ報告してください。

コメント