takt: # タスク指示書: Output Contracts と Quality Gates の実装
## 概要
仕様ドキュメント `/Users/m_naruse/work/git/takt/task_planning/output-contracts-and-quality-gates.md` に基づき、YAML構造の変更を実装する。
---
## タスク一覧
### 【高】トップレベル構造の変更
- 現在の `output_contracts` を `report_formats` にリネーム
- レポートテンプレート定義として機能させる
### 【高】Movement内の output_contracts 構造変更
- 各 movement の `output_contracts` が直接レポート配列を持つ構造に変更
- `output_contracts.report` の `report` キーを廃止
**変更後の構造:**
```yaml
report_formats: # トップレベル(テンプレート定義)
plan: ...
movements:
- name: plan
output_contracts: # 直接配列(reportキー不要)
- name: 00-plan.md
format: plan
```
### 【中】quality_gates の実装
- エージェントへの通達として機能させる(自動検証は将来実装)
- Movement完了時にエージェントが参照できる形式で定義
---
## 制約(ユーザー明示)
- 後方互換性は不要
---
## 確認方法
- 既存のピース定義YAMLが新構造でパースできること
- テストが通ること
This commit is contained in:
parent
e506c4035f
commit
1466a7176d
@ -17,14 +17,15 @@ instructions:
|
|||||||
ai-review: ../instructions/ai-review.md
|
ai-review: ../instructions/ai-review.md
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -40,6 +41,9 @@ movements:
|
|||||||
- condition: Requirements are unclear, insufficient information
|
- condition: Requirements are unclear, insufficient information
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -49,9 +53,6 @@ movements:
|
|||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -74,6 +75,9 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -82,9 +86,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -95,14 +96,14 @@ movements:
|
|||||||
- condition: No AI-specific issues
|
- condition: No AI-specific issues
|
||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -113,6 +114,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "approved")
|
- condition: all("No AI-specific issues", "approved")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -147,7 +151,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
|
|||||||
@ -1,73 +1,29 @@
|
|||||||
# Coding TAKT Piece
|
|
||||||
# Plan -> Implement -> Parallel Review (AI + Architecture) -> Fix if needed
|
|
||||||
#
|
|
||||||
# Lightweight development piece with planning and parallel reviews.
|
|
||||||
# architect-planner investigates and organizes requirements, resolving unknowns by reading code.
|
|
||||||
# After parallel reviews, completes directly if no issues, enabling fast feedback loops.
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# plan (requirements investigation & planning)
|
|
||||||
# ↓
|
|
||||||
# implement (implementation)
|
|
||||||
# ↓
|
|
||||||
# reviewers (parallel review)
|
|
||||||
# ├─ ai_review (AI-specific issue detection)
|
|
||||||
# └─ arch-review (design compliance check)
|
|
||||||
# ↓
|
|
||||||
# [judgment]
|
|
||||||
# ├─ all(approved) → COMPLETE
|
|
||||||
# └─ any(needs_fix) → fix → reviewers (re-review)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected by buildInstruction):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: coding
|
name: coding
|
||||||
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
architect-planner: ../personas/architect-planner.md
|
architect-planner: ../personas/architect-planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
ai-review: ../instructions/ai-review.md
|
ai-review: ../instructions/ai-review.md
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -83,7 +39,9 @@ movements:
|
|||||||
- condition: Requirements are unclear, insufficient information
|
- condition: Requirements are unclear, insufficient information
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -92,9 +50,6 @@ movements:
|
|||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -117,7 +72,9 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -126,9 +83,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -139,15 +93,14 @@ movements:
|
|||||||
- condition: No AI-specific issues
|
- condition: No AI-specific issues
|
||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -158,13 +111,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "approved")
|
- condition: all("No AI-specific issues", "approved")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: any("AI-specific issues found", "needs_fix")
|
- condition: any("AI-specific issues found", "needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -188,3 +142,7 @@ movements:
|
|||||||
- condition: Cannot determine, insufficient information
|
- condition: Cannot determine, insufficient information
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
|||||||
@ -26,6 +26,14 @@ instructions:
|
|||||||
review-qa: ../instructions/review-qa.md
|
review-qa: ../instructions/review-qa.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
architecture-design: ../output-contracts/architecture-design.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
loop_monitors:
|
loop_monitors:
|
||||||
- cycle:
|
- cycle:
|
||||||
@ -56,9 +64,6 @@ movements:
|
|||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -78,12 +83,12 @@ movements:
|
|||||||
- {Question 1}
|
- {Question 1}
|
||||||
- {Question 2}
|
- {Question 2}
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: architect
|
- name: architect
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 01-architecture.md
|
|
||||||
format: architecture-design
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -98,6 +103,9 @@ movements:
|
|||||||
- condition: Insufficient info, cannot proceed
|
- condition: Insufficient info, cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: architect
|
instruction: architect
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architecture.md
|
||||||
|
format: architecture-design
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -109,9 +117,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- backend
|
- backend
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -134,15 +139,15 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -155,6 +160,9 @@ movements:
|
|||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -207,9 +215,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- architecture
|
- architecture
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -220,15 +225,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 06-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -239,6 +244,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -274,9 +282,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 07-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -290,17 +295,12 @@ movements:
|
|||||||
- condition: Requirements unmet, tests failing, build errors
|
- condition: Requirements unmet, tests failing, build errors
|
||||||
next: plan
|
next: plan
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 07-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
architecture-design: ../output-contracts/architecture-design.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,31 +1,15 @@
|
|||||||
# Default TAKT Piece
|
|
||||||
# Plan -> Architect -> Implement -> AI Review -> Reviewers (parallel: Architect + QA) -> Supervisor Approval
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected by buildInstruction):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: default
|
name: default
|
||||||
description: Standard development piece with planning and specialized reviews
|
description: Standard development piece with planning and specialized reviews
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
architect-planner: ../personas/architect-planner.md
|
architect-planner: ../personas/architect-planner.md
|
||||||
@ -34,7 +18,6 @@ personas:
|
|||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
architect: ../instructions/architect.md
|
architect: ../instructions/architect.md
|
||||||
@ -46,20 +29,11 @@ instructions:
|
|||||||
review-qa: ../instructions/review-qa.md
|
review-qa: ../instructions/review-qa.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
architecture-design: ../output-contracts/architecture-design.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
loop_monitors:
|
loop_monitors:
|
||||||
- cycle: [ai_review, ai_fix]
|
- cycle:
|
||||||
|
- ai_review
|
||||||
|
- ai_fix
|
||||||
threshold: 3
|
threshold: 3
|
||||||
judge:
|
judge:
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
@ -81,14 +55,10 @@ loop_monitors:
|
|||||||
next: ai_review
|
next: ai_review
|
||||||
- condition: Unproductive (no improvement)
|
- condition: Unproductive (no improvement)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -108,13 +78,12 @@ movements:
|
|||||||
- {Question 1}
|
- {Question 1}
|
||||||
- {Question 2}
|
- {Question 2}
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: architect
|
- name: architect
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 01-architecture.md
|
|
||||||
format: architecture-design
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -129,7 +98,9 @@ movements:
|
|||||||
- condition: Insufficient info, cannot proceed
|
- condition: Insufficient info, cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: architect
|
instruction: architect
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architecture.md
|
||||||
|
format: architecture-design
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -137,10 +108,9 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
report:
|
- backend
|
||||||
- Scope: 02-coder-scope.md
|
- architecture
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -163,16 +133,15 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -185,7 +154,9 @@ movements:
|
|||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -193,7 +164,9 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
|
- backend
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -212,7 +185,6 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -227,17 +199,15 @@ movements:
|
|||||||
- condition: ai_fix's judgment is valid (no fix needed)
|
- condition: ai_fix's judgment is valid (no fix needed)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [architecture, backend]
|
knowledge:
|
||||||
report:
|
- architecture
|
||||||
name: 05-architect-review.md
|
- backend
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -248,16 +218,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 06-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -268,19 +237,23 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
|
- backend
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -297,14 +270,10 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 07-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -318,3 +287,14 @@ movements:
|
|||||||
- condition: Requirements unmet, tests failing, build errors
|
- condition: Requirements unmet, tests failing, build errors
|
||||||
next: plan
|
next: plan
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 07-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
architecture-design: ../output-contracts/architecture-design.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -33,14 +33,20 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -54,6 +60,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: Requirements are unclear and planning cannot proceed
|
- condition: Requirements are unclear and planning cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -68,9 +77,6 @@ movements:
|
|||||||
- cqrs-es
|
- cqrs-es
|
||||||
- security
|
- security
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -92,15 +98,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -113,6 +119,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI-specific issues detected
|
- condition: AI-specific issues detected
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -167,9 +176,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- cqrs-es
|
- cqrs-es
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 04-cqrs-es-review.md
|
|
||||||
format: cqrs-es-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -180,14 +186,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-cqrs-es
|
instruction: review-cqrs-es
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-cqrs-es-review.md
|
||||||
|
format: cqrs-es-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -198,14 +204,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -216,15 +222,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -235,6 +241,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -273,9 +282,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -288,6 +294,9 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: Issues detected during final review
|
- condition: Issues detected during final review
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -322,12 +331,3 @@ policies:
|
|||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,42 +1,18 @@
|
|||||||
# Expert CQRS Review Piece
|
|
||||||
# Review piece with CQRS+ES, Frontend, Security, and QA experts
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# plan -> implement -> ai_review -> reviewers (parallel) -> supervise -> COMPLETE
|
|
||||||
# ↓ ├─ cqrs-es-review ↓
|
|
||||||
# ai_fix ├─ frontend-review fix_supervisor
|
|
||||||
# ├─ security-review
|
|
||||||
# └─ qa-review
|
|
||||||
# any("needs_fix") → fix → reviewers
|
|
||||||
#
|
|
||||||
# Template Variables:
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: expert-cqrs
|
name: expert-cqrs
|
||||||
description: CQRS+ES, Frontend, Security, QA Expert Review
|
description: CQRS+ES, Frontend, Security, QA Expert Review
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
frontend: ../knowledge/frontend.md
|
frontend: ../knowledge/frontend.md
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
cqrs-es: ../knowledge/cqrs-es.md
|
cqrs-es: ../knowledge/cqrs-es.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
@ -47,7 +23,6 @@ personas:
|
|||||||
security-reviewer: ../personas/security-reviewer.md
|
security-reviewer: ../personas/security-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
expert-supervisor: ../personas/expert-supervisor.md
|
expert-supervisor: ../personas/expert-supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
@ -61,29 +36,11 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
# ===========================================
|
|
||||||
# Movement 0: Planning
|
|
||||||
# ===========================================
|
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -97,10 +54,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: Requirements are unclear and planning cannot proceed
|
- condition: Requirements are unclear and planning cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- name: 00-plan.md
|
||||||
# Movement 1: Implementation
|
format: plan
|
||||||
# ===========================================
|
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -108,10 +64,12 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
report:
|
- frontend
|
||||||
- Scope: 01-coder-scope.md
|
- backend
|
||||||
- Decisions: 02-coder-decisions.md
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -133,19 +91,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- Scope: 01-coder-scope.md
|
||||||
# Movement 2: AI Review
|
- Decisions: 02-coder-decisions.md
|
||||||
# ===========================================
|
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -158,7 +112,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI-specific issues detected
|
- condition: AI-specific issues detected
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -166,7 +122,12 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -184,7 +145,6 @@ movements:
|
|||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
- condition: Unable to proceed with fixes
|
- condition: Unable to proceed with fixes
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -199,105 +159,100 @@ movements:
|
|||||||
- condition: ai_fix's judgment is valid (no fix needed)
|
- condition: ai_fix's judgment is valid (no fix needed)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 3: Expert Reviews (Parallel)
|
|
||||||
# ===========================================
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: cqrs-es-review
|
- name: cqrs-es-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: cqrs-es-reviewer
|
persona: cqrs-es-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [cqrs-es, backend]
|
knowledge:
|
||||||
report:
|
- cqrs-es
|
||||||
name: 04-cqrs-es-review.md
|
- backend
|
||||||
format: cqrs-es-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-cqrs-es
|
instruction: review-cqrs-es
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-cqrs-es-review.md
|
||||||
|
format: cqrs-es-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -314,17 +269,10 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 4: Supervision
|
|
||||||
# ===========================================
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -337,14 +285,21 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: Issues detected during final review
|
- condition: Issues detected during final review
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -360,3 +315,12 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: Unable to proceed with fixes
|
- condition: Unable to proceed with fixes
|
||||||
next: plan
|
next: plan
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -31,14 +31,20 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -52,6 +58,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: Requirements are unclear and planning cannot proceed
|
- condition: Requirements are unclear and planning cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -65,9 +74,6 @@ movements:
|
|||||||
- backend
|
- backend
|
||||||
- security
|
- security
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -89,15 +95,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -110,6 +116,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI-specific issues detected
|
- condition: AI-specific issues detected
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -163,9 +172,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- architecture
|
- architecture
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 04-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -176,14 +182,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -194,14 +200,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -212,15 +218,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -231,6 +237,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -268,9 +277,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -283,6 +289,9 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: Issues detected during final review
|
- condition: Issues detected during final review
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -316,12 +325,3 @@ policies:
|
|||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,41 +1,17 @@
|
|||||||
# Expert Review Piece
|
|
||||||
# Review piece with Architecture, Frontend, Security, and QA experts
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# plan -> implement -> ai_review -> reviewers (parallel) -> supervise -> COMPLETE
|
|
||||||
# ↓ ├─ arch-review ↓
|
|
||||||
# ai_fix ├─ frontend-review fix_supervisor
|
|
||||||
# ├─ security-review
|
|
||||||
# └─ qa-review
|
|
||||||
# any("needs_fix") → fix → reviewers
|
|
||||||
#
|
|
||||||
# Template Variables:
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: expert
|
name: expert
|
||||||
description: Architecture, Frontend, Security, QA Expert Review
|
description: Architecture, Frontend, Security, QA Expert Review
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
frontend: ../knowledge/frontend.md
|
frontend: ../knowledge/frontend.md
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
@ -45,7 +21,6 @@ personas:
|
|||||||
security-reviewer: ../personas/security-reviewer.md
|
security-reviewer: ../personas/security-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
expert-supervisor: ../personas/expert-supervisor.md
|
expert-supervisor: ../personas/expert-supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
@ -59,29 +34,11 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
# ===========================================
|
|
||||||
# Movement 0: Planning
|
|
||||||
# ===========================================
|
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -95,10 +52,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: Requirements are unclear and planning cannot proceed
|
- condition: Requirements are unclear and planning cannot proceed
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- name: 00-plan.md
|
||||||
# Movement 1: Implementation
|
format: plan
|
||||||
# ===========================================
|
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -106,10 +62,11 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
report:
|
- frontend
|
||||||
- Scope: 01-coder-scope.md
|
- backend
|
||||||
- Decisions: 02-coder-decisions.md
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -131,19 +88,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- Scope: 01-coder-scope.md
|
||||||
# Movement 2: AI Review
|
- Decisions: 02-coder-decisions.md
|
||||||
# ===========================================
|
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -156,7 +109,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI-specific issues detected
|
- condition: AI-specific issues detected
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -164,7 +119,11 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -182,7 +141,6 @@ movements:
|
|||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
- condition: Unable to proceed with fixes
|
- condition: Unable to proceed with fixes
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -197,105 +155,99 @@ movements:
|
|||||||
- condition: ai_fix's judgment is valid (no fix needed)
|
- condition: ai_fix's judgment is valid (no fix needed)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 3: Expert Reviews (Parallel)
|
|
||||||
# ===========================================
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [architecture, backend]
|
knowledge:
|
||||||
report:
|
- architecture
|
||||||
name: 04-architect-review.md
|
- backend
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -312,17 +264,10 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 4: Supervision
|
|
||||||
# ===========================================
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -335,14 +280,20 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: Issues detected during final review
|
- condition: Issues detected during final review
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -358,3 +309,12 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: Unable to proceed with fixes
|
- condition: Unable to proceed with fixes
|
||||||
next: plan
|
next: plan
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -1,28 +1,11 @@
|
|||||||
# MAGI System Piece
|
|
||||||
# A deliberation piece modeled after Evangelion's MAGI system
|
|
||||||
# Three personas (scientist, nurturer, pragmatist) analyze from different perspectives and vote
|
|
||||||
#
|
|
||||||
# Template Variables:
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: magi
|
name: magi
|
||||||
description: MAGI Deliberation System - Analyze from 3 perspectives and decide by majority
|
description: MAGI Deliberation System - Analyze from 3 perspectives and decide by majority
|
||||||
|
|
||||||
max_iterations: 5
|
max_iterations: 5
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
melchior: ../personas/melchior.md
|
melchior: ../personas/melchior.md
|
||||||
balthasar: ../personas/balthasar.md
|
balthasar: ../personas/balthasar.md
|
||||||
casper: ../personas/casper.md
|
casper: ../personas/casper.md
|
||||||
|
|
||||||
initial_movement: melchior
|
initial_movement: melchior
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: melchior
|
- name: melchior
|
||||||
persona: melchior
|
persona: melchior
|
||||||
@ -60,7 +43,6 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: Judgment completed
|
- condition: Judgment completed
|
||||||
next: balthasar
|
next: balthasar
|
||||||
|
|
||||||
- name: balthasar
|
- name: balthasar
|
||||||
persona: balthasar
|
persona: balthasar
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
@ -101,7 +83,6 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: Judgment completed
|
- condition: Judgment completed
|
||||||
next: casper
|
next: casper
|
||||||
|
|
||||||
- name: casper
|
- name: casper
|
||||||
persona: casper
|
persona: casper
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
|
|||||||
@ -14,6 +14,8 @@ instructions:
|
|||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
initial_movement: implement
|
initial_movement: implement
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
@ -23,9 +25,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -46,6 +45,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -54,9 +56,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -67,13 +66,13 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: No AI-specific issues
|
- condition: No AI-specific issues
|
||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -85,6 +84,9 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: All checks passed
|
- condition: All checks passed
|
||||||
- condition: Requirements unmet, tests failing
|
- condition: Requirements unmet, tests failing
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "All checks passed")
|
- condition: all("No AI-specific issues", "All checks passed")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -195,5 +197,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|||||||
@ -1,44 +1,22 @@
|
|||||||
# Minimal TAKT Piece
|
|
||||||
# Implement -> Parallel Review (AI + Supervisor) -> Fix if needed -> Complete
|
|
||||||
# (Simplest configuration - no plan, no architect review)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request (auto-injected)
|
|
||||||
# {previous_response} - Output from the previous movement (auto-injected)
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece (auto-injected)
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: minimal
|
name: minimal
|
||||||
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|
||||||
initial_movement: implement
|
initial_movement: implement
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
@ -46,9 +24,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -69,7 +44,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -78,33 +55,27 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
rules:
|
rules:
|
||||||
- condition: No AI-specific issues
|
- condition: No AI-specific issues
|
||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -112,7 +83,9 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: All checks passed
|
- condition: All checks passed
|
||||||
- condition: Requirements unmet, tests failing
|
- condition: Requirements unmet, tests failing
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "All checks passed")
|
- condition: all("No AI-specific issues", "All checks passed")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -122,7 +95,6 @@ movements:
|
|||||||
next: ai_fix
|
next: ai_fix
|
||||||
- condition: any("Requirements unmet, tests failing")
|
- condition: any("Requirements unmet, tests failing")
|
||||||
next: supervise_fix
|
next: supervise_fix
|
||||||
|
|
||||||
- name: fix_both
|
- name: fix_both
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_fix_parallel
|
- name: ai_fix_parallel
|
||||||
@ -136,7 +108,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -146,7 +117,6 @@ movements:
|
|||||||
- condition: No fix needed (verified target files/spec)
|
- condition: No fix needed (verified target files/spec)
|
||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix_parallel
|
- name: supervise_fix_parallel
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -158,7 +128,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -167,13 +136,11 @@ movements:
|
|||||||
- condition: Supervisor's issues fixed
|
- condition: Supervisor's issues fixed
|
||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
||||||
next: implement
|
next: implement
|
||||||
|
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -198,7 +165,6 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: implement
|
next: implement
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix
|
- name: supervise_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -221,3 +187,5 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: implement
|
next: implement
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
|||||||
@ -15,8 +15,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -38,6 +36,8 @@ movements:
|
|||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction_template: |
|
instruction_template: |
|
||||||
Do the task.
|
Do the task.
|
||||||
|
output_contracts:
|
||||||
|
- Summary: summary.md
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
|
|||||||
@ -1,25 +1,12 @@
|
|||||||
# Passthrough TAKT Piece
|
|
||||||
# Thinnest wrapper. Pass task directly to coder as-is.
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# execute (do the task)
|
|
||||||
# ↓
|
|
||||||
# COMPLETE
|
|
||||||
|
|
||||||
name: passthrough
|
name: passthrough
|
||||||
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
|
|
||||||
initial_movement: execute
|
initial_movement: execute
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: execute
|
- name: execute
|
||||||
edit: true
|
edit: true
|
||||||
@ -27,8 +14,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -50,3 +35,5 @@ movements:
|
|||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction_template: |
|
instruction_template: |
|
||||||
Do the task.
|
Do the task.
|
||||||
|
output_contracts:
|
||||||
|
- Summary: summary.md
|
||||||
|
|||||||
@ -1,32 +1,11 @@
|
|||||||
# Research Piece
|
|
||||||
# A piece that autonomously executes research tasks
|
|
||||||
# Planner creates the plan, Digger executes, Supervisor verifies
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# plan -> dig -> supervise -> COMPLETE (approved)
|
|
||||||
# -> plan (rejected: restart from planning)
|
|
||||||
#
|
|
||||||
# Template Variables:
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: research
|
name: research
|
||||||
description: Research piece - autonomously executes research without asking questions
|
description: Research piece - autonomously executes research without asking questions
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
research-planner: ../personas/research-planner.md
|
research-planner: ../personas/research-planner.md
|
||||||
research-digger: ../personas/research-digger.md
|
research-digger: ../personas/research-digger.md
|
||||||
research-supervisor: ../personas/research-supervisor.md
|
research-supervisor: ../personas/research-supervisor.md
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
persona: research-planner
|
persona: research-planner
|
||||||
@ -63,7 +42,6 @@ movements:
|
|||||||
next: dig
|
next: dig
|
||||||
- condition: Insufficient information to create a plan
|
- condition: Insufficient information to create a plan
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
|
||||||
- name: dig
|
- name: dig
|
||||||
persona: research-digger
|
persona: research-digger
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
@ -104,7 +82,6 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: Unable to conduct research
|
- condition: Unable to conduct research
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
persona: research-supervisor
|
persona: research-supervisor
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
|
|||||||
@ -14,6 +14,8 @@ instructions:
|
|||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
initial_movement: reviewers
|
initial_movement: reviewers
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
@ -23,9 +25,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -46,6 +45,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -54,9 +56,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -67,13 +66,13 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: No AI-specific issues
|
- condition: No AI-specific issues
|
||||||
- condition: AI-specific issues found
|
- condition: AI-specific issues found
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -85,6 +84,9 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: All checks passed
|
- condition: All checks passed
|
||||||
- condition: Requirements unmet, tests failing
|
- condition: Requirements unmet, tests failing
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "All checks passed")
|
- condition: all("No AI-specific issues", "All checks passed")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -195,5 +197,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|||||||
@ -1,44 +1,22 @@
|
|||||||
# Review-Fix Minimal TAKT Piece
|
|
||||||
# Review -> Fix (if needed) -> Re-review -> Complete
|
|
||||||
# (Starts with review, no implementation movement)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request (auto-injected)
|
|
||||||
# {previous_response} - Output from the previous movement (auto-injected)
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece (auto-injected)
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: review-fix-minimal
|
name: review-fix-minimal
|
||||||
description: Review and fix piece for existing code (starts with review, no implementation)
|
description: Review and fix piece for existing code (starts with review, no implementation)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|
||||||
initial_movement: reviewers
|
initial_movement: reviewers
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
@ -46,9 +24,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -69,7 +44,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -78,41 +55,37 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
rules:
|
rules:
|
||||||
- condition: "No AI-specific issues"
|
- condition: No AI-specific issues
|
||||||
- condition: "AI-specific issues found"
|
- condition: AI-specific issues found
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
rules:
|
rules:
|
||||||
- condition: "All checks passed"
|
- condition: All checks passed
|
||||||
- condition: "Requirements unmet, tests failing"
|
- condition: Requirements unmet, tests failing
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("No AI-specific issues", "All checks passed")
|
- condition: all("No AI-specific issues", "All checks passed")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -122,7 +95,6 @@ movements:
|
|||||||
next: ai_fix
|
next: ai_fix
|
||||||
- condition: any("Requirements unmet, tests failing")
|
- condition: any("Requirements unmet, tests failing")
|
||||||
next: supervise_fix
|
next: supervise_fix
|
||||||
|
|
||||||
- name: fix_both
|
- name: fix_both
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_fix_parallel
|
- name: ai_fix_parallel
|
||||||
@ -136,7 +108,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -146,7 +117,6 @@ movements:
|
|||||||
- condition: No fix needed (verified target files/spec)
|
- condition: No fix needed (verified target files/spec)
|
||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix_parallel
|
- name: supervise_fix_parallel
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -158,7 +128,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -167,13 +136,11 @@ movements:
|
|||||||
- condition: Supervisor's issues fixed
|
- condition: Supervisor's issues fixed
|
||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
||||||
next: implement
|
next: implement
|
||||||
|
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -198,7 +165,6 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: implement
|
next: implement
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix
|
- name: supervise_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -221,3 +187,5 @@ movements:
|
|||||||
- condition: Cannot proceed, insufficient info
|
- condition: Cannot proceed, insufficient info
|
||||||
next: implement
|
next: implement
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
|||||||
@ -1,37 +1,12 @@
|
|||||||
# Review-Only Piece
|
|
||||||
# Reviews code or PRs without making any edits
|
|
||||||
# Local: console output only. PR specified: posts inline comments + summary to PR
|
|
||||||
#
|
|
||||||
# Flow:
|
|
||||||
# plan -> reviewers (parallel: arch-review + security-review + ai-review) -> supervise
|
|
||||||
# -> pr-comment -> COMPLETE (PR comment requested)
|
|
||||||
# -> COMPLETE (local: console output only)
|
|
||||||
# -> ABORT (rejected)
|
|
||||||
#
|
|
||||||
# All movements have edit: false (no file modifications)
|
|
||||||
#
|
|
||||||
# Template Variables:
|
|
||||||
# {iteration} - Piece-wide turn count
|
|
||||||
# {max_iterations} - Maximum iterations allowed
|
|
||||||
# {movement_iteration} - Per-movement iteration count
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs
|
|
||||||
# {report_dir} - Report directory name
|
|
||||||
|
|
||||||
name: review-only
|
name: review-only
|
||||||
description: Review-only piece - reviews code without making edits
|
description: Review-only piece - reviews code without making edits
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
@ -39,20 +14,11 @@ personas:
|
|||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
pr-commenter: ../personas/pr-commenter.md
|
pr-commenter: ../personas/pr-commenter.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
review-security: ../instructions/review-security.md
|
review-security: ../instructions/review-security.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
review-summary: ../output-contracts/review-summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
@ -88,7 +54,6 @@ movements:
|
|||||||
|
|
||||||
**If a PR number is mentioned** (e.g., "PR #42"), include it in your plan
|
**If a PR number is mentioned** (e.g., "PR #42"), include it in your plan
|
||||||
so reviewers can focus on the PR's changed files.
|
so reviewers can focus on the PR's changed files.
|
||||||
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
@ -96,73 +61,65 @@ movements:
|
|||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 01-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 02-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 02-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: ai-review
|
- name: ai-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: supervise
|
next: supervise
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Review Summary: 04-review-summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -217,7 +174,8 @@ movements:
|
|||||||
## Improvement Suggestions
|
## Improvement Suggestions
|
||||||
- {Consolidated suggestions from all reviews}
|
- {Consolidated suggestions from all reviews}
|
||||||
```
|
```
|
||||||
|
output_contracts:
|
||||||
|
- Review Summary: 04-review-summary.md
|
||||||
- name: pr-comment
|
- name: pr-comment
|
||||||
edit: false
|
edit: false
|
||||||
persona: pr-commenter
|
persona: pr-commenter
|
||||||
@ -268,3 +226,8 @@ movements:
|
|||||||
---
|
---
|
||||||
*Generated by [takt](https://github.com/toruticas/takt) review-only piece*
|
*Generated by [takt](https://github.com/toruticas/takt) review-only piece*
|
||||||
```
|
```
|
||||||
|
report_formats:
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
review-summary: ../output-contracts/review-summary.md
|
||||||
|
|||||||
@ -17,14 +17,15 @@ instructions:
|
|||||||
ai-review: ../instructions/ai-review.md
|
ai-review: ../instructions/ai-review.md
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -40,6 +41,9 @@ movements:
|
|||||||
- condition: 要件が不明確、情報不足
|
- condition: 要件が不明確、情報不足
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -49,9 +53,6 @@ movements:
|
|||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -74,6 +75,9 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -82,9 +86,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -95,14 +96,14 @@ movements:
|
|||||||
- condition: AI特有の問題なし
|
- condition: AI特有の問題なし
|
||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -113,6 +114,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "approved")
|
- condition: all("AI特有の問題なし", "approved")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -147,7 +151,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
|
|||||||
@ -1,73 +1,29 @@
|
|||||||
# Coding TAKT Piece
|
|
||||||
# Plan -> Implement -> Parallel Review (AI + Architecture) -> Fix if needed
|
|
||||||
#
|
|
||||||
# 計画と並列レビューを備えた軽量な開発ピース。
|
|
||||||
# architect-plannerが要件を調査・整理し、不明点はコードを読んで自力で解決する。
|
|
||||||
# 並列レビュー後、問題がなければ直接完了し、高速なフィードバックループを実現。
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# plan (要件調査・計画)
|
|
||||||
# ↓
|
|
||||||
# implement (実装)
|
|
||||||
# ↓
|
|
||||||
# reviewers (並列レビュー)
|
|
||||||
# ├─ ai_review (AI特有問題検出)
|
|
||||||
# └─ arch-review (設計準拠性確認)
|
|
||||||
# ↓
|
|
||||||
# [判定]
|
|
||||||
# ├─ all(approved) → COMPLETE
|
|
||||||
# └─ any(needs_fix) → fix → reviewers (再レビュー)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected by buildInstruction):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: coding
|
name: coding
|
||||||
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
architect-planner: ../personas/architect-planner.md
|
architect-planner: ../personas/architect-planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
ai-review: ../instructions/ai-review.md
|
ai-review: ../instructions/ai-review.md
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -83,7 +39,9 @@ movements:
|
|||||||
- condition: 要件が不明確、情報不足
|
- condition: 要件が不明確、情報不足
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -92,9 +50,6 @@ movements:
|
|||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -117,7 +72,9 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -126,9 +83,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -139,15 +93,14 @@ movements:
|
|||||||
- condition: AI特有の問題なし
|
- condition: AI特有の問題なし
|
||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -158,13 +111,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "approved")
|
- condition: all("AI特有の問題なし", "approved")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: any("AI特有の問題あり", "needs_fix")
|
- condition: any("AI特有の問題あり", "needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -188,3 +142,7 @@ movements:
|
|||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
|||||||
@ -26,6 +26,14 @@ instructions:
|
|||||||
review-qa: ../instructions/review-qa.md
|
review-qa: ../instructions/review-qa.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
architecture-design: ../output-contracts/architecture-design.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
loop_monitors:
|
loop_monitors:
|
||||||
- cycle:
|
- cycle:
|
||||||
@ -56,9 +64,6 @@ movements:
|
|||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -78,12 +83,12 @@ movements:
|
|||||||
- {質問1}
|
- {質問1}
|
||||||
- {質問2}
|
- {質問2}
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: architect
|
- name: architect
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 01-architecture.md
|
|
||||||
format: architecture-design
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -98,6 +103,9 @@ movements:
|
|||||||
- condition: 情報不足、判断できない
|
- condition: 情報不足、判断できない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: architect
|
instruction: architect
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architecture.md
|
||||||
|
format: architecture-design
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -109,9 +117,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- backend
|
- backend
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 02-coder-scope.md
|
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -134,15 +139,15 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -155,6 +160,9 @@ movements:
|
|||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -207,9 +215,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- architecture
|
- architecture
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 05-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -220,15 +225,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 06-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -239,6 +244,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -274,9 +282,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 07-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -290,17 +295,12 @@ movements:
|
|||||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
next: plan
|
next: plan
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 07-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
architecture-design: ../output-contracts/architecture-design.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,31 +1,15 @@
|
|||||||
# Default TAKT Piece
|
|
||||||
# Plan -> Architect -> Implement -> AI Review -> Reviewers (parallel: Architect + QA) -> Supervisor Approval
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected by buildInstruction):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request
|
|
||||||
# {previous_response} - Output from the previous movement
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: default
|
name: default
|
||||||
description: Standard development piece with planning and specialized reviews
|
description: Standard development piece with planning and specialized reviews
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
architect-planner: ../personas/architect-planner.md
|
architect-planner: ../personas/architect-planner.md
|
||||||
@ -34,7 +18,6 @@ personas:
|
|||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
architect: ../instructions/architect.md
|
architect: ../instructions/architect.md
|
||||||
@ -46,20 +29,11 @@ instructions:
|
|||||||
review-qa: ../instructions/review-qa.md
|
review-qa: ../instructions/review-qa.md
|
||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
architecture-design: ../output-contracts/architecture-design.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
loop_monitors:
|
loop_monitors:
|
||||||
- cycle: [ai_review, ai_fix]
|
- cycle:
|
||||||
|
- ai_review
|
||||||
|
- ai_fix
|
||||||
threshold: 3
|
threshold: 3
|
||||||
judge:
|
judge:
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
@ -81,14 +55,10 @@ loop_monitors:
|
|||||||
next: ai_review
|
next: ai_review
|
||||||
- condition: 非生産的(改善なし)
|
- condition: 非生産的(改善なし)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -108,13 +78,12 @@ movements:
|
|||||||
- {質問1}
|
- {質問1}
|
||||||
- {質問2}
|
- {質問2}
|
||||||
instruction: plan
|
instruction: plan
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: architect
|
- name: architect
|
||||||
edit: false
|
edit: false
|
||||||
persona: architect-planner
|
persona: architect-planner
|
||||||
report:
|
|
||||||
name: 01-architecture.md
|
|
||||||
format: architecture-design
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -129,7 +98,9 @@ movements:
|
|||||||
- condition: 情報不足、判断できない
|
- condition: 情報不足、判断できない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
instruction: architect
|
instruction: architect
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architecture.md
|
||||||
|
format: architecture-design
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -137,10 +108,9 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
report:
|
- backend
|
||||||
- Scope: 02-coder-scope.md
|
- architecture
|
||||||
- Decisions: 03-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -163,16 +133,15 @@ movements:
|
|||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction: implement
|
instruction: implement
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 02-coder-scope.md
|
||||||
|
- Decisions: 03-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 04-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -185,7 +154,9 @@ movements:
|
|||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
instruction: ai-review
|
instruction: ai-review
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -193,7 +164,9 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
|
- backend
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -212,7 +185,6 @@ movements:
|
|||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -227,17 +199,15 @@ movements:
|
|||||||
- condition: ai_fixの判断が妥当(修正不要)
|
- condition: ai_fixの判断が妥当(修正不要)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [architecture, backend]
|
knowledge:
|
||||||
report:
|
- architecture
|
||||||
name: 05-architect-review.md
|
- backend
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -248,16 +218,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 06-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -268,19 +237,23 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [backend, architecture]
|
knowledge:
|
||||||
|
- backend
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -297,14 +270,10 @@ movements:
|
|||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 07-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -318,3 +287,14 @@ movements:
|
|||||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
next: plan
|
next: plan
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 07-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
architecture-design: ../output-contracts/architecture-design.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -33,14 +33,20 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -54,6 +60,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: 要件が不明確で計画を立てられない
|
- condition: 要件が不明確で計画を立てられない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -68,9 +77,6 @@ movements:
|
|||||||
- cqrs-es
|
- cqrs-es
|
||||||
- security
|
- security
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -92,15 +98,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -113,6 +119,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI特有の問題が検出された
|
- condition: AI特有の問題が検出された
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -167,9 +176,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- cqrs-es
|
- cqrs-es
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 04-cqrs-es-review.md
|
|
||||||
format: cqrs-es-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -180,14 +186,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-cqrs-es
|
instruction: review-cqrs-es
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-cqrs-es-review.md
|
||||||
|
format: cqrs-es-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -198,14 +204,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -216,15 +222,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -235,6 +241,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -273,9 +282,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -288,6 +294,9 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: 問題が検出された
|
- condition: 問題が検出された
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -322,12 +331,3 @@ policies:
|
|||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,51 +1,18 @@
|
|||||||
# Expert Review Piece
|
|
||||||
# CQRS+ES、フロントエンド、セキュリティ、QAの専門家によるレビューピース
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# plan -> implement -> ai_review -> reviewers (parallel) -> supervise -> COMPLETE
|
|
||||||
# ↓ ├─ cqrs-es-review ↓
|
|
||||||
# ai_fix ├─ frontend-review fix_supervisor
|
|
||||||
# ├─ security-review
|
|
||||||
# └─ qa-review
|
|
||||||
# any("needs_fix") → fix → reviewers
|
|
||||||
#
|
|
||||||
# ボイラープレートセクション(Piece Context, User Request, Previous Response,
|
|
||||||
# Additional User Inputs, Instructions heading)はbuildInstruction()が自動挿入。
|
|
||||||
# instruction_templateにはムーブメント固有の内容のみ記述。
|
|
||||||
#
|
|
||||||
# テンプレート変数(instruction_template内で使用可能):
|
|
||||||
# {iteration} - ピース全体のターン数(全エージェントで実行されたムーブメントの合計)
|
|
||||||
# {max_iterations} - ピースの最大イテレーション数
|
|
||||||
# {movement_iteration} - ムーブメントごとのイテレーション数(このムーブメントが何回実行されたか)
|
|
||||||
# {previous_response} - 前のムーブメントの出力(pass_previous_response: true の場合のみ)
|
|
||||||
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary")
|
|
||||||
#
|
|
||||||
# ムーブメントレベルフィールド:
|
|
||||||
# report: - ムーブメントのレポートファイル(Piece ContextにReport File/Filesとして自動挿入)
|
|
||||||
# 単一: report: 00-plan.md
|
|
||||||
# 複数: report:
|
|
||||||
# - Scope: 01-coder-scope.md
|
|
||||||
# - Decisions: 02-coder-decisions.md
|
|
||||||
|
|
||||||
name: expert-cqrs
|
name: expert-cqrs
|
||||||
description: CQRS+ES・フロントエンド・セキュリティ・QA専門家レビュー
|
description: CQRS+ES・フロントエンド・セキュリティ・QA専門家レビュー
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
frontend: ../knowledge/frontend.md
|
frontend: ../knowledge/frontend.md
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
cqrs-es: ../knowledge/cqrs-es.md
|
cqrs-es: ../knowledge/cqrs-es.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
@ -56,7 +23,6 @@ personas:
|
|||||||
security-reviewer: ../personas/security-reviewer.md
|
security-reviewer: ../personas/security-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
expert-supervisor: ../personas/expert-supervisor.md
|
expert-supervisor: ../personas/expert-supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
@ -70,29 +36,11 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
# ===========================================
|
|
||||||
# Movement 0: Planning
|
|
||||||
# ===========================================
|
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -106,10 +54,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: 要件が不明確で計画を立てられない
|
- condition: 要件が不明確で計画を立てられない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- name: 00-plan.md
|
||||||
# Movement 1: Implementation
|
format: plan
|
||||||
# ===========================================
|
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -117,10 +64,12 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
report:
|
- frontend
|
||||||
- Scope: 01-coder-scope.md
|
- backend
|
||||||
- Decisions: 02-coder-decisions.md
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -142,19 +91,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- Scope: 01-coder-scope.md
|
||||||
# Movement 2: AI Review
|
- Decisions: 02-coder-decisions.md
|
||||||
# ===========================================
|
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -167,7 +112,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI特有の問題が検出された
|
- condition: AI特有の問題が検出された
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -175,7 +122,12 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -193,7 +145,6 @@ movements:
|
|||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -208,105 +159,100 @@ movements:
|
|||||||
- condition: ai_fixの判断が妥当(修正不要)
|
- condition: ai_fixの判断が妥当(修正不要)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 3: Expert Reviews (Parallel)
|
|
||||||
# ===========================================
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: cqrs-es-review
|
- name: cqrs-es-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: cqrs-es-reviewer
|
persona: cqrs-es-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [cqrs-es, backend]
|
knowledge:
|
||||||
report:
|
- cqrs-es
|
||||||
name: 04-cqrs-es-review.md
|
- backend
|
||||||
format: cqrs-es-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-cqrs-es
|
instruction: review-cqrs-es
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-cqrs-es-review.md
|
||||||
|
format: cqrs-es-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -323,17 +269,10 @@ movements:
|
|||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 4: Supervision
|
|
||||||
# ===========================================
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -346,14 +285,21 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: 問題が検出された
|
- condition: 問題が検出された
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- cqrs-es
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -369,3 +315,12 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: plan
|
next: plan
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
cqrs-es-review: ../output-contracts/cqrs-es-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -31,14 +31,20 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -52,6 +58,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: 要件が不明確で計画を立てられない
|
- condition: 要件が不明確で計画を立てられない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
|
- name: 00-plan.md
|
||||||
|
format: plan
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -65,9 +74,6 @@ movements:
|
|||||||
- backend
|
- backend
|
||||||
- security
|
- security
|
||||||
- architecture
|
- architecture
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -89,15 +95,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -110,6 +116,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI特有の問題が検出された
|
- condition: AI特有の問題が検出された
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -163,9 +172,6 @@ movements:
|
|||||||
knowledge:
|
knowledge:
|
||||||
- architecture
|
- architecture
|
||||||
- backend
|
- backend
|
||||||
report:
|
|
||||||
name: 04-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -176,14 +182,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -194,14 +200,14 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -212,15 +218,15 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -231,6 +237,9 @@ movements:
|
|||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
@ -268,9 +277,6 @@ movements:
|
|||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -283,6 +289,9 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: 問題が検出された
|
- condition: 問題が検出された
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -316,12 +325,3 @@ policies:
|
|||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|||||||
@ -1,41 +1,17 @@
|
|||||||
# Expert Review Piece
|
|
||||||
# アーキテクチャ、フロントエンド、セキュリティ、QAの専門家によるレビューピース
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# plan -> implement -> ai_review -> reviewers (parallel) -> supervise -> COMPLETE
|
|
||||||
# ↓ ├─ arch-review ↓
|
|
||||||
# ai_fix ├─ frontend-review fix_supervisor
|
|
||||||
# ├─ security-review
|
|
||||||
# └─ qa-review
|
|
||||||
# any("needs_fix") → fix → reviewers
|
|
||||||
#
|
|
||||||
# テンプレート変数:
|
|
||||||
# {iteration} - ピース全体のターン数(全エージェントで実行されたムーブメントの合計)
|
|
||||||
# {max_iterations} - ピースの最大イテレーション数
|
|
||||||
# {movement_iteration} - ムーブメントごとのイテレーション数(このムーブメントが何回実行されたか)
|
|
||||||
# {task} - 元のユーザー要求
|
|
||||||
# {previous_response} - 前のムーブメントの出力
|
|
||||||
# {user_inputs} - ピース中に蓄積されたユーザー入力
|
|
||||||
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: expert
|
name: expert
|
||||||
description: アーキテクチャ・フロントエンド・セキュリティ・QA専門家レビュー
|
description: アーキテクチャ・フロントエンド・セキュリティ・QA専門家レビュー
|
||||||
|
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
qa: ../policies/qa.md
|
qa: ../policies/qa.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
frontend: ../knowledge/frontend.md
|
frontend: ../knowledge/frontend.md
|
||||||
backend: ../knowledge/backend.md
|
backend: ../knowledge/backend.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
@ -45,7 +21,6 @@ personas:
|
|||||||
security-reviewer: ../personas/security-reviewer.md
|
security-reviewer: ../personas/security-reviewer.md
|
||||||
qa-reviewer: ../personas/qa-reviewer.md
|
qa-reviewer: ../personas/qa-reviewer.md
|
||||||
expert-supervisor: ../personas/expert-supervisor.md
|
expert-supervisor: ../personas/expert-supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
@ -59,29 +34,11 @@ instructions:
|
|||||||
fix: ../instructions/fix.md
|
fix: ../instructions/fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
plan: ../output-contracts/plan.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
frontend-review: ../output-contracts/frontend-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
qa-review: ../output-contracts/qa-review.md
|
|
||||||
validation: ../output-contracts/validation.md
|
|
||||||
summary: ../output-contracts/summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
# ===========================================
|
|
||||||
# Movement 0: Planning
|
|
||||||
# ===========================================
|
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
persona: planner
|
persona: planner
|
||||||
report:
|
|
||||||
name: 00-plan.md
|
|
||||||
format: plan
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -95,10 +52,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
- condition: 要件が不明確で計画を立てられない
|
- condition: 要件が不明確で計画を立てられない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- name: 00-plan.md
|
||||||
# Movement 1: Implementation
|
format: plan
|
||||||
# ===========================================
|
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -106,10 +62,11 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
report:
|
- frontend
|
||||||
- Scope: 01-coder-scope.md
|
- backend
|
||||||
- Decisions: 02-coder-decisions.md
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -131,19 +88,15 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
# ===========================================
|
- Scope: 01-coder-scope.md
|
||||||
# Movement 2: AI Review
|
- Decisions: 02-coder-decisions.md
|
||||||
# ===========================================
|
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -156,7 +109,9 @@ movements:
|
|||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: AI特有の問題が検出された
|
- condition: AI特有の問題が検出された
|
||||||
next: ai_fix
|
next: ai_fix
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -164,7 +119,11 @@ movements:
|
|||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
session: refresh
|
session: refresh
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -182,7 +141,6 @@ movements:
|
|||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: ai_no_fix
|
next: ai_no_fix
|
||||||
|
|
||||||
- name: ai_no_fix
|
- name: ai_no_fix
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
@ -197,105 +155,99 @@ movements:
|
|||||||
- condition: ai_fixの判断が妥当(修正不要)
|
- condition: ai_fixの判断が妥当(修正不要)
|
||||||
next: reviewers
|
next: reviewers
|
||||||
instruction: arbitrate
|
instruction: arbitrate
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 3: Expert Reviews (Parallel)
|
|
||||||
# ===========================================
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: [architecture, backend]
|
knowledge:
|
||||||
report:
|
- architecture
|
||||||
name: 04-architect-review.md
|
- backend
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 04-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: frontend-review
|
- name: frontend-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: frontend-reviewer
|
persona: frontend-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: frontend
|
knowledge: frontend
|
||||||
report:
|
|
||||||
name: 05-frontend-review.md
|
|
||||||
format: frontend-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-frontend
|
instruction: review-frontend
|
||||||
|
output_contracts:
|
||||||
|
- name: 05-frontend-review.md
|
||||||
|
format: frontend-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 06-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 06-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: qa-review
|
- name: qa-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: qa-reviewer
|
persona: qa-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- qa
|
- qa
|
||||||
report:
|
|
||||||
name: 07-qa-review.md
|
|
||||||
format: qa-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-qa
|
instruction: review-qa
|
||||||
|
output_contracts:
|
||||||
|
- name: 07-qa-review.md
|
||||||
|
format: qa-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: fix
|
next: fix
|
||||||
|
|
||||||
- name: fix
|
- name: fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -312,17 +264,10 @@ movements:
|
|||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: plan
|
next: plan
|
||||||
instruction: fix
|
instruction: fix
|
||||||
|
|
||||||
# ===========================================
|
|
||||||
# Movement 4: Supervision
|
|
||||||
# ===========================================
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: expert-supervisor
|
persona: expert-supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 08-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -335,14 +280,20 @@ movements:
|
|||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
- condition: 問題が検出された
|
- condition: 問題が検出された
|
||||||
next: fix_supervisor
|
next: fix_supervisor
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 08-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
- name: fix_supervisor
|
- name: fix_supervisor
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
knowledge: [frontend, backend, security, architecture]
|
knowledge:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
- security
|
||||||
|
- architecture
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -358,3 +309,12 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: plan
|
next: plan
|
||||||
|
report_formats:
|
||||||
|
plan: ../output-contracts/plan.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
frontend-review: ../output-contracts/frontend-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
qa-review: ../output-contracts/qa-review.md
|
||||||
|
validation: ../output-contracts/validation.md
|
||||||
|
summary: ../output-contracts/summary.md
|
||||||
|
|||||||
@ -1,28 +1,11 @@
|
|||||||
# MAGI System Piece
|
|
||||||
# エヴァンゲリオンのMAGIシステムを模した合議制ピース
|
|
||||||
# 3つの人格(科学者・育成者・実務家)が異なる観点から分析・投票する
|
|
||||||
#
|
|
||||||
# テンプレート変数:
|
|
||||||
# {iteration} - ピース全体のターン数(全エージェントで実行されたムーブメントの合計)
|
|
||||||
# {max_iterations} - ピースの最大イテレーション数
|
|
||||||
# {movement_iteration} - ムーブメントごとのイテレーション数(このムーブメントが何回実行されたか)
|
|
||||||
# {task} - 元のユーザー要求
|
|
||||||
# {previous_response} - 前のムーブメントの出力
|
|
||||||
# {user_inputs} - ピース中に蓄積されたユーザー入力
|
|
||||||
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: magi
|
name: magi
|
||||||
description: MAGI合議システム - 3つの観点から分析し多数決で判定
|
description: MAGI合議システム - 3つの観点から分析し多数決で判定
|
||||||
|
|
||||||
max_iterations: 5
|
max_iterations: 5
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
melchior: ../personas/melchior.md
|
melchior: ../personas/melchior.md
|
||||||
balthasar: ../personas/balthasar.md
|
balthasar: ../personas/balthasar.md
|
||||||
casper: ../personas/casper.md
|
casper: ../personas/casper.md
|
||||||
|
|
||||||
initial_movement: melchior
|
initial_movement: melchior
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: melchior
|
- name: melchior
|
||||||
persona: melchior
|
persona: melchior
|
||||||
@ -60,7 +43,6 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: 判定を完了した
|
- condition: 判定を完了した
|
||||||
next: balthasar
|
next: balthasar
|
||||||
|
|
||||||
- name: balthasar
|
- name: balthasar
|
||||||
persona: balthasar
|
persona: balthasar
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
@ -101,7 +83,6 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: 判定を完了した
|
- condition: 判定を完了した
|
||||||
next: casper
|
next: casper
|
||||||
|
|
||||||
- name: casper
|
- name: casper
|
||||||
persona: casper
|
persona: casper
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
|
|||||||
@ -14,6 +14,8 @@ instructions:
|
|||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
initial_movement: implement
|
initial_movement: implement
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
@ -23,9 +25,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -46,6 +45,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -54,9 +56,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -67,13 +66,13 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: AI特有の問題なし
|
- condition: AI特有の問題なし
|
||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -85,6 +84,9 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: すべて問題なし
|
- condition: すべて問題なし
|
||||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -195,5 +197,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|||||||
@ -1,44 +1,22 @@
|
|||||||
# Simple TAKT Piece
|
|
||||||
# Implement -> AI Review -> Supervisor Approval
|
|
||||||
# (最もシンプルな構成 - plan, architect review, fix ムーブメントなし)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request (auto-injected)
|
|
||||||
# {previous_response} - Output from the previous movement (auto-injected)
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece (auto-injected)
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: minimal
|
name: minimal
|
||||||
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|
||||||
initial_movement: implement
|
initial_movement: implement
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
@ -46,9 +24,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -69,7 +44,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -78,41 +55,37 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
rules:
|
rules:
|
||||||
- condition: "AI特有の問題なし"
|
- condition: AI特有の問題なし
|
||||||
- condition: "AI特有の問題あり"
|
- condition: AI特有の問題あり
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
rules:
|
rules:
|
||||||
- condition: "すべて問題なし"
|
- condition: すべて問題なし
|
||||||
- condition: "要求未達成、テスト失敗、ビルドエラー"
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -122,7 +95,6 @@ movements:
|
|||||||
next: ai_fix
|
next: ai_fix
|
||||||
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
||||||
next: supervise_fix
|
next: supervise_fix
|
||||||
|
|
||||||
- name: fix_both
|
- name: fix_both
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_fix_parallel
|
- name: ai_fix_parallel
|
||||||
@ -136,7 +108,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -146,7 +117,6 @@ movements:
|
|||||||
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix_parallel
|
- name: supervise_fix_parallel
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -158,7 +128,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -167,13 +136,11 @@ movements:
|
|||||||
- condition: 監督者の指摘に対する修正が完了した
|
- condition: 監督者の指摘に対する修正が完了した
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
||||||
next: implement
|
next: implement
|
||||||
|
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -198,7 +165,6 @@ movements:
|
|||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
next: implement
|
next: implement
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix
|
- name: supervise_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -221,3 +187,5 @@ movements:
|
|||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: implement
|
next: implement
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
|||||||
@ -15,8 +15,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -38,6 +36,8 @@ movements:
|
|||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction_template: |
|
instruction_template: |
|
||||||
タスクをこなしてください。
|
タスクをこなしてください。
|
||||||
|
output_contracts:
|
||||||
|
- Summary: summary.md
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
|
|||||||
@ -1,25 +1,12 @@
|
|||||||
# Passthrough TAKT Piece
|
|
||||||
# タスクをそのままエージェントに渡す最薄ラッパー。
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# execute (タスク実行)
|
|
||||||
# ↓
|
|
||||||
# COMPLETE
|
|
||||||
|
|
||||||
name: passthrough
|
name: passthrough
|
||||||
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
|
|
||||||
initial_movement: execute
|
initial_movement: execute
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: execute
|
- name: execute
|
||||||
edit: true
|
edit: true
|
||||||
@ -27,8 +14,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -50,3 +35,5 @@ movements:
|
|||||||
interactive_only: true
|
interactive_only: true
|
||||||
instruction_template: |
|
instruction_template: |
|
||||||
タスクをこなしてください。
|
タスクをこなしてください。
|
||||||
|
output_contracts:
|
||||||
|
- Summary: summary.md
|
||||||
|
|||||||
@ -1,32 +1,11 @@
|
|||||||
# Research Piece
|
|
||||||
# 調査タスクを自律的に実行するピース
|
|
||||||
# Planner が計画を立て、Digger が実行し、Supervisor が確認する
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# plan -> dig -> supervise -> COMPLETE (approved)
|
|
||||||
# -> plan (rejected: 計画からやり直し)
|
|
||||||
#
|
|
||||||
# テンプレート変数:
|
|
||||||
# {iteration} - ピース全体のターン数(全エージェントで実行されたムーブメントの合計)
|
|
||||||
# {max_iterations} - ピースの最大イテレーション数
|
|
||||||
# {movement_iteration} - ムーブメントごとのイテレーション数(このムーブメントが何回実行されたか)
|
|
||||||
# {task} - 元のユーザー要求
|
|
||||||
# {previous_response} - 前のムーブメントの出力
|
|
||||||
# {user_inputs} - ピース中に蓄積されたユーザー入力
|
|
||||||
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: research
|
name: research
|
||||||
description: 調査ピース - 質問せずに自律的に調査を実行
|
description: 調査ピース - 質問せずに自律的に調査を実行
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
research-planner: ../personas/research-planner.md
|
research-planner: ../personas/research-planner.md
|
||||||
research-digger: ../personas/research-digger.md
|
research-digger: ../personas/research-digger.md
|
||||||
research-supervisor: ../personas/research-supervisor.md
|
research-supervisor: ../personas/research-supervisor.md
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
persona: research-planner
|
persona: research-planner
|
||||||
@ -63,7 +42,6 @@ movements:
|
|||||||
next: dig
|
next: dig
|
||||||
- condition: 情報が不足しており計画を立てられない
|
- condition: 情報が不足しており計画を立てられない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
|
||||||
- name: dig
|
- name: dig
|
||||||
persona: research-digger
|
persona: research-digger
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
@ -104,7 +82,6 @@ movements:
|
|||||||
next: supervise
|
next: supervise
|
||||||
- condition: 調査を実行できない
|
- condition: 調査を実行できない
|
||||||
next: ABORT
|
next: ABORT
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
persona: research-supervisor
|
persona: research-supervisor
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
|
|||||||
@ -14,6 +14,8 @@ instructions:
|
|||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
initial_movement: reviewers
|
initial_movement: reviewers
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
@ -23,9 +25,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -46,6 +45,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -54,9 +56,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -67,13 +66,13 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: AI特有の問題なし
|
- condition: AI特有の問題なし
|
||||||
- condition: AI特有の問題あり
|
- condition: AI特有の問題あり
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -85,6 +84,9 @@ movements:
|
|||||||
rules:
|
rules:
|
||||||
- condition: すべて問題なし
|
- condition: すべて問題なし
|
||||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -195,5 +197,3 @@ policies:
|
|||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|||||||
@ -1,44 +1,22 @@
|
|||||||
# Review-Fix Minimal TAKT Piece
|
|
||||||
# Review -> Fix (if needed) -> Re-review -> Complete
|
|
||||||
# (レビューから開始、実装ムーブメントなし)
|
|
||||||
#
|
|
||||||
# Template Variables (auto-injected):
|
|
||||||
# {iteration} - Piece-wide turn count (total movements executed across all agents)
|
|
||||||
# {max_iterations} - Maximum iterations allowed for the piece
|
|
||||||
# {movement_iteration} - Per-movement iteration count (how many times THIS movement has been executed)
|
|
||||||
# {task} - Original user request (auto-injected)
|
|
||||||
# {previous_response} - Output from the previous movement (auto-injected)
|
|
||||||
# {user_inputs} - Accumulated user inputs during piece (auto-injected)
|
|
||||||
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
|
|
||||||
|
|
||||||
name: review-fix-minimal
|
name: review-fix-minimal
|
||||||
description: 既存コードのレビューと修正ピース(レビュー開始、実装なし)
|
description: 既存コードのレビューと修正ピース(レビュー開始、実装なし)
|
||||||
|
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
coding: ../policies/coding.md
|
coding: ../policies/coding.md
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
testing: ../policies/testing.md
|
testing: ../policies/testing.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
coder: ../personas/coder.md
|
coder: ../personas/coder.md
|
||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
ai-fix: ../instructions/ai-fix.md
|
ai-fix: ../instructions/ai-fix.md
|
||||||
supervise: ../instructions/supervise.md
|
supervise: ../instructions/supervise.md
|
||||||
fix-supervisor: ../instructions/fix-supervisor.md
|
fix-supervisor: ../instructions/fix-supervisor.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
|
|
||||||
initial_movement: reviewers
|
initial_movement: reviewers
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: implement
|
- name: implement
|
||||||
edit: true
|
edit: true
|
||||||
@ -46,9 +24,6 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- coding
|
- coding
|
||||||
- testing
|
- testing
|
||||||
report:
|
|
||||||
- Scope: 01-coder-scope.md
|
|
||||||
- Decisions: 02-coder-decisions.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -69,7 +44,9 @@ movements:
|
|||||||
next: implement
|
next: implement
|
||||||
requires_user_input: true
|
requires_user_input: true
|
||||||
interactive_only: true
|
interactive_only: true
|
||||||
|
output_contracts:
|
||||||
|
- Scope: 01-coder-scope.md
|
||||||
|
- Decisions: 02-coder-decisions.md
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_review
|
- name: ai_review
|
||||||
@ -78,41 +55,37 @@ movements:
|
|||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
rules:
|
rules:
|
||||||
- condition: "AI特有の問題なし"
|
- condition: AI特有の問題なし
|
||||||
- condition: "AI特有の問題あり"
|
- condition: AI特有の問題あり
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Validation: 05-supervisor-validation.md
|
|
||||||
- Summary: summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
instruction: supervise
|
instruction: supervise
|
||||||
rules:
|
rules:
|
||||||
- condition: "すべて問題なし"
|
- condition: すべて問題なし
|
||||||
- condition: "要求未達成、テスト失敗、ビルドエラー"
|
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||||
|
output_contracts:
|
||||||
|
- Validation: 05-supervisor-validation.md
|
||||||
|
- Summary: summary.md
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||||
next: COMPLETE
|
next: COMPLETE
|
||||||
@ -122,7 +95,6 @@ movements:
|
|||||||
next: ai_fix
|
next: ai_fix
|
||||||
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
||||||
next: supervise_fix
|
next: supervise_fix
|
||||||
|
|
||||||
- name: fix_both
|
- name: fix_both
|
||||||
parallel:
|
parallel:
|
||||||
- name: ai_fix_parallel
|
- name: ai_fix_parallel
|
||||||
@ -136,7 +108,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -146,7 +117,6 @@ movements:
|
|||||||
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix_parallel
|
- name: supervise_fix_parallel
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -158,7 +128,6 @@ movements:
|
|||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
- Edit
|
- Edit
|
||||||
|
|
||||||
- Bash
|
- Bash
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
@ -167,13 +136,11 @@ movements:
|
|||||||
- condition: 監督者の指摘に対する修正が完了した
|
- condition: 監督者の指摘に対する修正が完了した
|
||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
||||||
next: reviewers
|
next: reviewers
|
||||||
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
||||||
next: implement
|
next: implement
|
||||||
|
|
||||||
- name: ai_fix
|
- name: ai_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -198,7 +165,6 @@ movements:
|
|||||||
- condition: 判断できない、情報不足
|
- condition: 判断できない、情報不足
|
||||||
next: implement
|
next: implement
|
||||||
instruction: ai-fix
|
instruction: ai-fix
|
||||||
|
|
||||||
- name: supervise_fix
|
- name: supervise_fix
|
||||||
edit: true
|
edit: true
|
||||||
persona: coder
|
persona: coder
|
||||||
@ -221,3 +187,5 @@ movements:
|
|||||||
- condition: 修正を進行できない
|
- condition: 修正を進行できない
|
||||||
next: implement
|
next: implement
|
||||||
instruction: fix-supervisor
|
instruction: fix-supervisor
|
||||||
|
report_formats:
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
|||||||
@ -1,37 +1,12 @@
|
|||||||
# レビュー専用ピース
|
|
||||||
# コードやPRをレビューするだけで編集は行わない
|
|
||||||
# ローカル: コンソール出力のみ。PR指定時: PRにインラインコメント+サマリを投稿
|
|
||||||
#
|
|
||||||
# フロー:
|
|
||||||
# plan -> reviewers (parallel: arch-review + security-review + ai-review) -> supervise
|
|
||||||
# -> pr-comment -> COMPLETE (PRコメント要求時)
|
|
||||||
# -> COMPLETE (ローカル: コンソール出力のみ)
|
|
||||||
# -> ABORT (rejected)
|
|
||||||
#
|
|
||||||
# 全ムーブメント edit: false(ファイル変更なし)
|
|
||||||
#
|
|
||||||
# テンプレート変数:
|
|
||||||
# {iteration} - ピース全体のターン数
|
|
||||||
# {max_iterations} - 最大イテレーション数
|
|
||||||
# {movement_iteration} - ムーブメントごとのイテレーション数
|
|
||||||
# {task} - 元のユーザー要求
|
|
||||||
# {previous_response} - 前のムーブメントの出力
|
|
||||||
# {user_inputs} - 蓄積されたユーザー入力
|
|
||||||
# {report_dir} - レポートディレクトリ名
|
|
||||||
|
|
||||||
name: review-only
|
name: review-only
|
||||||
description: レビュー専用ピース - コードをレビューするだけで編集は行わない
|
description: レビュー専用ピース - コードをレビューするだけで編集は行わない
|
||||||
|
|
||||||
max_iterations: 10
|
max_iterations: 10
|
||||||
|
|
||||||
policies:
|
policies:
|
||||||
review: ../policies/review.md
|
review: ../policies/review.md
|
||||||
ai-antipattern: ../policies/ai-antipattern.md
|
ai-antipattern: ../policies/ai-antipattern.md
|
||||||
|
|
||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
security: ../knowledge/security.md
|
security: ../knowledge/security.md
|
||||||
|
|
||||||
personas:
|
personas:
|
||||||
planner: ../personas/planner.md
|
planner: ../personas/planner.md
|
||||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||||
@ -39,20 +14,11 @@ personas:
|
|||||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||||
supervisor: ../personas/supervisor.md
|
supervisor: ../personas/supervisor.md
|
||||||
pr-commenter: ../personas/pr-commenter.md
|
pr-commenter: ../personas/pr-commenter.md
|
||||||
|
|
||||||
instructions:
|
instructions:
|
||||||
review-arch: ../instructions/review-arch.md
|
review-arch: ../instructions/review-arch.md
|
||||||
review-security: ../instructions/review-security.md
|
review-security: ../instructions/review-security.md
|
||||||
review-ai: ../instructions/review-ai.md
|
review-ai: ../instructions/review-ai.md
|
||||||
|
|
||||||
output_contracts:
|
|
||||||
architecture-review: ../output-contracts/architecture-review.md
|
|
||||||
security-review: ../output-contracts/security-review.md
|
|
||||||
ai-review: ../output-contracts/ai-review.md
|
|
||||||
review-summary: ../output-contracts/review-summary.md
|
|
||||||
|
|
||||||
initial_movement: plan
|
initial_movement: plan
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
- name: plan
|
- name: plan
|
||||||
edit: false
|
edit: false
|
||||||
@ -88,7 +54,6 @@ movements:
|
|||||||
|
|
||||||
**PR番号が記載されている場合**(例: "PR #42")、レビュアーが
|
**PR番号が記載されている場合**(例: "PR #42")、レビュアーが
|
||||||
PRの変更ファイルに集中できるよう計画に含めてください。
|
PRの変更ファイルに集中できるよう計画に含めてください。
|
||||||
|
|
||||||
- name: reviewers
|
- name: reviewers
|
||||||
parallel:
|
parallel:
|
||||||
- name: arch-review
|
- name: arch-review
|
||||||
@ -96,73 +61,65 @@ movements:
|
|||||||
persona: architecture-reviewer
|
persona: architecture-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
report:
|
|
||||||
name: 01-architect-review.md
|
|
||||||
format: architecture-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
|
output_contracts:
|
||||||
|
- name: 01-architect-review.md
|
||||||
|
format: architecture-review
|
||||||
- name: security-review
|
- name: security-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: security-reviewer
|
persona: security-reviewer
|
||||||
policy: review
|
policy: review
|
||||||
knowledge: security
|
knowledge: security
|
||||||
report:
|
|
||||||
name: 02-security-review.md
|
|
||||||
format: security-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-security
|
instruction: review-security
|
||||||
|
output_contracts:
|
||||||
|
- name: 02-security-review.md
|
||||||
|
format: security-review
|
||||||
- name: ai-review
|
- name: ai-review
|
||||||
edit: false
|
edit: false
|
||||||
persona: ai-antipattern-reviewer
|
persona: ai-antipattern-reviewer
|
||||||
policy:
|
policy:
|
||||||
- review
|
- review
|
||||||
- ai-antipattern
|
- ai-antipattern
|
||||||
report:
|
|
||||||
name: 03-ai-review.md
|
|
||||||
format: ai-review
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
- Grep
|
- Grep
|
||||||
|
|
||||||
- WebSearch
|
- WebSearch
|
||||||
- WebFetch
|
- WebFetch
|
||||||
rules:
|
rules:
|
||||||
- condition: approved
|
- condition: approved
|
||||||
- condition: needs_fix
|
- condition: needs_fix
|
||||||
instruction: review-ai
|
instruction: review-ai
|
||||||
|
output_contracts:
|
||||||
|
- name: 03-ai-review.md
|
||||||
|
format: ai-review
|
||||||
rules:
|
rules:
|
||||||
- condition: all("approved")
|
- condition: all("approved")
|
||||||
next: supervise
|
next: supervise
|
||||||
- condition: any("needs_fix")
|
- condition: any("needs_fix")
|
||||||
next: supervise
|
next: supervise
|
||||||
|
|
||||||
- name: supervise
|
- name: supervise
|
||||||
edit: false
|
edit: false
|
||||||
persona: supervisor
|
persona: supervisor
|
||||||
policy: review
|
policy: review
|
||||||
report:
|
|
||||||
- Review Summary: 04-review-summary.md
|
|
||||||
allowed_tools:
|
allowed_tools:
|
||||||
- Read
|
- Read
|
||||||
- Glob
|
- Glob
|
||||||
@ -218,7 +175,8 @@ movements:
|
|||||||
## 改善提案
|
## 改善提案
|
||||||
- {全レビューからの統合提案}
|
- {全レビューからの統合提案}
|
||||||
```
|
```
|
||||||
|
output_contracts:
|
||||||
|
- Review Summary: 04-review-summary.md
|
||||||
- name: pr-comment
|
- name: pr-comment
|
||||||
edit: false
|
edit: false
|
||||||
persona: pr-commenter
|
persona: pr-commenter
|
||||||
@ -269,3 +227,8 @@ movements:
|
|||||||
---
|
---
|
||||||
*[takt](https://github.com/toruticas/takt) review-only ピースで生成*
|
*[takt](https://github.com/toruticas/takt) review-only ピースで生成*
|
||||||
```
|
```
|
||||||
|
report_formats:
|
||||||
|
architecture-review: ../output-contracts/architecture-review.md
|
||||||
|
security-review: ../output-contracts/security-review.md
|
||||||
|
ai-review: ../output-contracts/ai-review.md
|
||||||
|
review-summary: ../output-contracts/review-summary.md
|
||||||
|
|||||||
@ -20,7 +20,7 @@ personas: # ペルソナ定義(任意)
|
|||||||
instructions: # 指示テンプレート定義(任意)
|
instructions: # 指示テンプレート定義(任意)
|
||||||
plan: ../instructions/plan.md
|
plan: ../instructions/plan.md
|
||||||
implement: ../instructions/implement.md
|
implement: ../instructions/implement.md
|
||||||
output_contracts: # 出力契約定義(任意)
|
report_formats: # レポートフォーマット定義(任意)
|
||||||
plan: ../output-contracts/plan.md
|
plan: ../output-contracts/plan.md
|
||||||
review: ../output-contracts/architecture-review.md
|
review: ../output-contracts/architecture-review.md
|
||||||
knowledge: # ナレッジ定義(任意)
|
knowledge: # ナレッジ定義(任意)
|
||||||
@ -57,7 +57,8 @@ movement 内では**キー名**で参照する(パスを直接書かない)
|
|||||||
allowed_tools: [...] # 許可ツール一覧(任意、参考情報)
|
allowed_tools: [...] # 許可ツール一覧(任意、参考情報)
|
||||||
instruction_template: | # インライン指示テンプレート(instruction キーの代替、任意)
|
instruction_template: | # インライン指示テンプレート(instruction キーの代替、任意)
|
||||||
指示内容...
|
指示内容...
|
||||||
report: ... # レポート設定(任意)
|
output_contracts: [...] # 出力契約設定(任意)
|
||||||
|
quality_gates: [...] # 品質ゲート(AIへの指示、任意)
|
||||||
rules: [...] # 遷移ルール(必須)
|
rules: [...] # 遷移ルール(必須)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -74,9 +75,9 @@ movement 内では**キー名**で参照する(パスを直接書かない)
|
|||||||
knowledge: architecture
|
knowledge: architecture
|
||||||
edit: false
|
edit: false
|
||||||
instruction: review-arch
|
instruction: review-arch
|
||||||
report:
|
output_contracts:
|
||||||
name: 05-architect-review.md
|
- name: 05-architect-review.md
|
||||||
format: architecture-review
|
format: architecture-review
|
||||||
rules:
|
rules:
|
||||||
- condition: "approved"
|
- condition: "approved"
|
||||||
- condition: "needs_fix"
|
- condition: "needs_fix"
|
||||||
@ -129,39 +130,54 @@ rules:
|
|||||||
| `ABORT` | ピース失敗終了 |
|
| `ABORT` | ピース失敗終了 |
|
||||||
| movement 名 | 指定された movement に遷移 |
|
| movement 名 | 指定された movement に遷移 |
|
||||||
|
|
||||||
## Report 定義
|
## Output Contracts 定義
|
||||||
|
|
||||||
### 形式1: 単一レポート(name + format キー参照)
|
Movement の出力契約(レポート定義)。配列形式で指定する。
|
||||||
|
|
||||||
|
### 形式1: name + format(フォーマット参照)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
report:
|
output_contracts:
|
||||||
name: 01-plan.md
|
- name: 01-plan.md
|
||||||
format: plan # output_contracts マップのキーを参照
|
format: plan # report_formats マップのキーを参照
|
||||||
```
|
```
|
||||||
|
|
||||||
`format` がキー文字列の場合、トップレベル `output_contracts:` セクションから対応する .md ファイルを読み込み、出力契約指示として使用する。
|
`format` がキー文字列の場合、トップレベル `report_formats:` セクションから対応する .md ファイルを読み込み、出力契約指示として使用する。
|
||||||
|
|
||||||
### 形式1b: 単一レポート(name + format インライン)
|
### 形式1b: name + format(インライン)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
report:
|
output_contracts:
|
||||||
name: 01-plan.md
|
- name: 01-plan.md
|
||||||
format: | # インラインでフォーマットを記述
|
format: | # インラインでフォーマットを記述
|
||||||
# レポートタイトル
|
# レポートタイトル
|
||||||
## セクション
|
## セクション
|
||||||
{内容}
|
{内容}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 形式2: 複数レポート(配列)
|
### 形式2: label + path(ラベル付きパス)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
report:
|
output_contracts:
|
||||||
- Summary: summary.md
|
- Summary: summary.md
|
||||||
- Scope: 01-scope.md
|
- Scope: 01-scope.md
|
||||||
- Decisions: 02-decisions.md
|
- Decisions: 02-decisions.md
|
||||||
```
|
```
|
||||||
|
|
||||||
各要素のキーがレポート種別名、値がファイル名。
|
各要素のキーがレポート種別名(ラベル)、値がファイル名。
|
||||||
|
|
||||||
|
## Quality Gates 定義
|
||||||
|
|
||||||
|
Movement 完了時の品質要件を AI への指示として定義する。自動検証は行わない。
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
quality_gates:
|
||||||
|
- 全てのテストがパスすること
|
||||||
|
- TypeScript の型エラーがないこと
|
||||||
|
- ESLint 違反がないこと
|
||||||
|
```
|
||||||
|
|
||||||
|
配列で複数の品質基準を指定できる。エージェントはこれらの基準を満たしてから Movement を完了する必要がある。
|
||||||
|
|
||||||
## テンプレート変数
|
## テンプレート変数
|
||||||
|
|
||||||
|
|||||||
@ -350,7 +350,7 @@ instructions:
|
|||||||
knowledge:
|
knowledge:
|
||||||
architecture: ../knowledge/architecture.md
|
architecture: ../knowledge/architecture.md
|
||||||
|
|
||||||
output_contracts:
|
report_formats:
|
||||||
review: ../output-contracts/review.md
|
review: ../output-contracts/review.md
|
||||||
|
|
||||||
movements:
|
movements:
|
||||||
@ -369,9 +369,9 @@ movements:
|
|||||||
policy: review # 異なる RULES
|
policy: review # 異なる RULES
|
||||||
instruction: review # 異なる WHAT(共有も可能)
|
instruction: review # 異なる WHAT(共有も可能)
|
||||||
knowledge: architecture # 同じ CONTEXT — 再利用
|
knowledge: architecture # 同じ CONTEXT — 再利用
|
||||||
report:
|
output_contracts:
|
||||||
name: review.md
|
- name: review.md
|
||||||
format: review # OUTPUT — output_contracts.review を参照
|
format: review # OUTPUT — report_formats.review を参照
|
||||||
edit: false
|
edit: false
|
||||||
rules:
|
rules:
|
||||||
- condition: Approved
|
- condition: Approved
|
||||||
|
|||||||
@ -146,15 +146,15 @@ describe('default piece parallel reviewers movement', () => {
|
|||||||
expect(qaReview.persona).toContain('qa-reviewer');
|
expect(qaReview.persona).toContain('qa-reviewer');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have reports configured on sub-movements', () => {
|
it('should have output contracts configured on sub-movements', () => {
|
||||||
const piece = getBuiltinPiece('default');
|
const piece = getBuiltinPiece('default');
|
||||||
const reviewersMovement = piece!.movements.find((s) => s.name === 'reviewers')!;
|
const reviewersMovement = piece!.movements.find((s) => s.name === 'reviewers')!;
|
||||||
|
|
||||||
const archReview = reviewersMovement.parallel!.find((s) => s.name === 'arch-review')!;
|
const archReview = reviewersMovement.parallel!.find((s) => s.name === 'arch-review')!;
|
||||||
expect(archReview.report).toBeDefined();
|
expect(archReview.outputContracts).toBeDefined();
|
||||||
|
|
||||||
const qaReview = reviewersMovement.parallel!.find((s) => s.name === 'qa-review')!;
|
const qaReview = reviewersMovement.parallel!.find((s) => s.name === 'qa-review')!;
|
||||||
expect(qaReview.report).toBeDefined();
|
expect(qaReview.outputContracts).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@ import { join } from 'node:path';
|
|||||||
import { tmpdir } from 'node:os';
|
import { tmpdir } from 'node:os';
|
||||||
import { EventEmitter } from 'node:events';
|
import { EventEmitter } from 'node:events';
|
||||||
import { existsSync } from 'node:fs';
|
import { existsSync } from 'node:fs';
|
||||||
import { isReportObjectConfig } from '../core/piece/index.js';
|
import { isOutputContractItem } from '../core/piece/index.js';
|
||||||
import type { PieceMovement, ReportObjectConfig, ReportConfig } from '../core/models/index.js';
|
import type { PieceMovement, OutputContractItem, OutputContractLabelPath, OutputContractEntry } from '../core/models/index.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracted emitMovementReports logic for unit testing.
|
* Extracted emitMovementReports logic for unit testing.
|
||||||
@ -23,17 +23,12 @@ function emitMovementReports(
|
|||||||
reportDir: string,
|
reportDir: string,
|
||||||
projectCwd: string,
|
projectCwd: string,
|
||||||
): void {
|
): void {
|
||||||
if (!movement.report || !reportDir) return;
|
if (!movement.outputContracts || movement.outputContracts.length === 0 || !reportDir) return;
|
||||||
const baseDir = join(projectCwd, reportDir);
|
const baseDir = join(projectCwd, reportDir);
|
||||||
|
|
||||||
if (typeof movement.report === 'string') {
|
for (const entry of movement.outputContracts) {
|
||||||
emitIfReportExists(emitter, movement, baseDir, movement.report);
|
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||||
} else if (isReportObjectConfig(movement.report)) {
|
emitIfReportExists(emitter, movement, baseDir, fileName);
|
||||||
emitIfReportExists(emitter, movement, baseDir, movement.report.name);
|
|
||||||
} else {
|
|
||||||
for (const rc of movement.report) {
|
|
||||||
emitIfReportExists(emitter, movement, baseDir, rc.path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,9 +72,10 @@ describe('emitMovementReports', () => {
|
|||||||
rmSync(tmpDir, { recursive: true, force: true });
|
rmSync(tmpDir, { recursive: true, force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit movement:report when string report file exists', () => {
|
it('should emit movement:report when output contract file exists', () => {
|
||||||
// Given: a movement with string report and the file exists
|
// Given: a movement with output contract and the file exists
|
||||||
const movement = createMovement({ report: 'plan.md' });
|
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||||
|
const movement = createMovement({ outputContracts });
|
||||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const handler = vi.fn();
|
const handler = vi.fn();
|
||||||
@ -93,9 +89,10 @@ describe('emitMovementReports', () => {
|
|||||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, 'plan.md'), 'plan.md');
|
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, 'plan.md'), 'plan.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not emit when string report file does not exist', () => {
|
it('should not emit when output contract file does not exist', () => {
|
||||||
// Given: a movement with string report but file doesn't exist
|
// Given: a movement with output contract but file doesn't exist
|
||||||
const movement = createMovement({ report: 'missing.md' });
|
const outputContracts: OutputContractEntry[] = [{ name: 'missing.md' }];
|
||||||
|
const movement = createMovement({ outputContracts });
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const handler = vi.fn();
|
const handler = vi.fn();
|
||||||
emitter.on('movement:report', handler);
|
emitter.on('movement:report', handler);
|
||||||
@ -107,10 +104,10 @@ describe('emitMovementReports', () => {
|
|||||||
expect(handler).not.toHaveBeenCalled();
|
expect(handler).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit movement:report when ReportObjectConfig report file exists', () => {
|
it('should emit movement:report when OutputContractItem file exists', () => {
|
||||||
// Given: a movement with ReportObjectConfig and the file exists
|
// Given: a movement with OutputContractItem and the file exists
|
||||||
const report: ReportObjectConfig = { name: '03-review.md', format: '# Review' };
|
const outputContracts: OutputContractEntry[] = [{ name: '03-review.md', format: '# Review' }];
|
||||||
const movement = createMovement({ report });
|
const movement = createMovement({ outputContracts });
|
||||||
writeFileSync(join(reportBaseDir, '03-review.md'), '# Review\nOK', 'utf-8');
|
writeFileSync(join(reportBaseDir, '03-review.md'), '# Review\nOK', 'utf-8');
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const handler = vi.fn();
|
const handler = vi.fn();
|
||||||
@ -124,14 +121,14 @@ describe('emitMovementReports', () => {
|
|||||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '03-review.md'), '03-review.md');
|
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '03-review.md'), '03-review.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit for each existing file in ReportConfig[] array', () => {
|
it('should emit for each existing file in output contracts array', () => {
|
||||||
// Given: a movement with array report, two files exist, one missing
|
// Given: a movement with array output contracts, two files exist, one missing
|
||||||
const report: ReportConfig[] = [
|
const outputContracts: OutputContractEntry[] = [
|
||||||
{ label: 'Scope', path: '01-scope.md' },
|
{ label: 'Scope', path: '01-scope.md' },
|
||||||
{ label: 'Decisions', path: '02-decisions.md' },
|
{ label: 'Decisions', path: '02-decisions.md' },
|
||||||
{ label: 'Missing', path: '03-missing.md' },
|
{ label: 'Missing', path: '03-missing.md' },
|
||||||
];
|
];
|
||||||
const movement = createMovement({ report });
|
const movement = createMovement({ outputContracts });
|
||||||
writeFileSync(join(reportBaseDir, '01-scope.md'), '# Scope', 'utf-8');
|
writeFileSync(join(reportBaseDir, '01-scope.md'), '# Scope', 'utf-8');
|
||||||
writeFileSync(join(reportBaseDir, '02-decisions.md'), '# Decisions', 'utf-8');
|
writeFileSync(join(reportBaseDir, '02-decisions.md'), '# Decisions', 'utf-8');
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
@ -147,9 +144,9 @@ describe('emitMovementReports', () => {
|
|||||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '02-decisions.md'), '02-decisions.md');
|
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '02-decisions.md'), '02-decisions.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not emit when movement has no report', () => {
|
it('should not emit when movement has no output contracts', () => {
|
||||||
// Given: a movement without report
|
// Given: a movement without output contracts
|
||||||
const movement = createMovement({ report: undefined });
|
const movement = createMovement({ outputContracts: undefined });
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const handler = vi.fn();
|
const handler = vi.fn();
|
||||||
emitter.on('movement:report', handler);
|
emitter.on('movement:report', handler);
|
||||||
@ -162,8 +159,9 @@ describe('emitMovementReports', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should not emit when reportDir is empty', () => {
|
it('should not emit when reportDir is empty', () => {
|
||||||
// Given: a movement with report but empty reportDir
|
// Given: a movement with output contracts but empty reportDir
|
||||||
const movement = createMovement({ report: 'plan.md' });
|
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||||
|
const movement = createMovement({ outputContracts });
|
||||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const handler = vi.fn();
|
const handler = vi.fn();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ function buildSimpleConfig(): PieceConfig {
|
|||||||
initialMovement: 'review',
|
initialMovement: 'review',
|
||||||
movements: [
|
movements: [
|
||||||
makeMovement('review', {
|
makeMovement('review', {
|
||||||
report: '00-review.md',
|
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||||
rules: [
|
rules: [
|
||||||
makeRule('approved', 'COMPLETE'),
|
makeRule('approved', 'COMPLETE'),
|
||||||
],
|
],
|
||||||
@ -138,7 +138,7 @@ describe('PieceEngine: worktree reportDir resolution', () => {
|
|||||||
movements: [
|
movements: [
|
||||||
makeMovement('review', {
|
makeMovement('review', {
|
||||||
instructionTemplate: 'Write report to {report_dir}',
|
instructionTemplate: 'Write report to {report_dir}',
|
||||||
report: '00-review.md',
|
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||||
rules: [
|
rules: [
|
||||||
makeRule('approved', 'COMPLETE'),
|
makeRule('approved', 'COMPLETE'),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import {
|
import {
|
||||||
InstructionBuilder,
|
InstructionBuilder,
|
||||||
isReportObjectConfig,
|
isOutputContractItem,
|
||||||
ReportInstructionBuilder,
|
ReportInstructionBuilder,
|
||||||
StatusJudgmentBuilder,
|
StatusJudgmentBuilder,
|
||||||
generateStatusRulesComponents,
|
generateStatusRulesComponents,
|
||||||
@ -378,7 +378,7 @@ describe('instruction-builder', () => {
|
|||||||
it('should include report info in Phase 1 when step has report', () => {
|
it('should include report info in Phase 1 when step has report', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.name = 'plan';
|
step.name = 'plan';
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const context = createMinimalContext({
|
const context = createMinimalContext({
|
||||||
reportDir: '/project/.takt/reports/20260129-test',
|
reportDir: '/project/.takt/reports/20260129-test',
|
||||||
language: 'en',
|
language: 'en',
|
||||||
@ -392,9 +392,9 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).toContain('Phase 1');
|
expect(result).toContain('Phase 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include report info for ReportConfig[] in Phase 1', () => {
|
it('should include report info for OutputContractEntry[] in Phase 1', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = [
|
step.outputContracts = [
|
||||||
{ label: 'Scope', path: '01-scope.md' },
|
{ label: 'Scope', path: '01-scope.md' },
|
||||||
{ label: 'Decisions', path: '02-decisions.md' },
|
{ label: 'Decisions', path: '02-decisions.md' },
|
||||||
];
|
];
|
||||||
@ -410,9 +410,9 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).toContain('Phase 1');
|
expect(result).toContain('Phase 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include report info for ReportObjectConfig in Phase 1', () => {
|
it('should include report info for OutputContractItem in Phase 1', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = { name: '00-plan.md' };
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const context = createMinimalContext({
|
const context = createMinimalContext({
|
||||||
reportDir: '/project/.takt/reports/20260129-test',
|
reportDir: '/project/.takt/reports/20260129-test',
|
||||||
language: 'en',
|
language: 'en',
|
||||||
@ -557,7 +557,7 @@ describe('instruction-builder', () => {
|
|||||||
describe('buildInstruction report-free (phase separation)', () => {
|
describe('buildInstruction report-free (phase separation)', () => {
|
||||||
it('should include Report Directory info but NOT report output instruction in Phase 1', () => {
|
it('should include Report Directory info but NOT report output instruction in Phase 1', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const context = createMinimalContext({
|
const context = createMinimalContext({
|
||||||
reportDir: '/project/.takt/reports/20260129-test',
|
reportDir: '/project/.takt/reports/20260129-test',
|
||||||
language: 'en',
|
language: 'en',
|
||||||
@ -577,7 +577,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should NOT include output contract in buildInstruction', () => {
|
it('should NOT include output contract in buildInstruction', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = { name: '00-plan.md', format: '**Format:**\n# Plan' };
|
step.outputContracts = [{ name: '00-plan.md', format: '**Format:**\n# Plan' }];
|
||||||
const context = createMinimalContext({
|
const context = createMinimalContext({
|
||||||
reportDir: '/project/.takt/reports/20260129-test',
|
reportDir: '/project/.takt/reports/20260129-test',
|
||||||
language: 'en',
|
language: 'en',
|
||||||
@ -590,10 +590,10 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should NOT include report order in buildInstruction', () => {
|
it('should NOT include report order in buildInstruction', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = {
|
step.outputContracts = [{
|
||||||
name: '00-plan.md',
|
name: '00-plan.md',
|
||||||
order: 'Custom order instruction',
|
order: 'Custom order instruction',
|
||||||
};
|
}];
|
||||||
const context = createMinimalContext({
|
const context = createMinimalContext({
|
||||||
reportDir: '/project/.takt/reports/20260129-test',
|
reportDir: '/project/.takt/reports/20260129-test',
|
||||||
language: 'en',
|
language: 'en',
|
||||||
@ -631,7 +631,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include execution context with working directory', () => {
|
it('should include execution context with working directory', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext({ cwd: '/my/project' });
|
const ctx = createReportContext({ cwd: '/my/project' });
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -641,7 +641,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include no-source-edit rule in execution rules', () => {
|
it('should include no-source-edit rule in execution rules', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -651,7 +651,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include no-commit and no-cd rules', () => {
|
it('should include no-commit and no-cd rules', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -662,7 +662,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include report directory and file for string report', () => {
|
it('should include report directory and file for string report', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext({ reportDir: '/project/.takt/reports/20260130-test' });
|
const ctx = createReportContext({ reportDir: '/project/.takt/reports/20260130-test' });
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -671,9 +671,9 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).toContain('- Report File: /project/.takt/reports/20260130-test/00-plan.md');
|
expect(result).toContain('- Report File: /project/.takt/reports/20260130-test/00-plan.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include report files for ReportConfig[] report', () => {
|
it('should include report files for OutputContractEntry[] report', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = [
|
step.outputContracts = [
|
||||||
{ label: 'Scope', path: '01-scope.md' },
|
{ label: 'Scope', path: '01-scope.md' },
|
||||||
{ label: 'Decisions', path: '02-decisions.md' },
|
{ label: 'Decisions', path: '02-decisions.md' },
|
||||||
];
|
];
|
||||||
@ -687,9 +687,9 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).toContain(' - Decisions: /project/.takt/reports/20260129-test/02-decisions.md');
|
expect(result).toContain(' - Decisions: /project/.takt/reports/20260129-test/02-decisions.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include report file for ReportObjectConfig report', () => {
|
it('should include report file for OutputContractItem report', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = { name: '00-plan.md' };
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -699,7 +699,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include auto-generated report output instruction', () => {
|
it('should include auto-generated report output instruction', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -711,10 +711,10 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include explicit order instead of auto-generated', () => {
|
it('should include explicit order instead of auto-generated', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = {
|
step.outputContracts = [{
|
||||||
name: '00-plan.md',
|
name: '00-plan.md',
|
||||||
order: 'Output to {report:00-plan.md} file.',
|
order: 'Output to {report:00-plan.md} file.',
|
||||||
};
|
}];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -723,12 +723,12 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).not.toContain('**Report output:**');
|
expect(result).not.toContain('**Report output:**');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include format from ReportObjectConfig', () => {
|
it('should include format from OutputContractItem', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = {
|
step.outputContracts = [{
|
||||||
name: '00-plan.md',
|
name: '00-plan.md',
|
||||||
format: '**Format:**\n```markdown\n# Plan\n```',
|
format: '**Format:**\n```markdown\n# Plan\n```',
|
||||||
};
|
}];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -739,7 +739,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should replace {movement_iteration} in report output instruction', () => {
|
it('should replace {movement_iteration} in report output instruction', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext({ movementIteration: 5 });
|
const ctx = createReportContext({ movementIteration: 5 });
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -749,7 +749,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should include instruction body text', () => {
|
it('should include instruction body text', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -760,7 +760,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should NOT include user request, previous response, or status rules', () => {
|
it('should NOT include user request, previous response, or status rules', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = '00-plan.md';
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
step.rules = [
|
step.rules = [
|
||||||
{ condition: 'Done', next: 'COMPLETE' },
|
{ condition: 'Done', next: 'COMPLETE' },
|
||||||
];
|
];
|
||||||
@ -776,7 +776,7 @@ describe('instruction-builder', () => {
|
|||||||
|
|
||||||
it('should render Japanese report instruction', () => {
|
it('should render Japanese report instruction', () => {
|
||||||
const step = createMinimalStep('作業する');
|
const step = createMinimalStep('作業する');
|
||||||
step.report = { name: '00-plan.md' };
|
step.outputContracts = [{ name: '00-plan.md' }];
|
||||||
const ctx = createReportContext({ language: 'ja' });
|
const ctx = createReportContext({ language: 'ja' });
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -786,16 +786,19 @@ describe('instruction-builder', () => {
|
|||||||
expect(result).toContain('**レポート出力:** `Report File` に出力してください。');
|
expect(result).toContain('**レポート出力:** `Report File` に出力してください。');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw error when step has no report config', () => {
|
it('should throw error when step has no output contracts', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
expect(() => buildReportInstruction(step, ctx)).toThrow('no report config');
|
expect(() => buildReportInstruction(step, ctx)).toThrow('no output contracts');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include multi-file report output instruction for ReportConfig[]', () => {
|
it('should include multi-file report output instruction for OutputContractEntry[]', () => {
|
||||||
const step = createMinimalStep('Do work');
|
const step = createMinimalStep('Do work');
|
||||||
step.report = [{ label: 'Scope', path: '01-scope.md' }];
|
step.outputContracts = [
|
||||||
|
{ label: 'Scope', path: '01-scope.md' },
|
||||||
|
{ label: 'Decisions', path: '02-decisions.md' },
|
||||||
|
];
|
||||||
const ctx = createReportContext();
|
const ctx = createReportContext();
|
||||||
|
|
||||||
const result = buildReportInstruction(step, ctx);
|
const result = buildReportInstruction(step, ctx);
|
||||||
@ -1025,21 +1028,17 @@ describe('instruction-builder', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isReportObjectConfig', () => {
|
describe('isOutputContractItem', () => {
|
||||||
it('should return true for ReportObjectConfig', () => {
|
it('should return true for OutputContractItem', () => {
|
||||||
expect(isReportObjectConfig({ name: '00-plan.md' })).toBe(true);
|
expect(isOutputContractItem({ name: '00-plan.md' })).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true for ReportObjectConfig with order/format', () => {
|
it('should return true for OutputContractItem with order/format', () => {
|
||||||
expect(isReportObjectConfig({ name: '00-plan.md', order: 'output to...', format: '# Plan' })).toBe(true);
|
expect(isOutputContractItem({ name: '00-plan.md', order: 'output to...', format: '# Plan' })).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false for string', () => {
|
it('should return false for OutputContractLabelPath', () => {
|
||||||
expect(isReportObjectConfig('00-plan.md')).toBe(false);
|
expect(isOutputContractItem({ label: 'Scope', path: '01-scope.md' })).toBe(false);
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false for ReportConfig[] (array)', () => {
|
|
||||||
expect(isReportObjectConfig([{ label: 'Scope', path: '01-scope.md' }])).toBe(false);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -284,7 +284,7 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
|||||||
it('should build report instruction with report context', () => {
|
it('should build report instruction with report context', () => {
|
||||||
const step = makeMovement({
|
const step = makeMovement({
|
||||||
name: 'plan',
|
name: 'plan',
|
||||||
report: { name: '00-plan.md', format: '# Plan\n{movement_iteration}' },
|
outputContracts: [{ name: '00-plan.md', format: '# Plan\n{movement_iteration}' }],
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = buildReportInstruction(step, {
|
const result = buildReportInstruction(step, {
|
||||||
@ -299,8 +299,8 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
|||||||
expect(result).toContain('report');
|
expect(result).toContain('report');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw for step without report config', () => {
|
it('should throw for step without output contracts', () => {
|
||||||
const step = makeMovement({ report: undefined });
|
const step = makeMovement({ outputContracts: undefined });
|
||||||
|
|
||||||
expect(() =>
|
expect(() =>
|
||||||
buildReportInstruction(step, {
|
buildReportInstruction(step, {
|
||||||
@ -308,7 +308,7 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
|||||||
reportDir: '/tmp/reports',
|
reportDir: '/tmp/reports',
|
||||||
movementIteration: 1,
|
movementIteration: 1,
|
||||||
}),
|
}),
|
||||||
).toThrow(/no report config/);
|
).toThrow(/no output contracts/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -338,6 +338,44 @@ describe('Instruction Builder IT: buildStatusJudgmentInstruction', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Instruction Builder IT: quality gates injection', () => {
|
||||||
|
it('should inject quality gates section when qualityGates is defined', () => {
|
||||||
|
const step = makeMovement({
|
||||||
|
qualityGates: [
|
||||||
|
'All tests must pass',
|
||||||
|
'No TypeScript errors',
|
||||||
|
'No ESLint violations',
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const ctx = makeContext();
|
||||||
|
|
||||||
|
const result = buildInstruction(step, ctx);
|
||||||
|
|
||||||
|
expect(result).toContain('## Quality Gates');
|
||||||
|
expect(result).toContain('- All tests must pass');
|
||||||
|
expect(result).toContain('- No TypeScript errors');
|
||||||
|
expect(result).toContain('- No ESLint violations');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should NOT inject quality gates section when qualityGates is undefined', () => {
|
||||||
|
const step = makeMovement({ qualityGates: undefined });
|
||||||
|
const ctx = makeContext();
|
||||||
|
|
||||||
|
const result = buildInstruction(step, ctx);
|
||||||
|
|
||||||
|
expect(result).not.toContain('## Quality Gates');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should NOT inject quality gates section when qualityGates is empty', () => {
|
||||||
|
const step = makeMovement({ qualityGates: [] });
|
||||||
|
const ctx = makeContext();
|
||||||
|
|
||||||
|
const result = buildInstruction(step, ctx);
|
||||||
|
|
||||||
|
expect(result).not.toContain('## Quality Gates');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Instruction Builder IT: template injection prevention', () => {
|
describe('Instruction Builder IT: template injection prevention', () => {
|
||||||
it('should escape curly braces in task content', () => {
|
it('should escape curly braces in task content', () => {
|
||||||
const step = makeMovement();
|
const step = makeMovement();
|
||||||
|
|||||||
@ -324,22 +324,126 @@ describe('Piece Loader IT: report config loading', () => {
|
|||||||
const config = loadPiece('default', testDir);
|
const config = loadPiece('default', testDir);
|
||||||
expect(config).not.toBeNull();
|
expect(config).not.toBeNull();
|
||||||
|
|
||||||
// default piece: plan movement has a report config
|
// default piece: plan movement has output contracts
|
||||||
const planStep = config!.movements.find((s) => s.name === 'plan');
|
const planStep = config!.movements.find((s) => s.name === 'plan');
|
||||||
expect(planStep).toBeDefined();
|
expect(planStep).toBeDefined();
|
||||||
expect(planStep!.report).toBeDefined();
|
expect(planStep!.outputContracts).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load multi-report config from expert piece', () => {
|
it('should load multi-report config from expert piece', () => {
|
||||||
const config = loadPiece('expert', testDir);
|
const config = loadPiece('expert', testDir);
|
||||||
expect(config).not.toBeNull();
|
expect(config).not.toBeNull();
|
||||||
|
|
||||||
// implement movement has multi-report: [Scope, Decisions]
|
// implement movement has multi-output contracts: [Scope, Decisions]
|
||||||
const implementStep = config!.movements.find((s) => s.name === 'implement');
|
const implementStep = config!.movements.find((s) => s.name === 'implement');
|
||||||
expect(implementStep).toBeDefined();
|
expect(implementStep).toBeDefined();
|
||||||
expect(implementStep!.report).toBeDefined();
|
expect(implementStep!.outputContracts).toBeDefined();
|
||||||
expect(Array.isArray(implementStep!.report)).toBe(true);
|
expect(Array.isArray(implementStep!.outputContracts)).toBe(true);
|
||||||
expect((implementStep!.report as unknown[]).length).toBe(2);
|
expect((implementStep!.outputContracts as unknown[]).length).toBe(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Piece Loader IT: quality_gates loading', () => {
|
||||||
|
let testDir: string;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
testDir = createTestDir();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
rmSync(testDir, { recursive: true, force: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should parse quality_gates from YAML', () => {
|
||||||
|
const piecesDir = join(testDir, '.takt', 'pieces');
|
||||||
|
mkdirSync(piecesDir, { recursive: true });
|
||||||
|
|
||||||
|
writeFileSync(join(piecesDir, 'with-gates.yaml'), `
|
||||||
|
name: with-gates
|
||||||
|
description: Piece with quality gates
|
||||||
|
max_iterations: 5
|
||||||
|
initial_movement: implement
|
||||||
|
|
||||||
|
movements:
|
||||||
|
- name: implement
|
||||||
|
persona: coder
|
||||||
|
edit: true
|
||||||
|
quality_gates:
|
||||||
|
- "All tests must pass"
|
||||||
|
- "No TypeScript errors"
|
||||||
|
- "Coverage must be above 80%"
|
||||||
|
rules:
|
||||||
|
- condition: Done
|
||||||
|
next: COMPLETE
|
||||||
|
instruction: "Implement the feature"
|
||||||
|
`);
|
||||||
|
|
||||||
|
const config = loadPiece('with-gates', testDir);
|
||||||
|
|
||||||
|
expect(config).not.toBeNull();
|
||||||
|
const implementStep = config!.movements.find((s) => s.name === 'implement');
|
||||||
|
expect(implementStep).toBeDefined();
|
||||||
|
expect(implementStep!.qualityGates).toBeDefined();
|
||||||
|
expect(implementStep!.qualityGates).toEqual([
|
||||||
|
'All tests must pass',
|
||||||
|
'No TypeScript errors',
|
||||||
|
'Coverage must be above 80%',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow movement without quality_gates', () => {
|
||||||
|
const piecesDir = join(testDir, '.takt', 'pieces');
|
||||||
|
mkdirSync(piecesDir, { recursive: true });
|
||||||
|
|
||||||
|
writeFileSync(join(piecesDir, 'no-gates.yaml'), `
|
||||||
|
name: no-gates
|
||||||
|
description: Piece without quality gates
|
||||||
|
max_iterations: 5
|
||||||
|
initial_movement: implement
|
||||||
|
|
||||||
|
movements:
|
||||||
|
- name: implement
|
||||||
|
persona: coder
|
||||||
|
rules:
|
||||||
|
- condition: Done
|
||||||
|
next: COMPLETE
|
||||||
|
instruction: "Implement the feature"
|
||||||
|
`);
|
||||||
|
|
||||||
|
const config = loadPiece('no-gates', testDir);
|
||||||
|
|
||||||
|
expect(config).not.toBeNull();
|
||||||
|
const implementStep = config!.movements.find((s) => s.name === 'implement');
|
||||||
|
expect(implementStep).toBeDefined();
|
||||||
|
expect(implementStep!.qualityGates).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow empty quality_gates array', () => {
|
||||||
|
const piecesDir = join(testDir, '.takt', 'pieces');
|
||||||
|
mkdirSync(piecesDir, { recursive: true });
|
||||||
|
|
||||||
|
writeFileSync(join(piecesDir, 'empty-gates.yaml'), `
|
||||||
|
name: empty-gates
|
||||||
|
description: Piece with empty quality gates
|
||||||
|
max_iterations: 5
|
||||||
|
initial_movement: implement
|
||||||
|
|
||||||
|
movements:
|
||||||
|
- name: implement
|
||||||
|
persona: coder
|
||||||
|
quality_gates: []
|
||||||
|
rules:
|
||||||
|
- condition: Done
|
||||||
|
next: COMPLETE
|
||||||
|
instruction: "Implement the feature"
|
||||||
|
`);
|
||||||
|
|
||||||
|
const config = loadPiece('empty-gates', testDir);
|
||||||
|
|
||||||
|
expect(config).not.toBeNull();
|
||||||
|
const implementStep = config!.movements.find((s) => s.name === 'implement');
|
||||||
|
expect(implementStep).toBeDefined();
|
||||||
|
expect(implementStep!.qualityGates).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ function makeMovement(
|
|||||||
name: string,
|
name: string,
|
||||||
agentPath: string,
|
agentPath: string,
|
||||||
rules: PieceRule[],
|
rules: PieceRule[],
|
||||||
options: { report?: string | { label: string; path: string }[]; edit?: boolean } = {},
|
options: { outputContracts?: { label: string; path: string }[]; edit?: boolean } = {},
|
||||||
): PieceMovement {
|
): PieceMovement {
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
@ -98,7 +98,7 @@ function makeMovement(
|
|||||||
instructionTemplate: '{task}',
|
instructionTemplate: '{task}',
|
||||||
passPreviousResponse: true,
|
passPreviousResponse: true,
|
||||||
rules,
|
rules,
|
||||||
report: options.report,
|
outputContracts: options.outputContracts,
|
||||||
edit: options.edit,
|
edit: options.edit,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ describe('Three-Phase Execution IT: phase1 + phase2 (report defined)', () => {
|
|||||||
makeMovement('step', agentPath, [
|
makeMovement('step', agentPath, [
|
||||||
makeRule('Done', 'COMPLETE'),
|
makeRule('Done', 'COMPLETE'),
|
||||||
makeRule('Not done', 'ABORT'),
|
makeRule('Not done', 'ABORT'),
|
||||||
], { report: 'test-report.md' }),
|
], { outputContracts: [{ label: 'test', path: 'test-report.md' }] }),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ describe('Three-Phase Execution IT: phase1 + phase2 (report defined)', () => {
|
|||||||
movements: [
|
movements: [
|
||||||
makeMovement('step', agentPath, [
|
makeMovement('step', agentPath, [
|
||||||
makeRule('Done', 'COMPLETE'),
|
makeRule('Done', 'COMPLETE'),
|
||||||
], { report: [{ label: 'Scope', path: 'scope.md' }, { label: 'Decisions', path: 'decisions.md' }] }),
|
], { outputContracts: [{ label: 'Scope', path: 'scope.md' }, { label: 'Decisions', path: 'decisions.md' }] }),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ describe('Three-Phase Execution IT: all three phases', () => {
|
|||||||
makeMovement('step', agentPath, [
|
makeMovement('step', agentPath, [
|
||||||
makeRule('Done', 'COMPLETE'),
|
makeRule('Done', 'COMPLETE'),
|
||||||
makeRule('Not done', 'ABORT'),
|
makeRule('Not done', 'ABORT'),
|
||||||
], { report: 'test-report.md' }),
|
], { outputContracts: [{ label: 'test', path: 'test-report.md' }] }),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -69,13 +69,13 @@ describe('JudgmentStrategies', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('ReportBasedStrategy', () => {
|
describe('ReportBasedStrategy', () => {
|
||||||
it('should apply when reportDir and report files are configured', () => {
|
it('should apply when reportDir and output contracts are configured', () => {
|
||||||
const strategy = new ReportBasedStrategy();
|
const strategy = new ReportBasedStrategy();
|
||||||
const stepWithReport: PieceMovement = {
|
const stepWithOutputContracts: PieceMovement = {
|
||||||
...mockStep,
|
...mockStep,
|
||||||
report: 'review-report.md',
|
outputContracts: [{ label: 'review', path: 'review-report.md' }],
|
||||||
};
|
};
|
||||||
expect(strategy.canApply({ ...mockContext, step: stepWithReport })).toBe(true);
|
expect(strategy.canApply({ ...mockContext, step: stepWithOutputContracts })).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not apply when reportDir is missing', () => {
|
it('should not apply when reportDir is missing', () => {
|
||||||
@ -83,9 +83,9 @@ describe('JudgmentStrategies', () => {
|
|||||||
expect(strategy.canApply({ ...mockContext, reportDir: undefined })).toBe(false);
|
expect(strategy.canApply({ ...mockContext, reportDir: undefined })).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not apply when step has no report files configured', () => {
|
it('should not apply when step has no output contracts configured', () => {
|
||||||
const strategy = new ReportBasedStrategy();
|
const strategy = new ReportBasedStrategy();
|
||||||
// mockStep has no report field → getReportFiles returns []
|
// mockStep has no outputContracts field → getReportFiles returns []
|
||||||
expect(strategy.canApply(mockContext)).toBe(false);
|
expect(strategy.canApply(mockContext)).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -383,7 +383,7 @@ describe('InstructionBuilder policy injection', () => {
|
|||||||
expect(result).toContain('## Policy');
|
expect(result).toContain('## Policy');
|
||||||
expect(result).toContain('# Coding Policy');
|
expect(result).toContain('# Coding Policy');
|
||||||
expect(result).toContain('Write clean code.');
|
expect(result).toContain('Write clean code.');
|
||||||
expect(result).toContain('Policy Reminder');
|
expect(result).toContain('必ず遵守してください');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should inject policy content into instruction (EN)', () => {
|
it('should inject policy content into instruction (EN)', () => {
|
||||||
@ -401,7 +401,7 @@ describe('InstructionBuilder policy injection', () => {
|
|||||||
|
|
||||||
expect(result).toContain('## Policy');
|
expect(result).toContain('## Policy');
|
||||||
expect(result).toContain('Write clean code.');
|
expect(result).toContain('Write clean code.');
|
||||||
expect(result).toContain('Policy Reminder');
|
expect(result).toContain('You MUST comply');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not inject policy section when no policyContents', () => {
|
it('should not inject policy section when no policyContents', () => {
|
||||||
@ -417,7 +417,6 @@ describe('InstructionBuilder policy injection', () => {
|
|||||||
const result = builder.build();
|
const result = builder.build();
|
||||||
|
|
||||||
expect(result).not.toContain('## Policy');
|
expect(result).not.toContain('## Policy');
|
||||||
expect(result).not.toContain('Policy Reminder');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should join multiple policies with separator', () => {
|
it('should join multiple policies with separator', () => {
|
||||||
@ -549,24 +548,24 @@ describe('section reference resolution', () => {
|
|||||||
expect(config.movements[0]!.instructionTemplate).toBe('Implement the feature.');
|
expect(config.movements[0]!.instructionTemplate).toBe('Implement the feature.');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should resolve output contract from output_contracts section by name', () => {
|
it('should resolve output contract from report_formats section by name', () => {
|
||||||
const raw = {
|
const raw = {
|
||||||
name: 'test-piece',
|
name: 'test-piece',
|
||||||
output_contracts: { plan: './output-contracts/plan.md' },
|
report_formats: { plan: './output-contracts/plan.md' },
|
||||||
movements: [{
|
movements: [{
|
||||||
name: 'plan',
|
name: 'plan',
|
||||||
persona: 'planner',
|
persona: 'planner',
|
||||||
instruction: '{task}',
|
instruction: '{task}',
|
||||||
report: {
|
output_contracts: [{
|
||||||
name: '00-plan.md',
|
name: '00-plan.md',
|
||||||
format: 'plan',
|
format: 'plan',
|
||||||
},
|
}],
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
const config = normalizePieceConfig(raw, testDir);
|
const config = normalizePieceConfig(raw, testDir);
|
||||||
const report = config.movements[0]!.report as { name: string; format?: string };
|
const outputContract = config.movements[0]!.outputContracts![0] as { name: string; format?: string };
|
||||||
expect(report.format).toBe('# Plan Report\n## Goal\n{goal}');
|
expect(outputContract.format).toBe('# Plan Report\n## Goal\n{goal}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should treat unresolved name as inline value (no section match)', () => {
|
it('should treat unresolved name as inline value (no section match)', () => {
|
||||||
@ -606,7 +605,7 @@ describe('section reference resolution', () => {
|
|||||||
personas: { coder: './personas/coder.md' },
|
personas: { coder: './personas/coder.md' },
|
||||||
policies: { coding: './policies/coding.md' },
|
policies: { coding: './policies/coding.md' },
|
||||||
instructions: { implement: './instructions/implement.md' },
|
instructions: { implement: './instructions/implement.md' },
|
||||||
output_contracts: { plan: './output-contracts/plan.md' },
|
report_formats: { plan: './output-contracts/plan.md' },
|
||||||
movements: [{
|
movements: [{
|
||||||
name: 'impl',
|
name: 'impl',
|
||||||
persona: 'coder',
|
persona: 'coder',
|
||||||
@ -618,7 +617,7 @@ describe('section reference resolution', () => {
|
|||||||
expect(config.personas).toEqual({ coder: './personas/coder.md' });
|
expect(config.personas).toEqual({ coder: './personas/coder.md' });
|
||||||
expect(config.policies).toEqual({ coding: '# Coding Policy\nWrite clean code.' });
|
expect(config.policies).toEqual({ coding: '# Coding Policy\nWrite clean code.' });
|
||||||
expect(config.instructions).toEqual({ implement: 'Implement the feature.' });
|
expect(config.instructions).toEqual({ implement: 'Implement the feature.' });
|
||||||
expect(config.outputContracts).toEqual({ plan: '# Plan Report\n## Goal\n{goal}' });
|
expect(config.reportFormats).toEqual({ plan: '# Plan Report\n## Goal\n{goal}' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work with section references in parallel sub-movements', () => {
|
it('should work with section references in parallel sub-movements', () => {
|
||||||
|
|||||||
@ -4,8 +4,9 @@ export type {
|
|||||||
Status,
|
Status,
|
||||||
RuleMatchMethod,
|
RuleMatchMethod,
|
||||||
PermissionMode,
|
PermissionMode,
|
||||||
ReportConfig,
|
OutputContractLabelPath,
|
||||||
ReportObjectConfig,
|
OutputContractItem,
|
||||||
|
OutputContractEntry,
|
||||||
AgentResponse,
|
AgentResponse,
|
||||||
SessionState,
|
SessionState,
|
||||||
PieceRule,
|
PieceRule,
|
||||||
|
|||||||
@ -32,24 +32,27 @@ export interface PieceRule {
|
|||||||
aggregateConditionText?: string | string[];
|
aggregateConditionText?: string | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Report file configuration for a piece movement (label: path pair) */
|
/** Output contract configuration (label: path pair format) */
|
||||||
export interface ReportConfig {
|
export interface OutputContractLabelPath {
|
||||||
/** Display label (e.g., "Scope", "Decisions") */
|
/** Display label (e.g., "Scope", "Decisions") */
|
||||||
label: string;
|
label: string;
|
||||||
/** File path relative to report directory (e.g., "01-coder-scope.md") */
|
/** File path relative to report directory (e.g., "01-coder-scope.md") */
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Report object configuration with order/format instructions */
|
/** Output contract item configuration with order/format instructions */
|
||||||
export interface ReportObjectConfig {
|
export interface OutputContractItem {
|
||||||
/** Report file name (e.g., "00-plan.md") */
|
/** Report file name (e.g., "00-plan.md") */
|
||||||
name: string;
|
name: string;
|
||||||
/** Instruction prepended before instruction_template (e.g., output destination) */
|
/** Instruction prepended before instruction_template (e.g., output destination) */
|
||||||
order?: string;
|
order?: string;
|
||||||
/** Instruction appended after instruction_template (e.g., output format) */
|
/** Instruction appended after instruction_template (e.g., output format) - resolved from report_formats */
|
||||||
format?: string;
|
format?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Union type for output contract entries */
|
||||||
|
export type OutputContractEntry = OutputContractLabelPath | OutputContractItem;
|
||||||
|
|
||||||
/** Single movement in a piece */
|
/** Single movement in a piece */
|
||||||
export interface PieceMovement {
|
export interface PieceMovement {
|
||||||
name: string;
|
name: string;
|
||||||
@ -76,8 +79,10 @@ export interface PieceMovement {
|
|||||||
instructionTemplate: string;
|
instructionTemplate: string;
|
||||||
/** Rules for movement routing */
|
/** Rules for movement routing */
|
||||||
rules?: PieceRule[];
|
rules?: PieceRule[];
|
||||||
/** Report file configuration. Single string, array of label:path, or object with order/format. */
|
/** Output contracts for this movement (report definitions) */
|
||||||
report?: string | ReportConfig[] | ReportObjectConfig;
|
outputContracts?: OutputContractEntry[];
|
||||||
|
/** Quality gates for this movement (AI directives for completion requirements) */
|
||||||
|
qualityGates?: string[];
|
||||||
passPreviousResponse: boolean;
|
passPreviousResponse: boolean;
|
||||||
/** Sub-movements to execute in parallel. When set, this movement runs all sub-movements concurrently. */
|
/** Sub-movements to execute in parallel. When set, this movement runs all sub-movements concurrently. */
|
||||||
parallel?: PieceMovement[];
|
parallel?: PieceMovement[];
|
||||||
@ -137,8 +142,8 @@ export interface PieceConfig {
|
|||||||
knowledge?: Record<string, string>;
|
knowledge?: Record<string, string>;
|
||||||
/** Resolved instruction definitions — map of name to file content (resolved at parse time) */
|
/** Resolved instruction definitions — map of name to file content (resolved at parse time) */
|
||||||
instructions?: Record<string, string>;
|
instructions?: Record<string, string>;
|
||||||
/** Resolved output contract definitions — map of name to file content (resolved at parse time) */
|
/** Resolved report format definitions — map of name to file content (resolved at parse time) */
|
||||||
outputContracts?: Record<string, string>;
|
reportFormats?: Record<string, string>;
|
||||||
movements: PieceMovement[];
|
movements: PieceMovement[];
|
||||||
initialMovement: string;
|
initialMovement: string;
|
||||||
maxIterations: number;
|
maxIterations: number;
|
||||||
|
|||||||
@ -56,20 +56,20 @@ export const StatusSchema = z.enum([
|
|||||||
export const PermissionModeSchema = z.enum(['readonly', 'edit', 'full']);
|
export const PermissionModeSchema = z.enum(['readonly', 'edit', 'full']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report object schema (new structured format).
|
* Output contract item schema (new structured format).
|
||||||
*
|
*
|
||||||
* YAML format:
|
* YAML format:
|
||||||
* report:
|
* output_contracts:
|
||||||
* name: 00-plan.md
|
* - name: 00-plan.md
|
||||||
* order: |
|
* order: |
|
||||||
* **レポート出力:** {report:00-plan.md} に出力してください。
|
* **レポート出力:** {report:00-plan.md} に出力してください。
|
||||||
* format: |
|
* format: |
|
||||||
* **出力契約:**
|
* **出力契約:**
|
||||||
* ```markdown
|
* ```markdown
|
||||||
* ...
|
* ...
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ReportObjectSchema = z.object({
|
export const OutputContractItemSchema = z.object({
|
||||||
/** Report file name */
|
/** Report file name */
|
||||||
name: z.string().min(1),
|
name: z.string().min(1),
|
||||||
/** Instruction prepended before instruction_template (e.g., output destination) */
|
/** Instruction prepended before instruction_template (e.g., output destination) */
|
||||||
@ -79,25 +79,28 @@ export const ReportObjectSchema = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report field schema.
|
* Output contracts field schema for movement-level definition.
|
||||||
*
|
*
|
||||||
* YAML formats:
|
* YAML formats:
|
||||||
* report: 00-plan.md # single file (string)
|
* output_contracts: # array of label:path entries
|
||||||
* report: # multiple files (label: path map entries)
|
|
||||||
* - Scope: 01-scope.md
|
* - Scope: 01-scope.md
|
||||||
* - Decisions: 02-decisions.md
|
* - Decisions: 02-decisions.md
|
||||||
* report: # object form (name + order + format)
|
* output_contracts: # array of objects (name + order + format)
|
||||||
* name: 00-plan.md
|
* - name: 00-plan.md
|
||||||
* order: ...
|
* order: ...
|
||||||
* format: ...
|
* format: plan
|
||||||
*
|
*
|
||||||
* Array items are parsed as single-key objects: [{Scope: "01-scope.md"}, ...]
|
* Array items can be single-key objects or full item objects.
|
||||||
*/
|
*/
|
||||||
export const ReportFieldSchema = z.union([
|
export const OutputContractsFieldSchema = z.array(
|
||||||
z.string().min(1),
|
z.union([
|
||||||
z.array(z.record(z.string(), z.string())).min(1),
|
z.record(z.string(), z.string()), // {Scope: "01-scope.md"} format
|
||||||
ReportObjectSchema,
|
OutputContractItemSchema, // {name, order?, format?} format
|
||||||
]);
|
])
|
||||||
|
).optional();
|
||||||
|
|
||||||
|
/** Quality gates schema - AI directives for movement completion (string array) */
|
||||||
|
export const QualityGatesSchema = z.array(z.string()).optional();
|
||||||
|
|
||||||
/** Rule-based transition schema (new unified format) */
|
/** Rule-based transition schema (new unified format) */
|
||||||
export const PieceRuleSchema = z.object({
|
export const PieceRuleSchema = z.object({
|
||||||
@ -132,7 +135,10 @@ export const ParallelSubMovementRawSchema = z.object({
|
|||||||
instruction: z.string().optional(),
|
instruction: z.string().optional(),
|
||||||
instruction_template: z.string().optional(),
|
instruction_template: z.string().optional(),
|
||||||
rules: z.array(PieceRuleSchema).optional(),
|
rules: z.array(PieceRuleSchema).optional(),
|
||||||
report: ReportFieldSchema.optional(),
|
/** Output contracts for this movement (report definitions) */
|
||||||
|
output_contracts: OutputContractsFieldSchema,
|
||||||
|
/** Quality gates for this movement (AI directives) */
|
||||||
|
quality_gates: QualityGatesSchema,
|
||||||
pass_previous_response: z.boolean().optional().default(true),
|
pass_previous_response: z.boolean().optional().default(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -161,8 +167,10 @@ export const PieceMovementRawSchema = z.object({
|
|||||||
instruction_template: z.string().optional(),
|
instruction_template: z.string().optional(),
|
||||||
/** Rules for movement routing */
|
/** Rules for movement routing */
|
||||||
rules: z.array(PieceRuleSchema).optional(),
|
rules: z.array(PieceRuleSchema).optional(),
|
||||||
/** Report file(s) for this movement */
|
/** Output contracts for this movement (report definitions) */
|
||||||
report: ReportFieldSchema.optional(),
|
output_contracts: OutputContractsFieldSchema,
|
||||||
|
/** Quality gates for this movement (AI directives) */
|
||||||
|
quality_gates: QualityGatesSchema,
|
||||||
pass_previous_response: z.boolean().optional().default(true),
|
pass_previous_response: z.boolean().optional().default(true),
|
||||||
/** Sub-movements to execute in parallel */
|
/** Sub-movements to execute in parallel */
|
||||||
parallel: z.array(ParallelSubMovementRawSchema).optional(),
|
parallel: z.array(ParallelSubMovementRawSchema).optional(),
|
||||||
@ -208,8 +216,8 @@ export const PieceConfigRawSchema = z.object({
|
|||||||
knowledge: z.record(z.string(), z.string()).optional(),
|
knowledge: z.record(z.string(), z.string()).optional(),
|
||||||
/** Piece-level instruction definitions — map of name to .md file path or inline content */
|
/** Piece-level instruction definitions — map of name to .md file path or inline content */
|
||||||
instructions: z.record(z.string(), z.string()).optional(),
|
instructions: z.record(z.string(), z.string()).optional(),
|
||||||
/** Piece-level output contract definitions — map of name to .md file path or inline content */
|
/** Piece-level report format definitions — map of name to .md file path or inline content */
|
||||||
output_contracts: z.record(z.string(), z.string()).optional(),
|
report_formats: z.record(z.string(), z.string()).optional(),
|
||||||
movements: z.array(PieceMovementRawSchema).min(1),
|
movements: z.array(PieceMovementRawSchema).min(1),
|
||||||
initial_movement: z.string().optional(),
|
initial_movement: z.string().optional(),
|
||||||
max_iterations: z.number().int().positive().optional().default(10),
|
max_iterations: z.number().int().positive().optional().default(10),
|
||||||
|
|||||||
@ -26,8 +26,9 @@ export type {
|
|||||||
// Piece configuration and runtime state
|
// Piece configuration and runtime state
|
||||||
export type {
|
export type {
|
||||||
PieceRule,
|
PieceRule,
|
||||||
ReportConfig,
|
OutputContractLabelPath,
|
||||||
ReportObjectConfig,
|
OutputContractItem,
|
||||||
|
OutputContractEntry,
|
||||||
PieceMovement,
|
PieceMovement,
|
||||||
LoopDetectionConfig,
|
LoopDetectionConfig,
|
||||||
LoopMonitorConfig,
|
LoopMonitorConfig,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import type {
|
|||||||
} from '../../models/types.js';
|
} from '../../models/types.js';
|
||||||
import type { PhaseName } from '../types.js';
|
import type { PhaseName } from '../types.js';
|
||||||
import { runAgent } from '../../../agents/runner.js';
|
import { runAgent } from '../../../agents/runner.js';
|
||||||
import { InstructionBuilder, isReportObjectConfig } from '../instruction/InstructionBuilder.js';
|
import { InstructionBuilder, isOutputContractItem } from '../instruction/InstructionBuilder.js';
|
||||||
import { needsStatusJudgmentPhase, runReportPhase, runStatusJudgmentPhase } from '../phase-runner.js';
|
import { needsStatusJudgmentPhase, runReportPhase, runStatusJudgmentPhase } from '../phase-runner.js';
|
||||||
import { detectMatchedRule } from '../evaluation/index.js';
|
import { detectMatchedRule } from '../evaluation/index.js';
|
||||||
import { incrementMovementIteration, getPreviousOutput } from './state-manager.js';
|
import { incrementMovementIteration, getPreviousOutput } from './state-manager.js';
|
||||||
@ -119,7 +119,7 @@ export class MovementExecutor {
|
|||||||
const phaseCtx = this.deps.optionsBuilder.buildPhaseRunnerContext(state, response.content, updatePersonaSession, this.deps.onPhaseStart, this.deps.onPhaseComplete);
|
const phaseCtx = this.deps.optionsBuilder.buildPhaseRunnerContext(state, response.content, updatePersonaSession, this.deps.onPhaseStart, this.deps.onPhaseComplete);
|
||||||
|
|
||||||
// Phase 2: report output (resume same session, Write only)
|
// Phase 2: report output (resume same session, Write only)
|
||||||
if (step.report) {
|
if (step.outputContracts && step.outputContracts.length > 0) {
|
||||||
await runReportPhase(step, movementIteration, phaseCtx);
|
await runReportPhase(step, movementIteration, phaseCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,18 +149,12 @@ export class MovementExecutor {
|
|||||||
|
|
||||||
/** Collect movement:report events for each report file that exists */
|
/** Collect movement:report events for each report file that exists */
|
||||||
emitMovementReports(step: PieceMovement): void {
|
emitMovementReports(step: PieceMovement): void {
|
||||||
if (!step.report) return;
|
if (!step.outputContracts || step.outputContracts.length === 0) return;
|
||||||
const baseDir = join(this.deps.getCwd(), this.deps.getReportDir());
|
const baseDir = join(this.deps.getCwd(), this.deps.getReportDir());
|
||||||
|
|
||||||
if (typeof step.report === 'string') {
|
for (const entry of step.outputContracts) {
|
||||||
this.checkReportFile(step, baseDir, step.report);
|
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||||
} else if (isReportObjectConfig(step.report)) {
|
this.checkReportFile(step, baseDir, fileName);
|
||||||
this.checkReportFile(step, baseDir, step.report.name);
|
|
||||||
} else {
|
|
||||||
// ReportConfig[] (array)
|
|
||||||
for (const rc of step.report) {
|
|
||||||
this.checkReportFile(step, baseDir, rc.path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,10 +53,11 @@ export class OptionsBuilder {
|
|||||||
|
|
||||||
/** Build RunAgentOptions for Phase 1 (main execution) */
|
/** Build RunAgentOptions for Phase 1 (main execution) */
|
||||||
buildAgentOptions(step: PieceMovement): RunAgentOptions {
|
buildAgentOptions(step: PieceMovement): RunAgentOptions {
|
||||||
// Phase 1: exclude Write from allowedTools when movement has report config AND edit is NOT enabled
|
// Phase 1: exclude Write from allowedTools when movement has output contracts AND edit is NOT enabled
|
||||||
// (If edit is enabled, Write is needed for code implementation even if report exists)
|
// (If edit is enabled, Write is needed for code implementation even if output contracts exist)
|
||||||
// Note: edit defaults to undefined, so check !== true to catch both false and undefined
|
// Note: edit defaults to undefined, so check !== true to catch both false and undefined
|
||||||
const allowedTools = step.report && step.edit !== true
|
const hasOutputContracts = step.outputContracts && step.outputContracts.length > 0;
|
||||||
|
const allowedTools = hasOutputContracts && step.edit !== true
|
||||||
? step.allowedTools?.filter((t) => t !== 'Write')
|
? step.allowedTools?.filter((t) => t !== 'Write')
|
||||||
: step.allowedTools;
|
: step.allowedTools;
|
||||||
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export class ParallelRunner {
|
|||||||
const phaseCtx = this.deps.optionsBuilder.buildPhaseRunnerContext(state, subResponse.content, updatePersonaSession, this.deps.onPhaseStart, this.deps.onPhaseComplete);
|
const phaseCtx = this.deps.optionsBuilder.buildPhaseRunnerContext(state, subResponse.content, updatePersonaSession, this.deps.onPhaseStart, this.deps.onPhaseComplete);
|
||||||
|
|
||||||
// Phase 2: report output for sub-movement
|
// Phase 2: report output for sub-movement
|
||||||
if (subMovement.report) {
|
if (subMovement.outputContracts && subMovement.outputContracts.length > 0) {
|
||||||
await runReportPhase(subMovement, subIteration, phaseCtx);
|
await runReportPhase(subMovement, subIteration, phaseCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
* Shared rule utility functions used by both engine.ts and instruction-builder.ts.
|
* Shared rule utility functions used by both engine.ts and instruction-builder.ts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PieceMovement } from '../../models/types.js';
|
import type { PieceMovement, OutputContractEntry } from '../../models/types.js';
|
||||||
import { isReportObjectConfig } from '../instruction/InstructionBuilder.js';
|
import { isOutputContractItem } from '../instruction/InstructionBuilder.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether a movement has tag-based rules (i.e., rules that require
|
* Check whether a movement has tag-based rules (i.e., rules that require
|
||||||
@ -38,12 +38,12 @@ export function getAutoSelectedTag(step: PieceMovement): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get report file names from a movement's report configuration.
|
* Get report file names from a movement's output contracts.
|
||||||
* Handles all three report config formats: string, ReportObjectConfig, and ReportConfig[].
|
|
||||||
*/
|
*/
|
||||||
export function getReportFiles(report: PieceMovement['report']): string[] {
|
export function getReportFiles(outputContracts: OutputContractEntry[] | undefined): string[] {
|
||||||
if (!report) return [];
|
if (!outputContracts || outputContracts.length === 0) return [];
|
||||||
if (typeof report === 'string') return [report];
|
return outputContracts.map((entry) => {
|
||||||
if (isReportObjectConfig(report)) return [report.name];
|
if (isOutputContractItem(entry)) return entry.name;
|
||||||
return report.map((rc) => rc.path);
|
return entry.path;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export { handleBlocked, type BlockedHandlerResult } from './engine/blocked-handl
|
|||||||
export { ParallelLogger } from './engine/parallel-logger.js';
|
export { ParallelLogger } from './engine/parallel-logger.js';
|
||||||
|
|
||||||
// Instruction building
|
// Instruction building
|
||||||
export { InstructionBuilder, isReportObjectConfig } from './instruction/InstructionBuilder.js';
|
export { InstructionBuilder, isOutputContractItem, isOutputContractLabelPath } from './instruction/InstructionBuilder.js';
|
||||||
export { ReportInstructionBuilder, type ReportInstructionContext } from './instruction/ReportInstructionBuilder.js';
|
export { ReportInstructionBuilder, type ReportInstructionContext } from './instruction/ReportInstructionBuilder.js';
|
||||||
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './instruction/StatusJudgmentBuilder.js';
|
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './instruction/StatusJudgmentBuilder.js';
|
||||||
export { buildEditRule, type InstructionContext } from './instruction/instruction-context.js';
|
export { buildEditRule, type InstructionContext } from './instruction/instruction-context.js';
|
||||||
|
|||||||
@ -5,17 +5,24 @@
|
|||||||
* Assembles template variables and renders a single complete template.
|
* Assembles template variables and renders a single complete template.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PieceMovement, Language, ReportConfig, ReportObjectConfig } from '../../models/types.js';
|
import type { PieceMovement, Language, OutputContractLabelPath, OutputContractItem, OutputContractEntry } from '../../models/types.js';
|
||||||
import type { InstructionContext } from './instruction-context.js';
|
import type { InstructionContext } from './instruction-context.js';
|
||||||
import { buildEditRule } from './instruction-context.js';
|
import { buildEditRule } from './instruction-context.js';
|
||||||
import { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
import { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
||||||
import { loadTemplate } from '../../../shared/prompts/index.js';
|
import { loadTemplate } from '../../../shared/prompts/index.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a report config is the object form (ReportObjectConfig).
|
* Check if an output contract entry is the item form (OutputContractItem).
|
||||||
*/
|
*/
|
||||||
export function isReportObjectConfig(report: string | ReportConfig[] | ReportObjectConfig): report is ReportObjectConfig {
|
export function isOutputContractItem(entry: OutputContractEntry): entry is OutputContractItem {
|
||||||
return typeof report === 'object' && !Array.isArray(report) && 'name' in report;
|
return 'name' in entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if an output contract entry is the label-path form (OutputContractLabelPath).
|
||||||
|
*/
|
||||||
|
export function isOutputContractLabelPath(entry: OutputContractEntry): entry is OutputContractLabelPath {
|
||||||
|
return 'label' in entry && 'path' in entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,12 +52,12 @@ export class InstructionBuilder {
|
|||||||
// Piece structure (loop expansion done in code)
|
// Piece structure (loop expansion done in code)
|
||||||
const pieceStructure = this.buildPieceStructure(language);
|
const pieceStructure = this.buildPieceStructure(language);
|
||||||
|
|
||||||
// Report info
|
// Report info (from output contracts)
|
||||||
const hasReport = !!(this.step.report && this.context.reportDir);
|
const hasReport = !!(this.step.outputContracts && this.step.outputContracts.length > 0 && this.context.reportDir);
|
||||||
let reportInfo = '';
|
let reportInfo = '';
|
||||||
let phaseNote = '';
|
let phaseNote = '';
|
||||||
if (hasReport && this.step.report && this.context.reportDir) {
|
if (hasReport && this.step.outputContracts && this.context.reportDir) {
|
||||||
reportInfo = renderReportContext(this.step.report, this.context.reportDir);
|
reportInfo = renderReportContext(this.step.outputContracts, this.context.reportDir);
|
||||||
phaseNote = language === 'ja'
|
phaseNote = language === 'ja'
|
||||||
? '**注意:** これはPhase 1(本来の作業)です。作業完了後、Phase 2で自動的にレポートを生成します。'
|
? '**注意:** これはPhase 1(本来の作業)です。作業完了後、Phase 2で自動的にレポートを生成します。'
|
||||||
: '**Note:** This is Phase 1 (main work). After you complete your work, Phase 2 will automatically generate the report based on your findings.';
|
: '**Note:** This is Phase 1 (main work). After you complete your work, Phase 2 will automatically generate the report based on your findings.';
|
||||||
@ -108,6 +115,12 @@ export class InstructionBuilder {
|
|||||||
const hasKnowledge = !!(knowledgeContents && knowledgeContents.length > 0);
|
const hasKnowledge = !!(knowledgeContents && knowledgeContents.length > 0);
|
||||||
const knowledgeContent = hasKnowledge ? knowledgeContents!.join('\n\n---\n\n') : '';
|
const knowledgeContent = hasKnowledge ? knowledgeContents!.join('\n\n---\n\n') : '';
|
||||||
|
|
||||||
|
// Quality gates injection (AI directives for movement completion)
|
||||||
|
const hasQualityGates = !!(this.step.qualityGates && this.step.qualityGates.length > 0);
|
||||||
|
const qualityGatesContent = hasQualityGates
|
||||||
|
? this.step.qualityGates!.map(gate => `- ${gate}`).join('\n')
|
||||||
|
: '';
|
||||||
|
|
||||||
return loadTemplate('perform_phase1_message', language, {
|
return loadTemplate('perform_phase1_message', language, {
|
||||||
workingDirectory: this.context.cwd,
|
workingDirectory: this.context.cwd,
|
||||||
editRule,
|
editRule,
|
||||||
@ -133,6 +146,8 @@ export class InstructionBuilder {
|
|||||||
policyContent,
|
policyContent,
|
||||||
hasKnowledge,
|
hasKnowledge,
|
||||||
knowledgeContent,
|
knowledgeContent,
|
||||||
|
hasQualityGates,
|
||||||
|
qualityGatesContent,
|
||||||
instructions,
|
instructions,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -165,7 +180,7 @@ export class InstructionBuilder {
|
|||||||
* Used by InstructionBuilder and ReportInstructionBuilder.
|
* Used by InstructionBuilder and ReportInstructionBuilder.
|
||||||
*/
|
*/
|
||||||
export function renderReportContext(
|
export function renderReportContext(
|
||||||
report: string | ReportConfig[] | ReportObjectConfig,
|
outputContracts: OutputContractEntry[],
|
||||||
reportDir: string,
|
reportDir: string,
|
||||||
): string {
|
): string {
|
||||||
const reportDirectory = 'Report Directory';
|
const reportDirectory = 'Report Directory';
|
||||||
@ -176,14 +191,18 @@ export function renderReportContext(
|
|||||||
`- ${reportDirectory}: ${reportDir}/`,
|
`- ${reportDirectory}: ${reportDir}/`,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (typeof report === 'string') {
|
if (outputContracts.length === 1) {
|
||||||
lines.push(`- ${reportFile}: ${reportDir}/${report}`);
|
const entry = outputContracts[0]!;
|
||||||
} else if (isReportObjectConfig(report)) {
|
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||||
lines.push(`- ${reportFile}: ${reportDir}/${report.name}`);
|
lines.push(`- ${reportFile}: ${reportDir}/${fileName}`);
|
||||||
} else {
|
} else {
|
||||||
lines.push(`- ${reportFiles}:`);
|
lines.push(`- ${reportFiles}:`);
|
||||||
for (const file of report) {
|
for (const entry of outputContracts) {
|
||||||
lines.push(` - ${file.label}: ${reportDir}/${file.path}`);
|
if (isOutputContractItem(entry)) {
|
||||||
|
lines.push(` - ${entry.name}: ${reportDir}/${entry.name}`);
|
||||||
|
} else {
|
||||||
|
lines.push(` - ${entry.label}: ${reportDir}/${entry.path}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,17 +210,17 @@ export function renderReportContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate report output instructions from movement's report config.
|
* Generate report output instructions from movement's output contracts.
|
||||||
* Returns empty string if movement has no report or no reportDir.
|
* Returns empty string if movement has no output contracts or no reportDir.
|
||||||
*/
|
*/
|
||||||
export function renderReportOutputInstruction(
|
export function renderReportOutputInstruction(
|
||||||
step: PieceMovement,
|
step: PieceMovement,
|
||||||
context: InstructionContext,
|
context: InstructionContext,
|
||||||
language: Language,
|
language: Language,
|
||||||
): string {
|
): string {
|
||||||
if (!step.report || !context.reportDir) return '';
|
if (!step.outputContracts || step.outputContracts.length === 0 || !context.reportDir) return '';
|
||||||
|
|
||||||
const isMulti = Array.isArray(step.report);
|
const isMulti = step.outputContracts.length > 1;
|
||||||
|
|
||||||
let heading: string;
|
let heading: string;
|
||||||
let createRule: string;
|
let createRule: string;
|
||||||
|
|||||||
@ -5,10 +5,10 @@
|
|||||||
* Assembles template variables and renders a single complete template.
|
* Assembles template variables and renders a single complete template.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PieceMovement, Language } from '../../models/types.js';
|
import type { PieceMovement, Language, OutputContractEntry } from '../../models/types.js';
|
||||||
import type { InstructionContext } from './instruction-context.js';
|
import type { InstructionContext } from './instruction-context.js';
|
||||||
import { replaceTemplatePlaceholders } from './escape.js';
|
import { replaceTemplatePlaceholders } from './escape.js';
|
||||||
import { isReportObjectConfig, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
import { isOutputContractItem, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
||||||
import { loadTemplate } from '../../../shared/prompts/index.js';
|
import { loadTemplate } from '../../../shared/prompts/index.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,8 +39,8 @@ export class ReportInstructionBuilder {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
build(): string {
|
build(): string {
|
||||||
if (!this.step.report) {
|
if (!this.step.outputContracts || this.step.outputContracts.length === 0) {
|
||||||
throw new Error(`ReportInstructionBuilder called for movement "${this.step.name}" which has no report config`);
|
throw new Error(`ReportInstructionBuilder called for movement "${this.step.name}" which has no output contracts`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const language = this.context.language ?? 'en';
|
const language = this.context.language ?? 'en';
|
||||||
@ -50,7 +50,7 @@ export class ReportInstructionBuilder {
|
|||||||
if (this.context.targetFile) {
|
if (this.context.targetFile) {
|
||||||
reportContext = `- Report Directory: ${this.context.reportDir}/\n- Report File: ${this.context.reportDir}/${this.context.targetFile}`;
|
reportContext = `- Report Directory: ${this.context.reportDir}/\n- Report File: ${this.context.reportDir}/${this.context.targetFile}`;
|
||||||
} else {
|
} else {
|
||||||
reportContext = renderReportContext(this.step.report, this.context.reportDir);
|
reportContext = renderReportContext(this.step.outputContracts, this.context.reportDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build report output instruction
|
// Build report output instruction
|
||||||
@ -68,8 +68,10 @@ export class ReportInstructionBuilder {
|
|||||||
language,
|
language,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isReportObjectConfig(this.step.report) && this.step.report.order) {
|
// Check for order instruction in first output contract item
|
||||||
reportOutput = replaceTemplatePlaceholders(this.step.report.order.trimEnd(), this.step, instrContext);
|
const firstContract = this.step.outputContracts[0];
|
||||||
|
if (firstContract && isOutputContractItem(firstContract) && firstContract.order) {
|
||||||
|
reportOutput = replaceTemplatePlaceholders(firstContract.order.trimEnd(), this.step, instrContext);
|
||||||
hasReportOutput = true;
|
hasReportOutput = true;
|
||||||
} else if (!this.context.targetFile) {
|
} else if (!this.context.targetFile) {
|
||||||
const output = renderReportOutputInstruction(this.step, instrContext, language);
|
const output = renderReportOutputInstruction(this.step, instrContext, language);
|
||||||
@ -79,11 +81,11 @@ export class ReportInstructionBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build output contract
|
// Build output contract (from first item's format)
|
||||||
let outputContract = '';
|
let outputContract = '';
|
||||||
let hasOutputContract = false;
|
let hasOutputContract = false;
|
||||||
if (isReportObjectConfig(this.step.report) && this.step.report.format) {
|
if (firstContract && isOutputContractItem(firstContract) && firstContract.format) {
|
||||||
outputContract = replaceTemplatePlaceholders(this.step.report.format.trimEnd(), this.step, instrContext);
|
outputContract = replaceTemplatePlaceholders(firstContract.format.trimEnd(), this.step, instrContext);
|
||||||
hasOutputContract = true;
|
hasOutputContract = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
* Instruction builders - barrel exports
|
* Instruction builders - barrel exports
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { InstructionBuilder, isReportObjectConfig, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
export { InstructionBuilder, isOutputContractItem, isOutputContractLabelPath, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
||||||
export { ReportInstructionBuilder, type ReportInstructionContext } from './ReportInstructionBuilder.js';
|
export { ReportInstructionBuilder, type ReportInstructionContext } from './ReportInstructionBuilder.js';
|
||||||
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './StatusJudgmentBuilder.js';
|
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './StatusJudgmentBuilder.js';
|
||||||
export { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
export { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
||||||
|
|||||||
@ -111,7 +111,7 @@ export class ReportBasedStrategy extends JudgmentStrategyBase {
|
|||||||
readonly name = 'ReportBased';
|
readonly name = 'ReportBased';
|
||||||
|
|
||||||
canApply(context: JudgmentContext): boolean {
|
canApply(context: JudgmentContext): boolean {
|
||||||
return context.reportDir !== undefined && getReportFiles(context.step.report).length > 0;
|
return context.reportDir !== undefined && getReportFiles(context.step.outputContracts).length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async gatherInput(context: JudgmentContext): Promise<string> {
|
protected async gatherInput(context: JudgmentContext): Promise<string> {
|
||||||
@ -119,7 +119,7 @@ export class ReportBasedStrategy extends JudgmentStrategyBase {
|
|||||||
throw new Error('Report directory not provided');
|
throw new Error('Report directory not provided');
|
||||||
}
|
}
|
||||||
|
|
||||||
const reportFiles = getReportFiles(context.step.report);
|
const reportFiles = getReportFiles(context.step.outputContracts);
|
||||||
if (reportFiles.length === 0) {
|
if (reportFiles.length === 0) {
|
||||||
throw new Error('No report files configured');
|
throw new Error('No report files configured');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export async function runReportPhase(
|
|||||||
|
|
||||||
log.debug('Running report phase', { movement: step.name, sessionId: currentSessionId });
|
log.debug('Running report phase', { movement: step.name, sessionId: currentSessionId });
|
||||||
|
|
||||||
const reportFiles = getReportFiles(step.report);
|
const reportFiles = getReportFiles(step.outputContracts);
|
||||||
if (reportFiles.length === 0) {
|
if (reportFiles.length === 0) {
|
||||||
log.debug('No report files configured, skipping report phase');
|
log.debug('No report files configured, skipping report phase');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export async function previewPrompts(cwd: string, pieceIdentifier?: string): Pro
|
|||||||
userInputs: [],
|
userInputs: [],
|
||||||
pieceMovements: config.movements,
|
pieceMovements: config.movements,
|
||||||
currentMovementIndex: i,
|
currentMovementIndex: i,
|
||||||
reportDir: movement.report ? '.takt/reports/preview' : undefined,
|
reportDir: movement.outputContracts && movement.outputContracts.length > 0 ? '.takt/reports/preview' : undefined,
|
||||||
language,
|
language,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ export async function previewPrompts(cwd: string, pieceIdentifier?: string): Pro
|
|||||||
console.log('\n--- Phase 1 (Main Execution) ---\n');
|
console.log('\n--- Phase 1 (Main Execution) ---\n');
|
||||||
console.log(phase1Builder.build());
|
console.log(phase1Builder.build());
|
||||||
|
|
||||||
// Phase 2: Report output (only if movement has report config)
|
// Phase 2: Report output (only if movement has output contracts)
|
||||||
if (movement.report) {
|
if (movement.outputContracts && movement.outputContracts.length > 0) {
|
||||||
const reportBuilder = new ReportInstructionBuilder(movement, {
|
const reportBuilder = new ReportInstructionBuilder(movement, {
|
||||||
cwd,
|
cwd,
|
||||||
reportDir: '.takt/reports/preview',
|
reportDir: '.takt/reports/preview',
|
||||||
|
|||||||
@ -113,7 +113,8 @@ export {
|
|||||||
handleBlocked,
|
handleBlocked,
|
||||||
ParallelLogger,
|
ParallelLogger,
|
||||||
InstructionBuilder,
|
InstructionBuilder,
|
||||||
isReportObjectConfig,
|
isOutputContractItem,
|
||||||
|
isOutputContractLabelPath,
|
||||||
ReportInstructionBuilder,
|
ReportInstructionBuilder,
|
||||||
StatusJudgmentBuilder,
|
StatusJudgmentBuilder,
|
||||||
buildEditRule,
|
buildEditRule,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { join, dirname, basename } from 'node:path';
|
|||||||
import { parse as parseYaml } from 'yaml';
|
import { parse as parseYaml } from 'yaml';
|
||||||
import type { z } from 'zod';
|
import type { z } from 'zod';
|
||||||
import { PieceConfigRawSchema, PieceMovementRawSchema } from '../../../core/models/index.js';
|
import { PieceConfigRawSchema, PieceMovementRawSchema } from '../../../core/models/index.js';
|
||||||
import type { PieceConfig, PieceMovement, PieceRule, ReportConfig, ReportObjectConfig, LoopMonitorConfig, LoopMonitorJudge } from '../../../core/models/index.js';
|
import type { PieceConfig, PieceMovement, PieceRule, OutputContractEntry, OutputContractLabelPath, OutputContractItem, LoopMonitorConfig, LoopMonitorJudge } from '../../../core/models/index.js';
|
||||||
|
|
||||||
type RawStep = z.output<typeof PieceMovementRawSchema>;
|
type RawStep = z.output<typeof PieceMovementRawSchema>;
|
||||||
|
|
||||||
@ -110,33 +110,54 @@ interface PieceSections {
|
|||||||
resolvedKnowledge?: Record<string, string>;
|
resolvedKnowledge?: Record<string, string>;
|
||||||
/** Instruction name → resolved content */
|
/** Instruction name → resolved content */
|
||||||
resolvedInstructions?: Record<string, string>;
|
resolvedInstructions?: Record<string, string>;
|
||||||
/** Output contract name → resolved content */
|
/** Report format name → resolved content */
|
||||||
resolvedOutputContracts?: Record<string, string>;
|
resolvedReportFormats?: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if a raw report value is the object form (has 'name' property). */
|
/** Check if a raw output contract item is the object form (has 'name' property). */
|
||||||
function isReportObject(raw: unknown): raw is { name: string; order?: string; format?: string } {
|
function isOutputContractItem(raw: unknown): raw is { name: string; order?: string; format?: string } {
|
||||||
return typeof raw === 'object' && raw !== null && !Array.isArray(raw) && 'name' in raw;
|
return typeof raw === 'object' && raw !== null && !Array.isArray(raw) && 'name' in raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Normalize the raw report field from YAML into internal format. */
|
/**
|
||||||
function normalizeReport(
|
* Normalize the raw output_contracts field from YAML into internal format.
|
||||||
raw: string | Record<string, string>[] | { name: string; order?: string; format?: string } | undefined,
|
*
|
||||||
|
* Input formats (YAML):
|
||||||
|
* output_contracts:
|
||||||
|
* - Scope: 01-scope.md # label:path format
|
||||||
|
* - name: 00-plan.md # item format
|
||||||
|
* format: plan
|
||||||
|
*
|
||||||
|
* Output: OutputContractEntry[]
|
||||||
|
*/
|
||||||
|
function normalizeOutputContracts(
|
||||||
|
raw: Array<Record<string, string> | { name: string; order?: string; format?: string }> | undefined,
|
||||||
pieceDir: string,
|
pieceDir: string,
|
||||||
resolvedOutputContracts?: Record<string, string>,
|
resolvedReportFormats?: Record<string, string>,
|
||||||
): string | ReportConfig[] | ReportObjectConfig | undefined {
|
): OutputContractEntry[] | undefined {
|
||||||
if (raw == null) return undefined;
|
if (raw == null || raw.length === 0) return undefined;
|
||||||
if (typeof raw === 'string') return raw;
|
|
||||||
if (isReportObject(raw)) {
|
const result: OutputContractEntry[] = [];
|
||||||
return {
|
|
||||||
name: raw.name,
|
for (const entry of raw) {
|
||||||
order: raw.order ? resolveRefToContent(raw.order, resolvedOutputContracts, pieceDir) : undefined,
|
if (isOutputContractItem(entry)) {
|
||||||
format: raw.format ? resolveRefToContent(raw.format, resolvedOutputContracts, pieceDir) : undefined,
|
// Item format: {name, order?, format?}
|
||||||
};
|
const item: OutputContractItem = {
|
||||||
|
name: entry.name,
|
||||||
|
order: entry.order ? resolveRefToContent(entry.order, resolvedReportFormats, pieceDir) : undefined,
|
||||||
|
format: entry.format ? resolveRefToContent(entry.format, resolvedReportFormats, pieceDir) : undefined,
|
||||||
|
};
|
||||||
|
result.push(item);
|
||||||
|
} else {
|
||||||
|
// Label:path format: {Scope: "01-scope.md"}
|
||||||
|
for (const [label, path] of Object.entries(entry)) {
|
||||||
|
const labelPath: OutputContractLabelPath = { label, path };
|
||||||
|
result.push(labelPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (raw as Record<string, string>[]).flatMap((entry) =>
|
|
||||||
Object.entries(entry).map(([label, path]) => ({ label, path })),
|
return result.length > 0 ? result : undefined;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Regex to detect ai("...") condition expressions */
|
/** Regex to detect ai("...") condition expressions */
|
||||||
@ -255,7 +276,8 @@ function normalizeStepFromRaw(
|
|||||||
edit: step.edit,
|
edit: step.edit,
|
||||||
instructionTemplate: resolveResourceContent(step.instruction_template, pieceDir) || expandedInstruction || '{task}',
|
instructionTemplate: resolveResourceContent(step.instruction_template, pieceDir) || expandedInstruction || '{task}',
|
||||||
rules,
|
rules,
|
||||||
report: normalizeReport(step.report, pieceDir, sections.resolvedOutputContracts),
|
outputContracts: normalizeOutputContracts(step.output_contracts, pieceDir, sections.resolvedReportFormats),
|
||||||
|
qualityGates: step.quality_gates,
|
||||||
passPreviousResponse: step.pass_previous_response ?? true,
|
passPreviousResponse: step.pass_previous_response ?? true,
|
||||||
policyContents,
|
policyContents,
|
||||||
knowledgeContents,
|
knowledgeContents,
|
||||||
@ -307,14 +329,14 @@ export function normalizePieceConfig(raw: unknown, pieceDir: string): PieceConfi
|
|||||||
const resolvedPolicies = resolveSectionMap(parsed.policies, pieceDir);
|
const resolvedPolicies = resolveSectionMap(parsed.policies, pieceDir);
|
||||||
const resolvedKnowledge = resolveSectionMap(parsed.knowledge, pieceDir);
|
const resolvedKnowledge = resolveSectionMap(parsed.knowledge, pieceDir);
|
||||||
const resolvedInstructions = resolveSectionMap(parsed.instructions, pieceDir);
|
const resolvedInstructions = resolveSectionMap(parsed.instructions, pieceDir);
|
||||||
const resolvedOutputContracts = resolveSectionMap(parsed.output_contracts, pieceDir);
|
const resolvedReportFormats = resolveSectionMap(parsed.report_formats, pieceDir);
|
||||||
|
|
||||||
const sections: PieceSections = {
|
const sections: PieceSections = {
|
||||||
personas: parsed.personas,
|
personas: parsed.personas,
|
||||||
resolvedPolicies,
|
resolvedPolicies,
|
||||||
resolvedKnowledge,
|
resolvedKnowledge,
|
||||||
resolvedInstructions,
|
resolvedInstructions,
|
||||||
resolvedOutputContracts,
|
resolvedReportFormats,
|
||||||
};
|
};
|
||||||
|
|
||||||
const movements: PieceMovement[] = parsed.movements.map((step) =>
|
const movements: PieceMovement[] = parsed.movements.map((step) =>
|
||||||
@ -331,7 +353,7 @@ export function normalizePieceConfig(raw: unknown, pieceDir: string): PieceConfi
|
|||||||
policies: resolvedPolicies,
|
policies: resolvedPolicies,
|
||||||
knowledge: resolvedKnowledge,
|
knowledge: resolvedKnowledge,
|
||||||
instructions: resolvedInstructions,
|
instructions: resolvedInstructions,
|
||||||
outputContracts: resolvedOutputContracts,
|
reportFormats: resolvedReportFormats,
|
||||||
movements,
|
movements,
|
||||||
initialMovement,
|
initialMovement,
|
||||||
maxIterations: parsed.max_iterations,
|
maxIterations: parsed.max_iterations,
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
||||||
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
||||||
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
||||||
hasKnowledge, knowledgeContent, instructions
|
hasKnowledge, knowledgeContent, hasQualityGates, qualityGatesContent, instructions
|
||||||
builder: InstructionBuilder
|
builder: InstructionBuilder
|
||||||
-->
|
-->
|
||||||
## Execution Context
|
## Execution Context
|
||||||
@ -61,6 +61,13 @@ The following knowledge is domain-specific information for this movement. Use it
|
|||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
{{instructions}}
|
{{instructions}}
|
||||||
|
{{#if hasQualityGates}}
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
Before completing this movement, ensure the following requirements are met:
|
||||||
|
|
||||||
|
{{qualityGatesContent}}
|
||||||
|
{{/if}}
|
||||||
{{#if hasPolicy}}
|
{{#if hasPolicy}}
|
||||||
|
|
||||||
## Policy
|
## Policy
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
||||||
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
||||||
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
||||||
hasKnowledge, knowledgeContent, instructions
|
hasKnowledge, knowledgeContent, hasQualityGates, qualityGatesContent, instructions
|
||||||
builder: InstructionBuilder
|
builder: InstructionBuilder
|
||||||
-->
|
-->
|
||||||
## 実行コンテキスト
|
## 実行コンテキスト
|
||||||
@ -60,6 +60,13 @@
|
|||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
{{instructions}}
|
{{instructions}}
|
||||||
|
{{#if hasQualityGates}}
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
このムーブメントを完了する前に、以下の要件を満たしてください:
|
||||||
|
|
||||||
|
{{qualityGatesContent}}
|
||||||
|
{{/if}}
|
||||||
{{#if hasPolicy}}
|
{{#if hasPolicy}}
|
||||||
|
|
||||||
## Policy
|
## Policy
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user