sefirot-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesefirot とは
What is Sefirot
Sefirot は Claude Code 上のマルチエージェントオーケストレーションフレームワーク。3つのエージェント(Planner / Builder / Verifier)が Milestone 単位で設計→実装→検証のループを自動で回す。
- Planner: 設計ドキュメントからタスクを分割し、Wave(並列実行単位)を割り当てる
- Builder: 各タスクを独立した git worktree 内で並列実装する(最大8並列)
- Verifier: Builder のブランチをマージし、テスト・リント・型チェックで検証する。失敗時は fix task を生成して再ループ
すべての状態は (タスクディレクトリ内)と設計ドキュメント(Markdown)で管理される。エージェント間の直接通信はなく、これらのファイルを介して連携する。
milestones.jsonエージェントが判断に迷った場合は の 配列に質問を書き込み、ループが一時停止する。このスキルがその質問をユーザーに仲介し、回答を設計ドキュメントに反映してループを再開する。
milestones.jsonquestionsSefirot is a multi-agent orchestration framework on Claude Code. Three agents (Planner / Builder / Verifier) automatically run the design→implementation→verification loop in Milestone units.
- Planner: Splits tasks from design documents and assigns Waves (parallel execution units)
- Builder: Implements each task in parallel within independent git worktrees (up to 8 parallel executions)
- Verifier: Merges Builder branches and verifies them through tests, linting, and type checks. If verification fails, it generates a fix task and restarts the loop
All states are managed by (in the task directory) and design documents (Markdown). There is no direct communication between agents; they collaborate via these files.
milestones.jsonIf an agent is unsure about a decision, it writes the question to the array in and the loop pauses. This skill mediates that question to the user, reflects the answer in the design document, and restarts the loop.
questionsmilestones.json前提チェック
Prerequisite Check
まず CLI がインストールされているか確認してください:
sefirotbash
command -v sefirotインストールされていない場合は、以下のメッセージを返して終了してください:
CLI がインストールされていません。以下のコマンドでインストールしてください:sefirotbashuv tool install git+https://github.com/agarichan/sefirot.git
First, check if the CLI is installed:
sefirotbash
command -v sefirotIf it is not installed, return the following message and exit:
TheCLI is not installed. Please install it using the following command:sefirotbashuv tool install git+https://github.com/agarichan/sefirot.git
概要
Overview
sefirot のビルドループをバックグラウンドで実行し、エージェントからの質問があればユーザーに確認して回答を反映した上で再実行する。
Run the sefirot build loop in the background, and if there are questions from agents, confirm with the user, reflect the answers, and restart the loop.
手順
Steps
ステップ0: 対象タスクの確認
Step 0: Confirm Target Task
sefirot list --active- 見つからない場合: 以下を案内して終了する:
未完了のタスクがありません。で設計ドキュメントを作成し、
/planで milestones.json を生成してください。/milestone - 1つだけ見つかった場合: そのまま使う。
- 複数見つかった場合: の結果を提示して AskUserQuestion でユーザーにどのタスクを実行するか確認する。
sefirot list --active
Run to check the list of incomplete tasks:
sefirot list --active- If none found: Guide the user with the following and exit:
There are no incomplete tasks. Create a design document withand generate milestones.json with
/plan./milestone - If only one found: Use it directly.
- If multiple found: Present the results of and ask the user which task to execute using the AskUserQuestion tool.
sefirot list --active
ステップ1: バックグラウンドでループ実行
Step 1: Run Loop in Background
Bash ツールの を使ってバックグラウンドで起動する:
run_in_background: truebash
sefirot loop --from-skill --task-dir <ステップ0で特定したタスクディレクトリ>起動後、ユーザーに以下を伝える:
sefirot loop をバックグラウンドで開始しました。 完了時に通知します。実行中も自由に質問できます。
Use the Bash tool's to start it in the background:
run_in_background: truebash
sefirot loop --from-skill --task-dir <task directory identified in Step 0>After starting, inform the user:
The sefirot loop has started in the background. You will be notified when it is completed. You can ask questions freely during execution.
ステップ2: ユーザーとの対話(ループ実行中)
Step 2: Interaction with User (During Loop Execution)
バックグラウンドタスクの完了通知が届くまで、ユーザーの入力を待つ。
ユーザーから質問や依頼があった場合は通常通り応答する。
典型的なリクエスト:
- 「進捗は?」「状況教えて」 → TaskOutput でバックグラウンドプロセスの出力を読み、進捗を報告する。各エージェントの詳細ログは 配下にあるので、必要に応じてそちらも確認する
.sefirot/sessions/<タスク名>/ - その他の質問 → 通常通り応答する
Wait for user input until the background task completion notification arrives.
Respond normally if the user has questions or requests.
Typical requests:
- "How's the progress?" "Tell me the status" → Read the output of the background process with TaskOutput and report the progress. Detailed logs for each agent are located under , so check those if necessary.
.sefirot/sessions/<task name>/ - Other questions → Respond normally.
ステップ3: 完了時の処理
Step 3: Post-Completion Processing
バックグラウンドタスクが完了したら、TaskOutput で出力を取得する。
出力の末尾に 行が含まれているので、そのアクション指示に従う:
[SEFIROT:ACTION]- : 正常完了。ステップ5 に進む。
[SEFIROT:ACTION] COMPLETE - : 質問が保留中。ステップ4 に進む。
[SEFIROT:ACTION] QUESTIONS_PENDING - : エラー。
[SEFIROT:ACTION] ERROR行のメッセージをユーザーに報告し、終了する。[SEFIROT:MESSAGE] - が見つからない場合: 予期しないクラッシュ。出力の末尾をユーザーに報告し、終了する。
[SEFIROT:ACTION]
When the background task is completed, retrieve the output with TaskOutput.
The output ends with a line; follow the action instructions:
[SEFIROT:ACTION]- : Completed successfully. Proceed to Step 5.
[SEFIROT:ACTION] COMPLETE - : Questions are pending. Proceed to Step 4.
[SEFIROT:ACTION] QUESTIONS_PENDING - : Error. Report the message in the
[SEFIROT:ACTION] ERRORline to the user and exit.[SEFIROT:MESSAGE] - If is not found: Unexpected crash. Report the end of the output to the user and exit.
[SEFIROT:ACTION]
ステップ4: 質問の処理
Step 4: Process Questions
エージェントからの質問が の 配列に格納されている。
milestones.json は に配置されている。
milestones.json$.questionsdocs/tasks/<タスクディレクトリ>/milestones.json- milestones.json を読み、配列を取得する
questions - 各質問について:
-
質問内容をユーザーに提示する。フォーマット:
[質問 N/{total}] from {agent} (task: {task_id}) {question} -
AskUserQuestion ツールを使ってユーザーの回答を得る
-
回答を関連する設計ドキュメントに反映する: a.から該当タスクの所属する Milestone を特定する b. その Milestone の
milestones.jsonフィールドから設計ドキュメントのパスを取得する。plan_docがない場合(Planner からの質問等)は、plan_docのmilestones.jsonフィールド(design.md)を使う c. 設計ドキュメント内の該当タスクのセクション(または末尾)に「追加指示」として回答を追記する:sourcemarkdown#### 追加指示(ユーザー回答) - Q: {元の質問} - A: {ユーザーの回答}
-
- 全ての質問を処理したら、の
milestones.json配列を空にする(questions)"questions": [] - 変更をコミットする:
bash
git add -A && git commit -m "chore: resolve agent questions" - ステップ1 に戻り、再度バックグラウンドでループを実行する
Questions from agents are stored in the array of .
milestones.json is located at .
$.questionsmilestones.jsondocs/tasks/<task directory>/milestones.json- Read milestones.json and retrieve the array
questions - For each question:
-
Present the question to the user in the following format:
[Question N/{total}] from {agent} (task: {task_id}) {question} -
Use the AskUserQuestion tool to get the user's answer
-
Reflect the answer in the relevant design document: a. Identify the Milestone to which the corresponding task belongs from milestones.json b. Get the path of the design document from thefield of that Milestone. If there is no
plan_docfield (e.g., questions from Planner), use theplan_docfield (design.md) in milestones.json c. Append the answer as "Additional Instructions" in the relevant task section (or at the end) of the design document:sourcemarkdown#### Additional Instructions (User Answer) - Q: {original question} - A: {user's answer}
-
- After processing all questions, empty the array in milestones.json (set to
questions)"questions": [] - Commit the changes:
bash
git add -A && git commit -m "chore: resolve agent questions" - Return to Step 1 and run the loop in the background again.
ステップ5: 完了報告
Step 5: Completion Report
ループが正常完了したら、結果を報告する:
- を読み、現在の状態を把握する
milestones.json - 以下の情報を報告する:
- 完了した Milestone とそのゴール
- 完了したタスクの一覧
- 次の未完了 Milestone があればその情報
- 検証結果のサマリー
When the loop completes successfully, report the results:
- Read milestones.json to understand the current state
- Report the following information:
- Completed Milestones and their goals
- List of completed tasks
- Information on the next incomplete Milestone, if any
- Summary of verification results
注意事項
Notes
- ループは必ずバックグラウンドで実行する。 フォアグラウンドで実行しない
- ループ実行中もユーザーの入力を受け付け、進捗確認などに応答する
- 質問が発生した場合のみユーザーの判断を求める
- 質問への回答は設計ドキュメントに永続化されるため、再実行時にエージェントが参照できる
- 1回のループで複数の質問が発生する場合がある。全て処理してから再実行すること
- Always run the loop in the background. Do not run it in the foreground.
- Accept user input during loop execution and respond to progress checks, etc.
- Only ask for the user's judgment when questions arise.
- Answers to questions are persisted in the design document, so agents can reference them during re-runs.
- Multiple questions may arise in one loop. Process all of them before re-running.