diff --git a/builtins/en/knowledge/architecture.md b/builtins/en/knowledge/architecture.md index 04eccfb..c410c6d 100644 --- a/builtins/en/knowledge/architecture.md +++ b/builtins/en/knowledge/architecture.md @@ -18,6 +18,26 @@ - No circular dependencies - Appropriate directory hierarchy +**Operation Discoverability:** + +When calls to the same generic function are scattered across the codebase with different purposes, it becomes impossible to understand what the system does without grepping every call site. Group related operations into purpose-named functions within a single module. Reading that module should reveal the complete list of operations the system performs. + +| Judgment | Criteria | +|----------|----------| +| REJECT | Same generic function called directly from 3+ places with different purposes | +| REJECT | Understanding all system operations requires grepping every call site | +| OK | Purpose-named functions defined and collected in a single module | + +**Public API Surface:** + +Public APIs should expose only domain-level functions and types. Do not export infrastructure internals (provider-specific functions, internal parsers, etc.). + +| Judgment | Criteria | +|----------|----------| +| REJECT | Infrastructure-layer functions exported from public API | +| REJECT | Internal implementation functions callable from outside | +| OK | External consumers interact only through domain-level abstractions | + **Function Design:** - One responsibility per function @@ -299,19 +319,18 @@ Correct handling: ## DRY Violation Detection -Detect duplicate code. +Eliminate duplication by default. When logic is essentially the same and should be unified, apply DRY. Do not judge mechanically by count. | Pattern | Judgment | |---------|----------| -| Same logic in 3+ places | Immediate REJECT - Extract to function/method | -| Same validation in 2+ places | Immediate REJECT - Extract to validator function | -| Similar components 3+ | Immediate REJECT - Create shared component | -| Copy-paste derived code | Immediate REJECT - Parameterize or abstract | +| Essentially identical logic duplicated | REJECT - Extract to function/method | +| Same validation duplicated | REJECT - Extract to validator function | +| Essentially identical component structure | REJECT - Create shared component | +| Copy-paste derived code | REJECT - Parameterize or abstract | -AHA principle (Avoid Hasty Abstractions) balance: -- 2 duplications → Wait and see -- 3 duplications → Extract immediately -- Different domain duplications → Don't abstract (e.g., customer validation vs admin validation are different) +When NOT to apply DRY: +- Different domains: Don't abstract (e.g., customer validation vs admin validation are different things) +- Superficially similar but different reasons to change: Treat as separate code ## Spec Compliance Verification diff --git a/builtins/en/piece-categories.yaml b/builtins/en/piece-categories.yaml index 27db8db..1cd1933 100644 --- a/builtins/en/piece-categories.yaml +++ b/builtins/en/piece-categories.yaml @@ -9,7 +9,10 @@ piece_categories: 🎨 Frontend: pieces: - frontend - ⚙️ Backend: {} + ⚙️ Backend: + pieces: + - backend + - backend-cqrs 🔧 Expert: Full Stack: pieces: diff --git a/builtins/en/pieces/backend-cqrs.yaml b/builtins/en/pieces/backend-cqrs.yaml new file mode 100644 index 0000000..aa4a112 --- /dev/null +++ b/builtins/en/pieces/backend-cqrs.yaml @@ -0,0 +1,267 @@ +name: backend-cqrs +description: CQRS+ES, Security, QA Expert Review +max_movements: 30 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: plan + rules: + - condition: Task analysis and planning is complete + next: implement + - condition: Requirements are unclear and planning cannot proceed + next: ABORT + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: implement + rules: + - condition: Implementation is complete + next: ai_review + - condition: No implementation (report only) + next: ai_review + - condition: Cannot proceed with implementation + next: ai_review + - condition: User input required + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - Scope: 01-coder-scope.md + - Decisions: 02-coder-decisions.md + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: ai-review + rules: + - condition: No AI-specific issues found + next: reviewers + - condition: AI-specific issues detected + next: ai_fix + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: ai-fix + rules: + - condition: AI Reviewer's issues have been fixed + next: ai_review + - condition: No fix needed (verified target files/spec) + next: ai_no_fix + - condition: Unable to proceed with fixes + next: ai_no_fix + - name: ai_no_fix + edit: false + persona: architecture-reviewer + policy: review + allowed_tools: + - Read + - Glob + - Grep + rules: + - condition: ai_review's findings are valid (fix required) + next: ai_fix + - condition: ai_fix's judgment is valid (no fix needed) + next: reviewers + instruction: arbitrate + - name: reviewers + parallel: + - name: cqrs-es-review + edit: false + persona: cqrs-es-reviewer + policy: review + knowledge: + - cqrs-es + - backend + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-cqrs-es + output_contracts: + report: + - name: 04-cqrs-es-review.md + format: cqrs-es-review + - name: security-review + edit: false + persona: security-reviewer + policy: review + knowledge: security + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-security + output_contracts: + report: + - name: 05-security-review.md + format: security-review + - name: qa-review + edit: false + persona: qa-reviewer + policy: + - review + - qa + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-qa + output_contracts: + report: + - name: 06-qa-review.md + format: qa-review + rules: + - condition: all("approved") + next: supervise + - condition: any("needs_fix") + next: fix + - name: fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + permission_mode: edit + rules: + - condition: Fix complete + next: reviewers + - condition: Cannot proceed, insufficient info + next: plan + instruction: fix + - name: supervise + edit: false + persona: expert-supervisor + policy: review + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: All validations pass and ready to merge + next: COMPLETE + - condition: Issues detected during final review + next: fix_supervisor + output_contracts: + report: + - Validation: 07-supervisor-validation.md + - Summary: summary.md + - name: fix_supervisor + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: fix-supervisor + rules: + - condition: Supervisor's issues have been fixed + next: supervise + - condition: Unable to proceed with fixes + next: plan diff --git a/builtins/en/pieces/backend.yaml b/builtins/en/pieces/backend.yaml new file mode 100644 index 0000000..d3d7522 --- /dev/null +++ b/builtins/en/pieces/backend.yaml @@ -0,0 +1,263 @@ +name: backend +description: Backend, Security, QA Expert Review +max_movements: 30 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: plan + rules: + - condition: Task analysis and planning is complete + next: implement + - condition: Requirements are unclear and planning cannot proceed + next: ABORT + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: implement + rules: + - condition: Implementation is complete + next: ai_review + - condition: No implementation (report only) + next: ai_review + - condition: Cannot proceed with implementation + next: ai_review + - condition: User input required + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - Scope: 01-coder-scope.md + - Decisions: 02-coder-decisions.md + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: ai-review + rules: + - condition: No AI-specific issues found + next: reviewers + - condition: AI-specific issues detected + next: ai_fix + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: ai-fix + rules: + - condition: AI Reviewer's issues have been fixed + next: ai_review + - condition: No fix needed (verified target files/spec) + next: ai_no_fix + - condition: Unable to proceed with fixes + next: ai_no_fix + - name: ai_no_fix + edit: false + persona: architecture-reviewer + policy: review + allowed_tools: + - Read + - Glob + - Grep + rules: + - condition: ai_review's findings are valid (fix required) + next: ai_fix + - condition: ai_fix's judgment is valid (no fix needed) + next: reviewers + instruction: arbitrate + - name: reviewers + parallel: + - name: arch-review + edit: false + persona: architecture-reviewer + policy: review + knowledge: + - architecture + - backend + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-arch + output_contracts: + report: + - name: 04-architect-review.md + format: architecture-review + - name: security-review + edit: false + persona: security-reviewer + policy: review + knowledge: security + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-security + output_contracts: + report: + - name: 05-security-review.md + format: security-review + - name: qa-review + edit: false + persona: qa-reviewer + policy: + - review + - qa + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-qa + output_contracts: + report: + - name: 06-qa-review.md + format: qa-review + rules: + - condition: all("approved") + next: supervise + - condition: any("needs_fix") + next: fix + - name: fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + permission_mode: edit + rules: + - condition: Fix complete + next: reviewers + - condition: Cannot proceed, insufficient info + next: plan + instruction: fix + - name: supervise + edit: false + persona: expert-supervisor + policy: review + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: All validations pass and ready to merge + next: COMPLETE + - condition: Issues detected during final review + next: fix_supervisor + output_contracts: + report: + - Validation: 07-supervisor-validation.md + - Summary: summary.md + - name: fix_supervisor + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: fix-supervisor + rules: + - condition: Supervisor's issues have been fixed + next: supervise + - condition: Unable to proceed with fixes + next: plan diff --git a/builtins/ja/knowledge/architecture.md b/builtins/ja/knowledge/architecture.md index 7527100..a00ffb0 100644 --- a/builtins/ja/knowledge/architecture.md +++ b/builtins/ja/knowledge/architecture.md @@ -18,6 +18,26 @@ - 循環依存がないか - 適切なディレクトリ階層か +**操作の一覧性** + +同じ汎用関数への呼び出しがコードベースに散在すると、システムが何をしているか把握できなくなる。操作には目的に応じた名前を付けて関数化し、関連する操作を1つのモジュールにまとめる。そのモジュールを読めば「このシステムが行う操作の全体像」がわかる状態にする。 + +| 判定 | 基準 | +|------|------| +| REJECT | 同じ汎用関数が目的の異なる3箇所以上から直接呼ばれている | +| REJECT | 呼び出し元を全件 grep しないとシステムの操作一覧がわからない | +| OK | 目的ごとに名前付き関数が定義され、1モジュールに集約されている | + +**パブリック API の公開範囲** + +パブリック API が公開するのは、ドメインの操作に対応する関数・型のみ。インフラの実装詳細(特定プロバイダーの関数、内部パーサー等)を公開しない。 + +| 判定 | 基準 | +|------|------| +| REJECT | インフラ層の関数がパブリック API からエクスポートされている | +| REJECT | 内部実装の関数が外部から直接呼び出し可能になっている | +| OK | 外部消費者がドメインレベルの抽象のみを通じて対話する | + **関数設計** - 1関数1責務になっているか @@ -299,19 +319,18 @@ TODOが許容される唯一のケース: ## DRY違反の検出 -重複コードを検出する。 +基本的に重複は排除する。本質的に同じロジックであり、まとめるべきと判断したら DRY にする。回数で機械的に判断しない。 | パターン | 判定 | |---------|------| -| 同じロジックが3箇所以上 | 即REJECT - 関数/メソッドに抽出 | -| 同じバリデーションが2箇所以上 | 即REJECT - バリデーター関数に抽出 | -| 似たようなコンポーネントが3個以上 | 即REJECT - 共通コンポーネント化 | -| コピペで派生したコード | 即REJECT - パラメータ化または抽象化 | +| 本質的に同じロジックの重複 | REJECT - 関数/メソッドに抽出 | +| 同じバリデーションの重複 | REJECT - バリデーター関数に抽出 | +| 本質的に同じ構造のコンポーネント | REJECT - 共通コンポーネント化 | +| コピペで派生したコード | REJECT - パラメータ化または抽象化 | -AHA原則(Avoid Hasty Abstractions)とのバランス: -- 2回の重複 → 様子見 -- 3回の重複 → 即抽出 -- ドメインが異なる重複 → 抽象化しない(例: 顧客用バリデーションと管理者用バリデーションは別物) +DRY にしないケース: +- ドメインが異なる重複は抽象化しない(例: 顧客用バリデーションと管理者用バリデーションは別物) +- 表面的に似ているが、変更理由が異なるコードは別物として扱う ## 仕様準拠の検証 diff --git a/builtins/ja/piece-categories.yaml b/builtins/ja/piece-categories.yaml index 5858f9b..6daf434 100644 --- a/builtins/ja/piece-categories.yaml +++ b/builtins/ja/piece-categories.yaml @@ -9,7 +9,10 @@ piece_categories: 🎨 フロントエンド: pieces: - frontend - ⚙️ バックエンド: {} + ⚙️ バックエンド: + pieces: + - backend + - backend-cqrs 🔧 エキスパート: フルスタック: pieces: diff --git a/builtins/ja/pieces/backend-cqrs.yaml b/builtins/ja/pieces/backend-cqrs.yaml new file mode 100644 index 0000000..efd269b --- /dev/null +++ b/builtins/ja/pieces/backend-cqrs.yaml @@ -0,0 +1,267 @@ +name: backend-cqrs +description: CQRS+ES・セキュリティ・QA専門家レビュー +max_movements: 30 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: plan + rules: + - condition: タスク分析と計画が完了した + next: implement + - condition: 要件が不明確で計画を立てられない + next: ABORT + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: implement + rules: + - condition: 実装が完了した + next: ai_review + - condition: 実装未着手(レポートのみ) + next: ai_review + - condition: 実装を進行できない + next: ai_review + - condition: ユーザー入力が必要 + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - Scope: 01-coder-scope.md + - Decisions: 02-coder-decisions.md + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: ai-review + rules: + - condition: AI特有の問題が見つからない + next: reviewers + - condition: AI特有の問題が検出された + next: ai_fix + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: ai-fix + rules: + - condition: AI Reviewerの指摘に対する修正が完了した + next: ai_review + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + next: ai_no_fix + - condition: 修正を進行できない + next: ai_no_fix + - name: ai_no_fix + edit: false + persona: architecture-reviewer + policy: review + allowed_tools: + - Read + - Glob + - Grep + rules: + - condition: ai_reviewの指摘が妥当(修正すべき) + next: ai_fix + - condition: ai_fixの判断が妥当(修正不要) + next: reviewers + instruction: arbitrate + - name: reviewers + parallel: + - name: cqrs-es-review + edit: false + persona: cqrs-es-reviewer + policy: review + knowledge: + - cqrs-es + - backend + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-cqrs-es + output_contracts: + report: + - name: 04-cqrs-es-review.md + format: cqrs-es-review + - name: security-review + edit: false + persona: security-reviewer + policy: review + knowledge: security + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-security + output_contracts: + report: + - name: 05-security-review.md + format: security-review + - name: qa-review + edit: false + persona: qa-reviewer + policy: + - review + - qa + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-qa + output_contracts: + report: + - name: 06-qa-review.md + format: qa-review + rules: + - condition: all("approved") + next: supervise + - condition: any("needs_fix") + next: fix + - name: fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + permission_mode: edit + rules: + - condition: 修正が完了した + next: reviewers + - condition: 修正を進行できない + next: plan + instruction: fix + - name: supervise + edit: false + persona: expert-supervisor + policy: review + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: すべての検証が完了し、マージ可能な状態である + next: COMPLETE + - condition: 問題が検出された + next: fix_supervisor + output_contracts: + report: + - Validation: 07-supervisor-validation.md + - Summary: summary.md + - name: fix_supervisor + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: fix-supervisor + rules: + - condition: 監督者の指摘に対する修正が完了した + next: supervise + - condition: 修正を進行できない + next: plan diff --git a/builtins/ja/pieces/backend.yaml b/builtins/ja/pieces/backend.yaml new file mode 100644 index 0000000..1ac6ea6 --- /dev/null +++ b/builtins/ja/pieces/backend.yaml @@ -0,0 +1,263 @@ +name: backend +description: バックエンド・セキュリティ・QA専門家レビュー +max_movements: 30 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: plan + rules: + - condition: タスク分析と計画が完了した + next: implement + - condition: 要件が不明確で計画を立てられない + next: ABORT + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: implement + rules: + - condition: 実装が完了した + next: ai_review + - condition: 実装未着手(レポートのみ) + next: ai_review + - condition: 実装を進行できない + next: ai_review + - condition: ユーザー入力が必要 + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - Scope: 01-coder-scope.md + - Decisions: 02-coder-decisions.md + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: ai-review + rules: + - condition: AI特有の問題が見つからない + next: reviewers + - condition: AI特有の問題が検出された + next: ai_fix + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + session: refresh + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: ai-fix + rules: + - condition: AI Reviewerの指摘に対する修正が完了した + next: ai_review + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + next: ai_no_fix + - condition: 修正を進行できない + next: ai_no_fix + - name: ai_no_fix + edit: false + persona: architecture-reviewer + policy: review + allowed_tools: + - Read + - Glob + - Grep + rules: + - condition: ai_reviewの指摘が妥当(修正すべき) + next: ai_fix + - condition: ai_fixの判断が妥当(修正不要) + next: reviewers + instruction: arbitrate + - name: reviewers + parallel: + - name: arch-review + edit: false + persona: architecture-reviewer + policy: review + knowledge: + - architecture + - backend + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-arch + output_contracts: + report: + - name: 04-architect-review.md + format: architecture-review + - name: security-review + edit: false + persona: security-reviewer + policy: review + knowledge: security + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-security + output_contracts: + report: + - name: 05-security-review.md + format: security-review + - name: qa-review + edit: false + persona: qa-reviewer + policy: + - review + - qa + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + rules: + - condition: approved + - condition: needs_fix + instruction: review-qa + output_contracts: + report: + - name: 06-qa-review.md + format: qa-review + rules: + - condition: all("approved") + next: supervise + - condition: any("needs_fix") + next: fix + - name: fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + permission_mode: edit + rules: + - condition: 修正が完了した + next: reviewers + - condition: 修正を進行できない + next: plan + instruction: fix + - name: supervise + edit: false + persona: expert-supervisor + policy: review + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: すべての検証が完了し、マージ可能な状態である + next: COMPLETE + - condition: 問題が検出された + next: fix_supervisor + output_contracts: + report: + - Validation: 07-supervisor-validation.md + - Summary: summary.md + - name: fix_supervisor + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + instruction: fix-supervisor + rules: + - condition: 監督者の指摘に対する修正が完了した + next: supervise + - condition: 修正を進行できない + next: plan