feat(agent-discipline): 分業規律を fable/opus/その他の 3-way 配送にし Opus 5 版を新設 - #333
Merged
Conversation
spec-first 2 段階の Phase A。Opus 5 公式ガイド (prompting-claude-opus-5) の固有挙動 (指示なしの自己検証、サブエージェント委任への強い傾向、過剰検証によるトークン浪費) に 合わせた discipline-opus.md 新設と inject-discipline.sh の 3-way 化を red テストで固定する: - 静的契約: discipline-opus.md の存在と rule ID セットの 3 ファイル完全一致、 限定式 verifier / 委任粒度抑制 / 汎用再確認指示禁止の canonical 文言、 fable / sonnet 版への Opus 5 過剰検証注意の追記、lint-prompt-sync.sh と workflow paths の discipline-opus.md 参照、配送サイズ予算 (8,000 UTF-16 units) - 挙動契約: inject-discipline.sh を隔離 TMPDIR で直接実行し、fable / opus / sonnet / pending (self-gate) / sonnet-gate からの opus one-shot 補正 / 同 sonnet 確定の 6 経路のマーカー遷移と配送内容を検証 (現行挙動 4 経路は特性化として green、 opus 2 経路は Phase B まで red) 配送スクリプト群には従来テストが存在しなかったため、本テストが初のリグレッション網となる。 Generated with [Claude Code](https://claude.com/claude-code)
…回帰・補正文言の意味検証・trigger 別 workflow 検証・否定契約・配送本文サイズ) Generated with [Claude Code](https://claude.com/claude-code)
spec-first 2 段階の Phase B (実装本体)。Opus 5 公式ガイド (prompting-claude-opus-5) の 固有挙動 — 指示なしの自己検証・自己修正、サブエージェント委任への強い傾向、過剰検証による トークン浪費 — に合わせ、Opus 系メインセッション向けの分業規律を分離する: - hooks/prompts/discipline-opus.md を新設: verifier 委任を限定式 (大規模独立トラック・ リスク根拠あり・設計境界の独立確認) に変更、委任粒度の抑制 (数回の tool call で終わる 作業は直接実行、spawn 数を低く保つ)、rule ID セットは fable / sonnet 版と完全一致 - discipline-fable.md / discipline-sonnet.md に「Opus 5 への委任では汎用的な再確認指示を 加えない」注意を追記 (タスク固有の受入条件検証と終了時自己点検は維持) - inject-discipline.sh を 3-way 化: fable 判定最優先を維持しつつ opus 分岐を追加。 判定不能時の self-gate 暫定配送 (Sonnet 版) から opus 確定時の one-shot 補正 (先行 Sonnet 版の破棄を明示) を fable 補正と同型で実装 - discipline-preamble-self-gate.md / hooks.json description / README を 3-way へ同期 - lint-prompt-sync.sh チェック 4 を 3 ファイル総当たり完全一致に拡張、workflow paths に discipline-opus.md を追加 - 配送サイズ予算 (8,000 UTF-16 units) を実際の配送本文 (Opus 直接 / Opus 補正 / self-gate+Sonnet) で契約テスト化 - version bump: agent-discipline 0.20.0 -> 0.21.0 (hooks/prompts は共有 path のため Claude Code / Codex 両 runtime)。sourceTreeDigest を再監査のうえ refresh Generated with [Claude Code](https://claude.com/claude-code)
…rride 見積り文言の是正 - discipline-preamble-self-gate.md: 「非 Fable はそのまま適用」の分岐を「非 Fable かつ非 Opus」に限定し、Opus セッションが暫定扱いと二重マッチしないようにする - discipline-opus.md / discipline-sonnet.md: CLAUDE_CODE_SUBAGENT_MODEL 設定時の品質・コスト見積りを「env の実効モデルで走る前提 (メインセッションと同一とは限らない)」に是正 (直前の優先順位説明との矛盾を解消) - sourceTreeDigest を再監査のうえ refresh Generated with [Claude Code](https://claude.com/claude-code)
This was referenced Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Claude Opus 5 の公式プロンプトガイド (prompting-claude-opus-5) の固有挙動 — 指示なしの自己検証・自己修正、サブエージェント委任への強い傾向、過剰検証によるトークン浪費 — に合わせ、agent-discipline の分業規律を fable / opus / その他非 Fable の 3-way 配送に拡張し、Opus 系メインセッション向けの分業規律
discipline-opus.mdを新設する。Refs #332 (同じ Claude 5 世代対応の PR1: subagent model 契約の明示化)
変更内容
hooks/prompts/discipline-opus.md新設: Sonnet 版を基本形に、Opus 5 固有の差分のみ変更inject-discipline.shの 3-way 化: fable 判定最優先を維持しつつ opus 分岐を追加。判定不能時は従来どおり self-gate 付き Sonnet 版を暫定配送し、opus 確定時に fable 補正と同型の one-shot 補正 (先行 Sonnet 版の破棄を明示) を配送設計判断 (ユーザ確認済み)
レビュー経過と残課題
pre-push 3 レビュー (code / security / codex) を各コミット段階で実施。codex review 指摘のうち self-gate 分岐の重複と env override 見積り文言の矛盾は修正済み。5 サイクル時点で cadence 規律に基づく根本方針 checkpoint (advisor 相談) を実施し、「局所修正の継続が妥当 + 受入基準に影響しない新規 may-defer は記録に回す」方針を採用した。
残課題 (may-defer 判定で記録):
spec-first 運用上の注記
Phase A (契約テスト) は commit d89052e でレビュー済み。その後の checkpoint 指示によるテスト増補 (85fb224) と Phase B (315adb0, 3c4c5c2) を同一ブランチで実施し、最終差分に対して 3 レビューを再走してから push した (Phase A 単独 push の draft PR 工程は、増補による差分変化とレビュー再走コストを踏まえて最終差分レビューに統合)。
🤖 Generated with Claude Code