Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [0.10.0] - 2026-02-09

### Added

- **`structural-reform` builtin piece**: Full project review and structural reform — iterative codebase restructuring with staged file splits, powered by `loop_monitors`
- **`unit-test` builtin piece**: Unit test focused piece — test analysis → test implementation → review → fix, with `loop_monitors` for cycle control
- **`test-planner` persona**: Specialized persona for analyzing codebase and planning comprehensive test strategies
- **Interactive mode variants**: Four selectable modes after piece selection — `assistant` (default: AI-guided requirement refinement), `persona` (conversation with first movement's persona), `quiet` (generate instructions without questions), `passthrough` (user input used as-is)
- **`persona_providers` config**: Per-persona provider overrides (e.g., `{ coder: 'codex' }`) — route specific personas to different providers without creating hybrid pieces
- **`task_poll_interval_ms` config**: Configurable polling interval for `takt run` to detect new tasks during execution (default: 500ms, range: 100–5000ms)
- **`interactive_mode` piece field**: Piece-level default interactive mode override (e.g., set `passthrough` for pieces that don't benefit from AI planning)
- **Task-level output prefixing**: Colored `[taskName]` prefix on all output lines during parallel `takt run` execution, preventing mid-line interleaving between concurrent tasks
- **Review policy facet**: Shared review policy (`builtins/{lang}/policies/review.md`) for consistent review criteria across pieces

### Changed

- **BREAKING:** Removed all Hybrid Codex pieces (`*-hybrid-codex`) — replaced by `persona_providers` config which achieves the same result without duplicating piece files
- Removed `tools/generate-hybrid-codex.mjs` (no longer needed with `persona_providers`)
- Improved parallel execution output: movement-level prefix now includes task context and iteration info in concurrent runs
- Codex client now detects stream hangs (10-minute idle timeout) and distinguishes timeout vs external abort in error messages
- Parallel task execution (`takt run`) now polls for newly added tasks during execution instead of only checking between task completions
- Parallel task execution no longer enforces per-task time limits (previously had a timeout)
- Issue references now routed through interactive mode (as initial input) instead of skipping interactive mode entirely
- Builtin `config.yaml` updated to document all GlobalConfig fields
- Extracted `conversationLoop.ts` for shared conversation logic across interactive mode variants
- Line editor improvements: additional key bindings and edge case fixes

### Fixed

- Codex processes hanging indefinitely when stream becomes idle — now aborted after 10 minutes of inactivity, releasing worker pool slots

### Internal

- New test coverage: engine-persona-providers, interactive-mode (532 lines), task-prefix-writer, workerPool expansion, pieceResolver expansion, lineEditor expansion, parallel-logger expansion, globalConfig-defaults expansion, pieceExecution-debug-prompts expansion, it-piece-loader expansion, runAllTasks-concurrency expansion, engine-parallel
- Extracted `TaskPrefixWriter` for task-level parallel output management
- Extracted `modeSelection.ts`, `passthroughMode.ts`, `personaMode.ts`, `quietMode.ts` from interactive module
- `InteractiveMode` type model added (`src/core/models/interactive-mode.ts`)
- `PieceEngine` validates `taskPrefix`/`taskColorIndex` pair consistency at construction
- Implementation notes document added (`docs/implements/retry-and-session.ja.md`)

## [0.9.0] - 2026-02-08

### Added
Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,25 @@ takt
takt hello
```

**Note:** Issue references (`#6`) and `--task` / `--issue` options skip interactive mode and execute the task directly. All other inputs (including text with spaces) enter interactive mode for requirement refinement.
**Note:** `--task` option skips interactive mode and executes the task directly. Issue references (`#6`, `--issue`) are used as initial input in interactive mode.

**Flow:**
1. Select piece
2. Refine task content through conversation with AI
3. Finalize task instructions with `/go` (you can also add additional instructions like `/go additional instructions`), or use `/play <task>` to execute a task immediately
4. Execute (create worktree, run piece, create PR)
2. Select interactive mode (assistant / persona / quiet / passthrough)
3. Refine task content through conversation with AI
4. Finalize task instructions with `/go` (you can also add additional instructions like `/go additional instructions`), or use `/play <task>` to execute a task immediately
5. Execute (create worktree, run piece, create PR)

#### Interactive Mode Variants

| Mode | Description |
|------|-------------|
| `assistant` | Default. AI asks clarifying questions before generating task instructions. |
| `persona` | Conversation with the first movement's persona (uses its system prompt and tools). |
| `quiet` | Generates task instructions without asking questions (best-effort). |
| `passthrough` | Passes user input directly as task text without AI processing. |

Pieces can set a default mode via the `interactive_mode` field in YAML.

#### Execution Example

Expand Down Expand Up @@ -451,8 +463,10 @@ TAKT includes multiple builtin pieces:
| `passthrough` | Thinnest wrapper. Pass task directly to coder as-is. No review. |
| `compound-eye` | Multi-model review: sends the same instruction to Claude and Codex simultaneously, then synthesizes both responses. |
| `review-only` | Read-only code review piece that makes no changes. |
| `structural-reform` | Full project review and structural reform: iterative codebase restructuring with staged file splits. |
| `unit-test` | Unit test focused piece: test analysis → test implementation → review → fix. |

**Hybrid Codex variants** (`*-hybrid-codex`): Each major piece has a Codex variant where the coder agent runs on Codex while reviewers use Claude. Available for: default, minimal, expert, expert-cqrs, passthrough, review-fix-minimal, coding.
**Per-persona provider overrides:** Use `persona_providers` in config to route specific personas to different providers (e.g., coder on Codex, reviewers on Claude) without duplicating pieces.

Use `takt switch` to switch pieces.

Expand All @@ -475,6 +489,7 @@ Use `takt switch` to switch pieces.
| **research-planner** | Research task planning and scope definition |
| **research-digger** | Deep investigation and information gathering |
| **research-supervisor** | Research quality validation and completeness assessment |
| **test-planner** | Test strategy analysis and comprehensive test planning |
| **pr-commenter** | Posts review findings as GitHub PR comments |

## Custom Personas
Expand Down Expand Up @@ -543,8 +558,15 @@ branch_name_strategy: romaji # Branch name generation: 'romaji' (fast) or 'ai'
prevent_sleep: false # Prevent macOS idle sleep during execution (caffeinate)
notification_sound: true # Enable/disable notification sounds
concurrency: 1 # Parallel task count for takt run (1-10, default: 1 = sequential)
task_poll_interval_ms: 500 # Polling interval for new tasks during takt run (100-5000, default: 500)
interactive_preview_movements: 3 # Movement previews in interactive mode (0-10, default: 3)

# Per-persona provider overrides (optional)
# Route specific personas to different providers without duplicating pieces
# persona_providers:
# coder: codex # Run coder on Codex
# ai-antipattern-reviewer: claude # Keep reviewers on Claude

# API Key configuration (optional)
# Can be overridden by environment variables TAKT_ANTHROPIC_API_KEY / TAKT_OPENAI_API_KEY
anthropic_api_key: sk-ant-... # For Claude (Anthropic)
Expand Down
89 changes: 72 additions & 17 deletions builtins/en/config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,85 @@
# TAKT Global Configuration
# This file contains default settings for takt.
# Location: ~/.takt/config.yaml

# Language setting (en or ja)
# ── Basic ──

# Language (en | ja)
language: en

# Default piece to use when no piece is specified
# Default piece when no piece is specified
default_piece: default

# Log level: debug, info, warn, error
# Log level (debug | info | warn | error)
log_level: info

# Provider runtime: claude or codex
provider: claude
# ── Provider & Model ──

# Builtin pieces (resources/global/{lang}/pieces)
# enable_builtin_pieces: true
# Provider runtime (claude | codex)
provider: claude

# Default model (optional)
# Claude: opus, sonnet, haiku, opusplan, default, or full model name
# Claude: opus, sonnet, haiku
# Codex: gpt-5.2-codex, gpt-5.1-codex, etc.
# model: sonnet

# Anthropic API key (optional, overridden by TAKT_ANTHROPIC_API_KEY env var)
# anthropic_api_key: ""
# Per-persona provider override (optional)
# Override provider for specific personas. Others use the global provider.
# persona_providers:
# coder: codex

# ── API Keys ──
# Optional. Environment variables take priority:
# TAKT_ANTHROPIC_API_KEY, TAKT_OPENAI_API_KEY

# OpenAI API key (optional, overridden by TAKT_OPENAI_API_KEY env var)
# anthropic_api_key: ""
# openai_api_key: ""

# Pipeline execution settings (optional)
# Customize branch naming, commit messages, and PR body for pipeline mode (--task).
# ── Execution ──

# Worktree (shared clone) directory (default: ../{clone-name} relative to project)
# worktree_dir: ~/takt-worktrees

# Auto-create PR after worktree execution (default: prompt in interactive mode)
# auto_pr: false

# Prevent macOS idle sleep during execution using caffeinate (default: false)
# prevent_sleep: false

# ── Parallel Execution (takt run) ──

# Number of tasks to run concurrently (1 = sequential, max: 10)
# concurrency: 1

# Polling interval in ms for picking up new tasks (100-5000, default: 500)
# task_poll_interval_ms: 500

# ── Interactive Mode ──

# Number of movement previews shown in interactive mode (0 to disable, max: 10)
# interactive_preview_movements: 3

# Branch name generation strategy (romaji: fast default | ai: slow)
# branch_name_strategy: romaji

# ── Output ──

# Notification sounds (default: true)
# notification_sound: true

# Minimal output for CI - suppress AI output (default: false)
# minimal_output: false

# ── Builtin Pieces ──

# Enable builtin pieces (default: true)
# enable_builtin_pieces: true

# Exclude specific builtins from loading
# disabled_builtins:
# - magi

# ── Pipeline Mode (--pipeline) ──

# pipeline:
# default_branch_prefix: "takt/"
# commit_message_template: "feat: {title} (#{issue})"
Expand All @@ -37,10 +88,14 @@ provider: claude
# {issue_body}
# Closes #{issue}

# Notification sounds (true: enabled, false: disabled, default: true)
# notification_sound: true
# ── Preferences ──

# Custom paths for preference files
# bookmarks_file: ~/.takt/preferences/bookmarks.yaml
# piece_categories_file: ~/.takt/preferences/piece-categories.yaml

# ── Debug ──

# Debug settings (optional)
# debug:
# enabled: false
# log_file: ~/.takt/logs/debug.log
52 changes: 52 additions & 0 deletions builtins/en/instructions/implement-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Implement unit tests according to the test plan.
Refer only to files within the Report Directory shown in the Piece Context. Do not search or reference other report directories.

**Important: Do NOT modify production code. Only test files may be edited.**

**Actions:**
1. Review the test plan report
2. Implement the planned test cases
3. Run tests and verify all pass
4. Confirm existing tests are not broken

**Test implementation constraints:**
- Follow the project's existing test patterns (naming conventions, directory structure, helpers)
- Write tests in Given-When-Then structure
- One concept per test. Do not mix multiple concerns in a single test

**Scope output contract (create at the start of implementation):**
```markdown
# Change Scope Declaration

## Task
{One-line task summary}

## Planned changes
| Type | File |
|------|------|
| Create | `src/__tests__/example.test.ts` |

## Estimated size
Small / Medium / Large

## Impact area
- {Affected modules or features}
```

**Decisions output contract (at implementation completion, only if decisions were made):**
```markdown
# Decision Log

## 1. {Decision}
- **Context**: {Why the decision was needed}
- **Options considered**: {List of options}
- **Rationale**: {Reason for the choice}
```

**Required output (include headings)**
## Work results
- {Summary of actions taken}
## Changes made
- {Summary of changes}
## Test results
- {Command executed and results}
11 changes: 11 additions & 0 deletions builtins/en/instructions/plan-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Analyze the target code and identify missing unit tests.

**Note:** If a Previous Response exists, this is a replan due to rejection.
Revise the test plan taking that feedback into account.

**Actions:**
1. Read the target module source code and understand its behavior, branches, and state transitions
2. Read existing tests and identify what is already covered
3. Identify missing test cases (happy path, error cases, boundary values, edge cases)
4. Determine test strategy (mock approach, existing test helper usage, fixture design)
5. Provide concrete guidelines for the test implementer
12 changes: 9 additions & 3 deletions builtins/en/instructions/review-arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ Do not review AI-specific issues (already covered by the ai_review movement).
- Dead code
- Call chain verification

**Previous finding tracking (required):**
- First, extract open findings from "Previous Response"
- Assign `finding_id` to each finding and classify current status as `new / persists / resolved`
- If status is `persists`, provide concrete unresolved evidence (file/line)

## Judgment Procedure

1. Review the change diff and detect issues based on the architecture and design criteria above
2. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
3. If there is even one blocking issue, judge as REJECT
1. First, extract previous open findings and preliminarily classify as `new / persists / resolved`
2. Review the change diff and detect issues based on the architecture and design criteria above
3. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
4. If there is even one blocking issue (`new` or `persists`), judge as REJECT
12 changes: 9 additions & 3 deletions builtins/en/instructions/review-qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ Review the changes from a quality assurance perspective.
- Logging and monitoring
- Maintainability

**Previous finding tracking (required):**
- First, extract open findings from "Previous Response"
- Assign `finding_id` to each finding and classify current status as `new / persists / resolved`
- If status is `persists`, provide concrete unresolved evidence (file/line)

## Judgment Procedure

1. Review the change diff and detect issues based on the quality assurance criteria above
2. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
3. If there is even one blocking issue, judge as REJECT
1. First, extract previous open findings and preliminarily classify as `new / persists / resolved`
2. Review the change diff and detect issues based on the quality assurance criteria above
3. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
4. If there is even one blocking issue (`new` or `persists`), judge as REJECT
14 changes: 14 additions & 0 deletions builtins/en/instructions/review-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Review the changes from a test quality perspective.

**Review criteria:**
- Whether all test plan items are covered
- Test quality (Given-When-Then structure, independence, reproducibility)
- Test naming conventions
- Completeness (unnecessary tests, missing cases)
- Appropriateness of mocks and fixtures

## Judgment Procedure

1. Cross-reference the test plan report ({report:00-test-plan.md}) with the implemented tests
2. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
3. If there is even one blocking issue, judge as REJECT
11 changes: 8 additions & 3 deletions builtins/en/output-contracts/architecture-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
- [x] Dead code
- [x] Call chain verification

## Previous Open Findings
| finding_id | Previous Status | Current Status (new/persists/resolved) | Evidence |
|------------|-----------------|-----------------------------------------|----------|
| ARCH-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |

## Issues (if REJECT)
| # | Scope | Location | Issue | Fix Suggestion |
|---|-------|----------|-------|----------------|
| 1 | In-scope | `src/file.ts:42` | Issue description | Fix approach |
| # | finding_id | Status (new/persists) | Scope | Location | Issue | Fix Suggestion |
|---|------------|-----------------------|-------|----------|-------|----------------|
| 1 | ARCH-EXAMPLE-src-file-L42 | new | In-scope | `src/file.ts:42` | Issue description | Fix approach |

Scope: "In-scope" (fixable in this change) / "Out-of-scope" (existing issue, non-blocking)

Expand Down
11 changes: 8 additions & 3 deletions builtins/en/output-contracts/qa-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
| Documentation | ✅ | - |
| Maintainability | ✅ | - |

## Previous Open Findings
| finding_id | Previous Status | Current Status (new/persists/resolved) | Evidence |
|------------|-----------------|-----------------------------------------|----------|
| QA-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |

## Issues (if REJECT)
| # | Category | Issue | Fix Suggestion |
|---|----------|-------|----------------|
| 1 | Testing | Issue description | Fix approach |
| # | finding_id | Status (new/persists) | Category | Issue | Fix Suggestion |
|---|------------|-----------------------|----------|-------|----------------|
| 1 | QA-EXAMPLE-src-file-L42 | new | Testing | Issue description | Fix approach |
```
Loading