From 8e5bc3c912a12342b6a8fb9cb7031f81ea70f51f Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sun, 15 Feb 2026 05:41:29 +0900 Subject: [PATCH] feat(piece): add ai-fix loop monitor and extract judge instruction --- builtins/en/instructions/loop-monitor-ai-fix.md | 12 ++++++++++++ builtins/en/pieces/expert-cqrs.yaml | 13 +++++++++++++ builtins/en/pieces/expert.yaml | 13 +++++++++++++ builtins/ja/instructions/loop-monitor-ai-fix.md | 12 ++++++++++++ builtins/ja/pieces/expert-cqrs.yaml | 13 +++++++++++++ builtins/ja/pieces/expert.yaml | 13 +++++++++++++ 6 files changed, 76 insertions(+) create mode 100644 builtins/en/instructions/loop-monitor-ai-fix.md create mode 100644 builtins/ja/instructions/loop-monitor-ai-fix.md diff --git a/builtins/en/instructions/loop-monitor-ai-fix.md b/builtins/en/instructions/loop-monitor-ai-fix.md new file mode 100644 index 0000000..c6b4466 --- /dev/null +++ b/builtins/en/instructions/loop-monitor-ai-fix.md @@ -0,0 +1,12 @@ +The ai_review ↔ ai_fix loop has repeated {cycle_count} times. + +Review the reports from each cycle and determine whether this loop +is healthy (making progress) or unproductive (repeating the same issues). + +**Reports to reference:** +- AI Review results: {report:03-ai-review.md} + +**Judgment criteria:** +- Are new issues being found/fixed in each cycle? +- Are the same findings being repeated? +- Are fixes actually being applied? diff --git a/builtins/en/pieces/expert-cqrs.yaml b/builtins/en/pieces/expert-cqrs.yaml index bced204..f5e1182 100644 --- a/builtins/en/pieces/expert-cqrs.yaml +++ b/builtins/en/pieces/expert-cqrs.yaml @@ -9,6 +9,19 @@ piece_config: max_movements: 30 initial_movement: plan +loop_monitors: + - cycle: + - ai_review + - ai_fix + threshold: 3 + judge: + persona: supervisor + instruction_template: loop-monitor-ai-fix + rules: + - condition: Healthy (making progress) + next: ai_review + - condition: Unproductive (same findings repeated or fixes not reflected) + next: ai_no_fix movements: - name: plan edit: false diff --git a/builtins/en/pieces/expert.yaml b/builtins/en/pieces/expert.yaml index 0ea5818..d04524a 100644 --- a/builtins/en/pieces/expert.yaml +++ b/builtins/en/pieces/expert.yaml @@ -9,6 +9,19 @@ piece_config: max_movements: 30 initial_movement: plan +loop_monitors: + - cycle: + - ai_review + - ai_fix + threshold: 3 + judge: + persona: supervisor + instruction_template: loop-monitor-ai-fix + rules: + - condition: Healthy (making progress) + next: ai_review + - condition: Unproductive (same findings repeated or fixes not reflected) + next: ai_no_fix movements: - name: plan edit: false diff --git a/builtins/ja/instructions/loop-monitor-ai-fix.md b/builtins/ja/instructions/loop-monitor-ai-fix.md new file mode 100644 index 0000000..672b8b0 --- /dev/null +++ b/builtins/ja/instructions/loop-monitor-ai-fix.md @@ -0,0 +1,12 @@ +ai_review と ai_fix のループが {cycle_count} 回繰り返されました。 + +各サイクルのレポートを確認し、このループが健全(進捗がある)か、 +非生産的(同じ問題を繰り返している)かを判断してください。 + +**参照するレポート:** +- AIレビュー結果: {report:03-ai-review.md} + +**判断基準:** +- 各サイクルで新しい問題が発見・修正されているか +- 同じ指摘が繰り返されていないか +- 修正が実際に反映されているか diff --git a/builtins/ja/pieces/expert-cqrs.yaml b/builtins/ja/pieces/expert-cqrs.yaml index f24448a..6851cf0 100644 --- a/builtins/ja/pieces/expert-cqrs.yaml +++ b/builtins/ja/pieces/expert-cqrs.yaml @@ -9,6 +9,19 @@ piece_config: max_movements: 30 initial_movement: plan +loop_monitors: + - cycle: + - ai_review + - ai_fix + threshold: 3 + judge: + persona: supervisor + instruction_template: loop-monitor-ai-fix + rules: + - condition: 健全(進捗あり) + next: ai_review + - condition: 非生産的(同じ指摘の反復・修正未反映) + next: ai_no_fix movements: - name: plan edit: false diff --git a/builtins/ja/pieces/expert.yaml b/builtins/ja/pieces/expert.yaml index 8f5e5bf..162b288 100644 --- a/builtins/ja/pieces/expert.yaml +++ b/builtins/ja/pieces/expert.yaml @@ -9,6 +9,19 @@ piece_config: max_movements: 30 initial_movement: plan +loop_monitors: + - cycle: + - ai_review + - ai_fix + threshold: 3 + judge: + persona: supervisor + instruction_template: loop-monitor-ai-fix + rules: + - condition: 健全(進捗あり) + next: ai_review + - condition: 非生産的(同じ指摘の反復・修正未反映) + next: ai_no_fix movements: - name: plan edit: false