report 系のformatを利用するように変更、gitdiff廃止

This commit is contained in:
nrslib 2026-01-30 09:13:32 +09:00
parent 79227dffd1
commit 6fe6491948
21 changed files with 1207 additions and 1419 deletions

View File

@ -149,7 +149,6 @@ steps:
| `{max_iterations}` | Maximum iterations |
| `{previous_response}` | Previous step output (requires `pass_previous_response: true`) |
| `{user_inputs}` | Accumulated user inputs during workflow |
| `{git_diff}` | Current git diff (uncommitted changes) |
| `{report_dir}` | Report directory name (e.g., `20250126-143052-task-summary`) |
### Model Resolution

View File

@ -436,7 +436,6 @@ Available variables in `instruction_template`:
| `{step_iteration}` | Per-step iteration count (how many times THIS step has run) |
| `{previous_response}` | Previous step's output (requires `pass_previous_response: true`) |
| `{user_inputs}` | Additional user inputs during workflow |
| `{git_diff}` | Current git diff (uncommitted changes) |
| `{report_dir}` | Report directory name (e.g., `20250126-143052-task-summary`) |
### Designing Workflows

View File

@ -264,7 +264,6 @@ agent: /path/to/custom/agent.md
| `{step_iteration}` | ステップごとのイテレーション数(このステップが実行された回数) |
| `{previous_response}` | 前のステップの出力(`pass_previous_response: true`が必要) |
| `{user_inputs}` | ワークフロー中の追加ユーザー入力 |
| `{git_diff}` | 現在のgit diffコミットされていない変更 |
| `{report_dir}` | レポートディレクトリ名(例:`20250126-143052-task-summary` |
### ワークフローの設計

View File

@ -48,7 +48,6 @@ steps:
| `{max_iterations}` | Maximum allowed iterations |
| `{previous_response}` | Previous step's output |
| `{user_inputs}` | Additional inputs during workflow |
| `{git_diff}` | Current uncommitted changes |
## Transitions

View File

@ -41,7 +41,7 @@ Code is read far more often than it is written. Poorly structured code destroys
**About template files:**
- YAML and Markdown files in `resources/` are templates
- `{report_dir}`, `{task}`, `{git_diff}` are placeholders (replaced at runtime)
- `{report_dir}`, `{task}` are placeholders (replaced at runtime)
- Even if expanded values appear in git diff for report files, they are NOT hardcoded
**To avoid false positives:**

View File

@ -10,7 +10,6 @@
# {max_iterations} - Maximum iterations allowed for the workflow
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {previous_response} - Output from the previous step (only when pass_previous_response: true)
# {git_diff} - Current uncommitted changes (git diff)
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
#
# Step-level Fields:
@ -30,7 +29,33 @@ initial_step: plan
steps:
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
allowed_tools:
- Read
- Glob
@ -65,32 +90,6 @@ steps:
2. Identify impact scope
3. Decide implementation approach
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
- name: implement
agent: ~/.takt/agents/default/coder.md
report:
@ -151,7 +150,38 @@ steps:
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
allowed_tools:
- Read
- Glob
@ -165,48 +195,12 @@ steps:
- condition: AI-specific issues found
next: ai_fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the code for AI-specific issues:
- Assumption validation
- Plausible but wrong patterns
- Context fit with existing codebase
- Scope creep detection
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
- name: ai_fix
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -238,7 +232,39 @@ steps:
- name: review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Architecture Review
## Result: APPROVE / IMPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
- [x] Structure & Design
- [x] Code Quality
- [x] Change Scope
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional, non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
allowed_tools:
- Read
- Glob
@ -254,47 +280,10 @@ steps:
- condition: Structural fix required
next: fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Focus on **architecture and design** review. Do NOT review AI-specific issues (that's the ai_review step).
Review the changes and provide feedback.
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Architecture Review
## Result: APPROVE / IMPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
- [x] Structure & Design
- [x] Code Quality
- [x] Change Scope
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional, non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
- name: improve
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -354,7 +343,41 @@ steps:
- name: security_review
agent: ~/.takt/agents/default/security-reviewer.md
report: 05-security-review.md
report:
name: 05-security-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
**Cognitive load reduction rules:**
- No issues -> Check table only (10 lines or less)
- Warnings -> + Warnings 1-2 lines (15 lines or less)
- Vulnerabilities -> + Table format (30 lines or less)
allowed_tools:
- Read
- Glob
@ -368,51 +391,12 @@ steps:
- condition: Vulnerabilities require fix
next: security_fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Perform security review on the changes. Check for vulnerabilities including:
- Injection attacks (SQL, Command, XSS)
- Authentication/Authorization issues
- Data exposure risks
- Cryptographic weaknesses
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
**Cognitive load reduction rules:**
- No issues -> Check table only (10 lines or less)
- Warnings -> + Warnings 1-2 lines (15 lines or less)
- Vulnerabilities -> + Table format (30 lines or less)
- name: security_fix
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -457,11 +441,6 @@ steps:
- condition: Requirements unmet, tests failing, build errors
next: plan
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Run tests, verify the build, and perform final approval.
**Workflow Overall Review:**

View File

@ -16,7 +16,6 @@
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
@ -33,7 +32,33 @@ steps:
# ===========================================
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
allowed_tools:
- Read
- Glob
@ -55,32 +80,6 @@ steps:
1. Understand the requirements
2. Identify impact scope
3. Decide implementation approach
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
pass_previous_response: true
rules:
- condition: Task analysis and planning is complete
@ -153,7 +152,38 @@ steps:
# ===========================================
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues → Summary 1 line + check table only (10 lines or less)
- Issues found → + Issues in table format (25 lines or less)
allowed_tools:
- Read
- Glob
@ -162,47 +192,11 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the code for AI-specific issues:
- Assumption validation
- Plausible but wrong patterns
- Context fit with existing codebase
- Scope creep detection
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues → Summary 1 line + check table only (10 lines or less)
- Issues found → + Issues in table format (25 lines or less)
rules:
- condition: No AI-specific issues found
next: cqrs_es_review
@ -242,7 +236,35 @@ steps:
# ===========================================
- name: cqrs_es_review
agent: ~/.takt/agents/expert-cqrs/cqrs-es-reviewer.md
report: 04-cqrs-es-review.md
report:
name: 04-cqrs-es-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# CQRS+ES Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Aggregate Design | ✅ | - |
| Event Design | ✅ | - |
| Command/Query Separation | ✅ | - |
| Projections | ✅ | - |
| Eventual Consistency | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
```
allowed_tools:
- Read
- Glob
@ -251,11 +273,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the CQRS (Command Query Responsibility Segregation)
and Event Sourcing perspective.
@ -268,34 +285,6 @@ steps:
**Note**: If this project does not use CQRS+ES patterns,
review from a general domain design perspective.
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# CQRS+ES Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Aggregate Design | ✅ | - |
| Event Design | ✅ | - |
| Command/Query Separation | ✅ | - |
| Projections | ✅ | - |
| Eventual Consistency | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
```
rules:
- condition: CQRS+ES design is sound with no issues
next: frontend_review
@ -337,7 +326,35 @@ steps:
# ===========================================
- name: frontend_review
agent: ~/.takt/agents/expert/frontend-reviewer.md
report: 05-frontend-review.md
report:
name: 05-frontend-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Frontend Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Component Design | ✅ | - |
| State Management | ✅ | - |
| Performance | ✅ | - |
| Accessibility | ✅ | - |
| Type Safety | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.tsx:42` | Issue description | Fix method |
```
allowed_tools:
- Read
- Glob
@ -346,11 +363,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the frontend development perspective.
**Review Criteria:**
@ -363,34 +375,6 @@ steps:
**Note**: If this project does not include frontend code,
approve and proceed to the next step.
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Frontend Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Component Design | ✅ | - |
| State Management | ✅ | - |
| Performance | ✅ | - |
| Accessibility | ✅ | - |
| Type Safety | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.tsx:42` | Issue description | Fix method |
```
rules:
- condition: Frontend design is sound with no issues
next: security_review
@ -432,7 +416,36 @@ steps:
# ===========================================
- name: security_review
agent: ~/.takt/agents/expert/security-reviewer.md
report: 06-security-review.md
report:
name: 06-security-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
allowed_tools:
- Read
- Glob
@ -441,11 +454,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the security perspective.
**Review Criteria:**
@ -454,35 +462,6 @@ steps:
- Sensitive information handling
- Encryption appropriateness
- OWASP Top 10
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
rules:
- condition: No security issues found
next: qa_review
@ -534,7 +513,35 @@ steps:
# ===========================================
- name: qa_review
agent: ~/.takt/agents/expert/qa-reviewer.md
report: 07-qa-review.md
report:
name: 07-qa-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# QA Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Test Coverage | ✅ | - |
| Test Quality | ✅ | - |
| Error Handling | ✅ | - |
| Documentation | ✅ | - |
| Maintainability | ✅ | - |
## Issues (if REJECT)
| # | Category | Issue | Fix |
|---|----------|-------|-----|
| 1 | Testing | Issue description | Fix method |
```
allowed_tools:
- Read
- Glob
@ -543,11 +550,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the quality assurance perspective.
**Review Criteria:**
@ -557,34 +559,6 @@ steps:
- Error handling
- Logging and monitoring
- Maintainability
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# QA Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Test Coverage | ✅ | - |
| Test Quality | ✅ | - |
| Error Handling | ✅ | - |
| Documentation | ✅ | - |
| Maintainability | ✅ | - |
## Issues (if REJECT)
| # | Category | Issue | Fix |
|---|----------|-------|-----|
| 1 | Testing | Issue description | Fix method |
```
rules:
- condition: Quality standards are met
next: supervise
@ -651,11 +625,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
## Previous Reviews Summary
Reaching this step means all the following reviews have been APPROVED:
- AI Review: APPROVED

View File

@ -13,15 +13,23 @@
# - fix_security: MINOR->security_review, MAJOR->architect_review
# - fix_qa: MINOR->qa_review, SECURITY->security_review, MAJOR->architect_review
#
# Template Variables:
# {iteration} - Workflow-wide turn count (total steps executed across all agents)
# {max_iterations} - Maximum iterations allowed for the workflow
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
# Boilerplate sections (Workflow Context, User Request, Previous Response,
# Additional User Inputs, Instructions heading) are auto-injected by buildInstruction().
# Only step-specific content belongs in instruction_template.
#
# Template Variables (available in instruction_template):
# {iteration} - Workflow-wide turn count (total steps executed across all agents)
# {max_iterations} - Maximum iterations allowed for the workflow
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {previous_response} - Output from the previous step (only when pass_previous_response: true)
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
#
# Step-level Fields:
# report: - Report file(s) for the step (auto-injected as Report File/Files in Workflow Context)
# Single: report: 00-plan.md
# Multiple: report:
# - Scope: 01-coder-scope.md
# - Decisions: 02-coder-decisions.md
name: expert
description: Architecture, Frontend, Security, QA Expert Review
@ -36,7 +44,33 @@ steps:
# ===========================================
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
allowed_tools:
- Read
- Glob
@ -58,32 +92,6 @@ steps:
1. Understand the requirements
2. Identify impact scope
3. Decide implementation approach
**Report output:** Output to `.takt/reports/{report_dir}/00-plan.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
pass_previous_response: true
rules:
- condition: Task analysis and planning is complete
@ -112,9 +120,7 @@ steps:
Follow the plan from the plan step and implement.
Refer to the plan report (00-plan.md) and proceed with implementation.
**Report output:** Output to the report files specified below.
- Scope: `.takt/reports/{report_dir}/01-coder-scope.md`
- Decisions: `.takt/reports/{report_dir}/02-coder-decisions.md`
**Report output:** Output to the `Report Files` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
@ -158,7 +164,38 @@ steps:
# ===========================================
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
allowed_tools:
- Read
- Glob
@ -167,47 +204,11 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the code for AI-specific issues:
- Assumption validation
- Plausible but wrong patterns
- Context fit with existing codebase
- Scope creep detection
**Report output:** Output to `.takt/reports/{report_dir}/03-ai-review.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
rules:
- condition: No AI-specific issues found
next: architect_review
@ -247,7 +248,42 @@ steps:
# ===========================================
- name: architect_review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Architecture Review
## Result: APPROVE / IMPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Aspects
- [x] Structure/Design
- [x] Code Quality
- [x] Change Scope
- [x] Test Coverage
- [x] Dead Code
- [x] Call Chain Verification
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional - non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
allowed_tools:
- Read
- Glob
@ -256,11 +292,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Focus on **architecture and design** review.
**Review Criteria:**
@ -270,41 +301,6 @@ steps:
- Test coverage
- Dead code
- Call chain verification
**Report output:** Output to `.takt/reports/{report_dir}/04-architect-review.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Architecture Review
## Result: APPROVE / IMPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Aspects
- [x] Structure/Design
- [x] Code Quality
- [x] Change Scope
- [x] Test Coverage
- [x] Dead Code
- [x] Call Chain Verification
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional - non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
rules:
- condition: No architecture or design issues found
next: frontend_review
@ -344,7 +340,35 @@ steps:
# ===========================================
- name: frontend_review
agent: ~/.takt/agents/expert/frontend-reviewer.md
report: 05-frontend-review.md
report:
name: 05-frontend-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Frontend Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Component Design | ✅ | - |
| State Management | ✅ | - |
| Performance | ✅ | - |
| Accessibility | ✅ | - |
| Type Safety | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.tsx:42` | Issue description | Fix method |
```
allowed_tools:
- Read
- Glob
@ -353,12 +377,7 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the frontend development perspective.
Review the changes from the frontend development perspective.
**Review Criteria:**
- Component design (separation of concerns, granularity)
@ -370,34 +389,6 @@ steps:
**Note**: If this project does not include frontend code,
approve and proceed to the next step.
**Report output:** Output to `.takt/reports/{report_dir}/05-frontend-review.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Frontend Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Component Design | ✅ | - |
| State Management | ✅ | - |
| Performance | ✅ | - |
| Accessibility | ✅ | - |
| Type Safety | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.tsx:42` | Issue description | Fix method |
```
rules:
- condition: Frontend design is sound with no issues
next: security_review
@ -439,7 +430,36 @@ steps:
# ===========================================
- name: security_review
agent: ~/.takt/agents/expert/security-reviewer.md
report: 06-security-review.md
report:
name: 06-security-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
allowed_tools:
- Read
- Glob
@ -448,12 +468,7 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the security perspective.
Review the changes from the security perspective.
**Review Criteria:**
- Injection attacks (SQL, command, XSS)
@ -461,35 +476,6 @@ steps:
- Sensitive information handling
- Encryption appropriateness
- OWASP Top 10
**Report output:** Output to `.takt/reports/{report_dir}/06-security-review.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Security Review
## Result: APPROVE / REJECT
## Severity: None / Low / Medium / High / Critical
## Check Results
| Category | Result | Notes |
|----------|--------|-------|
| Injection | ✅ | - |
| Auth/Authz | ✅ | - |
| Data Protection | ✅ | - |
| Dependencies | ✅ | - |
## Vulnerabilities (if REJECT)
| # | Severity | Type | Location | Fix |
|---|----------|------|----------|-----|
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
## Warnings (non-blocking)
- {Security recommendations}
```
rules:
- condition: No security issues found
next: qa_review
@ -541,7 +527,35 @@ steps:
# ===========================================
- name: qa_review
agent: ~/.takt/agents/expert/qa-reviewer.md
report: 07-qa-review.md
report:
name: 07-qa-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# QA Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Test Coverage | ✅ | - |
| Test Quality | ✅ | - |
| Error Handling | ✅ | - |
| Documentation | ✅ | - |
| Maintainability | ✅ | - |
## Issues (if REJECT)
| # | Category | Issue | Fix |
|---|----------|-------|-----|
| 1 | Testing | Issue description | Fix method |
```
allowed_tools:
- Read
- Glob
@ -550,12 +564,7 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the changes above from the quality assurance perspective.
Review the changes from the quality assurance perspective.
**Review Criteria:**
- Test coverage and quality
@ -564,34 +573,6 @@ steps:
- Error handling
- Logging and monitoring
- Maintainability
**Report output:** Output to `.takt/reports/{report_dir}/07-qa-review.md`.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# QA Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
| Perspective | Result | Notes |
|-------------|--------|-------|
| Test Coverage | ✅ | - |
| Test Quality | ✅ | - |
| Error Handling | ✅ | - |
| Documentation | ✅ | - |
| Maintainability | ✅ | - |
## Issues (if REJECT)
| # | Category | Issue | Fix |
|---|----------|-------|-----|
| 1 | Testing | Issue description | Fix method |
```
rules:
- condition: Quality standards are met
next: supervise
@ -658,11 +639,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
## Previous Reviews Summary
Reaching this step means all the following reviews have been APPROVED:
- Architecture Review: APPROVED
@ -681,9 +657,7 @@ steps:
**Review Reports:** Read all reports in Report Directory and
check for any unaddressed improvement suggestions.
**Report output:** Output to the report files specified below.
- Validation: `.takt/reports/{report_dir}/08-supervisor-validation.md`
- Summary: `.takt/reports/{report_dir}/summary.md`
**Report output:** Output to the `Report Files` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section

View File

@ -8,7 +8,6 @@
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")

View File

@ -12,7 +12,6 @@
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")

View File

@ -7,7 +7,6 @@
# {step_iteration} - Per-step iteration count
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name
#
@ -27,7 +26,33 @@ initial_step: plan
steps:
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
allowed_tools:
- Read
- Glob
@ -58,32 +83,6 @@ steps:
2. Identify impact scope
3. Decide implementation approach
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Task Plan
## Original Request
{User's request as-is}
## Analysis Results
### Objective
{What needs to be achieved}
### Scope
{Impact scope}
### Implementation Approach
{How to proceed}
## Clarifications Needed (if any)
- {Unclear points or items requiring confirmation}
```
- name: implement
agent: ~/.takt/agents/default/coder.md
report:
@ -144,7 +143,38 @@ steps:
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
allowed_tools:
- Read
- Glob
@ -158,51 +188,47 @@ steps:
- condition: AI-specific issues found
next: plan
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Review the code for AI-specific issues:
- Assumption validation
- Plausible but wrong patterns
- Context fit with existing codebase
- Scope creep detection
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# AI-Generated Code Review
## Result: APPROVE / REJECT
## Summary
{One sentence summarizing result}
## Verified Items
| Aspect | Result | Notes |
|--------|--------|-------|
| Assumption validity | ✅ | - |
| API/Library existence | ✅ | - |
| Context fit | ✅ | - |
| Scope | ✅ | - |
## Issues (if REJECT)
| # | Category | Location | Issue |
|---|----------|----------|-------|
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
```
**Cognitive load reduction rules:**
- No issues -> Summary 1 line + check table only (10 lines or less)
- Issues found -> + Issues in table format (25 lines or less)
- name: review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
format: |
```markdown
# Architecture Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
- [x] Structure & Design
- [x] Code Quality
- [x] Change Scope
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional, non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
allowed_tools:
- Read
- Glob
@ -216,11 +242,6 @@ steps:
- condition: Structural fix required
next: plan
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Focus on **architecture and design** review. Do NOT review AI-specific issues (that's already done).
Review the changes and provide feedback.
@ -228,38 +249,6 @@ steps:
**Note:** In simple workflow, IMPROVE judgment is not used.
If there are minor suggestions, use APPROVE + comments.
**Report output:** Output to the `Report File` specified above.
- If file does not exist: Create new file
- If file exists: Append with `## Iteration {step_iteration}` section
**Report format:**
```markdown
# Architecture Review
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing result}
## Reviewed Perspectives
- [x] Structure & Design
- [x] Code Quality
- [x] Change Scope
## Issues (if REJECT)
| # | Location | Issue | Fix |
|---|----------|-------|-----|
| 1 | `src/file.ts:42` | Issue description | Fix method |
## Improvement Suggestions (optional, non-blocking)
- {Future improvement suggestions}
```
**Cognitive load reduction rules:**
- APPROVE + no issues -> Summary only (5 lines or less)
- APPROVE + minor suggestions -> Summary + suggestions (15 lines or less)
- REJECT -> Issues in table format (30 lines or less)
- name: supervise
agent: ~/.takt/agents/default/supervisor.md
report:
@ -279,11 +268,6 @@ steps:
- condition: Requirements unmet, tests failing
next: plan
instruction_template: |
## Git Diff
```diff
{git_diff}
```
Run tests, verify the build, and perform final approval.
**Workflow Overall Review:**

View File

@ -41,7 +41,7 @@
**特にテンプレートファイルについて:**
- `resources/` 内のYAMLやMarkdownはテンプレート
- `{report_dir}`, `{task}`, `{git_diff}` はプレースホルダー(実行時に置換される)
- `{report_dir}`, `{task}` はプレースホルダー(実行時に置換される)
- git diff でレポートファイルに展開後の値が見えても、それはハードコードではない
**誤検知を避けるために:**

View File

@ -7,7 +7,6 @@
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request
# {previous_response} - Output from the previous step
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
@ -21,7 +20,33 @@ initial_step: plan
steps:
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
allowed_tools:
- Read
- Glob
@ -30,8 +55,6 @@ steps:
- Bash
- WebSearch
- WebFetch
rules:
- condition: 要件が明確で実装可能
next: implement
@ -58,32 +81,6 @@ steps:
2. 影響範囲を特定する
3. 実装アプローチを決める
**レポート出力:** Report File に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
- name: implement
agent: ~/.takt/agents/default/coder.md
report:
@ -149,7 +146,38 @@ steps:
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
allowed_tools:
- Read
- Glob
@ -163,48 +191,12 @@ steps:
- condition: AI特有の問題あり
next: ai_fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
AI特有の問題についてコードをレビューしてください:
- 仮定の検証
- もっともらしいが間違っているパターン
- 既存コードベースとの適合性
- スコープクリープの検出
**レポート出力:** Report File に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
- name: ai_fix
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -236,7 +228,42 @@ steps:
- name: review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / IMPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
- [x] テストカバレッジ
- [x] デッドコード
- [x] 呼び出しチェーン検証
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
allowed_tools:
- Read
- Glob
@ -252,11 +279,6 @@ steps:
- condition: 構造的な修正が必要
next: fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
**アーキテクチャと設計**のレビューに集中してください。AI特有の問題はレビューしないでください次のステップで行います
変更をレビューしてフィードバックを提供してください。
@ -269,41 +291,6 @@ steps:
- デッドコード
- 呼び出しチェーン検証
**レポート出力:** Report File に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / IMPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
- [x] テストカバレッジ
- [x] デッドコード
- [x] 呼び出しチェーン検証
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
- name: improve
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -362,7 +349,41 @@ steps:
- name: security_review
agent: ~/.takt/agents/default/security-reviewer.md
report: 05-security-review.md
report:
name: 05-security-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
**認知負荷軽減ルール:**
- 問題なし → チェック表のみ10行以内
- 警告あり → + 警告を1-2行15行以内
- 脆弱性あり → + 表形式で30行以内
allowed_tools:
- Read
- Glob
@ -376,51 +397,12 @@ steps:
- condition: 脆弱性があり修正が必要
next: security_fix
instruction_template: |
## Git Diff
```diff
{git_diff}
```
変更に対してセキュリティレビューを行ってください。以下の脆弱性を確認してください:
- インジェクション攻撃SQL, コマンド, XSS
- 認証・認可の問題
- データ露出リスク
- 暗号化の弱点
**レポート出力:** Report File に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
**認知負荷軽減ルール:**
- 問題なし → チェック表のみ10行以内
- 警告あり → + 警告を1-2行15行以内
- 脆弱性あり → + 表形式で30行以内
- name: security_fix
agent: ~/.takt/agents/default/coder.md
allowed_tools:
@ -465,11 +447,6 @@ steps:
- condition: 要求未達成、テスト失敗、ビルドエラー
next: plan
instruction_template: |
## Git Diff
```diff
{git_diff}
```
テスト実行、ビルド確認、最終承認を行ってください。
**ワークフロー全体の確認:**

View File

@ -10,15 +10,23 @@
# - fix_security: MINOR→security_review, MAJOR→cqrs_es_review
# - fix_qa: MINOR→qa_review, SECURITY→security_review, MAJOR→cqrs_es_review
#
# テンプレート変数:
# {iteration} - ワークフロー全体のターン数(全エージェントで実行されたステップの合計)
# {max_iterations} - ワークフローの最大イテレーション数
# {step_iteration} - ステップごとのイテレーション数(このステップが何回実行されたか)
# {task} - 元のユーザー要求
# {previous_response} - 前のステップの出力
# {git_diff} - 現在のコミットされていない変更git diff
# {user_inputs} - ワークフロー中に蓄積されたユーザー入力
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary"
# ボイラープレートセクションWorkflow Context, User Request, Previous Response,
# Additional User Inputs, Instructions headingはbuildInstruction()が自動挿入。
# instruction_templateにはステップ固有の内容のみ記述。
#
# テンプレート変数instruction_template内で使用可能:
# {iteration} - ワークフロー全体のターン数(全エージェントで実行されたステップの合計)
# {max_iterations} - ワークフローの最大イテレーション数
# {step_iteration} - ステップごとのイテレーション数(このステップが何回実行されたか)
# {previous_response} - 前のステップの出力pass_previous_response: true の場合のみ)
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary"
#
# ステップレベルフィールド:
# report: - ステップのレポートファイルWorkflow 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専門家レビュー
@ -33,7 +41,33 @@ steps:
# ===========================================
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
allowed_tools:
- Read
- Glob
@ -55,32 +89,6 @@ steps:
1. タスクの要件を理解する
2. 影響範囲を特定する
3. 実装アプローチを決める
**レポート出力:** .takt/reports/{report_dir}/00-plan.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
pass_previous_response: true
rules:
- condition: タスク分析と計画が完了した
@ -109,9 +117,7 @@ steps:
planステップで立てた計画に従って実装してください。
計画レポート00-plan.mdを参照し、実装を進めてください。
**レポート出力:** .takt/reports/{report_dir}/ に出力してください。
- Scope: .takt/reports/{report_dir}/01-coder-scope.md
- Decisions: .takt/reports/{report_dir}/02-coder-decisions.md
**レポート出力:** 上記の `Report Files` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
@ -155,7 +161,38 @@ steps:
# ===========================================
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
allowed_tools:
- Read
- Glob
@ -164,47 +201,11 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
AI特有の問題についてコードをレビューしてください:
- 仮定の検証
- もっともらしいが間違っているパターン
- 既存コードベースとの適合性
- スコープクリープの検出
**レポート出力:** .takt/reports/{report_dir}/03-ai-review.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
rules:
- condition: AI特有の問題が見つからない
next: cqrs_es_review
@ -244,7 +245,35 @@ steps:
# ===========================================
- name: cqrs_es_review
agent: ~/.takt/agents/expert-cqrs/cqrs-es-reviewer.md
report: 04-cqrs-es-review.md
report:
name: 04-cqrs-es-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# CQRS+ESレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| Aggregate設計 | ✅ | - |
| イベント設計 | ✅ | - |
| Command/Query分離 | ✅ | - |
| プロジェクション | ✅ | - |
| 結果整合性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
```
allowed_tools:
- Read
- Glob
@ -253,11 +282,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
CQRSコマンドクエリ責務分離とEvent Sourcingイベントソーシングの観点から
上記の変更をレビューしてください。
@ -270,34 +294,6 @@ steps:
**注意**: このプロジェクトがCQRS+ESパターンを使用していない場合は、
一般的なドメイン設計の観点からレビューしてください。
**レポート出力:** .takt/reports/{report_dir}/04-cqrs-es-review.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# CQRS+ESレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| Aggregate設計 | ✅ | - |
| イベント設計 | ✅ | - |
| Command/Query分離 | ✅ | - |
| プロジェクション | ✅ | - |
| 結果整合性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
```
rules:
- condition: CQRS+ES設計に問題がない
next: frontend_review
@ -339,7 +335,35 @@ steps:
# ===========================================
- name: frontend_review
agent: ~/.takt/agents/expert/frontend-reviewer.md
report: 05-frontend-review.md
report:
name: 05-frontend-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# フロントエンドレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| コンポーネント設計 | ✅ | - |
| 状態管理 | ✅ | - |
| パフォーマンス | ✅ | - |
| アクセシビリティ | ✅ | - |
| 型安全性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.tsx:42` | 問題の説明 | 修正方法 |
```
allowed_tools:
- Read
- Glob
@ -348,11 +372,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
フロントエンド開発の観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -365,34 +384,6 @@ steps:
**注意**: このプロジェクトがフロントエンドを含まない場合は、
問題なしとして次に進んでください。
**レポート出力:** .takt/reports/{report_dir}/05-frontend-review.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# フロントエンドレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| コンポーネント設計 | ✅ | - |
| 状態管理 | ✅ | - |
| パフォーマンス | ✅ | - |
| アクセシビリティ | ✅ | - |
| 型安全性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.tsx:42` | 問題の説明 | 修正方法 |
```
rules:
- condition: フロントエンド設計に問題がない
next: security_review
@ -434,7 +425,36 @@ steps:
# ===========================================
- name: security_review
agent: ~/.takt/agents/expert/security-reviewer.md
report: 06-security-review.md
report:
name: 06-security-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
allowed_tools:
- Read
- Glob
@ -443,11 +463,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
セキュリティの観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -456,35 +471,6 @@ steps:
- 機密情報の取り扱い
- 暗号化の適切性
- OWASP Top 10
**レポート出力:** .takt/reports/{report_dir}/06-security-review.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
rules:
- condition: セキュリティ上の問題がない
next: qa_review
@ -536,7 +522,35 @@ steps:
# ===========================================
- name: qa_review
agent: ~/.takt/agents/expert/qa-reviewer.md
report: 07-qa-review.md
report:
name: 07-qa-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# QAレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| テストカバレッジ | ✅ | - |
| テスト品質 | ✅ | - |
| エラーハンドリング | ✅ | - |
| ドキュメント | ✅ | - |
| 保守性 | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 問題 | 修正案 |
|---|---------|------|--------|
| 1 | テスト | 問題の説明 | 修正方法 |
```
allowed_tools:
- Read
- Glob
@ -545,11 +559,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
品質保証の観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -559,34 +568,6 @@ steps:
- エラーハンドリング
- ログとモニタリング
- 保守性
**レポート出力:** .takt/reports/{report_dir}/07-qa-review.md に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# QAレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| テストカバレッジ | ✅ | - |
| テスト品質 | ✅ | - |
| エラーハンドリング | ✅ | - |
| ドキュメント | ✅ | - |
| 保守性 | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 問題 | 修正案 |
|---|---------|------|--------|
| 1 | テスト | 問題の説明 | 修正方法 |
```
rules:
- condition: 品質基準を満たしている
next: supervise
@ -653,11 +634,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
## Previous Reviews Summary
このステップに到達したということは、以下のレビューがすべてAPPROVEされています
- AI Review: APPROVED
@ -673,12 +649,10 @@ steps:
2. 各レビューステップの指摘が対応されているか
3. 元のタスク目的が達成されているか
**レポートの確認:** .takt/reports/{report_dir}/ 内の全レポートを読み、
**レポートの確認:** Report Directory内の全レポートを読み、
未対応の改善提案がないか確認してください。
**レポート出力:**
- Validation: .takt/reports/{report_dir}/08-supervisor-validation.md
- Summary: .takt/reports/{report_dir}/summary.md
**レポート出力:** 上記の `Report Files` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記

View File

@ -16,7 +16,6 @@
# {step_iteration} - ステップごとのイテレーション数(このステップが何回実行されたか)
# {task} - 元のユーザー要求
# {previous_response} - 前のステップの出力
# {git_diff} - 現在のコミットされていない変更git diff
# {user_inputs} - ワークフロー中に蓄積されたユーザー入力
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary"
@ -33,7 +32,33 @@ steps:
# ===========================================
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
allowed_tools:
- Read
- Glob
@ -55,32 +80,6 @@ steps:
1. タスクの要件を理解する
2. 影響範囲を特定する
3. 実装アプローチを決める
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
pass_previous_response: true
rules:
- condition: タスク分析と計画が完了した
@ -153,7 +152,38 @@ steps:
# ===========================================
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
allowed_tools:
- Read
- Glob
@ -162,47 +192,11 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
AI特有の問題についてコードをレビューしてください:
- 仮定の検証
- もっともらしいが間違っているパターン
- 既存コードベースとの適合性
- スコープクリープの検出
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
rules:
- condition: AI特有の問題が見つからない
next: architect_review
@ -242,7 +236,42 @@ steps:
# ===========================================
- name: architect_review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / IMPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
- [x] テストカバレッジ
- [x] デッドコード
- [x] 呼び出しチェーン検証
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
allowed_tools:
- Read
- Glob
@ -251,11 +280,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
**アーキテクチャと設計**のレビューに集中してください。
**レビュー観点:**
@ -265,41 +289,6 @@ steps:
- テストカバレッジ
- デッドコード
- 呼び出しチェーン検証
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / IMPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
- [x] テストカバレッジ
- [x] デッドコード
- [x] 呼び出しチェーン検証
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
rules:
- condition: アーキテクチャと設計に問題がない
next: frontend_review
@ -339,7 +328,35 @@ steps:
# ===========================================
- name: frontend_review
agent: ~/.takt/agents/expert/frontend-reviewer.md
report: 05-frontend-review.md
report:
name: 05-frontend-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# フロントエンドレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| コンポーネント設計 | ✅ | - |
| 状態管理 | ✅ | - |
| パフォーマンス | ✅ | - |
| アクセシビリティ | ✅ | - |
| 型安全性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.tsx:42` | 問題の説明 | 修正方法 |
```
allowed_tools:
- Read
- Glob
@ -348,11 +365,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
フロントエンド開発の観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -365,34 +377,6 @@ steps:
**注意**: このプロジェクトがフロントエンドを含まない場合は、
問題なしとして次に進んでください。
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# フロントエンドレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| コンポーネント設計 | ✅ | - |
| 状態管理 | ✅ | - |
| パフォーマンス | ✅ | - |
| アクセシビリティ | ✅ | - |
| 型安全性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.tsx:42` | 問題の説明 | 修正方法 |
```
rules:
- condition: フロントエンド設計に問題がない
next: security_review
@ -434,7 +418,36 @@ steps:
# ===========================================
- name: security_review
agent: ~/.takt/agents/expert/security-reviewer.md
report: 06-security-review.md
report:
name: 06-security-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
allowed_tools:
- Read
- Glob
@ -443,11 +456,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
セキュリティの観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -456,35 +464,6 @@ steps:
- 機密情報の取り扱い
- 暗号化の適切性
- OWASP Top 10
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# セキュリティレビュー
## 結果: APPROVE / REJECT
## 重大度: None / Low / Medium / High / Critical
## チェック結果
| カテゴリ | 結果 | 備考 |
|---------|------|------|
| インジェクション | ✅ | - |
| 認証・認可 | ✅ | - |
| データ保護 | ✅ | - |
| 依存関係 | ✅ | - |
## 脆弱性REJECTの場合
| # | 重大度 | 種類 | 場所 | 修正案 |
|---|--------|------|------|--------|
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
## 警告(ブロッキングではない)
- {セキュリティに関する推奨事項}
```
rules:
- condition: セキュリティ上の問題がない
next: qa_review
@ -536,7 +515,35 @@ steps:
# ===========================================
- name: qa_review
agent: ~/.takt/agents/expert/qa-reviewer.md
report: 07-qa-review.md
report:
name: 07-qa-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# QAレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| テストカバレッジ | ✅ | - |
| テスト品質 | ✅ | - |
| エラーハンドリング | ✅ | - |
| ドキュメント | ✅ | - |
| 保守性 | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 問題 | 修正案 |
|---|---------|------|--------|
| 1 | テスト | 問題の説明 | 修正方法 |
```
allowed_tools:
- Read
- Glob
@ -545,11 +552,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
品質保証の観点から上記の変更をレビューしてください。
**レビュー観点:**
@ -559,34 +561,6 @@ steps:
- エラーハンドリング
- ログとモニタリング
- 保守性
**レポート出力:** 上記の `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
**レポートフォーマット:**
```markdown
# QAレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
| 観点 | 結果 | 備考 |
|------|------|------|
| テストカバレッジ | ✅ | - |
| テスト品質 | ✅ | - |
| エラーハンドリング | ✅ | - |
| ドキュメント | ✅ | - |
| 保守性 | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 問題 | 修正案 |
|---|---------|------|--------|
| 1 | テスト | 問題の説明 | 修正方法 |
```
rules:
- condition: 品質基準を満たしている
next: supervise
@ -653,11 +627,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
## Previous Reviews Summary
このステップに到達したということは、以下のレビューがすべてAPPROVEされています
- AI Review: APPROVED

View File

@ -8,7 +8,6 @@
# {step_iteration} - ステップごとのイテレーション数(このステップが何回実行されたか)
# {task} - 元のユーザー要求
# {previous_response} - 前のステップの出力
# {git_diff} - 現在のコミットされていない変更git diff
# {user_inputs} - ワークフロー中に蓄積されたユーザー入力
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary"

View File

@ -12,7 +12,6 @@
# {step_iteration} - ステップごとのイテレーション数(このステップが何回実行されたか)
# {task} - 元のユーザー要求
# {previous_response} - 前のステップの出力
# {git_diff} - 現在のコミットされていない変更git diff
# {user_inputs} - ワークフロー中に蓄積されたユーザー入力
# {report_dir} - レポートディレクトリ名(例: "20250126-143052-task-summary"

View File

@ -8,7 +8,6 @@
# {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
# {task} - Original user request (auto-injected)
# {previous_response} - Output from the previous step (auto-injected)
# {git_diff} - Current uncommitted changes (git diff)
# {user_inputs} - Accumulated user inputs during workflow (auto-injected)
# {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
@ -22,7 +21,33 @@ initial_step: plan
steps:
- name: plan
agent: ~/.takt/agents/default/planner.md
report: 00-plan.md
report:
name: 00-plan.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
allowed_tools:
- Read
- Glob
@ -44,28 +69,6 @@ steps:
1. タスクの要件を理解する
2. 影響範囲を特定する
3. 実装アプローチを決める
**レポートフォーマット:**
```markdown
# タスク計画
## 元の要求
{ユーザーの要求をそのまま記載}
## 分析結果
### 目的
{達成すべきこと}
### スコープ
{影響範囲}
### 実装アプローチ
{どう進めるか}
## 確認事項(あれば)
- {不明点や確認が必要な点}
```
pass_previous_response: true
rules:
- condition: "要件が明確で実装可能"
@ -135,7 +138,38 @@ steps:
- name: ai_review
agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
report: 03-ai-review.md
report:
name: 03-ai-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
allowed_tools:
- Read
- Glob
@ -144,43 +178,11 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
AI特有の問題についてコードをレビューしてください:
- 仮定の検証
- もっともらしいが間違っているパターン
- 既存コードベースとの適合性
- スコープクリープの検出
**レポートフォーマット:**
```markdown
# AI生成コードレビュー
## 結果: APPROVE / REJECT
## サマリー
{1文で結果を要約}
## 検証した項目
| 観点 | 結果 | 備考 |
|------|------|------|
| 仮定の妥当性 | ✅ | - |
| API/ライブラリの実在 | ✅ | - |
| コンテキスト適合 | ✅ | - |
| スコープ | ✅ | - |
## 問題点REJECTの場合
| # | カテゴリ | 場所 | 問題 |
|---|---------|------|------|
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
```
**認知負荷軽減ルール:**
- 問題なし → サマリー1文 + チェック表のみ10行以内
- 問題あり → + 問題を表形式で25行以内
rules:
- condition: "AI特有の問題なし"
next: review
@ -189,7 +191,39 @@ steps:
- name: review
agent: ~/.takt/agents/default/architecture-reviewer.md
report: 04-architect-review.md
report:
name: 04-architect-review.md
order: |
**レポート出力:** `Report File` に出力してください。
- ファイルが存在しない場合: 新規作成
- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記
format: |
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
allowed_tools:
- Read
- Glob
@ -198,45 +232,12 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
**アーキテクチャと設計**のレビューに集中してください。AI特有の問題はレビューしないでください前のステップで完了済み
変更をレビューしてフィードバックを提供してください。
**注意:** simpleワークフローではIMPROVE判定は使用しません。
軽微な改善提案がある場合は APPROVE + コメントとしてください。
**レポートフォーマット:**
```markdown
# アーキテクチャレビュー
## 結果: APPROVE / REJECT
## サマリー
{1-2文で結果を要約}
## 確認した観点
- [x] 構造・設計
- [x] コード品質
- [x] 変更スコープ
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 改善提案(任意・ブロッキングではない)
- {将来的な改善提案}
```
**認知負荷軽減ルール:**
- APPROVE + 問題なし → サマリーのみ5行以内
- APPROVE + 軽微な提案 → サマリー + 改善提案15行以内
- REJECT → 問題点を表形式で30行以内
rules:
- condition: "問題なし"
next: supervise
@ -257,11 +258,6 @@ steps:
- WebSearch
- WebFetch
instruction_template: |
## Git Diff
```diff
{git_diff}
```
テスト実行、ビルド確認、最終承認を行ってください。
**ワークフロー全体の確認:**

View File

@ -13,6 +13,7 @@ import {
} from '../workflow/instruction-builder.js';
import type { WorkflowStep, WorkflowRule } from '../models/types.js';
function createMinimalStep(template: string): WorkflowStep {
return {
name: 'test-step',

View File

@ -2,7 +2,6 @@
* Agent execution runners
*/
import { execSync } from 'node:child_process';
import { existsSync, readFileSync } from 'node:fs';
import { basename, dirname } from 'node:path';
import {
@ -68,28 +67,6 @@ function resolveModel(cwd: string, options?: RunAgentOptions, agentConfig?: Cust
return undefined;
}
/** Get git diff for review context */
export function getGitDiff(cwd: string): string {
try {
// First check if HEAD exists (new repos may not have any commits)
try {
execSync('git rev-parse HEAD', { cwd, encoding: 'utf-8', stdio: 'pipe' });
} catch {
// No commits yet, return empty diff
return '';
}
const diff = execSync('git diff HEAD', {
cwd,
encoding: 'utf-8',
maxBuffer: 1024 * 1024 * 10, // 10MB
stdio: 'pipe',
});
return diff.trim();
} catch {
return '';
}
}
/** Run a custom agent */
export async function runCustomAgent(

View File

@ -9,7 +9,7 @@
*/
import type { WorkflowStep, WorkflowRule, AgentResponse, Language, ReportConfig, ReportObjectConfig } from '../models/types.js';
import { getGitDiff } from '../agents/runner.js';
/**
* Context for building instruction from template.
@ -299,7 +299,7 @@ function renderWorkflowContext(
* Replace template placeholders in the instruction_template body.
*
* These placeholders may still be used in instruction_template for
* backward compatibility or special cases (e.g., {git_diff} in review steps).
* backward compatibility or special cases.
*/
function replaceTemplatePlaceholders(
template: string,
@ -335,10 +335,6 @@ function replaceTemplatePlaceholders(
}
}
// Replace {git_diff}
const gitDiff = getGitDiff(context.cwd);
result = result.replace(/\{git_diff\}/g, gitDiff);
// Replace {user_inputs}
const userInputsStr = context.userInputs.join('\n');
result = result.replace(
@ -375,7 +371,7 @@ function replaceTemplatePlaceholders(
* 6. Instructions header + instruction_template content always
* 7. Status Output Rules if rules exist
*
* Template placeholders ({task}, {git_diff}, etc.) are still replaced
* Template placeholders ({task}, {previous_response}, etc.) are still replaced
* within the instruction_template body for backward compatibility.
* When a placeholder is present in the template, the corresponding
* auto-injected section is skipped to avoid duplication.