From bed566209711b2c6580d538e04b6d2dc65d22789 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:55:12 +0900 Subject: [PATCH] =?UTF-8?q?expert-review.yaml=20=E3=81=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 8 ++++++++ .../global/en/workflows/expert-review.yaml | 20 +++++++++---------- .../global/ja/workflows/expert-review.yaml | 20 +++++++++---------- src/models/schemas.ts | 13 +++++++++++- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e61e860..950404b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,3 +141,11 @@ steps: ## Design Principles **Keep commands minimal.** One command per concept. Use arguments/modes instead of multiple similar commands. Before adding a new command, consider if existing commands can be extended. + +**Do NOT expand schemas carelessly.** The `TransitionConditionSchema` defines allowed condition values for workflow transitions. Do NOT add new values without strong justification. Use existing values creatively: +- `done` - Task completed (minor fixes, successful completion) +- `blocked` - Cannot proceed (needs plan rework) +- `approved` - Review passed +- `rejected` - Review failed, needs major rework +- `improve` - Needs improvement (security concerns, quality issues) +- `always` - Unconditional transition diff --git a/resources/global/en/workflows/expert-review.yaml b/resources/global/en/workflows/expert-review.yaml index c729f9a..5dd7cf5 100644 --- a/resources/global/en/workflows/expert-review.yaml +++ b/resources/global/en/workflows/expert-review.yaml @@ -557,17 +557,17 @@ steps: ## Completion: Determine Change Impact When fix is complete, judge the **impact scope of changes** and output the appropriate tag: - - `[CODER:MINOR]` - Minor fix (re-run security review only) + - `[CODER:DONE]` - Minor fix (re-run security review only) - Examples: Add validation, add escaping, configuration changes - - `[CODER:MAJOR]` - Major fix (restart from CQRS+ES review) + - `[CODER:REJECT]` - Major fix (restart from CQRS+ES review) - Examples: Data flow changes, API design changes, auth method changes, domain model changes Include [CODER:BLOCKED] if unable to proceed. pass_previous_response: true transitions: - - condition: minor + - condition: done next_step: security_review - - condition: major + - condition: rejected next_step: cqrs_es_review - condition: blocked next_step: plan @@ -669,21 +669,21 @@ steps: ## Completion: Determine Change Impact When fix is complete, judge the **impact scope of changes** and output the appropriate tag: - - `[CODER:MINOR]` - Minor fix (re-run QA review only) + - `[CODER:DONE]` - Minor fix (re-run QA review only) - Examples: Add tests, add documentation, add logs, add comments - - `[CODER:SECURITY]` - Security-impacting fix (restart from security review) + - `[CODER:IMPROVE]` - Security-impacting fix (restart from security review) - Examples: Error handling changes (error message content changes), input validation changes - - `[CODER:MAJOR]` - Major fix (restart from CQRS+ES review) + - `[CODER:REJECT]` - Major fix (restart from CQRS+ES review) - Examples: Business logic changes, data model changes, API changes Include [CODER:BLOCKED] if unable to proceed. pass_previous_response: true transitions: - - condition: minor + - condition: done next_step: qa_review - - condition: security + - condition: improve next_step: security_review - - condition: major + - condition: rejected next_step: cqrs_es_review - condition: blocked next_step: plan diff --git a/resources/global/ja/workflows/expert-review.yaml b/resources/global/ja/workflows/expert-review.yaml index ead3eab..61c4048 100644 --- a/resources/global/ja/workflows/expert-review.yaml +++ b/resources/global/ja/workflows/expert-review.yaml @@ -557,17 +557,17 @@ steps: ## 修正完了時の判断 修正が完了したら、**変更の影響範囲**を判断して適切なタグを出力してください: - - `[CODER:MINOR]` - 軽微な修正(セキュリティレビューのみ再実施) + - `[CODER:DONE]` - 軽微な修正(セキュリティレビューのみ再実施) - 例: バリデーション追加、エスケープ処理追加、設定変更 - - `[CODER:MAJOR]` - 大きな修正(CQRS+ESレビューからやり直し) + - `[CODER:REJECT]` - 大きな修正(CQRS+ESレビューからやり直し) - 例: データフロー変更、API設計変更、認証方式変更、ドメインモデル変更 進行できない場合は [CODER:BLOCKED] を含めてください。 pass_previous_response: true transitions: - - condition: minor + - condition: done next_step: security_review - - condition: major + - condition: rejected next_step: cqrs_es_review - condition: blocked next_step: plan @@ -669,21 +669,21 @@ steps: ## 修正完了時の判断 修正が完了したら、**変更の影響範囲**を判断して適切なタグを出力してください: - - `[CODER:MINOR]` - 軽微な修正(QAレビューのみ再実施) + - `[CODER:DONE]` - 軽微な修正(QAレビューのみ再実施) - 例: テスト追加、ドキュメント追加、ログ追加、コメント追加 - - `[CODER:SECURITY]` - セキュリティに影響する修正(セキュリティレビューからやり直し) + - `[CODER:IMPROVE]` - セキュリティに影響する修正(セキュリティレビューからやり直し) - 例: エラーハンドリング変更(エラーメッセージの内容変更)、入力検証の変更 - - `[CODER:MAJOR]` - 大きな修正(CQRS+ESレビューからやり直し) + - `[CODER:REJECT]` - 大きな修正(CQRS+ESレビューからやり直し) - 例: ビジネスロジック変更、データモデル変更、API変更 進行できない場合は [CODER:BLOCKED] を含めてください。 pass_previous_response: true transitions: - - condition: minor + - condition: done next_step: qa_review - - condition: security + - condition: improve next_step: security_review - - condition: major + - condition: rejected next_step: cqrs_es_review - condition: blocked next_step: plan diff --git a/src/models/schemas.ts b/src/models/schemas.ts index 377c3c6..c024f8d 100644 --- a/src/models/schemas.ts +++ b/src/models/schemas.ts @@ -23,7 +23,18 @@ export const StatusSchema = z.enum([ 'interrupted', ]); -/** Transition condition schema */ +/** + * Transition condition schema + * + * WARNING: Do NOT add new values carelessly. + * Use existing values creatively in workflow design: + * - done: Task completed (minor fixes, successful completion) + * - blocked: Cannot proceed (needs plan rework) + * - approved: Review passed + * - rejected: Review failed, needs major rework + * - improve: Needs improvement (security concerns, quality issues) + * - always: Unconditional transition + */ export const TransitionConditionSchema = z.enum([ 'done', 'blocked',