Merge branch 'takt/20260207T1212-tasuku-output-contracts-to-qua' into develop
This commit is contained in:
commit
487b8bf235
@ -17,14 +17,15 @@ instructions:
|
||||
ai-review: ../instructions/ai-review.md
|
||||
review-arch: ../instructions/review-arch.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -40,6 +41,9 @@ movements:
|
||||
- condition: Requirements are unclear, insufficient information
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -49,9 +53,6 @@ movements:
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -74,6 +75,9 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -82,9 +86,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -95,14 +96,14 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -113,6 +114,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "approved")
|
||||
next: COMPLETE
|
||||
@ -147,7 +151,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
architect-planner: ../personas/architect-planner.md
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
ai-review: ../instructions/ai-review.md
|
||||
review-arch: ../instructions/review-arch.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
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -83,7 +39,9 @@ movements:
|
||||
- condition: Requirements are unclear, insufficient information
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -92,9 +50,6 @@ movements:
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -117,7 +72,9 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -126,9 +83,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -139,15 +93,14 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
instruction: ai-review
|
||||
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -158,13 +111,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "approved")
|
||||
next: COMPLETE
|
||||
- condition: any("AI-specific issues found", "needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -188,3 +142,7 @@ movements:
|
||||
- condition: Cannot determine, insufficient information
|
||||
next: ABORT
|
||||
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
|
||||
fix: ../instructions/fix.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
|
||||
loop_monitors:
|
||||
- cycle:
|
||||
@ -56,9 +64,6 @@ movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -78,12 +83,12 @@ movements:
|
||||
- {Question 1}
|
||||
- {Question 2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 01-architecture.md
|
||||
format: architecture-design
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -98,6 +103,9 @@ movements:
|
||||
- condition: Insufficient info, cannot proceed
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -109,9 +117,6 @@ movements:
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -134,15 +139,15 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -155,6 +160,9 @@ movements:
|
||||
- condition: AI-specific issues found
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -207,9 +215,6 @@ movements:
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -220,15 +225,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 06-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -239,6 +244,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -274,9 +282,6 @@ movements:
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -290,17 +295,12 @@ movements:
|
||||
- condition: Requirements unmet, tests failing, build errors
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: Standard development piece with planning and specialized reviews
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
backend: ../knowledge/backend.md
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
architect-planner: ../personas/architect-planner.md
|
||||
@ -34,7 +18,6 @@ personas:
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
architect: ../instructions/architect.md
|
||||
@ -46,20 +29,11 @@ instructions:
|
||||
review-qa: ../instructions/review-qa.md
|
||||
fix: ../instructions/fix.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
|
||||
|
||||
loop_monitors:
|
||||
- cycle: [ai_review, ai_fix]
|
||||
- cycle:
|
||||
- ai_review
|
||||
- ai_fix
|
||||
threshold: 3
|
||||
judge:
|
||||
persona: supervisor
|
||||
@ -81,14 +55,10 @@ loop_monitors:
|
||||
next: ai_review
|
||||
- condition: Unproductive (no improvement)
|
||||
next: reviewers
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -108,13 +78,12 @@ movements:
|
||||
- {Question 1}
|
||||
- {Question 2}
|
||||
instruction: plan
|
||||
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 01-architecture.md
|
||||
format: architecture-design
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -129,7 +98,9 @@ movements:
|
||||
- condition: Insufficient info, cannot proceed
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
|
||||
output_contracts:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -137,10 +108,9 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [backend, architecture]
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -163,16 +133,15 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -185,7 +154,9 @@ movements:
|
||||
- condition: AI-specific issues found
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -193,7 +164,9 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [backend, architecture]
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -212,7 +185,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -227,17 +199,15 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: [architecture, backend]
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -248,16 +218,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 06-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -268,19 +237,23 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [backend, architecture]
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -297,14 +270,10 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -318,3 +287,14 @@ movements:
|
||||
- condition: Requirements unmet, tests failing, build errors
|
||||
next: plan
|
||||
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
|
||||
supervise: ../instructions/supervise.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -54,6 +60,9 @@ movements:
|
||||
next: implement
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -68,9 +77,6 @@ movements:
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -92,15 +98,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -113,6 +119,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -167,9 +176,6 @@ movements:
|
||||
knowledge:
|
||||
- cqrs-es
|
||||
- backend
|
||||
report:
|
||||
name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -180,14 +186,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -198,14 +204,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -216,15 +222,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -235,6 +241,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -273,9 +282,6 @@ movements:
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -288,6 +294,9 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -322,12 +331,3 @@ policies:
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: CQRS+ES, Frontend, Security, QA Expert Review
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
frontend: ../knowledge/frontend.md
|
||||
backend: ../knowledge/backend.md
|
||||
cqrs-es: ../knowledge/cqrs-es.md
|
||||
security: ../knowledge/security.md
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
coder: ../personas/coder.md
|
||||
@ -47,7 +23,6 @@ personas:
|
||||
security-reviewer: ../personas/security-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
expert-supervisor: ../personas/expert-supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
@ -61,29 +36,11 @@ instructions:
|
||||
fix: ../instructions/fix.md
|
||||
supervise: ../instructions/supervise.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
|
||||
|
||||
movements:
|
||||
# ===========================================
|
||||
# Movement 0: Planning
|
||||
# ===========================================
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -97,10 +54,9 @@ movements:
|
||||
next: implement
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
|
||||
# ===========================================
|
||||
# Movement 1: Implementation
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -108,10 +64,12 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -133,19 +91,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
# ===========================================
|
||||
# Movement 2: AI Review
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -158,7 +112,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -166,7 +122,12 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -184,7 +145,6 @@ movements:
|
||||
next: ai_no_fix
|
||||
- condition: Unable to proceed with fixes
|
||||
next: ai_no_fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -199,105 +159,100 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
# ===========================================
|
||||
# Movement 3: Expert Reviews (Parallel)
|
||||
# ===========================================
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: cqrs-es-review
|
||||
edit: false
|
||||
persona: cqrs-es-reviewer
|
||||
policy: review
|
||||
knowledge: [cqrs-es, backend]
|
||||
report:
|
||||
name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
knowledge:
|
||||
- cqrs-es
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
|
||||
output_contracts:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -314,17 +269,10 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
# ===========================================
|
||||
# Movement 4: Supervision
|
||||
# ===========================================
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -337,14 +285,21 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -360,3 +315,12 @@ movements:
|
||||
next: supervise
|
||||
- condition: Unable to proceed with fixes
|
||||
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
|
||||
supervise: ../instructions/supervise.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -52,6 +58,9 @@ movements:
|
||||
next: implement
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -65,9 +74,6 @@ movements:
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -89,15 +95,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -110,6 +116,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -163,9 +172,6 @@ movements:
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
report:
|
||||
name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -176,14 +182,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -194,14 +200,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -212,15 +218,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -231,6 +237,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -268,9 +277,6 @@ movements:
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -283,6 +289,9 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -316,12 +325,3 @@ policies:
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: Architecture, Frontend, Security, QA Expert Review
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
frontend: ../knowledge/frontend.md
|
||||
backend: ../knowledge/backend.md
|
||||
security: ../knowledge/security.md
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
coder: ../personas/coder.md
|
||||
@ -45,7 +21,6 @@ personas:
|
||||
security-reviewer: ../personas/security-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
expert-supervisor: ../personas/expert-supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
@ -59,29 +34,11 @@ instructions:
|
||||
fix: ../instructions/fix.md
|
||||
supervise: ../instructions/supervise.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
|
||||
|
||||
movements:
|
||||
# ===========================================
|
||||
# Movement 0: Planning
|
||||
# ===========================================
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -95,10 +52,9 @@ movements:
|
||||
next: implement
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
|
||||
# ===========================================
|
||||
# Movement 1: Implementation
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -106,10 +62,11 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -131,19 +88,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
# ===========================================
|
||||
# Movement 2: AI Review
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -156,7 +109,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -164,7 +119,11 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -182,7 +141,6 @@ movements:
|
||||
next: ai_no_fix
|
||||
- condition: Unable to proceed with fixes
|
||||
next: ai_no_fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -197,105 +155,99 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
# ===========================================
|
||||
# Movement 3: Expert Reviews (Parallel)
|
||||
# ===========================================
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: [architecture, backend]
|
||||
report:
|
||||
name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -312,17 +264,10 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
# ===========================================
|
||||
# Movement 4: Supervision
|
||||
# ===========================================
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -335,14 +280,20 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -358,3 +309,12 @@ movements:
|
||||
next: supervise
|
||||
- condition: Unable to proceed with fixes
|
||||
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
|
||||
description: MAGI Deliberation System - Analyze from 3 perspectives and decide by majority
|
||||
|
||||
max_iterations: 5
|
||||
|
||||
personas:
|
||||
melchior: ../personas/melchior.md
|
||||
balthasar: ../personas/balthasar.md
|
||||
casper: ../personas/casper.md
|
||||
|
||||
initial_movement: melchior
|
||||
|
||||
movements:
|
||||
- name: melchior
|
||||
persona: melchior
|
||||
@ -60,7 +43,6 @@ movements:
|
||||
rules:
|
||||
- condition: Judgment completed
|
||||
next: balthasar
|
||||
|
||||
- name: balthasar
|
||||
persona: balthasar
|
||||
allowed_tools:
|
||||
@ -101,7 +83,6 @@ movements:
|
||||
rules:
|
||||
- condition: Judgment completed
|
||||
next: casper
|
||||
|
||||
- name: casper
|
||||
persona: casper
|
||||
allowed_tools:
|
||||
|
||||
@ -14,6 +14,8 @@ instructions:
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
initial_movement: implement
|
||||
movements:
|
||||
- name: implement
|
||||
@ -23,9 +25,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -46,6 +45,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -54,9 +56,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -67,13 +66,13 @@ movements:
|
||||
rules:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -85,6 +84,9 @@ movements:
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -195,5 +197,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
implement: ../instructions/implement.md
|
||||
review-ai: ../instructions/review-ai.md
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
|
||||
output_contracts:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
initial_movement: implement
|
||||
|
||||
movements:
|
||||
- name: implement
|
||||
edit: true
|
||||
@ -46,9 +24,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -69,7 +44,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -78,33 +55,27 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: review-ai
|
||||
rules:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -112,7 +83,9 @@ movements:
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -122,7 +95,6 @@ movements:
|
||||
next: ai_fix
|
||||
- condition: any("Requirements unmet, tests failing")
|
||||
next: supervise_fix
|
||||
|
||||
- name: fix_both
|
||||
parallel:
|
||||
- name: ai_fix_parallel
|
||||
@ -136,7 +108,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -146,7 +117,6 @@ movements:
|
||||
- condition: No fix needed (verified target files/spec)
|
||||
- condition: Cannot proceed, insufficient info
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix_parallel
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -158,7 +128,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -167,13 +136,11 @@ movements:
|
||||
- condition: Supervisor's issues fixed
|
||||
- condition: Cannot proceed, insufficient info
|
||||
instruction: fix-supervisor
|
||||
|
||||
rules:
|
||||
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
||||
next: reviewers
|
||||
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
||||
next: implement
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -198,7 +165,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: implement
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -221,3 +187,5 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: implement
|
||||
instruction: fix-supervisor
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
@ -15,8 +15,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -38,6 +36,8 @@ movements:
|
||||
interactive_only: true
|
||||
instruction_template: |
|
||||
Do the task.
|
||||
output_contracts:
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.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
|
||||
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
testing: ../policies/testing.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
|
||||
initial_movement: execute
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
@ -27,8 +14,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -50,3 +35,5 @@ movements:
|
||||
interactive_only: true
|
||||
instruction_template: |
|
||||
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
|
||||
description: Research piece - autonomously executes research without asking questions
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
personas:
|
||||
research-planner: ../personas/research-planner.md
|
||||
research-digger: ../personas/research-digger.md
|
||||
research-supervisor: ../personas/research-supervisor.md
|
||||
|
||||
initial_movement: plan
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
persona: research-planner
|
||||
@ -63,7 +42,6 @@ movements:
|
||||
next: dig
|
||||
- condition: Insufficient information to create a plan
|
||||
next: ABORT
|
||||
|
||||
- name: dig
|
||||
persona: research-digger
|
||||
allowed_tools:
|
||||
@ -104,7 +82,6 @@ movements:
|
||||
next: supervise
|
||||
- condition: Unable to conduct research
|
||||
next: ABORT
|
||||
|
||||
- name: supervise
|
||||
persona: research-supervisor
|
||||
allowed_tools:
|
||||
|
||||
@ -14,6 +14,8 @@ instructions:
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
initial_movement: reviewers
|
||||
movements:
|
||||
- name: implement
|
||||
@ -23,9 +25,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -46,6 +45,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -54,9 +56,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -67,13 +66,13 @@ movements:
|
||||
rules:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -85,6 +84,9 @@ movements:
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -195,5 +197,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: Review and fix piece for existing code (starts with review, no implementation)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
implement: ../instructions/implement.md
|
||||
review-ai: ../instructions/review-ai.md
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
|
||||
output_contracts:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
initial_movement: reviewers
|
||||
|
||||
movements:
|
||||
- name: implement
|
||||
edit: true
|
||||
@ -46,9 +24,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -69,7 +44,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -78,41 +55,37 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: review-ai
|
||||
rules:
|
||||
- condition: "No AI-specific issues"
|
||||
- condition: "AI-specific issues found"
|
||||
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
rules:
|
||||
- condition: "All checks passed"
|
||||
- condition: "Requirements unmet, tests failing"
|
||||
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -122,7 +95,6 @@ movements:
|
||||
next: ai_fix
|
||||
- condition: any("Requirements unmet, tests failing")
|
||||
next: supervise_fix
|
||||
|
||||
- name: fix_both
|
||||
parallel:
|
||||
- name: ai_fix_parallel
|
||||
@ -136,7 +108,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -146,7 +117,6 @@ movements:
|
||||
- condition: No fix needed (verified target files/spec)
|
||||
- condition: Cannot proceed, insufficient info
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix_parallel
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -158,7 +128,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -167,13 +136,11 @@ movements:
|
||||
- condition: Supervisor's issues fixed
|
||||
- condition: Cannot proceed, insufficient info
|
||||
instruction: fix-supervisor
|
||||
|
||||
rules:
|
||||
- condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed")
|
||||
next: reviewers
|
||||
- condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info")
|
||||
next: implement
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -198,7 +165,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: implement
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -221,3 +187,5 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: implement
|
||||
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
|
||||
description: Review-only piece - reviews code without making edits
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
policies:
|
||||
review: ../policies/review.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
security: ../knowledge/security.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
@ -39,20 +14,11 @@ personas:
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
pr-commenter: ../personas/pr-commenter.md
|
||||
|
||||
instructions:
|
||||
review-arch: ../instructions/review-arch.md
|
||||
review-security: ../instructions/review-security.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
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
@ -88,7 +54,6 @@ movements:
|
||||
|
||||
**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.
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -96,73 +61,65 @@ movements:
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 02-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 02-security-review.md
|
||||
format: security-review
|
||||
- name: ai-review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-ai
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: supervise
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -217,7 +174,8 @@ movements:
|
||||
## Improvement Suggestions
|
||||
- {Consolidated suggestions from all reviews}
|
||||
```
|
||||
|
||||
output_contracts:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
persona: pr-commenter
|
||||
@ -268,3 +226,8 @@ movements:
|
||||
---
|
||||
*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
|
||||
review-arch: ../instructions/review-arch.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -40,6 +41,9 @@ movements:
|
||||
- condition: 要件が不明確、情報不足
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -49,9 +53,6 @@ movements:
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -74,6 +75,9 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -82,9 +86,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -95,14 +96,14 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -113,6 +114,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "approved")
|
||||
next: COMPLETE
|
||||
@ -147,7 +151,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
architect-planner: ../personas/architect-planner.md
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
ai-review: ../instructions/ai-review.md
|
||||
review-arch: ../instructions/review-arch.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
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -83,7 +39,9 @@ movements:
|
||||
- condition: 要件が不明確、情報不足
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -92,9 +50,6 @@ movements:
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -117,7 +72,9 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -126,9 +83,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -139,15 +93,14 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
instruction: ai-review
|
||||
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -158,13 +111,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "approved")
|
||||
next: COMPLETE
|
||||
- condition: any("AI特有の問題あり", "needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -188,3 +142,7 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: ABORT
|
||||
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
|
||||
fix: ../instructions/fix.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
|
||||
loop_monitors:
|
||||
- cycle:
|
||||
@ -56,9 +64,6 @@ movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -78,12 +83,12 @@ movements:
|
||||
- {質問1}
|
||||
- {質問2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 01-architecture.md
|
||||
format: architecture-design
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -98,6 +103,9 @@ movements:
|
||||
- condition: 情報不足、判断できない
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -109,9 +117,6 @@ movements:
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -134,15 +139,15 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -155,6 +160,9 @@ movements:
|
||||
- condition: AI特有の問題あり
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -207,9 +215,6 @@ movements:
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -220,15 +225,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 06-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -239,6 +244,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -274,9 +282,6 @@ movements:
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -290,17 +295,12 @@ movements:
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: Standard development piece with planning and specialized reviews
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
backend: ../knowledge/backend.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
architect-planner: ../personas/architect-planner.md
|
||||
@ -34,7 +18,6 @@ personas:
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
architect: ../instructions/architect.md
|
||||
@ -46,20 +29,11 @@ instructions:
|
||||
review-qa: ../instructions/review-qa.md
|
||||
fix: ../instructions/fix.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
|
||||
|
||||
loop_monitors:
|
||||
- cycle: [ai_review, ai_fix]
|
||||
- cycle:
|
||||
- ai_review
|
||||
- ai_fix
|
||||
threshold: 3
|
||||
judge:
|
||||
persona: supervisor
|
||||
@ -81,14 +55,10 @@ loop_monitors:
|
||||
next: ai_review
|
||||
- condition: 非生産的(改善なし)
|
||||
next: reviewers
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -108,13 +78,12 @@ movements:
|
||||
- {質問1}
|
||||
- {質問2}
|
||||
instruction: plan
|
||||
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
edit: false
|
||||
persona: architect-planner
|
||||
report:
|
||||
name: 01-architecture.md
|
||||
format: architecture-design
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -129,7 +98,9 @@ movements:
|
||||
- condition: 情報不足、判断できない
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
|
||||
output_contracts:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -137,10 +108,9 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [backend, architecture]
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -163,16 +133,15 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
|
||||
output_contracts:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 04-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -185,7 +154,9 @@ movements:
|
||||
- condition: AI特有の問題あり
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
|
||||
output_contracts:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -193,7 +164,9 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [backend, architecture]
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -212,7 +185,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -227,17 +199,15 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: [architecture, backend]
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -248,16 +218,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 06-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -268,19 +237,23 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [backend, architecture]
|
||||
knowledge:
|
||||
- backend
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -297,14 +270,10 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -318,3 +287,14 @@ movements:
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
next: plan
|
||||
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
|
||||
supervise: ../instructions/supervise.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -54,6 +60,9 @@ movements:
|
||||
next: implement
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -68,9 +77,6 @@ movements:
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -92,15 +98,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -113,6 +119,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -167,9 +176,6 @@ movements:
|
||||
knowledge:
|
||||
- cqrs-es
|
||||
- backend
|
||||
report:
|
||||
name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -180,14 +186,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -198,14 +204,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -216,15 +222,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -235,6 +241,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -273,9 +282,6 @@ movements:
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -288,6 +294,9 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -322,12 +331,3 @@ policies:
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: CQRS+ES・フロントエンド・セキュリティ・QA専門家レビュー
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
frontend: ../knowledge/frontend.md
|
||||
backend: ../knowledge/backend.md
|
||||
cqrs-es: ../knowledge/cqrs-es.md
|
||||
security: ../knowledge/security.md
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
coder: ../personas/coder.md
|
||||
@ -56,7 +23,6 @@ personas:
|
||||
security-reviewer: ../personas/security-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
expert-supervisor: ../personas/expert-supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
@ -70,29 +36,11 @@ instructions:
|
||||
fix: ../instructions/fix.md
|
||||
supervise: ../instructions/supervise.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
|
||||
|
||||
movements:
|
||||
# ===========================================
|
||||
# Movement 0: Planning
|
||||
# ===========================================
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -106,10 +54,9 @@ movements:
|
||||
next: implement
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
|
||||
# ===========================================
|
||||
# Movement 1: Implementation
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -117,10 +64,12 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -142,19 +91,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
# ===========================================
|
||||
# Movement 2: AI Review
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -167,7 +112,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -175,7 +122,12 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -193,7 +145,6 @@ movements:
|
||||
next: ai_no_fix
|
||||
- condition: 修正を進行できない
|
||||
next: ai_no_fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -208,105 +159,100 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
# ===========================================
|
||||
# Movement 3: Expert Reviews (Parallel)
|
||||
# ===========================================
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: cqrs-es-review
|
||||
edit: false
|
||||
persona: cqrs-es-reviewer
|
||||
policy: review
|
||||
knowledge: [cqrs-es, backend]
|
||||
report:
|
||||
name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
knowledge:
|
||||
- cqrs-es
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
|
||||
output_contracts:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -323,17 +269,10 @@ movements:
|
||||
- condition: 修正を進行できない
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
# ===========================================
|
||||
# Movement 4: Supervision
|
||||
# ===========================================
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -346,14 +285,21 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, cqrs-es, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- cqrs-es
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -369,3 +315,12 @@ movements:
|
||||
next: supervise
|
||||
- condition: 修正を進行できない
|
||||
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
|
||||
supervise: ../instructions/supervise.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
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -52,6 +58,9 @@ movements:
|
||||
next: implement
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -65,9 +74,6 @@ movements:
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -89,15 +95,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -110,6 +116,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -163,9 +172,6 @@ movements:
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
report:
|
||||
name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -176,14 +182,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -194,14 +200,14 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -212,15 +218,15 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -231,6 +237,9 @@ movements:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
@ -268,9 +277,6 @@ movements:
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -283,6 +289,9 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -316,12 +325,3 @@ policies:
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.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
|
||||
description: アーキテクチャ・フロントエンド・セキュリティ・QA専門家レビュー
|
||||
|
||||
max_iterations: 30
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
qa: ../policies/qa.md
|
||||
|
||||
knowledge:
|
||||
frontend: ../knowledge/frontend.md
|
||||
backend: ../knowledge/backend.md
|
||||
security: ../knowledge/security.md
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
coder: ../personas/coder.md
|
||||
@ -45,7 +21,6 @@ personas:
|
||||
security-reviewer: ../personas/security-reviewer.md
|
||||
qa-reviewer: ../personas/qa-reviewer.md
|
||||
expert-supervisor: ../personas/expert-supervisor.md
|
||||
|
||||
instructions:
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
@ -59,29 +34,11 @@ instructions:
|
||||
fix: ../instructions/fix.md
|
||||
supervise: ../instructions/supervise.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
|
||||
|
||||
movements:
|
||||
# ===========================================
|
||||
# Movement 0: Planning
|
||||
# ===========================================
|
||||
- name: plan
|
||||
edit: false
|
||||
persona: planner
|
||||
report:
|
||||
name: 00-plan.md
|
||||
format: plan
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -95,10 +52,9 @@ movements:
|
||||
next: implement
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
|
||||
# ===========================================
|
||||
# Movement 1: Implementation
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -106,10 +62,11 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -131,19 +88,15 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
# ===========================================
|
||||
# Movement 2: AI Review
|
||||
# ===========================================
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -156,7 +109,9 @@ movements:
|
||||
next: reviewers
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -164,7 +119,11 @@ movements:
|
||||
- coding
|
||||
- testing
|
||||
session: refresh
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -182,7 +141,6 @@ movements:
|
||||
next: ai_no_fix
|
||||
- condition: 修正を進行できない
|
||||
next: ai_no_fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -197,105 +155,99 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
# ===========================================
|
||||
# Movement 3: Expert Reviews (Parallel)
|
||||
# ===========================================
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: [architecture, backend]
|
||||
report:
|
||||
name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
knowledge:
|
||||
- architecture
|
||||
- backend
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
edit: false
|
||||
persona: frontend-reviewer
|
||||
policy: review
|
||||
knowledge: frontend
|
||||
report:
|
||||
name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
|
||||
output_contracts:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 06-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
policy:
|
||||
- review
|
||||
- qa
|
||||
report:
|
||||
name: 07-qa-review.md
|
||||
format: qa-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -312,17 +264,10 @@ movements:
|
||||
- condition: 修正を進行できない
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
# ===========================================
|
||||
# Movement 4: Supervision
|
||||
# ===========================================
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: expert-supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -335,14 +280,20 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
|
||||
output_contracts:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
knowledge: [frontend, backend, security, architecture]
|
||||
knowledge:
|
||||
- frontend
|
||||
- backend
|
||||
- security
|
||||
- architecture
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -358,3 +309,12 @@ movements:
|
||||
next: supervise
|
||||
- condition: 修正を進行できない
|
||||
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
|
||||
description: MAGI合議システム - 3つの観点から分析し多数決で判定
|
||||
|
||||
max_iterations: 5
|
||||
|
||||
personas:
|
||||
melchior: ../personas/melchior.md
|
||||
balthasar: ../personas/balthasar.md
|
||||
casper: ../personas/casper.md
|
||||
|
||||
initial_movement: melchior
|
||||
|
||||
movements:
|
||||
- name: melchior
|
||||
persona: melchior
|
||||
@ -60,7 +43,6 @@ movements:
|
||||
rules:
|
||||
- condition: 判定を完了した
|
||||
next: balthasar
|
||||
|
||||
- name: balthasar
|
||||
persona: balthasar
|
||||
allowed_tools:
|
||||
@ -101,7 +83,6 @@ movements:
|
||||
rules:
|
||||
- condition: 判定を完了した
|
||||
next: casper
|
||||
|
||||
- name: casper
|
||||
persona: casper
|
||||
allowed_tools:
|
||||
|
||||
@ -14,6 +14,8 @@ instructions:
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
initial_movement: implement
|
||||
movements:
|
||||
- name: implement
|
||||
@ -23,9 +25,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -46,6 +45,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -54,9 +56,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -67,13 +66,13 @@ movements:
|
||||
rules:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -85,6 +84,9 @@ movements:
|
||||
rules:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -195,5 +197,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: Minimal development piece (implement -> parallel review -> fix if needed -> complete)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
implement: ../instructions/implement.md
|
||||
review-ai: ../instructions/review-ai.md
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
|
||||
output_contracts:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
initial_movement: implement
|
||||
|
||||
movements:
|
||||
- name: implement
|
||||
edit: true
|
||||
@ -46,9 +24,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -69,7 +44,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -78,41 +55,37 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: review-ai
|
||||
rules:
|
||||
- condition: "AI特有の問題なし"
|
||||
- condition: "AI特有の問題あり"
|
||||
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
rules:
|
||||
- condition: "すべて問題なし"
|
||||
- condition: "要求未達成、テスト失敗、ビルドエラー"
|
||||
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -122,7 +95,6 @@ movements:
|
||||
next: ai_fix
|
||||
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
||||
next: supervise_fix
|
||||
|
||||
- name: fix_both
|
||||
parallel:
|
||||
- name: ai_fix_parallel
|
||||
@ -136,7 +108,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -146,7 +117,6 @@ movements:
|
||||
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
||||
- condition: 判断できない、情報不足
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix_parallel
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -158,7 +128,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -167,13 +136,11 @@ movements:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
- condition: 修正を進行できない
|
||||
instruction: fix-supervisor
|
||||
|
||||
rules:
|
||||
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
||||
next: reviewers
|
||||
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
||||
next: implement
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -198,7 +165,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: implement
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -221,3 +187,5 @@ movements:
|
||||
- condition: 修正を進行できない
|
||||
next: implement
|
||||
instruction: fix-supervisor
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
@ -15,8 +15,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -38,6 +36,8 @@ movements:
|
||||
interactive_only: true
|
||||
instruction_template: |
|
||||
タスクをこなしてください。
|
||||
output_contracts:
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
testing: ../policies/testing.md
|
||||
|
||||
@ -1,25 +1,12 @@
|
||||
# Passthrough TAKT Piece
|
||||
# タスクをそのままエージェントに渡す最薄ラッパー。
|
||||
#
|
||||
# フロー:
|
||||
# execute (タスク実行)
|
||||
# ↓
|
||||
# COMPLETE
|
||||
|
||||
name: passthrough
|
||||
description: Single-agent thin wrapper. Pass task directly to coder as-is.
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
testing: ../policies/testing.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
|
||||
initial_movement: execute
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
@ -27,8 +14,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -50,3 +35,5 @@ movements:
|
||||
interactive_only: true
|
||||
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
|
||||
description: 調査ピース - 質問せずに自律的に調査を実行
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
personas:
|
||||
research-planner: ../personas/research-planner.md
|
||||
research-digger: ../personas/research-digger.md
|
||||
research-supervisor: ../personas/research-supervisor.md
|
||||
|
||||
initial_movement: plan
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
persona: research-planner
|
||||
@ -63,7 +42,6 @@ movements:
|
||||
next: dig
|
||||
- condition: 情報が不足しており計画を立てられない
|
||||
next: ABORT
|
||||
|
||||
- name: dig
|
||||
persona: research-digger
|
||||
allowed_tools:
|
||||
@ -104,7 +82,6 @@ movements:
|
||||
next: supervise
|
||||
- condition: 調査を実行できない
|
||||
next: ABORT
|
||||
|
||||
- name: supervise
|
||||
persona: research-supervisor
|
||||
allowed_tools:
|
||||
|
||||
@ -14,6 +14,8 @@ instructions:
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
report_formats:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
initial_movement: reviewers
|
||||
movements:
|
||||
- name: implement
|
||||
@ -23,9 +25,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -46,6 +45,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -54,9 +56,6 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -67,13 +66,13 @@ movements:
|
||||
rules:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -85,6 +84,9 @@ movements:
|
||||
rules:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -195,5 +197,3 @@ policies:
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.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
|
||||
description: 既存コードのレビューと修正ピース(レビュー開始、実装なし)
|
||||
|
||||
max_iterations: 20
|
||||
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
review: ../policies/review.md
|
||||
testing: ../policies/testing.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
personas:
|
||||
coder: ../personas/coder.md
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
|
||||
instructions:
|
||||
implement: ../instructions/implement.md
|
||||
review-ai: ../instructions/review-ai.md
|
||||
ai-fix: ../instructions/ai-fix.md
|
||||
supervise: ../instructions/supervise.md
|
||||
fix-supervisor: ../instructions/fix-supervisor.md
|
||||
|
||||
output_contracts:
|
||||
ai-review: ../output-contracts/ai-review.md
|
||||
|
||||
initial_movement: reviewers
|
||||
|
||||
movements:
|
||||
- name: implement
|
||||
edit: true
|
||||
@ -46,9 +24,6 @@ movements:
|
||||
policy:
|
||||
- coding
|
||||
- testing
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -69,7 +44,9 @@ movements:
|
||||
next: implement
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
|
||||
output_contracts:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -78,41 +55,37 @@ movements:
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: review-ai
|
||||
rules:
|
||||
- condition: "AI特有の問題なし"
|
||||
- condition: "AI特有の問題あり"
|
||||
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
rules:
|
||||
- condition: "すべて問題なし"
|
||||
- condition: "要求未達成、テスト失敗、ビルドエラー"
|
||||
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -122,7 +95,6 @@ movements:
|
||||
next: ai_fix
|
||||
- condition: any("要求未達成、テスト失敗、ビルドエラー")
|
||||
next: supervise_fix
|
||||
|
||||
- name: fix_both
|
||||
parallel:
|
||||
- name: ai_fix_parallel
|
||||
@ -136,7 +108,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -146,7 +117,6 @@ movements:
|
||||
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
|
||||
- condition: 判断できない、情報不足
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix_parallel
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -158,7 +128,6 @@ movements:
|
||||
- Glob
|
||||
- Grep
|
||||
- Edit
|
||||
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
@ -167,13 +136,11 @@ movements:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
- condition: 修正を進行できない
|
||||
instruction: fix-supervisor
|
||||
|
||||
rules:
|
||||
- condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した")
|
||||
next: reviewers
|
||||
- condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない")
|
||||
next: implement
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -198,7 +165,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: implement
|
||||
instruction: ai-fix
|
||||
|
||||
- name: supervise_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -221,3 +187,5 @@ movements:
|
||||
- condition: 修正を進行できない
|
||||
next: implement
|
||||
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
|
||||
description: レビュー専用ピース - コードをレビューするだけで編集は行わない
|
||||
|
||||
max_iterations: 10
|
||||
|
||||
policies:
|
||||
review: ../policies/review.md
|
||||
ai-antipattern: ../policies/ai-antipattern.md
|
||||
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
security: ../knowledge/security.md
|
||||
|
||||
personas:
|
||||
planner: ../personas/planner.md
|
||||
architecture-reviewer: ../personas/architecture-reviewer.md
|
||||
@ -39,20 +14,11 @@ personas:
|
||||
ai-antipattern-reviewer: ../personas/ai-antipattern-reviewer.md
|
||||
supervisor: ../personas/supervisor.md
|
||||
pr-commenter: ../personas/pr-commenter.md
|
||||
|
||||
instructions:
|
||||
review-arch: ../instructions/review-arch.md
|
||||
review-security: ../instructions/review-security.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
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
edit: false
|
||||
@ -88,7 +54,6 @@ movements:
|
||||
|
||||
**PR番号が記載されている場合**(例: "PR #42")、レビュアーが
|
||||
PRの変更ファイルに集中できるよう計画に含めてください。
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -96,73 +61,65 @@ movements:
|
||||
persona: architecture-reviewer
|
||||
policy: review
|
||||
knowledge: architecture
|
||||
report:
|
||||
name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
|
||||
output_contracts:
|
||||
- name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
- name: security-review
|
||||
edit: false
|
||||
persona: security-reviewer
|
||||
policy: review
|
||||
knowledge: security
|
||||
report:
|
||||
name: 02-security-review.md
|
||||
format: security-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
|
||||
output_contracts:
|
||||
- name: 02-security-review.md
|
||||
format: security-review
|
||||
- name: ai-review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
policy:
|
||||
- review
|
||||
- ai-antipattern
|
||||
report:
|
||||
name: 03-ai-review.md
|
||||
format: ai-review
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
rules:
|
||||
- condition: approved
|
||||
- condition: needs_fix
|
||||
instruction: review-ai
|
||||
output_contracts:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
rules:
|
||||
- condition: all("approved")
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: supervise
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
policy: review
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
allowed_tools:
|
||||
- Read
|
||||
- Glob
|
||||
@ -218,7 +175,8 @@ movements:
|
||||
## 改善提案
|
||||
- {全レビューからの統合提案}
|
||||
```
|
||||
|
||||
output_contracts:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
persona: pr-commenter
|
||||
@ -269,3 +227,8 @@ movements:
|
||||
---
|
||||
*[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: # 指示テンプレート定義(任意)
|
||||
plan: ../instructions/plan.md
|
||||
implement: ../instructions/implement.md
|
||||
output_contracts: # 出力契約定義(任意)
|
||||
report_formats: # レポートフォーマット定義(任意)
|
||||
plan: ../output-contracts/plan.md
|
||||
review: ../output-contracts/architecture-review.md
|
||||
knowledge: # ナレッジ定義(任意)
|
||||
@ -57,7 +57,8 @@ movement 内では**キー名**で参照する(パスを直接書かない)
|
||||
allowed_tools: [...] # 許可ツール一覧(任意、参考情報)
|
||||
instruction_template: | # インライン指示テンプレート(instruction キーの代替、任意)
|
||||
指示内容...
|
||||
report: ... # レポート設定(任意)
|
||||
output_contracts: [...] # 出力契約設定(任意)
|
||||
quality_gates: [...] # 品質ゲート(AIへの指示、任意)
|
||||
rules: [...] # 遷移ルール(必須)
|
||||
```
|
||||
|
||||
@ -74,9 +75,9 @@ movement 内では**キー名**で参照する(パスを直接書かない)
|
||||
knowledge: architecture
|
||||
edit: false
|
||||
instruction: review-arch
|
||||
report:
|
||||
name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
output_contracts:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
- condition: "approved"
|
||||
- condition: "needs_fix"
|
||||
@ -129,39 +130,54 @@ rules:
|
||||
| `ABORT` | ピース失敗終了 |
|
||||
| movement 名 | 指定された movement に遷移 |
|
||||
|
||||
## Report 定義
|
||||
## Output Contracts 定義
|
||||
|
||||
### 形式1: 単一レポート(name + format キー参照)
|
||||
Movement の出力契約(レポート定義)。配列形式で指定する。
|
||||
|
||||
### 形式1: name + format(フォーマット参照)
|
||||
|
||||
```yaml
|
||||
report:
|
||||
name: 01-plan.md
|
||||
format: plan # output_contracts マップのキーを参照
|
||||
output_contracts:
|
||||
- name: 01-plan.md
|
||||
format: plan # report_formats マップのキーを参照
|
||||
```
|
||||
|
||||
`format` がキー文字列の場合、トップレベル `output_contracts:` セクションから対応する .md ファイルを読み込み、出力契約指示として使用する。
|
||||
`format` がキー文字列の場合、トップレベル `report_formats:` セクションから対応する .md ファイルを読み込み、出力契約指示として使用する。
|
||||
|
||||
### 形式1b: 単一レポート(name + format インライン)
|
||||
### 形式1b: name + format(インライン)
|
||||
|
||||
```yaml
|
||||
report:
|
||||
name: 01-plan.md
|
||||
format: | # インラインでフォーマットを記述
|
||||
# レポートタイトル
|
||||
## セクション
|
||||
{内容}
|
||||
output_contracts:
|
||||
- name: 01-plan.md
|
||||
format: | # インラインでフォーマットを記述
|
||||
# レポートタイトル
|
||||
## セクション
|
||||
{内容}
|
||||
```
|
||||
|
||||
### 形式2: 複数レポート(配列)
|
||||
### 形式2: label + path(ラベル付きパス)
|
||||
|
||||
```yaml
|
||||
report:
|
||||
output_contracts:
|
||||
- Summary: summary.md
|
||||
- Scope: 01-scope.md
|
||||
- Decisions: 02-decisions.md
|
||||
```
|
||||
|
||||
各要素のキーがレポート種別名、値がファイル名。
|
||||
各要素のキーがレポート種別名(ラベル)、値がファイル名。
|
||||
|
||||
## Quality Gates 定義
|
||||
|
||||
Movement 完了時の品質要件を AI への指示として定義する。自動検証は行わない。
|
||||
|
||||
```yaml
|
||||
quality_gates:
|
||||
- 全てのテストがパスすること
|
||||
- TypeScript の型エラーがないこと
|
||||
- ESLint 違反がないこと
|
||||
```
|
||||
|
||||
配列で複数の品質基準を指定できる。エージェントはこれらの基準を満たしてから Movement を完了する必要がある。
|
||||
|
||||
## テンプレート変数
|
||||
|
||||
|
||||
@ -350,7 +350,7 @@ instructions:
|
||||
knowledge:
|
||||
architecture: ../knowledge/architecture.md
|
||||
|
||||
output_contracts:
|
||||
report_formats:
|
||||
review: ../output-contracts/review.md
|
||||
|
||||
movements:
|
||||
@ -369,9 +369,9 @@ movements:
|
||||
policy: review # 異なる RULES
|
||||
instruction: review # 異なる WHAT(共有も可能)
|
||||
knowledge: architecture # 同じ CONTEXT — 再利用
|
||||
report:
|
||||
name: review.md
|
||||
format: review # OUTPUT — output_contracts.review を参照
|
||||
output_contracts:
|
||||
- name: review.md
|
||||
format: review # OUTPUT — report_formats.review を参照
|
||||
edit: false
|
||||
rules:
|
||||
- condition: Approved
|
||||
|
||||
@ -146,15 +146,15 @@ describe('default piece parallel reviewers movement', () => {
|
||||
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 reviewersMovement = piece!.movements.find((s) => s.name === 'reviewers')!;
|
||||
|
||||
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')!;
|
||||
expect(qaReview.report).toBeDefined();
|
||||
expect(qaReview.outputContracts).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@ import { join } from 'node:path';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { isReportObjectConfig } from '../core/piece/index.js';
|
||||
import type { PieceMovement, ReportObjectConfig, ReportConfig } from '../core/models/index.js';
|
||||
import { isOutputContractItem } from '../core/piece/index.js';
|
||||
import type { PieceMovement, OutputContractItem, OutputContractLabelPath, OutputContractEntry } from '../core/models/index.js';
|
||||
|
||||
/**
|
||||
* Extracted emitMovementReports logic for unit testing.
|
||||
@ -23,17 +23,12 @@ function emitMovementReports(
|
||||
reportDir: string,
|
||||
projectCwd: string,
|
||||
): void {
|
||||
if (!movement.report || !reportDir) return;
|
||||
if (!movement.outputContracts || movement.outputContracts.length === 0 || !reportDir) return;
|
||||
const baseDir = join(projectCwd, reportDir);
|
||||
|
||||
if (typeof movement.report === 'string') {
|
||||
emitIfReportExists(emitter, movement, baseDir, movement.report);
|
||||
} else if (isReportObjectConfig(movement.report)) {
|
||||
emitIfReportExists(emitter, movement, baseDir, movement.report.name);
|
||||
} else {
|
||||
for (const rc of movement.report) {
|
||||
emitIfReportExists(emitter, movement, baseDir, rc.path);
|
||||
}
|
||||
for (const entry of movement.outputContracts) {
|
||||
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||
emitIfReportExists(emitter, movement, baseDir, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,9 +72,10 @@ describe('emitMovementReports', () => {
|
||||
rmSync(tmpDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it('should emit movement:report when string report file exists', () => {
|
||||
// Given: a movement with string report and the file exists
|
||||
const movement = createMovement({ report: 'plan.md' });
|
||||
it('should emit movement:report when output contract file exists', () => {
|
||||
// Given: a movement with output contract and the file exists
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
@ -93,9 +89,10 @@ describe('emitMovementReports', () => {
|
||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, 'plan.md'), 'plan.md');
|
||||
});
|
||||
|
||||
it('should not emit when string report file does not exist', () => {
|
||||
// Given: a movement with string report but file doesn't exist
|
||||
const movement = createMovement({ report: 'missing.md' });
|
||||
it('should not emit when output contract file does not exist', () => {
|
||||
// Given: a movement with output contract but file doesn't exist
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'missing.md' }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
emitter.on('movement:report', handler);
|
||||
@ -107,10 +104,10 @@ describe('emitMovementReports', () => {
|
||||
expect(handler).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should emit movement:report when ReportObjectConfig report file exists', () => {
|
||||
// Given: a movement with ReportObjectConfig and the file exists
|
||||
const report: ReportObjectConfig = { name: '03-review.md', format: '# Review' };
|
||||
const movement = createMovement({ report });
|
||||
it('should emit movement:report when OutputContractItem file exists', () => {
|
||||
// Given: a movement with OutputContractItem and the file exists
|
||||
const outputContracts: OutputContractEntry[] = [{ name: '03-review.md', format: '# Review' }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, '03-review.md'), '# Review\nOK', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
@ -124,14 +121,14 @@ describe('emitMovementReports', () => {
|
||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '03-review.md'), '03-review.md');
|
||||
});
|
||||
|
||||
it('should emit for each existing file in ReportConfig[] array', () => {
|
||||
// Given: a movement with array report, two files exist, one missing
|
||||
const report: ReportConfig[] = [
|
||||
it('should emit for each existing file in output contracts array', () => {
|
||||
// Given: a movement with array output contracts, two files exist, one missing
|
||||
const outputContracts: OutputContractEntry[] = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.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, '02-decisions.md'), '# Decisions', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
@ -147,9 +144,9 @@ describe('emitMovementReports', () => {
|
||||
expect(handler).toHaveBeenCalledWith(movement, join(reportBaseDir, '02-decisions.md'), '02-decisions.md');
|
||||
});
|
||||
|
||||
it('should not emit when movement has no report', () => {
|
||||
// Given: a movement without report
|
||||
const movement = createMovement({ report: undefined });
|
||||
it('should not emit when movement has no output contracts', () => {
|
||||
// Given: a movement without output contracts
|
||||
const movement = createMovement({ outputContracts: undefined });
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
emitter.on('movement:report', handler);
|
||||
@ -162,8 +159,9 @@ describe('emitMovementReports', () => {
|
||||
});
|
||||
|
||||
it('should not emit when reportDir is empty', () => {
|
||||
// Given: a movement with report but empty reportDir
|
||||
const movement = createMovement({ report: 'plan.md' });
|
||||
// Given: a movement with output contracts but empty reportDir
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
|
||||
@ -68,7 +68,7 @@ function buildSimpleConfig(): PieceConfig {
|
||||
initialMovement: 'review',
|
||||
movements: [
|
||||
makeMovement('review', {
|
||||
report: '00-review.md',
|
||||
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||
rules: [
|
||||
makeRule('approved', 'COMPLETE'),
|
||||
],
|
||||
@ -138,7 +138,7 @@ describe('PieceEngine: worktree reportDir resolution', () => {
|
||||
movements: [
|
||||
makeMovement('review', {
|
||||
instructionTemplate: 'Write report to {report_dir}',
|
||||
report: '00-review.md',
|
||||
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||
rules: [
|
||||
makeRule('approved', 'COMPLETE'),
|
||||
],
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
InstructionBuilder,
|
||||
isReportObjectConfig,
|
||||
isOutputContractItem,
|
||||
ReportInstructionBuilder,
|
||||
StatusJudgmentBuilder,
|
||||
generateStatusRulesComponents,
|
||||
@ -378,7 +378,7 @@ describe('instruction-builder', () => {
|
||||
it('should include report info in Phase 1 when step has report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.name = 'plan';
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/reports/20260129-test',
|
||||
language: 'en',
|
||||
@ -392,9 +392,9 @@ describe('instruction-builder', () => {
|
||||
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');
|
||||
step.report = [
|
||||
step.outputContracts = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.md' },
|
||||
];
|
||||
@ -410,9 +410,9 @@ describe('instruction-builder', () => {
|
||||
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');
|
||||
step.report = { name: '00-plan.md' };
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/reports/20260129-test',
|
||||
language: 'en',
|
||||
@ -557,7 +557,7 @@ describe('instruction-builder', () => {
|
||||
describe('buildInstruction report-free (phase separation)', () => {
|
||||
it('should include Report Directory info but NOT report output instruction in Phase 1', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/reports/20260129-test',
|
||||
language: 'en',
|
||||
@ -577,7 +577,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should NOT include output contract in buildInstruction', () => {
|
||||
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({
|
||||
reportDir: '/project/.takt/reports/20260129-test',
|
||||
language: 'en',
|
||||
@ -590,10 +590,10 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should NOT include report order in buildInstruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = {
|
||||
step.outputContracts = [{
|
||||
name: '00-plan.md',
|
||||
order: 'Custom order instruction',
|
||||
};
|
||||
}];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/reports/20260129-test',
|
||||
language: 'en',
|
||||
@ -631,7 +631,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include execution context with working directory', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext({ cwd: '/my/project' });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -641,7 +641,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include no-source-edit rule in execution rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -651,7 +651,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include no-commit and no-cd rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -662,7 +662,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include report directory and file for string report', () => {
|
||||
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 result = buildReportInstruction(step, ctx);
|
||||
@ -671,9 +671,9 @@ describe('instruction-builder', () => {
|
||||
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');
|
||||
step.report = [
|
||||
step.outputContracts = [
|
||||
{ label: 'Scope', path: '01-scope.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');
|
||||
});
|
||||
|
||||
it('should include report file for ReportObjectConfig report', () => {
|
||||
it('should include report file for OutputContractItem report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = { name: '00-plan.md' };
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -699,7 +699,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include auto-generated report output instruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -711,10 +711,10 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include explicit order instead of auto-generated', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = {
|
||||
step.outputContracts = [{
|
||||
name: '00-plan.md',
|
||||
order: 'Output to {report:00-plan.md} file.',
|
||||
};
|
||||
}];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -723,12 +723,12 @@ describe('instruction-builder', () => {
|
||||
expect(result).not.toContain('**Report output:**');
|
||||
});
|
||||
|
||||
it('should include format from ReportObjectConfig', () => {
|
||||
it('should include format from OutputContractItem', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = {
|
||||
step.outputContracts = [{
|
||||
name: '00-plan.md',
|
||||
format: '**Format:**\n```markdown\n# Plan\n```',
|
||||
};
|
||||
}];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -739,7 +739,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should replace {movement_iteration} in report output instruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext({ movementIteration: 5 });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -749,7 +749,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include instruction body text', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -760,7 +760,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should NOT include user request, previous response, or status rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.report = '00-plan.md';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.rules = [
|
||||
{ condition: 'Done', next: 'COMPLETE' },
|
||||
];
|
||||
@ -776,7 +776,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should render Japanese report instruction', () => {
|
||||
const step = createMinimalStep('作業する');
|
||||
step.report = { name: '00-plan.md' };
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
const ctx = createReportContext({ language: 'ja' });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -786,16 +786,19 @@ describe('instruction-builder', () => {
|
||||
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 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');
|
||||
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 result = buildReportInstruction(step, ctx);
|
||||
@ -1025,21 +1028,17 @@ describe('instruction-builder', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isReportObjectConfig', () => {
|
||||
it('should return true for ReportObjectConfig', () => {
|
||||
expect(isReportObjectConfig({ name: '00-plan.md' })).toBe(true);
|
||||
describe('isOutputContractItem', () => {
|
||||
it('should return true for OutputContractItem', () => {
|
||||
expect(isOutputContractItem({ name: '00-plan.md' })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for ReportObjectConfig with order/format', () => {
|
||||
expect(isReportObjectConfig({ name: '00-plan.md', order: 'output to...', format: '# Plan' })).toBe(true);
|
||||
it('should return true for OutputContractItem with order/format', () => {
|
||||
expect(isOutputContractItem({ name: '00-plan.md', order: 'output to...', format: '# Plan' })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for string', () => {
|
||||
expect(isReportObjectConfig('00-plan.md')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for ReportConfig[] (array)', () => {
|
||||
expect(isReportObjectConfig([{ label: 'Scope', path: '01-scope.md' }])).toBe(false);
|
||||
it('should return false for OutputContractLabelPath', () => {
|
||||
expect(isOutputContractItem({ 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', () => {
|
||||
const step = makeMovement({
|
||||
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, {
|
||||
@ -299,8 +299,8 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
||||
expect(result).toContain('report');
|
||||
});
|
||||
|
||||
it('should throw for step without report config', () => {
|
||||
const step = makeMovement({ report: undefined });
|
||||
it('should throw for step without output contracts', () => {
|
||||
const step = makeMovement({ outputContracts: undefined });
|
||||
|
||||
expect(() =>
|
||||
buildReportInstruction(step, {
|
||||
@ -308,7 +308,7 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
||||
reportDir: '/tmp/reports',
|
||||
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', () => {
|
||||
it('should escape curly braces in task content', () => {
|
||||
const step = makeMovement();
|
||||
|
||||
@ -324,22 +324,126 @@ describe('Piece Loader IT: report config loading', () => {
|
||||
const config = loadPiece('default', testDir);
|
||||
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');
|
||||
expect(planStep).toBeDefined();
|
||||
expect(planStep!.report).toBeDefined();
|
||||
expect(planStep!.outputContracts).toBeDefined();
|
||||
});
|
||||
|
||||
it('should load multi-report config from expert piece', () => {
|
||||
const config = loadPiece('expert', testDir);
|
||||
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');
|
||||
expect(implementStep).toBeDefined();
|
||||
expect(implementStep!.report).toBeDefined();
|
||||
expect(Array.isArray(implementStep!.report)).toBe(true);
|
||||
expect((implementStep!.report as unknown[]).length).toBe(2);
|
||||
expect(implementStep!.outputContracts).toBeDefined();
|
||||
expect(Array.isArray(implementStep!.outputContracts)).toBe(true);
|
||||
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,
|
||||
agentPath: string,
|
||||
rules: PieceRule[],
|
||||
options: { report?: string | { label: string; path: string }[]; edit?: boolean } = {},
|
||||
options: { outputContracts?: { label: string; path: string }[]; edit?: boolean } = {},
|
||||
): PieceMovement {
|
||||
return {
|
||||
name,
|
||||
@ -98,7 +98,7 @@ function makeMovement(
|
||||
instructionTemplate: '{task}',
|
||||
passPreviousResponse: true,
|
||||
rules,
|
||||
report: options.report,
|
||||
outputContracts: options.outputContracts,
|
||||
edit: options.edit,
|
||||
};
|
||||
}
|
||||
@ -190,7 +190,7 @@ describe('Three-Phase Execution IT: phase1 + phase2 (report defined)', () => {
|
||||
makeMovement('step', agentPath, [
|
||||
makeRule('Done', 'COMPLETE'),
|
||||
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: [
|
||||
makeMovement('step', agentPath, [
|
||||
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, [
|
||||
makeRule('Done', 'COMPLETE'),
|
||||
makeRule('Not done', 'ABORT'),
|
||||
], { report: 'test-report.md' }),
|
||||
], { outputContracts: [{ label: 'test', path: 'test-report.md' }] }),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@ -69,13 +69,13 @@ describe('JudgmentStrategies', () => {
|
||||
});
|
||||
|
||||
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 stepWithReport: PieceMovement = {
|
||||
const stepWithOutputContracts: PieceMovement = {
|
||||
...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', () => {
|
||||
@ -83,9 +83,9 @@ describe('JudgmentStrategies', () => {
|
||||
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();
|
||||
// mockStep has no report field → getReportFiles returns []
|
||||
// mockStep has no outputContracts field → getReportFiles returns []
|
||||
expect(strategy.canApply(mockContext)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -383,7 +383,7 @@ describe('InstructionBuilder policy injection', () => {
|
||||
expect(result).toContain('## Policy');
|
||||
expect(result).toContain('# Coding Policy');
|
||||
expect(result).toContain('Write clean code.');
|
||||
expect(result).toContain('Policy Reminder');
|
||||
expect(result).toContain('必ず遵守してください');
|
||||
});
|
||||
|
||||
it('should inject policy content into instruction (EN)', () => {
|
||||
@ -401,7 +401,7 @@ describe('InstructionBuilder policy injection', () => {
|
||||
|
||||
expect(result).toContain('## Policy');
|
||||
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', () => {
|
||||
@ -417,7 +417,6 @@ describe('InstructionBuilder policy injection', () => {
|
||||
const result = builder.build();
|
||||
|
||||
expect(result).not.toContain('## Policy');
|
||||
expect(result).not.toContain('Policy Reminder');
|
||||
});
|
||||
|
||||
it('should join multiple policies with separator', () => {
|
||||
@ -549,24 +548,24 @@ describe('section reference resolution', () => {
|
||||
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 = {
|
||||
name: 'test-piece',
|
||||
output_contracts: { plan: './output-contracts/plan.md' },
|
||||
report_formats: { plan: './output-contracts/plan.md' },
|
||||
movements: [{
|
||||
name: 'plan',
|
||||
persona: 'planner',
|
||||
instruction: '{task}',
|
||||
report: {
|
||||
output_contracts: [{
|
||||
name: '00-plan.md',
|
||||
format: 'plan',
|
||||
},
|
||||
}],
|
||||
}],
|
||||
};
|
||||
|
||||
const config = normalizePieceConfig(raw, testDir);
|
||||
const report = config.movements[0]!.report as { name: string; format?: string };
|
||||
expect(report.format).toBe('# Plan Report\n## Goal\n{goal}');
|
||||
const outputContract = config.movements[0]!.outputContracts![0] as { name: string; format?: string };
|
||||
expect(outputContract.format).toBe('# Plan Report\n## Goal\n{goal}');
|
||||
});
|
||||
|
||||
it('should treat unresolved name as inline value (no section match)', () => {
|
||||
@ -606,7 +605,7 @@ describe('section reference resolution', () => {
|
||||
personas: { coder: './personas/coder.md' },
|
||||
policies: { coding: './policies/coding.md' },
|
||||
instructions: { implement: './instructions/implement.md' },
|
||||
output_contracts: { plan: './output-contracts/plan.md' },
|
||||
report_formats: { plan: './output-contracts/plan.md' },
|
||||
movements: [{
|
||||
name: 'impl',
|
||||
persona: 'coder',
|
||||
@ -618,7 +617,7 @@ describe('section reference resolution', () => {
|
||||
expect(config.personas).toEqual({ coder: './personas/coder.md' });
|
||||
expect(config.policies).toEqual({ coding: '# Coding Policy\nWrite clean code.' });
|
||||
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', () => {
|
||||
|
||||
@ -4,8 +4,9 @@ export type {
|
||||
Status,
|
||||
RuleMatchMethod,
|
||||
PermissionMode,
|
||||
ReportConfig,
|
||||
ReportObjectConfig,
|
||||
OutputContractLabelPath,
|
||||
OutputContractItem,
|
||||
OutputContractEntry,
|
||||
AgentResponse,
|
||||
SessionState,
|
||||
PieceRule,
|
||||
|
||||
@ -32,24 +32,27 @@ export interface PieceRule {
|
||||
aggregateConditionText?: string | string[];
|
||||
}
|
||||
|
||||
/** Report file configuration for a piece movement (label: path pair) */
|
||||
export interface ReportConfig {
|
||||
/** Output contract configuration (label: path pair format) */
|
||||
export interface OutputContractLabelPath {
|
||||
/** Display label (e.g., "Scope", "Decisions") */
|
||||
label: string;
|
||||
/** File path relative to report directory (e.g., "01-coder-scope.md") */
|
||||
path: string;
|
||||
}
|
||||
|
||||
/** Report object configuration with order/format instructions */
|
||||
export interface ReportObjectConfig {
|
||||
/** Output contract item configuration with order/format instructions */
|
||||
export interface OutputContractItem {
|
||||
/** Report file name (e.g., "00-plan.md") */
|
||||
name: string;
|
||||
/** Instruction prepended before instruction_template (e.g., output destination) */
|
||||
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;
|
||||
}
|
||||
|
||||
/** Union type for output contract entries */
|
||||
export type OutputContractEntry = OutputContractLabelPath | OutputContractItem;
|
||||
|
||||
/** Single movement in a piece */
|
||||
export interface PieceMovement {
|
||||
name: string;
|
||||
@ -76,8 +79,10 @@ export interface PieceMovement {
|
||||
instructionTemplate: string;
|
||||
/** Rules for movement routing */
|
||||
rules?: PieceRule[];
|
||||
/** Report file configuration. Single string, array of label:path, or object with order/format. */
|
||||
report?: string | ReportConfig[] | ReportObjectConfig;
|
||||
/** Output contracts for this movement (report definitions) */
|
||||
outputContracts?: OutputContractEntry[];
|
||||
/** Quality gates for this movement (AI directives for completion requirements) */
|
||||
qualityGates?: string[];
|
||||
passPreviousResponse: boolean;
|
||||
/** Sub-movements to execute in parallel. When set, this movement runs all sub-movements concurrently. */
|
||||
parallel?: PieceMovement[];
|
||||
@ -137,8 +142,8 @@ export interface PieceConfig {
|
||||
knowledge?: Record<string, string>;
|
||||
/** Resolved instruction definitions — map of name to file content (resolved at parse time) */
|
||||
instructions?: Record<string, string>;
|
||||
/** Resolved output contract definitions — map of name to file content (resolved at parse time) */
|
||||
outputContracts?: Record<string, string>;
|
||||
/** Resolved report format definitions — map of name to file content (resolved at parse time) */
|
||||
reportFormats?: Record<string, string>;
|
||||
movements: PieceMovement[];
|
||||
initialMovement: string;
|
||||
maxIterations: number;
|
||||
|
||||
@ -56,20 +56,20 @@ export const StatusSchema = z.enum([
|
||||
export const PermissionModeSchema = z.enum(['readonly', 'edit', 'full']);
|
||||
|
||||
/**
|
||||
* Report object schema (new structured format).
|
||||
* Output contract item schema (new structured format).
|
||||
*
|
||||
* YAML format:
|
||||
* report:
|
||||
* name: 00-plan.md
|
||||
* order: |
|
||||
* **レポート出力:** {report:00-plan.md} に出力してください。
|
||||
* format: |
|
||||
* **出力契約:**
|
||||
* ```markdown
|
||||
* ...
|
||||
* ```
|
||||
* output_contracts:
|
||||
* - name: 00-plan.md
|
||||
* order: |
|
||||
* **レポート出力:** {report:00-plan.md} に出力してください。
|
||||
* format: |
|
||||
* **出力契約:**
|
||||
* ```markdown
|
||||
* ...
|
||||
* ```
|
||||
*/
|
||||
export const ReportObjectSchema = z.object({
|
||||
export const OutputContractItemSchema = z.object({
|
||||
/** Report file name */
|
||||
name: z.string().min(1),
|
||||
/** 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:
|
||||
* report: 00-plan.md # single file (string)
|
||||
* report: # multiple files (label: path map entries)
|
||||
* output_contracts: # array of label:path entries
|
||||
* - Scope: 01-scope.md
|
||||
* - Decisions: 02-decisions.md
|
||||
* report: # object form (name + order + format)
|
||||
* name: 00-plan.md
|
||||
* order: ...
|
||||
* format: ...
|
||||
* output_contracts: # array of objects (name + order + format)
|
||||
* - name: 00-plan.md
|
||||
* order: ...
|
||||
* 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([
|
||||
z.string().min(1),
|
||||
z.array(z.record(z.string(), z.string())).min(1),
|
||||
ReportObjectSchema,
|
||||
]);
|
||||
export const OutputContractsFieldSchema = z.array(
|
||||
z.union([
|
||||
z.record(z.string(), z.string()), // {Scope: "01-scope.md"} format
|
||||
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) */
|
||||
export const PieceRuleSchema = z.object({
|
||||
@ -132,7 +135,10 @@ export const ParallelSubMovementRawSchema = z.object({
|
||||
instruction: z.string().optional(),
|
||||
instruction_template: z.string().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),
|
||||
});
|
||||
|
||||
@ -161,8 +167,10 @@ export const PieceMovementRawSchema = z.object({
|
||||
instruction_template: z.string().optional(),
|
||||
/** Rules for movement routing */
|
||||
rules: z.array(PieceRuleSchema).optional(),
|
||||
/** Report file(s) for this movement */
|
||||
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),
|
||||
/** Sub-movements to execute in parallel */
|
||||
parallel: z.array(ParallelSubMovementRawSchema).optional(),
|
||||
@ -208,8 +216,8 @@ export const PieceConfigRawSchema = z.object({
|
||||
knowledge: z.record(z.string(), z.string()).optional(),
|
||||
/** Piece-level instruction definitions — map of name to .md file path or inline content */
|
||||
instructions: z.record(z.string(), z.string()).optional(),
|
||||
/** Piece-level output contract definitions — map of name to .md file path or inline content */
|
||||
output_contracts: z.record(z.string(), z.string()).optional(),
|
||||
/** Piece-level report format definitions — map of name to .md file path or inline content */
|
||||
report_formats: z.record(z.string(), z.string()).optional(),
|
||||
movements: z.array(PieceMovementRawSchema).min(1),
|
||||
initial_movement: z.string().optional(),
|
||||
max_iterations: z.number().int().positive().optional().default(10),
|
||||
|
||||
@ -26,8 +26,9 @@ export type {
|
||||
// Piece configuration and runtime state
|
||||
export type {
|
||||
PieceRule,
|
||||
ReportConfig,
|
||||
ReportObjectConfig,
|
||||
OutputContractLabelPath,
|
||||
OutputContractItem,
|
||||
OutputContractEntry,
|
||||
PieceMovement,
|
||||
LoopDetectionConfig,
|
||||
LoopMonitorConfig,
|
||||
|
||||
@ -16,7 +16,7 @@ import type {
|
||||
} from '../../models/types.js';
|
||||
import type { PhaseName } from '../types.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 { detectMatchedRule } from '../evaluation/index.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);
|
||||
|
||||
// Phase 2: report output (resume same session, Write only)
|
||||
if (step.report) {
|
||||
if (step.outputContracts && step.outputContracts.length > 0) {
|
||||
await runReportPhase(step, movementIteration, phaseCtx);
|
||||
}
|
||||
|
||||
@ -149,18 +149,12 @@ export class MovementExecutor {
|
||||
|
||||
/** Collect movement:report events for each report file that exists */
|
||||
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());
|
||||
|
||||
if (typeof step.report === 'string') {
|
||||
this.checkReportFile(step, baseDir, step.report);
|
||||
} else if (isReportObjectConfig(step.report)) {
|
||||
this.checkReportFile(step, baseDir, step.report.name);
|
||||
} else {
|
||||
// ReportConfig[] (array)
|
||||
for (const rc of step.report) {
|
||||
this.checkReportFile(step, baseDir, rc.path);
|
||||
}
|
||||
for (const entry of step.outputContracts) {
|
||||
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||
this.checkReportFile(step, baseDir, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -53,10 +53,11 @@ export class OptionsBuilder {
|
||||
|
||||
/** Build RunAgentOptions for Phase 1 (main execution) */
|
||||
buildAgentOptions(step: PieceMovement): RunAgentOptions {
|
||||
// Phase 1: exclude Write from allowedTools when movement has report config AND edit is NOT enabled
|
||||
// (If edit is enabled, Write is needed for code implementation even if report exists)
|
||||
// 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 output contracts exist)
|
||||
// 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;
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ export class ParallelRunner {
|
||||
const phaseCtx = this.deps.optionsBuilder.buildPhaseRunnerContext(state, subResponse.content, updatePersonaSession, this.deps.onPhaseStart, this.deps.onPhaseComplete);
|
||||
|
||||
// Phase 2: report output for sub-movement
|
||||
if (subMovement.report) {
|
||||
if (subMovement.outputContracts && subMovement.outputContracts.length > 0) {
|
||||
await runReportPhase(subMovement, subIteration, phaseCtx);
|
||||
}
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
* Shared rule utility functions used by both engine.ts and instruction-builder.ts.
|
||||
*/
|
||||
|
||||
import type { PieceMovement } from '../../models/types.js';
|
||||
import { isReportObjectConfig } from '../instruction/InstructionBuilder.js';
|
||||
import type { PieceMovement, OutputContractEntry } from '../../models/types.js';
|
||||
import { isOutputContractItem } from '../instruction/InstructionBuilder.js';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Handles all three report config formats: string, ReportObjectConfig, and ReportConfig[].
|
||||
* Get report file names from a movement's output contracts.
|
||||
*/
|
||||
export function getReportFiles(report: PieceMovement['report']): string[] {
|
||||
if (!report) return [];
|
||||
if (typeof report === 'string') return [report];
|
||||
if (isReportObjectConfig(report)) return [report.name];
|
||||
return report.map((rc) => rc.path);
|
||||
export function getReportFiles(outputContracts: OutputContractEntry[] | undefined): string[] {
|
||||
if (!outputContracts || outputContracts.length === 0) return [];
|
||||
return outputContracts.map((entry) => {
|
||||
if (isOutputContractItem(entry)) return entry.name;
|
||||
return entry.path;
|
||||
});
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ export { handleBlocked, type BlockedHandlerResult } from './engine/blocked-handl
|
||||
export { ParallelLogger } from './engine/parallel-logger.js';
|
||||
|
||||
// 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 { StatusJudgmentBuilder, type StatusJudgmentContext } from './instruction/StatusJudgmentBuilder.js';
|
||||
export { buildEditRule, type InstructionContext } from './instruction/instruction-context.js';
|
||||
|
||||
@ -5,17 +5,24 @@
|
||||
* 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 { buildEditRule } from './instruction-context.js';
|
||||
import { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.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 {
|
||||
return typeof report === 'object' && !Array.isArray(report) && 'name' in report;
|
||||
export function isOutputContractItem(entry: OutputContractEntry): entry is OutputContractItem {
|
||||
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)
|
||||
const pieceStructure = this.buildPieceStructure(language);
|
||||
|
||||
// Report info
|
||||
const hasReport = !!(this.step.report && this.context.reportDir);
|
||||
// Report info (from output contracts)
|
||||
const hasReport = !!(this.step.outputContracts && this.step.outputContracts.length > 0 && this.context.reportDir);
|
||||
let reportInfo = '';
|
||||
let phaseNote = '';
|
||||
if (hasReport && this.step.report && this.context.reportDir) {
|
||||
reportInfo = renderReportContext(this.step.report, this.context.reportDir);
|
||||
if (hasReport && this.step.outputContracts && this.context.reportDir) {
|
||||
reportInfo = renderReportContext(this.step.outputContracts, this.context.reportDir);
|
||||
phaseNote = language === 'ja'
|
||||
? '**注意:** これは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.';
|
||||
@ -108,6 +115,12 @@ export class InstructionBuilder {
|
||||
const hasKnowledge = !!(knowledgeContents && knowledgeContents.length > 0);
|
||||
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, {
|
||||
workingDirectory: this.context.cwd,
|
||||
editRule,
|
||||
@ -133,6 +146,8 @@ export class InstructionBuilder {
|
||||
policyContent,
|
||||
hasKnowledge,
|
||||
knowledgeContent,
|
||||
hasQualityGates,
|
||||
qualityGatesContent,
|
||||
instructions,
|
||||
});
|
||||
}
|
||||
@ -165,7 +180,7 @@ export class InstructionBuilder {
|
||||
* Used by InstructionBuilder and ReportInstructionBuilder.
|
||||
*/
|
||||
export function renderReportContext(
|
||||
report: string | ReportConfig[] | ReportObjectConfig,
|
||||
outputContracts: OutputContractEntry[],
|
||||
reportDir: string,
|
||||
): string {
|
||||
const reportDirectory = 'Report Directory';
|
||||
@ -176,14 +191,18 @@ export function renderReportContext(
|
||||
`- ${reportDirectory}: ${reportDir}/`,
|
||||
];
|
||||
|
||||
if (typeof report === 'string') {
|
||||
lines.push(`- ${reportFile}: ${reportDir}/${report}`);
|
||||
} else if (isReportObjectConfig(report)) {
|
||||
lines.push(`- ${reportFile}: ${reportDir}/${report.name}`);
|
||||
if (outputContracts.length === 1) {
|
||||
const entry = outputContracts[0]!;
|
||||
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||
lines.push(`- ${reportFile}: ${reportDir}/${fileName}`);
|
||||
} else {
|
||||
lines.push(`- ${reportFiles}:`);
|
||||
for (const file of report) {
|
||||
lines.push(` - ${file.label}: ${reportDir}/${file.path}`);
|
||||
for (const entry of outputContracts) {
|
||||
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.
|
||||
* Returns empty string if movement has no report or no reportDir.
|
||||
* Generate report output instructions from movement's output contracts.
|
||||
* Returns empty string if movement has no output contracts or no reportDir.
|
||||
*/
|
||||
export function renderReportOutputInstruction(
|
||||
step: PieceMovement,
|
||||
context: InstructionContext,
|
||||
language: Language,
|
||||
): 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 createRule: string;
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
* 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 { 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';
|
||||
|
||||
/**
|
||||
@ -39,8 +39,8 @@ export class ReportInstructionBuilder {
|
||||
) {}
|
||||
|
||||
build(): string {
|
||||
if (!this.step.report) {
|
||||
throw new Error(`ReportInstructionBuilder called for movement "${this.step.name}" which has no report config`);
|
||||
if (!this.step.outputContracts || this.step.outputContracts.length === 0) {
|
||||
throw new Error(`ReportInstructionBuilder called for movement "${this.step.name}" which has no output contracts`);
|
||||
}
|
||||
|
||||
const language = this.context.language ?? 'en';
|
||||
@ -50,7 +50,7 @@ export class ReportInstructionBuilder {
|
||||
if (this.context.targetFile) {
|
||||
reportContext = `- Report Directory: ${this.context.reportDir}/\n- Report File: ${this.context.reportDir}/${this.context.targetFile}`;
|
||||
} else {
|
||||
reportContext = renderReportContext(this.step.report, this.context.reportDir);
|
||||
reportContext = renderReportContext(this.step.outputContracts, this.context.reportDir);
|
||||
}
|
||||
|
||||
// Build report output instruction
|
||||
@ -68,8 +68,10 @@ export class ReportInstructionBuilder {
|
||||
language,
|
||||
};
|
||||
|
||||
if (isReportObjectConfig(this.step.report) && this.step.report.order) {
|
||||
reportOutput = replaceTemplatePlaceholders(this.step.report.order.trimEnd(), this.step, instrContext);
|
||||
// Check for order instruction in first output contract item
|
||||
const firstContract = this.step.outputContracts[0];
|
||||
if (firstContract && isOutputContractItem(firstContract) && firstContract.order) {
|
||||
reportOutput = replaceTemplatePlaceholders(firstContract.order.trimEnd(), this.step, instrContext);
|
||||
hasReportOutput = true;
|
||||
} else if (!this.context.targetFile) {
|
||||
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 hasOutputContract = false;
|
||||
if (isReportObjectConfig(this.step.report) && this.step.report.format) {
|
||||
outputContract = replaceTemplatePlaceholders(this.step.report.format.trimEnd(), this.step, instrContext);
|
||||
if (firstContract && isOutputContractItem(firstContract) && firstContract.format) {
|
||||
outputContract = replaceTemplatePlaceholders(firstContract.format.trimEnd(), this.step, instrContext);
|
||||
hasOutputContract = true;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
* 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 { StatusJudgmentBuilder, type StatusJudgmentContext } from './StatusJudgmentBuilder.js';
|
||||
export { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
||||
|
||||
@ -111,7 +111,7 @@ export class ReportBasedStrategy extends JudgmentStrategyBase {
|
||||
readonly name = 'ReportBased';
|
||||
|
||||
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> {
|
||||
@ -119,7 +119,7 @@ export class ReportBasedStrategy extends JudgmentStrategyBase {
|
||||
throw new Error('Report directory not provided');
|
||||
}
|
||||
|
||||
const reportFiles = getReportFiles(context.step.report);
|
||||
const reportFiles = getReportFiles(context.step.outputContracts);
|
||||
if (reportFiles.length === 0) {
|
||||
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 });
|
||||
|
||||
const reportFiles = getReportFiles(step.report);
|
||||
const reportFiles = getReportFiles(step.outputContracts);
|
||||
if (reportFiles.length === 0) {
|
||||
log.debug('No report files configured, skipping report phase');
|
||||
return;
|
||||
|
||||
@ -55,7 +55,7 @@ export async function previewPrompts(cwd: string, pieceIdentifier?: string): Pro
|
||||
userInputs: [],
|
||||
pieceMovements: config.movements,
|
||||
currentMovementIndex: i,
|
||||
reportDir: movement.report ? '.takt/reports/preview' : undefined,
|
||||
reportDir: movement.outputContracts && movement.outputContracts.length > 0 ? '.takt/reports/preview' : undefined,
|
||||
language,
|
||||
};
|
||||
|
||||
@ -63,8 +63,8 @@ export async function previewPrompts(cwd: string, pieceIdentifier?: string): Pro
|
||||
console.log('\n--- Phase 1 (Main Execution) ---\n');
|
||||
console.log(phase1Builder.build());
|
||||
|
||||
// Phase 2: Report output (only if movement has report config)
|
||||
if (movement.report) {
|
||||
// Phase 2: Report output (only if movement has output contracts)
|
||||
if (movement.outputContracts && movement.outputContracts.length > 0) {
|
||||
const reportBuilder = new ReportInstructionBuilder(movement, {
|
||||
cwd,
|
||||
reportDir: '.takt/reports/preview',
|
||||
|
||||
@ -113,7 +113,8 @@ export {
|
||||
handleBlocked,
|
||||
ParallelLogger,
|
||||
InstructionBuilder,
|
||||
isReportObjectConfig,
|
||||
isOutputContractItem,
|
||||
isOutputContractLabelPath,
|
||||
ReportInstructionBuilder,
|
||||
StatusJudgmentBuilder,
|
||||
buildEditRule,
|
||||
|
||||
@ -11,7 +11,7 @@ import { join, dirname, basename } from 'node:path';
|
||||
import { parse as parseYaml } from 'yaml';
|
||||
import type { z } from 'zod';
|
||||
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>;
|
||||
|
||||
@ -110,33 +110,54 @@ interface PieceSections {
|
||||
resolvedKnowledge?: Record<string, string>;
|
||||
/** Instruction name → resolved content */
|
||||
resolvedInstructions?: Record<string, string>;
|
||||
/** Output contract name → resolved content */
|
||||
resolvedOutputContracts?: Record<string, string>;
|
||||
/** Report format name → resolved content */
|
||||
resolvedReportFormats?: Record<string, string>;
|
||||
}
|
||||
|
||||
/** Check if a raw report value is the object form (has 'name' property). */
|
||||
function isReportObject(raw: unknown): raw is { name: string; order?: string; format?: string } {
|
||||
/** Check if a raw output contract item is the object form (has 'name' property). */
|
||||
function isOutputContractItem(raw: unknown): raw is { name: string; order?: string; format?: string } {
|
||||
return typeof raw === 'object' && raw !== null && !Array.isArray(raw) && 'name' in raw;
|
||||
}
|
||||
|
||||
/** Normalize the raw report field from YAML into internal format. */
|
||||
function normalizeReport(
|
||||
raw: string | Record<string, string>[] | { name: string; order?: string; format?: string } | undefined,
|
||||
/**
|
||||
* Normalize the raw output_contracts field from YAML into internal format.
|
||||
*
|
||||
* 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,
|
||||
resolvedOutputContracts?: Record<string, string>,
|
||||
): string | ReportConfig[] | ReportObjectConfig | undefined {
|
||||
if (raw == null) return undefined;
|
||||
if (typeof raw === 'string') return raw;
|
||||
if (isReportObject(raw)) {
|
||||
return {
|
||||
name: raw.name,
|
||||
order: raw.order ? resolveRefToContent(raw.order, resolvedOutputContracts, pieceDir) : undefined,
|
||||
format: raw.format ? resolveRefToContent(raw.format, resolvedOutputContracts, pieceDir) : undefined,
|
||||
};
|
||||
resolvedReportFormats?: Record<string, string>,
|
||||
): OutputContractEntry[] | undefined {
|
||||
if (raw == null || raw.length === 0) return undefined;
|
||||
|
||||
const result: OutputContractEntry[] = [];
|
||||
|
||||
for (const entry of raw) {
|
||||
if (isOutputContractItem(entry)) {
|
||||
// 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 */
|
||||
@ -255,7 +276,8 @@ function normalizeStepFromRaw(
|
||||
edit: step.edit,
|
||||
instructionTemplate: resolveResourceContent(step.instruction_template, pieceDir) || expandedInstruction || '{task}',
|
||||
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,
|
||||
policyContents,
|
||||
knowledgeContents,
|
||||
@ -307,14 +329,14 @@ export function normalizePieceConfig(raw: unknown, pieceDir: string): PieceConfi
|
||||
const resolvedPolicies = resolveSectionMap(parsed.policies, pieceDir);
|
||||
const resolvedKnowledge = resolveSectionMap(parsed.knowledge, pieceDir);
|
||||
const resolvedInstructions = resolveSectionMap(parsed.instructions, pieceDir);
|
||||
const resolvedOutputContracts = resolveSectionMap(parsed.output_contracts, pieceDir);
|
||||
const resolvedReportFormats = resolveSectionMap(parsed.report_formats, pieceDir);
|
||||
|
||||
const sections: PieceSections = {
|
||||
personas: parsed.personas,
|
||||
resolvedPolicies,
|
||||
resolvedKnowledge,
|
||||
resolvedInstructions,
|
||||
resolvedOutputContracts,
|
||||
resolvedReportFormats,
|
||||
};
|
||||
|
||||
const movements: PieceMovement[] = parsed.movements.map((step) =>
|
||||
@ -331,7 +353,7 @@ export function normalizePieceConfig(raw: unknown, pieceDir: string): PieceConfi
|
||||
policies: resolvedPolicies,
|
||||
knowledge: resolvedKnowledge,
|
||||
instructions: resolvedInstructions,
|
||||
outputContracts: resolvedOutputContracts,
|
||||
reportFormats: resolvedReportFormats,
|
||||
movements,
|
||||
initialMovement,
|
||||
maxIterations: parsed.max_iterations,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
||||
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
||||
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
||||
hasKnowledge, knowledgeContent, instructions
|
||||
hasKnowledge, knowledgeContent, hasQualityGates, qualityGatesContent, instructions
|
||||
builder: InstructionBuilder
|
||||
-->
|
||||
## Execution Context
|
||||
@ -61,6 +61,13 @@ The following knowledge is domain-specific information for this movement. Use it
|
||||
|
||||
## Instructions
|
||||
{{instructions}}
|
||||
{{#if hasQualityGates}}
|
||||
|
||||
## Quality Gates
|
||||
Before completing this movement, ensure the following requirements are met:
|
||||
|
||||
{{qualityGatesContent}}
|
||||
{{/if}}
|
||||
{{#if hasPolicy}}
|
||||
|
||||
## Policy
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
pieceStructure, iteration, movementIteration, movement, hasReport, reportInfo,
|
||||
phaseNote, hasTaskSection, userRequest, hasPreviousResponse, previousResponse,
|
||||
hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy, policyContent,
|
||||
hasKnowledge, knowledgeContent, instructions
|
||||
hasKnowledge, knowledgeContent, hasQualityGates, qualityGatesContent, instructions
|
||||
builder: InstructionBuilder
|
||||
-->
|
||||
## 実行コンテキスト
|
||||
@ -60,6 +60,13 @@
|
||||
|
||||
## Instructions
|
||||
{{instructions}}
|
||||
{{#if hasQualityGates}}
|
||||
|
||||
## Quality Gates
|
||||
このムーブメントを完了する前に、以下の要件を満たしてください:
|
||||
|
||||
{{qualityGatesContent}}
|
||||
{{/if}}
|
||||
{{#if hasPolicy}}
|
||||
|
||||
## Policy
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user