agent-dotfiles
Claude Code、OpenAI Codex CLI、GitHub Copilot CLI、Gemini CLI、Oracle CLI の設定ファイルと AI Agent 向け skill を Git リポジトリで管理するための個人運用ツール。 秘匿情報とホームディレクトリ依存を取り除いた repo view を作り、別マシンへ必要な設定だけを戻せるようにする。
このページの原本は
TomoakiMizuno/agent-dotfiles
の README、AGENTS.md、docs 配下の設計メモです。内容が古くなった場合は元リポジトリを読み直して
content/agent-dotfiles/index.html を再生成します。
関連ページ
新規 gate の段階導入
report_only で計測してから required へ昇格する条件を定義する。扱う設定
~/.claude/skills/ と ~/.agents/skills/ の両方を見て、mtime が新しい側を採用する。review-orchestrator が issue gate、multi-review、Claude reviewer transport、Copilot bot gate、thread close を担当する。git worktreeinclude apply --from auto --quiet を適用する wrapper を配布する。基本のデータフロー
flowchart LR
home["Home directories
~/.claude / ~/.codex / ~/.copilot / ~/.gemini / ~/.oracle"]
export["agent-dotfiles export"]
repo["agent-dotfiles repo
sanitized repo view"]
review["review-orchestrator
issue / PR review gates"]
import["agent-dotfiles import"]
target["Target machine
restored local settings"]
home --> export --> repo
repo --> review
repo --> import --> target
target --> home
サニタイズと復元
export では設定ファイルを service ごとの構造に合わせて読み、秘匿値とホームディレクトリ依存を repo に置ける形へ正規化する。 import では既存のローカル設定を preseed し、管理対象だけを上書きする。これにより認証情報、履歴、cache、runtime state は保持される。
変換ルール
- 環境変数名に
TOKEN、SECRET、PASSWORD、CREDENTIAL、_KEYを含む値はプレースホルダ化する。 - コマンド、引数、環境変数内のホームディレクトリパスは
{{HOME}}に置き換える。 - Claude の
mcpServers、Codex の TOML、Copilot / Gemini の JSON、Oracle の JSON5 は構造を保ったまま処理する。 - 履歴、セッション、cache、認証 token、runtime DB は管理対象から外す。
主要コマンド
git clone https://github.com/TomoakiMizuno/agent-dotfiles.git
cd agent-dotfiles
make install
agent-dotfiles status
agent-dotfiles diff
agent-dotfiles export --target codex/config.toml
agent-dotfiles import --target claude/skills/multi-review
新規環境では、先に dotfiles 側で secret substrate と PATH を整える。agent-dotfiles は AI Agent 固有の構造化設定と 同期ロジックを扱い、shell や OS の基本セットアップは dotfiles 側の責務として分ける。
通常 docs
CLI の使い方、同期仕様、review 運用の詳細は docs-site 内の通常 docs index から読む。 skill reference は別 scope で移植するため、このページでは通常 Markdown docs への導線だけを扱う。
target 指定
export、import、status、diff は repo display path を基準に
--target で対象を絞れる。service root、管理対象ファイル、管理対象ディレクトリだけを許可し、
対象外のファイルや runtime state を巻き込まない。
claude、codex、copilot、gemini、oracleの service target。codex/config.toml、gemini/settings.json、oracle/config.jsonのような file target。claude/skills/<skill>、claude/agents、codex/hooksのような directory target。codex/memoriesは PC 移行や明示 backup 用の opt-in target として扱う。
実装 workflow の既定
github-issue-breakdown から実装へ進む場合は、PR mode、local / GitHub reviewer、review loop、E2E、worktree の指定を artifact と resume command に保持する。review-orchestrator の役割
review-orchestrator は review 系 skill の実行本体で、Issue 作業開始前の claim gate、
checkpoint 付き implementation gate、multi-review、Copilot bot review 待機、inline thread close、adversarial review prompt の生成を担う。
外側の AI Agent は自然言語の判断だけで完了扱いにせず、stdout JSON、evidence manifest、report を根拠に次の action を決める。
fix-github-issue と implement-from-plan は PR 前 simplify 後、review、push、PR 作成の前に fix-code-comments を実行する。完了可否は stateless な completion-check を標準入口とし、必要な mode、commit、validation、simplify、review、CI、E2E の canonical artifact を現在の repository / HEAD / PR と照合する。completion-check は fix-code-comments の run record も照合して comment-check-observation.v1 を report-only で保存する。
手元検証は pr-publication run-validation で transcript 化し、sanitizer 適用済みの public artifact を PR 本文から参照する。
host profile の companion PR を遅延生成する場合は、pending event を追記し、元 PR の merge 後に host-profile-pending batch で未処理分を 1 本へまとめる。予約済み event 集合から同じ batch を復元するため、中断後の再実行でも重複 PR を作らない。
stacked な sibling 実装や明示 auto stack では、publication intent と凍結順を repo-scoped state に保存する。publication gate と closing Issue gate は required で動き、coordinator が lease と effective tail を確定して finalization を再開する。親 Issue の表が変わった場合は未公開 intent の相対順を再確認し、並び替えや row 消失を検知すると publication_order_stale で branch 変更前に停止する。false stop や順序違反などが観測された場合だけ report-only へ戻す。
design doc を公開した Issue 作成 flow は repo-scoped binding record を保存し、published family の completion で Issue との紐付け evidence を確認する。
Claude reviewer の transport は CLI 明示値、host-local な agent-runtime.json、default headless の順で決まる。
transport failure 時は別 transport へ黙って fallback せず、stderr summary、artifact path、次 action を evidence に残す。
review-orchestrator agent-runtime doctor --format json は review 系 workflow から Codex CLI reviewer を呼ぶための最小 allow rule coverage を検査し、不足 rule を JSON で報告する。host-local file は編集しない。
非管理データ
agent-dotfiles は CLI 設定の同期ツールであり、各 Agent が実行時に作る履歴や cache を repo に集めない。 Claude の projects、Codex の sessions、Copilot の trusted folders、Gemini の認証・履歴などは環境固有の状態として保持される。
運用境界
agent-dotfiles は管理者個人の private repo として運用される。公開配布や他ユーザー互換より、 現在の管理者環境で安全に同期できることを優先する。