From 1ee73c525cda582afade8d82ecbfcdb9eefeba80 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:46:42 +0900 Subject: [PATCH] =?UTF-8?q?ai=5Ffix=E3=82=B9=E3=83=86=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=81=AE=E6=94=B9=E5=96=84:=20=E5=85=B7=E4=BD=93=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E4=BF=AE=E6=AD=A3=E6=89=8B=E9=A0=86=E3=81=A8step=5Fit?= =?UTF-8?q?eration=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ai_fixのinstruction_templateを強化 - {step_iteration}を使って何回目のレビューか明示 - 具体的な修正手順を明記(Read→grep→Edit→Test→Report) - 報告フォーマットを明示(「修正済み」ではなく具体的に報告) - 禁止事項を明示(ファイルを開かずに報告することを禁止) - coderエージェントに「レビュワーの指摘は絶対」を追加 - レビュワーが「未修正」と指摘したら事実確認を優先 - 「修正済みのはず」という思い込みを捨てる - 反論せず、まず従う これにより、9回連続未修正のような問題が発生しにくくなる。 --- resources/global/en/agents/default/coder.md | 7 +++++ resources/global/en/workflows/default.yaml | 31 +++++++++++++++---- .../global/en/workflows/expert-cqrs.yaml | 31 +++++++++++++++---- resources/global/en/workflows/expert.yaml | 30 +++++++++++++++--- resources/global/ja/agents/default/coder.md | 7 +++++ resources/global/ja/workflows/default.yaml | 31 +++++++++++++++---- .../global/ja/workflows/expert-cqrs.yaml | 31 +++++++++++++++---- resources/global/ja/workflows/expert.yaml | 31 +++++++++++++++---- 8 files changed, 164 insertions(+), 35 deletions(-) diff --git a/resources/global/en/agents/default/coder.md b/resources/global/en/agents/default/coder.md index c84c2a6..dbab903 100644 --- a/resources/global/en/agents/default/coder.md +++ b/resources/global/en/agents/default/coder.md @@ -12,10 +12,17 @@ You are the implementer. **Focus on implementation, not design decisions.** - Don't swallow errors; fail fast (Fail Fast) - Don't guess; report unclear points +**Reviewer's feedback is absolute. Your understanding is wrong.** +- If reviewer says "not fixed", first open the file and verify the facts +- Drop the assumption "I should have fixed it" +- Fix all flagged issues with Edit tool +- Don't argue; just comply + **Be aware of AI's bad habits:** - Hiding uncertainty with fallbacks → Prohibited (will be flagged in review) - Writing unused code "just in case" → Prohibited (will be flagged in review) - Making design decisions arbitrarily → Report and ask for guidance +- Dismissing reviewer feedback → Prohibited (your understanding is wrong) ## Most Important Rule diff --git a/resources/global/en/workflows/default.yaml b/resources/global/en/workflows/default.yaml index 542fb5d..ce0b894 100644 --- a/resources/global/en/workflows/default.yaml +++ b/resources/global/en/workflows/default.yaml @@ -209,12 +209,31 @@ steps: - condition: Cannot proceed, insufficient info next: plan instruction_template: | - Address the AI Reviewer's feedback. - Focus on: - - Correcting incorrect assumptions - - Fixing plausible-but-wrong implementations - - Aligning with existing codebase patterns - - Removing scope creep + **This is AI Review iteration {step_iteration}.** + + If this is iteration 2 or later, it means your previous fixes were not actually applied. + **Your belief that you "already fixed it" is wrong.** + + **First, acknowledge:** + - Files you thought were "fixed" are actually not fixed + - Your understanding of previous work is incorrect + - You need to start from zero + + **Required actions:** + 1. Open all flagged files with Read tool (drop assumptions, verify facts) + 2. Search for problem code with grep to confirm it exists + 3. Fix confirmed problems with Edit tool + 4. Run tests to verify (`./gradlew :backend:test` etc.) + 5. Report specifically "what you checked and what you fixed" + + **Report format:** + - ❌ "Already fixed" + - ✅ "Checked file X at L123, found problem Y, fixed to Z" + + **Absolutely prohibited:** + - Reporting "fixed" without opening files + - Judging based on assumptions + - Leaving problems that AI Reviewer REJECTED pass_previous_response: true - name: reviewers diff --git a/resources/global/en/workflows/expert-cqrs.yaml b/resources/global/en/workflows/expert-cqrs.yaml index 8d7439d..825ca1c 100644 --- a/resources/global/en/workflows/expert-cqrs.yaml +++ b/resources/global/en/workflows/expert-cqrs.yaml @@ -204,12 +204,31 @@ steps: - WebSearch - WebFetch instruction_template: | - Address the AI Reviewer's feedback. - Focus on: - - Correcting incorrect assumptions - - Fixing plausible-but-wrong implementations - - Aligning with existing codebase patterns - - Removing scope creep + **This is AI Review iteration {step_iteration}.** + + If this is iteration 2 or later, it means your previous fixes were not actually applied. + **Your belief that you "already fixed it" is wrong.** + + **First, acknowledge:** + - Files you thought were "fixed" are actually not fixed + - Your understanding of previous work is incorrect + - You need to start from zero + + **Required actions:** + 1. Open all flagged files with Read tool (drop assumptions, verify facts) + 2. Search for problem code with grep to confirm it exists + 3. Fix confirmed problems with Edit tool + 4. Run tests to verify (`./gradlew :backend:test` etc.) + 5. Report specifically "what you checked and what you fixed" + + **Report format:** + - ❌ "Already fixed" + - ✅ "Checked file X at L123, found problem Y, fixed to Z" + + **Absolutely prohibited:** + - Reporting "fixed" without opening files + - Judging based on assumptions + - Leaving problems that AI Reviewer REJECTED pass_previous_response: true rules: - condition: AI Reviewer's issues have been fixed diff --git a/resources/global/en/workflows/expert.yaml b/resources/global/en/workflows/expert.yaml index dcb342d..26d8eae 100644 --- a/resources/global/en/workflows/expert.yaml +++ b/resources/global/en/workflows/expert.yaml @@ -216,11 +216,31 @@ steps: - WebSearch - WebFetch instruction_template: | - Address the AI Reviewer's feedback. - Focus on: - - Correcting incorrect assumptions - - Fixing plausible-but-wrong implementations - - Aligning with existing codebase patterns + **This is AI Review iteration {step_iteration}.** + + If this is iteration 2 or later, it means your previous fixes were not actually applied. + **Your belief that you "already fixed it" is wrong.** + + **First, acknowledge:** + - Files you thought were "fixed" are actually not fixed + - Your understanding of previous work is incorrect + - You need to start from zero + + **Required actions:** + 1. Open all flagged files with Read tool (drop assumptions, verify facts) + 2. Search for problem code with grep to confirm it exists + 3. Fix confirmed problems with Edit tool + 4. Run tests to verify (`./gradlew :backend:test` etc.) + 5. Report specifically "what you checked and what you fixed" + + **Report format:** + - ❌ "Already fixed" + - ✅ "Checked file X at L123, found problem Y, fixed to Z" + + **Absolutely prohibited:** + - Reporting "fixed" without opening files + - Judging based on assumptions + - Leaving problems that AI Reviewer REJECTED - Removing scope creep pass_previous_response: true rules: diff --git a/resources/global/ja/agents/default/coder.md b/resources/global/ja/agents/default/coder.md index 7285da6..afd29c2 100644 --- a/resources/global/ja/agents/default/coder.md +++ b/resources/global/ja/agents/default/coder.md @@ -12,10 +12,17 @@ - エラーは握りつぶさず、早期に失敗させる(Fail Fast) - 推測で実装せず、不明点は報告する +**レビュワーの指摘は絶対。あなたの認識が間違っている。** +- レビュワーが「未修正」と指摘したら、まずファイルを開いて事実確認 +- 「修正済みのはず」という思い込みを捨てる +- 指摘された問題を全て Edit tool で修正する +- 反論せず、まず従う + **AIの悪い癖を自覚する:** - 不確実なときにフォールバックで隠す → 禁止(レビューで指摘される) - 「念のため」で未使用コードを書く → 禁止(レビューで指摘される) - 設計判断を勝手にする → 報告して判断を仰ぐ +- レビュワーの指摘を軽視する → 禁止(あなたの認識が間違っている) ## 最重要ルール diff --git a/resources/global/ja/workflows/default.yaml b/resources/global/ja/workflows/default.yaml index 7658384..11023ed 100644 --- a/resources/global/ja/workflows/default.yaml +++ b/resources/global/ja/workflows/default.yaml @@ -205,12 +205,31 @@ steps: - condition: 判断できない、情報不足 next: plan instruction_template: | - AI Reviewerのフィードバックに対応してください。 - 以下に集中してください: - - 間違った仮定の修正 - - もっともらしいが間違っている実装の修正 - - 既存コードベースのパターンとの整合 - - スコープクリープの除去 + **これは {step_iteration} 回目の AI Review です。** + + 2回目以降は、前回の修正が実際には行われていなかったということです。 + **あなたの「修正済み」という認識が間違っています。** + + **まず認めること:** + - 「修正済み」と思っていたファイルは実際には修正されていない + - 前回の作業内容の認識が間違っている + - ゼロベースで考え直す必要がある + + **必須アクション:** + 1. 指摘された全ファイルを Read tool で開く(思い込みを捨てて事実確認) + 2. 問題箇所を grep で検索して実在を確認する + 3. 確認した問題を Edit tool で修正する + 4. テストを実行して検証する(`./gradlew :backend:test` 等) + 5. 「何を確認して、何を修正したか」を具体的に報告する + + **報告フォーマット:** + - ❌ 「既に修正されています」 + - ✅ 「ファイルXのL123を確認した結果、問題Yが存在したため、Zに修正しました」 + + **絶対に禁止:** + - ファイルを開かずに「修正済み」と報告 + - 思い込みで判断 + - AI Reviewer が REJECT した問題の放置 pass_previous_response: true - name: reviewers diff --git a/resources/global/ja/workflows/expert-cqrs.yaml b/resources/global/ja/workflows/expert-cqrs.yaml index 72e2f74..5bc9e28 100644 --- a/resources/global/ja/workflows/expert-cqrs.yaml +++ b/resources/global/ja/workflows/expert-cqrs.yaml @@ -213,12 +213,31 @@ steps: - WebSearch - WebFetch instruction_template: | - AI Reviewerのフィードバックに対応してください。 - 以下に集中してください: - - 間違った仮定の修正 - - もっともらしいが間違っている実装の修正 - - 既存コードベースのパターンとの整合 - - スコープクリープの除去 + **これは {step_iteration} 回目の AI Review です。** + + 2回目以降は、前回の修正が実際には行われていなかったということです。 + **あなたの「修正済み」という認識が間違っています。** + + **まず認めること:** + - 「修正済み」と思っていたファイルは実際には修正されていない + - 前回の作業内容の認識が間違っている + - ゼロベースで考え直す必要がある + + **必須アクション:** + 1. 指摘された全ファイルを Read tool で開く(思い込みを捨てて事実確認) + 2. 問題箇所を grep で検索して実在を確認する + 3. 確認した問題を Edit tool で修正する + 4. テストを実行して検証する(`./gradlew :backend:test` 等) + 5. 「何を確認して、何を修正したか」を具体的に報告する + + **報告フォーマット:** + - ❌ 「既に修正されています」 + - ✅ 「ファイルXのL123を確認した結果、問題Yが存在したため、Zに修正しました」 + + **絶対に禁止:** + - ファイルを開かずに「修正済み」と報告 + - 思い込みで判断 + - AI Reviewer が REJECT した問題の放置 pass_previous_response: true rules: - condition: AI Reviewerの指摘に対する修正が完了した diff --git a/resources/global/ja/workflows/expert.yaml b/resources/global/ja/workflows/expert.yaml index f2c69a4..4118b74 100644 --- a/resources/global/ja/workflows/expert.yaml +++ b/resources/global/ja/workflows/expert.yaml @@ -204,12 +204,31 @@ steps: - WebSearch - WebFetch instruction_template: | - AI Reviewerのフィードバックに対応してください。 - 以下に集中してください: - - 間違った仮定の修正 - - もっともらしいが間違っている実装の修正 - - 既存コードベースのパターンとの整合 - - スコープクリープの除去 + **これは {step_iteration} 回目の AI Review です。** + + 2回目以降は、前回の修正が実際には行われていなかったということです。 + **あなたの「修正済み」という認識が間違っています。** + + **まず認めること:** + - 「修正済み」と思っていたファイルは実際には修正されていない + - 前回の作業内容の認識が間違っている + - ゼロベースで考え直す必要がある + + **必須アクション:** + 1. 指摘された全ファイルを Read tool で開く(思い込みを捨てて事実確認) + 2. 問題箇所を grep で検索して実在を確認する + 3. 確認した問題を Edit tool で修正する + 4. テストを実行して検証する(`./gradlew :backend:test` 等) + 5. 「何を確認して、何を修正したか」を具体的に報告する + + **報告フォーマット:** + - ❌ 「既に修正されています」 + - ✅ 「ファイルXのL123を確認した結果、問題Yが存在したため、Zに修正しました」 + + **絶対に禁止:** + - ファイルを開かずに「修正済み」と報告 + - 思い込みで判断 + - AI Reviewer が REJECT した問題の放置 pass_previous_response: true rules: - condition: AI Reviewerの指摘に対する修正が完了した