- permission_mode を readonly/edit/full に統一(プロバイダー非依存) - Claude SDK: readonly→default, edit→acceptEdits, full→bypassPermissions とマッピング - Codex SDK: readonly→read-only, edit→workspace-write, full→danger-full-access とマッピング - Legacy値(default/acceptEdits/bypassPermissions)のサポートを削除 - 全ビルトインワークフローを新しい permission_mode 値に更新 - AgentRunner の ProviderCallOptions 生成ロジックをリファクタリング(DRY化)
347 lines
9.4 KiB
YAML
347 lines
9.4 KiB
YAML
# Simple TAKT Workflow
|
|
# Plan -> Implement -> AI Review -> Architect Review -> Supervisor Approval
|
|
#
|
|
# Template Variables (auto-injected by engine):
|
|
# {iteration} - Workflow-wide turn count
|
|
# {max_iterations} - Maximum iterations allowed
|
|
# {step_iteration} - Per-step iteration count
|
|
# {task} - Original user request
|
|
# {previous_response} - Output from the previous step
|
|
# {user_inputs} - Accumulated user inputs during workflow
|
|
# {report_dir} - Report directory name
|
|
#
|
|
# Auto-injected sections (do NOT include in instruction_template):
|
|
# ## Workflow Context - iteration, step_iteration, report info
|
|
# ## User Request - {task}
|
|
# ## Previous Response - {previous_response}
|
|
# ## Additional User Inputs - {user_inputs}
|
|
|
|
name: simple
|
|
description: Simplified development workflow (plan -> implement -> ai_review -> review -> supervise)
|
|
|
|
max_iterations: 20
|
|
|
|
initial_step: plan
|
|
|
|
steps:
|
|
- name: plan
|
|
edit: false
|
|
agent: ../agents/default/planner.md
|
|
report:
|
|
name: 00-plan.md
|
|
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
|
|
- Grep
|
|
- Write
|
|
- Bash
|
|
- WebSearch
|
|
- WebFetch
|
|
rules:
|
|
- condition: Requirements are clear and implementable
|
|
next: implement
|
|
- condition: User is asking a question
|
|
next: COMPLETE
|
|
- condition: Requirements unclear, insufficient info
|
|
next: ABORT
|
|
pass_previous_response: true
|
|
instruction_template: |
|
|
## Previous Response (when returned from implement)
|
|
{previous_response}
|
|
|
|
Analyze the task and create an implementation plan.
|
|
|
|
**Note:** If returned from implement step (Previous Response exists),
|
|
review and revise the plan based on that feedback (replan).
|
|
|
|
**Tasks (for implementation tasks):**
|
|
1. Understand the requirements
|
|
2. Identify impact scope
|
|
3. Decide implementation approach
|
|
|
|
- name: implement
|
|
edit: true
|
|
agent: ../agents/default/coder.md
|
|
report:
|
|
- Scope: 01-coder-scope.md
|
|
- Decisions: 02-coder-decisions.md
|
|
allowed_tools:
|
|
- Read
|
|
- Glob
|
|
- Grep
|
|
- Edit
|
|
- Write
|
|
- Bash
|
|
- WebSearch
|
|
- WebFetch
|
|
permission_mode: edit
|
|
rules:
|
|
- condition: Implementation complete
|
|
next: ai_review
|
|
- condition: No implementation (report only)
|
|
next: ai_review
|
|
- condition: Cannot proceed, insufficient info
|
|
next: ai_review
|
|
- condition: User input required
|
|
next: implement
|
|
requires_user_input: true
|
|
interactive_only: true
|
|
instruction_template: |
|
|
Follow the plan from the plan step and implement.
|
|
Refer to the plan report ({report:00-plan.md}) and proceed with implementation.
|
|
Use only the Report Directory files shown in Workflow Context. Do not search or open reports outside that directory.
|
|
|
|
**Scope report format (create at implementation start):**
|
|
```markdown
|
|
# Change Scope Declaration
|
|
|
|
## Task
|
|
{One-line task summary}
|
|
|
|
## Planned Changes
|
|
| Type | File |
|
|
|------|------|
|
|
| Create | `src/example.ts` |
|
|
| Modify | `src/routes.ts` |
|
|
|
|
## Estimated Size
|
|
Small / Medium / Large
|
|
|
|
## Impact Scope
|
|
- {Affected modules or features}
|
|
```
|
|
|
|
**Decisions report format (on completion, only if decisions were made):**
|
|
```markdown
|
|
# Decision Log
|
|
|
|
## 1. {Decision Content}
|
|
- **Background**: {Why the decision was needed}
|
|
- **Options Considered**: {List of options}
|
|
- **Reason**: {Why this option was chosen}
|
|
```
|
|
|
|
**Required output (include headings)**
|
|
## Work done
|
|
- {summary of work performed}
|
|
## Changes made
|
|
- {summary of code changes}
|
|
## Test results
|
|
- {command and outcome}
|
|
|
|
**No-implementation handling (required)**
|
|
|
|
**Required output (include headings)**
|
|
## Work done
|
|
- {summary of work performed}
|
|
## Changes made
|
|
- {summary of code changes}
|
|
## Test results
|
|
- {command and outcome}
|
|
|
|
- name: ai_review
|
|
edit: false
|
|
agent: ../agents/default/ai-antipattern-reviewer.md
|
|
report:
|
|
name: 03-ai-review.md
|
|
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
|
|
- Grep
|
|
- Write
|
|
- WebSearch
|
|
- WebFetch
|
|
rules:
|
|
- condition: No AI-specific issues
|
|
next: review
|
|
- condition: AI-specific issues found
|
|
next: plan
|
|
instruction_template: |
|
|
Review the code for AI-specific issues:
|
|
- Assumption validation
|
|
- Plausible but wrong patterns
|
|
- Context fit with existing codebase
|
|
- Scope creep detection
|
|
|
|
- name: review
|
|
edit: false
|
|
agent: ../agents/default/architecture-reviewer.md
|
|
report:
|
|
name: 04-architect-review.md
|
|
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
|
|
- Grep
|
|
- Write
|
|
- WebSearch
|
|
- WebFetch
|
|
rules:
|
|
- condition: No issues found
|
|
next: supervise
|
|
- condition: Structural fix required
|
|
next: plan
|
|
instruction_template: |
|
|
Focus on **architecture and design** review. Do NOT review AI-specific issues (that's already done).
|
|
|
|
Review the changes and provide feedback.
|
|
|
|
**Note:** In simple workflow, IMPROVE judgment is not used.
|
|
If there are minor suggestions, use APPROVE + comments.
|
|
|
|
- name: supervise
|
|
edit: false
|
|
agent: ../agents/default/supervisor.md
|
|
report:
|
|
- Validation: 05-supervisor-validation.md
|
|
- Summary: summary.md
|
|
allowed_tools:
|
|
- Read
|
|
- Glob
|
|
- Grep
|
|
- Write
|
|
- Bash
|
|
- WebSearch
|
|
- WebFetch
|
|
rules:
|
|
- condition: All checks passed
|
|
next: COMPLETE
|
|
- condition: Requirements unmet, tests failing
|
|
next: plan
|
|
instruction_template: |
|
|
Run tests, verify the build, and perform final approval.
|
|
|
|
**Workflow Overall Review:**
|
|
1. Does the implementation match the plan ({report:00-plan.md})?
|
|
2. Were all review step issues addressed?
|
|
3. Was the original task objective achieved?
|
|
|
|
**Review Reports:** Read all reports in Report Directory and
|
|
check for any unaddressed improvement suggestions.
|
|
|
|
**Validation report format:**
|
|
```markdown
|
|
# Final Validation Results
|
|
|
|
## Result: APPROVE / REJECT
|
|
|
|
## Validation Summary
|
|
| Item | Status | Verification Method |
|
|
|------|--------|---------------------|
|
|
| Requirements met | ✅ | Matched against requirements list |
|
|
| Tests | ✅ | `npm test` (N passed) |
|
|
| Build | ✅ | `npm run build` succeeded |
|
|
| Functional check | ✅ | Main flows verified |
|
|
|
|
## Deliverables
|
|
- Created: {Created files}
|
|
- Modified: {Modified files}
|
|
|
|
## Incomplete Items (if REJECT)
|
|
| # | Item | Reason |
|
|
|---|------|--------|
|
|
| 1 | {Item} | {Reason} |
|
|
```
|
|
|
|
**Summary report format (only if APPROVE):**
|
|
```markdown
|
|
# Task Completion Summary
|
|
|
|
## Task
|
|
{Original request in 1-2 sentences}
|
|
|
|
## Result
|
|
✅ Complete
|
|
|
|
## Changes
|
|
| Type | File | Summary |
|
|
|------|------|---------|
|
|
| Create | `src/file.ts` | Summary description |
|
|
|
|
## Review Results
|
|
| Review | Result |
|
|
|--------|--------|
|
|
| AI Review | ✅ APPROVE |
|
|
| Architect | ✅ APPROVE |
|
|
| Supervisor | ✅ APPROVE |
|
|
|
|
## Verification Commands
|
|
```bash
|
|
npm test
|
|
npm run build
|
|
```
|
|
```
|