dev-orchestra で役割ごとに決まった指示を渡してみた Giving dev-orchestra Standing Instructions per Role
はじめに
dev-orchestra に依頼するたびに、「テストは python -m unittest で」「標準ライブラリだけで書いて」のような同じ注文を書いていました。1.2.1 で入った instructions を使うと、こうした決まった指示を役割ごとに一度だけ書いておけます。v1.1.0 から v1.2.1 までの変更全体は、リリースの記事にまとめています。
試した環境です。
- Windows 11
- dev-orchestra 1.2.1
- Claude Code 2.1.309(implementer は Claude の sonnet)
- Codex CLI 0.163.0(レビュアーの 1 人)
試すときは、普段の設定とは別のフォルダを DEV_ORCHESTRA_HOME に指定し、作業用に作った小さな Python のリポジトリ(textkit)で動かしています。オーケストレーターが自動で進める手順を、ここではコマンドで 1 つずつ実行しました。
dev-orchestra は GitHub で公開しています(MIT ライセンス)。役に立ちそうと思ったら、スターを付けてもらえるとうれしいです。
手順
1. 指示を書く
リポジトリの .dev-orchestra.yaml に、instructions を書きます。
version: 1
instructions:
orchestrator: "Ask before adding a new dependency."
implementer:
file: .dev-orchestra/implementer.md
reviewers: "Check that every public function in textkit/ has a docstring."
implementer への指示は長くなりそうなので、ファイルに分けました。
- Use only the Python standard library.
- Every public function gets a docstring and type hints.
- Run tests with `python -m unittest`.
書ける役割は次のとおりです。
| キー | 渡る相手 |
|---|---|
orchestrator | オーケストレーター(Claude Code など、ワークフローを進める側) |
architect | 計画を書く役 |
implementer | 実装する役 |
review_fixer | 指摘を直す役 |
reviewers | すべてのコードレビュアー |
design_reviewers | すべての設計レビュアー |
値は文字列か {file: <パス>} です。パスはリポジトリのルートからの相対パスで、リポジトリの外は指せません。レビュアーの席には、その席だけの instructions も書けます。
2. config validate の注意を読む
書いたら config validate を実行します。
$ dev-orchestra config validate
Configuration is valid.
Warnings:
- instructions.orchestrator: the project config (.dev-orchestra.yaml) gives the session standing orders, which `status` tells it to follow; that file can come with the branch under review, so check that this is intended
- instructions.implementer: the project config (.dev-orchestra.yaml) gives the implementer standing orders, and it runs with write access; that file can come with the branch under review, so check that this is intended
- instructions.reviewers: the project config (.dev-orchestra.yaml) sets reviewer instructions; that file can come with the branch under review, so check that this is intended
設定としては正しいのですが、指示 1 つにつき 1 行の注意が出ます。リポジトリの中の .dev-orchestra.yaml は、レビューするブランチと一緒に入ってくることがあるからです。他人のブランチに「implementer はこうしろ」と書かれていたら、それが書き込み権限のある実行に渡ります。implementer の行に it runs with write access とあるのはそのためです。
注意は拒否ではありません。自分で書いた指示なら、そのまま進めて大丈夫です。同じ行は doctor と review run でも出ます。
3. status と config show で確かめる
status には Instructions: の行が出ます。どの役割に、どこから(global か project か、インラインかファイルか)、何文字の指示が効いているかが分かります。
$ dev-orchestra status
...
Plan approval: pending -- present .ai/workflows/instr/plan.md and the instructions in force to the user and ask; a yes is recorded with `design approve`, never without one
Instructions: orchestrator (project, inline, 35 chars); implementer (project, .dev-orchestra/implementer.md, 135 chars); reviewers (project, inline, 61 chars)
Orchestrator instruction (follow it; the skill's rules come first):
Ask before adding a new dependency.
ポイントは 2 つあります。
- orchestrator への指示は、プロンプトではなく
statusで渡ります。 オーケストレーターはstatusを読みながら進むので、本文がそのまま表示されます。「スキルの規則が先」と添えられています - 計画の承認を求めるときに、指示も見せるよう促されます。 指示が効いている間は、
Plan approval:の行にand the instructions in forceが足されます
config show にも Instructions の節が出ます。
Instructions
orchestrator (project, inline, 35 chars)
implementer (project, .dev-orchestra/implementer.md, 135 chars)
reviewers (project, inline, 61 chars)
Orchestrator instruction:
Ask before adding a new dependency.
4. implementer に渡ったプロンプトを見る
小さな計画(truncate(text, width) を足す)を承認して、implementer を走らせました。プロンプトを見るために、もう一度、implementer を mock アダプタ(トークンを使わない試験用のアダプタ)に切り替えて --detach で走らせ、保存されたプロンプトを開きました。
## Project instructions
Where a project instruction conflicts with any other rule in this prompt or with the request below, follow those instead.
Sources: project .dev-orchestra/implementer.md.
- Use only the Python standard library.
- Every public function gets a docstring and type hints.
- Run tests with `python -m unittest`.
Implement the approved plan at .ai/workflows/instr/plan.md.
...
指示は ## Project instructions の見出しの下で、依頼の前に入ります。「ほかの規則や依頼とぶつかったら、そちらに従う」という 1 行が付くので、指示は CLI の規則や依頼より弱い扱いです。
Claude(sonnet)で走らせたときに書かれた textkit/truncate.py は、指示どおり型ヒントと docstring が付き、標準ライブラリだけでした。
def truncate(text: str, width: int) -> str:
"""Return text unchanged if it fits in width, else cut it so that the result ending in "..." is width characters long.
Raises ValueError if text must be cut but width is too small to hold "...".
"""
計画には型ヒントも docstring も書いていません。それでも付いたのは指示のおかげと考えていますが、指示なしで同じ計画を走らせて比べてはいません。
5. global と project の指示はつながる
instructions は、ほかの設定と違う動きをします。ほかのキーは project の値が global の値を上書きしますが、instructions は両方の本文をつなげます(global が先)。
global の設定(DEV_ORCHESTRA_HOME の config.yaml)にも implementer への指示を足しました。
instructions:
implementer: "Keep each change small; leave no TODO comments."
status には、implementer の指示が 2 つ並びます。
Instructions: orchestrator (project, inline, 35 chars); implementer (global, inline, 47 chars); implementer (project, .dev-orchestra/implementer.md, 135 chars); reviewers (project, inline, 61 chars)
自分の好み(global)と、リポジトリの決まり(project)を分けて書けます。
6. レビュアーへの指示は「見るものを足す」だけ
レビュアーへの指示は、タスクの規則のあと、変更の前に入ります。そのうえで、レビュアーには指示は見るものを足すことしかできないと伝えられます。「この指摘は出さないで」「severity を下げて」のような指示には従いません。ブランチと一緒に入ってきた指示で、レビューを甘くされないためです。
レビュアーのプロンプトはファイルに残らないので、mock アダプタのレビュアーで確かめました。mock は、環境変数 DEV_ORCHESTRA_MOCK_FAIL に書いた文字列がプロンプトに含まれていると失敗します。これで、指示の本文(has a docstring)と、見るものを足すだけという一文(may only add)が、どちらもレビュアーのプロンプトに入っていることを確かめました(含まれない文字列では成功しました)。
7. 指示を変える変更は、高リスクとしてレビューされる
指示のファイルを書き換えた変更を、レビューにかけてみました。
$ echo "- Never edit tests/ without a failing test first." >> .dev-orchestra/implementer.md
$ dev-orchestra review run --force
note: balanced → quality: .dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)
note: claude-test (when: relevance) added: .dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)
note: high-risk round (.dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)): claude-security runs opus instead of sonnet
ok claude-general claude opus 1 finding(s)
ok codex-general codex gpt-6.1-sol 0 finding(s)
ok claude-security claude opus 0 finding(s)
ok claude-test claude sonnet 2 finding(s)
ok mock-general mock recommended-coding 0 finding(s)
5 successful, 0 failed
(instructions の注意の行は省きました。mock-general は手順 6 で足した試験用のレビュアーです。--force は、同じ作業で何度もレビューを走らせていて、回数の上限(2 回)を越えるために付けています。)
1 行だけの変更ですが、最適化のレベルが balanced から quality に上がり、パネル全体が走り、セキュリティのレビュアーは opus に上がりました。review snapshot --json にも、変わった指示のファイルが instruction_changes として記録されます。
{'instruction_changes': ['.dev-orchestra/implementer.md']}
指示は、これからのすべての実行に効きます。だから、指示を変える変更は認証や決済のコードと同じく、高リスクとして扱われます。
8. 指示のファイルが無いとき
指示のファイルを消してみると、status は 0 chars: not found と出し、doctor は note を出しました。
Instructions: orchestrator (project, inline, 35 chars); implementer (global, inline, 47 chars); implementer (project, .dev-orchestra/implementer.md, 0 chars: not found); reviewers (project, inline, 61 chars)
- instructions for implementer (project file): .dev-orchestra/implementer.md not found; runs go on without it
実行は止まらず、その指示なしで続きます。ファイルが 32 KB より大きいとき、リンクやジャンクションを通るときも同じ扱いだと、リファレンスにあります(こちらは試していません)。
9. 作業単位向けの設定もいっしょに入った
1.2.1 では、作業単位(1.2.0)向けの設定も 2 つ増えました。
| 設定 | 内容 |
|---|---|
implementation.unit_tests: after_merge | 各作業単位はテストを流さず、すべてをマージしたあとに 1 回だけ流す。テスト用のデータベースやポートを共有しているとき向け |
implementation.worktree_files | git が無視するファイル(config/database.yml、.env.test など)を、作業単位の worktree にコピーする |
unit_tests: after_merge は、作業単位の記事で使いました。worktree_files は今回は試していません。
まとめ
.dev-orchestra.yaml(または global の設定)のinstructionsに、役割ごとの決まった指示を書ける。インラインでも、ファイルでもよい- project ファイルの指示には、
config validate/doctor/review runが注意を 1 行ずつ出す。ブランチと一緒に入ってくることがあるため - 指示は
## Project instructionsの下でプロンプトに入り、CLI の規則や依頼より弱い。orchestrator への指示はstatusに出る - global と project の指示はつながる(ほかの設定のように上書きしない)
- レビュアーへの指示は見るものを足すだけ。指摘を控えさせることはできない
- 指示を変える変更は高リスクとしてレビューされる
- 指示のファイルが無くても、実行は止まらない
GitHub: istb16/dev-orchestra(スターを付けてもらえると励みになります)
Introduction
Every time I asked dev-orchestra for something, I wrote the same requests: “run tests with python -m unittest”, “use only the standard library”. With instructions, added in 1.2.1, these standing instructions can be written once per role. All the changes from v1.1.0 to v1.2.1 are in the release post.
My environment:
- Windows 11
- dev-orchestra 1.2.1
- Claude Code 2.1.309 (the implementer was Claude’s sonnet)
- Codex CLI 0.163.0 (one of the reviewers)
For the test, I pointed DEV_ORCHESTRA_HOME at a folder separate from my everyday configuration and worked in a small Python repository made for it (textkit). I ran the steps the orchestrator normally runs for you as commands, one at a time.
dev-orchestra is open source on GitHub (MIT license). If it looks useful, a star would mean a lot.
Steps
1. Write the instructions
Put instructions in the repository’s .dev-orchestra.yaml.
version: 1
instructions:
orchestrator: "Ask before adding a new dependency."
implementer:
file: .dev-orchestra/implementer.md
reviewers: "Check that every public function in textkit/ has a docstring."
The implementer’s instructions looked like they’d grow, so I put them in a file.
- Use only the Python standard library.
- Every public function gets a docstring and type hints.
- Run tests with `python -m unittest`.
These are the roles you can write for:
| Key | Who receives it |
|---|---|
orchestrator | The orchestrator (Claude Code or another agent that drives the workflow) |
architect | The role that writes the plan |
implementer | The role that implements |
review_fixer | The role that fixes findings |
reviewers | Every code reviewer |
design_reviewers | Every design reviewer |
A value is a string or {file: <path>}. The path is relative to the repository root and can’t point outside it. A reviewer seat can also carry its own instructions.
2. Read the notes from config validate
After writing them, run config validate.
$ dev-orchestra config validate
Configuration is valid.
Warnings:
- instructions.orchestrator: the project config (.dev-orchestra.yaml) gives the session standing orders, which `status` tells it to follow; that file can come with the branch under review, so check that this is intended
- instructions.implementer: the project config (.dev-orchestra.yaml) gives the implementer standing orders, and it runs with write access; that file can come with the branch under review, so check that this is intended
- instructions.reviewers: the project config (.dev-orchestra.yaml) sets reviewer instructions; that file can come with the branch under review, so check that this is intended
The configuration is valid, but there is one note per instruction. The .dev-orchestra.yaml in a repository can arrive with the branch under review. If someone else’s branch says “implementer, do this”, it reaches a run with write access. That’s why the implementer’s line says it runs with write access.
The notes don’t refuse anything. If you wrote the instructions yourself, carry on. The same lines also appear from doctor and review run.
3. Check with status and config show
status prints an Instructions: line. It shows which roles have instructions in force, where they come from (global or project, inline or a file), and how many characters they are.
$ dev-orchestra status
...
Plan approval: pending -- present .ai/workflows/instr/plan.md and the instructions in force to the user and ask; a yes is recorded with `design approve`, never without one
Instructions: orchestrator (project, inline, 35 chars); implementer (project, .dev-orchestra/implementer.md, 135 chars); reviewers (project, inline, 61 chars)
Orchestrator instruction (follow it; the skill's rules come first):
Ask before adding a new dependency.
Two things to notice:
- The orchestrator’s instruction reaches it through
status, not a prompt. The orchestrator readsstatusas it goes, so the text is printed in full, with a note that the skill’s rules come first - You’re prompted to show the instructions when the plan is approved. While any instruction is in force, the
Plan approval:line gainsand the instructions in force
config show has an Instructions section too.
Instructions
orchestrator (project, inline, 35 chars)
implementer (project, .dev-orchestra/implementer.md, 135 chars)
reviewers (project, inline, 61 chars)
Orchestrator instruction:
Ask before adding a new dependency.
4. Look at the prompt the implementer received
I approved a small plan (add truncate(text, width)) and ran the implementer. To see the prompt, I ran the implementer once more on the mock adapter (a test adapter that spends no tokens) with --detach, and opened the saved prompt.
## Project instructions
Where a project instruction conflicts with any other rule in this prompt or with the request below, follow those instead.
Sources: project .dev-orchestra/implementer.md.
- Use only the Python standard library.
- Every public function gets a docstring and type hints.
- Run tests with `python -m unittest`.
Implement the approved plan at .ai/workflows/instr/plan.md.
...
The instructions go under ## Project instructions, before the request. The line saying “where they conflict with other rules or the request, follow those instead” makes them weaker than the CLI’s rules and the request.
The textkit/truncate.py written by the run on Claude (sonnet) had type hints and a docstring and used only the standard library, as instructed.
def truncate(text: str, width: int) -> str:
"""Return text unchanged if it fits in width, else cut it so that the result ending in "..." is width characters long.
Raises ValueError if text must be cut but width is too small to hold "...".
"""
The plan said nothing about type hints or docstrings. I believe they came from the instructions, but I didn’t run the same plan without them to compare.
5. Global and project instructions are joined
instructions behaves differently from the other settings. For other keys, the project value overrides the global one, but for instructions both texts are joined (global first).
I added an implementer instruction to the global configuration (config.yaml in DEV_ORCHESTRA_HOME) too.
instructions:
implementer: "Keep each change small; leave no TODO comments."
status now lists two implementer instructions.
Instructions: orchestrator (project, inline, 35 chars); implementer (global, inline, 47 chars); implementer (project, .dev-orchestra/implementer.md, 135 chars); reviewers (project, inline, 61 chars)
You can keep your own preferences (global) apart from the repository’s rules (project).
6. Reviewer instructions can only add things to look at
Reviewer instructions go after the task’s rules and before the change. Reviewers are also told that instructions can only add things to look at. Instructions like “don’t report this” or “lower the severity” are not followed, so instructions arriving with a branch can’t soften the review.
Reviewer prompts aren’t saved to a file, so I checked with a reviewer on the mock adapter. The mock fails when the prompt contains the string in the environment variable DEV_ORCHESTRA_MOCK_FAIL. That’s how I confirmed that both the instruction text (has a docstring) and the sentence about only adding things to look at (may only add) were in the reviewer’s prompt (with a string that isn’t there, it succeeded).
7. A change to the instructions is reviewed as high-risk
I put a change that edits the instruction file up for review.
$ echo "- Never edit tests/ without a failing test first." >> .dev-orchestra/implementer.md
$ dev-orchestra review run --force
note: balanced → quality: .dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)
note: claude-test (when: relevance) added: .dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)
note: high-risk round (.dev-orchestra/implementer.md matches .dev-orchestra/implementer.md (and 1 more)): claude-security runs opus instead of sonnet
ok claude-general claude opus 1 finding(s)
ok codex-general codex gpt-6.1-sol 0 finding(s)
ok claude-security claude opus 0 finding(s)
ok claude-test claude sonnet 2 finding(s)
ok mock-general mock recommended-coding 0 finding(s)
5 successful, 0 failed
(I left out the instructions note lines. mock-general is the test reviewer added in step 6. --force is there because I had already run several reviews in this workflow and needed to go past the round limit of 2.)
It’s a one-line change, but the optimization level went up from balanced to quality, the whole panel ran, and the security reviewer was raised to opus. review snapshot --json also records the changed instruction file as instruction_changes.
{'instruction_changes': ['.dev-orchestra/implementer.md']}
Instructions apply to every run from then on. That’s why a change to them is treated as high-risk, like changes to authentication or payment code.
8. When an instruction file is missing
When I removed the instruction file, status said 0 chars: not found and doctor printed a note.
Instructions: orchestrator (project, inline, 35 chars); implementer (global, inline, 47 chars); implementer (project, .dev-orchestra/implementer.md, 0 chars: not found); reviewers (project, inline, 61 chars)
- instructions for implementer (project file): .dev-orchestra/implementer.md not found; runs go on without it
Runs don’t stop; they go on without that instruction. According to the reference, a file over 32 KB or one reached through a link or junction is treated the same way (I didn’t try those).
9. Settings for work units came along too
1.2.1 also added two settings for work units (1.2.0).
| Setting | What it does |
|---|---|
implementation.unit_tests: after_merge | Units don’t run tests; the suite runs once after everything is merged. For tests that share a database or a port |
implementation.worktree_files | Copies git-ignored files (config/database.yml, .env.test and so on) into each unit’s worktree |
I used unit_tests: after_merge in the work units post. I didn’t try worktree_files this time.
Summary
- Write standing instructions per role under
instructionsin.dev-orchestra.yaml(or the global configuration), inline or in a file - For instructions in the project file,
config validate/doctor/review runprint one note each, since that file can arrive with a branch - Instructions go into the prompt under
## Project instructionsand are weaker than the CLI’s rules and the request. The orchestrator’s appear instatus - Global and project instructions are joined (not overridden like other settings)
- Reviewer instructions can only add things to look at; they can’t hold findings back
- A change to the instructions is reviewed as high-risk
- A missing instruction file doesn’t stop the run
GitHub: istb16/dev-orchestra (a star is always appreciated)
関連記事 Related Posts
dev-orchestra のレビュアーとロールを組み替えてみた Rearranging dev-orchestra's Reviewers and Roles
dev-orchestra の役(ロール)ごとのモデルの指定方法、レビュアーの観点の選び方、分野の専門役を提案させる config suggest-roles を紹介します。わざとバグを仕込んだ変更を 9 人のレビュアーに見せて、人数を増やすと何が変わるかも測ってみました。 How to set the model for each role in dev-orchestra, how to choose reviewer focuses, and config suggest-roles, which proposes domain specialists. I also showed a change with deliberately planted bugs to 9 reviewers to see what changes as you add more of them.
dev-orchestra のプリセット quality / standard / fast を比べてみた Comparing dev-orchestra's quality / standard / fast presets
dev-orchestra の初期設定で選ぶプリセット quality / standard / fast を、Claude Code だけ・Codex だけ・両方の 3 つの環境で実際に展開して比べました。役ごとのモデル、レビュアーの人数、コストを削る度合いがどう変わるか、どれを選べばいいかをまとめます。 I expanded dev-orchestra's setup presets quality / standard / fast in three environments (Claude Code only, Codex only, and both) and compared them. Here is how the per-role models, the number of reviewers, and how much cost is cut change, and which one to pick.
Codex に dev-orchestra を入れて使ってみた Using dev-orchestra with Codex
Codex にも dev-orchestra を入れてみました。Codex だけの環境でも動きますが、Claude Code と両方入れると、別々の会社の AI がレビューする推奨構成に自動でなります。Codex の場合だけの機能と注意点も最後にまとめました。 I installed dev-orchestra in Codex too. It works with Codex alone, but with both Claude Code and Codex installed, it automatically switches to the recommended setup where AIs from different companies review your code. I also summarized the Codex-specific features and caveats at the end.