coding piece 追加と不要なパラメータを削除

This commit is contained in:
nrslib 2026-02-04 20:25:49 +09:00
parent 12ae871f16
commit e932d647c6
17 changed files with 357 additions and 64 deletions

View File

@ -71,7 +71,6 @@ movements:
Clarifications needed:
- {Question 1}
- {Question 2}
pass_previous_response: true
instruction_template: |
Analyze the task and create an implementation plan.
@ -124,7 +123,6 @@ movements:
next: implement
- condition: Insufficient info, cannot proceed
next: ABORT
pass_previous_response: true
instruction_template: |
Read the plan report ({report:00-plan.md}) and perform architecture design.
@ -231,7 +229,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 04-ai-review.md
format: |
@ -340,7 +337,6 @@ movements:
- {command and outcome}
- Judging based on assumptions
- Leaving problems that AI Reviewer REJECTED
pass_previous_response: true
- name: reviewers
parallel:
@ -492,7 +488,6 @@ movements:
- {command and outcome}
## Evidence
- {key files/grep/diff/log evidence you verified}
pass_previous_response: true
- name: supervise
edit: false

View File

@ -72,7 +72,6 @@ movements:
1. Understand the requirements
2. Identify impact scope
3. Decide implementation approach
pass_previous_response: true
rules:
- condition: Task analysis and planning is complete
next: implement
@ -158,7 +157,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 03-ai-review.md
format: |
@ -261,7 +259,6 @@ movements:
- {command and outcome}
**No-implementation handling (required)**
pass_previous_response: true
rules:
- condition: AI Reviewer's issues have been fixed
next: ai_review
@ -522,7 +519,6 @@ movements:
- {command and outcome}
## Evidence
- {key files/grep/diff/log evidence you verified}
pass_previous_response: true
# ===========================================
# Movement 4: Supervision
@ -647,7 +643,6 @@ movements:
- {command and outcome}
## Evidence
- {key files/grep/diff/log evidence you verified}
pass_previous_response: true
rules:
- condition: Supervisor's issues have been fixed
next: supervise

View File

@ -84,7 +84,6 @@ movements:
1. Understand the requirements
2. Identify impact scope
3. Decide implementation approach
pass_previous_response: true
rules:
- condition: Task analysis and planning is complete
next: implement
@ -170,7 +169,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 03-ai-review.md
format: |
@ -274,7 +272,6 @@ movements:
- {command and outcome}
**No-implementation handling (required)**
pass_previous_response: true
rules:
- condition: AI Reviewer's issues have been fixed
next: ai_review
@ -535,7 +532,6 @@ movements:
- {command and outcome}
## Evidence
- {key files/grep/diff/log evidence you verified}
pass_previous_response: true
# ===========================================
# Movement 4: Supervision
@ -660,7 +656,6 @@ movements:
- {command and outcome}
## Evidence
- {key files/grep/diff/log evidence you verified}
pass_previous_response: true
rules:
- condition: Supervisor's issues have been fixed
next: supervise

View File

@ -91,7 +91,6 @@ movements:
Reason: {Reason for approval}
```
pass_previous_response: true
rules:
- condition: Judgment completed
next: casper
@ -144,7 +143,6 @@ movements:
[Reasoning/Summary]
```
pass_previous_response: true
rules:
- condition: Final judgment completed
next: COMPLETE

View File

@ -242,7 +242,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI Reviewer's issues fixed
- condition: No fix needed (verified target files/spec)
@ -302,7 +301,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: Supervisor's issues fixed
- condition: Cannot proceed, insufficient info
@ -341,7 +339,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI Reviewer's issues fixed
next: reviewers
@ -404,7 +401,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: Supervisor's issues fixed
next: reviewers

View File

@ -51,7 +51,6 @@ movements:
- Make assumptions for unclear points and proceed
- If multiple interpretations exist, include all in the research scope
- If there is feedback from Supervisor, incorporate it into the plan
pass_previous_response: true
rules:
- condition: Planning is complete
next: dig
@ -93,7 +92,6 @@ movements:
- GitHub search (gh command)
- Codebase search
- File reading
pass_previous_response: true
rules:
- condition: Research is complete
next: supervise
@ -124,7 +122,6 @@ movements:
Evaluate the research results and determine if they adequately answer the original request.
**Important**: If there are issues, include specific instructions for the Planner.
pass_previous_response: true
rules:
- condition: Research results adequately answer the original request
next: COMPLETE

View File

@ -242,7 +242,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI Reviewer's issues fixed
- condition: No fix needed (verified target files/spec)
@ -302,7 +301,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: Supervisor's issues fixed
- condition: Cannot proceed, insufficient info
@ -341,7 +339,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI Reviewer's issues fixed
next: reviewers
@ -404,7 +401,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: Supervisor's issues fixed
next: reviewers

View File

@ -47,7 +47,6 @@ movements:
Clarifications needed:
- {Question 1}
- {Question 2}
pass_previous_response: true
instruction_template: |
## Previous Response (when returned from supervise)
{previous_response}
@ -234,7 +233,6 @@ movements:
next: COMPLETE
- condition: rejected
next: ABORT
pass_previous_response: true
instruction_template: |
## Review Results
{previous_response}
@ -290,7 +288,6 @@ movements:
next: COMPLETE
- condition: Failed to post comments
next: COMPLETE
pass_previous_response: true
instruction_template: |
## Review Summary
{previous_response}

View File

@ -0,0 +1,357 @@
# Coding TAKT Piece
# Architect -> Implement -> Parallel Review (AI + Architecture) -> Fix if needed
#
# 設計を重視しながらも、planとsuperviseを省略した軽量な開発ピース。
# 並列レビュー後、問題がなければ直接完了し、高速なフィードバックループを実現。
#
# フロー:
# architect (設計)
# ↓
# 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: Architecture-focused development piece with parallel reviews (architect -> implement -> parallel review -> complete)
max_iterations: 20
initial_movement: architect-plan
movements:
- name: architect-plan
edit: false
agent: ../agents/default/architecture-reviewer.md
report:
name: architecture-reviewer
format: |
```markdown
# アーキテクチャ設計
## タスク規模
Small / Medium / Large
## 設計判断
### ファイル構成
| ファイル | 役割 |
|---------|------|
| `src/example.ts` | 概要 |
### 技術選定
- {選定した技術・ライブラリとその理由}
### 設計パターン
- {採用するパターンと適用箇所}
## 実装ガイドライン
- {Coderが実装時に従うべき指針}
```
allowed_tools:
- Read
- Glob
- Grep
- WebSearch
- WebFetch
rules:
- condition: 小規模タスク(設計不要)
next: implement
- condition: 設計完了
next: implement
- condition: 情報不足、判断できない
next: ABORT
instruction_template: |
タスクのアーキテクチャ設計を行ってください。
**タスク**: {task}
**進行状況**: {iteration}/{max_iterations} ターン
**小規模タスクの判断基準:**
- 1-2ファイルの変更のみ
- 既存パターンの踏襲で済む
- 技術選定が不要
小規模タスクの場合は設計レポートを作成せず、「小規模タスク(設計不要)」のルールに対応してください。
**設計が必要なタスク:**
- 3ファイル以上の変更
- 新しいモジュール・機能の追加
- 技術選定が必要
- アーキテクチャパターンの決定が必要
**やること:**
1. タスクの規模を評価Small/Medium/Large
2. 影響を受けるファイル構成を特定
3. 必要に応じて技術選定を行う
4. 設計パターンの選択
5. Coderへの実装ガイドライン作成
**やらないこと:**
- コードの実装Coderの仕事
- コードレビュー
- name: implement
edit: true
agent: ../agents/default/coder.md
session: refresh
report:
- Scope: 02-coder-scope.md
- Decisions: 03-coder-decisions.md
allowed_tools:
- Read
- Glob
- Grep
- Edit
- Write
- Bash
- WebSearch
- WebFetch
permission_mode: edit
rules:
- condition: 実装完了
next: reviewers
- condition: 実装未着手(レポートのみ)
next: reviewers
- condition: 判断できない、情報不足
next: reviewers
- condition: ユーザー入力が必要
next: implement
requires_user_input: true
interactive_only: true
instruction_template: |
architect-planムーブメントで決定した設計に従って実装してください。
**参照するレポート:**
- 設計: {report:01-architecture.md}(存在する場合)
Piece Contextに示されたReport Directory内のファイルのみ参照してください。他のレポートディレクトリは検索/参照しないでください。
**重要:** 設計判断はせず、architect-planムーブメントで決定された設計に従ってください。
不明点や設計の変更が必要な場合は報告してください。
**重要**: 実装と同時に単体テストを追加してください。
- 新規作成したクラス・関数には単体テストを追加
- 既存コードを変更した場合は該当するテストを更新
- テストファイルの配置: プロジェクトの規約に従う(例: `__tests__/`, `*.test.ts`
- **テスト実行は必須です。** 実装完了後、必ずテストを実行して結果を確認してください。
**Scopeレポートフォーマット実装開始時に作成:**
```markdown
# 変更スコープ宣言
## タスク
{タスクの1行要約}
## 変更予定
| 種別 | ファイル |
|------|---------|
| 作成 | `src/example.ts` |
| 変更 | `src/routes.ts` |
## 推定規模
Small / Medium / Large
## 影響範囲
- {影響するモジュールや機能}
```
**Decisionsレポートフォーマット実装完了時、決定がある場合のみ:**
```markdown
# 決定ログ
## 1. {決定内容}
- **背景**: {なぜ決定が必要だったか}
- **検討した選択肢**: {選択肢リスト}
- **理由**: {選んだ理由}
```
**必須出力(見出しを含める)**
## 作業結果
- {実施内容の要約}
## 変更内容
- {変更内容の要約}
## テスト結果
- {実行コマンドと結果}
- name: reviewers
parallel:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
report:
name: 04-ai-review.md
format: |
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
allowed_tools:
- Read
- Glob
- Grep
- WebSearch
- WebFetch
rules:
- condition: AI特有の問題なし
- condition: AI特有の問題あり
instruction_template: |
AI特有の問題についてコードをレビューしてください:
- 仮定の検証
- もっともらしいが間違っているパターン
- 既存コードベースとの適合性
- スコープクリープの検出
**参照するレポート:**
- 実装スコープ: {report:02-coder-scope.md}
- 決定ログ: {report:03-coder-decisions.md}(存在する場合)
- name: arch-review
edit: false
agent: ../agents/default/architecture-reviewer.md
report:
name: 05-architect-review.md
format: |
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
- [x] テストカバレッジ
- [x] デッドコード
- [x] 呼び出しチェーン検証
## 問題点REJECTの場合
| # | スコープ | 場所 | 問題 | 修正案 |
|---|---------|------|------|--------|
| 1 | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
スコープ: 「スコープ内」(今回修正可能)/ 「スコープ外」(既存問題・非ブロッキング)
## 既存問題(参考・非ブロッキング)
- {既存問題の記録。今回の変更と無関係な問題}
```
**認知負荷軽減ルール:**
- APPROVE → サマリーのみ5行以内
- REJECT → 問題点を表形式で30行以内
allowed_tools:
- Read
- Glob
- Grep
- WebSearch
- WebFetch
rules:
- condition: approved
- condition: needs_fix
instruction_template: |
**実装がarchitectムーブメントの設計に従っているか**を確認してください。
AI特有の問題はレビューしないでくださいai_reviewムーブメントで行います
**参照するレポート:**
- 設計: {report:01-architecture.md}(存在する場合)
- 実装スコープ: {report:02-coder-scope.md}
**レビュー観点:**
- 設計との整合性architectが定めたファイル構成・パターンに従っているか
- コード品質DRY、YAGNI、Fail Fast、イディオマティック
- 変更スコープの適切性
- テストカバレッジ
- デッドコード
- 呼び出しチェーン検証
**注意:** architectムーブメントをスキップした小規模タスクの場合は、従来通り設計の妥当性も確認してください。
rules:
- condition: all("AI特有の問題なし", "approved")
next: COMPLETE
- condition: any("AI特有の問題あり", "needs_fix")
next: fix
- name: fix
edit: true
agent: ../agents/default/coder.md
allowed_tools:
- Read
- Glob
- Grep
- Edit
- Write
- Bash
- WebSearch
- WebFetch
permission_mode: edit
rules:
- condition: 修正完了
next: reviewers
- condition: 判断できない、情報不足
next: ABORT
instruction_template: |
レビュアーのフィードバックに対応してください。
**両方のレビュー結果を確認してください:**
- AI Review: {report:04-ai-review.md}
- Architecture Review: {report:05-architect-review.md}
**重要:** 両方のレビューで指摘された問題を全て修正してください。
- AI Reviewの指摘: 幻覚API、仮定の妥当性、スコープクリープ等
- Architecture Reviewの指摘: 設計との整合性、コード品質、テストカバレッジ等
**必須アクション:**
1. 指摘された全ファイルを Read tool で開く
2. 問題箇所を確認する
3. Edit tool で修正する
4. **テストを実行して検証する(必須)**
5. 修正内容を具体的に報告する
**必須出力(見出しを含める)**
## 作業結果
- {実施内容の要約}
## 変更内容
- {変更内容の要約}
## テスト結果
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}

View File

@ -62,7 +62,6 @@ movements:
確認事項:
- {質問1}
- {質問2}
pass_previous_response: true
instruction_template: |
タスクを分析し、実装方針を立ててください。
@ -115,7 +114,6 @@ movements:
next: implement
- condition: 情報不足、判断できない
next: ABORT
pass_previous_response: true
instruction_template: |
計画レポート({report:00-plan.md})を読み、アーキテクチャ設計を行ってください。
@ -226,7 +224,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 04-ai-review.md
format: |
@ -287,7 +284,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI問題の修正完了
next: ai_review
@ -489,7 +485,6 @@ movements:
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}
pass_previous_response: true
- name: supervise
edit: false

View File

@ -81,7 +81,6 @@ movements:
1. タスクの要件を理解する
2. 影響範囲を特定する
3. 実装アプローチを決める
pass_previous_response: true
rules:
- condition: タスク分析と計画が完了した
next: implement
@ -167,7 +166,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 03-ai-review.md
format: |
@ -268,8 +266,6 @@ movements:
- {変更内容}
## テスト結果
- {実行コマンドと結果}
pass_previous_response: true
rules:
- condition: AI Reviewerの指摘に対する修正が完了した
next: ai_review
@ -530,7 +526,6 @@ movements:
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}
pass_previous_response: true
# ===========================================
# Movement 4: Supervision
@ -655,7 +650,6 @@ movements:
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
next: supervise

View File

@ -72,7 +72,6 @@ movements:
1. タスクの要件を理解する
2. 影響範囲を特定する
3. 実装アプローチを決める
pass_previous_response: true
rules:
- condition: タスク分析と計画が完了した
next: implement
@ -158,7 +157,6 @@ movements:
- name: ai_review
edit: false
agent: ../agents/default/ai-antipattern-reviewer.md
pass_previous_response: true
report:
name: 03-ai-review.md
format: |
@ -259,8 +257,6 @@ movements:
- {変更内容}
## テスト結果
- {実行コマンドと結果}
pass_previous_response: true
rules:
- condition: AI Reviewerの指摘に対する修正が完了した
next: ai_review
@ -521,7 +517,6 @@ movements:
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}
pass_previous_response: true
# ===========================================
# Movement 4: Supervision
@ -646,7 +641,6 @@ movements:
- {実行コマンドと結果}
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
next: supervise

View File

@ -91,7 +91,6 @@ movements:
理由: {賛成の理由}
```
pass_previous_response: true
rules:
- condition: 判定を完了した
next: casper
@ -144,7 +143,6 @@ movements:
[理由・まとめ]
```
pass_previous_response: true
rules:
- condition: 最終判定を完了した
next: COMPLETE

View File

@ -242,7 +242,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI問題の修正完了
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
@ -302,7 +301,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
- condition: 修正を進行できない
@ -341,7 +339,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI問題の修正完了
next: reviewers
@ -404,7 +401,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
next: reviewers

View File

@ -51,7 +51,6 @@ movements:
- 不明点は仮定を置いて進める
- 複数の解釈がある場合は、すべてを調査対象に含める
- Supervisorからフィードバックがある場合は、指摘を反映した計画を作成
pass_previous_response: true
rules:
- condition: 計画が完了した
next: dig
@ -93,7 +92,6 @@ movements:
- GitHub検索gh コマンド)
- コードベース検索
- ファイル読み取り
pass_previous_response: true
rules:
- condition: 調査が完了した
next: supervise
@ -124,7 +122,6 @@ movements:
調査結果を評価し、元の依頼に対して十分な回答になっているか判断してください。
**重要**: 問題がある場合は、Plannerへの具体的な指示を含めてください。
pass_previous_response: true
rules:
- condition: 調査結果が元の依頼に対して十分である
next: COMPLETE

View File

@ -242,7 +242,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI問題の修正完了
- condition: 修正不要(指摘対象ファイル/仕様の確認済み)
@ -302,7 +301,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
- condition: 修正を進行できない
@ -341,7 +339,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: AI問題の修正完了
next: reviewers
@ -404,7 +401,6 @@ movements:
- WebSearch
- WebFetch
permission_mode: edit
pass_previous_response: true
rules:
- condition: 監督者の指摘に対する修正が完了した
next: reviewers

View File

@ -47,7 +47,6 @@ movements:
確認事項:
- {質問1}
- {質問2}
pass_previous_response: true
instruction_template: |
## Previous Response (superviseからの差し戻し時)
{previous_response}
@ -234,7 +233,6 @@ movements:
next: COMPLETE
- condition: rejected
next: ABORT
pass_previous_response: true
instruction_template: |
## レビュー結果
{previous_response}
@ -291,7 +289,6 @@ movements:
next: COMPLETE
- condition: コメント投稿失敗
next: COMPLETE
pass_previous_response: true
instruction_template: |
## レビューサマリー
{previous_response}