Skip to content

feat: takt ワークフロー導入#272

Merged
coji merged 2 commits intomainfrom
feat/takt-setup
Mar 31, 2026
Merged

feat: takt ワークフロー導入#272
coji merged 2 commits intomainfrom
feat/takt-setup

Conversation

@coji
Copy link
Copy Markdown
Owner

@coji coji commented Mar 31, 2026

Summary

durably の .takt/ 構成をベースに upflow 向けの takt ワークフローを導入。

ピース

  • spec-implement-accept: フルフロー(仕様作成 → レビュー → 実装 → 受入テスト → 監督)
  • implement-step: 単一ステップ(実装 → 並列レビュー → 修正ループ)

upflow 向けカスタマイズ

  • DB マイグレーション手順(Atlas + Kysely)を knowledge / policy / instruction に組み込み
  • マルチテナントセキュリティチェックを spec-review に追加
  • doc-update movement を削除(ライブラリではないため不要)
  • pnpm db:setup を acceptance / supervise のバリデーションに追加

Provider 構成(config.yaml)

Persona Provider Model
coder cursor composer-2-fast
architecture-reviewer codex gpt-5.4
acceptor codex gpt-5.4
supervisor codex gpt-5.4
デフォルト claude claude-opus-4-6

Test plan

  • takt タスク作成・実行で各 movement が正常に動作すること

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 新機能
    • タスク→仕様→実装→受け入れ→最終検証までの構造化ワークフローと自動ループ監視を追加しました
    • 役割(コーダー、アーキ、受入者、監督)に基づく多段階レビューと権限モデルを導入しました
  • ドキュメント
    • 仕様作成、仕様レビュー、受入試験、監督手順、実装方針、報告テンプレートなどの運用文書を多数追加しました
  • その他
    • ランタイム/セッション生成物を無視する設定を追加しました

durably の .takt/ 構成をベースに upflow 向けにカスタマイズ:
- spec-implement-accept ピース(フルフロー: 仕様 → レビュー → 実装 → 受入 → 監督)
- implement-step ピース(単一ステップ: 実装 → 並列レビュー → 修正)
- DB マイグレーション手順を knowledge/policy/instruction に組み込み
- マルチテナントセキュリティチェックを spec-review に追加

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50e5827a-aec1-4f65-925e-53c0c47a2cb7

📥 Commits

Reviewing files that changed from the base of the PR and between a040019 and bc888bc.

📒 Files selected for processing (8)
  • .takt/config.yaml
  • .takt/facets/instructions/acceptance.md
  • .takt/facets/instructions/spec-review.md
  • .takt/facets/instructions/supervise.md
  • .takt/facets/output-contracts/spec-review-report.md
  • .takt/facets/output-contracts/supervise-report.md
  • .takt/facets/policies/step-implementation.md
  • .takt/pieces/spec-implement-accept.yaml
✅ Files skipped from review due to trivial changes (6)
  • .takt/facets/output-contracts/supervise-report.md
  • .takt/facets/instructions/supervise.md
  • .takt/facets/output-contracts/spec-review-report.md
  • .takt/facets/policies/step-implementation.md
  • .takt/facets/instructions/acceptance.md
  • .takt/config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .takt/pieces/spec-implement-accept.yaml

📝 Walkthrough

Walkthrough

.takt/ 配下にワークフロー定義、役割ドキュメント、ポリシー、検証手順、出力テンプレート、および基本設定を追加して、タスクの仕様作成から実装・受入・最終検証までの標準化された流れを定義します。

Changes

Cohort / File(s) Summary
Config & Ignore
.takt/.gitignore, .takt/config.yaml, .takt/tasks.yaml
ランタイムアーティファクトの無視設定、LLMプロバイダ/モデルと権限プロファイルの定義、および空のタスクリストを追加。
Instruction Documents
.takt/facets/instructions/*
spec-draft, spec-review, acceptance, supervise 向けの手順書を追加し、各フェーズの実行手順とチェックリストを定義。
Knowledge & Reference
.takt/facets/knowledge/implementation-plan.md
実装計画の運用ルール、プロジェクト規約(SQL、マイグレーション、フォーム/バリデーション、マルチテナント等)を記載。
Personas
.takt/facets/personas/acceptor.md, .takt/facets/personas/supervisor.md
受け入れテスター(Acceptor)と最終検証者(Supervisor)の役割、責務、振る舞い原則を定義。
Policies
.takt/facets/policies/spec-revision.md, .takt/facets/policies/step-implementation.md
仕様改訂とステップ実装に関する制約、品質ルール、DBマイグレーション手順、禁止事項を規定。
Output Templates
.takt/facets/output-contracts/*
spec-review-report.md, acceptance-report.md, supervise-report.md などのレポートテンプレートを追加。
Workflow Pieces
.takt/pieces/implement-step.yaml, .takt/pieces/spec-implement-accept.yaml
単一ステップ実装と包括的ワークフローの定義を追加(ムーブメント、ループ監視、役割割当、出力契約を含む)。

Sequence Diagram(s)

sequenceDiagram
    participant Coder as Coder
    participant Takt as TaktEngine
    participant Architect as Architect
    participant Acceptor as Acceptor
    participant Supervisor as Supervisor
    Coder->>Takt: submit `implement` (order.md に従う)
    Takt->>Coder: acknowledge + run `pnpm validate`/`pnpm db:setup` (if needed)
    Takt->>Architect: trigger `arch-review` (read-only)
    Takt->>Supervisor: trigger `supervise` (read-only)
    Architect-->>Takt: architect-review.md (issues or approve)
    Supervisor-->>Takt: supervisor-validation.md (issues or approve)
    Takt->>Acceptor: run `acceptance` movement (evaluate completion criteria)
    Acceptor-->>Takt: acceptance-report.md (approved or needs_fix)
    alt needs_fix
        Takt->>Coder: route to `fix` (scope-limited edits)
        Coder-->>Takt: updated implementation + validate
        Takt->>Acceptor: re-run acceptance
    else approved
        Takt->>Supervisor: finalize -> COMPLETE
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

小さなウサギが跳ねて言う、
新しい道筋がここに整ったよ🐇,
仕様描いて実装し、受け入れて検証、
フローは清く、チェックは明瞭、
さあ一歩ずつ、進もう楽しく。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトル「feat: takt ワークフロー導入」は、変更セットの主要な内容を明確に要約しており、Takt ワークフロー体系全体(spec-implement-accept、implement-step、関連ポリシー・命令・ペルソナ)の導入という核心的な変更を正確に反映している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/takt-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (4)
.takt/.gitignore (1)

6-7: セッション成果物の ignore はワイルドカード化した方が安全です。

session-state.json / persona_sessions.json の固定名だけだと、派生ファイル名が増えた際に取りこぼす可能性があります。session-*.jsonpersona_sessions*.json のようなパターンにしておくと運用事故を防ぎやすいです。

差分案
-session-state.json
-persona_sessions.json
+session*.json
+persona_sessions*.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/.gitignore around lines 6 - 7, .takt/.gitignore にある固定ファイル名の
ignore(session-state.json,
persona_sessions.json)をワイルドカード化して将来的な派生ファイルを漏れなく無視するようにしてください;具体的には現行の
"session-state.json" と "persona_sessions.json" をそれぞれ "session-*.json" と
"persona_sessions*.json"(または運用に合わせて
"persona_sessions-*.json")のようなパターンに置き換え、既存の該当行を更新してコミットしてください(該当箇所は
.takt/.gitignore の該当エントリを探してください)。
.takt/pieces/implement-step.yaml (3)

79-80: YAML のスカラー値とリスト形式の一貫性

arch-review では policyknowledge がスカラー値として定義されていますが、他の movement(例: implement の Lines 37-42)ではリスト形式で定義されています。機能的には問題ありませんが、可読性と保守性のためにフォーマットを統一することを検討してください。

♻️ リスト形式に統一する場合の例
       - name: arch-review
         edit: false
         persona: architecture-reviewer
-        policy: review
-        knowledge: architecture
+        policy:
+          - review
+        knowledge:
+          - architecture
         rules:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/pieces/implement-step.yaml around lines 79 - 80, The arch-review
movement currently uses scalar values for policy and knowledge; change them to
YAML sequences to match the format used by other movements (e.g., implement) by
converting policy: review to policy: [review] and knowledge: architecture to
knowledge: [architecture] (or the multi-line list form) so all movements use
list-style scalars for consistency; update the arch-review section where the
keys "policy" and "knowledge" are defined accordingly.

99-103: supervise movement に knowledge フィールドがありません

supervise movement はタスクオーダーの完了条件に対して実装を検証しますが、knowledge フィールドが定義されていません。arch-review には knowledge: architecture があり、implementfix には architectureimplementation-plan の両方があります。

supervisor が実装計画やアーキテクチャを参照して適切に検証できるよう、knowledge を追加することを検討してください。

♻️ knowledge フィールドを追加する提案
       - name: supervise
         edit: false
         persona: supervisor
         policy: review
+        knowledge:
+          - architecture
+          - implementation-plan
         instruction: |
           Validate the implementation against the step's completion conditions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/pieces/implement-step.yaml around lines 99 - 103, The supervise
movement lacks a knowledge field so the supervisor cannot reference
architecture/implementation context; update the supervise movement definition
(the movement named "supervise") to include a knowledge entry—e.g., knowledge:
["architecture","implementation-plan"] or at least ["architecture"]—matching how
arch-review uses "architecture" and how implement/fix include "architecture" and
"implementation-plan", so the supervisor can access those artifacts when
validating task completion.

129-153: fix movement に output_contracts がありません

implement movement には coder-scope.mdcoder-decisions.mdoutput_contracts が定義されていますが、fix movement にはありません。修正内容のトレーサビリティのために、修正で何を変更したかを記録する出力レポートの追加を検討してください。

これは意図的な設計判断かもしれませんが、デバッグやループの進捗追跡に役立つ可能性があります。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/pieces/implement-step.yaml around lines 129 - 153, The "fix" movement
lacks an output_contracts entry (whereas the "implement" movement defines
output_contracts for coder-scope.md and coder-decisions.md); add an
output_contracts block under the movement named "fix" in the same
.takt/pieces/implement-step.yaml file that declares the expected fix output
(e.g., a fix-report or fix-decisions artifact and its schema/description) so
fixes are recorded for traceability — mirror the shape/naming used by the
existing implement movement (refer to coder-scope.md and coder-decisions.md
output_contracts) and keep this change limited to the "fix" movement only.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.takt/config.yaml:
- Around line 21-27: provider_profiles currently grants overly broad rights via
default_permission_mode: full for entries like cursor and codex; change their
default_permission_mode to a more restrictive setting (e.g., "edit" or
"read-only")—for example set cursor and codex to "edit" (claude already uses
"edit") and ensure any reviewer/acceptor/supervisor roles are explicitly
escalated only where needed; update provider_profiles, cursor, codex, claude
entries so defaults are not "full" and document any explicit permission
escalations.

In @.takt/facets/instructions/acceptance.md:
- Around line 30-33: スコープ検証で使う比較基準が不明瞭なため、`git diff --name-only` を明示的に `git diff
--name-only HEAD` に固定してください。該当する「Scope check」手順と、スクリプトやCIで呼ばれている場所(`git diff
--name-only` を使っている箇所)を探してコマンドを置き換え、受け入れ判定が再現可能になるようにしてください。

In @.takt/facets/instructions/spec-review.md:
- Line 15: Replace the slightly awkward English phrases to improve readability:
change "a supervise report" (line with that string) to "a supervisory report"
(or "the supervise report" if referring to a specific file) and change "type
regeneration consequences" (line with that string) to "consequences of type
regeneration" (or "type-regeneration consequences" if you prefer a hyphenated
compound). Update the two occurrences accordingly so the wording reads
naturally.

In @.takt/facets/instructions/supervise.md:
- Around line 21-24: `git diff --name-only`
の比較対象が曖昧なので、スコープ外変更を見逃さないように明示的に比較対象を指定してください。具体的には記載箇所のコマンド参照(`git diff
--name-only`)を `git diff --name-only HEAD`(必要に応じて `--relative` を追加)
のように置き換え、どのリビジョンと比較しているかを明示する説明を追記してください。

In @.takt/facets/output-contracts/spec-review-report.md:
- Around line 20-28: Add an explicit "Multitenant security" checklist item to
the spec-review table: insert a new row labeled "Multitenant security checks"
(with Result and Notes columns) alongside the existing aspects such as "DB
migration safety", and populate the <details> block with clear acceptance
criteria (e.g., tenant isolation, ACLs, data partitioning, auth/authorization
checks, and test/migration considerations) so reviewers have concrete pass/fail
checks; update any guiding text in the document that references the checklist to
mention this new item.

In @.takt/facets/output-contracts/supervise-report.md:
- Around line 28-32: Update the supervise report scope check table in
supervise-report.md to include PLAN.md in the "Changed files are within scope"
list so the final gate verifies plan files are unmodified; specifically, add a
row or column entry referencing "PLAN.md unmodified" alongside "order.md
unmodified" in the table (the file supervise-report.md contains the table
currently showing order.md only) so the supervise step enforces the same
plan-document immutability as step-implementation.

In @.takt/facets/policies/step-implementation.md:
- Line 24: 現行の文言だと「DROP TABLE には常に IF EXISTS を付ける」と誤解されるため、本文("Atlas
auto-generated SQL must be reviewed: add `IF EXISTS` to manually added `DROP
TABLE` statements" の説明部分)を修正して、"Atlas が自動生成する中間の `DROP TABLE`(再作成フロー内)は変更禁止、IF
EXISTS を付けるのは手動で追加した `DROP TABLE` のみ" と明確に追記してください;具体的には "Atlas-generated
intermediate `DROP TABLE`" と "manually added `DROP TABLE`"
という語句を使って例外条件を明示し、誤解を生む一般化("常に IF EXISTS")を削除してください.

In @.takt/pieces/spec-implement-accept.yaml:
- Around line 47-48: The current branch uses a single condition "Unproductive"
with "next: implement", which can advance to implement even when blocking issues
remain; split this into two explicit conditions so blocking issues won't
progress: replace the single "condition: Unproductive" rule with two rules
(e.g., "condition: UnresolvedBlocking" -> "next: address" or "review", and
"condition: UnproductiveSuggestions" -> "next: implement"), and ensure whatever
evaluator uses the "condition" values checks for unresolved blocking issues vs
only suggestion-level items so that "next: implement" is only reached from the
suggestions-only condition.

---

Nitpick comments:
In @.takt/.gitignore:
- Around line 6-7: .takt/.gitignore にある固定ファイル名の ignore(session-state.json,
persona_sessions.json)をワイルドカード化して将来的な派生ファイルを漏れなく無視するようにしてください;具体的には現行の
"session-state.json" と "persona_sessions.json" をそれぞれ "session-*.json" と
"persona_sessions*.json"(または運用に合わせて
"persona_sessions-*.json")のようなパターンに置き換え、既存の該当行を更新してコミットしてください(該当箇所は
.takt/.gitignore の該当エントリを探してください)。

In @.takt/pieces/implement-step.yaml:
- Around line 79-80: The arch-review movement currently uses scalar values for
policy and knowledge; change them to YAML sequences to match the format used by
other movements (e.g., implement) by converting policy: review to policy:
[review] and knowledge: architecture to knowledge: [architecture] (or the
multi-line list form) so all movements use list-style scalars for consistency;
update the arch-review section where the keys "policy" and "knowledge" are
defined accordingly.
- Around line 99-103: The supervise movement lacks a knowledge field so the
supervisor cannot reference architecture/implementation context; update the
supervise movement definition (the movement named "supervise") to include a
knowledge entry—e.g., knowledge: ["architecture","implementation-plan"] or at
least ["architecture"]—matching how arch-review uses "architecture" and how
implement/fix include "architecture" and "implementation-plan", so the
supervisor can access those artifacts when validating task completion.
- Around line 129-153: The "fix" movement lacks an output_contracts entry
(whereas the "implement" movement defines output_contracts for coder-scope.md
and coder-decisions.md); add an output_contracts block under the movement named
"fix" in the same .takt/pieces/implement-step.yaml file that declares the
expected fix output (e.g., a fix-report or fix-decisions artifact and its
schema/description) so fixes are recorded for traceability — mirror the
shape/naming used by the existing implement movement (refer to coder-scope.md
and coder-decisions.md output_contracts) and keep this change limited to the
"fix" movement only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6f645280-c459-411e-888b-fab3963dd363

📥 Commits

Reviewing files that changed from the base of the PR and between f741e2a and a040019.

📒 Files selected for processing (17)
  • .takt/.gitignore
  • .takt/config.yaml
  • .takt/facets/instructions/acceptance.md
  • .takt/facets/instructions/spec-draft.md
  • .takt/facets/instructions/spec-review.md
  • .takt/facets/instructions/supervise.md
  • .takt/facets/knowledge/implementation-plan.md
  • .takt/facets/output-contracts/acceptance-report.md
  • .takt/facets/output-contracts/spec-review-report.md
  • .takt/facets/output-contracts/supervise-report.md
  • .takt/facets/personas/acceptor.md
  • .takt/facets/personas/supervisor.md
  • .takt/facets/policies/spec-revision.md
  • .takt/facets/policies/step-implementation.md
  • .takt/pieces/implement-step.yaml
  • .takt/pieces/spec-implement-accept.yaml
  • .takt/tasks.yaml


2. Actually read the files to change and understand the existing code structure

3. If a supervise report exists (`supervise-report.md`), read it and incorporate its findings into the review
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

用語の自然さを調整した方が読みやすいです

Line 15 の “a supervise report” と Line 29 の “type regeneration consequences” は、英語として少し不自然です。軽微ですが明確化を推奨します。

✏️ 提案差分
-3. If a supervise report exists (`supervise-report.md`), read it and incorporate its findings into the review
+3. If a supervision report exists (`supervise-report.md`), read it and incorporate its findings into the review
...
-   - Are Kysely type regeneration (`pnpm db:generate`) consequences accounted for?
+   - Are Kysely type-regeneration (`pnpm db:generate`) consequences accounted for?

Also applies to: 29-29

🧰 Tools
🪛 LanguageTool

[grammar] ~15-~15: Ensure spelling is correct
Context: ...nd the existing code structure 3. If a supervise report exists (supervise-report.md), ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/facets/instructions/spec-review.md at line 15, Replace the slightly
awkward English phrases to improve readability: change "a supervise report"
(line with that string) to "a supervisory report" (or "the supervise report" if
referring to a specific file) and change "type regeneration consequences" (line
with that string) to "consequences of type regeneration" (or "type-regeneration
consequences" if you prefer a hyphenated compound). Update the two occurrences
accordingly so the wording reads naturally.

Comment on lines +20 to +28
| Aspect | Result | Notes |
| ------------------------------------ | ------ | ----- |
| Clarity of implementation scope | OK/NG | |
| Completeness of files to change | OK/NG | |
| Verifiability of completion criteria | OK/NG | |
| Appropriateness of scope | OK/NG | |
| Leveraging existing patterns | OK/NG | |
| DB migration safety (if applicable) | OK/NG | |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

spec-review のチェックリストにマルチテナントセキュリティ項目を明示してください。

PR 目的にある「multitenant security check」を出力契約で明文化しておかないと、レビュー品質が担当者依存になります。

差分案
 | Leveraging existing patterns         | OK/NG  |       |
+| Multi-tenant security invariants     | OK/NG  |       |
 | DB migration safety (if applicable)  | OK/NG  |       |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/facets/output-contracts/spec-review-report.md around lines 20 - 28,
Add an explicit "Multitenant security" checklist item to the spec-review table:
insert a new row labeled "Multitenant security checks" (with Result and Notes
columns) alongside the existing aspects such as "DB migration safety", and
populate the <details> block with clear acceptance criteria (e.g., tenant
isolation, ACLs, data partitioning, auth/authorization checks, and
test/migration considerations) so reviewers have concrete pass/fail checks;
update any guiding text in the document that references the checklist to mention
this new item.

- provider_profiles の default_permission_mode を full → edit に制限
- git diff --name-only に HEAD を明示(acceptance, supervise)
- spec-review-report にマルチテナントセキュリティチェック項目を追加
- supervise-report に PLAN.md unmodified チェックを追加
- DROP TABLE の IF EXISTS ルールで Atlas 生成分と手動分を明確に区別
- loop_monitor の分岐を分離(blocking 未解決時は ABORT)
- 英語表現の修正(supervise report → supervision report 等)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coji coji merged commit 3893102 into main Mar 31, 2026
6 checks passed
@coji coji deleted the feat/takt-setup branch March 31, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant